From 4bd61487061d86c9410ac3879b1a11c2c1f64427 Mon Sep 17 00:00:00 2001 From: Albert Silva Date: Wed, 22 Jun 2022 17:45:30 -0400 Subject: [PATCH 001/763] add data source for aws_servicecatalog_provisioning_artifacts --- internal/provider/provider.go | 11 +- .../provisioning_artifacts_data_source.go | 147 ++++++++++++++++++ 2 files changed, 153 insertions(+), 5 deletions(-) create mode 100644 internal/service/servicecatalog/provisioning_artifacts_data_source.go diff --git a/internal/provider/provider.go b/internal/provider/provider.go index 07f6e19c20e6..74df6d2caeda 100644 --- a/internal/provider/provider.go +++ b/internal/provider/provider.go @@ -845,11 +845,12 @@ func Provider() *schema.Provider { "aws_serverlessapplicationrepository_application": serverlessrepo.DataSourceApplication(), - "aws_servicecatalog_constraint": servicecatalog.DataSourceConstraint(), - "aws_servicecatalog_launch_paths": servicecatalog.DataSourceLaunchPaths(), - "aws_servicecatalog_portfolio_constraints": servicecatalog.DataSourcePortfolioConstraints(), - "aws_servicecatalog_portfolio": servicecatalog.DataSourcePortfolio(), - "aws_servicecatalog_product": servicecatalog.DataSourceProduct(), + "aws_servicecatalog_constraint": servicecatalog.DataSourceConstraint(), + "aws_servicecatalog_launch_paths": servicecatalog.DataSourceLaunchPaths(), + "aws_servicecatalog_portfolio_constraints": servicecatalog.DataSourcePortfolioConstraints(), + "aws_servicecatalog_portfolio": servicecatalog.DataSourcePortfolio(), + "aws_servicecatalog_product": servicecatalog.DataSourceProduct(), + "aws_servicecatalog_provisioning_artifacts": servicecatalog.DataSourceProvisioningArtifacts(), "aws_service_discovery_dns_namespace": servicediscovery.DataSourceDNSNamespace(), diff --git a/internal/service/servicecatalog/provisioning_artifacts_data_source.go b/internal/service/servicecatalog/provisioning_artifacts_data_source.go new file mode 100644 index 000000000000..b558e609b960 --- /dev/null +++ b/internal/service/servicecatalog/provisioning_artifacts_data_source.go @@ -0,0 +1,147 @@ +package servicecatalog + +import ( + "fmt" + + "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/service/servicecatalog" + "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" +) + +func DataSourceProvisioningArtifacts() *schema.Resource { + return &schema.Resource{ + Read: dataSourceProvisioningArtifactsRead, + + Timeouts: &schema.ResourceTimeout{ + Read: schema.DefaultTimeout(ConstraintReadTimeout), + }, + + Schema: map[string]*schema.Schema{ + "product_id": { + Type: schema.TypeString, + Required: true, + }, + "provisioning_artifact_details": { + Type: schema.TypeList, + Computed: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "accept_language": { + Type: schema.TypeString, + Optional: true, + Default: AcceptLanguageEnglish, + ValidateFunc: validation.StringInSlice(AcceptLanguage_Values(), false), + }, + "active": { + Type: schema.TypeBool, + Computed: true, + }, + "created_time": { + Type: schema.TypeString, + Computed: true, + }, + "description": { + Type: schema.TypeString, + Computed: true, + }, + "guidance": { + Type: schema.TypeString, + Computed: true, + }, + "id": { + Type: schema.TypeString, + Computed: true, + }, + "name": { + Type: schema.TypeString, + Computed: true, + }, + "type": { + Type: schema.TypeString, + Computed: true, + }, + }, + }, + }, + }, + } +} + +func dataSourceProvisioningArtifactsRead(d *schema.ResourceData, meta interface{}) error { + conn := meta.(*conns.AWSClient).ServiceCatalogConn + product_id := aws.String(d.Get("product_id").(string)) + + input := &servicecatalog.ListProvisioningArtifactsInput{ + ProductId: product_id, + } + + output, err := conn.ListProvisioningArtifacts(input) + + if err != nil { + return fmt.Errorf("error describing Service Catalog Constraint: %w", err) + } + if output == nil { + return fmt.Errorf("no provisioning artifacts found matching criteria; try different search") + } + if err := d.Set("provisioning_artifact_details", flattenProvisioningArtifactDetails(output.ProvisioningArtifactDetails)); err != nil { + return fmt.Errorf("error setting provisioning artifact details: %w", err) + } + + d.SetId(aws.StringValue(output.ProvisioningArtifactDetails[0].Id)) + d.SetId(d.Get("product_id").(string)) + + return nil +} + +func flattenProvisioningArtifactDetails(apiObjects []*servicecatalog.ProvisioningArtifactDetail) []interface{} { + + if len(apiObjects) == 0 { + return nil + } + + var tfList []interface{} + + for _, apiObject := range apiObjects { + if apiObject == nil { + continue + } + + tfList = append(tfList, flattenProvisioningArtifactDetail(apiObject)) + } + + return tfList +} + +func flattenProvisioningArtifactDetail(apiObject *servicecatalog.ProvisioningArtifactDetail) map[string]interface{} { + if apiObject == nil { + return nil + } + + tfMap := map[string]interface{}{} + + if apiObject.Active != nil { + tfMap["active"] = aws.BoolValue(apiObject.Active) + } + if apiObject.CreatedTime != nil { + tfMap["created_time"] = aws.TimeValue(apiObject.CreatedTime).String() + } + if apiObject.Description != nil { + tfMap["description"] = aws.StringValue(apiObject.Description) + } + if apiObject.Guidance != nil { + tfMap["guidance"] = aws.StringValue(apiObject.Guidance) + } + if apiObject.Id != nil { + tfMap["id"] = aws.StringValue(apiObject.Id) + } + if apiObject.Name != nil { + tfMap["name"] = aws.StringValue(apiObject.Name) + } + if apiObject.Type != nil { + tfMap["type"] = aws.StringValue(apiObject.Type) + } + + return tfMap +} From 5de5ddd9ec381494f93f81130665caa696799b91 Mon Sep 17 00:00:00 2001 From: Albert Silva Date: Wed, 22 Jun 2022 17:49:14 -0400 Subject: [PATCH 002/763] add changelog --- .changelog/25535.txt | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 .changelog/25535.txt diff --git a/.changelog/25535.txt b/.changelog/25535.txt new file mode 100644 index 000000000000..714365821acd --- /dev/null +++ b/.changelog/25535.txt @@ -0,0 +1,3 @@ +```release-note:new-data-source +aws_servicecatalog_provisioning_artifacts +``` \ No newline at end of file From b0e25a949ba6aab599dd144a5b723aabebbd289e Mon Sep 17 00:00:00 2001 From: Albert Silva Date: Wed, 22 Jun 2022 17:52:58 -0400 Subject: [PATCH 003/763] added accept_language to read --- .../provisioning_artifacts_data_source.go | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/internal/service/servicecatalog/provisioning_artifacts_data_source.go b/internal/service/servicecatalog/provisioning_artifacts_data_source.go index b558e609b960..dc0d4735b923 100644 --- a/internal/service/servicecatalog/provisioning_artifacts_data_source.go +++ b/internal/service/servicecatalog/provisioning_artifacts_data_source.go @@ -23,17 +23,17 @@ func DataSourceProvisioningArtifacts() *schema.Resource { Type: schema.TypeString, Required: true, }, + "accept_language": { + Type: schema.TypeString, + Default: AcceptLanguageEnglish, + Optional: true, + ValidateFunc: validation.StringInSlice(AcceptLanguage_Values(), false), + }, "provisioning_artifact_details": { Type: schema.TypeList, Computed: true, Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "accept_language": { - Type: schema.TypeString, - Optional: true, - Default: AcceptLanguageEnglish, - ValidateFunc: validation.StringInSlice(AcceptLanguage_Values(), false), - }, "active": { Type: schema.TypeBool, Computed: true, @@ -71,10 +71,10 @@ func DataSourceProvisioningArtifacts() *schema.Resource { func dataSourceProvisioningArtifactsRead(d *schema.ResourceData, meta interface{}) error { conn := meta.(*conns.AWSClient).ServiceCatalogConn - product_id := aws.String(d.Get("product_id").(string)) input := &servicecatalog.ListProvisioningArtifactsInput{ - ProductId: product_id, + ProductId: aws.String(d.Get("product_id").(string)), + AcceptLanguage: aws.String(d.Get("accept_language").(string)), } output, err := conn.ListProvisioningArtifacts(input) From 5ed070d6a8e8bacedad71cef015cc77b7bcfcc7f Mon Sep 17 00:00:00 2001 From: Albert Silva Date: Wed, 22 Jun 2022 17:58:45 -0400 Subject: [PATCH 004/763] added accept_language to read --- .../servicecatalog/provisioning_artifacts_data_source.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/service/servicecatalog/provisioning_artifacts_data_source.go b/internal/service/servicecatalog/provisioning_artifacts_data_source.go index dc0d4735b923..e253610cff3e 100644 --- a/internal/service/servicecatalog/provisioning_artifacts_data_source.go +++ b/internal/service/servicecatalog/provisioning_artifacts_data_source.go @@ -80,7 +80,7 @@ func dataSourceProvisioningArtifactsRead(d *schema.ResourceData, meta interface{ output, err := conn.ListProvisioningArtifacts(input) if err != nil { - return fmt.Errorf("error describing Service Catalog Constraint: %w", err) + return fmt.Errorf("error describing provisioning artifact: %w", err) } if output == nil { return fmt.Errorf("no provisioning artifacts found matching criteria; try different search") @@ -89,8 +89,8 @@ func dataSourceProvisioningArtifactsRead(d *schema.ResourceData, meta interface{ return fmt.Errorf("error setting provisioning artifact details: %w", err) } - d.SetId(aws.StringValue(output.ProvisioningArtifactDetails[0].Id)) d.SetId(d.Get("product_id").(string)) + d.Set("accept_language", d.Get("accept_language").(string)) return nil } From 2b25b758f938f8d211fd4f3aa19c9a074a26e77a Mon Sep 17 00:00:00 2001 From: Albert Silva Date: Wed, 22 Jun 2022 17:59:19 -0400 Subject: [PATCH 005/763] formatting --- .../servicecatalog/provisioning_artifacts_data_source.go | 2 -- 1 file changed, 2 deletions(-) diff --git a/internal/service/servicecatalog/provisioning_artifacts_data_source.go b/internal/service/servicecatalog/provisioning_artifacts_data_source.go index e253610cff3e..4ec45c7f42e2 100644 --- a/internal/service/servicecatalog/provisioning_artifacts_data_source.go +++ b/internal/service/servicecatalog/provisioning_artifacts_data_source.go @@ -96,7 +96,6 @@ func dataSourceProvisioningArtifactsRead(d *schema.ResourceData, meta interface{ } func flattenProvisioningArtifactDetails(apiObjects []*servicecatalog.ProvisioningArtifactDetail) []interface{} { - if len(apiObjects) == 0 { return nil } @@ -107,7 +106,6 @@ func flattenProvisioningArtifactDetails(apiObjects []*servicecatalog.Provisionin if apiObject == nil { continue } - tfList = append(tfList, flattenProvisioningArtifactDetail(apiObject)) } From f5bd9dfceb5e6a08c3dae76c37e0b9299884df74 Mon Sep 17 00:00:00 2001 From: Albert Silva Date: Wed, 22 Jun 2022 18:11:48 -0400 Subject: [PATCH 006/763] added documentation --- ...talog_provisioning_artifacts.html.markdown | 47 +++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 website/docs/d/servicecatalog_provisioning_artifacts.html.markdown diff --git a/website/docs/d/servicecatalog_provisioning_artifacts.html.markdown b/website/docs/d/servicecatalog_provisioning_artifacts.html.markdown new file mode 100644 index 000000000000..78e9d42c3f6e --- /dev/null +++ b/website/docs/d/servicecatalog_provisioning_artifacts.html.markdown @@ -0,0 +1,47 @@ +--- +subcategory: "Service Catalog" +layout: "aws" +page_title: "AWS: aws_servicecatalog_provisioning_artifacts" +description: |- + Provides information on Service Catalog Provisioning Artifacts +--- + +# Data Source: aws_servicecatalog_provisioning_artifacts + +Lists the provisioning artifacts for the specified product. + +## Example Usage + +### Basic Usage + +```terraform +data "aws_servicecatalog_provisioning_artifacts" "example" { + product_id = "prod-yakog5pdriver" +} +``` + +## Argument Reference + +The following arguments are required: + +* `product_id` - (Required) Product identifier. + +The following arguments are optional: + +* `accept_language` - (Optional) Language code. Valid values: `en` (English), `jp` (Japanese), `zh` (Chinese). Default value is `en`. + +## Attributes Reference + +In addition to all arguments above, the following attributes are exported: + +* `provisioning_artifact_details` - List with information about the provisioning artifacts. See details below. + +### provisioning_artifact_details + +* `active` - Indicates whether the product version is active. +* `created_time` - The UTC time stamp of the creation time. +* `description` - The description of the provisioning artifact. +* `guidance` - Information set by the administrator to provide guidance to end users about which provisioning artifacts to use. +* `id` - The identifier of the provisioning artifact. +* `name` - The name of the provisioning artifact. +* `type` - The type of provisioning artifact. From 26fed6d46f7be22e3dd26d39e31f8ea66c0e8783 Mon Sep 17 00:00:00 2001 From: Albert Silva Date: Wed, 22 Jun 2022 19:11:56 -0400 Subject: [PATCH 007/763] add tests --- ...provisioning_artifacts_data_source_test.go | 124 ++++++++++++++++++ 1 file changed, 124 insertions(+) create mode 100644 internal/service/servicecatalog/provisioning_artifacts_data_source_test.go diff --git a/internal/service/servicecatalog/provisioning_artifacts_data_source_test.go b/internal/service/servicecatalog/provisioning_artifacts_data_source_test.go new file mode 100644 index 000000000000..2d09ccdd3ce4 --- /dev/null +++ b/internal/service/servicecatalog/provisioning_artifacts_data_source_test.go @@ -0,0 +1,124 @@ +package servicecatalog_test + +import ( + "fmt" + "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-provider-aws/internal/acctest" + tfservicecatalog "github.com/hashicorp/terraform-provider-aws/internal/service/servicecatalog" +) + +func TestAccServiceCatalogProvisioningArtifactsDataSource_basic(t *testing.T) { + dataSourceName := "data.aws_servicecatalog_provisioning_artifacts.test" + rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) + + domain := fmt.Sprintf("http://%s", acctest.RandomDomainName()) + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { acctest.PreCheck(t) }, + ErrorCheck: acctest.ErrorCheck(t, servicecatalog.EndpointsID), + ProviderFactories: acctest.ProviderFactories, + CheckDestroy: testAccCheckProvisioningArtifactDestroy, + Steps: []resource.TestStep{ + { + Config: testAccProvisioningArtifactsDataSourceConfig_basic(rName, domain), + Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttr(dataSourceName, "accept_language", tfservicecatalog.AcceptLanguageEnglish), + resource.TestCheckResourceAttr(dataSourceName, "provisioning_artifact_details.0.active", "true"), + resource.TestCheckResourceAttrSet(dataSourceName, "provisioning_artifact_details.0.description"), + resource.TestCheckResourceAttr(dataSourceName, "provisioning_artifact_details.0.guidance", servicecatalog.ProvisioningArtifactGuidanceDefault), + resource.TestCheckResourceAttr(dataSourceName, "provisioning_artifact_details.0.name", rName), + resource.TestCheckResourceAttrPair(dataSourceName, "product_id", "aws_servicecatalog_product.test", "id"), + resource.TestCheckResourceAttr(dataSourceName, "provisioning_artifact_details.0.type", servicecatalog.ProductTypeCloudFormationTemplate), + ), + }, + }, + }) +} + +func testAccProvisioningArtifactsDataSourceBaseConfig(rName, domain string) string { + return fmt.Sprintf(` +resource "aws_s3_bucket" "test" { + bucket = %[1]q + 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" + + content = jsonencode({ + AWSTemplateFormatVersion = "2010-09-09" + + Resources = { + MyVPC = { + Type = "AWS::EC2::VPC" + Properties = { + CidrBlock = "10.1.0.0/16" + } + } + } + + Outputs = { + VpcID = { + Description = "VPC ID" + Value = { + Ref = "MyVPC" + } + } + } + }) +} + +resource "aws_servicecatalog_product" "test" { + description = %[1]q + distributor = "distributör" + name = %[1]q + owner = "ägare" + type = "CLOUD_FORMATION_TEMPLATE" + support_description = %[1]q + support_email = %[3]q + support_url = %[2]q + + provisioning_artifact_parameters { + description = "artefaktbeskrivning" + disable_template_validation = true + name = %[1]q + template_url = "https://${aws_s3_bucket.test.bucket_regional_domain_name}/${aws_s3_object.test.key}" + type = "CLOUD_FORMATION_TEMPLATE" + } + + tags = { + Name = %[1]q + } +} +resource "aws_servicecatalog_provisioning_artifact" "test" { + accept_language = "en" + active = true + description = %[1]q + disable_template_validation = true + guidance = "DEFAULT" + name = "%[1]s-2" + product_id = aws_servicecatalog_product.test.id + template_url = "https://${aws_s3_bucket.test.bucket_regional_domain_name}/${aws_s3_object.test.key}" + type = "CLOUD_FORMATION_TEMPLATE" +} +`, rName, domain, acctest.DefaultEmailAddress) +} + +func testAccProvisioningArtifactsDataSourceConfig_basic(rName, domain string) string { + return acctest.ConfigCompose(testAccProvisioningArtifactsDataSourceBaseConfig(rName, domain), fmt.Sprint(` +data "aws_servicecatalog_provisioning_artifacts" "test" { + accept_language = "en" + product_id = aws_servicecatalog_product.test.id +} +`)) +} From 7d36b894c25e517e3e39c0c6485ba86ae8de6ce8 Mon Sep 17 00:00:00 2001 From: Albert Silva Date: Wed, 22 Jun 2022 20:07:26 -0400 Subject: [PATCH 008/763] fix lint errors --- .../servicecatalog/provisioning_artifacts_data_source_test.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/service/servicecatalog/provisioning_artifacts_data_source_test.go b/internal/service/servicecatalog/provisioning_artifacts_data_source_test.go index 2d09ccdd3ce4..78ca5860889c 100644 --- a/internal/service/servicecatalog/provisioning_artifacts_data_source_test.go +++ b/internal/service/servicecatalog/provisioning_artifacts_data_source_test.go @@ -115,10 +115,10 @@ resource "aws_servicecatalog_provisioning_artifact" "test" { } func testAccProvisioningArtifactsDataSourceConfig_basic(rName, domain string) string { - return acctest.ConfigCompose(testAccProvisioningArtifactsDataSourceBaseConfig(rName, domain), fmt.Sprint(` + return acctest.ConfigCompose(testAccProvisioningArtifactsDataSourceBaseConfig(rName, domain), ` data "aws_servicecatalog_provisioning_artifacts" "test" { accept_language = "en" product_id = aws_servicecatalog_product.test.id } -`)) +`) } From 3c84850f4a6d4db45502f21781d8d1ec70f46bbb Mon Sep 17 00:00:00 2001 From: Albert Silva Date: Wed, 22 Jun 2022 20:56:50 -0400 Subject: [PATCH 009/763] removed destroy validation from test --- .../servicecatalog/provisioning_artifacts_data_source_test.go | 1 - 1 file changed, 1 deletion(-) diff --git a/internal/service/servicecatalog/provisioning_artifacts_data_source_test.go b/internal/service/servicecatalog/provisioning_artifacts_data_source_test.go index 78ca5860889c..45d39261c0f6 100644 --- a/internal/service/servicecatalog/provisioning_artifacts_data_source_test.go +++ b/internal/service/servicecatalog/provisioning_artifacts_data_source_test.go @@ -21,7 +21,6 @@ func TestAccServiceCatalogProvisioningArtifactsDataSource_basic(t *testing.T) { PreCheck: func() { acctest.PreCheck(t) }, ErrorCheck: acctest.ErrorCheck(t, servicecatalog.EndpointsID), ProviderFactories: acctest.ProviderFactories, - CheckDestroy: testAccCheckProvisioningArtifactDestroy, Steps: []resource.TestStep{ { Config: testAccProvisioningArtifactsDataSourceConfig_basic(rName, domain), From 4b6e03c7e0b90ece953dd5405d6e31ba9ad22180 Mon Sep 17 00:00:00 2001 From: Byungjin Park Date: Tue, 16 Aug 2022 01:39:37 +0900 Subject: [PATCH 010/763] Disable `ForceNew` flag for `enable_resource_name_dns_*` on aws_instance resource --- internal/service/ec2/ec2_instance.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/service/ec2/ec2_instance.go b/internal/service/ec2/ec2_instance.go index e6e3524aac40..b9de2c31d1af 100644 --- a/internal/service/ec2/ec2_instance.go +++ b/internal/service/ec2/ec2_instance.go @@ -519,13 +519,13 @@ func ResourceInstance() *schema.Resource { Type: schema.TypeBool, Optional: true, Computed: true, - ForceNew: true, + ForceNew: false, }, "enable_resource_name_dns_a_record": { Type: schema.TypeBool, Optional: true, Computed: true, - ForceNew: true, + ForceNew: false, }, "hostname_type": { Type: schema.TypeString, From eec34886ab310e87c537174a3385a724e0f10a56 Mon Sep 17 00:00:00 2001 From: Dennis Pattmann Date: Sat, 10 Sep 2022 00:15:48 +0200 Subject: [PATCH 011/763] Adds missing anonymous_auth_enabled parameter to aws_opensearch_domain data resource --- internal/service/opensearch/domain_data_source.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/internal/service/opensearch/domain_data_source.go b/internal/service/opensearch/domain_data_source.go index 4756f17a0403..dedda86bf8c9 100644 --- a/internal/service/opensearch/domain_data_source.go +++ b/internal/service/opensearch/domain_data_source.go @@ -31,6 +31,10 @@ func DataSourceDomain() *schema.Resource { Computed: true, Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ + "anonymous_auth_enabled": { + Type: schema.TypeBool, + Computed: true, + }, "enabled": { Type: schema.TypeBool, Computed: true, From d1c278af657e75b0b905ca09c475857c65f205b8 Mon Sep 17 00:00:00 2001 From: Dennis Pattmann Date: Sat, 10 Sep 2022 00:23:15 +0200 Subject: [PATCH 012/763] Adds changelog file for PR #26746 --- .changelog/26746.txt | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 .changelog/26746.txt diff --git a/.changelog/26746.txt b/.changelog/26746.txt new file mode 100644 index 000000000000..d9e0cc1dc79e --- /dev/null +++ b/.changelog/26746.txt @@ -0,0 +1,3 @@ +```release-note:bug +data/aws_opensearch_domain: Adds missing anonymous_auth_enabled parameter to aws_opensearch_domain data resource +``` \ No newline at end of file From adaae14c59175bd5c10051bb7f2e99c43a4bcdbf Mon Sep 17 00:00:00 2001 From: Dennis Pattmann Date: Mon, 12 Sep 2022 21:32:58 +0200 Subject: [PATCH 013/763] Fix test case --- internal/service/opensearch/domain_data_source_test.go | 1 - 1 file changed, 1 deletion(-) diff --git a/internal/service/opensearch/domain_data_source_test.go b/internal/service/opensearch/domain_data_source_test.go index 4cfbcc20133c..3d9983b2eead 100644 --- a/internal/service/opensearch/domain_data_source_test.go +++ b/internal/service/opensearch/domain_data_source_test.go @@ -46,7 +46,6 @@ func TestAccOpenSearchDomainDataSource_Data_basic(t *testing.T) { resource.TestCheckResourceAttrPair(datasourceName, "ebs_options.0.iops", resourceName, "ebs_options.0.iops"), resource.TestCheckResourceAttrPair(datasourceName, "snapshot_options.#", resourceName, "snapshot_options.#"), resource.TestCheckResourceAttrPair(datasourceName, "snapshot_options.0.automated_snapshot_start_hour", resourceName, "snapshot_options.0.automated_snapshot_start_hour"), - resource.TestCheckResourceAttrPair(datasourceName, "advanced_security_options.#", resourceName, "advanced_security_options.#"), ), }, }, From a53153cc700133b5562b79ed9055c4d5dd8ea069 Mon Sep 17 00:00:00 2001 From: Eugene Dementyev Date: Wed, 12 Oct 2022 23:05:53 +1300 Subject: [PATCH 014/763] Fix MaxItems for batch/compute_environments ec2_configuration There can be one or two configurations. --- internal/service/batch/compute_environment.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/service/batch/compute_environment.go b/internal/service/batch/compute_environment.go index 787562b387d8..341265852a41 100644 --- a/internal/service/batch/compute_environment.go +++ b/internal/service/batch/compute_environment.go @@ -87,7 +87,7 @@ func ResourceComputeEnvironment() *schema.Resource { Optional: true, Computed: true, ForceNew: true, - MaxItems: 1, + MaxItems: 2, Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ "image_id_override": { From 41699456d1d34ee0965b0d669f88e8c27cba5036 Mon Sep 17 00:00:00 2001 From: Ryan Dyer Date: Tue, 1 Nov 2022 17:29:21 -0500 Subject: [PATCH 015/763] AWS supports higher throughput ranges for select customers --- .changelog/27598.txt | 4 ++++ internal/service/elasticsearch/domain.go | 7 +++---- 2 files changed, 7 insertions(+), 4 deletions(-) create mode 100644 .changelog/27598.txt diff --git a/.changelog/27598.txt b/.changelog/27598.txt new file mode 100644 index 000000000000..4f89a0478fe9 --- /dev/null +++ b/.changelog/27598.txt @@ -0,0 +1,4 @@ +```release-note:bug +resource/aws_elasticsearch: Remove validation for EBS storage throughput as AWS has backend limits they can raise for select customers +``` + diff --git a/internal/service/elasticsearch/domain.go b/internal/service/elasticsearch/domain.go index 8c2b54915dfb..bed7260e0d34 100644 --- a/internal/service/elasticsearch/domain.go +++ b/internal/service/elasticsearch/domain.go @@ -386,10 +386,9 @@ func ResourceDomain() *schema.Resource { Optional: true, }, "throughput": { - Type: schema.TypeInt, - Optional: true, - Computed: true, - ValidateFunc: validation.IntBetween(125, 1000), + Type: schema.TypeInt, + Optional: true, + Computed: true, }, "volume_size": { Type: schema.TypeInt, From 0fbe6da7b4fd366498d2eb2f33b11f70411af83e Mon Sep 17 00:00:00 2001 From: Kristof Martens Date: Thu, 3 Nov 2022 12:58:28 +0100 Subject: [PATCH 016/763] Add the option to preservce the source data type for S3 output format config --- internal/service/appflow/flow.go | 16 ++++++++++++++++ website/docs/r/appflow_flow.html.markdown | 1 + 2 files changed, 17 insertions(+) diff --git a/internal/service/appflow/flow.go b/internal/service/appflow/flow.go index a5817b48d951..e79ea66cbf97 100644 --- a/internal/service/appflow/flow.go +++ b/internal/service/appflow/flow.go @@ -378,6 +378,10 @@ func ResourceFlow() *schema.Resource { }, }, }, + "preserve_source_data_typing": { + Type: schema.TypeBool, + Optional: true, + }, }, }, }, @@ -610,6 +614,10 @@ func ResourceFlow() *schema.Resource { }, }, }, + "preserve_source_data_typing": { + Type: schema.TypeBool, + Optional: true, + }, }, }, }, @@ -1720,6 +1728,10 @@ func expandS3OutputFormatConfig(tfMap map[string]interface{}) *appflow.S3OutputF a.PrefixConfig = expandPrefixConfig(v[0].(map[string]interface{})) } + if v, ok := tfMap["preserve_source_data_typing"].(bool); ok { + a.PreserveSourceDataTyping = aws.Bool(v) + } + return a } @@ -2824,6 +2836,10 @@ func flattenS3OutputFormatConfig(s3OutputFormatConfig *appflow.S3OutputFormatCon m["prefix_config"] = []interface{}{flattenPrefixConfig(v)} } + if v := s3OutputFormatConfig.PreserveSourceDataTyping; v != nil { + m["preserve_source_data_typing"] = aws.BoolValue(v) + } + return m } diff --git a/website/docs/r/appflow_flow.html.markdown b/website/docs/r/appflow_flow.html.markdown index 667f38ba8608..b5460a69d53d 100644 --- a/website/docs/r/appflow_flow.html.markdown +++ b/website/docs/r/appflow_flow.html.markdown @@ -202,6 +202,7 @@ EventBridge, Honeycode, and Marketo destination properties all support the follo * `aggregation_config` - (Optional) Aggregation settings that you can use to customize the output format of your flow data. See [Aggregation Config](#aggregation-config) for more details. * `file_type` - (Optional) File type that Amazon AppFlow places in the Amazon S3 bucket. Valid values are `CSV`, `JSON`, and `PARQUET`. * `prefix_config` - (Optional) Determines the prefix that Amazon AppFlow applies to the folder name in the Amazon S3 bucket. You can name folders according to the flow frequency and date. See [Prefix Config](#prefix-config) for more details. +* `preserve_source_data_typing` - (Optional, Boolean) Whether the data types from the source system need to be preserved (Only valid for `Parquet` file type) ##### Salesforce Destination Properties From 81f235c2ab7dc01d5edfce62c55f4b0ca55d535f Mon Sep 17 00:00:00 2001 From: Kristof Martens Date: Thu, 3 Nov 2022 13:31:53 +0100 Subject: [PATCH 017/763] Updating Changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 31324b17ac57..ffb568c73097 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -62,6 +62,7 @@ ENHANCEMENTS: * resource/aws_network_interface_attachment: Added import capabilities for the resource ([#27364](https://github.com/hashicorp/terraform-provider-aws/issues/27364)) * resource/aws_sesv2_dedicated_ip_pool: Add `scaling_mode` attribute ([#27388](https://github.com/hashicorp/terraform-provider-aws/issues/27388)) * resource/aws_ssm_parameter: Support `aws:ssm:integration` as a valid value for `data_type` ([#27329](https://github.com/hashicorp/terraform-provider-aws/issues/27329)) +* resource/aws_appflow_flow: Add support for preserving source data types in the S3 output config ([#26372](https://github.com/hashicorp/terraform-provider-aws/issues/26372)) BUG FIXES: From 60f8fe2cf157a6a291c2a6429c8b2cebcd0ecce6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lars=20Tobias=20Skjong-B=C3=B8rsting?= Date: Mon, 14 Nov 2022 13:14:23 +0100 Subject: [PATCH 018/763] Add cloudfront_distribution_zone_id parameter to aws_cognito_user_pool_domain --- .../service/cognitoidp/user_pool_domain.go | 23 +++++++++++++++++++ .../cognitoidp/user_pool_domain_test.go | 1 + .../docs/r/cognito_user_pool_domain.markdown | 5 ++-- 3 files changed, 26 insertions(+), 3 deletions(-) diff --git a/internal/service/cognitoidp/user_pool_domain.go b/internal/service/cognitoidp/user_pool_domain.go index f9c71fdcdda3..1fe6850e8b76 100644 --- a/internal/service/cognitoidp/user_pool_domain.go +++ b/internal/service/cognitoidp/user_pool_domain.go @@ -7,6 +7,7 @@ import ( "time" "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/aws/endpoints" "github.com/aws/aws-sdk-go/service/cognitoidentityprovider" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" @@ -17,6 +18,15 @@ import ( "github.com/hashicorp/terraform-provider-aws/names" ) +// route53ZoneID defines the route 53 zone ID for CloudFront. This +// is used to set the zone_id attribute. +const route53ZoneID = "Z2FDTNDATAQYW2" + +// cnRoute53ZoneID defines the route 53 zone ID for CloudFront in AWS CN. +// This is used to set the zone_id attribute. +// ref: https://docs.amazonaws.cn/en_us/aws/latest/userguide/route53.html +const cnRoute53ZoneID = "Z3RFFRIM2A3IF5" + func ResourceUserPoolDomain() *schema.Resource { return &schema.Resource{ Create: resourceUserPoolDomainCreate, @@ -52,6 +62,10 @@ func ResourceUserPoolDomain() *schema.Resource { Type: schema.TypeString, Computed: true, }, + "cloudfront_distribution_zone_id": { + Type: schema.TypeString, + Computed: true, + }, "s3_bucket": { Type: schema.TypeString, Computed: true, @@ -136,6 +150,15 @@ func resourceUserPoolDomainRead(d *schema.ResourceData, meta interface{}) error } d.Set("aws_account_id", desc.AWSAccountId) d.Set("cloudfront_distribution_arn", desc.CloudFrontDistribution) + + // override hosted_zone_id from flattenDistributionConfig + region := meta.(*conns.AWSClient).Region + if v, ok := endpoints.PartitionForRegion(endpoints.DefaultPartitions(), region); ok && v.ID() == endpoints.AwsCnPartitionID { + d.Set("cloudfront_distribution_zone_id", cnRoute53ZoneID) + } else { + d.Set("cloudfront_distribution_zone_id", route53ZoneID) + } + d.Set("s3_bucket", desc.S3Bucket) d.Set("user_pool_id", desc.UserPoolId) d.Set("version", desc.Version) diff --git a/internal/service/cognitoidp/user_pool_domain_test.go b/internal/service/cognitoidp/user_pool_domain_test.go index 5da97d4617c9..50db08474c91 100644 --- a/internal/service/cognitoidp/user_pool_domain_test.go +++ b/internal/service/cognitoidp/user_pool_domain_test.go @@ -35,6 +35,7 @@ func TestAccCognitoIDPUserPoolDomain_basic(t *testing.T) { resource.TestCheckResourceAttr("aws_cognito_user_pool.main", "name", poolName), resource.TestCheckResourceAttrSet("aws_cognito_user_pool_domain.main", "aws_account_id"), resource.TestCheckResourceAttrSet("aws_cognito_user_pool_domain.main", "cloudfront_distribution_arn"), + resource.TestCheckResourceAttr("aws_cognito_user_pool_domain.main", "cloudfront_distribution_zone_id", "Z2FDTNDATAQYW2"), resource.TestCheckResourceAttrSet("aws_cognito_user_pool_domain.main", "s3_bucket"), resource.TestCheckResourceAttrSet("aws_cognito_user_pool_domain.main", "version"), ), diff --git a/website/docs/r/cognito_user_pool_domain.markdown b/website/docs/r/cognito_user_pool_domain.markdown index da3149666050..5bdf0727190e 100644 --- a/website/docs/r/cognito_user_pool_domain.markdown +++ b/website/docs/r/cognito_user_pool_domain.markdown @@ -48,9 +48,8 @@ resource "aws_route53_record" "auth-cognito-A" { zone_id = data.aws_route53_zone.example.zone_id alias { evaluate_target_health = false - name = aws_cognito_user_pool_domain.main.cloudfront_distribution_arn - # This zone_id is fixed - zone_id = "Z2FDTNDATAQYW2" + name = aws_cognito_user_pool_domain.main.cloudfront_distribution_arn + zone_id = aws_cognito_user_pool_domain.main.cloudfront_distribution_zone_id } } ``` From e2cb013b15ff39e457b61dd910c0328f368e8ec7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lars=20Tobias=20Skjong-B=C3=B8rsting?= Date: Mon, 14 Nov 2022 14:13:24 +0100 Subject: [PATCH 019/763] Update CHANGELOG.md --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 28e29c9462d0..d43059855534 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -20,6 +20,7 @@ ENHANCEMENTS: * data-source/aws_identitystore_group: Add `alternate_identifier` argument and `description` attribute ([#27762](https://github.com/hashicorp/terraform-provider-aws/issues/27762)) * resource/aws_connect_instance: Add `multi_party_conference_enabled` argument ([#27734](https://github.com/hashicorp/terraform-provider-aws/issues/27734)) * resource/aws_msk_cluster: Add `storage_mode` argument ([#27546](https://github.com/hashicorp/terraform-provider-aws/issues/27546)) +resource/aws_cognito_user_pool_domain: Add `cloudfront_distribution_zone_id` attribute ([#27790](https://github.com/hashicorp/terraform-provider-aws/pull/27790)) ## 4.39.0 (November 10, 2022) From 7770c8b7c73b99b0e12238283d6746f3bf4806a4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lars=20Tobias=20Skjong-B=C3=B8rsting?= Date: Mon, 14 Nov 2022 14:14:08 +0100 Subject: [PATCH 020/763] Fix formatting --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d43059855534..95a3608cf91a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -20,7 +20,7 @@ ENHANCEMENTS: * data-source/aws_identitystore_group: Add `alternate_identifier` argument and `description` attribute ([#27762](https://github.com/hashicorp/terraform-provider-aws/issues/27762)) * resource/aws_connect_instance: Add `multi_party_conference_enabled` argument ([#27734](https://github.com/hashicorp/terraform-provider-aws/issues/27734)) * resource/aws_msk_cluster: Add `storage_mode` argument ([#27546](https://github.com/hashicorp/terraform-provider-aws/issues/27546)) -resource/aws_cognito_user_pool_domain: Add `cloudfront_distribution_zone_id` attribute ([#27790](https://github.com/hashicorp/terraform-provider-aws/pull/27790)) +* resource/aws_cognito_user_pool_domain: Add `cloudfront_distribution_zone_id` attribute ([#27790](https://github.com/hashicorp/terraform-provider-aws/pull/27790)) ## 4.39.0 (November 10, 2022) From e86eb6bc7163f61f35312f97418bc69b2644fe26 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lars=20Tobias=20Skjong-B=C3=B8rsting?= Date: Mon, 14 Nov 2022 14:16:10 +0100 Subject: [PATCH 021/763] Revert "Fix formatting" This reverts commit 7770c8b7c73b99b0e12238283d6746f3bf4806a4. --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 95a3608cf91a..d43059855534 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -20,7 +20,7 @@ ENHANCEMENTS: * data-source/aws_identitystore_group: Add `alternate_identifier` argument and `description` attribute ([#27762](https://github.com/hashicorp/terraform-provider-aws/issues/27762)) * resource/aws_connect_instance: Add `multi_party_conference_enabled` argument ([#27734](https://github.com/hashicorp/terraform-provider-aws/issues/27734)) * resource/aws_msk_cluster: Add `storage_mode` argument ([#27546](https://github.com/hashicorp/terraform-provider-aws/issues/27546)) -* resource/aws_cognito_user_pool_domain: Add `cloudfront_distribution_zone_id` attribute ([#27790](https://github.com/hashicorp/terraform-provider-aws/pull/27790)) +resource/aws_cognito_user_pool_domain: Add `cloudfront_distribution_zone_id` attribute ([#27790](https://github.com/hashicorp/terraform-provider-aws/pull/27790)) ## 4.39.0 (November 10, 2022) From 2b6ab2fb28027d243d2a577a67256c952e456d11 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lars=20Tobias=20Skjong-B=C3=B8rsting?= Date: Mon, 14 Nov 2022 14:16:24 +0100 Subject: [PATCH 022/763] Revert "Update CHANGELOG.md" This reverts commit e2cb013b15ff39e457b61dd910c0328f368e8ec7. --- CHANGELOG.md | 1 - 1 file changed, 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d43059855534..28e29c9462d0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -20,7 +20,6 @@ ENHANCEMENTS: * data-source/aws_identitystore_group: Add `alternate_identifier` argument and `description` attribute ([#27762](https://github.com/hashicorp/terraform-provider-aws/issues/27762)) * resource/aws_connect_instance: Add `multi_party_conference_enabled` argument ([#27734](https://github.com/hashicorp/terraform-provider-aws/issues/27734)) * resource/aws_msk_cluster: Add `storage_mode` argument ([#27546](https://github.com/hashicorp/terraform-provider-aws/issues/27546)) -resource/aws_cognito_user_pool_domain: Add `cloudfront_distribution_zone_id` attribute ([#27790](https://github.com/hashicorp/terraform-provider-aws/pull/27790)) ## 4.39.0 (November 10, 2022) From e5ae663ba03eba7bb1c5c96f2388c2c6c37b4553 Mon Sep 17 00:00:00 2001 From: Scott Reu Date: Wed, 7 Dec 2022 15:14:34 -0800 Subject: [PATCH 023/763] Initial work on public_ipv4_pools data source --- internal/service/ec2/find.go | 47 +++++++ .../ec2/public_ipv4_pool_data_source.go | 117 ++++++++++++++++++ .../ec2/public_ipv4_pools_data_source.go | 79 ++++++++++++ .../ec2/public_ipv4_pools_data_source_test.go | 79 ++++++++++++ website/docs/d/public_ipv4_pool.html.markdown | 58 +++++++++ .../docs/d/public_ipv4_pools.html.markdown | 55 ++++++++ 6 files changed, 435 insertions(+) create mode 100644 internal/service/ec2/public_ipv4_pool_data_source.go create mode 100644 internal/service/ec2/public_ipv4_pools_data_source.go create mode 100644 internal/service/ec2/public_ipv4_pools_data_source_test.go create mode 100644 website/docs/d/public_ipv4_pool.html.markdown create mode 100644 website/docs/d/public_ipv4_pools.html.markdown diff --git a/internal/service/ec2/find.go b/internal/service/ec2/find.go index c9ea17048d86..213b501183c8 100644 --- a/internal/service/ec2/find.go +++ b/internal/service/ec2/find.go @@ -1212,6 +1212,53 @@ func FindInstanceTypeOfferings(conn *ec2.EC2, input *ec2.DescribeInstanceTypeOff return output, nil } +func FindPublicIpv4Pool(ctx context.Context, conn *ec2.EC2, input *ec2.DescribePublicIpv4PoolsInput) ([]*ec2.PublicIpv4Pool, error) { + var output *ec2.DescribePublicIpv4PoolsOutput + var result []*ec2.PublicIpv4Pool + + output, err := conn.DescribePublicIpv4Pools(input) + if err != nil { + return nil, err + } + + result = output.PublicIpv4Pools + + return result, nil +} + +func FindPublicIpv4Pools(ctx context.Context, conn *ec2.EC2, input *ec2.DescribePublicIpv4PoolsInput) ([]*ec2.PublicIpv4Pool, error) { + var output []*ec2.PublicIpv4Pool + + err := conn.DescribePublicIpv4PoolsPages(input, func(page *ec2.DescribePublicIpv4PoolsOutput, lastPage bool) bool { + if page == nil { + return !lastPage + } + + for _, v := range page.PublicIpv4Pools { + if v == nil { + continue + } + + output = append(output, v) + } + + return !lastPage + }) + + if tfawserr.ErrCodeEquals(err, errCodeInvalidPoolIDNotFound) { + return nil, &resource.NotFoundError{ + LastError: err, + LastRequest: input, + } + } + + if err != nil { + return nil, err + } + + return output, nil +} + func FindLocalGatewayRouteTables(conn *ec2.EC2, input *ec2.DescribeLocalGatewayRouteTablesInput) ([]*ec2.LocalGatewayRouteTable, error) { var output []*ec2.LocalGatewayRouteTable diff --git a/internal/service/ec2/public_ipv4_pool_data_source.go b/internal/service/ec2/public_ipv4_pool_data_source.go new file mode 100644 index 000000000000..e3553eb1f87b --- /dev/null +++ b/internal/service/ec2/public_ipv4_pool_data_source.go @@ -0,0 +1,117 @@ +package ec2 + +import ( + "context" + + "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/create" + tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" + "github.com/hashicorp/terraform-provider-aws/names" +) + +func DataSourcePublicIpv4Pool() *schema.Resource { + return &schema.Resource{ + ReadWithoutTimeout: dataSourcePublicIpv4PoolRead, + Schema: map[string]*schema.Schema{ + "filter": DataSourceFiltersSchema(), + "pool_id": { + Type: schema.TypeString, + Required: true, + }, + "pool": { + Type: schema.TypeMap, + Computed: true, + Elem: &schema.Schema{Type: schema.TypeString}, + }, + "tags": tftags.TagsSchemaComputed(), + }, + } +} + +const ( + DSNamePublicIpv4Pool = "Public IPv4 Pool Data Source" +) + +func dataSourcePublicIpv4PoolRead(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { + conn := meta.(*conns.AWSClient).EC2Conn + input := &ec2.DescribePublicIpv4PoolsInput{} + + if v, ok := d.GetOk("pool_id"); ok { + input.PoolIds = aws.StringSlice([]string{v.(string)}) + } + + input.Filters = append(input.Filters, BuildTagFilterList( + Tags(tftags.New(d.Get("tags").(map[string]interface{}))), + )...) + + input.Filters = append(input.Filters, BuildFiltersDataSource( + d.Get("filter").(*schema.Set), + )...) + + if len(input.Filters) == 0 { + input.Filters = nil + } + + output, err := FindPublicIpv4Pool(ctx, conn, input) + if err != nil { + create.DiagError(names.EC2, create.ErrActionSetting, DSNamePublicIpv4Pool, d.Id(), err) + } + + pool := flattenPublicIpv4Pool(output[0]) + + d.SetId(meta.(*conns.AWSClient).Region) + d.Set("pool", pool) + + return nil +} + +func flattenPublicIpv4Pool(pool *ec2.PublicIpv4Pool) map[string]interface{} { + if pool == nil { + return map[string]interface{}{} + } + + m := map[string]interface{}{ + "description": aws.StringValue(pool.Description), + "network_border_group": aws.StringValue(pool.NetworkBorderGroup), + "pool_address_ranges": flattenPublicIpv4PoolRanges(pool.PoolAddressRanges), + "pool_id": aws.StringValue(pool.PoolId), + "tags": flattenTags(pool.Tags), + "total_address_count": aws.Int64Value(pool.TotalAddressCount), + "total_available_address_count": aws.Int64Value(pool.TotalAvailableAddressCount), + } + + return m +} + +func flattenPublicIpv4PoolRanges(pool_ranges []*ec2.PublicIpv4PoolRange) []interface{} { + result := []interface{}{} + + if pool_ranges == nil { + return result + } + + for _, v := range pool_ranges { + range_map := map[string]interface{}{ + "address_count": aws.Int64Value(v.AddressCount), + "available_address_count": aws.Int64Value(v.AvailableAddressCount), + "first_address": aws.StringValue(v.FirstAddress), + "last_address": aws.StringValue(v.LastAddress), + } + result = append(result, range_map) + } + + return result +} + +func flattenTags(tags []*ec2.Tag) map[string]string { + result := make(map[string]string) + for _, t := range tags { + result[aws.StringValue(t.Key)] = aws.StringValue(t.Value) + } + + return result +} diff --git a/internal/service/ec2/public_ipv4_pools_data_source.go b/internal/service/ec2/public_ipv4_pools_data_source.go new file mode 100644 index 000000000000..16c5fd8bf154 --- /dev/null +++ b/internal/service/ec2/public_ipv4_pools_data_source.go @@ -0,0 +1,79 @@ +package ec2 + +import ( + "context" + + "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/create" + tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" + "github.com/hashicorp/terraform-provider-aws/names" +) + +func DataSourcePublicIpv4Pools() *schema.Resource { + return &schema.Resource{ + ReadWithoutTimeout: dataSourcePublicIpv4PoolsRead, + Schema: map[string]*schema.Schema{ + "filter": DataSourceFiltersSchema(), + "pool_ids": { + Type: schema.TypeList, + Optional: true, + Elem: &schema.Schema{Type: schema.TypeString}, + }, + "pools": { + Type: schema.TypeList, + Computed: true, + Elem: &schema.Schema{ + Type: schema.TypeMap, + Elem: &schema.Schema{Type: schema.TypeString}, + }, + }, + "tags": tftags.TagsSchemaComputed(), + }, + } +} + +const ( + DSNamePublicIpv4Pools = "Public IPv4 Pools Data Source" +) + +func dataSourcePublicIpv4PoolsRead(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { + conn := meta.(*conns.AWSClient).EC2Conn + input := &ec2.DescribePublicIpv4PoolsInput{} + + if v, ok := d.GetOk("pool_ids"); ok { + input.PoolIds = aws.StringSlice([]string{v.(string)}) + } + + input.Filters = append(input.Filters, BuildTagFilterList( + Tags(tftags.New(d.Get("tags").(map[string]interface{}))), + )...) + + input.Filters = append(input.Filters, BuildFiltersDataSource( + d.Get("filter").(*schema.Set), + )...) + + if len(input.Filters) == 0 { + input.Filters = nil + } + + publicIpv4Pools := []map[string]interface{}{} + + output, err := FindPublicIpv4Pools(ctx, conn, input) + if err != nil { + create.DiagError(names.EC2, create.ErrActionSetting, DSNamePublicIpv4Pools, d.Id(), err) + } + + for _, v := range output { + pool := flattenPublicIpv4Pool(v) + publicIpv4Pools = append(publicIpv4Pools, pool) + } + + d.SetId(meta.(*conns.AWSClient).Region) + d.Set("pools", publicIpv4Pools) + + return nil +} diff --git a/internal/service/ec2/public_ipv4_pools_data_source_test.go b/internal/service/ec2/public_ipv4_pools_data_source_test.go new file mode 100644 index 000000000000..16c5fd8bf154 --- /dev/null +++ b/internal/service/ec2/public_ipv4_pools_data_source_test.go @@ -0,0 +1,79 @@ +package ec2 + +import ( + "context" + + "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/create" + tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" + "github.com/hashicorp/terraform-provider-aws/names" +) + +func DataSourcePublicIpv4Pools() *schema.Resource { + return &schema.Resource{ + ReadWithoutTimeout: dataSourcePublicIpv4PoolsRead, + Schema: map[string]*schema.Schema{ + "filter": DataSourceFiltersSchema(), + "pool_ids": { + Type: schema.TypeList, + Optional: true, + Elem: &schema.Schema{Type: schema.TypeString}, + }, + "pools": { + Type: schema.TypeList, + Computed: true, + Elem: &schema.Schema{ + Type: schema.TypeMap, + Elem: &schema.Schema{Type: schema.TypeString}, + }, + }, + "tags": tftags.TagsSchemaComputed(), + }, + } +} + +const ( + DSNamePublicIpv4Pools = "Public IPv4 Pools Data Source" +) + +func dataSourcePublicIpv4PoolsRead(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { + conn := meta.(*conns.AWSClient).EC2Conn + input := &ec2.DescribePublicIpv4PoolsInput{} + + if v, ok := d.GetOk("pool_ids"); ok { + input.PoolIds = aws.StringSlice([]string{v.(string)}) + } + + input.Filters = append(input.Filters, BuildTagFilterList( + Tags(tftags.New(d.Get("tags").(map[string]interface{}))), + )...) + + input.Filters = append(input.Filters, BuildFiltersDataSource( + d.Get("filter").(*schema.Set), + )...) + + if len(input.Filters) == 0 { + input.Filters = nil + } + + publicIpv4Pools := []map[string]interface{}{} + + output, err := FindPublicIpv4Pools(ctx, conn, input) + if err != nil { + create.DiagError(names.EC2, create.ErrActionSetting, DSNamePublicIpv4Pools, d.Id(), err) + } + + for _, v := range output { + pool := flattenPublicIpv4Pool(v) + publicIpv4Pools = append(publicIpv4Pools, pool) + } + + d.SetId(meta.(*conns.AWSClient).Region) + d.Set("pools", publicIpv4Pools) + + return nil +} diff --git a/website/docs/d/public_ipv4_pool.html.markdown b/website/docs/d/public_ipv4_pool.html.markdown new file mode 100644 index 000000000000..dcf853369e62 --- /dev/null +++ b/website/docs/d/public_ipv4_pool.html.markdown @@ -0,0 +1,58 @@ +--- +subcategory: "VPC (Virtual Private Cloud)" +layout: "aws" +page_title: "AWS: aws_vpc_public_ipv4_pools" +description: |- + Terraform data source for managing AWS VPC (Virtual Private Cloud) Public IPv4 Pools. +--- + +# Data Source: aws_ec2_public_ipv4_pools + +Terraform data source for managing an AWS VPC (Virtual Private Cloud) Public IPv4 Pool + +## Example Usage + +### Basic Usage + +```terraform +data "aws_vpc_public_ipv4_pool" "example" { + pool_ids = "ipv4pool-ec2-000df99cff0c1ec10" +} +``` + +### Usage with Filter +```terraform +data "aws_vpc_public_ipv4_pool" "example" { + filter { + name = "tag-key" + values = ["ExampleTagKey"] + } +} +``` + +## Argument Reference + +The following arguments are required: + +* `pool_id` - (Required) AWS resource IDs of a public IPv4 pool (as a string) for which this data source will fetch detailed information. + +The following arguments are optional: + +* `filter` - (Optional) One or more filters for results. Supported filters include `tag` and `tag-key`. +* `tags` - (Optional) One or more tags, which are used to filter results. + +## Attributes Reference + +In addition to all arguments above, the following attributes are exported: + +* `pool` - Record containing information about a Public IPv4 Pool. Contents: + - `description` - Description of the pool, if any. + - `network_border_group` - Name of the location from which the address pool is advertised. + - `pool_address_ranges` - List of Address Ranges in the Pool; each address range record contains: + - `address_count` - Number of addresses in the range. + - `available_address_count` - Number of available addresses in the range. + - `first_address` - First address in the range. + - `last_address` - Last address in the range. + - `tags` - Any tags for the address pool. + - `total_address_count` - Total number of addresses in the pool. + - `total_available_address_count` - Total number of available addresses in the pool. diff --git a/website/docs/d/public_ipv4_pools.html.markdown b/website/docs/d/public_ipv4_pools.html.markdown new file mode 100644 index 000000000000..790fa9314ec8 --- /dev/null +++ b/website/docs/d/public_ipv4_pools.html.markdown @@ -0,0 +1,55 @@ +--- +subcategory: "VPC (Virtual Private Cloud)" +layout: "aws" +page_title: "AWS: aws_vpc_public_ipv4_pools" +description: |- + Terraform data source for managing AWS VPC (Virtual Private Cloud) Public IPv4 Pools. +--- + +# Data Source: aws_ec2_public_ipv4_pools + +Terraform data source for managing AWS VPC (Virtual Private Cloud) Public IPv4 Pools + +## Example Usage + +### Basic Usage + +```terraform +data "aws_vpc_public_ipv4_pools" "example" { + pool_ids = ["ipv4pool-ec2-000df99cff0c1ec10", "ipv4pool-ec2-000fe121a300ffc94"] +} +``` + +### Usage with Filter +```terraform +data "aws_vpc_public_ipv4_pools" "example" { + filter { + name = "tag-key" + values = ["ExampleTagKey"] + } +} +``` + +## Argument Reference + +The following arguments are optional: + +* `pool_ids` - (Optional) List of AWS resource IDs of public IPv4 pools (as strings) for which this data source will fetch detailed information. If not specified, then this data source will return info about all pools in the configured region. +* `filter` - (Optional) One or more filters for results. Supported filters include `tag` and `tag-key`. +* `tags` - (Optional) One or more tags, which are used to filter results. + +## Attributes Reference + +In addition to all arguments above, the following attributes are exported: + +* `pools` - List of Public IPv4 Pool records. Each of these contains: + - `description` - Description of the pool, if any. + - `network_border_group` - Name of the location from which the address pool is advertised. + - `pool_address_ranges` - List of Address Ranges in the Pool; each address range record contains: + - `address_count` - Number of addresses in the range. + - `available_address_count` - Number of available addresses in the range. + - `first_address` - First address in the range. + - `last_address` - Last address in the range. + - `tags` - Any tags for the address pool. + - `total_address_count` - Total number of addresses in the pool. + - `total_available_address_count` - Total number of available addresses in the pool. From 044d2411feef039f4234dceb2d3ee0a67fbd7e98 Mon Sep 17 00:00:00 2001 From: Scott Reu Date: Wed, 7 Dec 2022 15:23:36 -0800 Subject: [PATCH 024/763] Remove test since we can't AccTest BYOIP-related resources --- .../ec2/public_ipv4_pools_data_source_test.go | 79 ------------------- 1 file changed, 79 deletions(-) delete mode 100644 internal/service/ec2/public_ipv4_pools_data_source_test.go diff --git a/internal/service/ec2/public_ipv4_pools_data_source_test.go b/internal/service/ec2/public_ipv4_pools_data_source_test.go deleted file mode 100644 index 16c5fd8bf154..000000000000 --- a/internal/service/ec2/public_ipv4_pools_data_source_test.go +++ /dev/null @@ -1,79 +0,0 @@ -package ec2 - -import ( - "context" - - "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/create" - tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" - "github.com/hashicorp/terraform-provider-aws/names" -) - -func DataSourcePublicIpv4Pools() *schema.Resource { - return &schema.Resource{ - ReadWithoutTimeout: dataSourcePublicIpv4PoolsRead, - Schema: map[string]*schema.Schema{ - "filter": DataSourceFiltersSchema(), - "pool_ids": { - Type: schema.TypeList, - Optional: true, - Elem: &schema.Schema{Type: schema.TypeString}, - }, - "pools": { - Type: schema.TypeList, - Computed: true, - Elem: &schema.Schema{ - Type: schema.TypeMap, - Elem: &schema.Schema{Type: schema.TypeString}, - }, - }, - "tags": tftags.TagsSchemaComputed(), - }, - } -} - -const ( - DSNamePublicIpv4Pools = "Public IPv4 Pools Data Source" -) - -func dataSourcePublicIpv4PoolsRead(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - conn := meta.(*conns.AWSClient).EC2Conn - input := &ec2.DescribePublicIpv4PoolsInput{} - - if v, ok := d.GetOk("pool_ids"); ok { - input.PoolIds = aws.StringSlice([]string{v.(string)}) - } - - input.Filters = append(input.Filters, BuildTagFilterList( - Tags(tftags.New(d.Get("tags").(map[string]interface{}))), - )...) - - input.Filters = append(input.Filters, BuildFiltersDataSource( - d.Get("filter").(*schema.Set), - )...) - - if len(input.Filters) == 0 { - input.Filters = nil - } - - publicIpv4Pools := []map[string]interface{}{} - - output, err := FindPublicIpv4Pools(ctx, conn, input) - if err != nil { - create.DiagError(names.EC2, create.ErrActionSetting, DSNamePublicIpv4Pools, d.Id(), err) - } - - for _, v := range output { - pool := flattenPublicIpv4Pool(v) - publicIpv4Pools = append(publicIpv4Pools, pool) - } - - d.SetId(meta.(*conns.AWSClient).Region) - d.Set("pools", publicIpv4Pools) - - return nil -} From f8c0396c494ad10236b557074df0c8555c8939c7 Mon Sep 17 00:00:00 2001 From: drfaust92 Date: Sat, 17 Dec 2022 15:30:13 +0200 Subject: [PATCH 025/763] add `listener_endpoint` --- .changelog/28434.txt | 3 ++ internal/service/rds/instance.go | 69 ++++++++++++++++++++---- website/docs/r/db_instance.html.markdown | 7 +++ 3 files changed, 70 insertions(+), 9 deletions(-) create mode 100644 .changelog/28434.txt diff --git a/.changelog/28434.txt b/.changelog/28434.txt new file mode 100644 index 000000000000..9f2d3610c8b8 --- /dev/null +++ b/.changelog/28434.txt @@ -0,0 +1,3 @@ +```release-note:enhancement +resource/aws_db_instance: Add `listener_endpoint` attribute +``` \ No newline at end of file diff --git a/internal/service/rds/instance.go b/internal/service/rds/instance.go index a3a9644826be..f7c4bec5306c 100644 --- a/internal/service/rds/instance.go +++ b/internal/service/rds/instance.go @@ -119,9 +119,10 @@ func ResourceInstance() *schema.Resource { ForceNew: true, }, "backup_retention_period": { - Type: schema.TypeInt, - Optional: true, - Computed: true, + Type: schema.TypeInt, + Optional: true, + Computed: true, + ValidateFunc: validation.IntBetween(0, 35), }, "backup_window": { Type: schema.TypeString, @@ -292,6 +293,26 @@ func ResourceInstance() *schema.Resource { Optional: true, Computed: true, }, + "listener_endpoint": { + Type: schema.TypeString, + Computed: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "address": { + Type: schema.TypeString, + Computed: true, + }, + "hosted_zone_id": { + Type: schema.TypeString, + Computed: true, + }, + "port": { + Type: schema.TypeInt, + Computed: true, + }, + }, + }, + }, "maintenance_window": { Type: schema.TypeString, Optional: true, @@ -316,14 +337,16 @@ func ResourceInstance() *schema.Resource { }, }, "monitoring_interval": { - Type: schema.TypeInt, - Optional: true, - Default: 0, + Type: schema.TypeInt, + Optional: true, + Default: 0, + ValidateFunc: validation.IntInSlice([]int{0, 1, 5, 10, 15, 30, 60}), }, "monitoring_role_arn": { - Type: schema.TypeString, - Optional: true, - Computed: true, + Type: schema.TypeString, + Optional: true, + Computed: true, + ValidateFunc: verify.ValidARN, }, "multi_az": { Type: schema.TypeBool, @@ -1642,6 +1665,12 @@ func resourceInstanceRead(ctx context.Context, d *schema.ResourceData, meta inte d.Set("port", v.Endpoint.Port) } + if v.ListenerEndpoint != nil { + if err := d.Set("listener_endpoint", []interface{}{flattenEndpoint(v.ListenerEndpoint)}); err != nil { + return errs.AppendErrorf(diags, "setting listener_endpoint: %s", err) + } + } + dbSetResourceDataEngineVersionFromInstance(d, v) tags, err := ListTagsWithContext(ctx, conn, arn) @@ -2584,3 +2613,25 @@ func dbInstanceValidBlueGreenEngines() []string { InstanceEngineMySQL, } } + +func flattenEndpoint(apiObject *rds.Endpoint) map[string]interface{} { + if apiObject == nil { + return nil + } + + tfMap := map[string]interface{}{} + + if v := apiObject.Address; v != nil { + tfMap["address"] = aws.StringValue(v) + } + + if v := apiObject.HostedZoneId; v != nil { + tfMap["hosted_zone_id"] = aws.StringValue(v) + } + + if v := apiObject.Port; v != nil { + tfMap["port"] = aws.Int64Value(v) + } + + return tfMap +} diff --git a/website/docs/r/db_instance.html.markdown b/website/docs/r/db_instance.html.markdown index b76ba135b4cd..96134074220a 100644 --- a/website/docs/r/db_instance.html.markdown +++ b/website/docs/r/db_instance.html.markdown @@ -309,6 +309,7 @@ in a Route 53 Alias record). * `id` - The RDS instance ID. * `instance_class`- The RDS instance class. * `latest_restorable_time` - The latest time, in UTC [RFC3339 format](https://tools.ietf.org/html/rfc3339#section-5.8), to which a database can be restored with point-in-time restore. +* `listener_endpoint` - Specifies the listener connection endpoint for SQL Server Always On. See [endpoint](#endpoint) below. * `maintenance_window` - The instance maintenance window. * `multi_az` - If the RDS instance is multi AZ enabled. * `name` - The database name. @@ -323,6 +324,12 @@ On Oracle and Microsoft SQL instances the following is exported additionally: * `character_set_name` - The character set (collation) used on Oracle and Microsoft SQL instances. +### Endpoint + +* `address` - Specifies the DNS address of the DB instance. +* `hosted_zone_id` - Specifies the ID that Amazon Route 53 assigns when you create a hosted zone. +* `port` - Specifies the port that the database engine is listening on. + ## Timeouts [Configuration options](https://developer.hashicorp.com/terraform/language/resources/syntax#operation-timeouts): From a8b328d78db1c795331032f8c0fd9f7cc9a2ecb2 Mon Sep 17 00:00:00 2001 From: drfaust92 Date: Sat, 17 Dec 2022 15:32:16 +0200 Subject: [PATCH 026/763] changelog --- .changelog/28434.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.changelog/28434.txt b/.changelog/28434.txt index 9f2d3610c8b8..7c9c4a3ad92b 100644 --- a/.changelog/28434.txt +++ b/.changelog/28434.txt @@ -1,3 +1,7 @@ ```release-note:enhancement resource/aws_db_instance: Add `listener_endpoint` attribute +``` + +```release-note:enhancement +resource/aws_db_instance: Add plan time validations for `backup_retention_period`, `monitoring_interval`, and `monitoring_role_arn` ``` \ No newline at end of file From e54a330cb39b1b29c5a297c423993eb219c1c69b Mon Sep 17 00:00:00 2001 From: drfaust92 Date: Sat, 17 Dec 2022 15:42:30 +0200 Subject: [PATCH 027/763] changelog --- internal/service/rds/instance.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/service/rds/instance.go b/internal/service/rds/instance.go index f7c4bec5306c..fd37376f8325 100644 --- a/internal/service/rds/instance.go +++ b/internal/service/rds/instance.go @@ -294,7 +294,7 @@ func ResourceInstance() *schema.Resource { Computed: true, }, "listener_endpoint": { - Type: schema.TypeString, + Type: schema.TypeList, Computed: true, Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ From cfd2686135821dda4089233a7cda49059c94685d Mon Sep 17 00:00:00 2001 From: Benny Lu Date: Fri, 30 Dec 2022 21:15:33 -0800 Subject: [PATCH 028/763] aws_transfer_server - protocol_details --- internal/service/transfer/server.go | 90 ++++++++++++++++++++++++ internal/service/transfer/server_test.go | 52 ++++++++++++++ 2 files changed, 142 insertions(+) diff --git a/internal/service/transfer/server.go b/internal/service/transfer/server.go index 7f749c1a6fe1..a5df7926c19c 100644 --- a/internal/service/transfer/server.go +++ b/internal/service/transfer/server.go @@ -176,6 +176,37 @@ func ResourceServer() *schema.Resource { ValidateFunc: validation.StringInSlice(transfer.Protocol_Values(), false), }, }, + "protocol_details": { + Type: schema.TypeList, + Optional: true, + MaxItems: 1, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "passive_ip": { + Type: schema.TypeString, + Optional: true, + ValidateFunc: validation.StringLenBetween(0, 15), + }, + "set_stat_option": { + Type: schema.TypeString, + Optional: true, + ValidateFunc: validation.StringInSlice([]string{ + "DEFAULT", + "ENABLE_NO_OP", + }, false), + }, + "tls_session_resumption_mode": { + Type: schema.TypeString, + Optional: true, + ValidateFunc: validation.StringInSlice([]string{ + "DISABLED", + "ENABLED", + "ENFORCED", + }, false), + }, + }, + }, + }, "security_policy_name": { Type: schema.TypeString, Optional: true, @@ -297,6 +328,10 @@ func resourceServerCreate(d *schema.ResourceData, meta interface{}) error { input.Protocols = flex.ExpandStringSet(v.(*schema.Set)) } + if v, ok := d.GetOk("protocol_details"); ok && len(v.([]interface{})) > 0 { + input.ProtocolDetails = expandProtocolDetails(v.([]interface{})) + } + if v, ok := d.GetOk("security_policy_name"); ok { input.SecurityPolicyName = aws.String(v.(string)) } @@ -423,6 +458,11 @@ func resourceServerRead(d *schema.ResourceData, meta interface{}) error { d.Set("post_authentication_login_banner", output.PostAuthenticationLoginBanner) d.Set("pre_authentication_login_banner", output.PreAuthenticationLoginBanner) d.Set("protocols", aws.StringValueSlice(output.Protocols)) + + if err := d.Set("protocol_details", flattenProtocolDetails(output.ProtocolDetails)); err != nil { + return fmt.Errorf("error setting protocol_details: %w", err) + } + d.Set("security_policy_name", output.SecurityPolicyName) if output.IdentityProviderDetails != nil { d.Set("url", output.IdentityProviderDetails.Url) @@ -603,6 +643,10 @@ func resourceServerUpdate(d *schema.ResourceData, meta interface{}) error { input.Protocols = flex.ExpandStringSet(d.Get("protocols").(*schema.Set)) } + if d.HasChange("protocol_details") { + input.ProtocolDetails = expandProtocolDetails(d.Get("protocol_details").([]interface{})) + } + if d.HasChange("security_policy_name") { input.SecurityPolicyName = aws.String(d.Get("security_policy_name").(string)) } @@ -794,6 +838,52 @@ func flattenEndpointDetails(apiObject *transfer.EndpointDetails, securityGroupID return tfMap } +func expandProtocolDetails(m []interface{}) *transfer.ProtocolDetails { + if len(m) < 1 || m[0] == nil { + return nil + } + + tfMap := m[0].(map[string]interface{}) + + apiObject := &transfer.ProtocolDetails{} + + if v, ok := tfMap["passive_ip"].(string); ok && len(v) > 0 { + apiObject.PassiveIp = aws.String(v) + } + + if v, ok := tfMap["set_stat_option"].(string); ok && len(v) > 0 { + apiObject.SetStatOption = aws.String(v) + } + + if v, ok := tfMap["tls_session_resumption_mode"].(string); ok && len(v) > 0 { + apiObject.TlsSessionResumptionMode = aws.String(v) + } + + return apiObject +} + +func flattenProtocolDetails(apiObject *transfer.ProtocolDetails) []interface{} { + if apiObject == nil { + return nil + } + + tfMap := map[string]interface{}{} + + if v := apiObject.PassiveIp; v != nil { + tfMap["passive_ip"] = aws.StringValue(v) + } + + if v := apiObject.SetStatOption; v != nil { + tfMap["set_stat_option"] = aws.StringValue(v) + } + + if v := apiObject.TlsSessionResumptionMode; v != nil { + tfMap["tls_session_resumption_mode"] = aws.StringValue(v) + } + + return []interface{}{tfMap} +} + func expandWorkflowDetails(tfMap []interface{}) *transfer.WorkflowDetails { if tfMap == nil { return nil diff --git a/internal/service/transfer/server_test.go b/internal/service/transfer/server_test.go index 3a0b296f08fb..9b437e92e005 100644 --- a/internal/service/transfer/server_test.go +++ b/internal/service/transfer/server_test.go @@ -727,6 +727,46 @@ func testAccServer_protocols(t *testing.T) { }) } +func TestAccServer_protocolDetails(t *testing.T) { + var s transfer.DescribedServer + resourceName := "aws_transfer_server.test" + + resource.Test(t, resource.TestCase{ + PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(t) }, + ErrorCheck: acctest.ErrorCheck(t, transfer.EndpointsID), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + CheckDestroy: testAccCheckServerDestroy, + Steps: []resource.TestStep{ + { + Config: testAccServerConfig_protocolDetails("AUTO", "DEFAULT", "ENFORCED"), + Check: resource.ComposeTestCheckFunc( + testAccCheckServerExists(resourceName, &s), + resource.TestCheckResourceAttr(resourceName, "protocol_details.#", "1"), + resource.TestCheckResourceAttr(resourceName, "protocol_details.0.passive_ip", "AUTO"), + resource.TestCheckResourceAttr(resourceName, "protocol_details.0.set_stat_option", "DEFAULT"), + resource.TestCheckResourceAttr(resourceName, "protocol_details.0.tls_session_resumption_mode", "ENFORCED"), + ), + }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + ImportStateVerifyIgnore: []string{"force_destroy"}, + }, + { + Config: testAccServerConfig_protocolDetails("AUTO", "ENABLE_NO_OP", "DISABLED"), + Check: resource.ComposeTestCheckFunc( + testAccCheckServerExists(resourceName, &s), + resource.TestCheckResourceAttr(resourceName, "protocol_details.#", "1"), + resource.TestCheckResourceAttr(resourceName, "protocol_details.0.passive_ip", "AUTO"), + resource.TestCheckResourceAttr(resourceName, "protocol_details.0.set_stat_option", "ENABLE_NO_OP"), + resource.TestCheckResourceAttr(resourceName, "protocol_details.0.tls_session_resumption_mode", "DISABLED"), + ), + }, + }, + }) +} + func testAccServer_apiGateway(t *testing.T) { var conf transfer.DescribedServer resourceName := "aws_transfer_server.test" @@ -1599,6 +1639,18 @@ resource "aws_transfer_server" "test" { `) } +func testAccServerConfig_protocolDetails(passive_ip, set_stat_option, tls_session_resumption_mode string) string { + return fmt.Sprintf(` +resource "aws_transfer_server" "test" { + protocol_details { + passive_ip = %[1]q + set_stat_option = %[2]q + tls_session_resumption_mode = %[3]q + } +} +`, passive_ip, set_stat_option, tls_session_resumption_mode) +} + func testAccServerConfig_rootCA(domain string) string { return fmt.Sprintf(` resource "aws_acmpca_certificate_authority" "test" { From 603a3276cbd4aeb6608368e50f6a2fa68e99d046 Mon Sep 17 00:00:00 2001 From: Benny Lu Date: Fri, 30 Dec 2022 21:21:52 -0800 Subject: [PATCH 029/763] Update doc --- website/docs/r/transfer_server.html.markdown | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/website/docs/r/transfer_server.html.markdown b/website/docs/r/transfer_server.html.markdown index db9baebfa3d3..db8df2fb142d 100644 --- a/website/docs/r/transfer_server.html.markdown +++ b/website/docs/r/transfer_server.html.markdown @@ -108,6 +108,7 @@ The following arguments are supported: * `force_destroy` - (Optional) A boolean that indicates all users associated with the server should be deleted so that the Server can be destroyed without error. The default value is `false`. This option only applies to servers configured with a `SERVICE_MANAGED` `identity_provider_type`. * `post_authentication_login_banner`- (Optional) Specify a string to display when users connect to a server. This string is displayed after the user authenticates. The SFTP protocol does not support post-authentication display banners. * `pre_authentication_login_banner`- (Optional) Specify a string to display when users connect to a server. This string is displayed before the user authenticates. +* `protocol_details`- (Optional) The protocol settings that are configured for your server. * `security_policy_name` - (Optional) Specifies the name of the security policy that is attached to the server. Possible values are `TransferSecurityPolicy-2018-11`, `TransferSecurityPolicy-2020-06`, `TransferSecurityPolicy-FIPS-2020-06` and `TransferSecurityPolicy-2022-03`. Default value is: `TransferSecurityPolicy-2018-11`. * `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. * `workflow_details` - (Optional) Specifies the workflow details. See Workflow Details below. @@ -120,6 +121,12 @@ The following arguments are supported: * `vpc_endpoint_id` - (Optional) The ID of the VPC endpoint. This property can only be used when `endpoint_type` is set to `VPC_ENDPOINT` * `vpc_id` - (Optional) The VPC ID of the virtual private cloud in which the SFTP server's endpoint will be hosted. This property can only be used when `endpoint_type` is set to `VPC`. +### Protocol Details + +* `passive_ip` - (Optional) Indicates passive mode, for FTP and FTPS protocols. Enter a single IPv4 address, such as the public IP address of a firewall, router, or load balancer. +* `set_stat_option` - (Optional) Use to ignore the error that is generated when the client attempts to use `SETSTAT` on a file you are uploading to an S3 bucket. +* `tls_session_resumption_mode` - (Optional) A property used with Transfer Family servers that use the FTPS protocol. Provides a mechanism to resume or share a negotiated secret key between the control and data connection for an FTPS session. + ### Workflow Details * `on_upload` - (Optional) A trigger that starts a workflow: the workflow begins to execute after a file is uploaded. See Workflow Detail below. From 6b0aace22c2f0e6a82bc3a9b53dc8bf463f0a4dd Mon Sep 17 00:00:00 2001 From: Benny Lu Date: Fri, 30 Dec 2022 21:22:58 -0800 Subject: [PATCH 030/763] Add to serial tests --- internal/service/transfer/server_test.go | 2 +- internal/service/transfer/transfer_test.go | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/internal/service/transfer/server_test.go b/internal/service/transfer/server_test.go index 9b437e92e005..5a5aeb4cc2cc 100644 --- a/internal/service/transfer/server_test.go +++ b/internal/service/transfer/server_test.go @@ -727,7 +727,7 @@ func testAccServer_protocols(t *testing.T) { }) } -func TestAccServer_protocolDetails(t *testing.T) { +func testAccServer_protocolDetails(t *testing.T) { var s transfer.DescribedServer resourceName := "aws_transfer_server.test" diff --git a/internal/service/transfer/transfer_test.go b/internal/service/transfer/transfer_test.go index 2f2e955361b6..494d629ca25f 100644 --- a/internal/service/transfer/transfer_test.go +++ b/internal/service/transfer/transfer_test.go @@ -24,6 +24,7 @@ func TestAccTransfer_serial(t *testing.T) { "HostKey": testAccServer_hostKey, "LambdaFunction": testAccServer_lambdaFunction, "Protocols": testAccServer_protocols, + "ProtocolDetails": testAccServer_protocolDetails, "SecurityPolicy": testAccServer_securityPolicy, "UpdateEndpointTypePublicToVPC": testAccServer_updateEndpointType_publicToVPC, "UpdateEndpointTypePublicToVPCAddressAllocationIDs": testAccServer_updateEndpointType_publicToVPC_addressAllocationIDs, From 97192ff13825486e6269f48dbfbb45c86fa6d6e7 Mon Sep 17 00:00:00 2001 From: Benny Lu Date: Fri, 30 Dec 2022 21:25:16 -0800 Subject: [PATCH 031/763] Lint --- internal/service/transfer/server_test.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/internal/service/transfer/server_test.go b/internal/service/transfer/server_test.go index 5a5aeb4cc2cc..8f1d0f80dfd9 100644 --- a/internal/service/transfer/server_test.go +++ b/internal/service/transfer/server_test.go @@ -1642,11 +1642,11 @@ resource "aws_transfer_server" "test" { func testAccServerConfig_protocolDetails(passive_ip, set_stat_option, tls_session_resumption_mode string) string { return fmt.Sprintf(` resource "aws_transfer_server" "test" { - protocol_details { - passive_ip = %[1]q - set_stat_option = %[2]q - tls_session_resumption_mode = %[3]q - } + protocol_details { + passive_ip = %[1]q + set_stat_option = %[2]q + tls_session_resumption_mode = %[3]q + } } `, passive_ip, set_stat_option, tls_session_resumption_mode) } From 81319bc1b44b58f7d56fcc1739ba6e2283f765e1 Mon Sep 17 00:00:00 2001 From: Benny Lu Date: Fri, 30 Dec 2022 21:28:35 -0800 Subject: [PATCH 032/763] changelog --- .changelog/28621.txt | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 .changelog/28621.txt diff --git a/.changelog/28621.txt b/.changelog/28621.txt new file mode 100644 index 000000000000..e73f9209efa6 --- /dev/null +++ b/.changelog/28621.txt @@ -0,0 +1,3 @@ +```release-note:enhancement +resource/aws_transfer_server: Add `protocol_details` argument +``` From 4702aa1ac2f153f9e871dbd83c82717ef87f38a3 Mon Sep 17 00:00:00 2001 From: Benny Lu Date: Fri, 30 Dec 2022 21:38:00 -0800 Subject: [PATCH 033/763] Order --- internal/service/transfer/server.go | 42 ++++++++++++++--------------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/internal/service/transfer/server.go b/internal/service/transfer/server.go index a5df7926c19c..00d84f566edc 100644 --- a/internal/service/transfer/server.go +++ b/internal/service/transfer/server.go @@ -165,17 +165,6 @@ func ResourceServer() *schema.Resource { Sensitive: true, ValidateFunc: validation.StringLenBetween(0, 512), }, - "protocols": { - Type: schema.TypeSet, - MinItems: 1, - MaxItems: 3, - Optional: true, - Computed: true, - Elem: &schema.Schema{ - Type: schema.TypeString, - ValidateFunc: validation.StringInSlice(transfer.Protocol_Values(), false), - }, - }, "protocol_details": { Type: schema.TypeList, Optional: true, @@ -207,6 +196,17 @@ func ResourceServer() *schema.Resource { }, }, }, + "protocols": { + Type: schema.TypeSet, + MinItems: 1, + MaxItems: 3, + Optional: true, + Computed: true, + Elem: &schema.Schema{ + Type: schema.TypeString, + ValidateFunc: validation.StringInSlice(transfer.Protocol_Values(), false), + }, + }, "security_policy_name": { Type: schema.TypeString, Optional: true, @@ -324,14 +324,14 @@ func resourceServerCreate(d *schema.ResourceData, meta interface{}) error { input.PreAuthenticationLoginBanner = aws.String(v.(string)) } - if v, ok := d.GetOk("protocols"); ok && v.(*schema.Set).Len() > 0 { - input.Protocols = flex.ExpandStringSet(v.(*schema.Set)) - } - if v, ok := d.GetOk("protocol_details"); ok && len(v.([]interface{})) > 0 { input.ProtocolDetails = expandProtocolDetails(v.([]interface{})) } + if v, ok := d.GetOk("protocols"); ok && v.(*schema.Set).Len() > 0 { + input.Protocols = flex.ExpandStringSet(v.(*schema.Set)) + } + if v, ok := d.GetOk("security_policy_name"); ok { input.SecurityPolicyName = aws.String(v.(string)) } @@ -457,12 +457,12 @@ func resourceServerRead(d *schema.ResourceData, meta interface{}) error { d.Set("logging_role", output.LoggingRole) d.Set("post_authentication_login_banner", output.PostAuthenticationLoginBanner) d.Set("pre_authentication_login_banner", output.PreAuthenticationLoginBanner) - d.Set("protocols", aws.StringValueSlice(output.Protocols)) - + if err := d.Set("protocol_details", flattenProtocolDetails(output.ProtocolDetails)); err != nil { return fmt.Errorf("error setting protocol_details: %w", err) } + d.Set("protocols", aws.StringValueSlice(output.Protocols)) d.Set("security_policy_name", output.SecurityPolicyName) if output.IdentityProviderDetails != nil { d.Set("url", output.IdentityProviderDetails.Url) @@ -639,13 +639,13 @@ func resourceServerUpdate(d *schema.ResourceData, meta interface{}) error { input.PreAuthenticationLoginBanner = aws.String(d.Get("pre_authentication_login_banner").(string)) } - if d.HasChange("protocols") { - input.Protocols = flex.ExpandStringSet(d.Get("protocols").(*schema.Set)) - } - if d.HasChange("protocol_details") { input.ProtocolDetails = expandProtocolDetails(d.Get("protocol_details").([]interface{})) } + + if d.HasChange("protocols") { + input.Protocols = flex.ExpandStringSet(d.Get("protocols").(*schema.Set)) + } if d.HasChange("security_policy_name") { input.SecurityPolicyName = aws.String(d.Get("security_policy_name").(string)) From dd56faa378661fd43cf2b99ddc83ee507372d38b Mon Sep 17 00:00:00 2001 From: Benny Lu Date: Fri, 30 Dec 2022 21:41:52 -0800 Subject: [PATCH 034/763] lint --- internal/service/transfer/server.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/service/transfer/server.go b/internal/service/transfer/server.go index 00d84f566edc..7f835dee3ee1 100644 --- a/internal/service/transfer/server.go +++ b/internal/service/transfer/server.go @@ -457,7 +457,7 @@ func resourceServerRead(d *schema.ResourceData, meta interface{}) error { d.Set("logging_role", output.LoggingRole) d.Set("post_authentication_login_banner", output.PostAuthenticationLoginBanner) d.Set("pre_authentication_login_banner", output.PreAuthenticationLoginBanner) - + if err := d.Set("protocol_details", flattenProtocolDetails(output.ProtocolDetails)); err != nil { return fmt.Errorf("error setting protocol_details: %w", err) } @@ -642,7 +642,7 @@ func resourceServerUpdate(d *schema.ResourceData, meta interface{}) error { if d.HasChange("protocol_details") { input.ProtocolDetails = expandProtocolDetails(d.Get("protocol_details").([]interface{})) } - + if d.HasChange("protocols") { input.Protocols = flex.ExpandStringSet(d.Get("protocols").(*schema.Set)) } From 87d6e06b0be45cb6951ba6a89b21e214607246ef Mon Sep 17 00:00:00 2001 From: Kamil Turek Date: Tue, 10 Jan 2023 21:12:26 +0100 Subject: [PATCH 035/763] Add the new attribute --- internal/service/sesv2/configuration_set.go | 153 ++++++++++++++++++++ 1 file changed, 153 insertions(+) diff --git a/internal/service/sesv2/configuration_set.go b/internal/service/sesv2/configuration_set.go index fd1cd2ceb801..bb374df40e9b 100644 --- a/internal/service/sesv2/configuration_set.go +++ b/internal/service/sesv2/configuration_set.go @@ -131,6 +131,43 @@ func ResourceConfigurationSet() *schema.Resource { }, }, }, + "vdm_options": { + Type: schema.TypeList, + Optional: true, + MaxItems: 1, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "dashboard_options": { + Type: schema.TypeList, + Optional: true, + MaxItems: 1, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "engagement_metrics": { + Type: schema.TypeString, + Optional: true, + ValidateDiagFunc: enum.Validate[types.FeatureStatus](), + }, + }, + }, + }, + "guardian_options": { + Type: schema.TypeList, + Optional: true, + MaxItems: 1, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "optimized_shared_delivery": { + Type: schema.TypeString, + Optional: true, + ValidateDiagFunc: enum.Validate[types.FeatureStatus](), + }, + }, + }, + }, + }, + }, + }, }, CustomizeDiff: verify.SetTagsDiff, @@ -168,6 +205,10 @@ func resourceConfigurationSetCreate(ctx context.Context, d *schema.ResourceData, in.TrackingOptions = expandTrackingOptions(v.([]interface{})[0].(map[string]interface{})) } + if v, ok := d.GetOk("vdm_options"); ok && len(v.([]interface{})) > 0 && v.([]interface{})[0] != nil { + in.VdmOptions = expandVDMOptions(v.([]interface{})[0].(map[string]interface{})) + } + defaultTagsConfig := meta.(*conns.AWSClient).DefaultTagsConfig tags := defaultTagsConfig.MergeTags(tftags.New(d.Get("tags").(map[string]interface{}))) @@ -255,6 +296,14 @@ func resourceConfigurationSetRead(ctx context.Context, d *schema.ResourceData, m d.Set("tracking_options", nil) } + if out.VdmOptions != nil { + if err := d.Set("vdm_options", []interface{}{flattenVDMOptions(out.VdmOptions)}); err != nil { + return create.DiagError(names.SESV2, create.ErrActionSetting, ResNameConfigurationSet, d.Id(), err) + } + } else { + d.Set("vdm_options", nil) + } + tags, err := ListTags(ctx, conn, d.Get("arn").(string)) if err != nil { return create.DiagError(names.SESV2, create.ErrActionReading, ResNameConfigurationSet, d.Id(), err) @@ -382,6 +431,22 @@ func resourceConfigurationSetUpdate(ctx context.Context, d *schema.ResourceData, } } + if d.HasChanges("vdm_options") { + in := &sesv2.PutConfigurationSetVdmOptionsInput{ + ConfigurationSetName: aws.String(d.Id()), + } + + if v, ok := d.GetOk("vdm_options"); ok && len(v.([]interface{})) > 0 && v.([]interface{})[0] != nil { + in.VdmOptions = expandVDMOptions(v.([]interface{})[0].(map[string]interface{})) + } + + log.Printf("[DEBUG] Updating SESV2 ConfigurationSet VdmOptions (%s): %#v", d.Id(), in) + _, err := conn.PutConfigurationSetVdmOptions(ctx, in) + if err != nil { + return create.DiagError(names.SESV2, create.ErrActionUpdating, ResNameConfigurationSet, d.Id(), err) + } + } + if d.HasChanges("tags_all") { o, n := d.GetChange("tags_all") @@ -520,6 +585,48 @@ func flattenTrackingOptions(apiObject *types.TrackingOptions) map[string]interfa return m } +func flattenVDMOptions(apiObject *types.VdmOptions) map[string]interface{} { + if apiObject == nil { + return nil + } + + m := map[string]interface{}{} + + if v := apiObject.DashboardOptions; v != nil { + m["dashboard_options"] = []interface{}{flattenDashboardOptions(v)} + } + + if v := apiObject.GuardianOptions; v != nil { + m["guardian_options"] = []interface{}{flattenGuardianOptions(v)} + } + + return m +} + +func flattenDashboardOptions(apiObject *types.DashboardOptions) map[string]interface{} { + if apiObject == nil { + return nil + } + + m := map[string]interface{}{ + "engagement_metrics": string(apiObject.EngagementMetrics), + } + + return m +} + +func flattenGuardianOptions(apiObject *types.GuardianOptions) map[string]interface{} { + if apiObject == nil { + return nil + } + + m := map[string]interface{}{ + "optimized_shared_delivery": string(apiObject.OptimizedSharedDelivery), + } + + return m +} + func expandDeliveryOptions(tfMap map[string]interface{}) *types.DeliveryOptions { if tfMap == nil { return nil @@ -605,3 +712,49 @@ func expandTrackingOptions(tfMap map[string]interface{}) *types.TrackingOptions return a } + +func expandVDMOptions(tfMap map[string]interface{}) *types.VdmOptions { + if tfMap == nil { + return nil + } + + a := &types.VdmOptions{} + + if v, ok := tfMap["dashboard_options"].([]interface{}); ok && len(v) > 0 && v[0] != nil { + a.DashboardOptions = expandDashboardOptions(v[0].(map[string]interface{})) + } + + if v, ok := tfMap["guardian_options"].([]interface{}); ok && len(v) > 0 && v[0] != nil { + a.GuardianOptions = expandGuardianOptions(v[0].(map[string]interface{})) + } + + return a +} + +func expandDashboardOptions(tfMap map[string]interface{}) *types.DashboardOptions { + if tfMap == nil { + return nil + } + + a := &types.DashboardOptions{} + + if v, ok := tfMap["engagement_metrics"].(string); ok && v != "" { + a.EngagementMetrics = types.FeatureStatus(v) + } + + return a +} + +func expandGuardianOptions(tfMap map[string]interface{}) *types.GuardianOptions { + if tfMap == nil { + return nil + } + + a := &types.GuardianOptions{} + + if v, ok := tfMap["optimized_shared_delivery"].(string); ok && v != "" { + a.OptimizedSharedDelivery = types.FeatureStatus(v) + } + + return a +} From a95435eb8418a51ef91600000976cc3b872415b2 Mon Sep 17 00:00:00 2001 From: Kamil Turek Date: Tue, 10 Jan 2023 21:12:35 +0100 Subject: [PATCH 036/763] Extend acceptance tests --- .../service/sesv2/configuration_set_test.go | 102 ++++++++++++++++++ 1 file changed, 102 insertions(+) diff --git a/internal/service/sesv2/configuration_set_test.go b/internal/service/sesv2/configuration_set_test.go index e365e309d71c..47cf15e37403 100644 --- a/internal/service/sesv2/configuration_set_test.go +++ b/internal/service/sesv2/configuration_set_test.go @@ -209,6 +209,80 @@ func TestAccSESV2ConfigurationSet_suppressedReasons(t *testing.T) { }) } +func TestAccSESV2ConfigurationSet_engagementMetrics(t *testing.T) { + rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) + resourceName := "aws_sesv2_configuration_set.test" + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { acctest.PreCheck(t) }, + ErrorCheck: acctest.ErrorCheck(t, names.SESV2EndpointID), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + CheckDestroy: testAccCheckConfigurationSetDestroy, + Steps: []resource.TestStep{ + { + Config: testAccConfigurationSetConfig_engagementMetrics(rName, string(types.FeatureStatusEnabled)), + Check: resource.ComposeTestCheckFunc( + testAccCheckConfigurationSetExists(resourceName), + resource.TestCheckResourceAttr(resourceName, "vdm_options.#", "1"), + resource.TestCheckResourceAttr(resourceName, "vdm_options.0.dashboard_options.#", "1"), + resource.TestCheckResourceAttr(resourceName, "vdm_options.0.dashboard_options.0.engagement_metrics", string(types.FeatureStatusEnabled)), + ), + }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, + { + Config: testAccConfigurationSetConfig_engagementMetrics(rName, string(types.FeatureStatusDisabled)), + Check: resource.ComposeTestCheckFunc( + testAccCheckConfigurationSetExists(resourceName), + resource.TestCheckResourceAttr(resourceName, "vdm_options.#", "1"), + resource.TestCheckResourceAttr(resourceName, "vdm_options.0.dashboard_options.#", "1"), + resource.TestCheckResourceAttr(resourceName, "vdm_options.0.dashboard_options.0.engagement_metrics", string(types.FeatureStatusDisabled)), + ), + }, + }, + }) +} + +func TestAccSESV2ConfigurationSet_optimizedSharedDelivery(t *testing.T) { + rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) + resourceName := "aws_sesv2_configuration_set.test" + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { acctest.PreCheck(t) }, + ErrorCheck: acctest.ErrorCheck(t, names.SESV2EndpointID), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + CheckDestroy: testAccCheckConfigurationSetDestroy, + Steps: []resource.TestStep{ + { + Config: testAccConfigurationSetConfig_optimizedSharedDelivery(rName, string(types.FeatureStatusEnabled)), + Check: resource.ComposeTestCheckFunc( + testAccCheckConfigurationSetExists(resourceName), + resource.TestCheckResourceAttr(resourceName, "vdm_options.#", "1"), + resource.TestCheckResourceAttr(resourceName, "vdm_options.0.guardian_options.#", "1"), + resource.TestCheckResourceAttr(resourceName, "vdm_options.0.guardian_options.0.optimized_shared_delivery", string(types.FeatureStatusEnabled)), + ), + }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, + { + Config: testAccConfigurationSetConfig_optimizedSharedDelivery(rName, string(types.FeatureStatusDisabled)), + Check: resource.ComposeTestCheckFunc( + testAccCheckConfigurationSetExists(resourceName), + resource.TestCheckResourceAttr(resourceName, "vdm_options.#", "1"), + resource.TestCheckResourceAttr(resourceName, "vdm_options.0.guardian_options.#", "1"), + resource.TestCheckResourceAttr(resourceName, "vdm_options.0.guardian_options.0.optimized_shared_delivery", string(types.FeatureStatusDisabled)), + ), + }, + }, + }) +} + func TestAccSESV2ConfigurationSet_tags(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resourceName := "aws_sesv2_configuration_set.test" @@ -356,6 +430,34 @@ resource "aws_sesv2_configuration_set" "test" { `, rName, suppressedReason) } +func testAccConfigurationSetConfig_engagementMetrics(rName, engagementMetrics string) string { + return fmt.Sprintf(` +resource "aws_sesv2_configuration_set" "test" { + configuration_set_name = %[1]q + + vdm_options { + dashboard_options { + engagement_metrics = %[2]q + } + } +} +`, rName, engagementMetrics) +} + +func testAccConfigurationSetConfig_optimizedSharedDelivery(rName, optimizedSharedDelivery string) string { + return fmt.Sprintf(` +resource "aws_sesv2_configuration_set" "test" { + configuration_set_name = %[1]q + + vdm_options { + guardian_options { + optimized_shared_delivery = %[2]q + } + } +} +`, rName, optimizedSharedDelivery) +} + func testAccConfigurationSetConfig_tags1(rName, tagKey1, tagValue1 string) string { return fmt.Sprintf(` resource "aws_sesv2_configuration_set" "test" { From dc57bc8958f5698206d389bf040c2ab11d759518 Mon Sep 17 00:00:00 2001 From: Kamil Turek Date: Tue, 10 Jan 2023 21:12:43 +0100 Subject: [PATCH 037/763] Update docs page --- .../r/sesv2_configuration_set.html.markdown | 20 ++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/website/docs/r/sesv2_configuration_set.html.markdown b/website/docs/r/sesv2_configuration_set.html.markdown index eb2854449e7e..fc8d444c87e3 100644 --- a/website/docs/r/sesv2_configuration_set.html.markdown +++ b/website/docs/r/sesv2_configuration_set.html.markdown @@ -51,6 +51,7 @@ The following arguments are supported: * `suppression_options` - (Optional) An object that contains information about the suppression list preferences for your account. * `tags` - (Optional) A 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. * `tracking_options` - (Optional) An object that defines the open and click tracking options for emails that you send using the configuration set. +* `vdm_options` - (Optional) An object that defines the VDM settings that apply to emails that you send using the configuration set. ### delivery_options @@ -73,11 +74,24 @@ The following arguments are supported: ### suppression_options -- `suppressed_reasons` - (Optional) A list that contains the reasons that email addresses are automatically added to the suppression list for your account. Valid values: `BOUNCE`, `COMPLAINT`. +* `suppressed_reasons` - (Optional) A list that contains the reasons that email addresses are automatically added to the suppression list for your account. Valid values: `BOUNCE`, `COMPLAINT`. -## tracking_options +### tracking_options -- `custom_redirect_domain` - (Required) The domain to use for tracking open and click events. +* `custom_redirect_domain` - (Required) The domain to use for tracking open and click events. + +### vdm_options + +* `dashboard_options` - (Optional) Specifies additional settings for your VDM configuration as applicable to the Dashboard. +* `guardian_options` - (Optional) Specifies additional settings for your VDM configuration as applicable to the Guardian. + +### dashboard_options + +* `engagement_metrics` - (Optional) Specifies the status of your VDM engagement metrics collection. Valid values: `ENABLED`, `DISABLED`. + +### guardian_options + +* `optimized_shared_delivery` - (Optional) Specifies the status of your VDM optimized shared delivery. Valid values: `ENABLED`, `DISABLED`. ## Attributes Reference From 889a1b5488562e8c3906b45a0ed783e09aac46bf Mon Sep 17 00:00:00 2001 From: Kamil Turek Date: Tue, 10 Jan 2023 21:25:17 +0100 Subject: [PATCH 038/763] Add changelog --- .changelog/28812.txt | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 .changelog/28812.txt diff --git a/.changelog/28812.txt b/.changelog/28812.txt new file mode 100644 index 000000000000..1e7125ee9aec --- /dev/null +++ b/.changelog/28812.txt @@ -0,0 +1,3 @@ +```release-note:enhancement +resource/aws_sesv2_configuration_set: Add `vdm_options` argument +``` From fdc9bc9cd950e7d52e372fc7420bdbd48fb6c477 Mon Sep 17 00:00:00 2001 From: Kamil Turek Date: Tue, 10 Jan 2023 21:25:26 +0100 Subject: [PATCH 039/763] Fix terrafmt issues --- internal/service/sesv2/configuration_set_test.go | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/internal/service/sesv2/configuration_set_test.go b/internal/service/sesv2/configuration_set_test.go index 47cf15e37403..ba8ce6a8aa01 100644 --- a/internal/service/sesv2/configuration_set_test.go +++ b/internal/service/sesv2/configuration_set_test.go @@ -436,9 +436,9 @@ resource "aws_sesv2_configuration_set" "test" { configuration_set_name = %[1]q vdm_options { - dashboard_options { - engagement_metrics = %[2]q - } + dashboard_options { + engagement_metrics = %[2]q + } } } `, rName, engagementMetrics) @@ -450,9 +450,9 @@ resource "aws_sesv2_configuration_set" "test" { configuration_set_name = %[1]q vdm_options { - guardian_options { - optimized_shared_delivery = %[2]q - } + guardian_options { + optimized_shared_delivery = %[2]q + } } } `, rName, optimizedSharedDelivery) From 750866fec30b5b214193d28e5680b6fb11be3b36 Mon Sep 17 00:00:00 2001 From: lvthillo Date: Wed, 18 Jan 2023 13:58:45 +0100 Subject: [PATCH 040/763] Add support for auto-enabling lambda scanning on aws_inspector2_organization_configuration --- CHANGELOG.md | 1 + .../inspector2/organization_configuration.go | 27 ++++++++++++++----- .../organization_configuration_test.go | 27 ++++++++++--------- 3 files changed, 36 insertions(+), 19 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 12dd1c3ea341..7706243fa0da 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ ENHANCEMENTS: * resource/aws_grafana_workspace: Add `configuration` argument ([#28569](https://github.com/hashicorp/terraform-provider-aws/issues/28569)) * resource/aws_imagbuilder_component: Add `skip_destroy` argument ([#28905](https://github.com/hashicorp/terraform-provider-aws/issues/28905)) * resource/aws_lambda_event_source_mapping: Add `scaling_config` argument ([#28876](https://github.com/hashicorp/terraform-provider-aws/issues/28876)) +* resource/aws_inspector2_organization_configuration: Add `lambda` attribute in `auto_enable` ([#28823](https://github.com/hashicorp/terraform-provider-aws/issues/28823)) BUG FIXES: diff --git a/internal/service/inspector2/organization_configuration.go b/internal/service/inspector2/organization_configuration.go index 12d20f9b93c0..e013998cd151 100644 --- a/internal/service/inspector2/organization_configuration.go +++ b/internal/service/inspector2/organization_configuration.go @@ -47,6 +47,10 @@ func ResourceOrganizationConfiguration() *schema.Resource { Type: schema.TypeBool, Required: true, }, + "lambda": { + Type: schema.TypeBool, + Required: true, + }, }, }, }, @@ -117,7 +121,7 @@ func resourceOrganizationConfigurationUpdate(ctx context.Context, d *schema.Reso return create.DiagError(names.Inspector2, create.ErrActionUpdating, ResNameOrganizationConfiguration, d.Id(), err) } - if err := waitOrganizationConfigurationUpdated(ctx, conn, d.Get("auto_enable.0.ec2").(bool), d.Get("auto_enable.0.ecr").(bool), d.Timeout(schema.TimeoutUpdate)); err != nil { + if err := waitOrganizationConfigurationUpdated(ctx, conn, d.Get("auto_enable.0.ec2").(bool), d.Get("auto_enable.0.ecr").(bool), d.Get("auto_enable.0.lambda").(bool), d.Timeout(schema.TimeoutUpdate)); err != nil { return create.DiagError(names.Inspector2, create.ErrActionWaitingForUpdate, ResNameOrganizationConfiguration, d.Id(), err) } @@ -132,8 +136,9 @@ func resourceOrganizationConfigurationDelete(ctx context.Context, d *schema.Reso in := &inspector2.UpdateOrganizationConfigurationInput{ AutoEnable: &types.AutoEnable{ - Ec2: aws.Bool(false), - Ecr: aws.Bool(false), + Ec2: aws.Bool(false), + Ecr: aws.Bool(false), + Lambda: aws.Bool(false), }, } @@ -143,15 +148,15 @@ func resourceOrganizationConfigurationDelete(ctx context.Context, d *schema.Reso return create.DiagError(names.Inspector2, create.ErrActionUpdating, ResNameOrganizationConfiguration, d.Id(), err) } - if err := waitOrganizationConfigurationUpdated(ctx, conn, false, false, d.Timeout(schema.TimeoutUpdate)); err != nil { + if err := waitOrganizationConfigurationUpdated(ctx, conn, false, false, false, d.Timeout(schema.TimeoutUpdate)); err != nil { return create.DiagError(names.Inspector2, create.ErrActionWaitingForUpdate, ResNameOrganizationConfiguration, d.Id(), err) } return nil } -func waitOrganizationConfigurationUpdated(ctx context.Context, conn *inspector2.Client, ec2, ecr bool, timeout time.Duration) error { - needle := fmt.Sprintf("%t:%t", ec2, ecr) +func waitOrganizationConfigurationUpdated(ctx context.Context, conn *inspector2.Client, ec2, ecr, lambda bool, timeout time.Duration) error { + needle := fmt.Sprintf("%t:%t:%t", ec2, ecr, lambda) all := []string{ fmt.Sprintf("%t:%t", false, false), @@ -193,7 +198,7 @@ func statusOrganizationConfiguration(ctx context.Context, conn *inspector2.Clien return nil, "", err } - return out, fmt.Sprintf("%t:%t", aws.ToBool(out.AutoEnable.Ec2), aws.ToBool(out.AutoEnable.Ecr)), nil + return out, fmt.Sprintf("%t:%t:%t", aws.ToBool(out.AutoEnable.Ec2), aws.ToBool(out.AutoEnable.Ecr), aws.ToBool(out.AutoEnable.Lambda)), nil } } @@ -212,6 +217,10 @@ func flattenAutoEnable(apiObject *types.AutoEnable) map[string]interface{} { m["ecr"] = aws.ToBool(v) } + if v := apiObject.Lambda; v != nil { + m["lambda"] = aws.ToBool(v) + } + return m } @@ -230,5 +239,9 @@ func expandAutoEnable(tfMap map[string]interface{}) *types.AutoEnable { a.Ecr = aws.Bool(v) } + if v, ok := tfMap["lambda"].(bool); ok { + a.Lambda = aws.Bool(v) + } + return a } diff --git a/internal/service/inspector2/organization_configuration_test.go b/internal/service/inspector2/organization_configuration_test.go index 2034a5f7011e..8050bf1d0d22 100644 --- a/internal/service/inspector2/organization_configuration_test.go +++ b/internal/service/inspector2/organization_configuration_test.go @@ -23,9 +23,9 @@ func TestAccInspector2OrganizationConfiguration_serial(t *testing.T) { t.Parallel() testCases := map[string]func(t *testing.T){ - "basic": testAccOrganizationConfiguration_basic, - "disappears": testAccOrganizationConfiguration_disappears, - "ec2ECR": testAccOrganizationConfiguration_ec2ECR, + "basic": testAccOrganizationConfiguration_basic, + "disappears": testAccOrganizationConfiguration_disappears, + "ec2ECRLambda": testAccOrganizationConfiguration_ec2ECRLambda, } acctest.RunSerialTests1Level(t, testCases, 0) @@ -46,11 +46,12 @@ func testAccOrganizationConfiguration_basic(t *testing.T) { CheckDestroy: testAccCheckOrganizationConfigurationDestroy, Steps: []resource.TestStep{ { - Config: testAccOrganizationConfigurationConfig_basic(true, false), + Config: testAccOrganizationConfigurationConfig_basic(true, false, true), Check: resource.ComposeTestCheckFunc( testAccCheckOrganizationConfigurationExists(resourceName), resource.TestCheckResourceAttr(resourceName, "auto_enable.0.ec2", "true"), resource.TestCheckResourceAttr(resourceName, "auto_enable.0.ecr", "false"), + resource.TestCheckResourceAttr(resourceName, "auto_enable.0.lambda", "true"), ), }, }, @@ -72,7 +73,7 @@ func testAccOrganizationConfiguration_disappears(t *testing.T) { CheckDestroy: testAccCheckOrganizationConfigurationDestroy, Steps: []resource.TestStep{ { - Config: testAccOrganizationConfigurationConfig_basic(true, false), + Config: testAccOrganizationConfigurationConfig_basic(true, false, true), Check: resource.ComposeTestCheckFunc( testAccCheckOrganizationConfigurationExists(resourceName), acctest.CheckResourceDisappears(acctest.Provider, tfinspector2.ResourceOrganizationConfiguration(), resourceName), @@ -83,7 +84,7 @@ func testAccOrganizationConfiguration_disappears(t *testing.T) { }) } -func testAccOrganizationConfiguration_ec2ECR(t *testing.T) { +func testAccOrganizationConfiguration_ec2ECRLambda(t *testing.T) { resourceName := "aws_inspector2_organization_configuration.test" resource.Test(t, resource.TestCase{ @@ -98,11 +99,12 @@ func testAccOrganizationConfiguration_ec2ECR(t *testing.T) { CheckDestroy: testAccCheckOrganizationConfigurationDestroy, Steps: []resource.TestStep{ { - Config: testAccOrganizationConfigurationConfig_basic(true, true), + Config: testAccOrganizationConfigurationConfig_basic(true, true, true), Check: resource.ComposeTestCheckFunc( testAccCheckOrganizationConfigurationExists(resourceName), resource.TestCheckResourceAttr(resourceName, "auto_enable.0.ec2", "true"), resource.TestCheckResourceAttr(resourceName, "auto_enable.0.ecr", "true"), + resource.TestCheckResourceAttr(resourceName, "auto_enable.0.lambda", "true"), ), }, }, @@ -142,7 +144,7 @@ func testAccCheckOrganizationConfigurationDestroy(s *terraform.State) error { return create.Error(names.Inspector2, create.ErrActionCheckingDestroyed, tfinspector2.ResNameOrganizationConfiguration, rs.Primary.ID, err) } - if out != nil && out.AutoEnable != nil && !aws.ToBool(out.AutoEnable.Ec2) && !aws.ToBool(out.AutoEnable.Ecr) { + if out != nil && out.AutoEnable != nil && !aws.ToBool(out.AutoEnable.Ec2) && !aws.ToBool(out.AutoEnable.Ecr) && !aws.ToBool(out.AutoEnable.Lambda) { if enabledDelAdAcct { if err := testDisableDelegatedAdminAccount(ctx, conn, acctest.AccountID()); err != nil { return err @@ -217,7 +219,7 @@ func testAccCheckOrganizationConfigurationExists(name string) resource.TestCheck } } -func testAccOrganizationConfigurationConfig_basic(ec2, ecr bool) string { +func testAccOrganizationConfigurationConfig_basic(ec2, ecr, lambda bool) string { return fmt.Sprintf(` data "aws_caller_identity" "current" {} @@ -227,11 +229,12 @@ resource "aws_inspector2_delegated_admin_account" "test" { resource "aws_inspector2_organization_configuration" "test" { auto_enable { - ec2 = %[1]t - ecr = %[2]t + ec2 = %[1]t + ecr = %[2]t + lambda = %[3]t } depends_on = [aws_inspector2_delegated_admin_account.test] } -`, ec2, ecr) +`, ec2, ecr, lambda) } From 5c6b10f28517b9093fb7c7c910143c80fc15e1be Mon Sep 17 00:00:00 2001 From: Ross Gustafson Date: Wed, 18 Jan 2023 17:23:56 +0000 Subject: [PATCH 041/763] implement lambda autoenable for inspectorv2 --- .../inspector2/organization_configuration.go | 40 +++++++++++---- .../organization_configuration_test.go | 50 ++++++++++++++++++- ...2_organization_configuration.html.markdown | 8 +-- 3 files changed, 83 insertions(+), 15 deletions(-) diff --git a/internal/service/inspector2/organization_configuration.go b/internal/service/inspector2/organization_configuration.go index 12d20f9b93c0..7c0e8c8f22a2 100644 --- a/internal/service/inspector2/organization_configuration.go +++ b/internal/service/inspector2/organization_configuration.go @@ -47,6 +47,11 @@ func ResourceOrganizationConfiguration() *schema.Resource { Type: schema.TypeBool, Required: true, }, + "lambda": { + Type: schema.TypeBool, + Optional: true, + Default: false, + }, }, }, }, @@ -117,7 +122,7 @@ func resourceOrganizationConfigurationUpdate(ctx context.Context, d *schema.Reso return create.DiagError(names.Inspector2, create.ErrActionUpdating, ResNameOrganizationConfiguration, d.Id(), err) } - if err := waitOrganizationConfigurationUpdated(ctx, conn, d.Get("auto_enable.0.ec2").(bool), d.Get("auto_enable.0.ecr").(bool), d.Timeout(schema.TimeoutUpdate)); err != nil { + if err := waitOrganizationConfigurationUpdated(ctx, conn, d.Get("auto_enable.0.ec2").(bool), d.Get("auto_enable.0.ecr").(bool), d.Get("auto_enable.0.lambda").(bool), d.Timeout(schema.TimeoutUpdate)); err != nil { return create.DiagError(names.Inspector2, create.ErrActionWaitingForUpdate, ResNameOrganizationConfiguration, d.Id(), err) } @@ -132,8 +137,9 @@ func resourceOrganizationConfigurationDelete(ctx context.Context, d *schema.Reso in := &inspector2.UpdateOrganizationConfigurationInput{ AutoEnable: &types.AutoEnable{ - Ec2: aws.Bool(false), - Ecr: aws.Bool(false), + Ec2: aws.Bool(false), + Ecr: aws.Bool(false), + Lambda: aws.Bool(false), }, } @@ -143,21 +149,25 @@ func resourceOrganizationConfigurationDelete(ctx context.Context, d *schema.Reso return create.DiagError(names.Inspector2, create.ErrActionUpdating, ResNameOrganizationConfiguration, d.Id(), err) } - if err := waitOrganizationConfigurationUpdated(ctx, conn, false, false, d.Timeout(schema.TimeoutUpdate)); err != nil { + if err := waitOrganizationConfigurationUpdated(ctx, conn, false, false, false, d.Timeout(schema.TimeoutUpdate)); err != nil { return create.DiagError(names.Inspector2, create.ErrActionWaitingForUpdate, ResNameOrganizationConfiguration, d.Id(), err) } return nil } -func waitOrganizationConfigurationUpdated(ctx context.Context, conn *inspector2.Client, ec2, ecr bool, timeout time.Duration) error { - needle := fmt.Sprintf("%t:%t", ec2, ecr) +func waitOrganizationConfigurationUpdated(ctx context.Context, conn *inspector2.Client, ec2, ecr, lambda bool, timeout time.Duration) error { + needle := fmt.Sprintf("%t:%t:%t", ec2, ecr, lambda) all := []string{ - fmt.Sprintf("%t:%t", false, false), - fmt.Sprintf("%t:%t", false, true), - fmt.Sprintf("%t:%t", true, false), - fmt.Sprintf("%t:%t", true, true), + fmt.Sprintf("%t:%t:%t", false, false, false), + fmt.Sprintf("%t:%t:%t", false, true, false), + fmt.Sprintf("%t:%t:%t", false, false, true), + fmt.Sprintf("%t:%t:%t", false, true, true), + fmt.Sprintf("%t:%t:%t", true, false, false), + fmt.Sprintf("%t:%t:%t", true, false, true), + fmt.Sprintf("%t:%t:%t", true, true, false), + fmt.Sprintf("%t:%t:%t", true, true, true), } for i, v := range all { @@ -193,7 +203,7 @@ func statusOrganizationConfiguration(ctx context.Context, conn *inspector2.Clien return nil, "", err } - return out, fmt.Sprintf("%t:%t", aws.ToBool(out.AutoEnable.Ec2), aws.ToBool(out.AutoEnable.Ecr)), nil + return out, fmt.Sprintf("%t:%t:%t", aws.ToBool(out.AutoEnable.Ec2), aws.ToBool(out.AutoEnable.Ecr), aws.ToBool(out.AutoEnable.Lambda)), nil } } @@ -212,6 +222,10 @@ func flattenAutoEnable(apiObject *types.AutoEnable) map[string]interface{} { m["ecr"] = aws.ToBool(v) } + if v := apiObject.Lambda; v != nil { + m["lambda"] = aws.ToBool(v) + } + return m } @@ -230,5 +244,9 @@ func expandAutoEnable(tfMap map[string]interface{}) *types.AutoEnable { a.Ecr = aws.Bool(v) } + if v, ok := tfMap["lambda"].(bool); ok { + a.Lambda = aws.Bool(v) + } + return a } diff --git a/internal/service/inspector2/organization_configuration_test.go b/internal/service/inspector2/organization_configuration_test.go index 2034a5f7011e..ae528e72dbe5 100644 --- a/internal/service/inspector2/organization_configuration_test.go +++ b/internal/service/inspector2/organization_configuration_test.go @@ -26,6 +26,7 @@ func TestAccInspector2OrganizationConfiguration_serial(t *testing.T) { "basic": testAccOrganizationConfiguration_basic, "disappears": testAccOrganizationConfiguration_disappears, "ec2ECR": testAccOrganizationConfiguration_ec2ECR, + "lambda": testAccOrganizationConfiguration_lambda, } acctest.RunSerialTests1Level(t, testCases, 0) @@ -109,6 +110,33 @@ func testAccOrganizationConfiguration_ec2ECR(t *testing.T) { }) } +func testAccOrganizationConfiguration_lambda(t *testing.T) { + resourceName := "aws_inspector2_organization_configuration.test" + + resource.Test(t, resource.TestCase{ + PreCheck: func() { + acctest.PreCheck(t) + acctest.PreCheckPartitionHasService(names.Inspector2EndpointID, t) + testAccPreCheck(t) + acctest.PreCheckOrganizationManagementAccount(t) + }, + ErrorCheck: acctest.ErrorCheck(t, names.Inspector2EndpointID), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + CheckDestroy: testAccCheckOrganizationConfigurationDestroy, + Steps: []resource.TestStep{ + { + Config: testAccOrganizationConfigurationConfig_lambda(false, false, true), + Check: resource.ComposeTestCheckFunc( + testAccCheckOrganizationConfigurationExists(resourceName), + resource.TestCheckResourceAttr(resourceName, "auto_enable.0.ec2", "false"), + resource.TestCheckResourceAttr(resourceName, "auto_enable.0.ecr", "false"), + resource.TestCheckResourceAttr(resourceName, "auto_enable.0.lambda", "true"), + ), + }, + }, + }) +} + func testAccCheckOrganizationConfigurationDestroy(s *terraform.State) error { conn := acctest.Provider.Meta().(*conns.AWSClient).Inspector2Client() ctx := context.Background() @@ -142,7 +170,7 @@ func testAccCheckOrganizationConfigurationDestroy(s *terraform.State) error { return create.Error(names.Inspector2, create.ErrActionCheckingDestroyed, tfinspector2.ResNameOrganizationConfiguration, rs.Primary.ID, err) } - if out != nil && out.AutoEnable != nil && !aws.ToBool(out.AutoEnable.Ec2) && !aws.ToBool(out.AutoEnable.Ecr) { + if out != nil && out.AutoEnable != nil && !aws.ToBool(out.AutoEnable.Ec2) && !aws.ToBool(out.AutoEnable.Ecr) && !aws.ToBool(out.AutoEnable.Lambda) { if enabledDelAdAcct { if err := testDisableDelegatedAdminAccount(ctx, conn, acctest.AccountID()); err != nil { return err @@ -235,3 +263,23 @@ resource "aws_inspector2_organization_configuration" "test" { } `, ec2, ecr) } + +func testAccOrganizationConfigurationConfig_lambda(ec2, ecr, lambda bool) string { + return fmt.Sprintf(` +data "aws_caller_identity" "current" {} + +resource "aws_inspector2_delegated_admin_account" "test" { + account_id = data.aws_caller_identity.current.account_id +} + +resource "aws_inspector2_organization_configuration" "test" { + auto_enable { + ec2 = %[1]t + ecr = %[2]t + lambda = %[3]t + } + + depends_on = [aws_inspector2_delegated_admin_account.test] +} +`, ec2, ecr, lambda) +} diff --git a/website/docs/r/inspector2_organization_configuration.html.markdown b/website/docs/r/inspector2_organization_configuration.html.markdown index dbaf5187554e..772977747b1e 100644 --- a/website/docs/r/inspector2_organization_configuration.html.markdown +++ b/website/docs/r/inspector2_organization_configuration.html.markdown @@ -12,7 +12,7 @@ Terraform resource for managing an AWS Inspector V2 Organization Configuration. ~> **NOTE:** In order for this resource to work, the account you use must be an Inspector V2 Delegated Admin Account. -~> **NOTE:** When this resource is deleted, EC2 and ECR scans will no longer be automatically enabled for new members of your Amazon Inspector organization. +~> **NOTE:** When this resource is deleted, EC2, ECR and Lambda scans will no longer be automatically enabled for new members of your Amazon Inspector organization. ## Example Usage @@ -21,8 +21,9 @@ Terraform resource for managing an AWS Inspector V2 Organization Configuration. ```terraform resource "aws_inspector2_organization_configuration" "example" { auto_enable { - ec2 = true - ecr = false + ec2 = true + ecr = false + lambda = true } } ``` @@ -37,6 +38,7 @@ The following arguments are required: * `ec2` - (Required) Whether Amazon EC2 scans are automatically enabled for new members of your Amazon Inspector organization. * `ecr` - (Required) Whether Amazon ECR scans are automatically enabled for new members of your Amazon Inspector organization. +* `lambda` - (Optional) Whether Lambda Function scans are automatically enabled for new members of your Amazon Inspector organization. ## Attributes Reference From 3beb28322d624b077267f4a8c473f5e2b55dd9f4 Mon Sep 17 00:00:00 2001 From: Ross Gustafson Date: Thu, 19 Jan 2023 10:20:30 +0000 Subject: [PATCH 042/763] formatting --- .../service/inspector2/organization_configuration_test.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/internal/service/inspector2/organization_configuration_test.go b/internal/service/inspector2/organization_configuration_test.go index ae528e72dbe5..52ea29a00986 100644 --- a/internal/service/inspector2/organization_configuration_test.go +++ b/internal/service/inspector2/organization_configuration_test.go @@ -274,9 +274,9 @@ resource "aws_inspector2_delegated_admin_account" "test" { resource "aws_inspector2_organization_configuration" "test" { auto_enable { - ec2 = %[1]t - ecr = %[2]t - lambda = %[3]t + ec2 = %[1]t + ecr = %[2]t + lambda = %[3]t } depends_on = [aws_inspector2_delegated_admin_account.test] From c22fbc608a677394abd6ac35239e6969f133f76e Mon Sep 17 00:00:00 2001 From: Kamil Turek Date: Fri, 20 Jan 2023 21:52:22 +0100 Subject: [PATCH 043/763] Implement ListConfigurationSetPages --- internal/service/sesv2/list.go | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 internal/service/sesv2/list.go diff --git a/internal/service/sesv2/list.go b/internal/service/sesv2/list.go new file mode 100644 index 000000000000..71bb0ff5ef4e --- /dev/null +++ b/internal/service/sesv2/list.go @@ -0,0 +1,26 @@ +package sesv2 + +import ( + "context" + + "github.com/aws/aws-sdk-go-v2/aws" + "github.com/aws/aws-sdk-go-v2/service/sesv2" +) + +func ListConfigurationSetsPages(ctx context.Context, conn *sesv2.Client, in *sesv2.ListConfigurationSetsInput, fn func(*sesv2.ListConfigurationSetsOutput, bool) bool) error { + for { + out, err := conn.ListConfigurationSets(ctx, in) + if err != nil { + return err + } + + lastPage := aws.ToString(out.NextToken) == "" + if !fn(out, lastPage) || lastPage { + break + } + + in.NextToken = out.NextToken + } + + return nil +} From 8adb6684bc9b19b566691a42e24e2342d6799f56 Mon Sep 17 00:00:00 2001 From: Kamil Turek Date: Fri, 20 Jan 2023 21:52:48 +0100 Subject: [PATCH 044/763] Implement and register the sweeper --- internal/service/sesv2/sweep.go | 69 +++++++++++++++++++++++++++++++++ internal/sweep/sweep_test.go | 1 + 2 files changed, 70 insertions(+) create mode 100644 internal/service/sesv2/sweep.go diff --git a/internal/service/sesv2/sweep.go b/internal/service/sesv2/sweep.go new file mode 100644 index 000000000000..70f42f57d877 --- /dev/null +++ b/internal/service/sesv2/sweep.go @@ -0,0 +1,69 @@ +//go:build sweep +// +build sweep + +package sesv2 + +import ( + "fmt" + "log" + + "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-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/sweep" +) + +func init() { + resource.AddTestSweepers("aws_sesv2_configuration_set", &resource.Sweeper{ + Name: "aws_sesv2_configuration_set", + F: sweepConfigurationSets, + }) +} + +func sweepConfigurationSets(region string) error { + ctx := sweep.Context(region) + client, err := sweep.SharedRegionalSweepClient(region) + + if err != nil { + return fmt.Errorf("getting client: %w", err) + } + + conn := client.(*conns.AWSClient).SESV2Client() + sweepResources := make([]sweep.Sweepable, 0) + var errs *multierror.Error + + input := &sesv2.ListConfigurationSetsInput{} + + err = ListConfigurationSetsPages(ctx, conn, input, func(page *sesv2.ListConfigurationSetsOutput, lastPage bool) bool { + if page == nil { + return !lastPage + } + + for _, configurationSet := range page.ConfigurationSets { + r := ResourceConfigurationSet() + d := r.Data(nil) + + d.SetId(configurationSet) + + sweepResources = append(sweepResources, sweep.NewSweepResource(r, d, client)) + } + + return !lastPage + }) + + if err != nil { + errs = multierror.Append(errs, fmt.Errorf("listing Configuration Sets for %s: %w", region, err)) + } + + if err := sweep.SweepOrchestratorWithContext(ctx, sweepResources); err != nil { + errs = multierror.Append(errs, fmt.Errorf("sweeping Configuration Sets for %s: %w", region, err)) + } + + if sweep.SkipSweepError(err) { + log.Printf("[WARN] Skipping Configuration Sets sweep for %s: %s", region, errs) + return nil + } + + return errs.ErrorOrNil() +} diff --git a/internal/sweep/sweep_test.go b/internal/sweep/sweep_test.go index f5b32310778c..1b58305e1651 100644 --- a/internal/sweep/sweep_test.go +++ b/internal/sweep/sweep_test.go @@ -123,6 +123,7 @@ import ( _ "github.com/hashicorp/terraform-provider-aws/internal/service/servicecatalog" _ "github.com/hashicorp/terraform-provider-aws/internal/service/servicediscovery" _ "github.com/hashicorp/terraform-provider-aws/internal/service/ses" + _ "github.com/hashicorp/terraform-provider-aws/internal/service/sesv2" _ "github.com/hashicorp/terraform-provider-aws/internal/service/sfn" _ "github.com/hashicorp/terraform-provider-aws/internal/service/simpledb" _ "github.com/hashicorp/terraform-provider-aws/internal/service/sns" From 60ec559e5339cbc6a67200ec3f1e50364245b55a Mon Sep 17 00:00:00 2001 From: Jim Razmus II Date: Tue, 7 Feb 2023 15:24:33 -0600 Subject: [PATCH 045/763] Add default_value to the cost category data source. --- internal/service/ce/cost_category_data_source.go | 5 +++++ internal/service/ce/cost_category_data_source_test.go | 1 + website/docs/d/ce_cost_category.html.markdown | 1 + 3 files changed, 7 insertions(+) diff --git a/internal/service/ce/cost_category_data_source.go b/internal/service/ce/cost_category_data_source.go index 9b98b06e8304..4fe0c01c1bf7 100644 --- a/internal/service/ce/cost_category_data_source.go +++ b/internal/service/ce/cost_category_data_source.go @@ -24,6 +24,10 @@ func DataSourceCostCategory() *schema.Resource { Type: schema.TypeString, Required: true, }, + "default_value": { + Type: schema.TypeString, + Computed: true, + }, "effective_end": { Type: schema.TypeString, Computed: true, @@ -321,6 +325,7 @@ func dataSourceCostCategoryRead(ctx context.Context, d *schema.ResourceData, met return create.DiagError(names.CE, create.ErrActionReading, ResNameCostCategory, d.Id(), err) } + d.Set("default_value", costCategory.DefaultValue) d.Set("effective_end", costCategory.EffectiveEnd) d.Set("effective_start", costCategory.EffectiveStart) d.Set("name", costCategory.Name) diff --git a/internal/service/ce/cost_category_data_source_test.go b/internal/service/ce/cost_category_data_source_test.go index 095952c5fb2c..6eae05efa22e 100644 --- a/internal/service/ce/cost_category_data_source_test.go +++ b/internal/service/ce/cost_category_data_source_test.go @@ -26,6 +26,7 @@ func TestAccCECostCategoryDataSource_basic(t *testing.T) { Check: resource.ComposeTestCheckFunc( testAccCheckCostCategoryExists(ctx, resourceName, &output), resource.TestCheckResourceAttrPair(dataSourceName, "cost_category_arn", resourceName, "arn"), + resource.TestCheckResourceAttrPair(dataSourceName, "default_value", resourceName, "default_value"), resource.TestCheckResourceAttrPair(dataSourceName, "name", resourceName, "name"), resource.TestCheckResourceAttrPair(dataSourceName, "rule_version", resourceName, "rule_version"), resource.TestCheckResourceAttrPair(dataSourceName, "rule.%", resourceName, "rule.%"), diff --git a/website/docs/d/ce_cost_category.html.markdown b/website/docs/d/ce_cost_category.html.markdown index fcbf026e5e5d..4bdcca5c309c 100644 --- a/website/docs/d/ce_cost_category.html.markdown +++ b/website/docs/d/ce_cost_category.html.markdown @@ -29,6 +29,7 @@ The following arguments are required: In addition to all arguments above, the following attributes are exported: * `arn` - ARN of the cost category. +* `default_value` - Default value for the cost category. * `effective_end` - Effective end data of your Cost Category. * `effective_start` - Effective state data of your Cost Category. * `id` - Unique ID of the cost category. From bbff5414e515a0459e8e9f850871a5c04c937f5a Mon Sep 17 00:00:00 2001 From: Matt Burgess <549318+mattburgess@users.noreply.github.com> Date: Sun, 5 Feb 2023 17:29:35 +0000 Subject: [PATCH 046/763] r/flow_log: Add `cross_account_iam_role_arn` attribute --- internal/service/ec2/vpc_flow_log.go | 11 +++ internal/service/ec2/vpc_flow_log_test.go | 113 ++++++++++++++++++++++ website/docs/r/flow_log.html.markdown | 1 + 3 files changed, 125 insertions(+) diff --git a/internal/service/ec2/vpc_flow_log.go b/internal/service/ec2/vpc_flow_log.go index f1103fc82835..3974d72b9d63 100644 --- a/internal/service/ec2/vpc_flow_log.go +++ b/internal/service/ec2/vpc_flow_log.go @@ -37,6 +37,12 @@ func ResourceFlowLog() *schema.Resource { Type: schema.TypeString, Computed: true, }, + "cross_account_iam_role_arn": { + Type: schema.TypeString, + Optional: true, + ForceNew: true, + ValidateFunc: verify.ValidARN, + }, "destination_options": { Type: schema.TypeList, Optional: true, @@ -210,6 +216,10 @@ func resourceLogFlowCreate(ctx context.Context, d *schema.ResourceData, meta int input.DestinationOptions = expandDestinationOptionsRequest(v.([]interface{})[0].(map[string]interface{})) } + if v, ok := d.GetOk("cross_account_iam_role_arn"); ok { + input.DeliverCrossAccountRole = aws.String(v.(string)) + } + if v, ok := d.GetOk("iam_role_arn"); ok { input.DeliverLogsPermissionArn = aws.String(v.(string)) } @@ -275,6 +285,7 @@ func resourceLogFlowRead(ctx context.Context, d *schema.ResourceData, meta inter Resource: fmt.Sprintf("vpc-flow-log/%s", d.Id()), }.String() d.Set("arn", arn) + d.Set("cross_account_iam_role_arn", fl.DeliverCrossAccountRole) if fl.DestinationOptions != nil { if err := d.Set("destination_options", []interface{}{flattenDestinationOptionsResponse(fl.DestinationOptions)}); err != nil { return sdkdiag.AppendErrorf(diags, "setting destination_options: %s", err) diff --git a/internal/service/ec2/vpc_flow_log_test.go b/internal/service/ec2/vpc_flow_log_test.go index 99b0af570885..747aa4042a57 100644 --- a/internal/service/ec2/vpc_flow_log_test.go +++ b/internal/service/ec2/vpc_flow_log_test.go @@ -128,6 +128,46 @@ func TestAccVPCFlowLog_subnetID(t *testing.T) { }) } +func TestAccVPCFlowLog_crossAccountRole(t *testing.T) { + ctx := acctest.Context(t) + var flowLog ec2.FlowLog + cloudwatchLogGroupResourceName := "aws_cloudwatch_log_group.test" + crossAccountIamRoleResourceName := "aws_iam_role.test_cross_account" + iamRoleResourceName := "aws_iam_role.test" + resourceName := "aws_flow_log.test" + subnetResourceName := "aws_subnet.test" + rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) + rName2 := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { acctest.PreCheck(t) }, + ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + CheckDestroy: testAccCheckFlowLogDestroy(ctx), + Steps: []resource.TestStep{ + { + Config: testAccVPCFlowLogConfig_crossAccountRole(rName, rName2), + Check: resource.ComposeTestCheckFunc( + testAccCheckFlowLogExists(ctx, resourceName, &flowLog), + resource.TestCheckResourceAttrPair(resourceName, "cross_account_iam_role_arn", crossAccountIamRoleResourceName, "arn"), + resource.TestCheckResourceAttrPair(resourceName, "iam_role_arn", iamRoleResourceName, "arn"), + resource.TestCheckResourceAttr(resourceName, "log_destination", ""), + resource.TestCheckResourceAttr(resourceName, "log_destination_type", "cloud-watch-logs"), + resource.TestCheckResourceAttrPair(resourceName, "log_group_name", cloudwatchLogGroupResourceName, "name"), + resource.TestCheckResourceAttr(resourceName, "max_aggregation_interval", "600"), + resource.TestCheckResourceAttrPair(resourceName, "subnet_id", subnetResourceName, "id"), + resource.TestCheckResourceAttr(resourceName, "traffic_type", "ALL"), + ), + }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, + }, + }) +} + func TestAccVPCFlowLog_transitGatewayID(t *testing.T) { ctx := acctest.Context(t) var flowLog ec2.FlowLog @@ -859,6 +899,79 @@ resource "aws_flow_log" "test" { `, rName)) } +func testAccVPCFlowLogConfig_crossAccountRole(rName string, rName2 string) string { + return acctest.ConfigCompose(testAccFlowLogConfigBase(rName), fmt.Sprintf(` +resource "aws_subnet" "test" { + cidr_block = "10.0.1.0/24" + vpc_id = aws_vpc.test.id + + tags = { + Name = %[1]q + } +} + +data "aws_partition" "current" {} + +resource "aws_iam_role" "test" { + name = %[1]q + + assume_role_policy = < Date: Sun, 5 Feb 2023 17:38:39 +0000 Subject: [PATCH 047/763] Add Changelog entry --- .changelog/29254.txt | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 .changelog/29254.txt diff --git a/.changelog/29254.txt b/.changelog/29254.txt new file mode 100644 index 000000000000..056e906d1dec --- /dev/null +++ b/.changelog/29254.txt @@ -0,0 +1,3 @@ +```release-note:enhancement +resource/aws_flow_log: Add `cross_account_iam_role_arn` attribute +``` From 341ea5d725867a7b268c5b1dae5d63dfe8fc2e0d Mon Sep 17 00:00:00 2001 From: Kevin Chun Date: Tue, 21 Feb 2023 12:01:22 +1100 Subject: [PATCH 048/763] Add SSMContacts to names/names.go --- names/names.go | 1 + 1 file changed, 1 insertion(+) diff --git a/names/names.go b/names/names.go index 0b074d70ef4a..850f6b7f8517 100644 --- a/names/names.go +++ b/names/names.go @@ -40,6 +40,7 @@ const ( SchedulerEndpointID = "scheduler" SESV2EndpointID = "sesv2" SSMEndpointID = "ssm" + SSMContactsEndpointId = "ssm-contacts" TranscribeEndpointID = "transcribe" ) From a5665813887b2f0724758c30145a7c116079bfb5 Mon Sep 17 00:00:00 2001 From: Kevin Chun Date: Tue, 21 Feb 2023 12:02:08 +1100 Subject: [PATCH 049/763] get ssmcontacts v1.14.3 --- go.mod | 1 + go.sum | 3 +++ 2 files changed, 4 insertions(+) diff --git a/go.mod b/go.mod index fdd2d045be68..896bc85a2e49 100644 --- a/go.mod +++ b/go.mod @@ -83,6 +83,7 @@ require ( github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.9.23 // indirect github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.13.23 // indirect github.com/aws/aws-sdk-go-v2/service/sso v1.12.3 // indirect + github.com/aws/aws-sdk-go-v2/service/ssmcontacts v1.14.3 // indirect github.com/aws/aws-sdk-go-v2/service/ssooidc v1.14.3 // indirect github.com/aws/aws-sdk-go-v2/service/sts v1.18.4 // indirect github.com/bgentry/speakeasy v0.1.0 // indirect diff --git a/go.sum b/go.sum index 9198ac8a9093..47ec9b951084 100644 --- a/go.sum +++ b/go.sum @@ -38,6 +38,7 @@ github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.12.23/go.mod h1:mOtmAg65GT1HIL/ github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.28/go.mod h1:3lwChorpIM/BhImY/hy+Z6jekmN92cXGPI1QJasVPYY= github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.29 h1:9/aKwwus0TQxppPXFmf010DFrE+ssSbzroLVYINA+xE= github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.29/go.mod h1:Dip3sIGv485+xerzVv24emnjX5Sg88utCL8fwGmCeWg= +github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.22 h1:7AwGYXDdqRQYsluvKFmWoqpcOQJ4bH634SkYf3FNj/A= github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.22/go.mod h1:EqK7gVrIGAHyZItrD1D8B0ilgwMD1GiWAmbU4u/JHNk= github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.23 h1:b/Vn141DBuLVgXbhRWIrl9g+ww7G+ScV5SzniWR13jQ= github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.23/go.mod h1:mr6c4cHC+S/MMkrjtSlG4QA36kOznDep+0fga5L/fGQ= @@ -94,6 +95,8 @@ github.com/aws/aws-sdk-go-v2/service/sesv2 v1.16.3 h1:0Nh5PsMu4mmPbRNqZQiGO6BZit github.com/aws/aws-sdk-go-v2/service/sesv2 v1.16.3/go.mod h1:uIM2GAheOB6xz7UuG5By72Zw2B/20fViFsbDY1JVTVY= github.com/aws/aws-sdk-go-v2/service/ssm v1.35.4 h1:SsnvRej4YNUIRn9oQ1zvt3Sra1cmkAwyePEIaXpz2hc= github.com/aws/aws-sdk-go-v2/service/ssm v1.35.4/go.mod h1:DlzAqaXaUSJVQGuZrGPb4TWTkDG6vUs5OiIoX0AxjkU= +github.com/aws/aws-sdk-go-v2/service/ssmcontacts v1.14.3 h1:51jPnor4Xf6myN5ylSvGl7XgeOhKE93XIZ21EpsmSpg= +github.com/aws/aws-sdk-go-v2/service/ssmcontacts v1.14.3/go.mod h1:t9IGXyK+eDt/FSGD2mLQgNS5nK1J+37r0d7jI4d8hqs= github.com/aws/aws-sdk-go-v2/service/ssmincidents v1.20.3 h1:wNrzSFTDuB7roMB5QHjyFUWq8fyMSPVDV7V7fwM0ous= github.com/aws/aws-sdk-go-v2/service/ssmincidents v1.20.3/go.mod h1:hYnjkk6Qz1eI1aXZVWXdmcyb3HGK1sPAFM8efXREt5Q= github.com/aws/aws-sdk-go-v2/service/sso v1.12.1/go.mod h1:IgV8l3sj22nQDd5qcAGY0WenwCzCphqdbFOpfktZPrI= From 38bf676b449ca9ce2fe413b93aeb32dd0335bf2c Mon Sep 17 00:00:00 2001 From: Kevin Chun Date: Tue, 21 Feb 2023 15:37:18 +1100 Subject: [PATCH 050/763] config to use v2 for ssmcontacts --- names/names_data.csv | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/names/names_data.csv b/names/names_data.csv index a83edb57106d..3f8e57d16a94 100644 --- a/names/names_data.csv +++ b/names/names_data.csv @@ -327,7 +327,7 @@ snowball,snowball,snowball,snowball,,snowball,,,Snowball,Snowball,,1,,,aws_snowb sns,sns,sns,sns,,sns,,,SNS,SNS,,1,,,aws_sns_,,sns_,SNS (Simple Notification),Amazon,,,,, sqs,sqs,sqs,sqs,,sqs,,,SQS,SQS,,1,,,aws_sqs_,,sqs_,SQS (Simple Queue),Amazon,,,,, ssm,ssm,ssm,ssm,,ssm,,,SSM,SSM,,1,2,,aws_ssm_,,ssm_,SSM (Systems Manager),AWS,,,,, -ssm-contacts,ssmcontacts,ssmcontacts,ssmcontacts,,ssmcontacts,,,SSMContacts,SSMContacts,,1,,,aws_ssmcontacts_,,ssmcontacts_,SSM Incident Manager Contacts,AWS,,,,, +ssm-contacts,ssmcontacts,ssmcontacts,ssmcontacts,,ssmcontacts,,,SSMContacts,SSMContacts,,,2,,aws_ssmcontacts_,,ssmcontacts_,SSM Incident Manager Contacts,AWS,,,,, ssm-incidents,ssmincidents,ssmincidents,ssmincidents,,ssmincidents,,,SSMIncidents,SSMIncidents,,,2,,aws_ssmincidents_,,ssmincidents_,SSM Incident Manager Incidents,AWS,,,,, sso,sso,sso,sso,,sso,,,SSO,SSO,,1,,,aws_sso_,,sso_,SSO (Single Sign-On),AWS,,,,, sso-admin,ssoadmin,ssoadmin,ssoadmin,,ssoadmin,,,SSOAdmin,SSOAdmin,,1,,,aws_ssoadmin_,,ssoadmin_,SSO Admin,AWS,,,,, From cbc3f7e6363ab5ec3963526cdfdf2b2c4a1bc0af Mon Sep 17 00:00:00 2001 From: Kevin Chun Date: Tue, 21 Feb 2023 15:37:41 +1100 Subject: [PATCH 051/763] run make gen --- internal/conns/awsclient_gen.go | 8 ++++---- internal/conns/config_gen.go | 8 ++++++-- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/internal/conns/awsclient_gen.go b/internal/conns/awsclient_gen.go index 51ef6d82d9e3..5a5649a1c611 100644 --- a/internal/conns/awsclient_gen.go +++ b/internal/conns/awsclient_gen.go @@ -26,6 +26,7 @@ import ( "github.com/aws/aws-sdk-go-v2/service/scheduler" "github.com/aws/aws-sdk-go-v2/service/sesv2" ssm_sdkv2 "github.com/aws/aws-sdk-go-v2/service/ssm" + "github.com/aws/aws-sdk-go-v2/service/ssmcontacts" "github.com/aws/aws-sdk-go-v2/service/ssmincidents" "github.com/aws/aws-sdk-go-v2/service/transcribe" "github.com/aws/aws-sdk-go/aws/session" @@ -291,7 +292,6 @@ import ( "github.com/aws/aws-sdk-go/service/sns" "github.com/aws/aws-sdk-go/service/sqs" "github.com/aws/aws-sdk-go/service/ssm" - "github.com/aws/aws-sdk-go/service/ssmcontacts" "github.com/aws/aws-sdk-go/service/sso" "github.com/aws/aws-sdk-go/service/ssoadmin" "github.com/aws/aws-sdk-go/service/ssooidc" @@ -601,7 +601,7 @@ type AWSClient struct { snsConn *sns.SNS sqsConn *sqs.SQS ssmConn *ssm.SSM - ssmcontactsConn *ssmcontacts.SSMContacts + ssmcontactsClient *ssmcontacts.Client ssmincidentsClient *ssmincidents.Client ssoConn *sso.SSO ssoadminConn *ssoadmin.SSOAdmin @@ -1707,8 +1707,8 @@ func (client *AWSClient) SSMClient() *ssm_sdkv2.Client { return client.ssmClient.Client() } -func (client *AWSClient) SSMContactsConn() *ssmcontacts.SSMContacts { - return client.ssmcontactsConn +func (client *AWSClient) SSMContactsClient() *ssmcontacts.Client { + return client.ssmcontactsClient } func (client *AWSClient) SSMIncidentsClient() *ssmincidents.Client { diff --git a/internal/conns/config_gen.go b/internal/conns/config_gen.go index 59d5eccf2038..0907ff91df45 100644 --- a/internal/conns/config_gen.go +++ b/internal/conns/config_gen.go @@ -24,6 +24,7 @@ import ( "github.com/aws/aws-sdk-go-v2/service/scheduler" "github.com/aws/aws-sdk-go-v2/service/sesv2" ssm_sdkv2 "github.com/aws/aws-sdk-go-v2/service/ssm" + "github.com/aws/aws-sdk-go-v2/service/ssmcontacts" "github.com/aws/aws-sdk-go-v2/service/ssmincidents" "github.com/aws/aws-sdk-go-v2/service/transcribe" "github.com/aws/aws-sdk-go/aws" @@ -284,7 +285,6 @@ import ( "github.com/aws/aws-sdk-go/service/sns" "github.com/aws/aws-sdk-go/service/sqs" "github.com/aws/aws-sdk-go/service/ssm" - "github.com/aws/aws-sdk-go/service/ssmcontacts" "github.com/aws/aws-sdk-go/service/sso" "github.com/aws/aws-sdk-go/service/ssoadmin" "github.com/aws/aws-sdk-go/service/ssooidc" @@ -552,7 +552,6 @@ func (c *Config) sdkv1Conns(client *AWSClient, sess *session.Session) { client.snsConn = sns.New(sess.Copy(&aws.Config{Endpoint: aws.String(c.Endpoints[names.SNS])})) client.sqsConn = sqs.New(sess.Copy(&aws.Config{Endpoint: aws.String(c.Endpoints[names.SQS])})) client.ssmConn = ssm.New(sess.Copy(&aws.Config{Endpoint: aws.String(c.Endpoints[names.SSM])})) - client.ssmcontactsConn = ssmcontacts.New(sess.Copy(&aws.Config{Endpoint: aws.String(c.Endpoints[names.SSMContacts])})) client.ssoConn = sso.New(sess.Copy(&aws.Config{Endpoint: aws.String(c.Endpoints[names.SSO])})) client.ssoadminConn = ssoadmin.New(sess.Copy(&aws.Config{Endpoint: aws.String(c.Endpoints[names.SSOAdmin])})) client.ssooidcConn = ssooidc.New(sess.Copy(&aws.Config{Endpoint: aws.String(c.Endpoints[names.SSOOIDC])})) @@ -676,6 +675,11 @@ func (c *Config) sdkv2Conns(client *AWSClient, cfg aws_sdkv2.Config) { o.EndpointResolver = sesv2.EndpointResolverFromURL(endpoint) } }) + client.ssmcontactsClient = ssmcontacts.NewFromConfig(cfg, func(o *ssmcontacts.Options) { + if endpoint := c.Endpoints[names.SSMContacts]; endpoint != "" { + o.EndpointResolver = ssmcontacts.EndpointResolverFromURL(endpoint) + } + }) client.ssmincidentsClient = ssmincidents.NewFromConfig(cfg, func(o *ssmincidents.Options) { if endpoint := c.Endpoints[names.SSMIncidents]; endpoint != "" { o.EndpointResolver = ssmincidents.EndpointResolverFromURL(endpoint) From f4d0cec8f4358dc4d3ea6c773459c564e409176e Mon Sep 17 00:00:00 2001 From: Kevin Chun Date: Tue, 21 Feb 2023 15:48:48 +1100 Subject: [PATCH 052/763] fix formatting issue --- names/names.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/names/names.go b/names/names.go index 850f6b7f8517..4538d92c84cc 100644 --- a/names/names.go +++ b/names/names.go @@ -40,7 +40,7 @@ const ( SchedulerEndpointID = "scheduler" SESV2EndpointID = "sesv2" SSMEndpointID = "ssm" - SSMContactsEndpointId = "ssm-contacts" + SSMContactsEndpointId = "ssm-contacts" TranscribeEndpointID = "transcribe" ) From b9506bdca3847c1abb447c2a5c77d016a57023bb Mon Sep 17 00:00:00 2001 From: tomwelsh11 Date: Wed, 22 Feb 2023 19:02:51 +1100 Subject: [PATCH 053/763] feat: add create_native_delta_table sub argument to aws_glue_crawler delta_target argument --- internal/service/glue/crawler.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/internal/service/glue/crawler.go b/internal/service/glue/crawler.go index ea7b18ce29a0..9a1188d915a3 100644 --- a/internal/service/glue/crawler.go +++ b/internal/service/glue/crawler.go @@ -118,6 +118,10 @@ func ResourceCrawler() *schema.Resource { Type: schema.TypeBool, Required: true, }, + "create_native_delta_table": { + Type: schema.TypeBool, + Required: true, + }, }, }, }, @@ -738,6 +742,7 @@ func expandDeltaTarget(cfg map[string]interface{}) *glue.DeltaTarget { target := &glue.DeltaTarget{ DeltaTables: flex.ExpandStringSet(cfg["delta_tables"].(*schema.Set)), WriteManifest: aws.Bool(cfg["write_manifest"].(bool)), + CreateNativeDeltaTable: aws.Bool(cfg["create_native_delta_table"].(bool)), } if v, ok := cfg["connection_name"].(string); ok { @@ -997,6 +1002,7 @@ func flattenDeltaTargets(deltaTargets []*glue.DeltaTarget) []map[string]interfac attrs["connection_name"] = aws.StringValue(deltaTarget.ConnectionName) attrs["delta_tables"] = flex.FlattenStringSet(deltaTarget.DeltaTables) attrs["write_manifest"] = aws.BoolValue(deltaTarget.WriteManifest) + attrs["create_native_delta_table"] = aws.BoolValue(deltaTarget.CreateNativeDeltaTable) result = append(result, attrs) } From 381b4a5f216052dab0f3fadfdfebede5b97dc42b Mon Sep 17 00:00:00 2001 From: tomwelsh11 Date: Wed, 22 Feb 2023 19:03:32 +1100 Subject: [PATCH 054/763] docs: Add documentation for create_native_delta_table sub argument in delta_target block --- website/docs/r/glue_crawler.html.markdown | 1 + 1 file changed, 1 insertion(+) diff --git a/website/docs/r/glue_crawler.html.markdown b/website/docs/r/glue_crawler.html.markdown index 37f076841d86..cabe77e32869 100644 --- a/website/docs/r/glue_crawler.html.markdown +++ b/website/docs/r/glue_crawler.html.markdown @@ -196,6 +196,7 @@ The following arguments are supported: * `connection_name` - (Optional) The name of the connection to use to connect to the Delta table target. * `delta_tables` - (Required) A list of the Amazon S3 paths to the Delta tables. * `write_manifest` - (Required) Specifies whether to write the manifest files to the Delta table path. +* `create_native_delta_table` (Required) Specifies whether the crawler will create native tables, to allow integration with query engines that support querying of the Delta transaction log directly. ### Schema Change Policy From 6878ebf3f9ee661bb821d379bb1094c7f196631b Mon Sep 17 00:00:00 2001 From: tomwelsh11 Date: Wed, 22 Feb 2023 19:10:56 +1100 Subject: [PATCH 055/763] test: Add create_native_delta_table option to delta_target glue test --- internal/service/glue/crawler_test.go | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/internal/service/glue/crawler_test.go b/internal/service/glue/crawler_test.go index 11099de6bdc0..1680f5068145 100644 --- a/internal/service/glue/crawler_test.go +++ b/internal/service/glue/crawler_test.go @@ -536,6 +536,7 @@ func TestAccGlueCrawler_deltaTarget(t *testing.T) { resource.TestCheckResourceAttr(resourceName, "delta_target.0.delta_tables.#", "1"), resource.TestCheckTypeSetElemAttr(resourceName, "delta_target.0.delta_tables.*", "s3://table1"), resource.TestCheckResourceAttr(resourceName, "delta_target.0.write_manifest", "false"), + resource.TestCheckResourceAttr(resourceName, "delta_target.0.create_native_delta_table", "false"), ), }, { @@ -552,6 +553,7 @@ func TestAccGlueCrawler_deltaTarget(t *testing.T) { resource.TestCheckResourceAttr(resourceName, "delta_target.0.delta_tables.#", "1"), resource.TestCheckTypeSetElemAttr(resourceName, "delta_target.0.delta_tables.*", "s3://table2"), resource.TestCheckResourceAttr(resourceName, "delta_target.0.write_manifest", "false"), + resource.TestCheckResourceAttr(resourceName, "delta_target.0.create_native_delta_table", "false"), ), }, }, @@ -2956,9 +2958,10 @@ resource "aws_glue_crawler" "test" { role = aws_iam_role.test.name delta_target { - connection_name = aws_glue_connection.test.name - delta_tables = [%[3]q] - write_manifest = false + connection_name = aws_glue_connection.test.name + delta_tables = [%[3]q] + write_manifest = false + create_native_delta_table = false } } `, rName, connectionUrl, tableName)) From b3a01fd39e37995cac6e47ea44c1dcb86f7a8caa Mon Sep 17 00:00:00 2001 From: tomwelsh11 Date: Wed, 22 Feb 2023 19:13:17 +1100 Subject: [PATCH 056/763] fix: formatting --- internal/service/glue/crawler.go | 6 +++--- internal/service/glue/crawler_test.go | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/internal/service/glue/crawler.go b/internal/service/glue/crawler.go index 9a1188d915a3..9ca1cc82a50b 100644 --- a/internal/service/glue/crawler.go +++ b/internal/service/glue/crawler.go @@ -119,7 +119,7 @@ func ResourceCrawler() *schema.Resource { Required: true, }, "create_native_delta_table": { - Type: schema.TypeBool, + Type: schema.TypeBool, Required: true, }, }, @@ -740,8 +740,8 @@ func expandDeltaTargets(targets []interface{}) []*glue.DeltaTarget { func expandDeltaTarget(cfg map[string]interface{}) *glue.DeltaTarget { target := &glue.DeltaTarget{ - DeltaTables: flex.ExpandStringSet(cfg["delta_tables"].(*schema.Set)), - WriteManifest: aws.Bool(cfg["write_manifest"].(bool)), + DeltaTables: flex.ExpandStringSet(cfg["delta_tables"].(*schema.Set)), + WriteManifest: aws.Bool(cfg["write_manifest"].(bool)), CreateNativeDeltaTable: aws.Bool(cfg["create_native_delta_table"].(bool)), } diff --git a/internal/service/glue/crawler_test.go b/internal/service/glue/crawler_test.go index 1680f5068145..25500e971ee5 100644 --- a/internal/service/glue/crawler_test.go +++ b/internal/service/glue/crawler_test.go @@ -536,7 +536,7 @@ func TestAccGlueCrawler_deltaTarget(t *testing.T) { resource.TestCheckResourceAttr(resourceName, "delta_target.0.delta_tables.#", "1"), resource.TestCheckTypeSetElemAttr(resourceName, "delta_target.0.delta_tables.*", "s3://table1"), resource.TestCheckResourceAttr(resourceName, "delta_target.0.write_manifest", "false"), - resource.TestCheckResourceAttr(resourceName, "delta_target.0.create_native_delta_table", "false"), + resource.TestCheckResourceAttr(resourceName, "delta_target.0.create_native_delta_table", "false"), ), }, { @@ -2961,7 +2961,7 @@ resource "aws_glue_crawler" "test" { connection_name = aws_glue_connection.test.name delta_tables = [%[3]q] write_manifest = false - create_native_delta_table = false + create_native_delta_table = false } } `, rName, connectionUrl, tableName)) From e199a01bba7e8d4d47f162ffc436dcca420a349c Mon Sep 17 00:00:00 2001 From: tomwelsh11 Date: Wed, 22 Feb 2023 20:43:19 +1100 Subject: [PATCH 057/763] feat: changelog --- .changelog/29566.txt | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 .changelog/29566.txt diff --git a/.changelog/29566.txt b/.changelog/29566.txt new file mode 100644 index 000000000000..67cd1710d7a0 --- /dev/null +++ b/.changelog/29566.txt @@ -0,0 +1,3 @@ +```release-note:enhancement +resource/aws_glue_crawler: Add create_native_delta_table argument to delta_target block +``` \ No newline at end of file From 87de56fca1b83a1e0dc5e19fd58f2ebd49c2fe07 Mon Sep 17 00:00:00 2001 From: drfaust92 Date: Sun, 19 Feb 2023 23:52:41 +0200 Subject: [PATCH 058/763] redshift snapshot cluster --- internal/provider/provider.go | 1 + internal/service/redshift/cluster_snapshot.go | 192 +++++++++++++++ .../service/redshift/cluster_snapshot_test.go | 227 ++++++++++++++++++ internal/service/redshift/cluster_test.go | 6 +- internal/service/redshift/find.go | 29 +++ internal/service/redshift/status.go | 16 ++ internal/service/redshift/wait.go | 42 ++++ .../r/redshift_cluster_snapshot.html.markdown | 53 ++++ 8 files changed, 563 insertions(+), 3 deletions(-) create mode 100644 internal/service/redshift/cluster_snapshot.go create mode 100644 internal/service/redshift/cluster_snapshot_test.go create mode 100644 website/docs/r/redshift_cluster_snapshot.html.markdown diff --git a/internal/provider/provider.go b/internal/provider/provider.go index 1c2fcaada922..c6b5356c3d99 100644 --- a/internal/provider/provider.go +++ b/internal/provider/provider.go @@ -1892,6 +1892,7 @@ func New(ctx context.Context) (*schema.Provider, error) { "aws_redshift_authentication_profile": redshift.ResourceAuthenticationProfile(), "aws_redshift_cluster": redshift.ResourceCluster(), "aws_redshift_cluster_iam_roles": redshift.ResourceClusterIAMRoles(), + "aws_redshift_cluster_snapshot": redshift.ResourceClusterSnapshot(), "aws_redshift_endpoint_access": redshift.ResourceEndpointAccess(), "aws_redshift_endpoint_authorization": redshift.ResourceEndpointAuthorization(), "aws_redshift_event_subscription": redshift.ResourceEventSubscription(), diff --git a/internal/service/redshift/cluster_snapshot.go b/internal/service/redshift/cluster_snapshot.go new file mode 100644 index 000000000000..8ee642729666 --- /dev/null +++ b/internal/service/redshift/cluster_snapshot.go @@ -0,0 +1,192 @@ +package redshift + +import ( + "context" + "fmt" + "log" + + "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/aws/arn" + "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/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/verify" +) + +func ResourceClusterSnapshot() *schema.Resource { + return &schema.Resource{ + CreateWithoutTimeout: resourceClusterSnapshotCreate, + ReadWithoutTimeout: resourceClusterSnapshotRead, + UpdateWithoutTimeout: resourceClusterSnapshotUpdate, + DeleteWithoutTimeout: resourceClusterSnapshotDelete, + + Importer: &schema.ResourceImporter{ + StateContext: schema.ImportStatePassthroughContext, + }, + + Schema: map[string]*schema.Schema{ + "arn": { + Type: schema.TypeString, + Computed: true, + }, + "cluster_identifier": { + Type: schema.TypeString, + Required: true, + ForceNew: true, + }, + "kms_key_id": { + Type: schema.TypeString, + Computed: true, + }, + "manual_snapshot_retention_period": { + Type: schema.TypeInt, + Optional: true, + Default: -1, + }, + "owner_account": { + Type: schema.TypeString, + Computed: true, + }, + "snapshot_identifier": { + Type: schema.TypeString, + Required: true, + ForceNew: true, + }, + "tags": tftags.TagsSchema(), + "tags_all": tftags.TagsSchemaComputed(), + }, + CustomizeDiff: verify.SetTagsDiff, + } +} + +func resourceClusterSnapshotCreate(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { + var diags diag.Diagnostics + conn := meta.(*conns.AWSClient).RedshiftConn() + defaultTagsConfig := meta.(*conns.AWSClient).DefaultTagsConfig + tags := defaultTagsConfig.MergeTags(tftags.New(d.Get("tags").(map[string]interface{}))) + + input := redshift.CreateClusterSnapshotInput{ + ClusterIdentifier: aws.String(d.Get("cluster_identifier").(string)), + SnapshotIdentifier: aws.String(d.Get("snapshot_identifier").(string)), + Tags: Tags(tags.IgnoreAWS()), + } + + if v, ok := d.GetOk("manual_snapshot_retention_period"); ok { + input.ManualSnapshotRetentionPeriod = aws.Int64(int64(v.(int))) + } + + out, err := conn.CreateClusterSnapshotWithContext(ctx, &input) + + if err != nil { + return sdkdiag.AppendErrorf(diags, "creating Redshift Cluster Snapshot : %s", err) + } + + d.SetId(aws.StringValue(out.Snapshot.SnapshotIdentifier)) + + if _, err := waitClusterSnapshotAvailable(ctx, conn, d.Id()); err != nil { + return sdkdiag.AppendErrorf(diags, "waiting for Redshift Cluster Snapshot (%s) to be Available: %s", d.Id(), err) + } + + return append(diags, resourceClusterSnapshotRead(ctx, d, meta)...) +} + +func resourceClusterSnapshotRead(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { + var diags diag.Diagnostics + conn := meta.(*conns.AWSClient).RedshiftConn() + defaultTagsConfig := meta.(*conns.AWSClient).DefaultTagsConfig + ignoreTagsConfig := meta.(*conns.AWSClient).IgnoreTagsConfig + + out, err := FindClusterSnapshotById(ctx, conn, d.Id()) + if !d.IsNewResource() && tfresource.NotFound(err) { + log.Printf("[WARN] Redshift Cluster Snapshot (%s) not found, removing from state", d.Id()) + d.SetId("") + return diags + } + + if err != nil { + return sdkdiag.AppendErrorf(diags, "reading Redshift Cluster Snapshot (%s): %s", d.Id(), err) + } + + arn := arn.ARN{ + Partition: meta.(*conns.AWSClient).Partition, + Service: "redshift", + Region: meta.(*conns.AWSClient).Region, + AccountID: meta.(*conns.AWSClient).AccountID, + Resource: fmt.Sprintf("snapshot:%s/%s", aws.StringValue(out.ClusterIdentifier), d.Id()), + }.String() + d.Set("arn", arn) + d.Set("snapshot_identifier", out.SnapshotIdentifier) + d.Set("cluster_identifier", out.ClusterIdentifier) + d.Set("manual_snapshot_retention_period", out.ManualSnapshotRetentionPeriod) + d.Set("kms_key_id", out.KmsKeyId) + d.Set("owner_account", out.OwnerAccount) + + tags := KeyValueTags(out.Tags).IgnoreAWS().IgnoreConfig(ignoreTagsConfig) + + //lintignore:AWSR002 + if err := d.Set("tags", tags.RemoveDefaultConfig(defaultTagsConfig).Map()); err != nil { + return sdkdiag.AppendErrorf(diags, "setting tags: %s", err) + } + + if err := d.Set("tags_all", tags.Map()); err != nil { + return sdkdiag.AppendErrorf(diags, "setting tags_all: %s", err) + } + + return diags +} + +func resourceClusterSnapshotUpdate(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { + var diags diag.Diagnostics + conn := meta.(*conns.AWSClient).RedshiftConn() + + if d.HasChangesExcept("tags", "tags_all") { + input := &redshift.ModifyClusterSnapshotInput{ + SnapshotIdentifier: aws.String(d.Id()), + ManualSnapshotRetentionPeriod: aws.Int64(int64(d.Get("manual_snapshot_retention_period").(int))), + } + + _, err := conn.ModifyClusterSnapshotWithContext(ctx, input) + if err != nil { + return sdkdiag.AppendErrorf(diags, "updating Redshift Cluster Snapshot (%s): %s", d.Id(), err) + } + } + + if d.HasChange("tags_all") { + o, n := d.GetChange("tags_all") + + if err := UpdateTags(ctx, conn, d.Get("arn").(string), o, n); err != nil { + return sdkdiag.AppendErrorf(diags, "updating Redshift Cluster Snapshot (%s) tags: %s", d.Id(), err) + } + } + + return append(diags, resourceClusterSnapshotRead(ctx, d, meta)...) +} + +func resourceClusterSnapshotDelete(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { + var diags diag.Diagnostics + conn := meta.(*conns.AWSClient).RedshiftConn() + + log.Printf("[DEBUG] Deleting Redshift Cluster Snapshot: %s", d.Id()) + _, err := conn.DeleteClusterSnapshotWithContext(ctx, &redshift.DeleteClusterSnapshotInput{ + SnapshotIdentifier: aws.String(d.Id()), + }) + + if tfawserr.ErrCodeEquals(err, redshift.ErrCodeClusterSnapshotNotFoundFault) { + return diags + } + + if err != nil { + return sdkdiag.AppendErrorf(diags, "deleting Redshift Cluster Snapshot (%s): %s", d.Id(), err) + } + + if _, err := waitClusterSnapshotDeleted(ctx, conn, d.Id()); err != nil { + return sdkdiag.AppendErrorf(diags, "waiting for Redshift Cluster Snapshot (%s) to be Deleted: %s", d.Id(), err) + } + + return diags +} diff --git a/internal/service/redshift/cluster_snapshot_test.go b/internal/service/redshift/cluster_snapshot_test.go new file mode 100644 index 000000000000..10897069ef67 --- /dev/null +++ b/internal/service/redshift/cluster_snapshot_test.go @@ -0,0 +1,227 @@ +package redshift_test + +import ( + "context" + "fmt" + "regexp" + "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" + "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" + "github.com/hashicorp/terraform-provider-aws/internal/tfresource" +) + +func TestAccRedshiftClusterSnapshot_basic(t *testing.T) { + ctx := acctest.Context(t) + var v redshift.Snapshot + resourceName := "aws_redshift_cluster_snapshot.test" + rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { acctest.PreCheck(t) }, + ErrorCheck: acctest.ErrorCheck(t, redshift.EndpointsID), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + CheckDestroy: testAccCheckClusterSnapshotDestroy(ctx), + Steps: []resource.TestStep{ + { + Config: testAccClusterSnapshotConfig_basic(rName), + Check: resource.ComposeTestCheckFunc( + testAccCheckClusterSnapshotExists(ctx, resourceName, &v), + acctest.MatchResourceAttrRegionalARN(resourceName, "arn", "redshift", regexp.MustCompile(`snapshot:.+`)), + acctest.CheckResourceAttrAccountID(resourceName, "owner_account"), + resource.TestCheckResourceAttr(resourceName, "cluster_identifier", rName), + resource.TestCheckResourceAttr(resourceName, "snapshot_identifier", rName), + resource.TestCheckResourceAttr(resourceName, "manual_snapshot_retention_period", "-1"), + resource.TestCheckResourceAttr(resourceName, "tags.%", "0"), + ), + }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, + { + Config: testAccClusterSnapshotConfig_retention(rName, 1), + Check: resource.ComposeTestCheckFunc( + testAccCheckClusterSnapshotExists(ctx, resourceName, &v), + acctest.MatchResourceAttrRegionalARN(resourceName, "arn", "redshift", regexp.MustCompile(`snapshot:.+`)), + resource.TestCheckResourceAttr(resourceName, "cluster_identifier", rName), + resource.TestCheckResourceAttr(resourceName, "snapshot_identifier", rName), + resource.TestCheckResourceAttr(resourceName, "manual_snapshot_retention_period", "1"), + resource.TestCheckResourceAttr(resourceName, "tags.%", "0"), + ), + }, + }, + }) +} + +func TestAccRedshiftClusterSnapshot_tags(t *testing.T) { + ctx := acctest.Context(t) + var v redshift.Snapshot + resourceName := "aws_redshift_cluster_snapshot.test" + rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { acctest.PreCheck(t) }, + ErrorCheck: acctest.ErrorCheck(t, redshift.EndpointsID), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + CheckDestroy: testAccCheckClusterSnapshotDestroy(ctx), + Steps: []resource.TestStep{ + { + Config: testAccClusterSnapshotConfig_tags1(rName, "key1", "value1"), + Check: resource.ComposeTestCheckFunc( + testAccCheckClusterSnapshotExists(ctx, resourceName, &v), + resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), + resource.TestCheckResourceAttr(resourceName, "tags.key1", "value1"), + ), + }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, + { + Config: testAccClusterSnapshotConfig_tags2(rName, "key1", "value1updated", "key2", "value2"), + Check: resource.ComposeTestCheckFunc( + testAccCheckClusterSnapshotExists(ctx, resourceName, &v), + resource.TestCheckResourceAttr(resourceName, "tags.%", "2"), + resource.TestCheckResourceAttr(resourceName, "tags.key1", "value1updated"), + resource.TestCheckResourceAttr(resourceName, "tags.key2", "value2"), + ), + }, + { + Config: testAccClusterSnapshotConfig_tags1(rName, "key2", "value2"), + Check: resource.ComposeTestCheckFunc( + testAccCheckClusterSnapshotExists(ctx, resourceName, &v), + resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), + resource.TestCheckResourceAttr(resourceName, "tags.key2", "value2"), + ), + }, + }, + }) +} + +func TestAccRedshiftClusterSnapshot_disappears(t *testing.T) { + ctx := acctest.Context(t) + var v redshift.Snapshot + resourceName := "aws_redshift_cluster_snapshot.test" + rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { acctest.PreCheck(t) }, + ErrorCheck: acctest.ErrorCheck(t, redshift.EndpointsID), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + CheckDestroy: testAccCheckClusterSnapshotDestroy(ctx), + Steps: []resource.TestStep{ + { + Config: testAccClusterSnapshotConfig_basic(rName), + Check: resource.ComposeTestCheckFunc( + testAccCheckClusterSnapshotExists(ctx, resourceName, &v), + acctest.CheckResourceDisappears(ctx, acctest.Provider, tfredshift.ResourceClusterSnapshot(), resourceName), + ), + ExpectNonEmptyPlan: true, + }, + }, + }) +} + +func testAccCheckClusterSnapshotExists(ctx context.Context, n string, v *redshift.Snapshot) 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 Redshift Cluster Snapshot is set") + } + + conn := acctest.Provider.Meta().(*conns.AWSClient).RedshiftConn() + + out, err := tfredshift.FindClusterSnapshotById(ctx, conn, rs.Primary.ID) + + if err != nil { + return err + } + + *v = *out + + return nil + } +} + +func testAccCheckClusterSnapshotDestroy(ctx context.Context) resource.TestCheckFunc { + return func(s *terraform.State) error { + conn := acctest.Provider.Meta().(*conns.AWSClient).RedshiftConn() + + for _, rs := range s.RootModule().Resources { + if rs.Type != "aws_redshift_cluster_snapshot" { + continue + } + + _, err := tfredshift.FindClusterSnapshotById(ctx, conn, rs.Primary.ID) + + if tfresource.NotFound(err) { + continue + } + + if err != nil { + return err + } + + return fmt.Errorf("Redshift Cluster Snapshot %s still exists", rs.Primary.ID) + } + + return nil + } +} + +func testAccClusterSnapshotConfig_basic(rName string) string { + return testAccClusterConfig_basic(rName) + fmt.Sprintf(` +resource "aws_redshift_cluster_snapshot" "test" { + cluster_identifier = aws_redshift_cluster.test.cluster_identifier + snapshot_identifier = %[1]q +} +`, rName) +} + +func testAccClusterSnapshotConfig_retention(rName string, retention int) string { + return testAccClusterConfig_basic(rName) + fmt.Sprintf(` +resource "aws_redshift_cluster_snapshot" "test" { + cluster_identifier = aws_redshift_cluster.test.cluster_identifier + snapshot_identifier = %[1]q + manual_snapshot_retention_period = %[2]d +} +`, rName, retention) +} + +func testAccClusterSnapshotConfig_tags1(rName, tagKey1, tagValue1 string) string { + return testAccClusterConfig_basic(rName) + fmt.Sprintf(` +resource "aws_redshift_cluster_snapshot" "test" { + cluster_identifier = aws_redshift_cluster.test.cluster_identifier + snapshot_identifier = %[1]q + + tags = { + %[2]q = %[3]q + } +} +`, rName, tagKey1, tagValue1) +} + +func testAccClusterSnapshotConfig_tags2(rName, tagKey1, tagValue1, tagKey2, tagValue2 string) string { + return testAccClusterConfig_basic(rName) + fmt.Sprintf(` +resource "aws_redshift_cluster_snapshot" "test" { + cluster_identifier = aws_redshift_cluster.test.cluster_identifier + snapshot_identifier = %[1]q + tags = { + %[2]q = %[3]q + %[4]q = %[5]q + } +} +`, rName, tagKey1, tagValue1, tagKey2, tagValue2) +} diff --git a/internal/service/redshift/cluster_test.go b/internal/service/redshift/cluster_test.go index 55207ccd8080..55aece5cc88f 100644 --- a/internal/service/redshift/cluster_test.go +++ b/internal/service/redshift/cluster_test.go @@ -145,7 +145,7 @@ func TestAccRedshiftCluster_withFinalSnapshot(t *testing.T) { PreCheck: func() { acctest.PreCheck(t) }, ErrorCheck: acctest.ErrorCheck(t, redshift.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - CheckDestroy: testAccCheckClusterSnapshotDestroy(ctx, rName), + CheckDestroy: testAccCheckClusterTestSnapshotDestroy(ctx, rName), Steps: []resource.TestStep{ { Config: testAccClusterConfig_finalSnapshot(rName), @@ -766,7 +766,7 @@ func TestAccRedshiftCluster_restoreFromSnapshot(t *testing.T) { PreCheck: func() { acctest.PreCheck(t) }, ErrorCheck: acctest.ErrorCheck(t, redshift.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - CheckDestroy: testAccCheckClusterSnapshotDestroy(ctx, rName), + CheckDestroy: testAccCheckClusterTestSnapshotDestroy(ctx, rName), Steps: []resource.TestStep{ { Config: testAccClusterConfig_createSnapshot(rName), @@ -832,7 +832,7 @@ func testAccCheckClusterDestroy(ctx context.Context) resource.TestCheckFunc { } } -func testAccCheckClusterSnapshotDestroy(ctx context.Context, rName string) resource.TestCheckFunc { +func testAccCheckClusterTestSnapshotDestroy(ctx context.Context, rName string) resource.TestCheckFunc { return func(s *terraform.State) error { for _, rs := range s.RootModule().Resources { if rs.Type != "aws_redshift_cluster" { diff --git a/internal/service/redshift/find.go b/internal/service/redshift/find.go index 17175c991893..d07c69596cba 100644 --- a/internal/service/redshift/find.go +++ b/internal/service/redshift/find.go @@ -429,3 +429,32 @@ func FindPartnerById(ctx context.Context, conn *redshift.Redshift, id string) (* return output.PartnerIntegrationInfoList[0], nil } + +func FindClusterSnapshotById(ctx context.Context, conn *redshift.Redshift, id string) (*redshift.Snapshot, error) { + input := &redshift.DescribeClusterSnapshotsInput{ + SnapshotIdentifier: aws.String(id), + } + + output, err := conn.DescribeClusterSnapshotsWithContext(ctx, input) + + if tfawserr.ErrCodeEquals(err, redshift.ErrCodeClusterNotFoundFault) || tfawserr.ErrCodeEquals(err, redshift.ErrCodeClusterSnapshotNotFoundFault) { + return nil, &resource.NotFoundError{ + LastError: err, + LastRequest: input, + } + } + + if err != nil { + return nil, err + } + + if output == nil || len(output.Snapshots) == 0 || output.Snapshots[0] == nil { + return nil, tfresource.NewEmptyResultError(input) + } + + if count := len(output.Snapshots); count > 1 { + return nil, tfresource.NewTooManyResultsError(count, input) + } + + return output.Snapshots[0], nil +} diff --git a/internal/service/redshift/status.go b/internal/service/redshift/status.go index b28d6736be25..e2a1868381da 100644 --- a/internal/service/redshift/status.go +++ b/internal/service/redshift/status.go @@ -104,3 +104,19 @@ func statusEndpointAccess(ctx context.Context, conn *redshift.Redshift, name str return output, aws.StringValue(output.EndpointStatus), nil } } + +func statusClusterSnapshot(ctx context.Context, conn *redshift.Redshift, id string) resource.StateRefreshFunc { + return func() (interface{}, string, error) { + output, err := FindClusterSnapshotById(ctx, conn, id) + + if tfresource.NotFound(err) { + return nil, "", nil + } + + if err != nil { + return nil, "", err + } + + return output, aws.StringValue(output.Status), nil + } +} diff --git a/internal/service/redshift/wait.go b/internal/service/redshift/wait.go index 7a183075e4d7..fd149bb5415b 100644 --- a/internal/service/redshift/wait.go +++ b/internal/service/redshift/wait.go @@ -216,3 +216,45 @@ func waitEndpointAccessDeleted(ctx context.Context, conn *redshift.Redshift, id return nil, err } + +func waitClusterSnapshotAvailable(ctx context.Context, conn *redshift.Redshift, id string) (*redshift.Snapshot, error) { //nolint:unparam + stateConf := &resource.StateChangeConf{ + Pending: []string{"creating"}, + Target: []string{"available"}, + Refresh: statusClusterSnapshot(ctx, conn, id), + Timeout: 10 * time.Minute, + MinTimeout: 10 * time.Second, + Delay: 30 * time.Second, + } + + outputRaw, err := stateConf.WaitForStateContext(ctx) + + if output, ok := outputRaw.(*redshift.Snapshot); ok { + tfresource.SetLastError(err, errors.New(aws.StringValue(output.Status))) + + return output, err + } + + return nil, err +} + +func waitClusterSnapshotDeleted(ctx context.Context, conn *redshift.Redshift, id string) (*redshift.Snapshot, error) { //nolint:unparam + stateConf := &resource.StateChangeConf{ + Pending: []string{"available"}, + Target: []string{}, + Refresh: statusClusterSnapshot(ctx, conn, id), + Timeout: 10 * time.Minute, + MinTimeout: 10 * time.Second, + Delay: 30 * time.Second, + } + + outputRaw, err := stateConf.WaitForStateContext(ctx) + + if output, ok := outputRaw.(*redshift.Snapshot); ok { + tfresource.SetLastError(err, errors.New(aws.StringValue(output.Status))) + + return output, err + } + + return nil, err +} diff --git a/website/docs/r/redshift_cluster_snapshot.html.markdown b/website/docs/r/redshift_cluster_snapshot.html.markdown new file mode 100644 index 000000000000..58a13452a1fa --- /dev/null +++ b/website/docs/r/redshift_cluster_snapshot.html.markdown @@ -0,0 +1,53 @@ +--- +subcategory: "Redshift" +layout: "aws" +page_title: "AWS: aws_redshift_cluster_snapshot" +description: |- + Creates a Redshift cluster snapshot +--- + +# Resource: aws_redshift_cluster_snapshot + +Creates a Redshift cluster snapshot + +## Example Usage + +```terraform +resource "aws_redshift_cluster_snapshot" "example" { + cluster_snapshot_name = "example" + cluster_snapshot_content = jsonencode( + { + AllowDBUserOverride = "1" + Client_ID = "ExampleClientID" + App_ID = "example" + } + ) +} +``` + +## Argument Reference + +The following arguments are supported: + +* `cluster_identifier` - (Required, Forces new resource) The cluster identifier for which you want a snapshot. +* `snapshot_identifier` - (Required, Forces new resource) A unique identifier for the snapshot that you are requesting. This identifier must be unique for all snapshots within the Amazon Web Services account. +* `manual_snapshot_retention_period` - (Optional) The number of days that a manual snapshot is retained. If the value is `-1`, the manual snapshot is retained indefinitely. Valid values are -1 and between `1` and `3653`. +* `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. + +## Attributes Reference + +In addition to all arguments above, the following attributes are exported: + +* `arn` - Amazon Resource Name (ARN) of the snapshot. +* `id` - A unique identifier for the snapshot that you are requesting. This identifiermust be unique for all snapshots within the Amazon Web Services account. +* `kms_key_id` - The Key Management Service (KMS) key ID of the encryption key that was used to encrypt data in the cluster from which the snapshot was taken. +* `owner_account` - For manual snapshots, the Amazon Web Services account used to create or copy the snapshot. For automatic snapshots, the owner of the cluster. The owner can perform all snapshot actions, such as sharing a manual snapshot. +* `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 + +Redshift Cluster Snapshots support import by `snapshot_identifier`, e.g., + +```console +$ terraform import aws_redshift_cluster_snapshot.test example +``` From 79e207aa1c9d1b432708a99dd13ca3f03e6267ae Mon Sep 17 00:00:00 2001 From: drfaust92 Date: Mon, 20 Feb 2023 09:34:55 +0200 Subject: [PATCH 059/763] redshift snapshot cluster --- internal/service/redshift/wait.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/service/redshift/wait.go b/internal/service/redshift/wait.go index fd149bb5415b..c494f13ca457 100644 --- a/internal/service/redshift/wait.go +++ b/internal/service/redshift/wait.go @@ -217,7 +217,7 @@ func waitEndpointAccessDeleted(ctx context.Context, conn *redshift.Redshift, id return nil, err } -func waitClusterSnapshotAvailable(ctx context.Context, conn *redshift.Redshift, id string) (*redshift.Snapshot, error) { //nolint:unparam +func waitClusterSnapshotAvailable(ctx context.Context, conn *redshift.Redshift, id string) (*redshift.Snapshot, error) { stateConf := &resource.StateChangeConf{ Pending: []string{"creating"}, Target: []string{"available"}, @@ -238,7 +238,7 @@ func waitClusterSnapshotAvailable(ctx context.Context, conn *redshift.Redshift, return nil, err } -func waitClusterSnapshotDeleted(ctx context.Context, conn *redshift.Redshift, id string) (*redshift.Snapshot, error) { //nolint:unparam +func waitClusterSnapshotDeleted(ctx context.Context, conn *redshift.Redshift, id string) (*redshift.Snapshot, error) { stateConf := &resource.StateChangeConf{ Pending: []string{"available"}, Target: []string{}, From e6645f1b977f8187db0747875de3760e3b203acf Mon Sep 17 00:00:00 2001 From: drfaust92 Date: Fri, 24 Feb 2023 09:26:53 +0200 Subject: [PATCH 060/763] redshift snapshot cluster sweep --- internal/service/redshift/sweep.go | 20 ++++++-------------- 1 file changed, 6 insertions(+), 14 deletions(-) diff --git a/internal/service/redshift/sweep.go b/internal/service/redshift/sweep.go index b72d0d5afc96..bba4c8af7717 100644 --- a/internal/service/redshift/sweep.go +++ b/internal/service/redshift/sweep.go @@ -83,22 +83,14 @@ func sweepClusterSnapshots(region string) error { return false } - for _, s := range resp.Snapshots { - id := aws.StringValue(s.SnapshotIdentifier) - - if !strings.EqualFold(aws.StringValue(s.SnapshotType), "manual") || !strings.EqualFold(aws.StringValue(s.Status), "available") { - log.Printf("[INFO] Skipping Redshift cluster snapshot: %s", id) - continue - } + for _, c := range resp.Snapshots { + r := ResourceClusterSnapshot() + d := r.Data(nil) + d.SetId(aws.StringValue(c.SnapshotIdentifier)) - log.Printf("[INFO] Deleting Redshift cluster snapshot: %s", id) - _, err := conn.DeleteClusterSnapshotWithContext(ctx, &redshift.DeleteClusterSnapshotInput{ - SnapshotIdentifier: s.SnapshotIdentifier, - }) - if err != nil { - log.Printf("[ERROR] Failed deleting Redshift cluster snapshot (%s): %s", id, err) - } + sweepResources = append(sweepResources, sweep.NewSweepResource(r, d, client)) } + return !lastPage }) if err != nil { From bb32dc61a42880f45194467bcad8d5e0f5007598 Mon Sep 17 00:00:00 2001 From: drfaust92 Date: Fri, 24 Feb 2023 15:49:09 +0200 Subject: [PATCH 061/763] fmt --- internal/service/redshift/cluster_snapshot.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/service/redshift/cluster_snapshot.go b/internal/service/redshift/cluster_snapshot.go index 8ee642729666..c9f28c8522e6 100644 --- a/internal/service/redshift/cluster_snapshot.go +++ b/internal/service/redshift/cluster_snapshot.go @@ -68,7 +68,7 @@ func resourceClusterSnapshotCreate(ctx context.Context, d *schema.ResourceData, var diags diag.Diagnostics conn := meta.(*conns.AWSClient).RedshiftConn() defaultTagsConfig := meta.(*conns.AWSClient).DefaultTagsConfig - tags := defaultTagsConfig.MergeTags(tftags.New(d.Get("tags").(map[string]interface{}))) + tags := defaultTagsConfig.MergeTags(tftags.New(ctx, d.Get("tags").(map[string]interface{}))) input := redshift.CreateClusterSnapshotInput{ ClusterIdentifier: aws.String(d.Get("cluster_identifier").(string)), @@ -126,7 +126,7 @@ func resourceClusterSnapshotRead(ctx context.Context, d *schema.ResourceData, me d.Set("kms_key_id", out.KmsKeyId) d.Set("owner_account", out.OwnerAccount) - tags := KeyValueTags(out.Tags).IgnoreAWS().IgnoreConfig(ignoreTagsConfig) + tags := KeyValueTags(ctx, rsc.Tags).IgnoreAWS().IgnoreConfig(ignoreTagsConfig) //lintignore:AWSR002 if err := d.Set("tags", tags.RemoveDefaultConfig(defaultTagsConfig).Map()); err != nil { From bc598a33a85765527a9e668e0f7c5897b75d1e20 Mon Sep 17 00:00:00 2001 From: drfaust92 Date: Fri, 24 Feb 2023 15:53:51 +0200 Subject: [PATCH 062/763] fmt --- internal/service/redshift/cluster_snapshot.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/service/redshift/cluster_snapshot.go b/internal/service/redshift/cluster_snapshot.go index c9f28c8522e6..aaa80161df42 100644 --- a/internal/service/redshift/cluster_snapshot.go +++ b/internal/service/redshift/cluster_snapshot.go @@ -126,7 +126,7 @@ func resourceClusterSnapshotRead(ctx context.Context, d *schema.ResourceData, me d.Set("kms_key_id", out.KmsKeyId) d.Set("owner_account", out.OwnerAccount) - tags := KeyValueTags(ctx, rsc.Tags).IgnoreAWS().IgnoreConfig(ignoreTagsConfig) + tags := KeyValueTags(ctx, out.Tags).IgnoreAWS().IgnoreConfig(ignoreTagsConfig) //lintignore:AWSR002 if err := d.Set("tags", tags.RemoveDefaultConfig(defaultTagsConfig).Map()); err != nil { From 68ef31fe8b789571a1433c7a44e3877d5bd5728e Mon Sep 17 00:00:00 2001 From: drfaust92 Date: Fri, 16 Dec 2022 18:24:57 +0200 Subject: [PATCH 063/763] rds snapshot share --- internal/service/rds/snapshot.go | 76 ++++++++++++++++++++---- internal/service/rds/snapshot_test.go | 63 +++++++++++++++----- website/docs/r/db_snapshot.html.markdown | 1 + 3 files changed, 113 insertions(+), 27 deletions(-) diff --git a/internal/service/rds/snapshot.go b/internal/service/rds/snapshot.go index 599be7f9b31b..5bf3da3811ac 100644 --- a/internal/service/rds/snapshot.go +++ b/internal/service/rds/snapshot.go @@ -14,6 +14,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/flex" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/verify" ) @@ -33,24 +34,23 @@ func ResourceSnapshot() *schema.Resource { }, Schema: map[string]*schema.Schema{ - "db_snapshot_identifier": { + "allocated_storage": { + Type: schema.TypeInt, + Computed: true, + }, + "availability_zone": { Type: schema.TypeString, - Required: true, - ForceNew: true, + Computed: true, }, "db_instance_identifier": { Type: schema.TypeString, Required: true, ForceNew: true, }, - - "allocated_storage": { - Type: schema.TypeInt, - Computed: true, - }, - "availability_zone": { + "db_snapshot_identifier": { Type: schema.TypeString, - Computed: true, + Required: true, + ForceNew: true, }, "db_snapshot_arn": { Type: schema.TypeString, @@ -88,6 +88,11 @@ func ResourceSnapshot() *schema.Resource { Type: schema.TypeInt, Computed: true, }, + "shared_accounts": { + Type: schema.TypeSet, + Optional: true, + Elem: &schema.Schema{Type: schema.TypeString}, + }, "source_db_snapshot_identifier": { Type: schema.TypeString, Computed: true, @@ -108,12 +113,12 @@ func ResourceSnapshot() *schema.Resource { Type: schema.TypeString, Computed: true, }, + "tags": tftags.TagsSchema(), + "tags_all": tftags.TagsSchemaComputed(), "vpc_id": { Type: schema.TypeString, Computed: true, }, - "tags": tftags.TagsSchema(), - "tags_all": tftags.TagsSchemaComputed(), }, CustomizeDiff: verify.SetTagsDiff, @@ -153,6 +158,19 @@ func resourceSnapshotCreate(ctx context.Context, d *schema.ResourceData, meta in return sdkdiag.AppendErrorf(diags, "creating AWS DB Snapshot (%s): waiting for completion: %s", dBInstanceIdentifier, err) } + if v, ok := d.GetOk("shared_accounts"); ok && v.(*schema.Set).Len() > 0 { + attrInput := &rds.ModifyDBSnapshotAttributeInput{ + DBSnapshotIdentifier: aws.String(dBInstanceIdentifier), + AttributeName: aws.String("restore"), + ValuesToAdd: flex.ExpandStringSet(v.(*schema.Set)), + } + + _, err := conn.ModifyDBSnapshotAttribute(attrInput) + if err != nil { + return sdkdiag.AppendErrorf(diags, "error modifying AWS DB Snapshot Attribute %s: %s", dBInstanceIdentifier, err) + } + } + return append(diags, resourceSnapshotRead(ctx, d, meta)...) } @@ -216,6 +234,19 @@ func resourceSnapshotRead(ctx context.Context, d *schema.ResourceData, meta inte return sdkdiag.AppendErrorf(diags, "setting tags_all: %s", err) } + attrInput := &rds.DescribeDBSnapshotAttributesInput{ + DBSnapshotIdentifier: aws.String(d.Id()), + } + + attrResp, err := conn.DescribeDBSnapshotAttributes(attrInput) + if err != nil { + return sdkdiag.AppendErrorf(diags, "error describing AWS DB Snapshot Attribute %s: %s", d.Id(), err) + } + + attr := attrResp.DBSnapshotAttributesResult.DBSnapshotAttributes[0] + + d.Set("shared_accounts", flex.FlattenStringSet(attr.AttributeValues)) + return diags } @@ -243,6 +274,27 @@ func resourceSnapshotUpdate(ctx context.Context, d *schema.ResourceData, meta in var diags diag.Diagnostics conn := meta.(*conns.AWSClient).RDSConn() + if d.HasChange("shared_accounts") { + o, n := d.GetChange("shared_accounts") + os := o.(*schema.Set) + ns := n.(*schema.Set) + + additionList := ns.Difference(os) + removalList := os.Difference(ns) + + attrInput := &rds.ModifyDBSnapshotAttributeInput{ + DBSnapshotIdentifier: aws.String(d.Id()), + AttributeName: aws.String("restore"), + ValuesToAdd: flex.ExpandStringSet(additionList), + ValuesToRemove: flex.ExpandStringSet(removalList), + } + + _, err := conn.ModifyDBSnapshotAttribute(attrInput) + if err != nil { + return sdkdiag.AppendErrorf(diags, "error modifying AWS DB Snapshot Attribute %s: %s", d.Id(), err) + } + } + if d.HasChange("tags_all") { o, n := d.GetChange("tags_all") diff --git a/internal/service/rds/snapshot_test.go b/internal/service/rds/snapshot_test.go index 7f355b0d917a..fb583981c8e1 100644 --- a/internal/service/rds/snapshot_test.go +++ b/internal/service/rds/snapshot_test.go @@ -14,6 +14,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/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" ) func TestAccRDSSnapshot_basic(t *testing.T) { @@ -38,6 +39,38 @@ func TestAccRDSSnapshot_basic(t *testing.T) { testAccCheckDBSnapshotExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "0"), acctest.MatchResourceAttrRegionalARN(resourceName, "db_snapshot_arn", "rds", regexp.MustCompile(`snapshot:.+`)), + resource.TestCheckResourceAttr(resourceName, "shared_accounts.#", "0"), + ), + }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, + }, + }) +} + +func TestAccRDSSnapshot_share(t *testing.T) { + if testing.Short() { + t.Skip("skipping long-running test in short mode") + } + + var v rds.DBSnapshot + resourceName := "aws_db_snapshot.test" + rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { acctest.PreCheck(t) }, + ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + CheckDestroy: testAccCheckDBSnapshotDestroy, + Steps: []resource.TestStep{ + { + Config: testAccSnapshotConfig_share(rName), + Check: resource.ComposeTestCheckFunc( + testAccCheckDBSnapshotExists(resourceName, &v), + resource.TestCheckResourceAttr(resourceName, "shared_accounts.#", "1"), ), }, { @@ -119,7 +152,7 @@ func TestAccRDSSnapshot_disappears(t *testing.T) { Config: testAccSnapshotConfig_basic(rName), Check: resource.ComposeTestCheckFunc( testAccCheckDBSnapshotExists(ctx, resourceName, &v), - testAccCheckDBSnapshotDisappears(ctx, &v), + acctest.CheckResourceDisappears(ctx, acctest.Provider, tfrds.ResourceSnapshot(), resourceName), ), ExpectNonEmptyPlan: true, }, @@ -189,20 +222,6 @@ func testAccCheckDBSnapshotExists(ctx context.Context, n string, v *rds.DBSnapsh } } -func testAccCheckDBSnapshotDisappears(ctx context.Context, snapshot *rds.DBSnapshot) resource.TestCheckFunc { - return func(s *terraform.State) error { - conn := acctest.Provider.Meta().(*conns.AWSClient).RDSConn() - - if _, err := conn.DeleteDBSnapshotWithContext(ctx, &rds.DeleteDBSnapshotInput{ - DBSnapshotIdentifier: snapshot.DBSnapshotIdentifier, - }); err != nil { - return err - } - - return nil - } -} - func testAccSnapshotBaseConfig(rName string) string { return fmt.Sprintf(` data "aws_rds_engine_version" "default" { @@ -272,3 +291,17 @@ resource "aws_db_snapshot" "test" { } `, rName, tag1Key, tag1Value, tag2Key, tag2Value)) } + +func testAccSnapshotConfig_share(rName string) string { + return acctest.ConfigCompose( + testAccSnapshotBaseConfig(rName), + fmt.Sprintf(` +data "aws_caller_identity" "current" {} + +resource "aws_db_snapshot" "test" { + db_instance_identifier = aws_db_instance.test.id + db_snapshot_identifier = %[1]q + shared_accounts = ["all"] +} +`, rName)) +} diff --git a/website/docs/r/db_snapshot.html.markdown b/website/docs/r/db_snapshot.html.markdown index 72f1809a2452..206a01fe8704 100644 --- a/website/docs/r/db_snapshot.html.markdown +++ b/website/docs/r/db_snapshot.html.markdown @@ -39,6 +39,7 @@ The following arguments are supported: * `db_instance_identifier` - (Required) The DB Instance Identifier from which to take the snapshot. * `db_snapshot_identifier` - (Required) The Identifier for the snapshot. +* `shared_accounts` - (Optional) List of AWS Account ids to share snapshot with, use `all` to make snaphot public. * `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. ## Attributes Reference From 4673a1eec5c37d1eab8e4fbe84008f950d97eee4 Mon Sep 17 00:00:00 2001 From: drfaust92 Date: Fri, 16 Dec 2022 18:35:49 +0200 Subject: [PATCH 064/763] refactor snapshots --- internal/service/rds/snapshot.go | 17 ++++++----------- internal/service/rds/snapshot_copy.go | 2 +- 2 files changed, 7 insertions(+), 12 deletions(-) diff --git a/internal/service/rds/snapshot.go b/internal/service/rds/snapshot.go index 5bf3da3811ac..751782f4036f 100644 --- a/internal/service/rds/snapshot.go +++ b/internal/service/rds/snapshot.go @@ -16,6 +16,7 @@ import ( "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" ) @@ -180,23 +181,17 @@ func resourceSnapshotRead(ctx context.Context, d *schema.ResourceData, meta inte defaultTagsConfig := meta.(*conns.AWSClient).DefaultTagsConfig ignoreTagsConfig := meta.(*conns.AWSClient).IgnoreTagsConfig - params := &rds.DescribeDBSnapshotsInput{ - DBSnapshotIdentifier: aws.String(d.Id()), - } - resp, err := conn.DescribeDBSnapshotsWithContext(ctx, params) - - if tfawserr.ErrCodeEquals(err, rds.ErrCodeDBSnapshotNotFoundFault) { - log.Printf("[WARN] AWS DB Snapshot (%s) is already gone", d.Id()) + snapshot, err := FindDBSnapshotByID(ctx, conn, d.Id()) + if !d.IsNewResource() && tfresource.NotFound(err) { + log.Printf("[WARN] RDS DB Snapshot (%s) not found, removing from state", d.Id()) d.SetId("") - return diags + return nil } if err != nil { - return sdkdiag.AppendErrorf(diags, "describing AWS DB Snapshot %s: %s", d.Id(), err) + return diag.Errorf("reading RDS DB snapshot (%s): %s", d.Id(), err) } - snapshot := resp.DBSnapshots[0] - arn := aws.StringValue(snapshot.DBSnapshotArn) d.Set("db_snapshot_identifier", snapshot.DBSnapshotIdentifier) d.Set("db_instance_identifier", snapshot.DBInstanceIdentifier) diff --git a/internal/service/rds/snapshot_copy.go b/internal/service/rds/snapshot_copy.go index 510bd74d8e6d..7b69b032ae95 100644 --- a/internal/service/rds/snapshot_copy.go +++ b/internal/service/rds/snapshot_copy.go @@ -173,7 +173,7 @@ func resourceSnapshotCopyCreate(ctx context.Context, d *schema.ResourceData, met d.SetId(aws.StringValue(out.DBSnapshot.DBSnapshotIdentifier)) - err = waitSnapshotCopyAvailable(ctx, d, meta) + err = waitSnapshotAvailable(ctx, d, meta) if err != nil { return diag.FromErr(err) } From d5f68876fa32547af5475e265d0f65c96dde888b Mon Sep 17 00:00:00 2001 From: drfaust92 Date: Fri, 16 Dec 2022 18:41:52 +0200 Subject: [PATCH 065/763] refactor snapshots --- internal/service/rds/snapshot_copy.go | 3 +- internal/service/rds/snapshot_test.go | 40 +++++++++------------------ 2 files changed, 14 insertions(+), 29 deletions(-) diff --git a/internal/service/rds/snapshot_copy.go b/internal/service/rds/snapshot_copy.go index 7b69b032ae95..69fcbafd4fb8 100644 --- a/internal/service/rds/snapshot_copy.go +++ b/internal/service/rds/snapshot_copy.go @@ -199,10 +199,9 @@ func resourceSnapshotCopyRead(ctx context.Context, d *schema.ResourceData, meta } arn := aws.StringValue(snapshot.DBSnapshotArn) - d.Set("allocated_storage", snapshot.AllocatedStorage) d.Set("availability_zone", snapshot.AvailabilityZone) - d.Set("db_snapshot_arn", snapshot.DBSnapshotArn) + d.Set("db_snapshot_arn", arn) d.Set("encrypted", snapshot.Encrypted) d.Set("engine", snapshot.Engine) d.Set("engine_version", snapshot.EngineVersion) diff --git a/internal/service/rds/snapshot_test.go b/internal/service/rds/snapshot_test.go index fb583981c8e1..58549fc2d74c 100644 --- a/internal/service/rds/snapshot_test.go +++ b/internal/service/rds/snapshot_test.go @@ -3,18 +3,18 @@ package rds_test import ( "context" "fmt" + "log" "regexp" "testing" - "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" "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" + "github.com/hashicorp/terraform-provider-aws/internal/tfresource" ) func TestAccRDSSnapshot_basic(t *testing.T) { @@ -71,6 +71,7 @@ func TestAccRDSSnapshot_share(t *testing.T) { Check: resource.ComposeTestCheckFunc( testAccCheckDBSnapshotExists(resourceName, &v), resource.TestCheckResourceAttr(resourceName, "shared_accounts.#", "1"), + resource.TestCheckTypeSetElemAttr(resourceName, "shared_accounts.*", "all"), ), }, { @@ -169,28 +170,17 @@ func testAccCheckDBSnapshotDestroy(ctx context.Context) resource.TestCheckFunc { continue } - request := &rds.DescribeDBSnapshotsInput{ - DBSnapshotIdentifier: aws.String(rs.Primary.ID), - } + log.Printf("[DEBUG] Checking if RDS DB Snapshot %s exists", rs.Primary.ID) - resp, err := conn.DescribeDBSnapshotsWithContext(ctx, request) + _, err := tfrds.FindSnapshot(context.Background(), conn, rs.Primary.ID) - if tfawserr.ErrCodeEquals(err, rds.ErrCodeDBSnapshotNotFoundFault) { + // verify error is what we want + if tfresource.NotFound(err) { continue } - if err == nil { - for _, dbSnapshot := range resp.DBSnapshots { - if aws.StringValue(dbSnapshot.DBSnapshotIdentifier) == rs.Primary.ID { - return fmt.Errorf("AWS DB Snapshot is still exist: %s", rs.Primary.ID) - } - } - } - return err } - - return nil } } @@ -207,18 +197,14 @@ func testAccCheckDBSnapshotExists(ctx context.Context, n string, v *rds.DBSnapsh conn := acctest.Provider.Meta().(*conns.AWSClient).RDSConn() - request := &rds.DescribeDBSnapshotsInput{ - DBSnapshotIdentifier: aws.String(rs.Primary.ID), + out, err := tfrds.FindSnapshot(context.Background(), conn, rs.Primary.ID) + if err != nil { + return err } - response, err := conn.DescribeDBSnapshotsWithContext(ctx, request) - if err == nil { - if response.DBSnapshots != nil && len(response.DBSnapshots) > 0 { - *v = *response.DBSnapshots[0] - return nil - } - } - return fmt.Errorf("Error finding RDS DB Snapshot %s", rs.Primary.ID) + ci = out + + return nil } } From bc6bf8732b1420a3d97c4be56f7533f0561638d7 Mon Sep 17 00:00:00 2001 From: drfaust92 Date: Fri, 16 Dec 2022 18:43:20 +0200 Subject: [PATCH 066/763] better test --- internal/service/rds/snapshot_test.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/internal/service/rds/snapshot_test.go b/internal/service/rds/snapshot_test.go index 58549fc2d74c..714251c5e5d0 100644 --- a/internal/service/rds/snapshot_test.go +++ b/internal/service/rds/snapshot_test.go @@ -79,6 +79,13 @@ func TestAccRDSSnapshot_share(t *testing.T) { ImportState: true, ImportStateVerify: true, }, + { + Config: testAccSnapshotConfig_basic(rName), + Check: resource.ComposeTestCheckFunc( + testAccCheckDBSnapshotExists(resourceName, &v), + resource.TestCheckResourceAttr(resourceName, "shared_accounts.#", "0"), + ), + }, }, }) } From 68a6f2330e2f54c8eed32ac7b1e3e39d007edd8e Mon Sep 17 00:00:00 2001 From: drfaust92 Date: Fri, 16 Dec 2022 18:45:16 +0200 Subject: [PATCH 067/763] better test --- internal/service/rds/snapshot_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/service/rds/snapshot_test.go b/internal/service/rds/snapshot_test.go index 714251c5e5d0..845e7adb5b81 100644 --- a/internal/service/rds/snapshot_test.go +++ b/internal/service/rds/snapshot_test.go @@ -209,7 +209,7 @@ func testAccCheckDBSnapshotExists(ctx context.Context, n string, v *rds.DBSnapsh return err } - ci = out + v = out return nil } From b25cda8a3e67a0705fe41a7fdaac0cb0b6bc0749 Mon Sep 17 00:00:00 2001 From: drfaust92 Date: Fri, 16 Dec 2022 20:46:20 +0200 Subject: [PATCH 068/763] better test --- internal/service/rds/snapshot_test.go | 2 -- 1 file changed, 2 deletions(-) diff --git a/internal/service/rds/snapshot_test.go b/internal/service/rds/snapshot_test.go index 845e7adb5b81..e5694df3ec5f 100644 --- a/internal/service/rds/snapshot_test.go +++ b/internal/service/rds/snapshot_test.go @@ -289,8 +289,6 @@ func testAccSnapshotConfig_share(rName string) string { return acctest.ConfigCompose( testAccSnapshotBaseConfig(rName), fmt.Sprintf(` -data "aws_caller_identity" "current" {} - resource "aws_db_snapshot" "test" { db_instance_identifier = aws_db_instance.test.id db_snapshot_identifier = %[1]q From 0d3c4e3a8ca149636a0d1355f5b3723dd9e5c236 Mon Sep 17 00:00:00 2001 From: drfaust92 Date: Fri, 16 Dec 2022 20:50:07 +0200 Subject: [PATCH 069/763] changelog --- .changelog/28424.txt | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 .changelog/28424.txt diff --git a/.changelog/28424.txt b/.changelog/28424.txt new file mode 100644 index 000000000000..8af7439772b1 --- /dev/null +++ b/.changelog/28424.txt @@ -0,0 +1,3 @@ +```release-note:enhancement +resource/db_snapshot: Add `shared_accounts` argument +``` \ No newline at end of file From 90c58db97660faff804434615ef116fe5e03b401 Mon Sep 17 00:00:00 2001 From: drfaust92 Date: Fri, 24 Feb 2023 16:28:29 +0200 Subject: [PATCH 070/763] rebase --- internal/service/rds/snapshot_copy.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/service/rds/snapshot_copy.go b/internal/service/rds/snapshot_copy.go index 69fcbafd4fb8..7a29489eb016 100644 --- a/internal/service/rds/snapshot_copy.go +++ b/internal/service/rds/snapshot_copy.go @@ -173,7 +173,7 @@ func resourceSnapshotCopyCreate(ctx context.Context, d *schema.ResourceData, met d.SetId(aws.StringValue(out.DBSnapshot.DBSnapshotIdentifier)) - err = waitSnapshotAvailable(ctx, d, meta) + err = waitSnapshotCopyAvailable(ctx, d, meta) if err != nil { return diag.FromErr(err) } From d5556b0940ac3f0339a123075591c8ca7e53c860 Mon Sep 17 00:00:00 2001 From: bjernie Date: Fri, 24 Feb 2023 15:53:57 +0100 Subject: [PATCH 071/763] Added timeouts to QLDB ledger --- go.mod | 1 + go.sum | 2 ++ internal/service/qldb/ledger.go | 16 +++++++++++++--- website/docs/r/qldb_ledger.html.markdown | 7 +++++++ 4 files changed, 23 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index e705eeacb15d..e1be8c103fd2 100644 --- a/go.mod +++ b/go.mod @@ -22,6 +22,7 @@ require ( github.com/aws/aws-sdk-go-v2/service/oam v1.1.5 github.com/aws/aws-sdk-go-v2/service/opensearchserverless v1.1.5 github.com/aws/aws-sdk-go-v2/service/pipes v1.1.4 + github.com/aws/aws-sdk-go-v2/service/qldb v1.15.4 github.com/aws/aws-sdk-go-v2/service/rds v1.40.5 github.com/aws/aws-sdk-go-v2/service/resourceexplorer2 v1.2.5 github.com/aws/aws-sdk-go-v2/service/rolesanywhere v1.1.4 diff --git a/go.sum b/go.sum index 15d060f76e85..df4d4f9f63e0 100644 --- a/go.sum +++ b/go.sum @@ -80,6 +80,8 @@ github.com/aws/aws-sdk-go-v2/service/opensearchserverless v1.1.5 h1:3EqOT8+GTVfZ github.com/aws/aws-sdk-go-v2/service/opensearchserverless v1.1.5/go.mod h1:zyCz2VSeUsBE9LMtZc+rVaTSPqJM64cjvLL50FJbblM= github.com/aws/aws-sdk-go-v2/service/pipes v1.1.4 h1:KAGParM+d33STJa8vDxIfLHEAerLFluqx1RFDUMb5RE= github.com/aws/aws-sdk-go-v2/service/pipes v1.1.4/go.mod h1:+c65uht0a5kyjx9emTS00DdDiVYBoXLKDF7LQ0/2g5U= +github.com/aws/aws-sdk-go-v2/service/qldb v1.15.4 h1:1j+mxsdwnPaY2kPOfYWnSG6iXLzZEAUTNxIsROiS6gE= +github.com/aws/aws-sdk-go-v2/service/qldb v1.15.4/go.mod h1:/NFJfE+jHk5Gy9aHc+DuGNIUmMi++czor2fa6DDvBWQ= github.com/aws/aws-sdk-go-v2/service/rds v1.40.5 h1:m4v9hSOgnLmSDbdVdNT0H8GTY6tik7uB7SVV/SFbhLY= github.com/aws/aws-sdk-go-v2/service/rds v1.40.5/go.mod h1:994zebv5Cj1WoGzo3zrrscm1zBLFvGwoA3ve1eVYNVQ= github.com/aws/aws-sdk-go-v2/service/resourceexplorer2 v1.2.5 h1:+F3ULspZOOeUy3LWcIrTguJdO1/A1llhML7alifHldQ= diff --git a/internal/service/qldb/ledger.go b/internal/service/qldb/ledger.go index 6230a8239057..e2ada6e822fd 100644 --- a/internal/service/qldb/ledger.go +++ b/internal/service/qldb/ledger.go @@ -20,6 +20,11 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/verify" ) +const ( + createLedgerTimeout = 5 * time.Minute + deleteLedgerTimeout = 15 * time.Minute +) + func ResourceLedger() *schema.Resource { return &schema.Resource{ CreateWithoutTimeout: resourceLedgerCreate, @@ -31,6 +36,11 @@ func ResourceLedger() *schema.Resource { StateContext: schema.ImportStatePassthroughContext, }, + Timeouts: &schema.ResourceTimeout{ + Create: schema.DefaultTimeout(createLedgerTimeout), + Delete: schema.DefaultTimeout(createLedgerTimeout), + }, + Schema: map[string]*schema.Schema{ "arn": { Type: schema.TypeString, @@ -276,7 +286,7 @@ func waitLedgerCreated(ctx context.Context, conn *qldb.QLDB, name string) (*qldb Pending: []string{qldb.LedgerStateCreating}, Target: []string{qldb.LedgerStateActive}, Refresh: statusLedgerState(ctx, conn, name), - Timeout: 8 * time.Minute, + Timeout: createLedgerTimeout, MinTimeout: 3 * time.Second, } @@ -294,7 +304,7 @@ func waitLedgerDeleted(ctx context.Context, conn *qldb.QLDB, name string) (*qldb Pending: []string{qldb.LedgerStateActive, qldb.LedgerStateDeleting}, Target: []string{}, Refresh: statusLedgerState(ctx, conn, name), - Timeout: 5 * time.Minute, + Timeout: deleteLedgerTimeout, MinTimeout: 1 * time.Second, } @@ -305,4 +315,4 @@ func waitLedgerDeleted(ctx context.Context, conn *qldb.QLDB, name string) (*qldb } return nil, err -} +} \ No newline at end of file diff --git a/website/docs/r/qldb_ledger.html.markdown b/website/docs/r/qldb_ledger.html.markdown index c11202963deb..3c09d400c958 100644 --- a/website/docs/r/qldb_ledger.html.markdown +++ b/website/docs/r/qldb_ledger.html.markdown @@ -39,6 +39,13 @@ In addition to all arguments above, the following attributes are exported: * `arn` - The ARN of the QLDB Ledger * `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). +## Timeouts + +[Configuration options](https://developer.hashicorp.com/terraform/language/resources/syntax#operation-timeouts): + +- `create` - (Default `5m`) +- `delete` - (Default `10m`) + ## Import QLDB Ledgers can be imported using the `name`, e.g., From 9a8ed8fbf008eaf1bbd38cfbaa2908671d7ea67a Mon Sep 17 00:00:00 2001 From: Lukas Hetzenecker Date: Fri, 24 Feb 2023 17:05:59 +0100 Subject: [PATCH 072/763] EC2 Transit Gateway Attachments: Add attributes --- .../ec2/transitgateway_attachment_data_source.go | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/internal/service/ec2/transitgateway_attachment_data_source.go b/internal/service/ec2/transitgateway_attachment_data_source.go index afcf09496898..57bd270ea636 100644 --- a/internal/service/ec2/transitgateway_attachment_data_source.go +++ b/internal/service/ec2/transitgateway_attachment_data_source.go @@ -55,6 +55,14 @@ func DataSourceTransitGatewayAttachment() *schema.Resource { Type: schema.TypeString, Computed: true, }, + "association_state": { + Type: schema.TypeString, + Computed: true, + }, + "association_transit_gateway_route_table_id": { + Type: schema.TypeString, + Computed: true, + }, }, } } @@ -104,6 +112,8 @@ func dataSourceTransitGatewayAttachmentRead(ctx context.Context, d *schema.Resou d.Set("transit_gateway_attachment_id", transitGatewayAttachmentID) d.Set("transit_gateway_id", transitGatewayAttachment.TransitGatewayId) d.Set("transit_gateway_owner_id", transitGatewayAttachment.TransitGatewayOwnerId) + d.Set("association_state", transitGatewayAttachment.Association.State) + d.Set("association_transit_gateway_route_table_id", transitGatewayAttachment.Association.TransitGatewayRouteTableId) if err := d.Set("tags", KeyValueTags(ctx, transitGatewayAttachment.Tags).IgnoreAWS().IgnoreConfig(ignoreTagsConfig).Map()); err != nil { return sdkdiag.AppendErrorf(diags, "setting tags: %s", err) From c2aa421117b5c022706c85ba24c2fbff6cd3de5f Mon Sep 17 00:00:00 2001 From: drfaust92 Date: Fri, 24 Feb 2023 18:57:40 +0200 Subject: [PATCH 073/763] rebase --- internal/service/rds/snapshot.go | 6 +++--- internal/service/rds/snapshot_test.go | 20 +++++++++++++------- 2 files changed, 16 insertions(+), 10 deletions(-) diff --git a/internal/service/rds/snapshot.go b/internal/service/rds/snapshot.go index 751782f4036f..c72959a1f279 100644 --- a/internal/service/rds/snapshot.go +++ b/internal/service/rds/snapshot.go @@ -166,7 +166,7 @@ func resourceSnapshotCreate(ctx context.Context, d *schema.ResourceData, meta in ValuesToAdd: flex.ExpandStringSet(v.(*schema.Set)), } - _, err := conn.ModifyDBSnapshotAttribute(attrInput) + _, err := conn.ModifyDBSnapshotAttributeWithContext(ctx, attrInput) if err != nil { return sdkdiag.AppendErrorf(diags, "error modifying AWS DB Snapshot Attribute %s: %s", dBInstanceIdentifier, err) } @@ -233,7 +233,7 @@ func resourceSnapshotRead(ctx context.Context, d *schema.ResourceData, meta inte DBSnapshotIdentifier: aws.String(d.Id()), } - attrResp, err := conn.DescribeDBSnapshotAttributes(attrInput) + attrResp, err := conn.DescribeDBSnapshotAttributesWithContext(ctx, attrInput) if err != nil { return sdkdiag.AppendErrorf(diags, "error describing AWS DB Snapshot Attribute %s: %s", d.Id(), err) } @@ -284,7 +284,7 @@ func resourceSnapshotUpdate(ctx context.Context, d *schema.ResourceData, meta in ValuesToRemove: flex.ExpandStringSet(removalList), } - _, err := conn.ModifyDBSnapshotAttribute(attrInput) + _, err := conn.ModifyDBSnapshotAttributeWithContext(ctx, attrInput) if err != nil { return sdkdiag.AppendErrorf(diags, "error modifying AWS DB Snapshot Attribute %s: %s", d.Id(), err) } diff --git a/internal/service/rds/snapshot_test.go b/internal/service/rds/snapshot_test.go index e5694df3ec5f..5e65c4e68a4c 100644 --- a/internal/service/rds/snapshot_test.go +++ b/internal/service/rds/snapshot_test.go @@ -52,6 +52,7 @@ func TestAccRDSSnapshot_basic(t *testing.T) { } func TestAccRDSSnapshot_share(t *testing.T) { + ctx := acctest.Context(t) if testing.Short() { t.Skip("skipping long-running test in short mode") } @@ -64,12 +65,12 @@ func TestAccRDSSnapshot_share(t *testing.T) { PreCheck: func() { acctest.PreCheck(t) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - CheckDestroy: testAccCheckDBSnapshotDestroy, + CheckDestroy: testAccCheckDBSnapshotDestroy(ctx), Steps: []resource.TestStep{ { Config: testAccSnapshotConfig_share(rName), Check: resource.ComposeTestCheckFunc( - testAccCheckDBSnapshotExists(resourceName, &v), + testAccCheckDBSnapshotExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "shared_accounts.#", "1"), resource.TestCheckTypeSetElemAttr(resourceName, "shared_accounts.*", "all"), ), @@ -82,7 +83,7 @@ func TestAccRDSSnapshot_share(t *testing.T) { { Config: testAccSnapshotConfig_basic(rName), Check: resource.ComposeTestCheckFunc( - testAccCheckDBSnapshotExists(resourceName, &v), + testAccCheckDBSnapshotExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "shared_accounts.#", "0"), ), }, @@ -179,15 +180,20 @@ func testAccCheckDBSnapshotDestroy(ctx context.Context) resource.TestCheckFunc { log.Printf("[DEBUG] Checking if RDS DB Snapshot %s exists", rs.Primary.ID) - _, err := tfrds.FindSnapshot(context.Background(), conn, rs.Primary.ID) + _, err := tfrds.FindDBSnapshotByID(ctx, conn, rs.Primary.ID) - // verify error is what we want if tfresource.NotFound(err) { continue } - return err + if err != nil { + return err + } + + return fmt.Errorf("RDS DB Snapshot %s still exists", rs.Primary.ID) } + + return nil } } @@ -204,7 +210,7 @@ func testAccCheckDBSnapshotExists(ctx context.Context, n string, v *rds.DBSnapsh conn := acctest.Provider.Meta().(*conns.AWSClient).RDSConn() - out, err := tfrds.FindSnapshot(context.Background(), conn, rs.Primary.ID) + out, err := tfrds.FindDBSnapshotByID(context.Background(), conn, rs.Primary.ID) if err != nil { return err } From 6cb5341c33fa5c9a6a7597b14bd6819fdbce383a Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Fri, 24 Feb 2023 15:49:23 -0500 Subject: [PATCH 074/763] semgrep to add 'acctest.Context(t)' to data source tests. --- data-source-test-create-context.semgrep.yml | 28 +++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 data-source-test-create-context.semgrep.yml diff --git a/data-source-test-create-context.semgrep.yml b/data-source-test-create-context.semgrep.yml new file mode 100644 index 000000000000..7448e3977c1f --- /dev/null +++ b/data-source-test-create-context.semgrep.yml @@ -0,0 +1,28 @@ +rules: + - id: data-source-acceptance-test-no-Context + languages: [go] + message: $FUNCNAME should create Context + paths: + include: + - internal/service/**/*_data_source_test.go + patterns: + - pattern: | + func $FUNCNAME(t *testing.T) { + $...BODY + } + - pattern-not: | + func $FUNCNAME(t *testing.T) { + ... + ctx := acctest.Context(t) + ... + } + - metavariable-pattern: + metavariable: $FUNCNAME + patterns: + - pattern-regex: "^[Tt]estAcc[a-zA-Z0-9]+_[a-zA-Z0-9_]+$" + - pattern-not-regex: "^TestAcc[a-zA-Z0-9]+_serial$" + - focus-metavariable: $...BODY + fix: | + ctx := acctest.Context(t) + $...BODY + severity: WARNING \ No newline at end of file From 1f94aa2b86fecd0dacac514f53290deeaeba6a7e Mon Sep 17 00:00:00 2001 From: Lukas Hetzenecker Date: Fri, 24 Feb 2023 22:08:53 +0100 Subject: [PATCH 075/763] small fixes, add tests and documentation --- .../service/ec2/transitgateway_attachment_data_source.go | 9 +++++++-- .../ec2/transitgateway_attachment_data_source_test.go | 8 ++++++-- internal/service/ec2/transitgateway_data_source_test.go | 4 ++-- .../docs/d/ec2_transit_gateway_attachment.html.markdown | 2 ++ 4 files changed, 17 insertions(+), 6 deletions(-) diff --git a/internal/service/ec2/transitgateway_attachment_data_source.go b/internal/service/ec2/transitgateway_attachment_data_source.go index 57bd270ea636..284681421f87 100644 --- a/internal/service/ec2/transitgateway_attachment_data_source.go +++ b/internal/service/ec2/transitgateway_attachment_data_source.go @@ -112,8 +112,13 @@ func dataSourceTransitGatewayAttachmentRead(ctx context.Context, d *schema.Resou d.Set("transit_gateway_attachment_id", transitGatewayAttachmentID) d.Set("transit_gateway_id", transitGatewayAttachment.TransitGatewayId) d.Set("transit_gateway_owner_id", transitGatewayAttachment.TransitGatewayOwnerId) - d.Set("association_state", transitGatewayAttachment.Association.State) - d.Set("association_transit_gateway_route_table_id", transitGatewayAttachment.Association.TransitGatewayRouteTableId) + if v := transitGatewayAttachment.Association; v != nil { + d.Set("association_state", v.State) + d.Set("association_transit_gateway_route_table_id", v.TransitGatewayRouteTableId) + } else { + d.Set("association_state", nil) + d.Set("association_transit_gateway_route_table_id", nil) + } if err := d.Set("tags", KeyValueTags(ctx, transitGatewayAttachment.Tags).IgnoreAWS().IgnoreConfig(ignoreTagsConfig).Map()); err != nil { return sdkdiag.AppendErrorf(diags, "setting tags: %s", err) diff --git a/internal/service/ec2/transitgateway_attachment_data_source_test.go b/internal/service/ec2/transitgateway_attachment_data_source_test.go index 6bbb210fc8b7..f43cd939cc0b 100644 --- a/internal/service/ec2/transitgateway_attachment_data_source_test.go +++ b/internal/service/ec2/transitgateway_attachment_data_source_test.go @@ -10,7 +10,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) -func testAccTransitGatewayAttachmentDataSource_Filter(t *testing.T) { +func TestAccTransitGatewayAttachmentDataSource_Filter(t *testing.T) { ctx := acctest.Context(t) dataSourceName := "data.aws_ec2_transit_gateway_attachment.test" resourceName := "aws_ec2_transit_gateway_vpc_attachment.test" @@ -33,13 +33,15 @@ func testAccTransitGatewayAttachmentDataSource_Filter(t *testing.T) { resource.TestCheckResourceAttrPair(resourceName, "id", dataSourceName, "transit_gateway_attachment_id"), resource.TestCheckResourceAttrPair(resourceName, "transit_gateway_id", dataSourceName, "transit_gateway_id"), acctest.CheckResourceAttrAccountID(dataSourceName, "transit_gateway_owner_id"), + resource.TestCheckResourceAttr(dataSourceName, "association_state", "associated"), + resource.TestCheckResourceAttrSet(dataSourceName, "association_transit_gateway_route_table_id"), ), }, }, }) } -func testAccTransitGatewayAttachmentDataSource_ID(t *testing.T) { +func TestAccTransitGatewayAttachmentDataSource_ID(t *testing.T) { ctx := acctest.Context(t) dataSourceName := "data.aws_ec2_transit_gateway_attachment.test" resourceName := "aws_ec2_transit_gateway_vpc_attachment.test" @@ -62,6 +64,8 @@ func testAccTransitGatewayAttachmentDataSource_ID(t *testing.T) { resource.TestCheckResourceAttrPair(resourceName, "id", dataSourceName, "transit_gateway_attachment_id"), resource.TestCheckResourceAttrPair(resourceName, "transit_gateway_id", dataSourceName, "transit_gateway_id"), acctest.CheckResourceAttrAccountID(dataSourceName, "transit_gateway_owner_id"), + resource.TestCheckResourceAttr(dataSourceName, "association_state", "associated"), + resource.TestCheckResourceAttrSet(dataSourceName, "association_transit_gateway_route_table_id"), ), }, }, diff --git a/internal/service/ec2/transitgateway_data_source_test.go b/internal/service/ec2/transitgateway_data_source_test.go index 82ae29471d61..d44c43dc6f84 100644 --- a/internal/service/ec2/transitgateway_data_source_test.go +++ b/internal/service/ec2/transitgateway_data_source_test.go @@ -15,8 +15,8 @@ func TestAccTransitGatewayDataSource_serial(t *testing.T) { testCases := map[string]map[string]func(t *testing.T){ "Attachment": { - "Filter": testAccTransitGatewayAttachmentDataSource_Filter, - "ID": testAccTransitGatewayAttachmentDataSource_ID, + "Filter": TestAccTransitGatewayAttachmentDataSource_Filter, + "ID": TestAccTransitGatewayAttachmentDataSource_ID, }, "Connect": { "Filter": testAccTransitGatewayConnectDataSource_Filter, diff --git a/website/docs/d/ec2_transit_gateway_attachment.html.markdown b/website/docs/d/ec2_transit_gateway_attachment.html.markdown index ed3bdca9f897..dfe7dc547fff 100644 --- a/website/docs/d/ec2_transit_gateway_attachment.html.markdown +++ b/website/docs/d/ec2_transit_gateway_attachment.html.markdown @@ -50,3 +50,5 @@ In addition to all arguments above, the following attributes are exported: * `tags` - Key-value tags for the attachment. * `transit_gateway_id` - ID of the transit gateway. * `transit_gateway_owner_id` - The ID of the AWS account that owns the transit gateway. +* `association_state` - The state of the association (see [the underlying AWS API](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_TransitGatewayAttachmentAssociation.html) for valid values). +* `association_transit_gateway_route_table_id` - The ID of the route table for the transit gateway. From b81d3117e5e4411a934b0ccbbf58a2bb816859bb Mon Sep 17 00:00:00 2001 From: Lukas Hetzenecker Date: Fri, 24 Feb 2023 22:11:19 +0100 Subject: [PATCH 076/763] revert test name changes --- .../service/ec2/transitgateway_attachment_data_source_test.go | 4 ++-- internal/service/ec2/transitgateway_data_source_test.go | 4 ++-- website/docs/d/ec2_transit_gateway_attachment.html.markdown | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/internal/service/ec2/transitgateway_attachment_data_source_test.go b/internal/service/ec2/transitgateway_attachment_data_source_test.go index f43cd939cc0b..a92123828bb0 100644 --- a/internal/service/ec2/transitgateway_attachment_data_source_test.go +++ b/internal/service/ec2/transitgateway_attachment_data_source_test.go @@ -10,7 +10,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) -func TestAccTransitGatewayAttachmentDataSource_Filter(t *testing.T) { +func testAccTransitGatewayAttachmentDataSource_Filter(t *testing.T) { ctx := acctest.Context(t) dataSourceName := "data.aws_ec2_transit_gateway_attachment.test" resourceName := "aws_ec2_transit_gateway_vpc_attachment.test" @@ -41,7 +41,7 @@ func TestAccTransitGatewayAttachmentDataSource_Filter(t *testing.T) { }) } -func TestAccTransitGatewayAttachmentDataSource_ID(t *testing.T) { +func testAccTransitGatewayAttachmentDataSource_ID(t *testing.T) { ctx := acctest.Context(t) dataSourceName := "data.aws_ec2_transit_gateway_attachment.test" resourceName := "aws_ec2_transit_gateway_vpc_attachment.test" diff --git a/internal/service/ec2/transitgateway_data_source_test.go b/internal/service/ec2/transitgateway_data_source_test.go index d44c43dc6f84..82ae29471d61 100644 --- a/internal/service/ec2/transitgateway_data_source_test.go +++ b/internal/service/ec2/transitgateway_data_source_test.go @@ -15,8 +15,8 @@ func TestAccTransitGatewayDataSource_serial(t *testing.T) { testCases := map[string]map[string]func(t *testing.T){ "Attachment": { - "Filter": TestAccTransitGatewayAttachmentDataSource_Filter, - "ID": TestAccTransitGatewayAttachmentDataSource_ID, + "Filter": testAccTransitGatewayAttachmentDataSource_Filter, + "ID": testAccTransitGatewayAttachmentDataSource_ID, }, "Connect": { "Filter": testAccTransitGatewayConnectDataSource_Filter, diff --git a/website/docs/d/ec2_transit_gateway_attachment.html.markdown b/website/docs/d/ec2_transit_gateway_attachment.html.markdown index dfe7dc547fff..66a3ff8ded91 100644 --- a/website/docs/d/ec2_transit_gateway_attachment.html.markdown +++ b/website/docs/d/ec2_transit_gateway_attachment.html.markdown @@ -51,4 +51,4 @@ In addition to all arguments above, the following attributes are exported: * `transit_gateway_id` - ID of the transit gateway. * `transit_gateway_owner_id` - The ID of the AWS account that owns the transit gateway. * `association_state` - The state of the association (see [the underlying AWS API](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_TransitGatewayAttachmentAssociation.html) for valid values). -* `association_transit_gateway_route_table_id` - The ID of the route table for the transit gateway. +* `association_transit_gateway_route_table_id` - The ID of the route table for the transit gateway. From 9acadbb782b9bba1689216e564e669d22b31c745 Mon Sep 17 00:00:00 2001 From: Lukas Date: Fri, 24 Feb 2023 22:21:40 +0100 Subject: [PATCH 077/763] Create 29648.txt --- .changelog/29648.txt | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 .changelog/29648.txt diff --git a/.changelog/29648.txt b/.changelog/29648.txt new file mode 100644 index 000000000000..5b768acd31bc --- /dev/null +++ b/.changelog/29648.txt @@ -0,0 +1,4 @@ +```release-note:enhancement +data-source/aws_ec2_transit_gateway_attachment: Add association_state argument +data-source/aws_ec2_transit_gateway_attachment: Add association_transit_gateway_route_table_id argument +``` From 162448071770fa15cb1017ed1d5bf45974e08989 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Fri, 24 Feb 2023 16:34:59 -0500 Subject: [PATCH 078/763] Add 'Context' argument to 'acctest.PreCheck'. --- internal/acctest/acctest.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/acctest/acctest.go b/internal/acctest/acctest.go index bce69aa381bb..8e0caace0433 100644 --- a/internal/acctest/acctest.go +++ b/internal/acctest/acctest.go @@ -200,7 +200,7 @@ func ProtoV5FactoriesMultipleRegions(ctx context.Context, t *testing.T, n int) m // // These verifications and configuration are preferred at this level to prevent // provider developers from experiencing less clear errors for every test. -func PreCheck(t *testing.T) { +func PreCheck(ctx context.Context, t *testing.T) { // Since we are outside the scope of the Terraform configuration we must // call Configure() to properly initialize the provider configuration. testAccProviderConfigure.Do(func() { @@ -220,7 +220,7 @@ func PreCheck(t *testing.T) { region := Region() os.Setenv(envvar.DefaultRegion, region) - err := sdkdiag.DiagnosticsError(Provider.Configure(context.Background(), terraform.NewResourceConfigRaw(nil))) + err := sdkdiag.DiagnosticsError(Provider.Configure(ctx, terraform.NewResourceConfigRaw(nil))) if err != nil { t.Fatal(err) From 462b1cd290f7c779c49d2b2f842bcb76f20b23d9 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Fri, 24 Feb 2023 16:36:28 -0500 Subject: [PATCH 079/763] Add 'Context' argument to 'acctest.PreCheck' for accessanalyzer. --- internal/service/accessanalyzer/analyzer_test.go | 8 ++++---- internal/service/accessanalyzer/archive_rule_test.go | 6 +++--- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/internal/service/accessanalyzer/analyzer_test.go b/internal/service/accessanalyzer/analyzer_test.go index 7b38789b760f..a710d2232dbe 100644 --- a/internal/service/accessanalyzer/analyzer_test.go +++ b/internal/service/accessanalyzer/analyzer_test.go @@ -23,7 +23,7 @@ func testAccAnalyzer_basic(t *testing.T) { resourceName := "aws_accessanalyzer_analyzer.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, accessanalyzer.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckAnalyzerDestroy(ctx), @@ -55,7 +55,7 @@ func testAccAnalyzer_disappears(t *testing.T) { resourceName := "aws_accessanalyzer_analyzer.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, accessanalyzer.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckAnalyzerDestroy(ctx), @@ -80,7 +80,7 @@ func testAccAnalyzer_Tags(t *testing.T) { resourceName := "aws_accessanalyzer_analyzer.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, accessanalyzer.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckAnalyzerDestroy(ctx), @@ -128,7 +128,7 @@ func testAccAnalyzer_Type_Organization(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) testAccPreCheck(ctx, t) acctest.PreCheckOrganizationsAccount(ctx, t) }, diff --git a/internal/service/accessanalyzer/archive_rule_test.go b/internal/service/accessanalyzer/archive_rule_test.go index 099dc803e022..b25de1940b91 100644 --- a/internal/service/accessanalyzer/archive_rule_test.go +++ b/internal/service/accessanalyzer/archive_rule_test.go @@ -23,7 +23,7 @@ func testAccAnalyzerArchiveRule_basic(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(accessanalyzer.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, accessanalyzer.EndpointsID), @@ -79,7 +79,7 @@ filter { ` resource.Test(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(accessanalyzer.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, accessanalyzer.EndpointsID), @@ -127,7 +127,7 @@ func testAccAnalyzerArchiveRule_disappears(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(accessanalyzer.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, accessanalyzer.EndpointsID), From 47f49aa30d81296a7c20a49c224826c556008d8c Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Fri, 24 Feb 2023 16:36:28 -0500 Subject: [PATCH 080/763] Add 'Context' argument to 'acctest.PreCheck' for account. --- internal/service/account/alternate_contact_test.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/internal/service/account/alternate_contact_test.go b/internal/service/account/alternate_contact_test.go index 0d3651f9e812..d3426390f8cf 100644 --- a/internal/service/account/alternate_contact_test.go +++ b/internal/service/account/alternate_contact_test.go @@ -25,7 +25,7 @@ func testAccAlternateContact_basic(t *testing.T) { rName2 := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, account.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckAlternateContactDestroy(ctx), @@ -71,7 +71,7 @@ func testAccAlternateContact_disappears(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, account.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckAlternateContactDestroy(ctx), @@ -99,7 +99,7 @@ func testAccAlternateContact_accountID(t *testing.T) { // nosemgrep:ci.account-i resource.Test(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckAlternateAccount(t) acctest.PreCheckOrganizationManagementAccount(ctx, t) testAccPreCheck(ctx, t) From 907d34b15d7f211280205df334c6031d2f081f6d Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Fri, 24 Feb 2023 16:36:29 -0500 Subject: [PATCH 081/763] Add 'Context' argument to 'acctest.PreCheck' for acm. --- .../acm/certificate_data_source_test.go | 8 +-- internal/service/acm/certificate_test.go | 56 +++++++++---------- .../acm/certificate_validation_test.go | 18 +++--- 3 files changed, 41 insertions(+), 41 deletions(-) diff --git a/internal/service/acm/certificate_data_source_test.go b/internal/service/acm/certificate_data_source_test.go index 0a497b18d5bd..1d56cd2bc4af 100644 --- a/internal/service/acm/certificate_data_source_test.go +++ b/internal/service/acm/certificate_data_source_test.go @@ -37,7 +37,7 @@ func TestAccACMCertificateDataSource_singleIssued(t *testing.T) { resourceName := "data.aws_acm_certificate.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, acm.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ @@ -124,7 +124,7 @@ func TestAccACMCertificateDataSource_multipleIssued(t *testing.T) { resourceName := "data.aws_acm_certificate.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, acm.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ @@ -173,7 +173,7 @@ func TestAccACMCertificateDataSource_noMatchReturnsError(t *testing.T) { domain := fmt.Sprintf("tf-acc-nonexistent.%s", os.Getenv("ACM_CERTIFICATE_ROOT_DOMAIN")) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, acm.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ @@ -213,7 +213,7 @@ func TestAccACMCertificateDataSource_keyTypes(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, acm.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ diff --git a/internal/service/acm/certificate_test.go b/internal/service/acm/certificate_test.go index a35fe19677d0..e4a9de9788d8 100644 --- a/internal/service/acm/certificate_test.go +++ b/internal/service/acm/certificate_test.go @@ -27,7 +27,7 @@ func TestAccACMCertificate_emailValidation(t *testing.T) { var v acm.CertificateDetail resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, acm.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckCertificateDestroy(ctx), @@ -72,7 +72,7 @@ func TestAccACMCertificate_dnsValidation(t *testing.T) { var v acm.CertificateDetail resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, acm.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckCertificateDestroy(ctx), @@ -119,7 +119,7 @@ func TestAccACMCertificate_root(t *testing.T) { var v acm.CertificateDetail resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, acm.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckCertificateDestroy(ctx), @@ -160,7 +160,7 @@ func TestAccACMCertificate_validationOptions(t *testing.T) { var v acm.CertificateDetail resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, acm.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckCertificateDestroy(ctx), @@ -200,7 +200,7 @@ func TestAccACMCertificate_privateCertificate_renewable(t *testing.T) { var v1, v2, v3, v4 acm.CertificateDetail resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, acm.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckCertificateDestroy(ctx), @@ -326,7 +326,7 @@ func TestAccACMCertificate_privateCertificate_noRenewalPermission(t *testing.T) var v1, v2, v3 acm.CertificateDetail resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, acm.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckCertificateDestroy(ctx), @@ -444,7 +444,7 @@ func TestAccACMCertificate_privateCertificate_pendingRenewalGoDuration(t *testin var v1, v2 acm.CertificateDetail resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, acm.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckCertificateDestroy(ctx), @@ -518,7 +518,7 @@ func TestAccACMCertificate_privateCertificate_pendingRenewalRFC3339Duration(t *t var v1, v2 acm.CertificateDetail resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, acm.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckCertificateDestroy(ctx), @@ -592,7 +592,7 @@ func TestAccACMCertificate_privateCertificate_addEarlyRenewalPast(t *testing.T) var v1, v2, v3 acm.CertificateDetail resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, acm.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckCertificateDestroy(ctx), @@ -680,7 +680,7 @@ func TestAccACMCertificate_privateCertificate_addEarlyRenewalPastIneligible(t *t var v1, v2 acm.CertificateDetail resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, acm.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckCertificateDestroy(ctx), @@ -733,7 +733,7 @@ func TestAccACMCertificate_privateCertificate_addEarlyRenewalFuture(t *testing.T var v1, v2, v3 acm.CertificateDetail resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, acm.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckCertificateDestroy(ctx), @@ -819,7 +819,7 @@ func TestAccACMCertificate_privateCertificate_updateEarlyRenewalFuture(t *testin var v1, v2 acm.CertificateDetail resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, acm.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckCertificateDestroy(ctx), @@ -889,7 +889,7 @@ func TestAccACMCertificate_privateCertificate_removeEarlyRenewal(t *testing.T) { var v1, v2 acm.CertificateDetail resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, acm.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckCertificateDestroy(ctx), @@ -958,7 +958,7 @@ func TestAccACMCertificate_Root_trailingPeriod(t *testing.T) { domain := fmt.Sprintf("%s.", rootDomain) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, acm.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckCertificateDestroy(ctx), @@ -979,7 +979,7 @@ func TestAccACMCertificate_rootAndWildcardSan(t *testing.T) { var v acm.CertificateDetail resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, acm.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckCertificateDestroy(ctx), @@ -1022,7 +1022,7 @@ func TestAccACMCertificate_SubjectAlternativeNames_emptyString(t *testing.T) { domain := acctest.ACMCertificateRandomSubDomain(rootDomain) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, acm.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckCertificateDestroy(ctx), @@ -1044,7 +1044,7 @@ func TestAccACMCertificate_San_single(t *testing.T) { var v acm.CertificateDetail resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, acm.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckCertificateDestroy(ctx), @@ -1091,7 +1091,7 @@ func TestAccACMCertificate_San_multiple(t *testing.T) { var v acm.CertificateDetail resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, acm.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckCertificateDestroy(ctx), @@ -1142,7 +1142,7 @@ func TestAccACMCertificate_San_trailingPeriod(t *testing.T) { var v acm.CertificateDetail resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, acm.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckCertificateDestroy(ctx), @@ -1188,7 +1188,7 @@ func TestAccACMCertificate_San_matches_domain(t *testing.T) { var v acm.CertificateDetail resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, acm.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckCertificateDestroy(ctx), @@ -1233,7 +1233,7 @@ func TestAccACMCertificate_wildcard(t *testing.T) { var v acm.CertificateDetail resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, acm.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckCertificateDestroy(ctx), @@ -1273,7 +1273,7 @@ func TestAccACMCertificate_wildcardAndRootSan(t *testing.T) { var v acm.CertificateDetail resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, acm.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckCertificateDestroy(ctx), @@ -1317,7 +1317,7 @@ func TestAccACMCertificate_keyAlgorithm(t *testing.T) { var v acm.CertificateDetail resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, acm.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckCertificateDestroy(ctx), @@ -1357,7 +1357,7 @@ func TestAccACMCertificate_disableCTLogging(t *testing.T) { var v acm.CertificateDetail resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, acm.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckCertificateDestroy(ctx), @@ -1407,7 +1407,7 @@ func TestAccACMCertificate_Imported_domainName(t *testing.T) { var v1, v2, v3 acm.CertificateDetail resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, acm.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckCertificateDestroy(ctx), @@ -1465,7 +1465,7 @@ func TestAccACMCertificate_Imported_validityDates(t *testing.T) { var v acm.CertificateDetail resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, acm.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckCertificateDestroy(ctx), @@ -1501,7 +1501,7 @@ func TestAccACMCertificate_Imported_ipAddress(t *testing.T) { var v acm.CertificateDetail resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, acm.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckCertificateDestroy(ctx), @@ -1537,7 +1537,7 @@ func TestAccACMCertificate_PrivateKey_tags(t *testing.T) { var v acm.CertificateDetail resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, acm.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckCertificateDestroy(ctx), diff --git a/internal/service/acm/certificate_validation_test.go b/internal/service/acm/certificate_validation_test.go index 9a9f5dca419b..76ef3dc11193 100644 --- a/internal/service/acm/certificate_validation_test.go +++ b/internal/service/acm/certificate_validation_test.go @@ -23,7 +23,7 @@ func TestAccACMCertificateValidation_basic(t *testing.T) { resourceName := "aws_acm_certificate_validation.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, acm.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckCertificateDestroy(ctx), @@ -46,7 +46,7 @@ func TestAccACMCertificateValidation_timeout(t *testing.T) { domain := acctest.ACMCertificateRandomSubDomain(rootDomain) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, acm.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckCertificateDestroy(ctx), @@ -67,7 +67,7 @@ func TestAccACMCertificateValidation_validationRecordFQDNS(t *testing.T) { resourceName := "aws_acm_certificate_validation.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, acm.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckCertificateDestroy(ctx), @@ -95,7 +95,7 @@ func TestAccACMCertificateValidation_validationRecordFQDNSEmail(t *testing.T) { domain := acctest.ACMCertificateRandomSubDomain(rootDomain) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, acm.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckCertificateDestroy(ctx), @@ -115,7 +115,7 @@ func TestAccACMCertificateValidation_validationRecordFQDNSRoot(t *testing.T) { resourceName := "aws_acm_certificate_validation.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, acm.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckCertificateDestroy(ctx), @@ -139,7 +139,7 @@ func TestAccACMCertificateValidation_validationRecordFQDNSRootAndWildcard(t *tes resourceName := "aws_acm_certificate_validation.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, acm.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckCertificateDestroy(ctx), @@ -164,7 +164,7 @@ func TestAccACMCertificateValidation_validationRecordFQDNSSan(t *testing.T) { resourceName := "aws_acm_certificate_validation.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, acm.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckCertificateDestroy(ctx), @@ -188,7 +188,7 @@ func TestAccACMCertificateValidation_validationRecordFQDNSWildcard(t *testing.T) resourceName := "aws_acm_certificate_validation.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, acm.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckCertificateDestroy(ctx), @@ -213,7 +213,7 @@ func TestAccACMCertificateValidation_validationRecordFQDNSWildcardAndRoot(t *tes resourceName := "aws_acm_certificate_validation.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, acm.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckCertificateDestroy(ctx), From 86e6f48e5094158685881d03d62475d9a0999ad9 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Fri, 24 Feb 2023 16:36:29 -0500 Subject: [PATCH 082/763] Add 'Context' argument to 'acctest.PreCheck' for acmpca. --- .../certificate_authority_certificate_test.go | 6 ++--- .../certificate_authority_data_source_test.go | 4 +-- .../acmpca/certificate_authority_test.go | 26 +++++++++---------- .../acmpca/certificate_data_source_test.go | 2 +- internal/service/acmpca/certificate_test.go | 10 +++---- internal/service/acmpca/permission_test.go | 6 ++--- internal/service/acmpca/policy_test.go | 2 +- 7 files changed, 28 insertions(+), 28 deletions(-) diff --git a/internal/service/acmpca/certificate_authority_certificate_test.go b/internal/service/acmpca/certificate_authority_certificate_test.go index b37a2a15bb5b..87fc4df8df33 100644 --- a/internal/service/acmpca/certificate_authority_certificate_test.go +++ b/internal/service/acmpca/certificate_authority_certificate_test.go @@ -22,7 +22,7 @@ func TestAccACMPCACertificateAuthorityCertificate_rootCA(t *testing.T) { commonName := acctest.RandomDomainName() resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, acmpca.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: nil, // Certificate authority certificates cannot be deleted @@ -54,7 +54,7 @@ func TestAccACMPCACertificateAuthorityCertificate_updateRootCA(t *testing.T) { commonName := acctest.RandomDomainName() resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, acmpca.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: nil, // Certificate authority certificates cannot be deleted @@ -89,7 +89,7 @@ func TestAccACMPCACertificateAuthorityCertificate_subordinateCA(t *testing.T) { commonName := acctest.RandomDomainName() resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, acmpca.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: nil, // Certificate authority certificates cannot be deleted diff --git a/internal/service/acmpca/certificate_authority_data_source_test.go b/internal/service/acmpca/certificate_authority_data_source_test.go index d3a111c79dbb..94d85387fb52 100644 --- a/internal/service/acmpca/certificate_authority_data_source_test.go +++ b/internal/service/acmpca/certificate_authority_data_source_test.go @@ -17,7 +17,7 @@ func TestAccACMPCACertificateAuthorityDataSource_basic(t *testing.T) { commonName := acctest.RandomDomainName() resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, acmpca.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ @@ -55,7 +55,7 @@ func TestAccACMPCACertificateAuthorityDataSource_s3ObjectACL(t *testing.T) { commonName := acctest.RandomDomainName() resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, acmpca.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ diff --git a/internal/service/acmpca/certificate_authority_test.go b/internal/service/acmpca/certificate_authority_test.go index e083d65b60d2..ce1d5a10eca4 100644 --- a/internal/service/acmpca/certificate_authority_test.go +++ b/internal/service/acmpca/certificate_authority_test.go @@ -23,7 +23,7 @@ func TestAccACMPCACertificateAuthority_basic(t *testing.T) { commonName := acctest.RandomDomainName() resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, acmpca.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckCertificateAuthorityDestroy(ctx), @@ -71,7 +71,7 @@ func TestAccACMPCACertificateAuthority_disappears(t *testing.T) { commonName := acctest.RandomDomainName() resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, acmpca.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckCertificateAuthorityDestroy(ctx), @@ -95,7 +95,7 @@ func TestAccACMPCACertificateAuthority_enabledDeprecated(t *testing.T) { commonName := acctest.RandomDomainName() resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, acmpca.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckCertificateAuthorityDestroy(ctx), @@ -146,7 +146,7 @@ func TestAccACMPCACertificateAuthority_usageMode(t *testing.T) { commonName := acctest.RandomDomainName() resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, acmpca.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckCertificateAuthorityDestroy(ctx), @@ -177,7 +177,7 @@ func TestAccACMPCACertificateAuthority_deleteFromActiveState(t *testing.T) { commonName := acctest.RandomDomainName() resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, acmpca.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckCertificateAuthorityDestroy(ctx), @@ -204,7 +204,7 @@ func TestAccACMPCACertificateAuthority_RevocationConfiguration_empty(t *testing. commonName := acctest.RandomDomainName() resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, acmpca.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckCertificateAuthorityDestroy(ctx), @@ -256,7 +256,7 @@ func TestAccACMPCACertificateAuthority_RevocationCrl_customCNAME(t *testing.T) { customCName2 := domain.Subdomain("crl2").String() resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, acmpca.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckCertificateAuthorityDestroy(ctx), @@ -344,7 +344,7 @@ func TestAccACMPCACertificateAuthority_RevocationCrl_enabled(t *testing.T) { commonName := acctest.RandomDomainName() resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, acmpca.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckCertificateAuthorityDestroy(ctx), @@ -416,7 +416,7 @@ func TestAccACMPCACertificateAuthority_RevocationCrl_expirationInDays(t *testing commonName := acctest.RandomDomainName() resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, acmpca.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckCertificateAuthorityDestroy(ctx), @@ -478,7 +478,7 @@ func TestAccACMPCACertificateAuthority_RevocationCrl_s3ObjectACL(t *testing.T) { commonName := acctest.RandomDomainName() resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, acmpca.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckCertificateAuthorityDestroy(ctx), @@ -529,7 +529,7 @@ func TestAccACMPCACertificateAuthority_RevocationOcsp_enabled(t *testing.T) { commonName := acctest.RandomDomainName() resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, acmpca.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckCertificateAuthorityDestroy(ctx), @@ -599,7 +599,7 @@ func TestAccACMPCACertificateAuthority_RevocationOcsp_customCNAME(t *testing.T) customCName2 := domain.Subdomain("ocsp2").String() resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, acmpca.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckCertificateAuthorityDestroy(ctx), @@ -678,7 +678,7 @@ func TestAccACMPCACertificateAuthority_tags(t *testing.T) { commonName := acctest.RandomDomainName() resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, acmpca.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckCertificateAuthorityDestroy(ctx), diff --git a/internal/service/acmpca/certificate_data_source_test.go b/internal/service/acmpca/certificate_data_source_test.go index 17bc2c784e09..68e5a736a511 100644 --- a/internal/service/acmpca/certificate_data_source_test.go +++ b/internal/service/acmpca/certificate_data_source_test.go @@ -17,7 +17,7 @@ func TestAccACMPCACertificateDataSource_basic(t *testing.T) { domain := acctest.RandomDomainName() resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, acmpca.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ diff --git a/internal/service/acmpca/certificate_test.go b/internal/service/acmpca/certificate_test.go index 9ef8fdf45583..f62097aaf06a 100644 --- a/internal/service/acmpca/certificate_test.go +++ b/internal/service/acmpca/certificate_test.go @@ -26,7 +26,7 @@ func TestAccACMPCACertificate_rootCertificate(t *testing.T) { domain := acctest.RandomDomainName() resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, acmpca.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckCertificateDestroy(ctx), @@ -70,7 +70,7 @@ func TestAccACMPCACertificate_subordinateCertificate(t *testing.T) { domain := acctest.RandomDomainName() resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, acmpca.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckCertificateDestroy(ctx), @@ -114,7 +114,7 @@ func TestAccACMPCACertificate_endEntityCertificate(t *testing.T) { domain := acctest.RandomDomainName() resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, acmpca.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckCertificateDestroy(ctx), @@ -158,7 +158,7 @@ func TestAccACMPCACertificate_Validity_endDate(t *testing.T) { later := time.Now().Add(time.Minute * 10).Format(time.RFC3339) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, acmpca.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckCertificateDestroy(ctx), @@ -202,7 +202,7 @@ func TestAccACMPCACertificate_Validity_absolute(t *testing.T) { later := time.Now().Add(time.Minute * 10).Unix() resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, acmpca.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckCertificateDestroy(ctx), diff --git a/internal/service/acmpca/permission_test.go b/internal/service/acmpca/permission_test.go index 709a0849cde5..84e84bf83620 100644 --- a/internal/service/acmpca/permission_test.go +++ b/internal/service/acmpca/permission_test.go @@ -21,7 +21,7 @@ func TestAccACMPCAPermission_basic(t *testing.T) { commonName := acctest.RandomDomainName() resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, acmpca.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckPermissionDestroy(ctx), @@ -50,7 +50,7 @@ func TestAccACMPCAPermission_disappears(t *testing.T) { commonName := acctest.RandomDomainName() resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, acmpca.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckPermissionDestroy(ctx), @@ -74,7 +74,7 @@ func TestAccACMPCAPermission_sourceAccount(t *testing.T) { commonName := acctest.RandomDomainName() resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, acmpca.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckPermissionDestroy(ctx), diff --git a/internal/service/acmpca/policy_test.go b/internal/service/acmpca/policy_test.go index 591afe9fb350..040f5f08bd8f 100644 --- a/internal/service/acmpca/policy_test.go +++ b/internal/service/acmpca/policy_test.go @@ -19,7 +19,7 @@ func TestAccACMPCAPolicy_basic(t *testing.T) { resourceName := "aws_acmpca_policy.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, acmpca.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckPolicyDestroy(ctx), From aab745ecd5ea67d4b21b4831e72bd69bcaf14e1e Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Fri, 24 Feb 2023 16:36:29 -0500 Subject: [PATCH 083/763] Add 'Context' argument to 'acctest.PreCheck' for amp. --- internal/service/amp/alert_manager_definition_test.go | 4 ++-- internal/service/amp/rule_group_namespace_test.go | 4 ++-- internal/service/amp/workspace_data_source_test.go | 2 +- internal/service/amp/workspace_test.go | 10 +++++----- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/internal/service/amp/alert_manager_definition_test.go b/internal/service/amp/alert_manager_definition_test.go index 7015482c2d15..81ec296cb18e 100644 --- a/internal/service/amp/alert_manager_definition_test.go +++ b/internal/service/amp/alert_manager_definition_test.go @@ -19,7 +19,7 @@ func TestAccAMPAlertManagerDefinition_basic(t *testing.T) { resourceName := "aws_prometheus_alert_manager_definition.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(prometheusservice.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(prometheusservice.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, prometheusservice.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckAlertManagerDefinitionDestroy(ctx), @@ -58,7 +58,7 @@ func TestAccAMPAlertManagerDefinition_disappears(t *testing.T) { ctx := acctest.Context(t) resourceName := "aws_prometheus_alert_manager_definition.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(prometheusservice.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(prometheusservice.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, prometheusservice.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckAlertManagerDefinitionDestroy(ctx), diff --git a/internal/service/amp/rule_group_namespace_test.go b/internal/service/amp/rule_group_namespace_test.go index 24287259321b..c545352d3d0d 100644 --- a/internal/service/amp/rule_group_namespace_test.go +++ b/internal/service/amp/rule_group_namespace_test.go @@ -19,7 +19,7 @@ func TestAccAMPRuleGroupNamespace_basic(t *testing.T) { resourceName := "aws_prometheus_rule_group_namespace.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(prometheusservice.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(prometheusservice.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, prometheusservice.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRuleGroupNamespaceDestroy(ctx), @@ -58,7 +58,7 @@ func TestAccAMPRuleGroupNamespace_disappears(t *testing.T) { ctx := acctest.Context(t) resourceName := "aws_prometheus_rule_group_namespace.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(prometheusservice.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(prometheusservice.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, prometheusservice.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRuleGroupNamespaceDestroy(ctx), diff --git a/internal/service/amp/workspace_data_source_test.go b/internal/service/amp/workspace_data_source_test.go index b1f9f93baa31..8b4da8dd655b 100644 --- a/internal/service/amp/workspace_data_source_test.go +++ b/internal/service/amp/workspace_data_source_test.go @@ -16,7 +16,7 @@ func TestAccAMPWorkspaceDataSource_basic(t *testing.T) { dataSourceName := "data.aws_prometheus_workspace.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(prometheusservice.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(prometheusservice.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, prometheusservice.EndpointsID), CheckDestroy: nil, ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, diff --git a/internal/service/amp/workspace_test.go b/internal/service/amp/workspace_test.go index dd7acd3712e9..d837a51123ae 100644 --- a/internal/service/amp/workspace_test.go +++ b/internal/service/amp/workspace_test.go @@ -22,7 +22,7 @@ func TestAccAMPWorkspace_basic(t *testing.T) { resourceName := "aws_prometheus_workspace.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(prometheusservice.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(prometheusservice.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, prometheusservice.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckWorkspaceDestroy(ctx), @@ -53,7 +53,7 @@ func TestAccAMPWorkspace_disappears(t *testing.T) { resourceName := "aws_prometheus_workspace.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(prometheusservice.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(prometheusservice.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, prometheusservice.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckWorkspaceDestroy(ctx), @@ -76,7 +76,7 @@ func TestAccAMPWorkspace_tags(t *testing.T) { resourceName := "aws_prometheus_workspace.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, prometheusservice.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckWorkspaceDestroy(ctx), @@ -123,7 +123,7 @@ func TestAccAMPWorkspace_alias(t *testing.T) { resourceName := "aws_prometheus_workspace.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(prometheusservice.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(prometheusservice.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, prometheusservice.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckWorkspaceDestroy(ctx), @@ -175,7 +175,7 @@ func TestAccAMPWorkspace_loggingConfiguration(t *testing.T) { resourceName := "aws_prometheus_workspace.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, prometheusservice.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckWorkspaceDestroy(ctx), From 333819caab3afb106d2ec44b9025e69aad22719a Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Fri, 24 Feb 2023 16:36:30 -0500 Subject: [PATCH 084/763] Add 'Context' argument to 'acctest.PreCheck' for amplify. --- internal/service/amplify/app_test.go | 24 +++++++++---------- .../amplify/backend_environment_test.go | 6 ++--- internal/service/amplify/branch_test.go | 12 +++++----- .../amplify/domain_association_test.go | 6 ++--- internal/service/amplify/webhook_test.go | 6 ++--- 5 files changed, 27 insertions(+), 27 deletions(-) diff --git a/internal/service/amplify/app_test.go b/internal/service/amplify/app_test.go index 8cb05b9a5c8b..19be43e9ca69 100644 --- a/internal/service/amplify/app_test.go +++ b/internal/service/amplify/app_test.go @@ -26,7 +26,7 @@ func testAccApp_basic(t *testing.T) { resourceName := "aws_amplify_app.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(t) }, ErrorCheck: acctest.ErrorCheck(t, amplify.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckAppDestroy(ctx), @@ -74,7 +74,7 @@ func testAccApp_disappears(t *testing.T) { resourceName := "aws_amplify_app.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(t) }, ErrorCheck: acctest.ErrorCheck(t, amplify.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckAppDestroy(ctx), @@ -98,7 +98,7 @@ func testAccApp_Tags(t *testing.T) { resourceName := "aws_amplify_app.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(t) }, ErrorCheck: acctest.ErrorCheck(t, amplify.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckAppDestroy(ctx), @@ -146,7 +146,7 @@ func testAccApp_AutoBranchCreationConfig(t *testing.T) { credentials := base64.StdEncoding.EncodeToString([]byte("username1:password1")) resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(t) }, ErrorCheck: acctest.ErrorCheck(t, amplify.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckAppDestroy(ctx), @@ -243,7 +243,7 @@ func testAccApp_BasicAuthCredentials(t *testing.T) { credentials2 := base64.StdEncoding.EncodeToString([]byte("username2:password2")) resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(t) }, ErrorCheck: acctest.ErrorCheck(t, amplify.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckAppDestroy(ctx), @@ -289,7 +289,7 @@ func testAccApp_BuildSpec(t *testing.T) { resourceName := "aws_amplify_app.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(t) }, ErrorCheck: acctest.ErrorCheck(t, amplify.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckAppDestroy(ctx), @@ -332,7 +332,7 @@ func testAccApp_CustomRules(t *testing.T) { resourceName := "aws_amplify_app.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(t) }, ErrorCheck: acctest.ErrorCheck(t, amplify.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckAppDestroy(ctx), @@ -383,7 +383,7 @@ func testAccApp_Description(t *testing.T) { resourceName := "aws_amplify_app.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(t) }, ErrorCheck: acctest.ErrorCheck(t, amplify.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckAppDestroy(ctx), @@ -427,7 +427,7 @@ func testAccApp_EnvironmentVariables(t *testing.T) { resourceName := "aws_amplify_app.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(t) }, ErrorCheck: acctest.ErrorCheck(t, amplify.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckAppDestroy(ctx), @@ -474,7 +474,7 @@ func testAccApp_IAMServiceRole(t *testing.T) { iamRole2ResourceName := "aws_iam_role.test2" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(t) }, ErrorCheck: acctest.ErrorCheck(t, amplify.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckAppDestroy(ctx), @@ -518,7 +518,7 @@ func testAccApp_Name(t *testing.T) { resourceName := "aws_amplify_app.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(t) }, ErrorCheck: acctest.ErrorCheck(t, amplify.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckAppDestroy(ctx), @@ -565,7 +565,7 @@ func testAccApp_Repository(t *testing.T) { resourceName := "aws_amplify_app.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(t) }, ErrorCheck: acctest.ErrorCheck(t, amplify.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckAppDestroy(ctx), diff --git a/internal/service/amplify/backend_environment_test.go b/internal/service/amplify/backend_environment_test.go index e8d2a6d4ec8a..a66d40155d59 100644 --- a/internal/service/amplify/backend_environment_test.go +++ b/internal/service/amplify/backend_environment_test.go @@ -25,7 +25,7 @@ func testAccBackendEnvironment_basic(t *testing.T) { environmentName := sdkacctest.RandStringFromCharSet(10, sdkacctest.CharSetAlpha) resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(t) }, ErrorCheck: acctest.ErrorCheck(t, amplify.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckBackendEnvironmentDestroy(ctx), @@ -58,7 +58,7 @@ func testAccBackendEnvironment_disappears(t *testing.T) { environmentName := sdkacctest.RandStringFromCharSet(10, sdkacctest.CharSetAlpha) resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(t) }, ErrorCheck: acctest.ErrorCheck(t, amplify.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckBackendEnvironmentDestroy(ctx), @@ -84,7 +84,7 @@ func testAccBackendEnvironment_DeploymentArtifacts_StackName(t *testing.T) { environmentName := sdkacctest.RandStringFromCharSet(10, sdkacctest.CharSetAlpha) resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(t) }, ErrorCheck: acctest.ErrorCheck(t, amplify.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckBackendEnvironmentDestroy(ctx), diff --git a/internal/service/amplify/branch_test.go b/internal/service/amplify/branch_test.go index c530ca857e7b..4c4a0dfcc7b4 100644 --- a/internal/service/amplify/branch_test.go +++ b/internal/service/amplify/branch_test.go @@ -24,7 +24,7 @@ func testAccBranch_basic(t *testing.T) { resourceName := "aws_amplify_branch.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(t) }, ErrorCheck: acctest.ErrorCheck(t, amplify.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckBranchDestroy(ctx), @@ -72,7 +72,7 @@ func testAccBranch_disappears(t *testing.T) { resourceName := "aws_amplify_branch.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(t) }, ErrorCheck: acctest.ErrorCheck(t, amplify.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckBranchDestroy(ctx), @@ -96,7 +96,7 @@ func testAccBranch_Tags(t *testing.T) { resourceName := "aws_amplify_branch.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(t) }, ErrorCheck: acctest.ErrorCheck(t, amplify.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckBranchDestroy(ctx), @@ -145,7 +145,7 @@ func testAccBranch_BasicAuthCredentials(t *testing.T) { credentials2 := base64.StdEncoding.EncodeToString([]byte("username2:password2")) resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(t) }, ErrorCheck: acctest.ErrorCheck(t, amplify.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckBranchDestroy(ctx), @@ -191,7 +191,7 @@ func testAccBranch_EnvironmentVariables(t *testing.T) { resourceName := "aws_amplify_branch.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(t) }, ErrorCheck: acctest.ErrorCheck(t, amplify.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckBranchDestroy(ctx), @@ -239,7 +239,7 @@ func testAccBranch_OptionalArguments(t *testing.T) { backendEnvironment2ResourceName := "aws_amplify_backend_environment.test2" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(t) }, ErrorCheck: acctest.ErrorCheck(t, amplify.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckBranchDestroy(ctx), diff --git a/internal/service/amplify/domain_association_test.go b/internal/service/amplify/domain_association_test.go index 13e0a1f40403..a5d6e5d53501 100644 --- a/internal/service/amplify/domain_association_test.go +++ b/internal/service/amplify/domain_association_test.go @@ -30,7 +30,7 @@ func testAccDomainAssociation_basic(t *testing.T) { resourceName := "aws_amplify_domain_association.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(t) }, ErrorCheck: acctest.ErrorCheck(t, amplify.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDomainAssociationDestroy(ctx), @@ -72,7 +72,7 @@ func testAccDomainAssociation_disappears(t *testing.T) { resourceName := "aws_amplify_domain_association.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(t) }, ErrorCheck: acctest.ErrorCheck(t, amplify.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDomainAssociationDestroy(ctx), @@ -102,7 +102,7 @@ func testAccDomainAssociation_update(t *testing.T) { resourceName := "aws_amplify_domain_association.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(t) }, ErrorCheck: acctest.ErrorCheck(t, amplify.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDomainAssociationDestroy(ctx), diff --git a/internal/service/amplify/webhook_test.go b/internal/service/amplify/webhook_test.go index 6087e5cef704..59818428b8ce 100644 --- a/internal/service/amplify/webhook_test.go +++ b/internal/service/amplify/webhook_test.go @@ -23,7 +23,7 @@ func testAccWebhook_basic(t *testing.T) { resourceName := "aws_amplify_webhook.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(t) }, ErrorCheck: acctest.ErrorCheck(t, amplify.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckWebhookDestroy(ctx), @@ -54,7 +54,7 @@ func testAccWebhook_disappears(t *testing.T) { resourceName := "aws_amplify_webhook.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(t) }, ErrorCheck: acctest.ErrorCheck(t, amplify.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckWebhookDestroy(ctx), @@ -78,7 +78,7 @@ func testAccWebhook_update(t *testing.T) { resourceName := "aws_amplify_webhook.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(t) }, ErrorCheck: acctest.ErrorCheck(t, amplify.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckWebhookDestroy(ctx), From 263aaf6ef0a718242d20450827ba59d21f217230 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Fri, 24 Feb 2023 16:36:30 -0500 Subject: [PATCH 085/763] Add 'Context' argument to 'acctest.PreCheck' for apigateway. --- internal/service/apigateway/account_test.go | 2 +- .../apigateway/api_key_data_source_test.go | 2 +- internal/service/apigateway/api_key_test.go | 12 ++-- .../service/apigateway/authorizer_test.go | 16 ++--- .../apigateway/base_path_mapping_test.go | 8 +-- .../apigateway/client_certificate_test.go | 6 +- .../service/apigateway/deployment_test.go | 18 +++--- .../apigateway/documentation_part_test.go | 8 +-- .../apigateway/documentation_version_test.go | 6 +- .../domain_name_data_source_test.go | 2 +- .../service/apigateway/domain_name_test.go | 18 +++--- .../apigateway/export_data_source_test.go | 2 +- .../apigateway/gateway_response_test.go | 4 +- .../apigateway/integration_response_test.go | 4 +- .../service/apigateway/integration_test.go | 12 ++-- .../apigateway/method_response_test.go | 4 +- .../apigateway/method_settings_test.go | 30 ++++----- internal/service/apigateway/method_test.go | 12 ++-- internal/service/apigateway/model_test.go | 4 +- .../apigateway/request_validator_test.go | 4 +- .../apigateway/resource_data_source_test.go | 2 +- 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 | 64 +++++++++---------- .../apigateway/sdk_data_source_test.go | 2 +- internal/service/apigateway/stage_test.go | 22 +++---- .../service/apigateway/usage_plan_key_test.go | 6 +- .../service/apigateway/usage_plan_test.go | 22 +++---- .../apigateway/vpc_link_data_source_test.go | 2 +- internal/service/apigateway/vpc_link_test.go | 6 +- 31 files changed, 158 insertions(+), 158 deletions(-) diff --git a/internal/service/apigateway/account_test.go b/internal/service/apigateway/account_test.go index b89648919a7a..2010ba0d3e77 100644 --- a/internal/service/apigateway/account_test.go +++ b/internal/service/apigateway/account_test.go @@ -26,7 +26,7 @@ func TestAccAPIGatewayAccount_basic(t *testing.T) { expectedRoleArn_second := regexp.MustCompile("role/" + secondName + "$") resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, apigateway.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckAccountDestroy, diff --git a/internal/service/apigateway/api_key_data_source_test.go b/internal/service/apigateway/api_key_data_source_test.go index fdd87c43cb93..d59bf917bff2 100644 --- a/internal/service/apigateway/api_key_data_source_test.go +++ b/internal/service/apigateway/api_key_data_source_test.go @@ -16,7 +16,7 @@ func TestAccAPIGatewayAPIKeyDataSource_basic(t *testing.T) { dataSourceName := "data.aws_api_gateway_api_key.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, apigateway.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ diff --git a/internal/service/apigateway/api_key_test.go b/internal/service/apigateway/api_key_test.go index 3b3d406f450e..26e67c7ff86c 100644 --- a/internal/service/apigateway/api_key_test.go +++ b/internal/service/apigateway/api_key_test.go @@ -24,7 +24,7 @@ func TestAccAPIGatewayAPIKey_basic(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, apigateway.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckAPIKeyDestroy(ctx), @@ -58,7 +58,7 @@ func TestAccAPIGatewayAPIKey_tags(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, apigateway.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckAPIKeyDestroy(ctx), @@ -104,7 +104,7 @@ func TestAccAPIGatewayAPIKey_description(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, apigateway.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckAPIKeyDestroy(ctx), @@ -140,7 +140,7 @@ func TestAccAPIGatewayAPIKey_enabled(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, apigateway.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckAPIKeyDestroy(ctx), @@ -176,7 +176,7 @@ func TestAccAPIGatewayAPIKey_value(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, apigateway.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckAPIKeyDestroy(ctx), @@ -204,7 +204,7 @@ func TestAccAPIGatewayAPIKey_disappears(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, apigateway.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckAPIKeyDestroy(ctx), diff --git a/internal/service/apigateway/authorizer_test.go b/internal/service/apigateway/authorizer_test.go index 3430a06f2dca..6e5d83a077b0 100644 --- a/internal/service/apigateway/authorizer_test.go +++ b/internal/service/apigateway/authorizer_test.go @@ -26,7 +26,7 @@ func TestAccAPIGatewayAuthorizer_basic(t *testing.T) { roleResourceName := "aws_iam_role.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckAPIGatewayTypeEDGE(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckAPIGatewayTypeEDGE(t) }, ErrorCheck: acctest.ErrorCheck(t, apigateway.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckAuthorizerDestroy(ctx), @@ -74,7 +74,7 @@ func TestAccAPIGatewayAuthorizer_cognito(t *testing.T) { resourceName := "aws_api_gateway_authorizer.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckAPIGatewayTypeEDGE(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckAPIGatewayTypeEDGE(t) }, ErrorCheck: acctest.ErrorCheck(t, apigateway.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckAuthorizerDestroy(ctx), @@ -113,7 +113,7 @@ func TestAccAPIGatewayAuthorizer_Cognito_authorizerCredentials(t *testing.T) { iamRoleResourceName := "aws_iam_role.lambda" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckAPIGatewayTypeEDGE(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckAPIGatewayTypeEDGE(t) }, ErrorCheck: acctest.ErrorCheck(t, apigateway.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckAuthorizerDestroy(ctx), @@ -145,7 +145,7 @@ func TestAccAPIGatewayAuthorizer_switchAuthType(t *testing.T) { roleResourceName := "aws_iam_role.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckAPIGatewayTypeEDGE(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckAPIGatewayTypeEDGE(t) }, ErrorCheck: acctest.ErrorCheck(t, apigateway.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckAuthorizerDestroy(ctx), @@ -193,7 +193,7 @@ func TestAccAPIGatewayAuthorizer_switchAuthorizerTTL(t *testing.T) { resourceName := "aws_api_gateway_authorizer.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckAPIGatewayTypeEDGE(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckAPIGatewayTypeEDGE(t) }, ErrorCheck: acctest.ErrorCheck(t, apigateway.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckAuthorizerDestroy(ctx), @@ -241,7 +241,7 @@ func TestAccAPIGatewayAuthorizer_authTypeValidation(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckAPIGatewayTypeEDGE(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckAPIGatewayTypeEDGE(t) }, ErrorCheck: acctest.ErrorCheck(t, apigateway.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckAuthorizerDestroy(ctx), @@ -269,7 +269,7 @@ func TestAccAPIGatewayAuthorizer_Zero_ttl(t *testing.T) { resourceName := "aws_api_gateway_authorizer.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckAPIGatewayTypeEDGE(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckAPIGatewayTypeEDGE(t) }, ErrorCheck: acctest.ErrorCheck(t, apigateway.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckAuthorizerDestroy(ctx), @@ -298,7 +298,7 @@ func TestAccAPIGatewayAuthorizer_disappears(t *testing.T) { resourceName := "aws_api_gateway_authorizer.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckAPIGatewayTypeEDGE(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckAPIGatewayTypeEDGE(t) }, ErrorCheck: acctest.ErrorCheck(t, apigateway.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckAuthorizerDestroy(ctx), diff --git a/internal/service/apigateway/base_path_mapping_test.go b/internal/service/apigateway/base_path_mapping_test.go index cfb130a8caf2..7d5235b68cb5 100644 --- a/internal/service/apigateway/base_path_mapping_test.go +++ b/internal/service/apigateway/base_path_mapping_test.go @@ -79,7 +79,7 @@ func TestAccAPIGatewayBasePathMapping_basic(t *testing.T) { certificate := acctest.TLSRSAX509SelfSignedCertificatePEM(t, key, name) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, apigateway.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckBasePathDestroy(ctx), @@ -110,7 +110,7 @@ func TestAccAPIGatewayBasePathMapping_BasePath_empty(t *testing.T) { certificate := acctest.TLSRSAX509SelfSignedCertificatePEM(t, key, name) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, apigateway.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckBasePathDestroy(ctx), @@ -140,7 +140,7 @@ func TestAccAPIGatewayBasePathMapping_updates(t *testing.T) { certificate := acctest.TLSRSAX509SelfSignedCertificatePEM(t, key, name) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, apigateway.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckBasePathDestroy(ctx), @@ -192,7 +192,7 @@ func TestAccAPIGatewayBasePathMapping_disappears(t *testing.T) { certificate := acctest.TLSRSAX509SelfSignedCertificatePEM(t, key, name) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, apigateway.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckBasePathDestroy(ctx), diff --git a/internal/service/apigateway/client_certificate_test.go b/internal/service/apigateway/client_certificate_test.go index c2f502d6f756..b079759f4c2e 100644 --- a/internal/service/apigateway/client_certificate_test.go +++ b/internal/service/apigateway/client_certificate_test.go @@ -21,7 +21,7 @@ func TestAccAPIGatewayClientCertificate_basic(t *testing.T) { resourceName := "aws_api_gateway_client_certificate.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, apigateway.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClientCertificateDestroy(ctx), @@ -57,7 +57,7 @@ func TestAccAPIGatewayClientCertificate_tags(t *testing.T) { resourceName := "aws_api_gateway_client_certificate.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, apigateway.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClientCertificateDestroy(ctx), @@ -102,7 +102,7 @@ func TestAccAPIGatewayClientCertificate_disappears(t *testing.T) { resourceName := "aws_api_gateway_client_certificate.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, apigateway.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClientCertificateDestroy(ctx), diff --git a/internal/service/apigateway/deployment_test.go b/internal/service/apigateway/deployment_test.go index 356116d2e5f5..ec9aa38f1662 100644 --- a/internal/service/apigateway/deployment_test.go +++ b/internal/service/apigateway/deployment_test.go @@ -24,7 +24,7 @@ func TestAccAPIGatewayDeployment_basic(t *testing.T) { restApiResourceName := "aws_api_gateway_rest_api.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckAPIGatewayTypeEDGE(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckAPIGatewayTypeEDGE(t) }, ErrorCheck: acctest.ErrorCheck(t, apigateway.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDeploymentDestroy(ctx), @@ -62,7 +62,7 @@ func TestAccAPIGatewayDeployment_Disappears_restAPI(t *testing.T) { rName := sdkacctest.RandomWithPrefix("tf-acc-test-deployment") resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckAPIGatewayTypeEDGE(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckAPIGatewayTypeEDGE(t) }, ErrorCheck: acctest.ErrorCheck(t, apigateway.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDeploymentDestroy(ctx), @@ -87,7 +87,7 @@ func TestAccAPIGatewayDeployment_triggers(t *testing.T) { resourceName := "aws_api_gateway_deployment.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckAPIGatewayTypeEDGE(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckAPIGatewayTypeEDGE(t) }, ErrorCheck: acctest.ErrorCheck(t, apigateway.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDeploymentDestroy(ctx), @@ -144,7 +144,7 @@ func TestAccAPIGatewayDeployment_description(t *testing.T) { resourceName := "aws_api_gateway_deployment.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckAPIGatewayTypeEDGE(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckAPIGatewayTypeEDGE(t) }, ErrorCheck: acctest.ErrorCheck(t, apigateway.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDeploymentDestroy(ctx), @@ -174,7 +174,7 @@ func TestAccAPIGatewayDeployment_stageDescription(t *testing.T) { resourceName := "aws_api_gateway_deployment.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckAPIGatewayTypeEDGE(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckAPIGatewayTypeEDGE(t) }, ErrorCheck: acctest.ErrorCheck(t, apigateway.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDeploymentDestroy(ctx), @@ -199,7 +199,7 @@ func TestAccAPIGatewayDeployment_stageName(t *testing.T) { rName := sdkacctest.RandomWithPrefix("tf-acc-test-deployment") resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckAPIGatewayTypeEDGE(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckAPIGatewayTypeEDGE(t) }, ErrorCheck: acctest.ErrorCheck(t, apigateway.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDeploymentDestroy(ctx), @@ -232,7 +232,7 @@ func TestAccAPIGatewayDeployment_StageName_emptyString(t *testing.T) { resourceName := "aws_api_gateway_deployment.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckAPIGatewayTypeEDGE(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckAPIGatewayTypeEDGE(t) }, ErrorCheck: acctest.ErrorCheck(t, apigateway.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDeploymentDestroy(ctx), @@ -254,7 +254,7 @@ func TestAccAPIGatewayDeployment_variables(t *testing.T) { resourceName := "aws_api_gateway_deployment.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckAPIGatewayTypeEDGE(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckAPIGatewayTypeEDGE(t) }, ErrorCheck: acctest.ErrorCheck(t, apigateway.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDeploymentDestroy(ctx), @@ -279,7 +279,7 @@ func TestAccAPIGatewayDeployment_conflictingConnectionType(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckAPIGatewayTypeEDGE(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckAPIGatewayTypeEDGE(t) }, ErrorCheck: acctest.ErrorCheck(t, apigateway.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDeploymentDestroy(ctx), diff --git a/internal/service/apigateway/documentation_part_test.go b/internal/service/apigateway/documentation_part_test.go index 57537a1ae60e..7cee8f3aa618 100644 --- a/internal/service/apigateway/documentation_part_test.go +++ b/internal/service/apigateway/documentation_part_test.go @@ -29,7 +29,7 @@ func TestAccAPIGatewayDocumentationPart_basic(t *testing.T) { resourceName := "aws_api_gateway_documentation_part.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckAPIGatewayTypeEDGE(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckAPIGatewayTypeEDGE(t) }, ErrorCheck: acctest.ErrorCheck(t, apigateway.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDocumentationPartDestroy(ctx), @@ -75,7 +75,7 @@ func TestAccAPIGatewayDocumentationPart_method(t *testing.T) { resourceName := "aws_api_gateway_documentation_part.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckAPIGatewayTypeEDGE(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckAPIGatewayTypeEDGE(t) }, ErrorCheck: acctest.ErrorCheck(t, apigateway.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDocumentationPartDestroy(ctx), @@ -125,7 +125,7 @@ func TestAccAPIGatewayDocumentationPart_responseHeader(t *testing.T) { resourceName := "aws_api_gateway_documentation_part.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckAPIGatewayTypeEDGE(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckAPIGatewayTypeEDGE(t) }, ErrorCheck: acctest.ErrorCheck(t, apigateway.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDocumentationPartDestroy(ctx), @@ -178,7 +178,7 @@ func TestAccAPIGatewayDocumentationPart_disappears(t *testing.T) { resourceName := "aws_api_gateway_documentation_part.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckAPIGatewayTypeEDGE(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckAPIGatewayTypeEDGE(t) }, ErrorCheck: acctest.ErrorCheck(t, apigateway.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDocumentationPartDestroy(ctx), diff --git a/internal/service/apigateway/documentation_version_test.go b/internal/service/apigateway/documentation_version_test.go index 2b4fd725f757..4a642f4fbff0 100644 --- a/internal/service/apigateway/documentation_version_test.go +++ b/internal/service/apigateway/documentation_version_test.go @@ -27,7 +27,7 @@ func TestAccAPIGatewayDocumentationVersion_basic(t *testing.T) { resourceName := "aws_api_gateway_documentation_version.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckAPIGatewayTypeEDGE(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckAPIGatewayTypeEDGE(t) }, ErrorCheck: acctest.ErrorCheck(t, apigateway.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDocumentationVersionDestroy(ctx), @@ -63,7 +63,7 @@ func TestAccAPIGatewayDocumentationVersion_allFields(t *testing.T) { resourceName := "aws_api_gateway_documentation_version.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckAPIGatewayTypeEDGE(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckAPIGatewayTypeEDGE(t) }, ErrorCheck: acctest.ErrorCheck(t, apigateway.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDocumentationVersionDestroy(ctx), @@ -106,7 +106,7 @@ func TestAccAPIGatewayDocumentationVersion_disappears(t *testing.T) { resourceName := "aws_api_gateway_documentation_version.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckAPIGatewayTypeEDGE(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckAPIGatewayTypeEDGE(t) }, ErrorCheck: acctest.ErrorCheck(t, apigateway.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDocumentationVersionDestroy(ctx), diff --git a/internal/service/apigateway/domain_name_data_source_test.go b/internal/service/apigateway/domain_name_data_source_test.go index c090086843e6..7a26e8d8770f 100644 --- a/internal/service/apigateway/domain_name_data_source_test.go +++ b/internal/service/apigateway/domain_name_data_source_test.go @@ -19,7 +19,7 @@ func TestAccAPIGatewayDomainNameDataSource_basic(t *testing.T) { certificate := acctest.TLSRSAX509SelfSignedCertificatePEM(t, key, rName) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, apigateway.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDomainNameDestroy(ctx), diff --git a/internal/service/apigateway/domain_name_test.go b/internal/service/apigateway/domain_name_test.go index a2a4270689fc..a85bbda49ac7 100644 --- a/internal/service/apigateway/domain_name_test.go +++ b/internal/service/apigateway/domain_name_test.go @@ -28,7 +28,7 @@ func TestAccAPIGatewayDomainName_certificateARN(t *testing.T) { resourceName := "aws_api_gateway_domain_name.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckEdgeDomainName(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckEdgeDomainName(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, apigateway.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckEdgeDomainNameDestroy(ctx), @@ -91,7 +91,7 @@ func TestAccAPIGatewayDomainName_certificateName(t *testing.T) { resourceName := "aws_api_gateway_domain_name.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, apigateway.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDomainNameDestroy(ctx), @@ -128,7 +128,7 @@ func TestAccAPIGatewayDomainName_regionalCertificateARN(t *testing.T) { certificate := acctest.TLSRSAX509SelfSignedCertificatePEM(t, key, rName) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, apigateway.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDomainNameDestroy(ctx), @@ -176,7 +176,7 @@ func TestAccAPIGatewayDomainName_regionalCertificateName(t *testing.T) { certificate := acctest.TLSRSAX509LocallySignedCertificatePEM(t, caKey, caCertificate, key, domainWildcard) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, apigateway.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDomainNameDestroy(ctx), @@ -210,7 +210,7 @@ func TestAccAPIGatewayDomainName_securityPolicy(t *testing.T) { certificate := acctest.TLSRSAX509SelfSignedCertificatePEM(t, key, rName) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, apigateway.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDomainNameDestroy(ctx), @@ -241,7 +241,7 @@ func TestAccAPIGatewayDomainName_tags(t *testing.T) { certificate := acctest.TLSRSAX509SelfSignedCertificatePEM(t, key, rName) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, apigateway.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDomainNameDestroy(ctx), @@ -290,7 +290,7 @@ func TestAccAPIGatewayDomainName_disappears(t *testing.T) { certificate := acctest.TLSRSAX509SelfSignedCertificatePEM(t, key, rName) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, apigateway.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDomainNameDestroy(ctx), @@ -319,7 +319,7 @@ func TestAccAPIGatewayDomainName_MutualTLSAuthentication_basic(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, apigateway.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDomainNameDestroy(ctx), @@ -367,7 +367,7 @@ func TestAccAPIGatewayDomainName_MutualTLSAuthentication_ownership(t *testing.T) rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, apigateway.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDomainNameDestroy(ctx), diff --git a/internal/service/apigateway/export_data_source_test.go b/internal/service/apigateway/export_data_source_test.go index f5ecb91d53e2..b99e386534ec 100644 --- a/internal/service/apigateway/export_data_source_test.go +++ b/internal/service/apigateway/export_data_source_test.go @@ -14,7 +14,7 @@ func TestAccAPIGatewayExportDataSource_basic(t *testing.T) { dataSourceName := "data.aws_api_gateway_export.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, apigateway.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ diff --git a/internal/service/apigateway/gateway_response_test.go b/internal/service/apigateway/gateway_response_test.go index d01f8de8fff5..e360381f7003 100644 --- a/internal/service/apigateway/gateway_response_test.go +++ b/internal/service/apigateway/gateway_response_test.go @@ -22,7 +22,7 @@ func TestAccAPIGatewayGatewayResponse_basic(t *testing.T) { resourceName := "aws_api_gateway_gateway_response.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckAPIGatewayTypeEDGE(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckAPIGatewayTypeEDGE(t) }, ErrorCheck: acctest.ErrorCheck(t, apigateway.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckGatewayResponseDestroy(ctx), @@ -64,7 +64,7 @@ func TestAccAPIGatewayGatewayResponse_disappears(t *testing.T) { resourceName := "aws_api_gateway_gateway_response.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckAPIGatewayTypeEDGE(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckAPIGatewayTypeEDGE(t) }, ErrorCheck: acctest.ErrorCheck(t, apigateway.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckGatewayResponseDestroy(ctx), diff --git a/internal/service/apigateway/integration_response_test.go b/internal/service/apigateway/integration_response_test.go index e6540c90d577..65b48aa15188 100644 --- a/internal/service/apigateway/integration_response_test.go +++ b/internal/service/apigateway/integration_response_test.go @@ -22,7 +22,7 @@ func TestAccAPIGatewayIntegrationResponse_basic(t *testing.T) { resourceName := "aws_api_gateway_integration_response.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckAPIGatewayTypeEDGE(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckAPIGatewayTypeEDGE(t) }, ErrorCheck: acctest.ErrorCheck(t, apigateway.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckIntegrationResponseDestroy(ctx), @@ -71,7 +71,7 @@ func TestAccAPIGatewayIntegrationResponse_disappears(t *testing.T) { resourceName := "aws_api_gateway_integration_response.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckAPIGatewayTypeEDGE(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckAPIGatewayTypeEDGE(t) }, ErrorCheck: acctest.ErrorCheck(t, apigateway.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckIntegrationResponseDestroy(ctx), diff --git a/internal/service/apigateway/integration_test.go b/internal/service/apigateway/integration_test.go index f5490430875e..5c72af28e1cb 100644 --- a/internal/service/apigateway/integration_test.go +++ b/internal/service/apigateway/integration_test.go @@ -23,7 +23,7 @@ func TestAccAPIGatewayIntegration_basic(t *testing.T) { resourceName := "aws_api_gateway_integration.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckAPIGatewayTypeEDGE(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckAPIGatewayTypeEDGE(t) }, ErrorCheck: acctest.ErrorCheck(t, apigateway.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckIntegrationDestroy(ctx), @@ -136,7 +136,7 @@ func TestAccAPIGatewayIntegration_contentHandling(t *testing.T) { resourceName := "aws_api_gateway_integration.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckAPIGatewayTypeEDGE(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckAPIGatewayTypeEDGE(t) }, ErrorCheck: acctest.ErrorCheck(t, apigateway.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckIntegrationDestroy(ctx), @@ -213,7 +213,7 @@ func TestAccAPIGatewayIntegration_CacheKey_parameters(t *testing.T) { resourceName := "aws_api_gateway_integration.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckAPIGatewayTypeEDGE(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckAPIGatewayTypeEDGE(t) }, ErrorCheck: acctest.ErrorCheck(t, apigateway.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckIntegrationDestroy(ctx), @@ -257,7 +257,7 @@ func TestAccAPIGatewayIntegration_integrationType(t *testing.T) { resourceName := "aws_api_gateway_integration.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckAPIGatewayTypeEDGE(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckAPIGatewayTypeEDGE(t) }, ErrorCheck: acctest.ErrorCheck(t, apigateway.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckIntegrationDestroy(ctx), @@ -303,7 +303,7 @@ func TestAccAPIGatewayIntegration_TLS_insecureSkipVerification(t *testing.T) { resourceName := "aws_api_gateway_integration.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckAPIGatewayTypeEDGE(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckAPIGatewayTypeEDGE(t) }, ErrorCheck: acctest.ErrorCheck(t, apigateway.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckIntegrationDestroy(ctx), @@ -341,7 +341,7 @@ func TestAccAPIGatewayIntegration_disappears(t *testing.T) { resourceName := "aws_api_gateway_integration.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckAPIGatewayTypeEDGE(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckAPIGatewayTypeEDGE(t) }, ErrorCheck: acctest.ErrorCheck(t, apigateway.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckIntegrationDestroy(ctx), diff --git a/internal/service/apigateway/method_response_test.go b/internal/service/apigateway/method_response_test.go index 836ffefe4978..665ab1b08a29 100644 --- a/internal/service/apigateway/method_response_test.go +++ b/internal/service/apigateway/method_response_test.go @@ -22,7 +22,7 @@ func TestAccAPIGatewayMethodResponse_basic(t *testing.T) { resourceName := "aws_api_gateway_method_response.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckAPIGatewayTypeEDGE(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckAPIGatewayTypeEDGE(t) }, ErrorCheck: acctest.ErrorCheck(t, apigateway.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckMethodResponseDestroy(ctx), @@ -68,7 +68,7 @@ func TestAccAPIGatewayMethodResponse_disappears(t *testing.T) { resourceName := "aws_api_gateway_method_response.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckAPIGatewayTypeEDGE(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckAPIGatewayTypeEDGE(t) }, ErrorCheck: acctest.ErrorCheck(t, apigateway.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckMethodResponseDestroy(ctx), diff --git a/internal/service/apigateway/method_settings_test.go b/internal/service/apigateway/method_settings_test.go index f5ecd9324d79..b537ae3909b9 100644 --- a/internal/service/apigateway/method_settings_test.go +++ b/internal/service/apigateway/method_settings_test.go @@ -23,7 +23,7 @@ func TestAccAPIGatewayMethodSettings_basic(t *testing.T) { resourceName := "aws_api_gateway_method_settings.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckAPIGatewayTypeEDGE(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckAPIGatewayTypeEDGE(t) }, ErrorCheck: acctest.ErrorCheck(t, apigateway.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckMethodSettingsDestroy(ctx), @@ -53,7 +53,7 @@ func TestAccAPIGatewayMethodSettings_Settings_cacheDataEncrypted(t *testing.T) { resourceName := "aws_api_gateway_method_settings.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckAPIGatewayTypeEDGE(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckAPIGatewayTypeEDGE(t) }, ErrorCheck: acctest.ErrorCheck(t, apigateway.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckMethodSettingsDestroy(ctx), @@ -91,7 +91,7 @@ func TestAccAPIGatewayMethodSettings_Settings_cacheTTLInSeconds(t *testing.T) { resourceName := "aws_api_gateway_method_settings.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckAPIGatewayTypeEDGE(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckAPIGatewayTypeEDGE(t) }, ErrorCheck: acctest.ErrorCheck(t, apigateway.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckMethodSettingsDestroy(ctx), @@ -137,7 +137,7 @@ func TestAccAPIGatewayMethodSettings_Settings_cachingEnabled(t *testing.T) { resourceName := "aws_api_gateway_method_settings.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckAPIGatewayTypeEDGE(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckAPIGatewayTypeEDGE(t) }, ErrorCheck: acctest.ErrorCheck(t, apigateway.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckMethodSettingsDestroy(ctx), @@ -175,7 +175,7 @@ func TestAccAPIGatewayMethodSettings_Settings_dataTraceEnabled(t *testing.T) { resourceName := "aws_api_gateway_method_settings.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckAPIGatewayTypeEDGE(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckAPIGatewayTypeEDGE(t) }, ErrorCheck: acctest.ErrorCheck(t, apigateway.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckMethodSettingsDestroy(ctx), @@ -213,7 +213,7 @@ func TestAccAPIGatewayMethodSettings_Settings_loggingLevel(t *testing.T) { resourceName := "aws_api_gateway_method_settings.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckAPIGatewayTypeEDGE(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckAPIGatewayTypeEDGE(t) }, ErrorCheck: acctest.ErrorCheck(t, apigateway.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckMethodSettingsDestroy(ctx), @@ -253,7 +253,7 @@ func TestAccAPIGatewayMethodSettings_Settings_metricsEnabled(t *testing.T) { resourceName := "aws_api_gateway_method_settings.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckAPIGatewayTypeEDGE(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckAPIGatewayTypeEDGE(t) }, ErrorCheck: acctest.ErrorCheck(t, apigateway.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckMethodSettingsDestroy(ctx), @@ -293,7 +293,7 @@ func TestAccAPIGatewayMethodSettings_Settings_multiple(t *testing.T) { resourceName := "aws_api_gateway_method_settings.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckAPIGatewayTypeEDGE(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckAPIGatewayTypeEDGE(t) }, ErrorCheck: acctest.ErrorCheck(t, apigateway.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckMethodSettingsDestroy(ctx), @@ -337,7 +337,7 @@ func TestAccAPIGatewayMethodSettings_Settings_requireAuthorizationForCacheContro resourceName := "aws_api_gateway_method_settings.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckAPIGatewayTypeEDGE(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckAPIGatewayTypeEDGE(t) }, ErrorCheck: acctest.ErrorCheck(t, apigateway.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckMethodSettingsDestroy(ctx), @@ -375,7 +375,7 @@ func TestAccAPIGatewayMethodSettings_Settings_throttlingBurstLimit(t *testing.T) resourceName := "aws_api_gateway_method_settings.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckAPIGatewayTypeEDGE(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckAPIGatewayTypeEDGE(t) }, ErrorCheck: acctest.ErrorCheck(t, apigateway.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckMethodSettingsDestroy(ctx), @@ -414,7 +414,7 @@ func TestAccAPIGatewayMethodSettings_Settings_throttlingBurstLimitDisabledByDefa resourceName := "aws_api_gateway_method_settings.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckAPIGatewayTypeEDGE(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckAPIGatewayTypeEDGE(t) }, ErrorCheck: acctest.ErrorCheck(t, apigateway.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckMethodSettingsDestroy(ctx), @@ -452,7 +452,7 @@ func TestAccAPIGatewayMethodSettings_Settings_throttlingRateLimit(t *testing.T) resourceName := "aws_api_gateway_method_settings.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckAPIGatewayTypeEDGE(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckAPIGatewayTypeEDGE(t) }, ErrorCheck: acctest.ErrorCheck(t, apigateway.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckMethodSettingsDestroy(ctx), @@ -491,7 +491,7 @@ func TestAccAPIGatewayMethodSettings_Settings_throttlingRateLimitDisabledByDefau resourceName := "aws_api_gateway_method_settings.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckAPIGatewayTypeEDGE(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckAPIGatewayTypeEDGE(t) }, ErrorCheck: acctest.ErrorCheck(t, apigateway.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckMethodSettingsDestroy(ctx), @@ -529,7 +529,7 @@ func TestAccAPIGatewayMethodSettings_Settings_unauthorizedCacheControlHeaderStra resourceName := "aws_api_gateway_method_settings.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckAPIGatewayTypeEDGE(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckAPIGatewayTypeEDGE(t) }, ErrorCheck: acctest.ErrorCheck(t, apigateway.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckMethodSettingsDestroy(ctx), @@ -600,7 +600,7 @@ func TestAccAPIGatewayMethodSettings_disappears(t *testing.T) { resourceName := "aws_api_gateway_method_settings.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckAPIGatewayTypeEDGE(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckAPIGatewayTypeEDGE(t) }, ErrorCheck: acctest.ErrorCheck(t, apigateway.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckMethodSettingsDestroy(ctx), diff --git a/internal/service/apigateway/method_test.go b/internal/service/apigateway/method_test.go index 8fba5aad4aaa..c8229366efff 100644 --- a/internal/service/apigateway/method_test.go +++ b/internal/service/apigateway/method_test.go @@ -22,7 +22,7 @@ func TestAccAPIGatewayMethod_basic(t *testing.T) { resourceName := "aws_api_gateway_method.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckAPIGatewayTypeEDGE(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckAPIGatewayTypeEDGE(t) }, ErrorCheck: acctest.ErrorCheck(t, apigateway.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckMethodDestroy(ctx), @@ -69,7 +69,7 @@ func TestAccAPIGatewayMethod_customAuthorizer(t *testing.T) { resourceName := "aws_api_gateway_method.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckAPIGatewayTypeEDGE(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckAPIGatewayTypeEDGE(t) }, ErrorCheck: acctest.ErrorCheck(t, apigateway.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckMethodDestroy(ctx), @@ -108,7 +108,7 @@ func TestAccAPIGatewayMethod_cognitoAuthorizer(t *testing.T) { resourceName := "aws_api_gateway_method.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckAPIGatewayTypeEDGE(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckAPIGatewayTypeEDGE(t) }, ErrorCheck: acctest.ErrorCheck(t, apigateway.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckMethodDestroy(ctx), @@ -149,7 +149,7 @@ func TestAccAPIGatewayMethod_customRequestValidator(t *testing.T) { resourceName := "aws_api_gateway_method.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckAPIGatewayTypeEDGE(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckAPIGatewayTypeEDGE(t) }, ErrorCheck: acctest.ErrorCheck(t, apigateway.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckMethodDestroy(ctx), @@ -186,7 +186,7 @@ func TestAccAPIGatewayMethod_disappears(t *testing.T) { resourceName := "aws_api_gateway_method.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckAPIGatewayTypeEDGE(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckAPIGatewayTypeEDGE(t) }, ErrorCheck: acctest.ErrorCheck(t, apigateway.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckMethodDestroy(ctx), @@ -210,7 +210,7 @@ func TestAccAPIGatewayMethod_operationName(t *testing.T) { resourceName := "aws_api_gateway_method.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckAPIGatewayTypeEDGE(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckAPIGatewayTypeEDGE(t) }, ErrorCheck: acctest.ErrorCheck(t, apigateway.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckMethodDestroy(ctx), diff --git a/internal/service/apigateway/model_test.go b/internal/service/apigateway/model_test.go index 79b9a07bc954..74d39fb03c19 100644 --- a/internal/service/apigateway/model_test.go +++ b/internal/service/apigateway/model_test.go @@ -23,7 +23,7 @@ func TestAccAPIGatewayModel_basic(t *testing.T) { resourceName := "aws_api_gateway_model.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckAPIGatewayTypeEDGE(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckAPIGatewayTypeEDGE(t) }, ErrorCheck: acctest.ErrorCheck(t, apigateway.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckModelDestroy(ctx), @@ -55,7 +55,7 @@ func TestAccAPIGatewayModel_disappears(t *testing.T) { resourceName := "aws_api_gateway_model.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckAPIGatewayTypeEDGE(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckAPIGatewayTypeEDGE(t) }, ErrorCheck: acctest.ErrorCheck(t, apigateway.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckModelDestroy(ctx), diff --git a/internal/service/apigateway/request_validator_test.go b/internal/service/apigateway/request_validator_test.go index 9b5fe77270f9..1a64f06f3f80 100644 --- a/internal/service/apigateway/request_validator_test.go +++ b/internal/service/apigateway/request_validator_test.go @@ -22,7 +22,7 @@ func TestAccAPIGatewayRequestValidator_basic(t *testing.T) { resourceName := "aws_api_gateway_request_validator.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckAPIGatewayTypeEDGE(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckAPIGatewayTypeEDGE(t) }, ErrorCheck: acctest.ErrorCheck(t, apigateway.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRequestValidatorDestroy(ctx), @@ -62,7 +62,7 @@ func TestAccAPIGatewayRequestValidator_disappears(t *testing.T) { resourceName := "aws_api_gateway_request_validator.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckAPIGatewayTypeEDGE(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckAPIGatewayTypeEDGE(t) }, ErrorCheck: acctest.ErrorCheck(t, apigateway.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRequestValidatorDestroy(ctx), diff --git a/internal/service/apigateway/resource_data_source_test.go b/internal/service/apigateway/resource_data_source_test.go index 93545fecaeb4..2b6a7cf26720 100644 --- a/internal/service/apigateway/resource_data_source_test.go +++ b/internal/service/apigateway/resource_data_source_test.go @@ -18,7 +18,7 @@ func TestAccAPIGatewayResourceDataSource_basic(t *testing.T) { dataSourceName2 := "data.aws_api_gateway_resource.example_v1_endpoint" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckAPIGatewayTypeEDGE(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckAPIGatewayTypeEDGE(t) }, ErrorCheck: acctest.ErrorCheck(t, apigateway.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ diff --git a/internal/service/apigateway/resource_test.go b/internal/service/apigateway/resource_test.go index a329a9df8fb8..d85460fc7535 100644 --- a/internal/service/apigateway/resource_test.go +++ b/internal/service/apigateway/resource_test.go @@ -22,7 +22,7 @@ func TestAccAPIGatewayResource_basic(t *testing.T) { resourceName := "aws_api_gateway_resource.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckAPIGatewayTypeEDGE(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckAPIGatewayTypeEDGE(t) }, ErrorCheck: acctest.ErrorCheck(t, apigateway.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckResourceDestroy(ctx), @@ -52,7 +52,7 @@ func TestAccAPIGatewayResource_update(t *testing.T) { resourceName := "aws_api_gateway_resource.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckAPIGatewayTypeEDGE(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckAPIGatewayTypeEDGE(t) }, ErrorCheck: acctest.ErrorCheck(t, apigateway.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckResourceDestroy(ctx), @@ -90,7 +90,7 @@ func TestAccAPIGatewayResource_disappears(t *testing.T) { resourceName := "aws_api_gateway_resource.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckAPIGatewayTypeEDGE(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckAPIGatewayTypeEDGE(t) }, ErrorCheck: acctest.ErrorCheck(t, apigateway.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckResourceDestroy(ctx), diff --git a/internal/service/apigateway/rest_api_data_source_test.go b/internal/service/apigateway/rest_api_data_source_test.go index ed8fc6be1956..8107267c6bfc 100644 --- a/internal/service/apigateway/rest_api_data_source_test.go +++ b/internal/service/apigateway/rest_api_data_source_test.go @@ -14,7 +14,7 @@ func TestAccAPIGatewayRestAPIDataSource_basic(t *testing.T) { dataSourceName := "data.aws_api_gateway_rest_api.test" resourceName := "aws_api_gateway_rest_api.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckAPIGatewayTypeEDGE(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckAPIGatewayTypeEDGE(t) }, ErrorCheck: acctest.ErrorCheck(t, apigateway.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ @@ -46,7 +46,7 @@ func TestAccAPIGatewayRestAPIDataSource_Endpoint_vpcEndpointIDs(t *testing.T) { dataSourceName := "data.aws_api_gateway_rest_api.test" resourceName := "aws_api_gateway_rest_api.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, apigateway.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ diff --git a/internal/service/apigateway/rest_api_policy_test.go b/internal/service/apigateway/rest_api_policy_test.go index e4e86ba1ae5b..7494576aa742 100644 --- a/internal/service/apigateway/rest_api_policy_test.go +++ b/internal/service/apigateway/rest_api_policy_test.go @@ -25,7 +25,7 @@ func TestAccAPIGatewayRestAPIPolicy_basic(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckAPIGatewayTypeEDGE(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckAPIGatewayTypeEDGE(t) }, ErrorCheck: acctest.ErrorCheck(t, apigateway.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRestAPIPolicyDestroy(ctx), @@ -60,7 +60,7 @@ func TestAccAPIGatewayRestAPIPolicy_disappears(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckAPIGatewayTypeEDGE(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckAPIGatewayTypeEDGE(t) }, ErrorCheck: acctest.ErrorCheck(t, apigateway.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRestAPIPolicyDestroy(ctx), @@ -84,7 +84,7 @@ func TestAccAPIGatewayRestAPIPolicy_Disappears_restAPI(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckAPIGatewayTypeEDGE(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckAPIGatewayTypeEDGE(t) }, ErrorCheck: acctest.ErrorCheck(t, apigateway.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRestAPIPolicyDestroy(ctx), diff --git a/internal/service/apigateway/rest_api_test.go b/internal/service/apigateway/rest_api_test.go index 61024d237926..93fb4d6bc00b 100644 --- a/internal/service/apigateway/rest_api_test.go +++ b/internal/service/apigateway/rest_api_test.go @@ -24,7 +24,7 @@ func TestAccAPIGatewayRestAPI_basic(t *testing.T) { resourceName := "aws_api_gateway_rest_api.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckAPIGatewayTypeEDGE(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckAPIGatewayTypeEDGE(t) }, ErrorCheck: acctest.ErrorCheck(t, apigateway.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRestAPIDestroy(ctx), @@ -66,7 +66,7 @@ func TestAccAPIGatewayRestAPI_tags(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckAPIGatewayTypeEDGE(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckAPIGatewayTypeEDGE(t) }, ErrorCheck: acctest.ErrorCheck(t, apigateway.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRestAPIDestroy(ctx), @@ -118,7 +118,7 @@ func TestAccAPIGatewayRestAPI_disappears(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckAPIGatewayTypeEDGE(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckAPIGatewayTypeEDGE(t) }, ErrorCheck: acctest.ErrorCheck(t, apigateway.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRestAPIDestroy(ctx), @@ -142,7 +142,7 @@ func TestAccAPIGatewayRestAPI_endpoint(t *testing.T) { resourceName := "aws_api_gateway_rest_api.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, apigateway.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRestAPIDestroy(ctx), @@ -220,7 +220,7 @@ func TestAccAPIGatewayRestAPI_Endpoint_private(t *testing.T) { resourceName := "aws_api_gateway_rest_api.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, apigateway.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRestAPIDestroy(ctx), @@ -275,7 +275,7 @@ func TestAccAPIGatewayRestAPI_apiKeySource(t *testing.T) { resourceName := "aws_api_gateway_rest_api.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckAPIGatewayTypeEDGE(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckAPIGatewayTypeEDGE(t) }, ErrorCheck: acctest.ErrorCheck(t, apigateway.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRestAPIDestroy(ctx), @@ -315,7 +315,7 @@ func TestAccAPIGatewayRestAPI_APIKeySource_overrideBody(t *testing.T) { resourceName := "aws_api_gateway_rest_api.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckAPIGatewayTypeEDGE(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckAPIGatewayTypeEDGE(t) }, ErrorCheck: acctest.ErrorCheck(t, apigateway.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRestAPIDestroy(ctx), @@ -360,7 +360,7 @@ func TestAccAPIGatewayRestAPI_APIKeySource_setByBody(t *testing.T) { resourceName := "aws_api_gateway_rest_api.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckAPIGatewayTypeEDGE(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckAPIGatewayTypeEDGE(t) }, ErrorCheck: acctest.ErrorCheck(t, apigateway.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRestAPIDestroy(ctx), @@ -389,7 +389,7 @@ func TestAccAPIGatewayRestAPI_binaryMediaTypes(t *testing.T) { resourceName := "aws_api_gateway_rest_api.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckAPIGatewayTypeEDGE(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckAPIGatewayTypeEDGE(t) }, ErrorCheck: acctest.ErrorCheck(t, apigateway.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRestAPIDestroy(ctx), @@ -427,7 +427,7 @@ func TestAccAPIGatewayRestAPI_BinaryMediaTypes_overrideBody(t *testing.T) { resourceName := "aws_api_gateway_rest_api.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckAPIGatewayTypeEDGE(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckAPIGatewayTypeEDGE(t) }, ErrorCheck: acctest.ErrorCheck(t, apigateway.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRestAPIDestroy(ctx), @@ -475,7 +475,7 @@ func TestAccAPIGatewayRestAPI_BinaryMediaTypes_setByBody(t *testing.T) { resourceName := "aws_api_gateway_rest_api.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckAPIGatewayTypeEDGE(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckAPIGatewayTypeEDGE(t) }, ErrorCheck: acctest.ErrorCheck(t, apigateway.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRestAPIDestroy(ctx), @@ -505,7 +505,7 @@ func TestAccAPIGatewayRestAPI_body(t *testing.T) { resourceName := "aws_api_gateway_rest_api.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckAPIGatewayTypeEDGE(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckAPIGatewayTypeEDGE(t) }, ErrorCheck: acctest.ErrorCheck(t, apigateway.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRestAPIDestroy(ctx), @@ -549,7 +549,7 @@ func TestAccAPIGatewayRestAPI_description(t *testing.T) { resourceName := "aws_api_gateway_rest_api.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckAPIGatewayTypeEDGE(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckAPIGatewayTypeEDGE(t) }, ErrorCheck: acctest.ErrorCheck(t, apigateway.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRestAPIDestroy(ctx), @@ -585,7 +585,7 @@ func TestAccAPIGatewayRestAPI_Description_overrideBody(t *testing.T) { resourceName := "aws_api_gateway_rest_api.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckAPIGatewayTypeEDGE(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckAPIGatewayTypeEDGE(t) }, ErrorCheck: acctest.ErrorCheck(t, apigateway.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRestAPIDestroy(ctx), @@ -630,7 +630,7 @@ func TestAccAPIGatewayRestAPI_Description_setByBody(t *testing.T) { resourceName := "aws_api_gateway_rest_api.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckAPIGatewayTypeEDGE(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckAPIGatewayTypeEDGE(t) }, ErrorCheck: acctest.ErrorCheck(t, apigateway.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRestAPIDestroy(ctx), @@ -658,7 +658,7 @@ func TestAccAPIGatewayRestAPI_disableExecuteAPIEndpoint(t *testing.T) { resourceName := "aws_api_gateway_rest_api.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckAPIGatewayTypeEDGE(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckAPIGatewayTypeEDGE(t) }, ErrorCheck: acctest.ErrorCheck(t, apigateway.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRestAPIDestroy(ctx), @@ -698,7 +698,7 @@ func TestAccAPIGatewayRestAPI_DisableExecuteAPIEndpoint_overrideBody(t *testing. resourceName := "aws_api_gateway_rest_api.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckAPIGatewayTypeEDGE(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckAPIGatewayTypeEDGE(t) }, ErrorCheck: acctest.ErrorCheck(t, apigateway.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRestAPIDestroy(ctx), @@ -743,7 +743,7 @@ func TestAccAPIGatewayRestAPI_DisableExecuteAPIEndpoint_setByBody(t *testing.T) resourceName := "aws_api_gateway_rest_api.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckAPIGatewayTypeEDGE(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckAPIGatewayTypeEDGE(t) }, ErrorCheck: acctest.ErrorCheck(t, apigateway.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRestAPIDestroy(ctx), @@ -774,7 +774,7 @@ func TestAccAPIGatewayRestAPI_Endpoint_vpcEndpointIDs(t *testing.T) { vpcEndpointResourceName2 := "aws_vpc_endpoint.test2" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, apigateway.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRestAPIDestroy(ctx), @@ -833,7 +833,7 @@ func TestAccAPIGatewayRestAPI_EndpointVPCEndpointIDs_overrideBody(t *testing.T) vpcEndpointResourceName3 := "aws_vpc_endpoint.test.2" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, apigateway.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRestAPIDestroy(ctx), @@ -890,7 +890,7 @@ func TestAccAPIGatewayRestAPI_EndpointVPCEndpointIDs_mergeBody(t *testing.T) { vpcEndpointResourceName3 := "aws_vpc_endpoint.test.2" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, apigateway.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRestAPIDestroy(ctx), @@ -947,7 +947,7 @@ func TestAccAPIGatewayRestAPI_EndpointVPCEndpointIDs_overrideToMergeBody(t *test vpcEndpointResourceName2 := "aws_vpc_endpoint.test.1" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, apigateway.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRestAPIDestroy(ctx), @@ -998,7 +998,7 @@ func TestAccAPIGatewayRestAPI_EndpointVPCEndpointIDs_setByBody(t *testing.T) { vpcEndpointResourceName := "aws_vpc_endpoint.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, apigateway.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRestAPIDestroy(ctx), @@ -1029,7 +1029,7 @@ func TestAccAPIGatewayRestAPI_minimumCompressionSize(t *testing.T) { resourceName := "aws_api_gateway_rest_api.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckAPIGatewayTypeEDGE(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckAPIGatewayTypeEDGE(t) }, ErrorCheck: acctest.ErrorCheck(t, apigateway.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRestAPIDestroy(ctx), @@ -1072,7 +1072,7 @@ func TestAccAPIGatewayRestAPI_MinimumCompressionSize_overrideBody(t *testing.T) resourceName := "aws_api_gateway_rest_api.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckAPIGatewayTypeEDGE(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckAPIGatewayTypeEDGE(t) }, ErrorCheck: acctest.ErrorCheck(t, apigateway.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRestAPIDestroy(ctx), @@ -1117,7 +1117,7 @@ func TestAccAPIGatewayRestAPI_MinimumCompressionSize_setByBody(t *testing.T) { resourceName := "aws_api_gateway_rest_api.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckAPIGatewayTypeEDGE(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckAPIGatewayTypeEDGE(t) }, ErrorCheck: acctest.ErrorCheck(t, apigateway.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRestAPIDestroy(ctx), @@ -1149,7 +1149,7 @@ func TestAccAPIGatewayRestAPI_Name_overrideBody(t *testing.T) { resourceName := "aws_api_gateway_rest_api.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckAPIGatewayTypeEDGE(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckAPIGatewayTypeEDGE(t) }, ErrorCheck: acctest.ErrorCheck(t, apigateway.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRestAPIDestroy(ctx), @@ -1194,7 +1194,7 @@ func TestAccAPIGatewayRestAPI_parameters(t *testing.T) { resourceName := "aws_api_gateway_rest_api.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckAPIGatewayTypeEDGE(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckAPIGatewayTypeEDGE(t) }, ErrorCheck: acctest.ErrorCheck(t, apigateway.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRestAPIDestroy(ctx), @@ -1231,7 +1231,7 @@ func TestAccAPIGatewayRestAPI_Policy_basic(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckAPIGatewayTypeEDGE(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckAPIGatewayTypeEDGE(t) }, ErrorCheck: acctest.ErrorCheck(t, apigateway.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRestAPIDestroy(ctx), @@ -1265,7 +1265,7 @@ func TestAccAPIGatewayRestAPI_Policy_order(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckAPIGatewayTypeEDGE(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckAPIGatewayTypeEDGE(t) }, ErrorCheck: acctest.ErrorCheck(t, apigateway.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRestAPIDestroy(ctx), @@ -1291,7 +1291,7 @@ func TestAccAPIGatewayRestAPI_Policy_overrideBody(t *testing.T) { resourceName := "aws_api_gateway_rest_api.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckAPIGatewayTypeEDGE(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckAPIGatewayTypeEDGE(t) }, ErrorCheck: acctest.ErrorCheck(t, apigateway.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRestAPIDestroy(ctx), @@ -1339,7 +1339,7 @@ func TestAccAPIGatewayRestAPI_Policy_setByBody(t *testing.T) { resourceName := "aws_api_gateway_rest_api.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckAPIGatewayTypeEDGE(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckAPIGatewayTypeEDGE(t) }, ErrorCheck: acctest.ErrorCheck(t, apigateway.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRestAPIDestroy(ctx), diff --git a/internal/service/apigateway/sdk_data_source_test.go b/internal/service/apigateway/sdk_data_source_test.go index a6d203cbda74..c0eb301682b5 100644 --- a/internal/service/apigateway/sdk_data_source_test.go +++ b/internal/service/apigateway/sdk_data_source_test.go @@ -14,7 +14,7 @@ func TestAccAPIGatewaySdkDataSource_basic(t *testing.T) { dataSourceName := "data.aws_api_gateway_sdk.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, apigateway.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ diff --git a/internal/service/apigateway/stage_test.go b/internal/service/apigateway/stage_test.go index 18bb8e3e27b5..5861251e9671 100644 --- a/internal/service/apigateway/stage_test.go +++ b/internal/service/apigateway/stage_test.go @@ -23,7 +23,7 @@ func TestAccAPIGatewayStage_basic(t *testing.T) { resourceName := "aws_api_gateway_stage.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckAPIGatewayTypeEDGE(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckAPIGatewayTypeEDGE(t) }, ErrorCheck: acctest.ErrorCheck(t, apigateway.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckStageDestroy(ctx), @@ -90,7 +90,7 @@ func TestAccAPIGatewayStage_cache(t *testing.T) { resourceName := "aws_api_gateway_stage.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckAPIGatewayTypeEDGE(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckAPIGatewayTypeEDGE(t) }, ErrorCheck: acctest.ErrorCheck(t, apigateway.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckStageDestroy(ctx), @@ -144,7 +144,7 @@ func TestAccAPIGatewayStage_cacheSizeCacheDisabled(t *testing.T) { resourceName := "aws_api_gateway_stage.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckAPIGatewayTypeEDGE(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckAPIGatewayTypeEDGE(t) }, ErrorCheck: acctest.ErrorCheck(t, apigateway.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckStageDestroy(ctx), @@ -190,7 +190,7 @@ func TestAccAPIGatewayStage_Disappears_referencingDeployment(t *testing.T) { resourceName := "aws_api_gateway_stage.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckAPIGatewayTypeEDGE(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckAPIGatewayTypeEDGE(t) }, ErrorCheck: acctest.ErrorCheck(t, apigateway.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckStageDestroy(ctx), @@ -218,7 +218,7 @@ func TestAccAPIGatewayStage_tags(t *testing.T) { resourceName := "aws_api_gateway_stage.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckAPIGatewayTypeEDGE(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckAPIGatewayTypeEDGE(t) }, ErrorCheck: acctest.ErrorCheck(t, apigateway.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckStageDestroy(ctx), @@ -265,7 +265,7 @@ func TestAccAPIGatewayStage_disappears(t *testing.T) { resourceName := "aws_api_gateway_stage.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckAPIGatewayTypeEDGE(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckAPIGatewayTypeEDGE(t) }, ErrorCheck: acctest.ErrorCheck(t, apigateway.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckStageDestroy(ctx), @@ -290,7 +290,7 @@ func TestAccAPIGatewayStage_Disappears_restAPI(t *testing.T) { resourceName := "aws_api_gateway_stage.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckAPIGatewayTypeEDGE(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckAPIGatewayTypeEDGE(t) }, ErrorCheck: acctest.ErrorCheck(t, apigateway.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckStageDestroy(ctx), @@ -320,7 +320,7 @@ func TestAccAPIGatewayStage_accessLogSettings(t *testing.T) { csv := `$context.identity.sourceIp,$context.identity.caller,$context.identity.user,$context.requestTime,$context.httpMethod,$context.resourcePath,$context.protocol,$context.status,$context.responseLength,$context.requestId` resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckAPIGatewayTypeEDGE(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckAPIGatewayTypeEDGE(t) }, ErrorCheck: acctest.ErrorCheck(t, apigateway.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckStageDestroy(ctx), @@ -390,7 +390,7 @@ func TestAccAPIGatewayStage_AccessLogSettings_kinesis(t *testing.T) { csv := `$context.identity.sourceIp,$context.identity.caller,$context.identity.user,$context.requestTime,$context.httpMethod,$context.resourcePath,$context.protocol,$context.status,$context.responseLength,$context.requestId` resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckAPIGatewayTypeEDGE(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckAPIGatewayTypeEDGE(t) }, ErrorCheck: acctest.ErrorCheck(t, apigateway.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckStageDestroy(ctx), @@ -454,7 +454,7 @@ func TestAccAPIGatewayStage_waf(t *testing.T) { resourceName := "aws_api_gateway_stage.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckAPIGatewayTypeEDGE(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckAPIGatewayTypeEDGE(t) }, ErrorCheck: acctest.ErrorCheck(t, apigateway.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckStageDestroy(ctx), @@ -489,7 +489,7 @@ func TestAccAPIGatewayStage_canarySettings(t *testing.T) { resourceName := "aws_api_gateway_stage.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckAPIGatewayTypeEDGE(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckAPIGatewayTypeEDGE(t) }, ErrorCheck: acctest.ErrorCheck(t, apigateway.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckStageDestroy(ctx), diff --git a/internal/service/apigateway/usage_plan_key_test.go b/internal/service/apigateway/usage_plan_key_test.go index a3351c9516f1..3a3982f8d278 100644 --- a/internal/service/apigateway/usage_plan_key_test.go +++ b/internal/service/apigateway/usage_plan_key_test.go @@ -24,7 +24,7 @@ func TestAccAPIGatewayUsagePlanKey_basic(t *testing.T) { resourceName := "aws_api_gateway_usage_plan_key.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckAPIGatewayTypeEDGE(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckAPIGatewayTypeEDGE(t) }, ErrorCheck: acctest.ErrorCheck(t, apigateway.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckUsagePlanKeyDestroy(ctx), @@ -57,7 +57,7 @@ func TestAccAPIGatewayUsagePlanKey_disappears(t *testing.T) { resourceName := "aws_api_gateway_usage_plan_key.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckAPIGatewayTypeEDGE(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckAPIGatewayTypeEDGE(t) }, ErrorCheck: acctest.ErrorCheck(t, apigateway.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckUsagePlanKeyDestroy(ctx), @@ -80,7 +80,7 @@ func TestAccAPIGatewayUsagePlanKey_KeyID_concurrency(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckAPIGatewayTypeEDGE(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckAPIGatewayTypeEDGE(t) }, ErrorCheck: acctest.ErrorCheck(t, apigateway.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckUsagePlanKeyDestroy(ctx), diff --git a/internal/service/apigateway/usage_plan_test.go b/internal/service/apigateway/usage_plan_test.go index 5dfbff764a6e..70e7565f6f45 100644 --- a/internal/service/apigateway/usage_plan_test.go +++ b/internal/service/apigateway/usage_plan_test.go @@ -24,7 +24,7 @@ func TestAccAPIGatewayUsagePlan_basic(t *testing.T) { resourceName := "aws_api_gateway_usage_plan.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckAPIGatewayTypeEDGE(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckAPIGatewayTypeEDGE(t) }, ErrorCheck: acctest.ErrorCheck(t, apigateway.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckUsagePlanDestroy(ctx), @@ -65,7 +65,7 @@ func TestAccAPIGatewayUsagePlan_tags(t *testing.T) { resourceName := "aws_api_gateway_usage_plan.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckAPIGatewayTypeEDGE(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckAPIGatewayTypeEDGE(t) }, ErrorCheck: acctest.ErrorCheck(t, apigateway.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckUsagePlanDestroy(ctx), @@ -113,7 +113,7 @@ func TestAccAPIGatewayUsagePlan_description(t *testing.T) { resourceName := "aws_api_gateway_usage_plan.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckAPIGatewayTypeEDGE(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckAPIGatewayTypeEDGE(t) }, ErrorCheck: acctest.ErrorCheck(t, apigateway.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckUsagePlanDestroy(ctx), @@ -168,7 +168,7 @@ func TestAccAPIGatewayUsagePlan_productCode(t *testing.T) { resourceName := "aws_api_gateway_usage_plan.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckAPIGatewayTypeEDGE(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckAPIGatewayTypeEDGE(t) }, ErrorCheck: acctest.ErrorCheck(t, apigateway.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckUsagePlanDestroy(ctx), @@ -217,7 +217,7 @@ func TestAccAPIGatewayUsagePlan_throttling(t *testing.T) { resourceName := "aws_api_gateway_usage_plan.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckAPIGatewayTypeEDGE(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckAPIGatewayTypeEDGE(t) }, ErrorCheck: acctest.ErrorCheck(t, apigateway.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckUsagePlanDestroy(ctx), @@ -273,7 +273,7 @@ func TestAccAPIGatewayUsagePlan_throttlingInitialRateLimit(t *testing.T) { resourceName := "aws_api_gateway_usage_plan.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckAPIGatewayTypeEDGE(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckAPIGatewayTypeEDGE(t) }, ErrorCheck: acctest.ErrorCheck(t, apigateway.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckUsagePlanDestroy(ctx), @@ -301,7 +301,7 @@ func TestAccAPIGatewayUsagePlan_quota(t *testing.T) { resourceName := "aws_api_gateway_usage_plan.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckAPIGatewayTypeEDGE(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckAPIGatewayTypeEDGE(t) }, ErrorCheck: acctest.ErrorCheck(t, apigateway.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckUsagePlanDestroy(ctx), @@ -358,7 +358,7 @@ func TestAccAPIGatewayUsagePlan_apiStages(t *testing.T) { resourceName := "aws_api_gateway_usage_plan.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckAPIGatewayTypeEDGE(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckAPIGatewayTypeEDGE(t) }, ErrorCheck: acctest.ErrorCheck(t, apigateway.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckUsagePlanDestroy(ctx), @@ -443,7 +443,7 @@ func TestAccAPIGatewayUsagePlan_APIStages_multiple(t *testing.T) { resourceName := "aws_api_gateway_usage_plan.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckAPIGatewayTypeEDGE(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckAPIGatewayTypeEDGE(t) }, ErrorCheck: acctest.ErrorCheck(t, apigateway.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckUsagePlanDestroy(ctx), @@ -477,7 +477,7 @@ func TestAccAPIGatewayUsagePlan_APIStages_throttle(t *testing.T) { resourceName := "aws_api_gateway_usage_plan.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckAPIGatewayTypeEDGE(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckAPIGatewayTypeEDGE(t) }, ErrorCheck: acctest.ErrorCheck(t, apigateway.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckUsagePlanDestroy(ctx), @@ -536,7 +536,7 @@ func TestAccAPIGatewayUsagePlan_disappears(t *testing.T) { resourceName := "aws_api_gateway_usage_plan.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckAPIGatewayTypeEDGE(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckAPIGatewayTypeEDGE(t) }, ErrorCheck: acctest.ErrorCheck(t, apigateway.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckUsagePlanDestroy(ctx), diff --git a/internal/service/apigateway/vpc_link_data_source_test.go b/internal/service/apigateway/vpc_link_data_source_test.go index a3dc956bfeff..f28bb7b38862 100644 --- a/internal/service/apigateway/vpc_link_data_source_test.go +++ b/internal/service/apigateway/vpc_link_data_source_test.go @@ -15,7 +15,7 @@ func TestAccAPIGatewayVPCLinkDataSource_basic(t *testing.T) { resourceName := "aws_api_gateway_vpc_link.vpc_link" dataSourceName := "data.aws_api_gateway_vpc_link.vpc_link" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, apigateway.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ diff --git a/internal/service/apigateway/vpc_link_test.go b/internal/service/apigateway/vpc_link_test.go index fcab81aa7d3b..c122381c62e0 100644 --- a/internal/service/apigateway/vpc_link_test.go +++ b/internal/service/apigateway/vpc_link_test.go @@ -25,7 +25,7 @@ func TestAccAPIGatewayVPCLink_basic(t *testing.T) { vpcLinkNameUpdated := fmt.Sprintf("tf-apigateway-update-%s", rName) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, apigateway.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckVPCLinkDestroy(ctx), @@ -67,7 +67,7 @@ func TestAccAPIGatewayVPCLink_tags(t *testing.T) { description := "test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, apigateway.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckVPCLinkDestroy(ctx), @@ -121,7 +121,7 @@ func TestAccAPIGatewayVPCLink_disappears(t *testing.T) { resourceName := "aws_api_gateway_vpc_link.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, apigateway.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckVPCLinkDestroy(ctx), From a927122d670d3042a504df1482bdcdcd01db845e Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Fri, 24 Feb 2023 16:36:31 -0500 Subject: [PATCH 086/763] Add 'Context' argument to 'acctest.PreCheck' for apigatewayv2. --- .../apigatewayv2/api_data_source_test.go | 4 +-- .../service/apigatewayv2/api_mapping_test.go | 8 ++--- internal/service/apigatewayv2/api_test.go | 26 ++++++++-------- .../apigatewayv2/apis_data_source_test.go | 6 ++-- .../service/apigatewayv2/authorizer_test.go | 12 ++++---- .../service/apigatewayv2/deployment_test.go | 6 ++-- .../service/apigatewayv2/domain_name_test.go | 14 ++++----- .../apigatewayv2/export_data_source_test.go | 4 +-- .../apigatewayv2/integration_response_test.go | 6 ++-- .../service/apigatewayv2/integration_test.go | 20 ++++++------- internal/service/apigatewayv2/model_test.go | 6 ++-- .../apigatewayv2/route_response_test.go | 6 ++-- internal/service/apigatewayv2/route_test.go | 18 +++++------ internal/service/apigatewayv2/stage_test.go | 30 +++++++++---------- .../service/apigatewayv2/vpc_link_test.go | 6 ++-- 15 files changed, 86 insertions(+), 86 deletions(-) diff --git a/internal/service/apigatewayv2/api_data_source_test.go b/internal/service/apigatewayv2/api_data_source_test.go index 39df78a876c1..5d12f67c62c1 100644 --- a/internal/service/apigatewayv2/api_data_source_test.go +++ b/internal/service/apigatewayv2/api_data_source_test.go @@ -16,7 +16,7 @@ func TestAccAPIGatewayV2APIDataSource_http(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, apigatewayv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: nil, @@ -56,7 +56,7 @@ func TestAccAPIGatewayV2APIDataSource_webSocket(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, apigatewayv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: nil, diff --git a/internal/service/apigatewayv2/api_mapping_test.go b/internal/service/apigatewayv2/api_mapping_test.go index 7140aade7413..394dc4c37a8b 100644 --- a/internal/service/apigatewayv2/api_mapping_test.go +++ b/internal/service/apigatewayv2/api_mapping_test.go @@ -50,7 +50,7 @@ func TestAccAPIGatewayV2APIMapping_basic(t *testing.T) { func testAccAPIMapping_createCertificate(t *testing.T, rName string, certificateArn *string) { ctx := acctest.Context(t) resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, apigatewayv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: nil, @@ -76,7 +76,7 @@ func testAccAPIMapping_basic(t *testing.T, rName string, certificateArn *string) stageResourceName := "aws_apigatewayv2_stage.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, apigatewayv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckAPIMappingDestroy(ctx), @@ -105,7 +105,7 @@ func testAccAPIMapping_disappears(t *testing.T, rName string, certificateArn *st resourceName := "aws_apigatewayv2_api_mapping.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, apigatewayv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckAPIMappingDestroy(ctx), @@ -131,7 +131,7 @@ func testAccAPIMapping_key(t *testing.T, rName string, certificateArn *string) { stageResourceName := "aws_apigatewayv2_stage.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, apigatewayv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckAPIMappingDestroy(ctx), diff --git a/internal/service/apigatewayv2/api_test.go b/internal/service/apigatewayv2/api_test.go index 6debd744fb7b..e7f70d45f77c 100644 --- a/internal/service/apigatewayv2/api_test.go +++ b/internal/service/apigatewayv2/api_test.go @@ -24,7 +24,7 @@ func TestAccAPIGatewayV2API_basicWebSocket(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, apigatewayv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckAPIDestroy(ctx), @@ -63,7 +63,7 @@ func TestAccAPIGatewayV2API_basicHTTP(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, apigatewayv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckAPIDestroy(ctx), @@ -102,7 +102,7 @@ func TestAccAPIGatewayV2API_disappears(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, apigatewayv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckAPIDestroy(ctx), @@ -127,7 +127,7 @@ func TestAccAPIGatewayV2API_allAttributesWebSocket(t *testing.T) { rName2 := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, apigatewayv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckAPIDestroy(ctx), @@ -210,7 +210,7 @@ func TestAccAPIGatewayV2API_allAttributesHTTP(t *testing.T) { rName2 := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, apigatewayv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckAPIDestroy(ctx), @@ -292,7 +292,7 @@ func TestAccAPIGatewayV2API_openAPI(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, apigatewayv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckAPIDestroy(ctx), @@ -340,7 +340,7 @@ func TestAccAPIGatewayV2API_OpenAPI_withTags(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, apigatewayv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckAPIDestroy(ctx), @@ -386,7 +386,7 @@ func TestAccAPIGatewayV2API_OpenAPI_withCors(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, apigatewayv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckAPIDestroy(ctx), @@ -444,7 +444,7 @@ func TestAccAPIGatewayV2API_OpenAPI_withMoreFields(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, apigatewayv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckAPIDestroy(ctx), @@ -498,7 +498,7 @@ func TestAccAPIGatewayV2API_OpenAPI_failOnWarnings(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, apigatewayv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckAPIDestroy(ctx), @@ -583,7 +583,7 @@ func TestAccAPIGatewayV2API_tags(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, apigatewayv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckAPIDestroy(ctx), @@ -637,7 +637,7 @@ func TestAccAPIGatewayV2API_cors(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, apigatewayv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckAPIDestroy(ctx), @@ -729,7 +729,7 @@ func TestAccAPIGatewayV2API_quickCreate(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, apigatewayv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckAPIDestroy(ctx), diff --git a/internal/service/apigatewayv2/apis_data_source_test.go b/internal/service/apigatewayv2/apis_data_source_test.go index 6d903c0dc488..e20910b631ee 100644 --- a/internal/service/apigatewayv2/apis_data_source_test.go +++ b/internal/service/apigatewayv2/apis_data_source_test.go @@ -17,7 +17,7 @@ func TestAccAPIGatewayV2APIsDataSource_name(t *testing.T) { rName2 := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, apigatewayv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: nil, @@ -40,7 +40,7 @@ func TestAccAPIGatewayV2APIsDataSource_protocolType(t *testing.T) { rName2 := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, apigatewayv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: nil, @@ -64,7 +64,7 @@ func TestAccAPIGatewayV2APIsDataSource_tags(t *testing.T) { rName2 := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, apigatewayv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: nil, diff --git a/internal/service/apigatewayv2/authorizer_test.go b/internal/service/apigatewayv2/authorizer_test.go index cd54d73d5925..7e7e09d6bafa 100644 --- a/internal/service/apigatewayv2/authorizer_test.go +++ b/internal/service/apigatewayv2/authorizer_test.go @@ -25,7 +25,7 @@ func TestAccAPIGatewayV2Authorizer_basic(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, apigatewayv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckAuthorizerDestroy(ctx), @@ -63,7 +63,7 @@ func TestAccAPIGatewayV2Authorizer_disappears(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, apigatewayv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckAuthorizerDestroy(ctx), @@ -90,7 +90,7 @@ func TestAccAPIGatewayV2Authorizer_credentials(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, apigatewayv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckAuthorizerDestroy(ctx), @@ -161,7 +161,7 @@ func TestAccAPIGatewayV2Authorizer_jwt(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, apigatewayv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckAuthorizerDestroy(ctx), @@ -222,7 +222,7 @@ func TestAccAPIGatewayV2Authorizer_HTTPAPILambdaRequestAuthorizer_initialMissing rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, apigatewayv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckAuthorizerDestroy(ctx), @@ -296,7 +296,7 @@ func TestAccAPIGatewayV2Authorizer_HTTPAPILambdaRequestAuthorizer_initialZeroCac rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, apigatewayv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckAuthorizerDestroy(ctx), diff --git a/internal/service/apigatewayv2/deployment_test.go b/internal/service/apigatewayv2/deployment_test.go index 8bf041f61261..28abbbaec0fb 100644 --- a/internal/service/apigatewayv2/deployment_test.go +++ b/internal/service/apigatewayv2/deployment_test.go @@ -23,7 +23,7 @@ func TestAccAPIGatewayV2Deployment_basic(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, apigatewayv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDeploymentDestroy(ctx), @@ -62,7 +62,7 @@ func TestAccAPIGatewayV2Deployment_disappears(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, apigatewayv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDeploymentDestroy(ctx), @@ -87,7 +87,7 @@ func TestAccAPIGatewayV2Deployment_triggers(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, apigatewayv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDeploymentDestroy(ctx), diff --git a/internal/service/apigatewayv2/domain_name_test.go b/internal/service/apigatewayv2/domain_name_test.go index 73e2c718f4c2..38b6e10bfa77 100644 --- a/internal/service/apigatewayv2/domain_name_test.go +++ b/internal/service/apigatewayv2/domain_name_test.go @@ -27,7 +27,7 @@ func TestAccAPIGatewayV2DomainName_basic(t *testing.T) { certificate := acctest.TLSRSAX509SelfSignedCertificatePEM(t, key, domainName) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, apigatewayv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDomainNameDestroy(ctx), @@ -67,7 +67,7 @@ func TestAccAPIGatewayV2DomainName_disappears(t *testing.T) { certificate := acctest.TLSRSAX509SelfSignedCertificatePEM(t, key, domainName) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, apigatewayv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDomainNameDestroy(ctx), @@ -95,7 +95,7 @@ func TestAccAPIGatewayV2DomainName_tags(t *testing.T) { certificate := acctest.TLSRSAX509SelfSignedCertificatePEM(t, key, domainName) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, apigatewayv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDomainNameDestroy(ctx), @@ -155,7 +155,7 @@ func TestAccAPIGatewayV2DomainName_updateCertificate(t *testing.T) { certificate := acctest.TLSRSAX509SelfSignedCertificatePEM(t, key, domainName) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, apigatewayv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDomainNameDestroy(ctx), @@ -231,7 +231,7 @@ func TestAccAPIGatewayV2DomainName_MutualTLSAuthentication_basic(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, apigatewayv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDomainNameDestroy(ctx), @@ -309,7 +309,7 @@ func TestAccAPIGatewayV2DomainName_MutualTLSAuthentication_noVersion(t *testing. rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, apigatewayv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDomainNameDestroy(ctx), @@ -351,7 +351,7 @@ func TestAccAPIGatewayV2DomainName_MutualTLSAuthentication_ownership(t *testing. rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, apigatewayv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDomainNameDestroy(ctx), diff --git a/internal/service/apigatewayv2/export_data_source_test.go b/internal/service/apigatewayv2/export_data_source_test.go index 0933678c74ca..862f1e447c62 100644 --- a/internal/service/apigatewayv2/export_data_source_test.go +++ b/internal/service/apigatewayv2/export_data_source_test.go @@ -15,7 +15,7 @@ func TestAccAPIGatewayV2ExportDataSource_basic(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, apigatewayv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: nil, @@ -36,7 +36,7 @@ func TestAccAPIGatewayV2ExportDataSource_stage(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, apigatewayv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: nil, diff --git a/internal/service/apigatewayv2/integration_response_test.go b/internal/service/apigatewayv2/integration_response_test.go index 7377900d4e94..098c5bb5b3c4 100644 --- a/internal/service/apigatewayv2/integration_response_test.go +++ b/internal/service/apigatewayv2/integration_response_test.go @@ -24,7 +24,7 @@ func TestAccAPIGatewayV2IntegrationResponse_basic(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, apigatewayv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckIntegrationResponseDestroy(ctx), @@ -58,7 +58,7 @@ func TestAccAPIGatewayV2IntegrationResponse_disappears(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, apigatewayv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckIntegrationResponseDestroy(ctx), @@ -84,7 +84,7 @@ func TestAccAPIGatewayV2IntegrationResponse_allAttributes(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, apigatewayv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckIntegrationResponseDestroy(ctx), diff --git a/internal/service/apigatewayv2/integration_test.go b/internal/service/apigatewayv2/integration_test.go index 4c83b21631e2..2599e43a7858 100644 --- a/internal/service/apigatewayv2/integration_test.go +++ b/internal/service/apigatewayv2/integration_test.go @@ -23,7 +23,7 @@ func TestAccAPIGatewayV2Integration_basicWebSocket(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, apigatewayv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckIntegrationDestroy(ctx), @@ -70,7 +70,7 @@ func TestAccAPIGatewayV2Integration_basicHTTP(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, apigatewayv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckIntegrationDestroy(ctx), @@ -117,7 +117,7 @@ func TestAccAPIGatewayV2Integration_disappears(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, apigatewayv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckIntegrationDestroy(ctx), @@ -142,7 +142,7 @@ func TestAccAPIGatewayV2Integration_dataMappingHTTP(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, apigatewayv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckIntegrationDestroy(ctx), @@ -234,7 +234,7 @@ func TestAccAPIGatewayV2Integration_integrationTypeHTTP(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, apigatewayv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckIntegrationDestroy(ctx), @@ -312,7 +312,7 @@ func TestAccAPIGatewayV2Integration_lambdaWebSocket(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, apigatewayv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckIntegrationDestroy(ctx), @@ -359,7 +359,7 @@ func TestAccAPIGatewayV2Integration_lambdaHTTP(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, apigatewayv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckIntegrationDestroy(ctx), @@ -406,7 +406,7 @@ func TestAccAPIGatewayV2Integration_vpcLinkWebSocket(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, apigatewayv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckIntegrationDestroy(ctx), @@ -455,7 +455,7 @@ func TestAccAPIGatewayV2Integration_vpcLinkHTTP(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, apigatewayv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckIntegrationDestroy(ctx), @@ -537,7 +537,7 @@ func TestAccAPIGatewayV2Integration_serviceIntegration(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, apigatewayv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckIntegrationDestroy(ctx), diff --git a/internal/service/apigatewayv2/model_test.go b/internal/service/apigatewayv2/model_test.go index 184cd82a079c..3eb09a116667 100644 --- a/internal/service/apigatewayv2/model_test.go +++ b/internal/service/apigatewayv2/model_test.go @@ -37,7 +37,7 @@ func TestAccAPIGatewayV2Model_basic(t *testing.T) { ` resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, apigatewayv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckModelDestroy(ctx), @@ -83,7 +83,7 @@ func TestAccAPIGatewayV2Model_disappears(t *testing.T) { ` resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, apigatewayv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckModelDestroy(ctx), @@ -136,7 +136,7 @@ func TestAccAPIGatewayV2Model_allAttributes(t *testing.T) { ` resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, apigatewayv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckModelDestroy(ctx), diff --git a/internal/service/apigatewayv2/route_response_test.go b/internal/service/apigatewayv2/route_response_test.go index 2ae746b21113..4dbc099cbd6d 100644 --- a/internal/service/apigatewayv2/route_response_test.go +++ b/internal/service/apigatewayv2/route_response_test.go @@ -25,7 +25,7 @@ func TestAccAPIGatewayV2RouteResponse_basic(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, apigatewayv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRouteResponseDestroy(ctx), @@ -58,7 +58,7 @@ func TestAccAPIGatewayV2RouteResponse_disappears(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, apigatewayv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRouteResponseDestroy(ctx), @@ -86,7 +86,7 @@ func TestAccAPIGatewayV2RouteResponse_model(t *testing.T) { rName := strings.ReplaceAll(sdkacctest.RandomWithPrefix(acctest.ResourcePrefix), "-", "") resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, apigatewayv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRouteResponseDestroy(ctx), diff --git a/internal/service/apigatewayv2/route_test.go b/internal/service/apigatewayv2/route_test.go index 355580d28543..1628a359c6ab 100644 --- a/internal/service/apigatewayv2/route_test.go +++ b/internal/service/apigatewayv2/route_test.go @@ -25,7 +25,7 @@ func TestAccAPIGatewayV2Route_basic(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, apigatewayv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRouteDestroy(ctx), @@ -64,7 +64,7 @@ func TestAccAPIGatewayV2Route_disappears(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, apigatewayv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRouteDestroy(ctx), @@ -90,7 +90,7 @@ func TestAccAPIGatewayV2Route_authorizer(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, apigatewayv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRouteDestroy(ctx), @@ -148,7 +148,7 @@ func TestAccAPIGatewayV2Route_jwtAuthorization(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, apigatewayv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRouteDestroy(ctx), @@ -207,7 +207,7 @@ func TestAccAPIGatewayV2Route_model(t *testing.T) { rName := strings.ReplaceAll(sdkacctest.RandomWithPrefix(acctest.ResourcePrefix), "-", "") resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, apigatewayv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRouteDestroy(ctx), @@ -247,7 +247,7 @@ func TestAccAPIGatewayV2Route_requestParameters(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, apigatewayv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRouteDestroy(ctx), @@ -330,7 +330,7 @@ func TestAccAPIGatewayV2Route_simpleAttributes(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, apigatewayv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRouteDestroy(ctx), @@ -402,7 +402,7 @@ func TestAccAPIGatewayV2Route_target(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, apigatewayv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRouteDestroy(ctx), @@ -441,7 +441,7 @@ func TestAccAPIGatewayV2Route_updateRouteKey(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, apigatewayv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRouteDestroy(ctx), diff --git a/internal/service/apigatewayv2/stage_test.go b/internal/service/apigatewayv2/stage_test.go index b3332b7629b5..1ff0128f05d1 100644 --- a/internal/service/apigatewayv2/stage_test.go +++ b/internal/service/apigatewayv2/stage_test.go @@ -26,7 +26,7 @@ func TestAccAPIGatewayV2Stage_basicWebSocket(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, apigatewayv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckStageDestroy(ctx), @@ -73,7 +73,7 @@ func TestAccAPIGatewayV2Stage_basicHTTP(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, apigatewayv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckStageDestroy(ctx), @@ -120,7 +120,7 @@ func TestAccAPIGatewayV2Stage_defaultHTTPStage(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, apigatewayv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckStageDestroy(ctx), @@ -167,7 +167,7 @@ func TestAccAPIGatewayV2Stage_autoDeployHTTP(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, apigatewayv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckStageDestroy(ctx), @@ -240,7 +240,7 @@ func TestAccAPIGatewayV2Stage_disappears(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, apigatewayv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckStageDestroy(ctx), @@ -266,7 +266,7 @@ func TestAccAPIGatewayV2Stage_accessLogSettings(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckAPIGatewayAccountCloudWatchRoleARN(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckAPIGatewayAccountCloudWatchRoleARN(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, apigatewayv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckStageDestroy(ctx), @@ -339,7 +339,7 @@ func TestAccAPIGatewayV2Stage_clientCertificateIdAndDescription(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, apigatewayv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckStageDestroy(ctx), @@ -410,7 +410,7 @@ func TestAccAPIGatewayV2Stage_defaultRouteSettingsWebSocket(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckAPIGatewayAccountCloudWatchRoleARN(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckAPIGatewayAccountCloudWatchRoleARN(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, apigatewayv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckStageDestroy(ctx), @@ -502,7 +502,7 @@ func TestAccAPIGatewayV2Stage_defaultRouteSettingsHTTP(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, apigatewayv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckStageDestroy(ctx), @@ -595,7 +595,7 @@ func TestAccAPIGatewayV2Stage_deployment(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, apigatewayv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckStageDestroy(ctx), @@ -642,7 +642,7 @@ func TestAccAPIGatewayV2Stage_routeSettingsWebSocket(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckAPIGatewayAccountCloudWatchRoleARN(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckAPIGatewayAccountCloudWatchRoleARN(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, apigatewayv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckStageDestroy(ctx), @@ -771,7 +771,7 @@ func TestAccAPIGatewayV2Stage_routeSettingsHTTP(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, apigatewayv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckStageDestroy(ctx), @@ -877,7 +877,7 @@ func TestAccAPIGatewayV2Stage_RouteSettingsHTTP_withRoute(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, apigatewayv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckStageDestroy(ctx), @@ -962,7 +962,7 @@ func TestAccAPIGatewayV2Stage_stageVariables(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, apigatewayv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckStageDestroy(ctx), @@ -1032,7 +1032,7 @@ func TestAccAPIGatewayV2Stage_tags(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, apigatewayv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckStageDestroy(ctx), diff --git a/internal/service/apigatewayv2/vpc_link_test.go b/internal/service/apigatewayv2/vpc_link_test.go index 9a6161e1d54f..8fa64ff87ad7 100644 --- a/internal/service/apigatewayv2/vpc_link_test.go +++ b/internal/service/apigatewayv2/vpc_link_test.go @@ -25,7 +25,7 @@ func TestAccAPIGatewayV2VPCLink_basic(t *testing.T) { rName2 := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, apigatewayv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckVPCLinkDestroy(ctx), @@ -68,7 +68,7 @@ func TestAccAPIGatewayV2VPCLink_disappears(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, apigatewayv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckVPCLinkDestroy(ctx), @@ -92,7 +92,7 @@ func TestAccAPIGatewayV2VPCLink_tags(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, apigatewayv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckVPCLinkDestroy(ctx), From 8c9c349947e60b2e54fc85c085cc4204a4568fa8 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Fri, 24 Feb 2023 16:36:31 -0500 Subject: [PATCH 087/763] Add 'Context' argument to 'acctest.PreCheck' for appautoscaling. --- .../service/appautoscaling/policy_test.go | 18 ++++++------- .../appautoscaling/scheduled_action_test.go | 26 +++++++++---------- .../service/appautoscaling/target_test.go | 12 ++++----- 3 files changed, 28 insertions(+), 28 deletions(-) diff --git a/internal/service/appautoscaling/policy_test.go b/internal/service/appautoscaling/policy_test.go index bc94b5a9abeb..d57356f2e646 100644 --- a/internal/service/appautoscaling/policy_test.go +++ b/internal/service/appautoscaling/policy_test.go @@ -91,7 +91,7 @@ func TestAccAppAutoScalingPolicy_basic(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, applicationautoscaling.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckPolicyDestroy(ctx), @@ -133,7 +133,7 @@ func TestAccAppAutoScalingPolicy_disappears(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, applicationautoscaling.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckPolicyDestroy(ctx), @@ -158,7 +158,7 @@ func TestAccAppAutoScalingPolicy_scaleOutAndIn(t *testing.T) { randPolicyNamePrefix := fmt.Sprintf("terraform-test-foobar-%s", sdkacctest.RandString(5)) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, applicationautoscaling.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckPolicyDestroy(ctx), @@ -240,7 +240,7 @@ func TestAccAppAutoScalingPolicy_spotFleetRequest(t *testing.T) { validUntil := time.Now().UTC().Add(24 * time.Hour).Format(time.RFC3339) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, applicationautoscaling.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckPolicyDestroy(ctx), @@ -273,7 +273,7 @@ func TestAccAppAutoScalingPolicy_DynamoDB_table(t *testing.T) { randPolicyName := fmt.Sprintf("test-appautoscaling-policy-%s", sdkacctest.RandString(5)) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, applicationautoscaling.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckPolicyDestroy(ctx), @@ -306,7 +306,7 @@ func TestAccAppAutoScalingPolicy_DynamoDB_index(t *testing.T) { resourceName := "aws_appautoscaling_policy.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, applicationautoscaling.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckPolicyDestroy(ctx), @@ -341,7 +341,7 @@ func TestAccAppAutoScalingPolicy_multiplePoliciesSameName(t *testing.T) { namePrefix := fmt.Sprintf("tf-appautoscaling-policy-%s", sdkacctest.RandString(5)) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, applicationautoscaling.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckPolicyDestroy(ctx), @@ -375,7 +375,7 @@ func TestAccAppAutoScalingPolicy_multiplePoliciesSameResource(t *testing.T) { namePrefix := fmt.Sprintf("tf-appautoscaling-policy-%s", sdkacctest.RandString(5)) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, applicationautoscaling.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckPolicyDestroy(ctx), @@ -421,7 +421,7 @@ func TestAccAppAutoScalingPolicy_ResourceID_forceNew(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, applicationautoscaling.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckPolicyDestroy(ctx), diff --git a/internal/service/appautoscaling/scheduled_action_test.go b/internal/service/appautoscaling/scheduled_action_test.go index 30f4244e85a6..a81a8344da33 100644 --- a/internal/service/appautoscaling/scheduled_action_test.go +++ b/internal/service/appautoscaling/scheduled_action_test.go @@ -28,7 +28,7 @@ func TestAccAppAutoScalingScheduledAction_dynamoDB(t *testing.T) { autoscalingTargetResourceName := "aws_appautoscaling_target.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, applicationautoscaling.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckScheduledActionDestroy(ctx), @@ -83,7 +83,7 @@ func TestAccAppAutoScalingScheduledAction_ecs(t *testing.T) { autoscalingTargetResourceName := "aws_appautoscaling_target.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, applicationautoscaling.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckScheduledActionDestroy(ctx), @@ -117,7 +117,7 @@ func TestAccAppAutoScalingScheduledAction_emr(t *testing.T) { autoscalingTargetResourceName := "aws_appautoscaling_target.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, applicationautoscaling.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckScheduledActionDestroy(ctx), @@ -150,7 +150,7 @@ func TestAccAppAutoScalingScheduledAction_Name_duplicate(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, applicationautoscaling.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckScheduledActionDestroy(ctx), @@ -176,7 +176,7 @@ func TestAccAppAutoScalingScheduledAction_spotFleet(t *testing.T) { autoscalingTargetResourceName := "aws_appautoscaling_target.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, applicationautoscaling.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckScheduledActionDestroy(ctx), @@ -214,7 +214,7 @@ func TestAccAppAutoScalingScheduledAction_ScheduleAtExpression_timezone(t *testi autoscalingTargetResourceName := "aws_appautoscaling_target.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, applicationautoscaling.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckScheduledActionDestroy(ctx), @@ -250,7 +250,7 @@ func TestAccAppAutoScalingScheduledAction_ScheduleCronExpression_basic(t *testin autoscalingTargetResourceName := "aws_appautoscaling_target.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, applicationautoscaling.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckScheduledActionDestroy(ctx), @@ -289,7 +289,7 @@ func TestAccAppAutoScalingScheduledAction_ScheduleCronExpression_timezone(t *tes autoscalingTargetResourceName := "aws_appautoscaling_target.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, applicationautoscaling.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckScheduledActionDestroy(ctx), @@ -332,7 +332,7 @@ func TestAccAppAutoScalingScheduledAction_ScheduleCronExpression_startEndTimeTim autoscalingTargetResourceName := "aws_appautoscaling_target.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, applicationautoscaling.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckScheduledActionDestroy(ctx), @@ -386,7 +386,7 @@ func TestAccAppAutoScalingScheduledAction_ScheduleRateExpression_basic(t *testin autoscalingTargetResourceName := "aws_appautoscaling_target.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, applicationautoscaling.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckScheduledActionDestroy(ctx), @@ -425,7 +425,7 @@ func TestAccAppAutoScalingScheduledAction_ScheduleRateExpression_timezone(t *tes autoscalingTargetResourceName := "aws_appautoscaling_target.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, applicationautoscaling.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckScheduledActionDestroy(ctx), @@ -461,7 +461,7 @@ func TestAccAppAutoScalingScheduledAction_minCapacity(t *testing.T) { autoscalingTargetResourceName := "aws_appautoscaling_target.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, applicationautoscaling.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckScheduledActionDestroy(ctx), @@ -517,7 +517,7 @@ func TestAccAppAutoScalingScheduledAction_maxCapacity(t *testing.T) { autoscalingTargetResourceName := "aws_appautoscaling_target.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, applicationautoscaling.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckScheduledActionDestroy(ctx), diff --git a/internal/service/appautoscaling/target_test.go b/internal/service/appautoscaling/target_test.go index 64d607277e23..53d9cc82be8f 100644 --- a/internal/service/appautoscaling/target_test.go +++ b/internal/service/appautoscaling/target_test.go @@ -23,7 +23,7 @@ func TestAccAppAutoScalingTarget_basic(t *testing.T) { randClusterName := fmt.Sprintf("cluster-%s", sdkacctest.RandString(10)) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, applicationautoscaling.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTargetDestroy(ctx), @@ -64,7 +64,7 @@ func TestAccAppAutoScalingTarget_disappears(t *testing.T) { resourceName := "aws_appautoscaling_target.bar" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, applicationautoscaling.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTargetDestroy(ctx), @@ -87,7 +87,7 @@ func TestAccAppAutoScalingTarget_spotFleetRequest(t *testing.T) { validUntil := time.Now().UTC().Add(24 * time.Hour).Format(time.RFC3339) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, applicationautoscaling.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTargetDestroy(ctx), @@ -116,7 +116,7 @@ func TestAccAppAutoScalingTarget_emrCluster(t *testing.T) { rInt := sdkacctest.RandInt() resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, applicationautoscaling.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTargetDestroy(ctx), @@ -148,7 +148,7 @@ func TestAccAppAutoScalingTarget_multipleTargets(t *testing.T) { tableName := fmt.Sprintf("tf_acc_test_table_%d", rInt) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, applicationautoscaling.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTargetDestroy(ctx), @@ -183,7 +183,7 @@ func TestAccAppAutoScalingTarget_optionalRoleARN(t *testing.T) { tableName := fmt.Sprintf("tf_acc_test_table_%d", rInt) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, applicationautoscaling.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTargetDestroy(ctx), From ef06382c0e7d9967ba157ad081e9d882aa5e3a57 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Fri, 24 Feb 2023 16:36:31 -0500 Subject: [PATCH 088/763] Add 'Context' argument to 'acctest.PreCheck' for appconfig. --- internal/service/appconfig/application_test.go | 10 +++++----- .../configuration_profile_data_source_test.go | 2 +- .../appconfig/configuration_profile_test.go | 16 ++++++++-------- .../configuration_profiles_data_source_test.go | 2 +- .../appconfig/deployment_strategy_test.go | 10 +++++----- internal/service/appconfig/deployment_test.go | 6 +++--- .../appconfig/environment_data_source_test.go | 2 +- internal/service/appconfig/environment_test.go | 14 +++++++------- .../appconfig/environments_data_source_test.go | 2 +- internal/service/appconfig/extension_test.go | 14 +++++++------- .../appconfig/extenstion_association_test.go | 6 +++--- .../hosted_configuration_version_test.go | 4 ++-- 12 files changed, 44 insertions(+), 44 deletions(-) diff --git a/internal/service/appconfig/application_test.go b/internal/service/appconfig/application_test.go index 16da5dcf251d..35e262c7562d 100644 --- a/internal/service/appconfig/application_test.go +++ b/internal/service/appconfig/application_test.go @@ -23,7 +23,7 @@ func TestAccAppConfigApplication_basic(t *testing.T) { resourceName := "aws_appconfig_application.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, appconfig.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckApplicationDestroy(ctx), @@ -52,7 +52,7 @@ func TestAccAppConfigApplication_disappears(t *testing.T) { resourceName := "aws_appconfig_application.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, appconfig.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckApplicationDestroy(ctx), @@ -76,7 +76,7 @@ func TestAccAppConfigApplication_updateName(t *testing.T) { resourceName := "aws_appconfig_application.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, appconfig.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckApplicationDestroy(ctx), @@ -110,7 +110,7 @@ func TestAccAppConfigApplication_updateDescription(t *testing.T) { resourceName := "aws_appconfig_application.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, appconfig.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckApplicationDestroy(ctx), @@ -156,7 +156,7 @@ func TestAccAppConfigApplication_tags(t *testing.T) { resourceName := "aws_appconfig_application.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, appconfig.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckApplicationDestroy(ctx), diff --git a/internal/service/appconfig/configuration_profile_data_source_test.go b/internal/service/appconfig/configuration_profile_data_source_test.go index 984482f4972e..1ef21f496033 100644 --- a/internal/service/appconfig/configuration_profile_data_source_test.go +++ b/internal/service/appconfig/configuration_profile_data_source_test.go @@ -20,7 +20,7 @@ func TestAccAppConfigConfigurationProfileDataSource_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(appconfig.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, appconfig.EndpointsID), diff --git a/internal/service/appconfig/configuration_profile_test.go b/internal/service/appconfig/configuration_profile_test.go index acbe21014a73..43bb40954d00 100644 --- a/internal/service/appconfig/configuration_profile_test.go +++ b/internal/service/appconfig/configuration_profile_test.go @@ -24,7 +24,7 @@ func TestAccAppConfigConfigurationProfile_basic(t *testing.T) { appResourceName := "aws_appconfig_application.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, appconfig.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckConfigurationProfileDestroy(ctx), @@ -58,7 +58,7 @@ func TestAccAppConfigConfigurationProfile_disappears(t *testing.T) { resourceName := "aws_appconfig_configuration_profile.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, appconfig.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckConfigurationProfileDestroy(ctx), @@ -81,7 +81,7 @@ func TestAccAppConfigConfigurationProfile_Validators_json(t *testing.T) { resourceName := "aws_appconfig_configuration_profile.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, appconfig.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckConfigurationProfileDestroy(ctx), @@ -135,7 +135,7 @@ func TestAccAppConfigConfigurationProfile_Validators_lambda(t *testing.T) { resourceName := "aws_appconfig_configuration_profile.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, appconfig.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckConfigurationProfileDestroy(ctx), @@ -174,7 +174,7 @@ func TestAccAppConfigConfigurationProfile_Validators_multiple(t *testing.T) { resourceName := "aws_appconfig_configuration_profile.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, appconfig.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckConfigurationProfileDestroy(ctx), @@ -210,7 +210,7 @@ func TestAccAppConfigConfigurationProfile_updateName(t *testing.T) { resourceName := "aws_appconfig_configuration_profile.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, appconfig.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckConfigurationProfileDestroy(ctx), @@ -245,7 +245,7 @@ func TestAccAppConfigConfigurationProfile_updateDescription(t *testing.T) { resourceName := "aws_appconfig_configuration_profile.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, appconfig.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckConfigurationProfileDestroy(ctx), @@ -284,7 +284,7 @@ func TestAccAppConfigConfigurationProfile_tags(t *testing.T) { resourceName := "aws_appconfig_configuration_profile.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, appconfig.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckConfigurationProfileDestroy(ctx), diff --git a/internal/service/appconfig/configuration_profiles_data_source_test.go b/internal/service/appconfig/configuration_profiles_data_source_test.go index 1e0d06ec8f75..11b506b26306 100644 --- a/internal/service/appconfig/configuration_profiles_data_source_test.go +++ b/internal/service/appconfig/configuration_profiles_data_source_test.go @@ -19,7 +19,7 @@ func TestAccAppConfigConfigurationProfilesDataSource_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(appconfig.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, appconfig.EndpointsID), diff --git a/internal/service/appconfig/deployment_strategy_test.go b/internal/service/appconfig/deployment_strategy_test.go index bd3b5ccdeba2..79d3f2092358 100644 --- a/internal/service/appconfig/deployment_strategy_test.go +++ b/internal/service/appconfig/deployment_strategy_test.go @@ -23,7 +23,7 @@ func TestAccAppConfigDeploymentStrategy_basic(t *testing.T) { resourceName := "aws_appconfig_deployment_strategy.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, appconfig.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDeploymentStrategyDestroy(ctx), @@ -56,7 +56,7 @@ func TestAccAppConfigDeploymentStrategy_updateDescription(t *testing.T) { resourceName := "aws_appconfig_deployment_strategy.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, appconfig.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDeploymentStrategyDestroy(ctx), @@ -90,7 +90,7 @@ func TestAccAppConfigDeploymentStrategy_updateFinalBakeTime(t *testing.T) { resourceName := "aws_appconfig_deployment_strategy.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, appconfig.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDeploymentStrategyDestroy(ctx), @@ -136,7 +136,7 @@ func TestAccAppConfigDeploymentStrategy_disappears(t *testing.T) { resourceName := "aws_appconfig_deployment_strategy.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, appconfig.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDeploymentStrategyDestroy(ctx), @@ -159,7 +159,7 @@ func TestAccAppConfigDeploymentStrategy_tags(t *testing.T) { resourceName := "aws_appconfig_deployment_strategy.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, appconfig.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDeploymentStrategyDestroy(ctx), diff --git a/internal/service/appconfig/deployment_test.go b/internal/service/appconfig/deployment_test.go index 7210a4ae3a89..e02e4805803b 100644 --- a/internal/service/appconfig/deployment_test.go +++ b/internal/service/appconfig/deployment_test.go @@ -27,7 +27,7 @@ func TestAccAppConfigDeployment_basic(t *testing.T) { confVersionResourceName := "aws_appconfig_hosted_configuration_version.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, appconfig.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, // AppConfig Deployments cannot be destroyed, but we want to ensure @@ -66,7 +66,7 @@ func TestAccAppConfigDeployment_predefinedStrategy(t *testing.T) { strategy := "AppConfig.Linear50PercentEvery30Seconds" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, appconfig.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, // AppConfig Deployments cannot be destroyed, but we want to ensure @@ -100,7 +100,7 @@ func TestAccAppConfigDeployment_tags(t *testing.T) { resourceName := "aws_appconfig_deployment.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, appconfig.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: nil, diff --git a/internal/service/appconfig/environment_data_source_test.go b/internal/service/appconfig/environment_data_source_test.go index 239504b9766b..3bdd028030c0 100644 --- a/internal/service/appconfig/environment_data_source_test.go +++ b/internal/service/appconfig/environment_data_source_test.go @@ -20,7 +20,7 @@ func TestAccAppConfigEnvironmentDataSource_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(appconfig.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, appconfig.EndpointsID), diff --git a/internal/service/appconfig/environment_test.go b/internal/service/appconfig/environment_test.go index 598512e0b298..2b0face6271c 100644 --- a/internal/service/appconfig/environment_test.go +++ b/internal/service/appconfig/environment_test.go @@ -24,7 +24,7 @@ func TestAccAppConfigEnvironment_basic(t *testing.T) { appResourceName := "aws_appconfig_application.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, appconfig.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckEnvironmentDestroy(ctx), @@ -56,7 +56,7 @@ func TestAccAppConfigEnvironment_disappears(t *testing.T) { resourceName := "aws_appconfig_environment.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, appconfig.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckEnvironmentDestroy(ctx), @@ -80,7 +80,7 @@ func TestAccAppConfigEnvironment_updateName(t *testing.T) { resourceName := "aws_appconfig_environment.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, appconfig.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckEnvironmentDestroy(ctx), @@ -114,7 +114,7 @@ func TestAccAppConfigEnvironment_updateDescription(t *testing.T) { resourceName := "aws_appconfig_environment.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, appconfig.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckEnvironmentDestroy(ctx), @@ -160,7 +160,7 @@ func TestAccAppConfigEnvironment_monitors(t *testing.T) { resourceName := "aws_appconfig_environment.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, appconfig.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckEnvironmentDestroy(ctx), @@ -218,7 +218,7 @@ func TestAccAppConfigEnvironment_multipleEnvironments(t *testing.T) { resourceName2 := "aws_appconfig_environment.test2" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, appconfig.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckEnvironmentDestroy(ctx), @@ -261,7 +261,7 @@ func TestAccAppConfigEnvironment_tags(t *testing.T) { resourceName := "aws_appconfig_environment.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, appconfig.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckEnvironmentDestroy(ctx), diff --git a/internal/service/appconfig/environments_data_source_test.go b/internal/service/appconfig/environments_data_source_test.go index 5de22ff4e65e..a68dde5deb93 100644 --- a/internal/service/appconfig/environments_data_source_test.go +++ b/internal/service/appconfig/environments_data_source_test.go @@ -19,7 +19,7 @@ func TestAccAppConfigEnvironmentsDataSource_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(appconfig.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, appconfig.EndpointsID), diff --git a/internal/service/appconfig/extension_test.go b/internal/service/appconfig/extension_test.go index d46f083d0375..8796c53fe6dd 100644 --- a/internal/service/appconfig/extension_test.go +++ b/internal/service/appconfig/extension_test.go @@ -23,7 +23,7 @@ func TestAccAppConfigExtension_basic(t *testing.T) { resourceName := "aws_appconfig_extension.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, appconfig.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckExtensionDestroy(ctx), @@ -54,7 +54,7 @@ func TestAccAppConfigExtension_ActionPoint(t *testing.T) { resourceName := "aws_appconfig_extension.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, appconfig.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckExtensionDestroy(ctx), @@ -125,7 +125,7 @@ func TestAccAppConfigExtension_Parameter(t *testing.T) { pRequiredFalse := "false" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, appconfig.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckExtensionDestroy(ctx), @@ -187,7 +187,7 @@ func TestAccAppConfigExtension_Name(t *testing.T) { resourceName := "aws_appconfig_extension.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, appconfig.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckExtensionDestroy(ctx), @@ -224,7 +224,7 @@ func TestAccAppConfigExtension_Description(t *testing.T) { resourceName := "aws_appconfig_extension.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, appconfig.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckExtensionDestroy(ctx), @@ -258,7 +258,7 @@ func TestAccAppConfigExtension_tags(t *testing.T) { resourceName := "aws_appconfig_extension.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, appconfig.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckExtensionDestroy(ctx), @@ -303,7 +303,7 @@ func TestAccAppConfigExtension_disappears(t *testing.T) { resourceName := "aws_appconfig_extension.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, appconfig.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckExtensionDestroy(ctx), diff --git a/internal/service/appconfig/extenstion_association_test.go b/internal/service/appconfig/extenstion_association_test.go index af316403fcf7..c57fd9fc0c6c 100644 --- a/internal/service/appconfig/extenstion_association_test.go +++ b/internal/service/appconfig/extenstion_association_test.go @@ -23,7 +23,7 @@ func TestAccAppConfigExtensionAssociation_basic(t *testing.T) { resourceName := "aws_appconfig_extension_association.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, appconfig.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckExtensionAssociationDestroy(ctx), @@ -59,7 +59,7 @@ func TestAccAppConfigExtensionAssociation_Parameters(t *testing.T) { pValue2 := "ParameterValue2" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, appconfig.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckExtensionAssociationDestroy(ctx), @@ -111,7 +111,7 @@ func TestAccAppConfigExtensionAssociation_disappears(t *testing.T) { resourceName := "aws_appconfig_extension_association.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, appconfig.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckExtensionAssociationDestroy(ctx), diff --git a/internal/service/appconfig/hosted_configuration_version_test.go b/internal/service/appconfig/hosted_configuration_version_test.go index 1340a97eb065..bba8e92d35df 100644 --- a/internal/service/appconfig/hosted_configuration_version_test.go +++ b/internal/service/appconfig/hosted_configuration_version_test.go @@ -23,7 +23,7 @@ func TestAccAppConfigHostedConfigurationVersion_basic(t *testing.T) { resourceName := "aws_appconfig_hosted_configuration_version.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, appconfig.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckHostedConfigurationVersionDestroy(ctx), @@ -56,7 +56,7 @@ func TestAccAppConfigHostedConfigurationVersion_disappears(t *testing.T) { resourceName := "aws_appconfig_hosted_configuration_version.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, appconfig.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckHostedConfigurationVersionDestroy(ctx), From 91db49e4ce3f9ea768db681b28128db0d958b31c Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Fri, 24 Feb 2023 16:36:32 -0500 Subject: [PATCH 089/763] Add 'Context' argument to 'acctest.PreCheck' for appflow. --- internal/service/appflow/connector_profile_test.go | 6 +++--- internal/service/appflow/flow_test.go | 10 +++++----- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/internal/service/appflow/connector_profile_test.go b/internal/service/appflow/connector_profile_test.go index e453816df1ef..d96fc1124e54 100644 --- a/internal/service/appflow/connector_profile_test.go +++ b/internal/service/appflow/connector_profile_test.go @@ -29,7 +29,7 @@ func TestAccAppFlowConnectorProfile_basic(t *testing.T) { resourceName := "aws_appflow_connector_profile.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, appflow.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckConnectorProfileDestroy(ctx), @@ -69,7 +69,7 @@ func TestAccAppFlowConnectorProfile_update(t *testing.T) { testPrefix := "test-prefix" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, appflow.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckConnectorProfileDestroy(ctx), @@ -103,7 +103,7 @@ func TestAccAppFlowConnectorProfile_disappears(t *testing.T) { resourceName := "aws_appflow_connector_profile.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, appflow.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckConnectorProfileDestroy(ctx), diff --git a/internal/service/appflow/flow_test.go b/internal/service/appflow/flow_test.go index 3dccea858c8b..cc9cff7ca23f 100644 --- a/internal/service/appflow/flow_test.go +++ b/internal/service/appflow/flow_test.go @@ -28,7 +28,7 @@ func TestAccAppFlowFlow_basic(t *testing.T) { scheduleStartTime := time.Now().UTC().AddDate(0, 0, 1).Format(time.RFC3339) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, appflow.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckFlowDestroy(ctx), @@ -79,7 +79,7 @@ func TestAccAppFlowFlow_update(t *testing.T) { scheduleStartTime := time.Now().UTC().AddDate(0, 0, 1).Format(time.RFC3339) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, appflow.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckFlowDestroy(ctx), @@ -116,7 +116,7 @@ func TestAccAppFlowFlow_TaskProperties(t *testing.T) { resourceName := "aws_appflow_flow.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, appflow.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckFlowDestroy(ctx), @@ -143,7 +143,7 @@ func TestAccAppFlowFlow_tags(t *testing.T) { resourceName := "aws_appflow_flow.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, appflow.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckFlowDestroy(ctx), @@ -192,7 +192,7 @@ func TestAccAppFlowFlow_disappears(t *testing.T) { scheduleStartTime := time.Now().UTC().AddDate(0, 0, 1).Format(time.RFC3339) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, appflow.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckFlowDestroy(ctx), From 2b6fab3f59a9ff1c92ec1a7509cd273869d7246c Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Fri, 24 Feb 2023 16:36:32 -0500 Subject: [PATCH 090/763] Add 'Context' argument to 'acctest.PreCheck' for appintegrations. --- internal/service/appintegrations/event_integration_test.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/internal/service/appintegrations/event_integration_test.go b/internal/service/appintegrations/event_integration_test.go index 4e46113ec5ce..6c45e9c96429 100644 --- a/internal/service/appintegrations/event_integration_test.go +++ b/internal/service/appintegrations/event_integration_test.go @@ -34,7 +34,7 @@ func TestAccAppIntegrationsEventIntegration_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(appintegrationsservice.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, appintegrationsservice.EndpointsID), @@ -93,7 +93,7 @@ func TestAccAppIntegrationsEventIntegration_updateTags(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(appintegrationsservice.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, appintegrationsservice.EndpointsID), @@ -173,7 +173,7 @@ func TestAccAppIntegrationsEventIntegration_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(appintegrationsservice.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, appintegrationsservice.EndpointsID), From ac04d6bbea522d33f35a41f63c27f3b68a33397e Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Fri, 24 Feb 2023 16:36:32 -0500 Subject: [PATCH 091/763] Add 'Context' argument to 'acctest.PreCheck' for applicationinsights. --- internal/service/applicationinsights/application_test.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/internal/service/applicationinsights/application_test.go b/internal/service/applicationinsights/application_test.go index 24c8e4f95988..e67ec308bf9a 100644 --- a/internal/service/applicationinsights/application_test.go +++ b/internal/service/applicationinsights/application_test.go @@ -23,7 +23,7 @@ func TestAccApplicationInsightsApplication_basic(t *testing.T) { resourceName := "aws_applicationinsights_application.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, applicationinsights.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckApplicationDestroy(ctx), @@ -68,7 +68,7 @@ func TestAccApplicationInsightsApplication_autoConfig(t *testing.T) { resourceName := "aws_applicationinsights_application.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, applicationinsights.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckApplicationDestroy(ctx), @@ -101,7 +101,7 @@ func TestAccApplicationInsightsApplication_tags(t *testing.T) { resourceName := "aws_applicationinsights_application.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, applicationinsights.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckApplicationDestroy(ctx), @@ -147,7 +147,7 @@ func TestAccApplicationInsightsApplication_disappears(t *testing.T) { resourceName := "aws_applicationinsights_application.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, applicationinsights.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckApplicationDestroy(ctx), From d2df63dda13d1b253586ffa181d408ce63192977 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Fri, 24 Feb 2023 16:36:33 -0500 Subject: [PATCH 092/763] Add 'Context' argument to 'acctest.PreCheck' for appmesh. --- .../service/appmesh/gateway_route_test.go | 18 +++++----- .../service/appmesh/mesh_data_source_test.go | 6 ++-- internal/service/appmesh/mesh_test.go | 6 ++-- internal/service/appmesh/route_test.go | 36 +++++++++---------- .../service/appmesh/virtual_gateway_test.go | 22 ++++++------ internal/service/appmesh/virtual_node_test.go | 32 ++++++++--------- .../service/appmesh/virtual_router_test.go | 8 ++--- .../virtual_service_data_source_test.go | 4 +-- .../service/appmesh/virtual_service_test.go | 8 ++--- 9 files changed, 70 insertions(+), 70 deletions(-) diff --git a/internal/service/appmesh/gateway_route_test.go b/internal/service/appmesh/gateway_route_test.go index 8f7bb70e9b28..5b1cdd5622e5 100644 --- a/internal/service/appmesh/gateway_route_test.go +++ b/internal/service/appmesh/gateway_route_test.go @@ -25,7 +25,7 @@ func testAccGatewayRoute_basic(t *testing.T) { grName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(appmesh.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(appmesh.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, appmesh.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckGatewayRouteDestroy(ctx), @@ -73,7 +73,7 @@ func testAccGatewayRoute_disappears(t *testing.T) { grName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(appmesh.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(appmesh.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, appmesh.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckGatewayRouteDestroy(ctx), @@ -101,7 +101,7 @@ func testAccGatewayRoute_GRPCRoute(t *testing.T) { grName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(appmesh.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(appmesh.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, appmesh.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckGatewayRouteDestroy(ctx), @@ -175,7 +175,7 @@ func testAccGatewayRoute_GRPCRouteWithPort(t *testing.T) { grName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(appmesh.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(appmesh.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, appmesh.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckGatewayRouteDestroy(ctx), @@ -251,7 +251,7 @@ func testAccGatewayRoute_HTTPRoute(t *testing.T) { grName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(appmesh.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(appmesh.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, appmesh.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckGatewayRouteDestroy(ctx), @@ -379,7 +379,7 @@ func testAccGatewayRoute_HTTPRouteWithPort(t *testing.T) { grName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(appmesh.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(appmesh.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, appmesh.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckGatewayRouteDestroy(ctx), @@ -509,7 +509,7 @@ func testAccGatewayRoute_HTTP2Route(t *testing.T) { grName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(appmesh.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(appmesh.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, appmesh.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckGatewayRouteDestroy(ctx), @@ -637,7 +637,7 @@ func testAccGatewayRoute_HTTP2RouteWithPort(t *testing.T) { grName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(appmesh.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(appmesh.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, appmesh.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckGatewayRouteDestroy(ctx), @@ -765,7 +765,7 @@ func testAccGatewayRoute_Tags(t *testing.T) { grName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(appmesh.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(appmesh.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, appmesh.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckGatewayRouteDestroy(ctx), diff --git a/internal/service/appmesh/mesh_data_source_test.go b/internal/service/appmesh/mesh_data_source_test.go index 72631683d744..5ead6af721e5 100644 --- a/internal/service/appmesh/mesh_data_source_test.go +++ b/internal/service/appmesh/mesh_data_source_test.go @@ -17,7 +17,7 @@ func TestAccAppMeshMeshDataSource_basic(t *testing.T) { dataSourceName := "data.aws_appmesh_mesh.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(appmesh.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(appmesh.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, appmesh.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckMeshDestroy(ctx), @@ -46,7 +46,7 @@ func TestAccAppMeshMeshDataSource_meshOwner(t *testing.T) { dataSourceName := "data.aws_appmesh_mesh.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(appmesh.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(appmesh.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, appmesh.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckMeshDestroy(ctx), @@ -75,7 +75,7 @@ func TestAccAppMeshMeshDataSource_specAndTagsSet(t *testing.T) { dataSourceName := "data.aws_appmesh_mesh.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(appmesh.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(appmesh.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, appmesh.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckMeshDestroy(ctx), diff --git a/internal/service/appmesh/mesh_test.go b/internal/service/appmesh/mesh_test.go index 58ab1450604c..1325eb31fada 100644 --- a/internal/service/appmesh/mesh_test.go +++ b/internal/service/appmesh/mesh_test.go @@ -23,7 +23,7 @@ func testAccMesh_basic(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(appmesh.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(appmesh.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, appmesh.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckMeshDestroy(ctx), @@ -56,7 +56,7 @@ func testAccMesh_egressFilter(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(appmesh.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(appmesh.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, appmesh.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckMeshDestroy(ctx), @@ -97,7 +97,7 @@ func testAccMesh_tags(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(appmesh.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(appmesh.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, appmesh.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckMeshDestroy(ctx), diff --git a/internal/service/appmesh/route_test.go b/internal/service/appmesh/route_test.go index c5f8792739a3..a3d348698921 100644 --- a/internal/service/appmesh/route_test.go +++ b/internal/service/appmesh/route_test.go @@ -27,7 +27,7 @@ func testAccRoute_grpcRoute(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(appmesh.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(appmesh.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, appmesh.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRouteDestroy(ctx), @@ -243,7 +243,7 @@ func testAccRoute_grpcRouteWithPortMatch(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(appmesh.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(appmesh.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, appmesh.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRouteDestroy(ctx), @@ -464,7 +464,7 @@ func testAccRoute_grpcRouteTimeout(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(appmesh.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(appmesh.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, appmesh.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRouteDestroy(ctx), @@ -564,7 +564,7 @@ func testAccRoute_grpcRouteEmptyMatch(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(appmesh.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(appmesh.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, appmesh.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRouteDestroy(ctx), @@ -618,7 +618,7 @@ func testAccRoute_http2Route(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(appmesh.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(appmesh.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, appmesh.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRouteDestroy(ctx), @@ -736,7 +736,7 @@ func testAccRoute_http2RouteWithPortMatch(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(appmesh.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(appmesh.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, appmesh.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRouteDestroy(ctx), @@ -858,7 +858,7 @@ func testAccRoute_http2RouteTimeout(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(appmesh.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(appmesh.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, appmesh.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRouteDestroy(ctx), @@ -962,7 +962,7 @@ func testAccRoute_httpRoute(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(appmesh.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(appmesh.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, appmesh.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRouteDestroy(ctx), @@ -1074,7 +1074,7 @@ func testAccRoute_httpRouteWithPortMatch(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(appmesh.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(appmesh.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, appmesh.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRouteDestroy(ctx), @@ -1191,7 +1191,7 @@ func testAccRoute_httpRouteTimeout(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(appmesh.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(appmesh.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, appmesh.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRouteDestroy(ctx), @@ -1287,7 +1287,7 @@ func testAccRoute_tcpRoute(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(appmesh.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(appmesh.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, appmesh.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRouteDestroy(ctx), @@ -1382,7 +1382,7 @@ func testAccRoute_tcpRouteWithPortMatch(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(appmesh.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(appmesh.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, appmesh.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRouteDestroy(ctx), @@ -1484,7 +1484,7 @@ func testAccRoute_tcpRouteTimeout(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(appmesh.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(appmesh.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, appmesh.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRouteDestroy(ctx), @@ -1564,7 +1564,7 @@ func testAccRoute_tags(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(appmesh.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(appmesh.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, appmesh.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRouteDestroy(ctx), @@ -1615,7 +1615,7 @@ func testAccRoute_httpHeader(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(appmesh.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(appmesh.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, appmesh.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRouteDestroy(ctx), @@ -1715,7 +1715,7 @@ func testAccRoute_routePriority(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(appmesh.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(appmesh.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, appmesh.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRouteDestroy(ctx), @@ -1799,7 +1799,7 @@ func testAccRoute_httpRetryPolicy(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(appmesh.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(appmesh.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, appmesh.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRouteDestroy(ctx), @@ -1932,7 +1932,7 @@ func testAccRoute_disappears(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(appmesh.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(appmesh.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, appmesh.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRouteDestroy(ctx), diff --git a/internal/service/appmesh/virtual_gateway_test.go b/internal/service/appmesh/virtual_gateway_test.go index a8b20fba50f5..9bc3e168a38f 100644 --- a/internal/service/appmesh/virtual_gateway_test.go +++ b/internal/service/appmesh/virtual_gateway_test.go @@ -24,7 +24,7 @@ func testAccVirtualGateway_basic(t *testing.T) { vgName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(appmesh.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(appmesh.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, appmesh.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckVirtualGatewayDestroy(ctx), @@ -70,7 +70,7 @@ func testAccVirtualGateway_disappears(t *testing.T) { vgName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(appmesh.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(appmesh.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, appmesh.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckVirtualGatewayDestroy(ctx), @@ -95,7 +95,7 @@ func testAccVirtualGateway_BackendDefaults(t *testing.T) { vgName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(appmesh.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(appmesh.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, appmesh.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckVirtualGatewayDestroy(ctx), @@ -189,7 +189,7 @@ func testAccVirtualGateway_BackendDefaultsCertificate(t *testing.T) { vgName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(appmesh.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(appmesh.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, appmesh.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckVirtualGatewayDestroy(ctx), @@ -254,7 +254,7 @@ func testAccVirtualGateway_ListenerConnectionPool(t *testing.T) { vgName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(appmesh.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(appmesh.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, appmesh.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckVirtualGatewayDestroy(ctx), @@ -332,7 +332,7 @@ func testAccVirtualGateway_ListenerHealthChecks(t *testing.T) { vgName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(appmesh.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(appmesh.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, appmesh.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckVirtualGatewayDestroy(ctx), @@ -420,7 +420,7 @@ func testAccVirtualGateway_ListenerTLS(t *testing.T) { domain := acctest.RandomDomainName() resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(appmesh.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(appmesh.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, appmesh.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckVirtualGatewayDestroy(ctx), @@ -525,7 +525,7 @@ func testAccVirtualGateway_ListenerValidation(t *testing.T) { vgName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(appmesh.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(appmesh.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, appmesh.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckVirtualGatewayDestroy(ctx), @@ -624,7 +624,7 @@ func testAccVirtualGateway_MultiListenerValidation(t *testing.T) { vgName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(appmesh.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(appmesh.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, appmesh.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckVirtualGatewayDestroy(ctx), @@ -773,7 +773,7 @@ func testAccVirtualGateway_Logging(t *testing.T) { vgName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(appmesh.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(appmesh.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, appmesh.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckVirtualGatewayDestroy(ctx), @@ -846,7 +846,7 @@ func testAccVirtualGateway_Tags(t *testing.T) { vgName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(appmesh.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(appmesh.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, appmesh.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckVirtualGatewayDestroy(ctx), diff --git a/internal/service/appmesh/virtual_node_test.go b/internal/service/appmesh/virtual_node_test.go index 53d22e9d1ab9..5ffe87d7f5ab 100644 --- a/internal/service/appmesh/virtual_node_test.go +++ b/internal/service/appmesh/virtual_node_test.go @@ -25,7 +25,7 @@ func testAccVirtualNode_basic(t *testing.T) { vnName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(appmesh.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(appmesh.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, appmesh.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckVirtualNodeDestroy(ctx), @@ -67,7 +67,7 @@ func testAccVirtualNode_disappears(t *testing.T) { vnName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(appmesh.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(appmesh.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, appmesh.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckVirtualNodeDestroy(ctx), @@ -96,7 +96,7 @@ func testAccVirtualNode_backendClientPolicyACM(t *testing.T) { domain := acctest.RandomDomainName() resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(appmesh.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(appmesh.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, appmesh.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckVirtualNodeDestroy(ctx), @@ -180,7 +180,7 @@ func testAccVirtualNode_backendClientPolicyFile(t *testing.T) { vnName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(appmesh.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(appmesh.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, appmesh.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckVirtualNodeDestroy(ctx), @@ -295,7 +295,7 @@ func testAccVirtualNode_backendDefaults(t *testing.T) { vnName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(appmesh.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(appmesh.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, appmesh.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckVirtualNodeDestroy(ctx), @@ -383,7 +383,7 @@ func testAccVirtualNode_backendDefaultsCertificate(t *testing.T) { vnName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(appmesh.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(appmesh.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, appmesh.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckVirtualNodeDestroy(ctx), @@ -448,7 +448,7 @@ func testAccVirtualNode_cloudMapServiceDiscovery(t *testing.T) { rName := fmt.Sprintf("tf-acc-test-%s", sdkacctest.RandStringFromCharSet(20, sdkacctest.CharSetAlpha)) resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(appmesh.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(appmesh.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, appmesh.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckVirtualNodeDestroy(ctx), @@ -501,7 +501,7 @@ func testAccVirtualNode_listenerConnectionPool(t *testing.T) { vnName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(appmesh.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(appmesh.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, appmesh.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckVirtualNodeDestroy(ctx), @@ -591,7 +591,7 @@ func testAccVirtualNode_listenerHealthChecks(t *testing.T) { vnName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(appmesh.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(appmesh.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, appmesh.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckVirtualNodeDestroy(ctx), @@ -700,7 +700,7 @@ func testAccVirtualNode_listenerOutlierDetection(t *testing.T) { vnName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(appmesh.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(appmesh.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, appmesh.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckVirtualNodeDestroy(ctx), @@ -795,7 +795,7 @@ func testAccVirtualNode_listenerTimeout(t *testing.T) { vnName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(appmesh.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(appmesh.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, appmesh.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckVirtualNodeDestroy(ctx), @@ -896,7 +896,7 @@ func testAccVirtualNode_listenerTLS(t *testing.T) { domain := acctest.RandomDomainName() resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(appmesh.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(appmesh.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, appmesh.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckVirtualNodeDestroy(ctx), @@ -1022,7 +1022,7 @@ func testAccVirtualNode_listenerValidation(t *testing.T) { vnName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(appmesh.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(appmesh.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, appmesh.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckVirtualNodeDestroy(ctx), @@ -1141,7 +1141,7 @@ func testAccVirtualNode_multiListenerValidation(t *testing.T) { vnName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(appmesh.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(appmesh.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, appmesh.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckVirtualNodeDestroy(ctx), @@ -1324,7 +1324,7 @@ func testAccVirtualNode_logging(t *testing.T) { vnName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(appmesh.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(appmesh.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, appmesh.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckVirtualNodeDestroy(ctx), @@ -1374,7 +1374,7 @@ func testAccVirtualNode_tags(t *testing.T) { vnName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(appmesh.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(appmesh.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, appmesh.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckVirtualNodeDestroy(ctx), diff --git a/internal/service/appmesh/virtual_router_test.go b/internal/service/appmesh/virtual_router_test.go index 19b788e5ef43..7943848c5e94 100644 --- a/internal/service/appmesh/virtual_router_test.go +++ b/internal/service/appmesh/virtual_router_test.go @@ -24,7 +24,7 @@ func testAccVirtualRouter_basic(t *testing.T) { vrName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(appmesh.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(appmesh.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, appmesh.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckVirtualRouterDestroy(ctx), @@ -79,7 +79,7 @@ func testAccVirtualRouter_multiListener(t *testing.T) { vrName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(appmesh.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(appmesh.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, appmesh.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckVirtualRouterDestroy(ctx), @@ -143,7 +143,7 @@ func testAccVirtualRouter_tags(t *testing.T) { vrName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(appmesh.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(appmesh.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, appmesh.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckVirtualRouterDestroy(ctx), @@ -198,7 +198,7 @@ func testAccVirtualRouter_disappears(t *testing.T) { vrName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(appmesh.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(appmesh.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, appmesh.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckVirtualRouterDestroy(ctx), diff --git a/internal/service/appmesh/virtual_service_data_source_test.go b/internal/service/appmesh/virtual_service_data_source_test.go index 5bd08aedf105..e2ebe10ddbd7 100644 --- a/internal/service/appmesh/virtual_service_data_source_test.go +++ b/internal/service/appmesh/virtual_service_data_source_test.go @@ -18,7 +18,7 @@ func TestAccAppMeshVirtualServiceDataSource_virtualNode(t *testing.T) { vsName := fmt.Sprintf("tf-acc-test-%d.mesh.local", sdkacctest.RandInt()) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(appmesh.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(appmesh.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, appmesh.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckVirtualServiceDestroy(ctx), @@ -49,7 +49,7 @@ func TestAccAppMeshVirtualServiceDataSource_virtualRouter(t *testing.T) { vsName := fmt.Sprintf("tf-acc-test-%d.mesh.local", sdkacctest.RandInt()) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(appmesh.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(appmesh.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, appmesh.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckVirtualServiceDestroy(ctx), diff --git a/internal/service/appmesh/virtual_service_test.go b/internal/service/appmesh/virtual_service_test.go index 8c23a0011224..a8f1be17af7a 100644 --- a/internal/service/appmesh/virtual_service_test.go +++ b/internal/service/appmesh/virtual_service_test.go @@ -26,7 +26,7 @@ func testAccVirtualService_virtualNode(t *testing.T) { vsName := fmt.Sprintf("tf-acc-test-%d.mesh.local", sdkacctest.RandInt()) resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(appmesh.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(appmesh.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, appmesh.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckVirtualServiceDestroy(ctx), @@ -81,7 +81,7 @@ func testAccVirtualService_virtualRouter(t *testing.T) { vsName := fmt.Sprintf("tf-acc-test-%d.mesh.local", sdkacctest.RandInt()) resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(appmesh.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(appmesh.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, appmesh.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckVirtualServiceDestroy(ctx), @@ -129,7 +129,7 @@ func testAccVirtualService_tags(t *testing.T) { vsName := fmt.Sprintf("tf-acc-test-%d.mesh.local", sdkacctest.RandInt()) resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(appmesh.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(appmesh.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, appmesh.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckVirtualServiceDestroy(ctx), @@ -186,7 +186,7 @@ func testAccVirtualService_disappears(t *testing.T) { vsName := fmt.Sprintf("tf-acc-test-%d.mesh.local", sdkacctest.RandInt()) resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(appmesh.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(appmesh.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, appmesh.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckVirtualServiceDestroy(ctx), From 27443f11ee1163680e10478acdbd6b0f8498836f Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Fri, 24 Feb 2023 16:36:33 -0500 Subject: [PATCH 093/763] Add 'Context' argument to 'acctest.PreCheck' for apprunner. --- ...auto_scaling_configuration_version_test.go | 12 +++++----- internal/service/apprunner/connection_test.go | 6 ++--- .../custom_domain_association_test.go | 4 ++-- ...bservability_configuration_version_test.go | 8 +++---- internal/service/apprunner/service_test.go | 24 +++++++++---------- .../service/apprunner/vpc_connector_test.go | 8 +++---- .../apprunner/vpc_ingress_connection_test.go | 6 ++--- 7 files changed, 34 insertions(+), 34 deletions(-) diff --git a/internal/service/apprunner/auto_scaling_configuration_version_test.go b/internal/service/apprunner/auto_scaling_configuration_version_test.go index f4bec7c855c7..1b92ea285f50 100644 --- a/internal/service/apprunner/auto_scaling_configuration_version_test.go +++ b/internal/service/apprunner/auto_scaling_configuration_version_test.go @@ -23,7 +23,7 @@ func TestAccAppRunnerAutoScalingConfigurationVersion_basic(t *testing.T) { resourceName := "aws_apprunner_auto_scaling_configuration_version.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, apprunner.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckAutoScalingConfigurationVersionDestroy(ctx), @@ -57,7 +57,7 @@ func TestAccAppRunnerAutoScalingConfigurationVersion_complex(t *testing.T) { resourceName := "aws_apprunner_auto_scaling_configuration_version.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, apprunner.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckAutoScalingConfigurationVersionDestroy(ctx), @@ -127,7 +127,7 @@ func TestAccAppRunnerAutoScalingConfigurationVersion_multipleVersions(t *testing otherResourceName := "aws_apprunner_auto_scaling_configuration_version.other" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, apprunner.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckAutoScalingConfigurationVersionDestroy(ctx), @@ -186,7 +186,7 @@ func TestAccAppRunnerAutoScalingConfigurationVersion_updateMultipleVersions(t *t otherResourceName := "aws_apprunner_auto_scaling_configuration_version.other" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, apprunner.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckAutoScalingConfigurationVersionDestroy(ctx), @@ -241,7 +241,7 @@ func TestAccAppRunnerAutoScalingConfigurationVersion_disappears(t *testing.T) { resourceName := "aws_apprunner_auto_scaling_configuration_version.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, apprunner.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckAutoScalingConfigurationVersionDestroy(ctx), @@ -264,7 +264,7 @@ func TestAccAppRunnerAutoScalingConfigurationVersion_tags(t *testing.T) { resourceName := "aws_apprunner_auto_scaling_configuration_version.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, apprunner.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckAutoScalingConfigurationVersionDestroy(ctx), diff --git a/internal/service/apprunner/connection_test.go b/internal/service/apprunner/connection_test.go index ae891202cf74..5e144d49a9e8 100644 --- a/internal/service/apprunner/connection_test.go +++ b/internal/service/apprunner/connection_test.go @@ -22,7 +22,7 @@ func TestAccAppRunnerConnection_basic(t *testing.T) { resourceName := "aws_apprunner_connection.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, apprunner.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckConnectionDestroy(ctx), @@ -53,7 +53,7 @@ func TestAccAppRunnerConnection_disappears(t *testing.T) { resourceName := "aws_apprunner_connection.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, apprunner.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckConnectionDestroy(ctx), @@ -76,7 +76,7 @@ func TestAccAppRunnerConnection_tags(t *testing.T) { resourceName := "aws_apprunner_connection.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, apprunner.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckConnectionDestroy(ctx), diff --git a/internal/service/apprunner/custom_domain_association_test.go b/internal/service/apprunner/custom_domain_association_test.go index e52ae9c93e87..6bf482e197ef 100644 --- a/internal/service/apprunner/custom_domain_association_test.go +++ b/internal/service/apprunner/custom_domain_association_test.go @@ -28,7 +28,7 @@ func TestAccAppRunnerCustomDomainAssociation_basic(t *testing.T) { serviceResourceName := "aws_apprunner_service.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, apprunner.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckCustomDomainAssociationDestroy(ctx), @@ -66,7 +66,7 @@ func TestAccAppRunnerCustomDomainAssociation_disappears(t *testing.T) { resourceName := "aws_apprunner_custom_domain_association.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, apprunner.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckCustomDomainAssociationDestroy(ctx), diff --git a/internal/service/apprunner/observability_configuration_version_test.go b/internal/service/apprunner/observability_configuration_version_test.go index c793b640b227..e35d2a382456 100644 --- a/internal/service/apprunner/observability_configuration_version_test.go +++ b/internal/service/apprunner/observability_configuration_version_test.go @@ -23,7 +23,7 @@ func TestAccAppRunnerObservabilityConfiguration_basic(t *testing.T) { resourceName := "aws_apprunner_observability_configuration.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, apprunner.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckObservabilityConfigurationDestroy(ctx), @@ -53,7 +53,7 @@ func TestAccAppRunnerObservabilityConfiguration_traceConfiguration(t *testing.T) resourceName := "aws_apprunner_observability_configuration.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, apprunner.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckObservabilityConfigurationDestroy(ctx), @@ -85,7 +85,7 @@ func TestAccAppRunnerObservabilityConfiguration_disappears(t *testing.T) { resourceName := "aws_apprunner_observability_configuration.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, apprunner.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckObservabilityConfigurationDestroy(ctx), @@ -108,7 +108,7 @@ func TestAccAppRunnerObservabilityConfiguration_tags(t *testing.T) { resourceName := "aws_apprunner_observability_configuration.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, apprunner.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckObservabilityConfigurationDestroy(ctx), diff --git a/internal/service/apprunner/service_test.go b/internal/service/apprunner/service_test.go index 99cf893bfcf4..f65528a6f03e 100644 --- a/internal/service/apprunner/service_test.go +++ b/internal/service/apprunner/service_test.go @@ -23,7 +23,7 @@ func TestAccAppRunnerService_ImageRepository_basic(t *testing.T) { resourceName := "aws_apprunner_service.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, apprunner.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckServiceDestroy(ctx), @@ -89,7 +89,7 @@ func TestAccAppRunnerService_ImageRepository_autoScaling(t *testing.T) { autoScalingResourceName := "aws_apprunner_auto_scaling_configuration_version.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, apprunner.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckServiceDestroy(ctx), @@ -123,7 +123,7 @@ func TestAccAppRunnerService_ImageRepository_encryption(t *testing.T) { kmsResourceName := "aws_kms_key.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, apprunner.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckServiceDestroy(ctx), @@ -159,7 +159,7 @@ func TestAccAppRunnerService_ImageRepository_healthCheck(t *testing.T) { resourceName := "aws_apprunner_service.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, apprunner.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckServiceDestroy(ctx), @@ -209,7 +209,7 @@ func TestAccAppRunnerService_ImageRepository_instance_NoInstanceRole(t *testing. resourceName := "aws_apprunner_service.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, apprunner.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckServiceDestroy(ctx), @@ -240,7 +240,7 @@ func TestAccAppRunnerService_ImageRepository_instance_Update(t *testing.T) { roleResourceName := "aws_iam_role.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, apprunner.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckServiceDestroy(ctx), @@ -296,7 +296,7 @@ func TestAccAppRunnerService_ImageRepository_networkConfiguration(t *testing.T) vpcConnectorResourceName := "aws_apprunner_vpc_connector.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, apprunner.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckServiceDestroy(ctx), @@ -330,7 +330,7 @@ func TestAccAppRunnerService_ImageRepository_observabilityConfiguration(t *testi observabilityConfigurationResourceName := "aws_apprunner_observability_configuration.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, apprunner.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckServiceDestroy(ctx), @@ -368,7 +368,7 @@ func TestAccAppRunnerService_ImageRepository_runtimeEnvironmentVars(t *testing.T resourceName := "aws_apprunner_service.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, apprunner.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckServiceDestroy(ctx), @@ -400,7 +400,7 @@ func TestAccAppRunnerService_ImageRepository_runtimeEnvironmentSecrets(t *testin ssmParameterResourceName := "aws_ssm_parameter.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, apprunner.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckServiceDestroy(ctx), @@ -431,7 +431,7 @@ func TestAccAppRunnerService_disappears(t *testing.T) { resourceName := "aws_apprunner_service.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, apprunner.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckServiceDestroy(ctx), @@ -454,7 +454,7 @@ func TestAccAppRunnerService_tags(t *testing.T) { resourceName := "aws_apprunner_service.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, apprunner.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckServiceDestroy(ctx), diff --git a/internal/service/apprunner/vpc_connector_test.go b/internal/service/apprunner/vpc_connector_test.go index 83cd276c1edb..48cbba0080e0 100644 --- a/internal/service/apprunner/vpc_connector_test.go +++ b/internal/service/apprunner/vpc_connector_test.go @@ -22,7 +22,7 @@ func TestAccAppRunnerVPCConnector_basic(t *testing.T) { resourceName := "aws_apprunner_vpc_connector.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckVPCConnector(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckVPCConnector(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, apprunner.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckVPCConnectorDestroy(ctx), @@ -53,7 +53,7 @@ func TestAccAppRunnerVPCConnector_disappears(t *testing.T) { resourceName := "aws_apprunner_vpc_connector.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckVPCConnector(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckVPCConnector(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, apprunner.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckVPCConnectorDestroy(ctx), @@ -76,7 +76,7 @@ func TestAccAppRunnerVPCConnector_tags(t *testing.T) { resourceName := "aws_apprunner_vpc_connector.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckVPCConnector(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckVPCConnector(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, apprunner.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckVPCConnectorDestroy(ctx), @@ -121,7 +121,7 @@ func TestAccAppRunnerVPCConnector_defaultTags(t *testing.T) { resourceName := "aws_apprunner_vpc_connector.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckVPCConnector(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckVPCConnector(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, apprunner.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckVPCConnectorDestroy(ctx), diff --git a/internal/service/apprunner/vpc_ingress_connection_test.go b/internal/service/apprunner/vpc_ingress_connection_test.go index 560b4bdfc6e6..74a616d495ba 100644 --- a/internal/service/apprunner/vpc_ingress_connection_test.go +++ b/internal/service/apprunner/vpc_ingress_connection_test.go @@ -26,7 +26,7 @@ func TestAccAppRunnerVPCIngressConnection_basic(t *testing.T) { appRunnerServiceResourceName := "aws_apprunner_service.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, apprunner.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckVPCIngressConnectionDestroy(ctx), @@ -59,7 +59,7 @@ func TestAccAppRunnerVPCIngressConnection_disappears(t *testing.T) { resourceName := "aws_apprunner_vpc_ingress_connection.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, apprunner.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckVPCIngressConnectionDestroy(ctx), @@ -82,7 +82,7 @@ func TestAccAppRunnerVPCIngressConnection_tags(t *testing.T) { resourceName := "aws_apprunner_vpc_ingress_connection.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, apprunner.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckVPCIngressConnectionDestroy(ctx), From a14dd3ba8768c940d52a96c3ebd5181da2a463d5 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Fri, 24 Feb 2023 16:36:34 -0500 Subject: [PATCH 094/763] Add 'Context' argument to 'acctest.PreCheck' for appstream. --- .../service/appstream/directory_config_test.go | 6 +++--- .../appstream/fleet_stack_association_test.go | 4 ++-- internal/service/appstream/fleet_test.go | 12 ++++++------ internal/service/appstream/image_builder_test.go | 12 ++++++------ internal/service/appstream/stack_test.go | 14 +++++++------- .../appstream/user_stack_association_test.go | 6 +++--- internal/service/appstream/user_test.go | 6 +++--- 7 files changed, 30 insertions(+), 30 deletions(-) diff --git a/internal/service/appstream/directory_config_test.go b/internal/service/appstream/directory_config_test.go index 011263d05245..a2fa2655dc85 100644 --- a/internal/service/appstream/directory_config_test.go +++ b/internal/service/appstream/directory_config_test.go @@ -30,7 +30,7 @@ func TestAccAppStreamDirectoryConfig_basic(t *testing.T) { orgUnitDN := orgUnitFromDomain("Test", domain) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDirectoryConfigDestroy(ctx), ErrorCheck: acctest.ErrorCheck(t, appstream.EndpointsID), @@ -83,7 +83,7 @@ func TestAccAppStreamDirectoryConfig_disappears(t *testing.T) { orgUnitDN := orgUnitFromDomain("Test", domain) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDirectoryConfigDestroy(ctx), ErrorCheck: acctest.ErrorCheck(t, appstream.EndpointsID), @@ -112,7 +112,7 @@ func TestAccAppStreamDirectoryConfig_OrganizationalUnitDistinguishedNames(t *tes orgUnitDN2 := orgUnitFromDomain("Two", domain) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDirectoryConfigDestroy(ctx), ErrorCheck: acctest.ErrorCheck(t, appstream.EndpointsID), diff --git a/internal/service/appstream/fleet_stack_association_test.go b/internal/service/appstream/fleet_stack_association_test.go index d591b4841a5c..4e994421a2b9 100644 --- a/internal/service/appstream/fleet_stack_association_test.go +++ b/internal/service/appstream/fleet_stack_association_test.go @@ -22,7 +22,7 @@ func TestAccAppStreamFleetStackAssociation_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckHasIAMRole(ctx, t, "AmazonAppStreamServiceAccess") }, ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, @@ -53,7 +53,7 @@ func TestAccAppStreamFleetStackAssociation_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckHasIAMRole(ctx, t, "AmazonAppStreamServiceAccess") }, ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, diff --git a/internal/service/appstream/fleet_test.go b/internal/service/appstream/fleet_test.go index c277636abe01..1b556050d1ba 100644 --- a/internal/service/appstream/fleet_test.go +++ b/internal/service/appstream/fleet_test.go @@ -37,7 +37,7 @@ func TestAccAppStreamFleet_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckHasIAMRole(ctx, t, "AmazonAppStreamServiceAccess") }, ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, @@ -73,7 +73,7 @@ func TestAccAppStreamFleet_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckHasIAMRole(ctx, t, "AmazonAppStreamServiceAccess") }, ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, @@ -105,7 +105,7 @@ func TestAccAppStreamFleet_completeWithStop(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckHasIAMRole(ctx, t, "AmazonAppStreamServiceAccess") }, ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, @@ -158,7 +158,7 @@ func TestAccAppStreamFleet_completeWithoutStop(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckHasIAMRole(ctx, t, "AmazonAppStreamServiceAccess") }, ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, @@ -212,7 +212,7 @@ func TestAccAppStreamFleet_withTags(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckHasIAMRole(ctx, t, "AmazonAppStreamServiceAccess") }, ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, @@ -267,7 +267,7 @@ func TestAccAppStreamFleet_emptyDomainJoin(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckHasIAMRole(ctx, t, "AmazonAppStreamServiceAccess") }, ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, diff --git a/internal/service/appstream/image_builder_test.go b/internal/service/appstream/image_builder_test.go index 7577775cca00..beed16254066 100644 --- a/internal/service/appstream/image_builder_test.go +++ b/internal/service/appstream/image_builder_test.go @@ -22,7 +22,7 @@ func TestAccAppStreamImageBuilder_basic(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckImageBuilderDestroy(ctx), ErrorCheck: acctest.ErrorCheck(t, appstream.EndpointsID), @@ -54,7 +54,7 @@ func TestAccAppStreamImageBuilder_withIAMRole(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, ErrorCheck: acctest.ErrorCheck(t, appstream.EndpointsID), CheckDestroy: testAccCheckImageBuilderDestroy(ctx), @@ -77,7 +77,7 @@ func TestAccAppStreamImageBuilder_disappears(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckImageBuilderDestroy(ctx), ErrorCheck: acctest.ErrorCheck(t, appstream.EndpointsID), @@ -104,7 +104,7 @@ func TestAccAppStreamImageBuilder_complete(t *testing.T) { instanceTypeUpdate := "stream.standard.medium" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckImageBuilderDestroy(ctx), ErrorCheck: acctest.ErrorCheck(t, appstream.EndpointsID), @@ -154,7 +154,7 @@ func TestAccAppStreamImageBuilder_tags(t *testing.T) { instanceType := "stream.standard.small" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckImageBuilderDestroy(ctx), ErrorCheck: acctest.ErrorCheck(t, appstream.EndpointsID), @@ -204,7 +204,7 @@ func TestAccAppStreamImageBuilder_imageARN(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckImageBuilderDestroy(ctx), ErrorCheck: acctest.ErrorCheck(t, appstream.EndpointsID), diff --git a/internal/service/appstream/stack_test.go b/internal/service/appstream/stack_test.go index 9f08340085df..8d580db92ac5 100644 --- a/internal/service/appstream/stack_test.go +++ b/internal/service/appstream/stack_test.go @@ -23,7 +23,7 @@ func TestAccAppStreamStack_basic(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckStackDestroy(ctx), ErrorCheck: acctest.ErrorCheck(t, appstream.EndpointsID), @@ -65,7 +65,7 @@ func TestAccAppStreamStack_disappears(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckStackDestroy(ctx), ErrorCheck: acctest.ErrorCheck(t, appstream.EndpointsID), @@ -91,7 +91,7 @@ func TestAccAppStreamStack_complete(t *testing.T) { descriptionUpdated := "Updated Description of a test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckStackDestroy(ctx), ErrorCheck: acctest.ErrorCheck(t, appstream.EndpointsID), @@ -149,7 +149,7 @@ func TestAccAppStreamStack_applicationSettings_basic(t *testing.T) { settingsGroupUpdated := "group-updated" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckStackDestroy(ctx), ErrorCheck: acctest.ErrorCheck(t, appstream.EndpointsID), @@ -208,7 +208,7 @@ func TestAccAppStreamStack_applicationSettings_removeFromEnabled(t *testing.T) { settingsGroup := "group" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckStackDestroy(ctx), ErrorCheck: acctest.ErrorCheck(t, appstream.EndpointsID), @@ -247,7 +247,7 @@ func TestAccAppStreamStack_applicationSettings_removeFromDisabled(t *testing.T) rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckStackDestroy(ctx), ErrorCheck: acctest.ErrorCheck(t, appstream.EndpointsID), @@ -278,7 +278,7 @@ func TestAccAppStreamStack_withTags(t *testing.T) { descriptionUpdated := "Updated Description of a test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckStackDestroy(ctx), ErrorCheck: acctest.ErrorCheck(t, appstream.EndpointsID), diff --git a/internal/service/appstream/user_stack_association_test.go b/internal/service/appstream/user_stack_association_test.go index 68198b8cd7cf..b206a2f8cd7b 100644 --- a/internal/service/appstream/user_stack_association_test.go +++ b/internal/service/appstream/user_stack_association_test.go @@ -26,7 +26,7 @@ func TestAccAppStreamUserStackAssociation_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) }, ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckUserStackAssociationDestroy(ctx), @@ -60,7 +60,7 @@ func TestAccAppStreamUserStackAssociation_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) }, ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckUserStackAssociationDestroy(ctx), @@ -89,7 +89,7 @@ func TestAccAppStreamUserStackAssociation_complete(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) }, ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckUserStackAssociationDestroy(ctx), diff --git a/internal/service/appstream/user_test.go b/internal/service/appstream/user_test.go index abb3a0fac14b..c8da2bba99ce 100644 --- a/internal/service/appstream/user_test.go +++ b/internal/service/appstream/user_test.go @@ -26,7 +26,7 @@ func TestAccAppStreamUser_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) }, ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckUserDestroy(ctx), @@ -62,7 +62,7 @@ func TestAccAppStreamUser_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) }, ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckUserDestroy(ctx), @@ -92,7 +92,7 @@ func TestAccAppStreamUser_complete(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) }, ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckUserDestroy(ctx), From 0524f07e10ff49ea668f2d394fe448ccf9f2ff31 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Fri, 24 Feb 2023 16:36:34 -0500 Subject: [PATCH 095/763] Add 'Context' argument to 'acctest.PreCheck' for appsync. --- internal/service/appsync/api_cache_test.go | 4 +- internal/service/appsync/api_key_test.go | 6 +- internal/service/appsync/datasource_test.go | 30 +++++----- .../domain_name_api_association_test.go | 4 +- internal/service/appsync/domain_name_test.go | 6 +- internal/service/appsync/function_test.go | 12 ++-- internal/service/appsync/graphql_api_test.go | 60 +++++++++---------- internal/service/appsync/resolver_test.go | 22 +++---- internal/service/appsync/type_test.go | 4 +- 9 files changed, 74 insertions(+), 74 deletions(-) diff --git a/internal/service/appsync/api_cache_test.go b/internal/service/appsync/api_cache_test.go index 187cf5562d19..d2623ff5415f 100644 --- a/internal/service/appsync/api_cache_test.go +++ b/internal/service/appsync/api_cache_test.go @@ -22,7 +22,7 @@ func testAccAPICache_basic(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(appsync.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(appsync.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, appsync.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckAPICacheDestroy(ctx), @@ -52,7 +52,7 @@ func testAccAPICache_disappears(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(appsync.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(appsync.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, appsync.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckAPICacheDestroy(ctx), diff --git a/internal/service/appsync/api_key_test.go b/internal/service/appsync/api_key_test.go index e4676c3c568f..1454089763b3 100644 --- a/internal/service/appsync/api_key_test.go +++ b/internal/service/appsync/api_key_test.go @@ -26,7 +26,7 @@ func testAccAPIKey_basic(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(appsync.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(appsync.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, appsync.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckAPIKeyDestroy(ctx), @@ -56,7 +56,7 @@ func testAccAPIKey_description(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(appsync.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(appsync.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, appsync.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckAPIKeyDestroy(ctx), @@ -93,7 +93,7 @@ func testAccAPIKey_expires(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(appsync.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(appsync.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, appsync.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckAPIKeyDestroy(ctx), diff --git a/internal/service/appsync/datasource_test.go b/internal/service/appsync/datasource_test.go index d351d567ec2c..1203cee5139a 100644 --- a/internal/service/appsync/datasource_test.go +++ b/internal/service/appsync/datasource_test.go @@ -23,7 +23,7 @@ func testAccDataSource_basic(t *testing.T) { resourceName := "aws_appsync_datasource.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(appsync.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(appsync.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, appsync.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDataSourceDestroy(ctx), @@ -58,7 +58,7 @@ func testAccDataSource_description(t *testing.T) { resourceName := "aws_appsync_datasource.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(appsync.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(appsync.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, appsync.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDataSourceDestroy(ctx), @@ -92,7 +92,7 @@ func testAccDataSource_DynamoDB_region(t *testing.T) { resourceName := "aws_appsync_datasource.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(appsync.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(appsync.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, appsync.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDataSourceDestroy(ctx), @@ -128,7 +128,7 @@ func testAccDataSource_DynamoDB_useCallerCredentials(t *testing.T) { resourceName := "aws_appsync_datasource.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(appsync.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(appsync.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, appsync.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDataSourceDestroy(ctx), @@ -165,7 +165,7 @@ func TestAccAppSyncDataSource_Elasticsearch_region(t *testing.T) { // Keep this test Parallel as it takes considerably longer to run than any non-Elasticsearch tests. resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(appsync.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(appsync.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, appsync.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDataSourceDestroy(ctx), @@ -201,7 +201,7 @@ func testAccDataSource_HTTP_endpoint(t *testing.T) { resourceName := "aws_appsync_datasource.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(appsync.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(appsync.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, appsync.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDataSourceDestroy(ctx), @@ -239,7 +239,7 @@ func testAccDataSource_type(t *testing.T) { resourceName := "aws_appsync_datasource.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(appsync.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(appsync.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, appsync.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDataSourceDestroy(ctx), @@ -270,7 +270,7 @@ func testAccDataSource_Type_dynamoDB(t *testing.T) { resourceName := "aws_appsync_datasource.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(appsync.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(appsync.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, appsync.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDataSourceDestroy(ctx), @@ -303,7 +303,7 @@ func TestAccAppSyncDataSource_Type_elasticSearch(t *testing.T) { // Keep this test Parallel as it takes considerably longer to run than any non-Elasticsearch tests. resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(appsync.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(appsync.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, appsync.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDataSourceDestroy(ctx), @@ -334,7 +334,7 @@ func testAccDataSource_Type_http(t *testing.T) { resourceName := "aws_appsync_datasource.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(appsync.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(appsync.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, appsync.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDataSourceDestroy(ctx), @@ -363,7 +363,7 @@ func testAccDataSource_Type_httpAuth(t *testing.T) { resourceName := "aws_appsync_datasource.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(appsync.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(appsync.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, appsync.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDataSourceDestroy(ctx), @@ -397,7 +397,7 @@ func testAccDataSource_Type_relationalDatabase(t *testing.T) { resourceName := "aws_appsync_datasource.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(appsync.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(appsync.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, appsync.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDataSourceDestroy(ctx), @@ -426,7 +426,7 @@ func testAccDataSource_Type_relationalDatabaseWithOptions(t *testing.T) { resourceName := "aws_appsync_datasource.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(appsync.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(appsync.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, appsync.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDataSourceDestroy(ctx), @@ -459,7 +459,7 @@ func testAccDataSource_Type_lambda(t *testing.T) { resourceName := "aws_appsync_datasource.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(appsync.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(appsync.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, appsync.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDataSourceDestroy(ctx), @@ -489,7 +489,7 @@ func testAccDataSource_Type_none(t *testing.T) { resourceName := "aws_appsync_datasource.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(appsync.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(appsync.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, appsync.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDataSourceDestroy(ctx), diff --git a/internal/service/appsync/domain_name_api_association_test.go b/internal/service/appsync/domain_name_api_association_test.go index 40c236fae5c6..87dabe7cbb40 100644 --- a/internal/service/appsync/domain_name_api_association_test.go +++ b/internal/service/appsync/domain_name_api_association_test.go @@ -25,7 +25,7 @@ func testAccDomainNameAPIAssociation_basic(t *testing.T) { resourceName := "aws_appsync_domain_name_api_association.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(appsync.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(appsync.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, appsync.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5FactoriesAlternate(ctx, t), CheckDestroy: testAccCheckDomainNameAPIAssociationDestroy(ctx), @@ -64,7 +64,7 @@ func testAccDomainNameAPIAssociation_disappears(t *testing.T) { resourceName := "aws_appsync_domain_name_api_association.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(appsync.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(appsync.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, appsync.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5FactoriesAlternate(ctx, t), CheckDestroy: testAccCheckDomainNameAPIAssociationDestroy(ctx), diff --git a/internal/service/appsync/domain_name_test.go b/internal/service/appsync/domain_name_test.go index 0508e8a9def3..c88ab4c9f7c2 100644 --- a/internal/service/appsync/domain_name_test.go +++ b/internal/service/appsync/domain_name_test.go @@ -26,7 +26,7 @@ func testAccDomainName_basic(t *testing.T) { resourceName := "aws_appsync_domain_name.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(appsync.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(appsync.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, appsync.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5FactoriesAlternate(ctx, t), CheckDestroy: testAccCheckDomainNameDestroy(ctx), @@ -57,7 +57,7 @@ func testAccDomainName_description(t *testing.T) { resourceName := "aws_appsync_domain_name.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(appsync.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(appsync.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, appsync.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5FactoriesAlternate(ctx, t), CheckDestroy: testAccCheckDomainNameDestroy(ctx), @@ -94,7 +94,7 @@ func testAccDomainName_disappears(t *testing.T) { resourceName := "aws_appsync_domain_name.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(appsync.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(appsync.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, appsync.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5FactoriesAlternate(ctx, t), CheckDestroy: testAccCheckDomainNameDestroy(ctx), diff --git a/internal/service/appsync/function_test.go b/internal/service/appsync/function_test.go index 1ca62d77c456..cd8e96b80eb3 100644 --- a/internal/service/appsync/function_test.go +++ b/internal/service/appsync/function_test.go @@ -26,7 +26,7 @@ func testAccFunction_basic(t *testing.T) { var config appsync.FunctionConfiguration resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(appsync.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(appsync.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, appsync.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckFunctionDestroy(ctx), @@ -69,7 +69,7 @@ func testAccFunction_code(t *testing.T) { var config appsync.FunctionConfiguration resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(appsync.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(appsync.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, appsync.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckFunctionDestroy(ctx), @@ -112,7 +112,7 @@ func testAccFunction_syncConfig(t *testing.T) { var config appsync.FunctionConfiguration resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(appsync.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(appsync.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, appsync.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckFunctionDestroy(ctx), @@ -143,7 +143,7 @@ func testAccFunction_description(t *testing.T) { var config appsync.FunctionConfiguration resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(appsync.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(appsync.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, appsync.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckFunctionDestroy(ctx), @@ -179,7 +179,7 @@ func testAccFunction_responseMappingTemplate(t *testing.T) { var config appsync.FunctionConfiguration resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(appsync.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(appsync.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, appsync.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckFunctionDestroy(ctx), @@ -207,7 +207,7 @@ func testAccFunction_disappears(t *testing.T) { var config appsync.FunctionConfiguration resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(appsync.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(appsync.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, appsync.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckFunctionDestroy(ctx), diff --git a/internal/service/appsync/graphql_api_test.go b/internal/service/appsync/graphql_api_test.go index 43275f865b56..b52ffd120cc1 100644 --- a/internal/service/appsync/graphql_api_test.go +++ b/internal/service/appsync/graphql_api_test.go @@ -25,7 +25,7 @@ func testAccGraphQLAPI_basic(t *testing.T) { resourceName := "aws_appsync_graphql_api.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(appsync.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(appsync.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, appsync.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckGraphQLAPIDestroy(ctx), @@ -64,7 +64,7 @@ func testAccGraphQLAPI_disappears(t *testing.T) { resourceName := "aws_appsync_graphql_api.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(appsync.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(appsync.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, appsync.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckGraphQLAPIDestroy(ctx), @@ -88,7 +88,7 @@ func testAccGraphQLAPI_schema(t *testing.T) { resourceName := "aws_appsync_graphql_api.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(appsync.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(appsync.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, appsync.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckGraphQLAPIDestroy(ctx), @@ -135,7 +135,7 @@ func testAccGraphQLAPI_authenticationType(t *testing.T) { resourceName := "aws_appsync_graphql_api.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(appsync.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(appsync.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, appsync.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckGraphQLAPIDestroy(ctx), @@ -170,7 +170,7 @@ func testAccGraphQLAPI_AuthenticationType_apiKey(t *testing.T) { resourceName := "aws_appsync_graphql_api.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(appsync.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(appsync.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, appsync.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckGraphQLAPIDestroy(ctx), @@ -200,7 +200,7 @@ func testAccGraphQLAPI_AuthenticationType_iam(t *testing.T) { resourceName := "aws_appsync_graphql_api.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(appsync.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(appsync.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, appsync.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckGraphQLAPIDestroy(ctx), @@ -231,7 +231,7 @@ func testAccGraphQLAPI_AuthenticationType_amazonCognitoUserPools(t *testing.T) { resourceName := "aws_appsync_graphql_api.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(appsync.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(appsync.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, appsync.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckGraphQLAPIDestroy(ctx), @@ -263,7 +263,7 @@ func testAccGraphQLAPI_AuthenticationType_openIDConnect(t *testing.T) { resourceName := "aws_appsync_graphql_api.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(appsync.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(appsync.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, appsync.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckGraphQLAPIDestroy(ctx), @@ -294,7 +294,7 @@ func testAccGraphQLAPI_AuthenticationType_lambda(t *testing.T) { lambdaAuthorizerResourceName := "aws_lambda_function.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(appsync.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(appsync.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, appsync.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckGraphQLAPIDestroy(ctx), @@ -327,7 +327,7 @@ func testAccGraphQLAPI_log(t *testing.T) { resourceName := "aws_appsync_graphql_api.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(appsync.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(appsync.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, appsync.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckGraphQLAPIDestroy(ctx), @@ -359,7 +359,7 @@ func testAccGraphQLAPI_Log_fieldLogLevel(t *testing.T) { resourceName := "aws_appsync_graphql_api.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(appsync.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(appsync.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, appsync.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckGraphQLAPIDestroy(ctx), @@ -411,7 +411,7 @@ func testAccGraphQLAPI_Log_excludeVerboseContent(t *testing.T) { resourceName := "aws_appsync_graphql_api.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(appsync.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(appsync.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, appsync.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckGraphQLAPIDestroy(ctx), @@ -453,7 +453,7 @@ func testAccGraphQLAPI_OpenIDConnect_authTTL(t *testing.T) { resourceName := "aws_appsync_graphql_api.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(appsync.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(appsync.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, appsync.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckGraphQLAPIDestroy(ctx), @@ -494,7 +494,7 @@ func testAccGraphQLAPI_OpenIDConnect_clientID(t *testing.T) { resourceName := "aws_appsync_graphql_api.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(appsync.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(appsync.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, appsync.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckGraphQLAPIDestroy(ctx), @@ -535,7 +535,7 @@ func testAccGraphQLAPI_OpenIDConnect_iatTTL(t *testing.T) { resourceName := "aws_appsync_graphql_api.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(appsync.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(appsync.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, appsync.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckGraphQLAPIDestroy(ctx), @@ -576,7 +576,7 @@ func testAccGraphQLAPI_OpenIDConnect_issuer(t *testing.T) { resourceName := "aws_appsync_graphql_api.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(appsync.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(appsync.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, appsync.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckGraphQLAPIDestroy(ctx), @@ -616,7 +616,7 @@ func testAccGraphQLAPI_name(t *testing.T) { resourceName := "aws_appsync_graphql_api.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(appsync.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(appsync.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, appsync.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckGraphQLAPIDestroy(ctx), @@ -647,7 +647,7 @@ func testAccGraphQLAPI_UserPool_region(t *testing.T) { resourceName := "aws_appsync_graphql_api.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(appsync.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(appsync.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, appsync.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckGraphQLAPIDestroy(ctx), @@ -691,7 +691,7 @@ func testAccGraphQLAPI_UserPool_defaultAction(t *testing.T) { resourceName := "aws_appsync_graphql_api.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(appsync.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(appsync.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, appsync.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckGraphQLAPIDestroy(ctx), @@ -735,7 +735,7 @@ func testAccGraphQLAPI_LambdaAuthorizerConfig_authorizerURI(t *testing.T) { lambdaAuthorizerResourceName := "aws_lambda_function.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(appsync.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(appsync.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, appsync.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckGraphQLAPIDestroy(ctx), @@ -775,7 +775,7 @@ func testAccGraphQLAPI_LambdaAuthorizerConfig_identityValidationExpression(t *te lambdaAuthorizerResourceName := "aws_lambda_function.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(appsync.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(appsync.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, appsync.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckGraphQLAPIDestroy(ctx), @@ -816,7 +816,7 @@ func testAccGraphQLAPI_LambdaAuthorizerConfig_authorizerResultTTLInSeconds(t *te resourceName := "aws_appsync_graphql_api.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(appsync.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(appsync.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, appsync.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckGraphQLAPIDestroy(ctx), @@ -873,7 +873,7 @@ func testAccGraphQLAPI_tags(t *testing.T) { resourceName := "aws_appsync_graphql_api.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(appsync.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(appsync.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, appsync.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckGraphQLAPIDestroy(ctx), @@ -915,7 +915,7 @@ func testAccGraphQLAPI_AdditionalAuthentication_apiKey(t *testing.T) { resourceName := "aws_appsync_graphql_api.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(appsync.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(appsync.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, appsync.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckGraphQLAPIDestroy(ctx), @@ -950,7 +950,7 @@ func testAccGraphQLAPI_AdditionalAuthentication_iam(t *testing.T) { resourceName := "aws_appsync_graphql_api.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(appsync.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(appsync.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, appsync.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckGraphQLAPIDestroy(ctx), @@ -986,7 +986,7 @@ func testAccGraphQLAPI_AdditionalAuthentication_cognitoUserPools(t *testing.T) { resourceName := "aws_appsync_graphql_api.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(appsync.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(appsync.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, appsync.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckGraphQLAPIDestroy(ctx), @@ -1022,7 +1022,7 @@ func testAccGraphQLAPI_AdditionalAuthentication_openIDConnect(t *testing.T) { resourceName := "aws_appsync_graphql_api.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(appsync.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(appsync.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, appsync.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckGraphQLAPIDestroy(ctx), @@ -1059,7 +1059,7 @@ func testAccGraphQLAPI_AdditionalAuthentication_lambda(t *testing.T) { lambdaAuthorizerResourceName := "aws_lambda_function.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(appsync.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(appsync.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, appsync.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckGraphQLAPIDestroy(ctx), @@ -1099,7 +1099,7 @@ func testAccGraphQLAPI_AdditionalAuthentication_multiple(t *testing.T) { resourceName := "aws_appsync_graphql_api.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(appsync.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(appsync.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, appsync.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckGraphQLAPIDestroy(ctx), @@ -1149,7 +1149,7 @@ func testAccGraphQLAPI_xrayEnabled(t *testing.T) { resourceName := "aws_appsync_graphql_api.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(appsync.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(appsync.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, appsync.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckGraphQLAPIDestroy(ctx), diff --git a/internal/service/appsync/resolver_test.go b/internal/service/appsync/resolver_test.go index 4908da7ad0b5..600744b8c515 100644 --- a/internal/service/appsync/resolver_test.go +++ b/internal/service/appsync/resolver_test.go @@ -24,7 +24,7 @@ func testAccResolver_basic(t *testing.T) { resourceName := "aws_appsync_resolver.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(appsync.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(appsync.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, appsync.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckResolverDestroy(ctx), @@ -57,7 +57,7 @@ func testAccResolver_code(t *testing.T) { resourceName := "aws_appsync_resolver.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(appsync.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(appsync.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, appsync.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckResolverDestroy(ctx), @@ -87,7 +87,7 @@ func testAccResolver_syncConfig(t *testing.T) { resourceName := "aws_appsync_resolver.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(appsync.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(appsync.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, appsync.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckResolverDestroy(ctx), @@ -119,7 +119,7 @@ func testAccResolver_disappears(t *testing.T) { resourceName := "aws_appsync_resolver.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(appsync.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(appsync.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, appsync.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckResolverDestroy(ctx), @@ -144,7 +144,7 @@ func testAccResolver_dataSource(t *testing.T) { resourceName := "aws_appsync_resolver.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(appsync.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(appsync.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, appsync.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckResolverDestroy(ctx), @@ -179,7 +179,7 @@ func testAccResolver_DataSource_lambda(t *testing.T) { resourceName := "aws_appsync_resolver.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(appsync.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(appsync.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, appsync.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckResolverDestroy(ctx), @@ -207,7 +207,7 @@ func testAccResolver_requestTemplate(t *testing.T) { resourceName := "aws_appsync_resolver.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(appsync.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(appsync.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, appsync.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckResolverDestroy(ctx), @@ -242,7 +242,7 @@ func testAccResolver_responseTemplate(t *testing.T) { resourceName := "aws_appsync_resolver.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(appsync.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(appsync.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, appsync.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckResolverDestroy(ctx), @@ -277,7 +277,7 @@ func testAccResolver_multipleResolvers(t *testing.T) { resourceName := "aws_appsync_resolver.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(appsync.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(appsync.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, appsync.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckResolverDestroy(ctx), @@ -308,7 +308,7 @@ func testAccResolver_pipeline(t *testing.T) { resourceName := "aws_appsync_resolver.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(appsync.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(appsync.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, appsync.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckResolverDestroy(ctx), @@ -337,7 +337,7 @@ func testAccResolver_caching(t *testing.T) { resourceName := "aws_appsync_resolver.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(appsync.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(appsync.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, appsync.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckResolverDestroy(ctx), diff --git a/internal/service/appsync/type_test.go b/internal/service/appsync/type_test.go index 6a69dd16d6a2..289e71da9be6 100644 --- a/internal/service/appsync/type_test.go +++ b/internal/service/appsync/type_test.go @@ -23,7 +23,7 @@ func testAccType_basic(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(appsync.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(appsync.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, appsync.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTypeDestroy(ctx), @@ -54,7 +54,7 @@ func testAccType_disappears(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(appsync.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(appsync.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, appsync.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTypeDestroy(ctx), From 163a5a56115d7e1896c0bdfa84cc3c58ab61cc5a Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Fri, 24 Feb 2023 16:36:34 -0500 Subject: [PATCH 096/763] Add 'Context' argument to 'acctest.PreCheck' for athena. --- internal/service/athena/data_catalog_test.go | 14 ++++---- internal/service/athena/database_test.go | 22 ++++++------- internal/service/athena/named_query_test.go | 4 +-- internal/service/athena/workgroup_test.go | 34 ++++++++++---------- 4 files changed, 37 insertions(+), 37 deletions(-) diff --git a/internal/service/athena/data_catalog_test.go b/internal/service/athena/data_catalog_test.go index 315fd64355b3..9ca99f9ed22a 100644 --- a/internal/service/athena/data_catalog_test.go +++ b/internal/service/athena/data_catalog_test.go @@ -22,7 +22,7 @@ func TestAccAthenaDataCatalog_basic(t *testing.T) { resourceName := "aws_athena_data_catalog.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, athena.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDataCatalogDestroy(ctx), @@ -56,7 +56,7 @@ func TestAccAthenaDataCatalog_disappears(t *testing.T) { resourceName := "aws_athena_data_catalog.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, athena.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDataCatalogDestroy(ctx), @@ -79,7 +79,7 @@ func TestAccAthenaDataCatalog_tags(t *testing.T) { resourceName := "aws_athena_data_catalog.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, athena.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDataCatalogDestroy(ctx), @@ -125,7 +125,7 @@ func TestAccAthenaDataCatalog_type_lambda(t *testing.T) { resourceName := "aws_athena_data_catalog.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, athena.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDataCatalogDestroy(ctx), @@ -157,7 +157,7 @@ func TestAccAthenaDataCatalog_type_hive(t *testing.T) { resourceName := "aws_athena_data_catalog.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, athena.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDataCatalogDestroy(ctx), @@ -188,7 +188,7 @@ func TestAccAthenaDataCatalog_type_glue(t *testing.T) { resourceName := "aws_athena_data_catalog.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, athena.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDataCatalogDestroy(ctx), @@ -219,7 +219,7 @@ func TestAccAthenaDataCatalog_parameters(t *testing.T) { resourceName := "aws_athena_data_catalog.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, athena.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDataCatalogDestroy(ctx), diff --git a/internal/service/athena/database_test.go b/internal/service/athena/database_test.go index 447f2e26f29f..bf32c096dd32 100644 --- a/internal/service/athena/database_test.go +++ b/internal/service/athena/database_test.go @@ -23,7 +23,7 @@ func TestAccAthenaDatabase_basic(t *testing.T) { resourceName := "aws_athena_database.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, athena.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDatabaseDestroy(ctx), @@ -56,7 +56,7 @@ func TestAccAthenaDatabase_properties(t *testing.T) { resourceName := "aws_athena_database.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, athena.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDatabaseDestroy(ctx), @@ -87,7 +87,7 @@ func TestAccAthenaDatabase_acl(t *testing.T) { resourceName := "aws_athena_database.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, athena.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDatabaseDestroy(ctx), @@ -118,7 +118,7 @@ func TestAccAthenaDatabase_encryption(t *testing.T) { resourceName := "aws_athena_database.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, athena.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDatabaseDestroy(ctx), @@ -149,7 +149,7 @@ func TestAccAthenaDatabase_nameStartsWithUnderscore(t *testing.T) { resourceName := "aws_athena_database.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, athena.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDatabaseDestroy(ctx), @@ -177,7 +177,7 @@ func TestAccAthenaDatabase_nameCantHaveUppercase(t *testing.T) { dbName := "A" + sdkacctest.RandString(8) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, athena.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDatabaseDestroy(ctx), @@ -196,7 +196,7 @@ func TestAccAthenaDatabase_destroyFailsIfTablesExist(t *testing.T) { dbName := sdkacctest.RandString(8) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, athena.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDatabaseDestroy(ctx), @@ -220,7 +220,7 @@ func TestAccAthenaDatabase_forceDestroyAlwaysSucceeds(t *testing.T) { dbName := sdkacctest.RandString(8) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, athena.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDatabaseDestroy(ctx), @@ -243,7 +243,7 @@ func TestAccAthenaDatabase_description(t *testing.T) { resourceName := "aws_athena_database.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, athena.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDatabaseDestroy(ctx), @@ -273,7 +273,7 @@ func TestAccAthenaDatabase_unescaped_description(t *testing.T) { resourceName := "aws_athena_database.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, athena.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDatabaseDestroy(ctx), @@ -303,7 +303,7 @@ func TestAccAthenaDatabase_disppears(t *testing.T) { resourceName := "aws_athena_database.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, athena.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDatabaseDestroy(ctx), diff --git a/internal/service/athena/named_query_test.go b/internal/service/athena/named_query_test.go index 5e04d641b498..1c95388d475d 100644 --- a/internal/service/athena/named_query_test.go +++ b/internal/service/athena/named_query_test.go @@ -20,7 +20,7 @@ func TestAccAthenaNamedQuery_basic(t *testing.T) { resourceName := "aws_athena_named_query.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, athena.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckNamedQueryDestroy(ctx), @@ -45,7 +45,7 @@ func TestAccAthenaNamedQuery_withWorkGroup(t *testing.T) { resourceName := "aws_athena_named_query.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, athena.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckNamedQueryDestroy(ctx), diff --git a/internal/service/athena/workgroup_test.go b/internal/service/athena/workgroup_test.go index 9b3de3612977..05209da2050d 100644 --- a/internal/service/athena/workgroup_test.go +++ b/internal/service/athena/workgroup_test.go @@ -23,7 +23,7 @@ func TestAccAthenaWorkGroup_basic(t *testing.T) { resourceName := "aws_athena_workgroup.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, athena.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckWorkGroupDestroy(ctx), @@ -66,7 +66,7 @@ func TestAccAthenaWorkGroup_aclConfig(t *testing.T) { resourceName := "aws_athena_workgroup.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, athena.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckWorkGroupDestroy(ctx), @@ -99,7 +99,7 @@ func TestAccAthenaWorkGroup_disappears(t *testing.T) { resourceName := "aws_athena_workgroup.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, athena.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckWorkGroupDestroy(ctx), @@ -123,7 +123,7 @@ func TestAccAthenaWorkGroup_bytesScannedCutoffPerQuery(t *testing.T) { resourceName := "aws_athena_workgroup.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, athena.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckWorkGroupDestroy(ctx), @@ -161,7 +161,7 @@ func TestAccAthenaWorkGroup_enforceWorkGroup(t *testing.T) { resourceName := "aws_athena_workgroup.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, athena.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckWorkGroupDestroy(ctx), @@ -199,7 +199,7 @@ func TestAccAthenaWorkGroup_configurationEngineVersion(t *testing.T) { resourceName := "aws_athena_workgroup.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, athena.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckWorkGroupDestroy(ctx), @@ -256,7 +256,7 @@ func TestAccAthenaWorkGroup_configurationExecutionRole(t *testing.T) { iamRoleResourceName := "aws_iam_role.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, athena.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckWorkGroupDestroy(ctx), @@ -286,7 +286,7 @@ func TestAccAthenaWorkGroup_publishCloudWatchMetricsEnabled(t *testing.T) { resourceName := "aws_athena_workgroup.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, athena.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckWorkGroupDestroy(ctx), @@ -324,7 +324,7 @@ func TestAccAthenaWorkGroup_ResultEncryption_sseS3(t *testing.T) { resourceName := "aws_athena_workgroup.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, athena.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckWorkGroupDestroy(ctx), @@ -358,7 +358,7 @@ func TestAccAthenaWorkGroup_ResultEncryption_kms(t *testing.T) { rEncryption2 := athena.EncryptionOptionCseKms resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, athena.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckWorkGroupDestroy(ctx), @@ -402,7 +402,7 @@ func TestAccAthenaWorkGroup_Result_outputLocation(t *testing.T) { rOutputLocation2 := fmt.Sprintf("%s-2", rName) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, athena.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckWorkGroupDestroy(ctx), @@ -442,7 +442,7 @@ func TestAccAthenaWorkGroup_requesterPaysEnabled(t *testing.T) { resourceName := "aws_athena_workgroup.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, athena.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckWorkGroupDestroy(ctx), @@ -486,7 +486,7 @@ func TestAccAthenaWorkGroup_ResultOutputLocation_forceDestroy(t *testing.T) { rOutputLocation2 := fmt.Sprintf("%s-2", rName) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, athena.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckWorkGroupDestroy(ctx), @@ -528,7 +528,7 @@ func TestAccAthenaWorkGroup_description(t *testing.T) { rDescriptionUpdate := sdkacctest.RandString(20) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, athena.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckWorkGroupDestroy(ctx), @@ -564,7 +564,7 @@ func TestAccAthenaWorkGroup_state(t *testing.T) { resourceName := "aws_athena_workgroup.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, athena.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckWorkGroupDestroy(ctx), @@ -610,7 +610,7 @@ func TestAccAthenaWorkGroup_forceDestroy(t *testing.T) { resourceName := "aws_athena_workgroup.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, athena.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckWorkGroupDestroy(ctx), @@ -640,7 +640,7 @@ func TestAccAthenaWorkGroup_tags(t *testing.T) { resourceName := "aws_athena_workgroup.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, athena.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckWorkGroupDestroy(ctx), From a30715b7b4b8ddd244cea66c9a3603f1e6aa3903 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Fri, 24 Feb 2023 16:36:35 -0500 Subject: [PATCH 097/763] Add 'Context' argument to 'acctest.PreCheck' for auditmanager. --- .../service/auditmanager/account_registration_test.go | 6 +++--- .../service/auditmanager/assessment_delegation_test.go | 8 ++++---- .../service/auditmanager/assessment_report_test.go | 6 +++--- internal/service/auditmanager/assessment_test.go | 8 ++++---- .../service/auditmanager/control_data_source_test.go | 4 ++-- internal/service/auditmanager/control_test.go | 10 +++++----- .../service/auditmanager/framework_data_source_test.go | 4 ++-- internal/service/auditmanager/framework_share_test.go | 6 +++--- internal/service/auditmanager/framework_test.go | 8 ++++---- .../organization_admin_account_registration_test.go | 4 ++-- 10 files changed, 32 insertions(+), 32 deletions(-) diff --git a/internal/service/auditmanager/account_registration_test.go b/internal/service/auditmanager/account_registration_test.go index d880a01f6ea8..804f4651eaa5 100644 --- a/internal/service/auditmanager/account_registration_test.go +++ b/internal/service/auditmanager/account_registration_test.go @@ -35,7 +35,7 @@ func testAccAccountRegistration_basic(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(names.AuditManagerEndpointID, t) }, ErrorCheck: acctest.ErrorCheck(t, names.AuditManagerEndpointID), @@ -67,7 +67,7 @@ func testAccAccountRegistration_disappears(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(names.AuditManagerEndpointID, t) }, ErrorCheck: acctest.ErrorCheck(t, names.AuditManagerEndpointID), @@ -97,7 +97,7 @@ func testAccAccountRegistration_optionalKMSKey(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(names.AuditManagerEndpointID, t) }, ErrorCheck: acctest.ErrorCheck(t, names.AuditManagerEndpointID), diff --git a/internal/service/auditmanager/assessment_delegation_test.go b/internal/service/auditmanager/assessment_delegation_test.go index 59b0a5c9510d..44051ff073d3 100644 --- a/internal/service/auditmanager/assessment_delegation_test.go +++ b/internal/service/auditmanager/assessment_delegation_test.go @@ -25,7 +25,7 @@ func TestAccAuditManagerAssessmentDelegation_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(names.AuditManagerEndpointID, t) }, ErrorCheck: acctest.ErrorCheck(t, names.AuditManagerEndpointID), @@ -60,7 +60,7 @@ func TestAccAuditManagerAssessmentDelegation_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(names.AuditManagerEndpointID, t) }, ErrorCheck: acctest.ErrorCheck(t, names.AuditManagerEndpointID), @@ -87,7 +87,7 @@ func TestAccAuditManagerAssessmentDelegation_optional(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(names.AuditManagerEndpointID, t) }, ErrorCheck: acctest.ErrorCheck(t, names.AuditManagerEndpointID), @@ -146,7 +146,7 @@ func TestAccAuditManagerAssessmentDelegation_multiple(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(names.AuditManagerEndpointID, t) }, ErrorCheck: acctest.ErrorCheck(t, names.AuditManagerEndpointID), diff --git a/internal/service/auditmanager/assessment_report_test.go b/internal/service/auditmanager/assessment_report_test.go index e2b5767b3c76..da01044957fd 100644 --- a/internal/service/auditmanager/assessment_report_test.go +++ b/internal/service/auditmanager/assessment_report_test.go @@ -25,7 +25,7 @@ func TestAccAuditManagerAssessmentReport_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(names.AuditManagerEndpointID, t) }, ErrorCheck: acctest.ErrorCheck(t, names.AuditManagerEndpointID), @@ -58,7 +58,7 @@ func TestAccAuditManagerAssessmentReport_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(names.AuditManagerEndpointID, t) }, ErrorCheck: acctest.ErrorCheck(t, names.AuditManagerEndpointID), @@ -85,7 +85,7 @@ func TestAccAuditManagerAssessmentReport_optional(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(names.AuditManagerEndpointID, t) }, ErrorCheck: acctest.ErrorCheck(t, names.AuditManagerEndpointID), diff --git a/internal/service/auditmanager/assessment_test.go b/internal/service/auditmanager/assessment_test.go index c6442452b86d..dd86ead26449 100644 --- a/internal/service/auditmanager/assessment_test.go +++ b/internal/service/auditmanager/assessment_test.go @@ -26,7 +26,7 @@ func TestAccAuditManagerAssessment_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(names.AuditManagerEndpointID, t) }, ErrorCheck: acctest.ErrorCheck(t, names.AuditManagerEndpointID), @@ -65,7 +65,7 @@ func TestAccAuditManagerAssessment_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(names.AuditManagerEndpointID, t) }, ErrorCheck: acctest.ErrorCheck(t, names.AuditManagerEndpointID), @@ -92,7 +92,7 @@ func TestAccAuditManagerAssessment_tags(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(names.AuditManagerEndpointID, t) }, ErrorCheck: acctest.ErrorCheck(t, names.AuditManagerEndpointID), @@ -145,7 +145,7 @@ func TestAccAuditManagerAssessment_optional(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(names.AuditManagerEndpointID, t) }, ErrorCheck: acctest.ErrorCheck(t, names.AuditManagerEndpointID), diff --git a/internal/service/auditmanager/control_data_source_test.go b/internal/service/auditmanager/control_data_source_test.go index d9ec9814a963..a09783474d84 100644 --- a/internal/service/auditmanager/control_data_source_test.go +++ b/internal/service/auditmanager/control_data_source_test.go @@ -19,7 +19,7 @@ func TestAccAuditManagerControlDataSource_standard(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(names.AuditManagerEndpointID, t) }, ErrorCheck: acctest.ErrorCheck(t, names.AuditManagerEndpointID), @@ -42,7 +42,7 @@ func TestAccAuditManagerControlDataSource_custom(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(names.AuditManagerEndpointID, t) }, ErrorCheck: acctest.ErrorCheck(t, names.AuditManagerEndpointID), diff --git a/internal/service/auditmanager/control_test.go b/internal/service/auditmanager/control_test.go index 525fb16a5c98..b3ad5e8ce6c2 100644 --- a/internal/service/auditmanager/control_test.go +++ b/internal/service/auditmanager/control_test.go @@ -26,7 +26,7 @@ func TestAccAuditManagerControl_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(names.AuditManagerEndpointID, t) }, ErrorCheck: acctest.ErrorCheck(t, names.AuditManagerEndpointID), @@ -62,7 +62,7 @@ func TestAccAuditManagerControl_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(names.AuditManagerEndpointID, t) }, ErrorCheck: acctest.ErrorCheck(t, names.AuditManagerEndpointID), @@ -89,7 +89,7 @@ func TestAccAuditManagerControl_tags(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(names.AuditManagerEndpointID, t) }, ErrorCheck: acctest.ErrorCheck(t, names.AuditManagerEndpointID), @@ -141,7 +141,7 @@ func TestAccAuditManagerControl_optional(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(names.AuditManagerEndpointID, t) }, ErrorCheck: acctest.ErrorCheck(t, names.AuditManagerEndpointID), @@ -199,7 +199,7 @@ func TestAccAuditManagerControl_optionalSources(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(names.AuditManagerEndpointID, t) }, ErrorCheck: acctest.ErrorCheck(t, names.AuditManagerEndpointID), diff --git a/internal/service/auditmanager/framework_data_source_test.go b/internal/service/auditmanager/framework_data_source_test.go index 00b3c7d00100..18b36e3898c8 100644 --- a/internal/service/auditmanager/framework_data_source_test.go +++ b/internal/service/auditmanager/framework_data_source_test.go @@ -18,7 +18,7 @@ func TestAccAuditManagerFrameworkDataSource_standard(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(names.AuditManagerEndpointID, t) }, ErrorCheck: acctest.ErrorCheck(t, names.AuditManagerEndpointID), @@ -41,7 +41,7 @@ func TestAccAuditManagerFrameworkDataSource_custom(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(names.AuditManagerEndpointID, t) }, ErrorCheck: acctest.ErrorCheck(t, names.AuditManagerEndpointID), diff --git a/internal/service/auditmanager/framework_share_test.go b/internal/service/auditmanager/framework_share_test.go index 44a2ea19fcb5..94f3c703b697 100644 --- a/internal/service/auditmanager/framework_share_test.go +++ b/internal/service/auditmanager/framework_share_test.go @@ -55,7 +55,7 @@ func TestAccAuditManagerFrameworkShare_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(names.AuditManagerEndpointID, t) }, ErrorCheck: acctest.ErrorCheck(t, names.AuditManagerEndpointID), @@ -89,7 +89,7 @@ func TestAccAuditManagerFrameworkShare_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(names.AuditManagerEndpointID, t) }, ErrorCheck: acctest.ErrorCheck(t, names.AuditManagerEndpointID), @@ -119,7 +119,7 @@ func TestAccAuditManagerFrameworkShare_optional(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(names.AuditManagerEndpointID, t) }, ErrorCheck: acctest.ErrorCheck(t, names.AuditManagerEndpointID), diff --git a/internal/service/auditmanager/framework_test.go b/internal/service/auditmanager/framework_test.go index 1bbc6f497e2d..bfbbd507738d 100644 --- a/internal/service/auditmanager/framework_test.go +++ b/internal/service/auditmanager/framework_test.go @@ -26,7 +26,7 @@ func TestAccAuditManagerFramework_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(names.AuditManagerEndpointID, t) }, ErrorCheck: acctest.ErrorCheck(t, names.AuditManagerEndpointID), @@ -61,7 +61,7 @@ func TestAccAuditManagerFramework_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(names.AuditManagerEndpointID, t) }, ErrorCheck: acctest.ErrorCheck(t, names.AuditManagerEndpointID), @@ -88,7 +88,7 @@ func TestAccAuditManagerFramework_tags(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(names.AuditManagerEndpointID, t) }, ErrorCheck: acctest.ErrorCheck(t, names.AuditManagerEndpointID), @@ -140,7 +140,7 @@ func TestAccAuditManagerFramework_optional(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(names.AuditManagerEndpointID, t) }, ErrorCheck: acctest.ErrorCheck(t, names.AuditManagerEndpointID), diff --git a/internal/service/auditmanager/organization_admin_account_registration_test.go b/internal/service/auditmanager/organization_admin_account_registration_test.go index f0db7ab34d95..f760fe5fe856 100644 --- a/internal/service/auditmanager/organization_admin_account_registration_test.go +++ b/internal/service/auditmanager/organization_admin_account_registration_test.go @@ -39,7 +39,7 @@ func testAccOrganizationAdminAccountRegistration_basic(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(names.AuditManagerEndpointID, t) }, ErrorCheck: acctest.ErrorCheck(t, names.AuditManagerEndpointID), @@ -71,7 +71,7 @@ func testAccOrganizationAdminAccountRegistration_disappears(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(names.AuditManagerEndpointID, t) }, ErrorCheck: acctest.ErrorCheck(t, names.AuditManagerEndpointID), From da65434cf7e76a9d0b532843838567fe6e2f5d26 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Fri, 24 Feb 2023 16:36:35 -0500 Subject: [PATCH 098/763] Add 'Context' argument to 'acctest.PreCheck' for autoscaling. --- .../service/autoscaling/attachment_test.go | 8 +- .../autoscaling/group_data_source_test.go | 4 +- .../service/autoscaling/group_tag_test.go | 6 +- internal/service/autoscaling/group_test.go | 142 +++++++++--------- .../autoscaling/groups_data_source_test.go | 2 +- .../launch_configuration_data_source_test.go | 8 +- .../autoscaling/launch_configuration_test.go | 44 +++--- .../autoscaling/lifecycle_hook_test.go | 6 +- .../service/autoscaling/notification_test.go | 6 +- internal/service/autoscaling/policy_test.go | 24 +-- internal/service/autoscaling/schedule_test.go | 10 +- 11 files changed, 130 insertions(+), 130 deletions(-) diff --git a/internal/service/autoscaling/attachment_test.go b/internal/service/autoscaling/attachment_test.go index 9fa31440f53c..2f8ac4ff7d19 100644 --- a/internal/service/autoscaling/attachment_test.go +++ b/internal/service/autoscaling/attachment_test.go @@ -21,7 +21,7 @@ func TestAccAutoScalingAttachment_elb(t *testing.T) { resourceName := "aws_autoscaling_attachment.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, autoscaling.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckAttachmentDestroy(ctx), @@ -42,7 +42,7 @@ func TestAccAutoScalingAttachment_albTargetGroup(t *testing.T) { resourceName := "aws_autoscaling_attachment.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, autoscaling.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckAttachmentDestroy(ctx), @@ -64,7 +64,7 @@ func TestAccAutoScalingAttachment_multipleELBs(t *testing.T) { resource11Name := "aws_autoscaling_attachment.test.10" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, autoscaling.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckAttachmentDestroy(ctx), @@ -94,7 +94,7 @@ func TestAccAutoScalingAttachment_multipleALBTargetGroups(t *testing.T) { resource11Name := "aws_autoscaling_attachment.test.10" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, autoscaling.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckAttachmentDestroy(ctx), diff --git a/internal/service/autoscaling/group_data_source_test.go b/internal/service/autoscaling/group_data_source_test.go index 8393543baea1..1e132cf658d2 100644 --- a/internal/service/autoscaling/group_data_source_test.go +++ b/internal/service/autoscaling/group_data_source_test.go @@ -16,7 +16,7 @@ func TestAccAutoScalingGroupDataSource_basic(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, autoscaling.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ @@ -56,7 +56,7 @@ func TestAccAutoScalingGroupDataSource_launchTemplate(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, autoscaling.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ diff --git a/internal/service/autoscaling/group_tag_test.go b/internal/service/autoscaling/group_tag_test.go index f4de53c6a909..eaae050ecf15 100644 --- a/internal/service/autoscaling/group_tag_test.go +++ b/internal/service/autoscaling/group_tag_test.go @@ -20,7 +20,7 @@ func TestAccAutoScalingGroupTag_basic(t *testing.T) { resourceName := "aws_autoscaling_group_tag.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, autoscaling.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckGroupTagDestroy(ctx), @@ -47,7 +47,7 @@ func TestAccAutoScalingGroupTag_disappears(t *testing.T) { resourceName := "aws_autoscaling_group_tag.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, autoscaling.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckGroupTagDestroy(ctx), @@ -69,7 +69,7 @@ func TestAccAutoScalingGroupTag_value(t *testing.T) { resourceName := "aws_autoscaling_group_tag.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, autoscaling.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckGroupTagDestroy(ctx), diff --git a/internal/service/autoscaling/group_test.go b/internal/service/autoscaling/group_test.go index 6150be7bd4a2..4e453bf27cb5 100644 --- a/internal/service/autoscaling/group_test.go +++ b/internal/service/autoscaling/group_test.go @@ -53,7 +53,7 @@ func TestAccAutoScalingGroup_basic(t *testing.T) { resourceName := "aws_autoscaling_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, autoscaling.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckGroupDestroy(ctx), @@ -115,7 +115,7 @@ func TestAccAutoScalingGroup_disappears(t *testing.T) { resourceName := "aws_autoscaling_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, autoscaling.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckGroupDestroy(ctx), @@ -139,7 +139,7 @@ func TestAccAutoScalingGroup_defaultInstanceWarmup(t *testing.T) { resourceName := "aws_autoscaling_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, autoscaling.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckGroupDestroy(ctx), @@ -170,7 +170,7 @@ func TestAccAutoScalingGroup_nameGenerated(t *testing.T) { resourceName := "aws_autoscaling_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, autoscaling.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckGroupDestroy(ctx), @@ -195,7 +195,7 @@ func TestAccAutoScalingGroup_namePrefix(t *testing.T) { resourceName := "aws_autoscaling_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, autoscaling.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckGroupDestroy(ctx), @@ -220,7 +220,7 @@ func TestAccAutoScalingGroup_tags(t *testing.T) { resourceName := "aws_autoscaling_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, autoscaling.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckGroupDestroy(ctx), @@ -281,7 +281,7 @@ func TestAccAutoScalingGroup_deprecatedTags(t *testing.T) { resourceName := "aws_autoscaling_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, autoscaling.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckGroupDestroy(ctx), @@ -311,7 +311,7 @@ func TestAccAutoScalingGroup_simple(t *testing.T) { resourceName := "aws_autoscaling_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, autoscaling.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckGroupDestroy(ctx), @@ -427,7 +427,7 @@ func TestAccAutoScalingGroup_terminationPolicies(t *testing.T) { resourceName := "aws_autoscaling_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, autoscaling.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckGroupDestroy(ctx), @@ -472,7 +472,7 @@ func TestAccAutoScalingGroup_vpcUpdates(t *testing.T) { resourceName := "aws_autoscaling_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, autoscaling.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckGroupDestroy(ctx), @@ -507,7 +507,7 @@ func TestAccAutoScalingGroup_withLoadBalancer(t *testing.T) { resourceName := "aws_autoscaling_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, autoscaling.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckGroupDestroy(ctx), @@ -538,7 +538,7 @@ func TestAccAutoScalingGroup_WithLoadBalancer_toTargetGroup(t *testing.T) { resourceName := "aws_autoscaling_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, autoscaling.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckGroupDestroy(ctx), @@ -579,7 +579,7 @@ func TestAccAutoScalingGroup_withPlacementGroup(t *testing.T) { resourceName := "aws_autoscaling_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, autoscaling.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckGroupDestroy(ctx), @@ -601,7 +601,7 @@ func TestAccAutoScalingGroup_withScalingActivityErrorPlacementGroupNotSupportedO rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, autoscaling.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckGroupDestroy(ctx), @@ -619,7 +619,7 @@ func TestAccAutoScalingGroup_withScalingActivityErrorIncorrectInstanceArchitectu rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, autoscaling.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckGroupDestroy(ctx), @@ -639,7 +639,7 @@ func TestAccAutoScalingGroup_withNoScalingActivityErrorCorrectInstanceArchitectu resourceName := "aws_autoscaling_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, autoscaling.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckGroupDestroy(ctx), @@ -661,7 +661,7 @@ func TestAccAutoScalingGroup_enablingMetrics(t *testing.T) { resourceName := "aws_autoscaling_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, autoscaling.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckGroupDestroy(ctx), @@ -697,7 +697,7 @@ func TestAccAutoScalingGroup_withMetrics(t *testing.T) { resourceName := "aws_autoscaling_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, autoscaling.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckGroupDestroy(ctx), @@ -745,7 +745,7 @@ func TestAccAutoScalingGroup_suspendingProcesses(t *testing.T) { resourceName := "aws_autoscaling_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, autoscaling.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckGroupDestroy(ctx), @@ -787,7 +787,7 @@ func TestAccAutoScalingGroup_serviceLinkedRoleARN(t *testing.T) { resourceName := "aws_autoscaling_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, autoscaling.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckGroupDestroy(ctx), @@ -811,7 +811,7 @@ func TestAccAutoScalingGroup_maxInstanceLifetime(t *testing.T) { resourceName := "aws_autoscaling_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, autoscaling.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckGroupDestroy(ctx), @@ -842,7 +842,7 @@ func TestAccAutoScalingGroup_initialLifecycleHook(t *testing.T) { resourceName := "aws_autoscaling_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, autoscaling.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckGroupDestroy(ctx), @@ -873,7 +873,7 @@ func TestAccAutoScalingGroup_launchTemplate(t *testing.T) { resourceName := "aws_autoscaling_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, autoscaling.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckGroupDestroy(ctx), @@ -900,7 +900,7 @@ func TestAccAutoScalingGroup_LaunchTemplate_update(t *testing.T) { resourceName := "aws_autoscaling_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, autoscaling.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckGroupDestroy(ctx), @@ -969,7 +969,7 @@ func TestAccAutoScalingGroup_largeDesiredCapacity(t *testing.T) { resourceName := "aws_autoscaling_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, autoscaling.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckGroupDestroy(ctx), @@ -995,7 +995,7 @@ func TestAccAutoScalingGroup_InstanceRefresh_basic(t *testing.T) { resourceName := "aws_autoscaling_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, autoscaling.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckGroupDestroy(ctx), @@ -1079,7 +1079,7 @@ func TestAccAutoScalingGroup_InstanceRefresh_start(t *testing.T) { launchConfigurationResourceName := "aws_launch_configuration.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, autoscaling.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckGroupDestroy(ctx), @@ -1122,7 +1122,7 @@ func TestAccAutoScalingGroup_InstanceRefresh_triggers(t *testing.T) { resourceName := "aws_autoscaling_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, autoscaling.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckGroupDestroy(ctx), @@ -1163,7 +1163,7 @@ func TestAccAutoScalingGroup_loadBalancers(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, autoscaling.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckGroupDestroy(ctx), @@ -1201,7 +1201,7 @@ func TestAccAutoScalingGroup_targetGroups(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, autoscaling.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckGroupDestroy(ctx), @@ -1240,7 +1240,7 @@ func TestAccAutoScalingGroup_ALBTargetGroups_elbCapacity(t *testing.T) { var tg elbv2.TargetGroup resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, autoscaling.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckGroupDestroy(ctx), @@ -1265,7 +1265,7 @@ func TestAccAutoScalingGroup_warmPool(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, autoscaling.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckGroupDestroy(ctx), @@ -1312,7 +1312,7 @@ func TestAccAutoScalingGroup_launchTempPartitionNum(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, autoscaling.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckGroupDestroy(ctx), @@ -1335,7 +1335,7 @@ func TestAccAutoScalingGroup_Destroy_whenProtectedFromScaleIn(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, autoscaling.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckGroupDestroy(ctx), @@ -1363,7 +1363,7 @@ func TestAccAutoScalingGroup_mixedInstancesPolicy(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, autoscaling.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckGroupDestroy(ctx), @@ -1395,7 +1395,7 @@ func TestAccAutoScalingGroup_MixedInstancesPolicy_capacityRebalance(t *testing.T rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, autoscaling.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckGroupDestroy(ctx), @@ -1430,7 +1430,7 @@ func TestAccAutoScalingGroup_MixedInstancesPolicyInstancesDistribution_onDemandA rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, autoscaling.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckGroupDestroy(ctx), @@ -1456,7 +1456,7 @@ func TestAccAutoScalingGroup_MixedInstancesPolicyInstancesDistribution_onDemandB rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, autoscaling.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckGroupDestroy(ctx), @@ -1501,7 +1501,7 @@ func TestAccAutoScalingGroup_MixedInstancesPolicyInstancesDistribution_updateToZ rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, autoscaling.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckGroupDestroy(ctx), @@ -1537,7 +1537,7 @@ func TestAccAutoScalingGroup_MixedInstancesPolicyInstancesDistribution_onDemandP rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, autoscaling.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckGroupDestroy(ctx), @@ -1572,7 +1572,7 @@ func TestAccAutoScalingGroup_MixedInstancesPolicyInstancesDistribution_spotAlloc rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, autoscaling.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckGroupDestroy(ctx), @@ -1598,7 +1598,7 @@ func TestAccAutoScalingGroup_MixedInstancesPolicyInstancesDistribution_spotInsta rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, autoscaling.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckGroupDestroy(ctx), @@ -1633,7 +1633,7 @@ func TestAccAutoScalingGroup_MixedInstancesPolicyInstancesDistribution_spotMaxPr rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, autoscaling.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckGroupDestroy(ctx), @@ -1677,7 +1677,7 @@ func TestAccAutoScalingGroup_MixedInstancesPolicyLaunchTemplateLaunchTemplateSpe rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, autoscaling.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckGroupDestroy(ctx), @@ -1704,7 +1704,7 @@ func TestAccAutoScalingGroup_MixedInstancesPolicyLaunchTemplateLaunchTemplateSpe rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, autoscaling.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckGroupDestroy(ctx), @@ -1741,7 +1741,7 @@ func TestAccAutoScalingGroup_MixedInstancesPolicyLaunchTemplateOverride_instance rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, autoscaling.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckGroupDestroy(ctx), @@ -1780,7 +1780,7 @@ func TestAccAutoScalingGroup_MixedInstancesPolicyLaunchTemplateOverride_instance rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, autoscaling.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckGroupDestroy(ctx), @@ -1810,7 +1810,7 @@ func TestAccAutoScalingGroup_MixedInstancesPolicyLaunchTemplateOverride_weighted rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, autoscaling.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckGroupDestroy(ctx), @@ -1840,7 +1840,7 @@ func TestAccAutoScalingGroup_MixedInstancesPolicyLaunchTemplateOverride_weighted rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, autoscaling.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckGroupDestroy(ctx), @@ -1870,7 +1870,7 @@ func TestAccAutoScalingGroup_MixedInstancesPolicyLaunchTemplateOverride_instance resourceName := "aws_autoscaling_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, autoscaling.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckGroupDestroy(ctx), @@ -1936,7 +1936,7 @@ func TestAccAutoScalingGroup_MixedInstancesPolicyLaunchTemplateOverride_instance resourceName := "aws_autoscaling_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, autoscaling.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckGroupDestroy(ctx), @@ -2023,7 +2023,7 @@ func TestAccAutoScalingGroup_MixedInstancesPolicyLaunchTemplateOverride_instance resourceName := "aws_autoscaling_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, autoscaling.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckGroupDestroy(ctx), @@ -2084,7 +2084,7 @@ func TestAccAutoScalingGroup_MixedInstancesPolicyLaunchTemplateOverride_instance resourceName := "aws_autoscaling_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, autoscaling.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckGroupDestroy(ctx), @@ -2148,7 +2148,7 @@ func TestAccAutoScalingGroup_MixedInstancesPolicyLaunchTemplateOverride_instance resourceName := "aws_autoscaling_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, autoscaling.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckGroupDestroy(ctx), @@ -2237,7 +2237,7 @@ func TestAccAutoScalingGroup_MixedInstancesPolicyLaunchTemplateOverride_instance resourceName := "aws_autoscaling_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, autoscaling.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckGroupDestroy(ctx), @@ -2297,7 +2297,7 @@ func TestAccAutoScalingGroup_MixedInstancesPolicyLaunchTemplateOverride_instance resourceName := "aws_autoscaling_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, autoscaling.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckGroupDestroy(ctx), @@ -2373,7 +2373,7 @@ func TestAccAutoScalingGroup_MixedInstancesPolicyLaunchTemplateOverride_instance resourceName := "aws_autoscaling_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, autoscaling.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckGroupDestroy(ctx), @@ -2460,7 +2460,7 @@ func TestAccAutoScalingGroup_MixedInstancesPolicyLaunchTemplateOverride_instance resourceName := "aws_autoscaling_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, autoscaling.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckGroupDestroy(ctx), @@ -2536,7 +2536,7 @@ func TestAccAutoScalingGroup_MixedInstancesPolicyLaunchTemplateOverride_instance resourceName := "aws_autoscaling_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, autoscaling.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckGroupDestroy(ctx), @@ -2596,7 +2596,7 @@ func TestAccAutoScalingGroup_MixedInstancesPolicyLaunchTemplateOverride_instance resourceName := "aws_autoscaling_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, autoscaling.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckGroupDestroy(ctx), @@ -2656,7 +2656,7 @@ func TestAccAutoScalingGroup_MixedInstancesPolicyLaunchTemplateOverride_instance resourceName := "aws_autoscaling_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, autoscaling.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckGroupDestroy(ctx), @@ -2715,7 +2715,7 @@ func TestAccAutoScalingGroup_MixedInstancesPolicyLaunchTemplateOverride_instance resourceName := "aws_autoscaling_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, autoscaling.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckGroupDestroy(ctx), @@ -2791,7 +2791,7 @@ func TestAccAutoScalingGroup_MixedInstancesPolicyLaunchTemplateOverride_instance resourceName := "aws_autoscaling_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, autoscaling.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckGroupDestroy(ctx), @@ -2850,7 +2850,7 @@ func TestAccAutoScalingGroup_MixedInstancesPolicyLaunchTemplateOverride_instance resourceName := "aws_autoscaling_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, autoscaling.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckGroupDestroy(ctx), @@ -2937,7 +2937,7 @@ func TestAccAutoScalingGroup_MixedInstancesPolicyLaunchTemplateOverride_instance resourceName := "aws_autoscaling_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, autoscaling.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckGroupDestroy(ctx), @@ -3024,7 +3024,7 @@ func TestAccAutoScalingGroup_MixedInstancesPolicyLaunchTemplateOverride_instance resourceName := "aws_autoscaling_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, autoscaling.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckGroupDestroy(ctx), @@ -3060,7 +3060,7 @@ func TestAccAutoScalingGroup_MixedInstancesPolicyLaunchTemplateOverride_instance resourceName := "aws_autoscaling_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, autoscaling.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckGroupDestroy(ctx), @@ -3116,7 +3116,7 @@ func TestAccAutoScalingGroup_MixedInstancesPolicyLaunchTemplateOverride_instance resourceName := "aws_autoscaling_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, autoscaling.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckGroupDestroy(ctx), @@ -3152,7 +3152,7 @@ func TestAccAutoScalingGroup_MixedInstancesPolicyLaunchTemplateOverride_instance resourceName := "aws_autoscaling_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, autoscaling.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckGroupDestroy(ctx), @@ -3239,7 +3239,7 @@ func TestAccAutoScalingGroup_MixedInstancesPolicyLaunchTemplateOverride_instance resourceName := "aws_autoscaling_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, autoscaling.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckGroupDestroy(ctx), @@ -3269,7 +3269,7 @@ func TestAccAutoScalingGroup_MixedInstancesPolicyLaunchTemplateOverride_instance resourceName := "aws_autoscaling_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, autoscaling.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckGroupDestroy(ctx), diff --git a/internal/service/autoscaling/groups_data_source_test.go b/internal/service/autoscaling/groups_data_source_test.go index 6ee0b06a5be5..a8801f00f327 100644 --- a/internal/service/autoscaling/groups_data_source_test.go +++ b/internal/service/autoscaling/groups_data_source_test.go @@ -18,7 +18,7 @@ func TestAccAutoScalingGroupsDataSource_basic(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, autoscaling.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ diff --git a/internal/service/autoscaling/launch_configuration_data_source_test.go b/internal/service/autoscaling/launch_configuration_data_source_test.go index dd8142a4adee..5b48df664b37 100644 --- a/internal/service/autoscaling/launch_configuration_data_source_test.go +++ b/internal/service/autoscaling/launch_configuration_data_source_test.go @@ -16,7 +16,7 @@ func TestAccAutoScalingLaunchConfigurationDataSource_basic(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, autoscaling.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ @@ -53,7 +53,7 @@ func TestAccAutoScalingLaunchConfigurationDataSource_securityGroups(t *testing.T rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, autoscaling.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ @@ -73,7 +73,7 @@ func TestAccAutoScalingLaunchConfigurationDataSource_ebsNoDevice(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, autoscaling.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ @@ -94,7 +94,7 @@ func TestAccAutoScalingLaunchConfigurationDataSource_metadataOptions(t *testing. resourceName := "aws_launch_configuration.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, autoscaling.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckLaunchConfigurationDestroy(ctx), diff --git a/internal/service/autoscaling/launch_configuration_test.go b/internal/service/autoscaling/launch_configuration_test.go index 93c504f13523..6f7c50d87ea1 100644 --- a/internal/service/autoscaling/launch_configuration_test.go +++ b/internal/service/autoscaling/launch_configuration_test.go @@ -26,7 +26,7 @@ func TestAccAutoScalingLaunchConfiguration_basic(t *testing.T) { resourceName := "aws_launch_configuration.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, autoscaling.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckLaunchConfigurationDestroy(ctx), @@ -74,7 +74,7 @@ func TestAccAutoScalingLaunchConfiguration_disappears(t *testing.T) { resourceName := "aws_launch_configuration.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, autoscaling.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckLaunchConfigurationDestroy(ctx), @@ -97,7 +97,7 @@ func TestAccAutoScalingLaunchConfiguration_Name_generated(t *testing.T) { resourceName := "aws_launch_configuration.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, autoscaling.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckLaunchConfigurationDestroy(ctx), @@ -125,7 +125,7 @@ func TestAccAutoScalingLaunchConfiguration_namePrefix(t *testing.T) { resourceName := "aws_launch_configuration.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, autoscaling.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckLaunchConfigurationDestroy(ctx), @@ -154,7 +154,7 @@ func TestAccAutoScalingLaunchConfiguration_withBlockDevices(t *testing.T) { resourceName := "aws_launch_configuration.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, autoscaling.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckLaunchConfigurationDestroy(ctx), @@ -202,7 +202,7 @@ func TestAccAutoScalingLaunchConfiguration_withInstanceStoreAMI(t *testing.T) { resourceName := "aws_launch_configuration.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, autoscaling.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckLaunchConfigurationDestroy(ctx), @@ -231,7 +231,7 @@ func TestAccAutoScalingLaunchConfiguration_RootBlockDevice_amiDisappears(t *test resourceName := "aws_launch_configuration.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, autoscaling.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckLaunchConfigurationDestroy(ctx), @@ -262,7 +262,7 @@ func TestAccAutoScalingLaunchConfiguration_RootBlockDevice_volumeSize(t *testing resourceName := "aws_launch_configuration.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, autoscaling.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckLaunchConfigurationDestroy(ctx), @@ -299,7 +299,7 @@ func TestAccAutoScalingLaunchConfiguration_encryptedRootBlockDevice(t *testing.T resourceName := "aws_launch_configuration.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, autoscaling.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckLaunchConfigurationDestroy(ctx), @@ -332,7 +332,7 @@ func TestAccAutoScalingLaunchConfiguration_withSpotPrice(t *testing.T) { resourceName := "aws_launch_configuration.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, autoscaling.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckLaunchConfigurationDestroy(ctx), @@ -360,7 +360,7 @@ func TestAccAutoScalingLaunchConfiguration_withIAMProfile(t *testing.T) { resourceName := "aws_launch_configuration.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, autoscaling.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckLaunchConfigurationDestroy(ctx), @@ -388,7 +388,7 @@ func TestAccAutoScalingLaunchConfiguration_withGP3(t *testing.T) { resourceName := "aws_launch_configuration.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, autoscaling.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckLaunchConfigurationDestroy(ctx), @@ -428,7 +428,7 @@ func TestAccAutoScalingLaunchConfiguration_encryptedEBSBlockDevice(t *testing.T) resourceName := "aws_launch_configuration.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, autoscaling.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckLaunchConfigurationDestroy(ctx), @@ -483,7 +483,7 @@ func TestAccAutoScalingLaunchConfiguration_metadataOptions(t *testing.T) { resourceName := "aws_launch_configuration.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, autoscaling.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckLaunchConfigurationDestroy(ctx), @@ -514,7 +514,7 @@ func TestAccAutoScalingLaunchConfiguration_EBS_noDevice(t *testing.T) { resourceName := "aws_launch_configuration.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, autoscaling.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckLaunchConfigurationDestroy(ctx), @@ -546,7 +546,7 @@ func TestAccAutoScalingLaunchConfiguration_userData(t *testing.T) { resourceName := "aws_launch_configuration.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, autoscaling.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckLaunchConfigurationDestroy(ctx), @@ -583,7 +583,7 @@ func TestAccAutoScalingLaunchConfiguration_AssociatePublicIPAddress_subnetFalseC groupResourceName := "aws_autoscaling_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, autoscaling.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckLaunchConfigurationDestroy(ctx), @@ -615,7 +615,7 @@ func TestAccAutoScalingLaunchConfiguration_AssociatePublicIPAddress_subnetFalseC groupResourceName := "aws_autoscaling_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, autoscaling.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckLaunchConfigurationDestroy(ctx), @@ -647,7 +647,7 @@ func TestAccAutoScalingLaunchConfiguration_AssociatePublicIPAddress_subnetFalseC groupResourceName := "aws_autoscaling_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, autoscaling.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckLaunchConfigurationDestroy(ctx), @@ -679,7 +679,7 @@ func TestAccAutoScalingLaunchConfiguration_AssociatePublicIPAddress_subnetTrueCo groupResourceName := "aws_autoscaling_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, autoscaling.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckLaunchConfigurationDestroy(ctx), @@ -711,7 +711,7 @@ func TestAccAutoScalingLaunchConfiguration_AssociatePublicIPAddress_subnetTrueCo groupResourceName := "aws_autoscaling_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, autoscaling.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckLaunchConfigurationDestroy(ctx), @@ -743,7 +743,7 @@ func TestAccAutoScalingLaunchConfiguration_AssociatePublicIPAddress_subnetTrueCo groupResourceName := "aws_autoscaling_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, autoscaling.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckLaunchConfigurationDestroy(ctx), diff --git a/internal/service/autoscaling/lifecycle_hook_test.go b/internal/service/autoscaling/lifecycle_hook_test.go index 1764d8de6273..1da400679f35 100644 --- a/internal/service/autoscaling/lifecycle_hook_test.go +++ b/internal/service/autoscaling/lifecycle_hook_test.go @@ -21,7 +21,7 @@ func TestAccAutoScalingLifecycleHook_basic(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, autoscaling.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckLifecycleHookDestroy(ctx), @@ -52,7 +52,7 @@ func TestAccAutoScalingLifecycleHook_disappears(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, autoscaling.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckLifecycleHookDestroy(ctx), @@ -75,7 +75,7 @@ func TestAccAutoScalingLifecycleHook_omitDefaultResult(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, autoscaling.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckLifecycleHookDestroy(ctx), diff --git a/internal/service/autoscaling/notification_test.go b/internal/service/autoscaling/notification_test.go index 275089c27ff0..bb1cef04ebfc 100644 --- a/internal/service/autoscaling/notification_test.go +++ b/internal/service/autoscaling/notification_test.go @@ -22,7 +22,7 @@ func TestAccAutoScalingNotification_ASG_basic(t *testing.T) { rName := sdkacctest.RandString(5) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, autoscaling.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckASGNDestroy(ctx), @@ -45,7 +45,7 @@ func TestAccAutoScalingNotification_ASG_update(t *testing.T) { rName := sdkacctest.RandString(5) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, autoscaling.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckASGNDestroy(ctx), @@ -76,7 +76,7 @@ func TestAccAutoScalingNotification_ASG_pagination(t *testing.T) { resourceName := "aws_autoscaling_notification.example" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, autoscaling.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckASGNDestroy(ctx), diff --git a/internal/service/autoscaling/policy_test.go b/internal/service/autoscaling/policy_test.go index 86921ee329ed..3ca0a277698d 100644 --- a/internal/service/autoscaling/policy_test.go +++ b/internal/service/autoscaling/policy_test.go @@ -24,7 +24,7 @@ func TestAccAutoScalingPolicy_basic(t *testing.T) { resourceTargetTrackingName := "aws_autoscaling_policy.test_tracking" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, autoscaling.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckPolicyDestroy(ctx), @@ -120,7 +120,7 @@ func TestAccAutoScalingPolicy_disappears(t *testing.T) { resourceName := "aws_autoscaling_policy.test_simple" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, autoscaling.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckPolicyDestroy(ctx), @@ -144,7 +144,7 @@ func TestAccAutoScalingPolicy_predictiveScalingPredefined(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, autoscaling.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckPolicyDestroy(ctx), @@ -181,7 +181,7 @@ func TestAccAutoScalingPolicy_predictiveScalingResourceLabel(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, autoscaling.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckPolicyDestroy(ctx), @@ -218,7 +218,7 @@ func TestAccAutoScalingPolicy_predictiveScalingCustom(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, autoscaling.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckPolicyDestroy(ctx), @@ -271,7 +271,7 @@ func TestAccAutoScalingPolicy_predictiveScalingRemoved(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, autoscaling.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckPolicyDestroy(ctx), @@ -307,7 +307,7 @@ func TestAccAutoScalingPolicy_predictiveScalingUpdated(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, autoscaling.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckPolicyDestroy(ctx), @@ -359,7 +359,7 @@ func TestAccAutoScalingPolicy_predictiveScalingFloatTargetValue(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, autoscaling.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckPolicyDestroy(ctx), @@ -390,7 +390,7 @@ func TestAccAutoScalingPolicy_simpleScalingStepAdjustment(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, autoscaling.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckPolicyDestroy(ctx), @@ -420,7 +420,7 @@ func TestAccAutoScalingPolicy_TargetTrack_predefined(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, autoscaling.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckPolicyDestroy(ctx), @@ -448,7 +448,7 @@ func TestAccAutoScalingPolicy_TargetTrack_custom(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, autoscaling.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckPolicyDestroy(ctx), @@ -477,7 +477,7 @@ func TestAccAutoScalingPolicy_zeroValue(t *testing.T) { resourceStepName := "aws_autoscaling_policy.test_step" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, autoscaling.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckPolicyDestroy(ctx), diff --git a/internal/service/autoscaling/schedule_test.go b/internal/service/autoscaling/schedule_test.go index f04b0ba9e823..5909a48c3479 100644 --- a/internal/service/autoscaling/schedule_test.go +++ b/internal/service/autoscaling/schedule_test.go @@ -27,7 +27,7 @@ func TestAccAutoScalingSchedule_basic(t *testing.T) { resourceName := "aws_autoscaling_schedule.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, autoscaling.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckScheduleDestroy(ctx), @@ -58,7 +58,7 @@ func TestAccAutoScalingSchedule_disappears(t *testing.T) { resourceName := "aws_autoscaling_schedule.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, autoscaling.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckScheduleDestroy(ctx), @@ -82,7 +82,7 @@ func TestAccAutoScalingSchedule_recurrence(t *testing.T) { resourceName := "aws_autoscaling_schedule.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, autoscaling.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckScheduleDestroy(ctx), @@ -113,7 +113,7 @@ func TestAccAutoScalingSchedule_zeroValues(t *testing.T) { resourceName := "aws_autoscaling_schedule.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, autoscaling.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckScheduleDestroy(ctx), @@ -143,7 +143,7 @@ func TestAccAutoScalingSchedule_negativeOne(t *testing.T) { resourceName := "aws_autoscaling_schedule.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, autoscaling.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckScheduleDestroy(ctx), From 82b5319bb8584c21527684289315c739ca5fbb15 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Fri, 24 Feb 2023 16:36:36 -0500 Subject: [PATCH 099/763] Add 'Context' argument to 'acctest.PreCheck' for autoscalingplans. --- internal/service/autoscalingplans/scaling_plan_test.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/internal/service/autoscalingplans/scaling_plan_test.go b/internal/service/autoscalingplans/scaling_plan_test.go index 47f36bb05c36..b9e8fc480cc7 100644 --- a/internal/service/autoscalingplans/scaling_plan_test.go +++ b/internal/service/autoscalingplans/scaling_plan_test.go @@ -26,7 +26,7 @@ func TestAccAutoScalingPlansScalingPlan_basicDynamicScaling(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, autoscalingplans.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckScalingPlanDestroy(ctx), @@ -84,7 +84,7 @@ func TestAccAutoScalingPlansScalingPlan_basicPredictiveScaling(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckIAMServiceLinkedRole(ctx, t, "/aws-service-role/autoscaling-plans") }, ErrorCheck: acctest.ErrorCheck(t, autoscalingplans.EndpointsID), @@ -148,7 +148,7 @@ func TestAccAutoScalingPlansScalingPlan_basicUpdate(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckIAMServiceLinkedRole(ctx, t, "/aws-service-role/autoscaling-plans") }, ErrorCheck: acctest.ErrorCheck(t, autoscalingplans.EndpointsID), @@ -243,7 +243,7 @@ func TestAccAutoScalingPlansScalingPlan_disappears(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, autoscalingplans.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckScalingPlanDestroy(ctx), @@ -267,7 +267,7 @@ func TestAccAutoScalingPlansScalingPlan_DynamicScaling_customizedScalingMetricSp rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, autoscalingplans.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckScalingPlanDestroy(ctx), From 1eb07b698a75972de2c3d87bbbb3788e71469a70 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Fri, 24 Feb 2023 16:36:36 -0500 Subject: [PATCH 100/763] Add 'Context' argument to 'acctest.PreCheck' for backup. --- .../backup/framework_data_source_test.go | 4 ++-- internal/service/backup/framework_test.go | 12 +++++----- .../service/backup/global_settings_test.go | 2 +- .../service/backup/plan_data_source_test.go | 2 +- internal/service/backup/plan_test.go | 24 +++++++++---------- .../service/backup/region_settings_test.go | 2 +- .../backup/report_plan_data_source_test.go | 2 +- internal/service/backup/report_plan_test.go | 8 +++---- .../backup/selection_data_source_test.go | 2 +- internal/service/backup/selection_test.go | 16 ++++++------- .../service/backup/vault_data_source_test.go | 2 +- .../backup/vault_lock_configuration_test.go | 4 ++-- .../backup/vault_notifications_test.go | 4 ++-- internal/service/backup/vault_policy_test.go | 8 +++---- internal/service/backup/vault_test.go | 12 +++++----- 15 files changed, 52 insertions(+), 52 deletions(-) diff --git a/internal/service/backup/framework_data_source_test.go b/internal/service/backup/framework_data_source_test.go index 1228c3dd3d8e..e2c9f9576cc0 100644 --- a/internal/service/backup/framework_data_source_test.go +++ b/internal/service/backup/framework_data_source_test.go @@ -18,7 +18,7 @@ func testAccFrameworkDataSource_basic(t *testing.T) { rName := fmt.Sprintf("tf_acc_test_%s", sdkacctest.RandString(7)) resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccFrameworkPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccFrameworkPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, backup.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ @@ -75,7 +75,7 @@ func testAccFrameworkDataSource_controlScopeTag(t *testing.T) { rName := fmt.Sprintf("tf_acc_test_%s", sdkacctest.RandString(7)) resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccFrameworkPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccFrameworkPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, backup.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ diff --git a/internal/service/backup/framework_test.go b/internal/service/backup/framework_test.go index 3381e450558f..38aa964c4614 100644 --- a/internal/service/backup/framework_test.go +++ b/internal/service/backup/framework_test.go @@ -46,7 +46,7 @@ func testAccFramework_basic(t *testing.T) { resourceName := "aws_backup_framework.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccFrameworkPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccFrameworkPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, backup.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckFrameworkDestroy(ctx), @@ -107,7 +107,7 @@ func testAccFramework_updateTags(t *testing.T) { resourceName := "aws_backup_framework.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccFrameworkPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccFrameworkPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, backup.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckFrameworkDestroy(ctx), @@ -197,7 +197,7 @@ func testAccFramework_updateControlScope(t *testing.T) { resourceName := "aws_backup_framework.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccFrameworkPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccFrameworkPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, backup.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckFrameworkDestroy(ctx), @@ -310,7 +310,7 @@ func testAccFramework_updateControlInputParameters(t *testing.T) { resourceName := "aws_backup_framework.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccFrameworkPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccFrameworkPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, backup.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckFrameworkDestroy(ctx), @@ -391,7 +391,7 @@ func testAccFramework_updateControls(t *testing.T) { resourceName := "aws_backup_framework.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccFrameworkPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccFrameworkPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, backup.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckFrameworkDestroy(ctx), @@ -470,7 +470,7 @@ func testAccFramework_disappears(t *testing.T) { resourceName := "aws_backup_framework.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccFrameworkPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccFrameworkPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, backup.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckFrameworkDestroy(ctx), diff --git a/internal/service/backup/global_settings_test.go b/internal/service/backup/global_settings_test.go index 2ef3696f77e6..2aea122a9877 100644 --- a/internal/service/backup/global_settings_test.go +++ b/internal/service/backup/global_settings_test.go @@ -19,7 +19,7 @@ func TestAccBackupGlobalSettings_basic(t *testing.T) { resourceName := "aws_backup_global_settings.test" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckOrganizationManagementAccount(ctx, t) testAccPreCheck(ctx, t) }, diff --git a/internal/service/backup/plan_data_source_test.go b/internal/service/backup/plan_data_source_test.go index ccf0798cd1e0..8ac4b68b3a62 100644 --- a/internal/service/backup/plan_data_source_test.go +++ b/internal/service/backup/plan_data_source_test.go @@ -17,7 +17,7 @@ func TestAccBackupPlanDataSource_basic(t *testing.T) { rInt := sdkacctest.RandInt() resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, backup.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ diff --git a/internal/service/backup/plan_test.go b/internal/service/backup/plan_test.go index 5bc89e6fde25..78cb47f3d66e 100644 --- a/internal/service/backup/plan_test.go +++ b/internal/service/backup/plan_test.go @@ -23,7 +23,7 @@ func TestAccBackupPlan_basic(t *testing.T) { rName := fmt.Sprintf("tf-testacc-backup-%s", sdkacctest.RandString(14)) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, backup.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckPlanDestroy(ctx), @@ -61,7 +61,7 @@ func TestAccBackupPlan_withTags(t *testing.T) { rName := fmt.Sprintf("tf-testacc-backup-%s", sdkacctest.RandString(14)) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, backup.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckPlanDestroy(ctx), @@ -118,7 +118,7 @@ func TestAccBackupPlan_withRules(t *testing.T) { rule3Name := fmt.Sprintf("%s_3", rName) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, backup.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckPlanDestroy(ctx), @@ -202,7 +202,7 @@ func TestAccBackupPlan_withLifecycle(t *testing.T) { rName := fmt.Sprintf("tf-testacc-backup-%s", sdkacctest.RandString(14)) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, backup.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckPlanDestroy(ctx), @@ -275,7 +275,7 @@ func TestAccBackupPlan_withRecoveryPointTags(t *testing.T) { rName := fmt.Sprintf("tf-testacc-backup-%s", sdkacctest.RandString(14)) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, backup.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckPlanDestroy(ctx), @@ -349,7 +349,7 @@ func TestAccBackupPlan_RuleCopyAction_sameRegion(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, backup.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckPlanDestroy(ctx), @@ -413,7 +413,7 @@ func TestAccBackupPlan_RuleCopyAction_noLifecycle(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, backup.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckPlanDestroy(ctx), @@ -475,7 +475,7 @@ func TestAccBackupPlan_RuleCopyAction_multiple(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, backup.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckPlanDestroy(ctx), @@ -512,7 +512,7 @@ func TestAccBackupPlan_RuleCopyAction_crossRegion(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) testAccPreCheck(ctx, t) acctest.PreCheckMultipleRegion(t, 2) }, @@ -552,7 +552,7 @@ func TestAccBackupPlan_advancedBackupSetting(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, backup.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckPlanDestroy(ctx), @@ -599,7 +599,7 @@ func TestAccBackupPlan_enableContinuousBackup(t *testing.T) { rName := fmt.Sprintf("tf-testacc-backup-%s", sdkacctest.RandString(14)) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, backup.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckPlanDestroy(ctx), @@ -639,7 +639,7 @@ func TestAccBackupPlan_disappears(t *testing.T) { rName := fmt.Sprintf("tf-testacc-backup-%s", sdkacctest.RandString(14)) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, backup.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckPlanDestroy(ctx), diff --git a/internal/service/backup/region_settings_test.go b/internal/service/backup/region_settings_test.go index 531c6f66492e..881f86aa8441 100644 --- a/internal/service/backup/region_settings_test.go +++ b/internal/service/backup/region_settings_test.go @@ -19,7 +19,7 @@ func TestAccBackupRegionSettings_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(fsx.EndpointsID, t) testAccPreCheck(ctx, t) }, diff --git a/internal/service/backup/report_plan_data_source_test.go b/internal/service/backup/report_plan_data_source_test.go index 8501dfecff54..1ffdb76cb079 100644 --- a/internal/service/backup/report_plan_data_source_test.go +++ b/internal/service/backup/report_plan_data_source_test.go @@ -19,7 +19,7 @@ func TestAccBackupReportPlanDataSource_basic(t *testing.T) { rName2 := fmt.Sprintf("tf_acc_test_%s", sdkacctest.RandString(7)) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccReportPlanPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccReportPlanPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, backup.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ diff --git a/internal/service/backup/report_plan_test.go b/internal/service/backup/report_plan_test.go index fe661bc20673..aba69e7c8eaf 100644 --- a/internal/service/backup/report_plan_test.go +++ b/internal/service/backup/report_plan_test.go @@ -25,7 +25,7 @@ func TestAccBackupReportPlan_basic(t *testing.T) { resourceName := "aws_backup_report_plan.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccReportPlanPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccReportPlanPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, backup.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckReportPlanDestroy(ctx), @@ -84,7 +84,7 @@ func TestAccBackupReportPlan_updateTags(t *testing.T) { resourceName := "aws_backup_report_plan.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccReportPlanPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccReportPlanPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, backup.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckReportPlanDestroy(ctx), @@ -169,7 +169,7 @@ func TestAccBackupReportPlan_updateReportDeliveryChannel(t *testing.T) { resourceName := "aws_backup_report_plan.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccReportPlanPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccReportPlanPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, backup.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckReportPlanDestroy(ctx), @@ -229,7 +229,7 @@ func TestAccBackupReportPlan_disappears(t *testing.T) { resourceName := "aws_backup_report_plan.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccReportPlanPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccReportPlanPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, backup.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckReportPlanDestroy(ctx), diff --git a/internal/service/backup/selection_data_source_test.go b/internal/service/backup/selection_data_source_test.go index b528ae4d7896..d3ddc3d1ffa5 100644 --- a/internal/service/backup/selection_data_source_test.go +++ b/internal/service/backup/selection_data_source_test.go @@ -17,7 +17,7 @@ func TestAccBackupSelectionDataSource_basic(t *testing.T) { rInt := sdkacctest.RandInt() resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, backup.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ diff --git a/internal/service/backup/selection_test.go b/internal/service/backup/selection_test.go index 08ddf129c588..399ba3410e37 100644 --- a/internal/service/backup/selection_test.go +++ b/internal/service/backup/selection_test.go @@ -22,7 +22,7 @@ func TestAccBackupSelection_basic(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, backup.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSelectionDestroy(ctx), @@ -50,7 +50,7 @@ func TestAccBackupSelection_disappears(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, backup.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSelectionDestroy(ctx), @@ -75,7 +75,7 @@ func TestAccBackupSelection_Disappears_backupPlan(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, backup.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSelectionDestroy(ctx), @@ -100,7 +100,7 @@ func TestAccBackupSelection_withTags(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, backup.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSelectionDestroy(ctx), @@ -129,7 +129,7 @@ func TestAccBackupSelection_conditionsWithTags(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, backup.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSelectionDestroy(ctx), @@ -162,7 +162,7 @@ func TestAccBackupSelection_withResources(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, backup.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSelectionDestroy(ctx), @@ -191,7 +191,7 @@ func TestAccBackupSelection_withNotResources(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, backup.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSelectionDestroy(ctx), @@ -220,7 +220,7 @@ func TestAccBackupSelection_updateTag(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, backup.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSelectionDestroy(ctx), diff --git a/internal/service/backup/vault_data_source_test.go b/internal/service/backup/vault_data_source_test.go index e5b41a7fc498..98461115bf01 100644 --- a/internal/service/backup/vault_data_source_test.go +++ b/internal/service/backup/vault_data_source_test.go @@ -17,7 +17,7 @@ func TestAccBackupVaultDataSource_basic(t *testing.T) { rInt := sdkacctest.RandInt() resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, backup.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ diff --git a/internal/service/backup/vault_lock_configuration_test.go b/internal/service/backup/vault_lock_configuration_test.go index 7369e90b0c66..12b5c025a8b3 100644 --- a/internal/service/backup/vault_lock_configuration_test.go +++ b/internal/service/backup/vault_lock_configuration_test.go @@ -22,7 +22,7 @@ func TestAccBackupVaultLockConfiguration_basic(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resourceName := "aws_backup_vault_lock_configuration.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, backup.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckVaultLockConfigurationDestroy(ctx), @@ -54,7 +54,7 @@ func TestAccBackupVaultLockConfiguration_disappears(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resourceName := "aws_backup_vault_lock_configuration.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, backup.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckVaultLockConfigurationDestroy(ctx), diff --git a/internal/service/backup/vault_notifications_test.go b/internal/service/backup/vault_notifications_test.go index 6297dc0e67a9..6d8e83e15f88 100644 --- a/internal/service/backup/vault_notifications_test.go +++ b/internal/service/backup/vault_notifications_test.go @@ -22,7 +22,7 @@ func TestAccBackupVaultNotification_basic(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resourceName := "aws_backup_vault_notifications.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, backup.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckVaultNotificationDestroy(ctx), @@ -50,7 +50,7 @@ func TestAccBackupVaultNotification_disappears(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resourceName := "aws_backup_vault_notifications.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, backup.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckVaultNotificationDestroy(ctx), diff --git a/internal/service/backup/vault_policy_test.go b/internal/service/backup/vault_policy_test.go index 0309e3c4f049..2e127c2c0675 100644 --- a/internal/service/backup/vault_policy_test.go +++ b/internal/service/backup/vault_policy_test.go @@ -23,7 +23,7 @@ func TestAccBackupVaultPolicy_basic(t *testing.T) { resourceName := "aws_backup_vault_policy.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, backup.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckVaultPolicyDestroy(ctx), @@ -58,7 +58,7 @@ func TestAccBackupVaultPolicy_disappears(t *testing.T) { resourceName := "aws_backup_vault_policy.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, backup.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckVaultPolicyDestroy(ctx), @@ -83,7 +83,7 @@ func TestAccBackupVaultPolicy_Disappears_vault(t *testing.T) { vaultResourceName := "aws_backup_vault.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, backup.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckVaultPolicyDestroy(ctx), @@ -107,7 +107,7 @@ func TestAccBackupVaultPolicy_ignoreEquivalent(t *testing.T) { resourceName := "aws_backup_vault_policy.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, backup.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckVaultPolicyDestroy(ctx), diff --git a/internal/service/backup/vault_test.go b/internal/service/backup/vault_test.go index 9c1151864280..12ea933f10f5 100644 --- a/internal/service/backup/vault_test.go +++ b/internal/service/backup/vault_test.go @@ -25,7 +25,7 @@ func TestAccBackupVault_basic(t *testing.T) { resourceName := "aws_backup_vault.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, backup.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckVaultDestroy(ctx), @@ -58,7 +58,7 @@ func TestAccBackupVault_disappears(t *testing.T) { resourceName := "aws_backup_vault.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, backup.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckVaultDestroy(ctx), @@ -82,7 +82,7 @@ func TestAccBackupVault_tags(t *testing.T) { resourceName := "aws_backup_vault.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, backup.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckVaultDestroy(ctx), @@ -129,7 +129,7 @@ func TestAccBackupVault_withKMSKey(t *testing.T) { resourceName := "aws_backup_vault.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, backup.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckVaultDestroy(ctx), @@ -158,7 +158,7 @@ func TestAccBackupVault_forceDestroyEmpty(t *testing.T) { resourceName := "aws_backup_vault.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, backup.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckVaultDestroy(ctx), @@ -187,7 +187,7 @@ func TestAccBackupVault_forceDestroyWithRecoveryPoint(t *testing.T) { resourceName := "aws_backup_vault.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, backup.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckVaultDestroy(ctx), From eeb9b63eaccd2ee33005b4ea01811782c4a734df Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Fri, 24 Feb 2023 16:36:36 -0500 Subject: [PATCH 101/763] Add 'Context' argument to 'acctest.PreCheck' for batch. --- .../compute_environment_data_source_test.go | 2 +- .../service/batch/compute_environment_test.go | 48 +++++++++---------- internal/service/batch/job_definition_test.go | 18 +++---- .../batch/job_queue_data_source_test.go | 4 +- internal/service/batch/job_queue_test.go | 14 +++--- .../scheduling_policy_data_source_test.go | 2 +- .../service/batch/scheduling_policy_test.go | 4 +- 7 files changed, 46 insertions(+), 46 deletions(-) diff --git a/internal/service/batch/compute_environment_data_source_test.go b/internal/service/batch/compute_environment_data_source_test.go index 7e95ac96b167..b0be035b2212 100644 --- a/internal/service/batch/compute_environment_data_source_test.go +++ b/internal/service/batch/compute_environment_data_source_test.go @@ -17,7 +17,7 @@ func TestAccBatchComputeEnvironmentDataSource_basic(t *testing.T) { datasourceName := "data.aws_batch_compute_environment.by_name" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, batch.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ diff --git a/internal/service/batch/compute_environment_test.go b/internal/service/batch/compute_environment_test.go index 07259340d862..fd87ea72d1f6 100644 --- a/internal/service/batch/compute_environment_test.go +++ b/internal/service/batch/compute_environment_test.go @@ -24,7 +24,7 @@ func TestAccBatchComputeEnvironment_basic(t *testing.T) { serviceRoleResourceName := "aws_iam_role.batch_service" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, batch.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckComputeEnvironmentDestroy(ctx), @@ -58,7 +58,7 @@ func TestAccBatchComputeEnvironment_disappears(t *testing.T) { resourceName := "aws_batch_compute_environment.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, batch.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckComputeEnvironmentDestroy(ctx), @@ -82,7 +82,7 @@ func TestAccBatchComputeEnvironment_nameGenerated(t *testing.T) { resourceName := "aws_batch_compute_environment.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, batch.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckComputeEnvironmentDestroy(ctx), @@ -111,7 +111,7 @@ func TestAccBatchComputeEnvironment_namePrefix(t *testing.T) { resourceName := "aws_batch_compute_environment.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, batch.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckComputeEnvironmentDestroy(ctx), @@ -141,7 +141,7 @@ func TestAccBatchComputeEnvironment_eksConfiguration(t *testing.T) { eksClusterResourceName := "aws_eks_cluster.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, batch.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, ExternalProviders: map[string]resource.ExternalProvider{ @@ -176,7 +176,7 @@ func TestAccBatchComputeEnvironment_createEC2(t *testing.T) { subnetResourceName := "aws_subnet.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, batch.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckComputeEnvironmentDestroy(ctx), @@ -245,7 +245,7 @@ func TestAccBatchComputeEnvironment_CreateEC2DesiredVCPUsEC2KeyPairImageID_compu } resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, batch.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckComputeEnvironmentDestroy(ctx), @@ -307,7 +307,7 @@ func TestAccBatchComputeEnvironment_createSpot(t *testing.T) { subnetResourceName := "aws_subnet.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, batch.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckComputeEnvironmentDestroy(ctx), @@ -368,7 +368,7 @@ func TestAccBatchComputeEnvironment_CreateSpotAllocationStrategy_bidPercentage(t subnetResourceName := "aws_subnet.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, batch.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckComputeEnvironmentDestroy(ctx), @@ -427,7 +427,7 @@ func TestAccBatchComputeEnvironment_createFargate(t *testing.T) { subnetResourceName := "aws_subnet.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, batch.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckComputeEnvironmentDestroy(ctx), @@ -485,7 +485,7 @@ func TestAccBatchComputeEnvironment_createFargateSpot(t *testing.T) { subnetResourceName := "aws_subnet.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, batch.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckComputeEnvironmentDestroy(ctx), @@ -541,7 +541,7 @@ func TestAccBatchComputeEnvironment_updateState(t *testing.T) { serviceRoleResourceName := "aws_iam_role.batch_service" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, batch.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckComputeEnvironmentDestroy(ctx), @@ -600,7 +600,7 @@ func TestAccBatchComputeEnvironment_updateServiceRole(t *testing.T) { subnetResourceName := "aws_subnet.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, batch.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckComputeEnvironmentDestroy(ctx), @@ -692,7 +692,7 @@ func TestAccBatchComputeEnvironment_defaultServiceRole(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) testAccPreCheck(ctx, t) acctest.PreCheckIAMServiceLinkedRole(ctx, t, "/aws-service-role/batch") }, @@ -754,7 +754,7 @@ func TestAccBatchComputeEnvironment_ComputeResources_minVCPUs(t *testing.T) { subnetResourceName := "aws_subnet.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, batch.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckComputeEnvironmentDestroy(ctx), @@ -884,7 +884,7 @@ func TestAccBatchComputeEnvironment_ComputeResources_maxVCPUs(t *testing.T) { subnetResourceName := "aws_subnet.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, batch.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckComputeEnvironmentDestroy(ctx), @@ -1015,7 +1015,7 @@ func TestAccBatchComputeEnvironment_ec2Configuration(t *testing.T) { subnetResourceName := "aws_subnet.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, batch.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckComputeEnvironmentDestroy(ctx), @@ -1078,7 +1078,7 @@ func TestAccBatchComputeEnvironment_launchTemplate(t *testing.T) { subnetResourceName := "aws_subnet.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, batch.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckComputeEnvironmentDestroy(ctx), @@ -1142,7 +1142,7 @@ func TestAccBatchComputeEnvironment_updateLaunchTemplate(t *testing.T) { subnetResourceName := "aws_subnet.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, batch.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckComputeEnvironmentDestroy(ctx), @@ -1245,7 +1245,7 @@ func TestAccBatchComputeEnvironment_UpdateSecurityGroupsAndSubnets_fargate(t *te subnetResourceName2 := "aws_subnet.test_2" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, batch.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckComputeEnvironmentDestroy(ctx), @@ -1335,7 +1335,7 @@ func TestAccBatchComputeEnvironment_tags(t *testing.T) { resourceName := "aws_batch_compute_environment.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, batch.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckComputeEnvironmentDestroy(ctx), @@ -1379,7 +1379,7 @@ func TestAccBatchComputeEnvironment_createUnmanagedWithComputeResources(t *testi rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, batch.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckComputeEnvironmentDestroy(ctx), @@ -1399,7 +1399,7 @@ func TestAccBatchComputeEnvironment_createEC2WithoutComputeResources(t *testing. rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, batch.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckComputeEnvironmentDestroy(ctx), @@ -1417,7 +1417,7 @@ func TestAccBatchComputeEnvironment_createSpotWithoutIAMFleetRole(t *testing.T) rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, batch.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckComputeEnvironmentDestroy(ctx), diff --git a/internal/service/batch/job_definition_test.go b/internal/service/batch/job_definition_test.go index 21bca63976e8..2e8bbfac1a55 100644 --- a/internal/service/batch/job_definition_test.go +++ b/internal/service/batch/job_definition_test.go @@ -26,7 +26,7 @@ func TestAccBatchJobDefinition_basic(t *testing.T) { resourceName := "aws_batch_job_definition.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, batch.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckJobDefinitionDestroy(ctx), @@ -64,7 +64,7 @@ func TestAccBatchJobDefinition_disappears(t *testing.T) { resourceName := "aws_batch_job_definition.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, batch.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckJobDefinitionDestroy(ctx), @@ -88,7 +88,7 @@ func TestAccBatchJobDefinition_PlatformCapabilities_ec2(t *testing.T) { resourceName := "aws_batch_job_definition.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, batch.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckJobDefinitionDestroy(ctx), @@ -127,7 +127,7 @@ func TestAccBatchJobDefinition_PlatformCapabilitiesFargate_containerPropertiesDe resourceName := "aws_batch_job_definition.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, batch.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckJobDefinitionDestroy(ctx), @@ -166,7 +166,7 @@ func TestAccBatchJobDefinition_PlatformCapabilities_fargate(t *testing.T) { resourceName := "aws_batch_job_definition.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, batch.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckJobDefinitionDestroy(ctx), @@ -244,7 +244,7 @@ func TestAccBatchJobDefinition_ContainerProperties_advanced(t *testing.T) { resourceName := "aws_batch_job_definition.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, batch.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckJobDefinitionDestroy(ctx), @@ -272,7 +272,7 @@ func TestAccBatchJobDefinition_updateForcesNewResource(t *testing.T) { resourceName := "aws_batch_job_definition.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, batch.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckJobDefinitionDestroy(ctx), @@ -307,7 +307,7 @@ func TestAccBatchJobDefinition_tags(t *testing.T) { resourceName := "aws_batch_job_definition.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, batch.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckJobDefinitionDestroy(ctx), @@ -353,7 +353,7 @@ func TestAccBatchJobDefinition_propagateTags(t *testing.T) { resourceName := "aws_batch_job_definition.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, batch.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckJobDefinitionDestroy(ctx), diff --git a/internal/service/batch/job_queue_data_source_test.go b/internal/service/batch/job_queue_data_source_test.go index 806e02ae0b3c..59cf72c33c4d 100644 --- a/internal/service/batch/job_queue_data_source_test.go +++ b/internal/service/batch/job_queue_data_source_test.go @@ -17,7 +17,7 @@ func TestAccBatchJobQueueDataSource_basic(t *testing.T) { datasourceName := "data.aws_batch_job_queue.by_name" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, batch.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ @@ -44,7 +44,7 @@ func TestAccBatchJobQueueDataSource_schedulingPolicy(t *testing.T) { datasourceName := "data.aws_batch_job_queue.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, batch.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ diff --git a/internal/service/batch/job_queue_test.go b/internal/service/batch/job_queue_test.go index 98572c3f689c..1429a9796f83 100644 --- a/internal/service/batch/job_queue_test.go +++ b/internal/service/batch/job_queue_test.go @@ -25,7 +25,7 @@ func TestAccBatchJobQueue_basic(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, batch.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckJobQueueDestroy(ctx), @@ -58,7 +58,7 @@ func TestAccBatchJobQueue_disappears(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, batch.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckLaunchTemplateDestroy(ctx), @@ -83,7 +83,7 @@ func TestAccBatchJobQueue_ComputeEnvironments_externalOrderUpdate(t *testing.T) rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, batch.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckJobQueueDestroy(ctx), @@ -111,7 +111,7 @@ func TestAccBatchJobQueue_priority(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, batch.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckJobQueueDestroy(ctx), @@ -148,7 +148,7 @@ func TestAccBatchJobQueue_schedulingPolicy(t *testing.T) { schedulingPolicyName2 := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, batch.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckJobQueueDestroy(ctx), @@ -185,7 +185,7 @@ func TestAccBatchJobQueue_state(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, batch.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckJobQueueDestroy(ctx), @@ -220,7 +220,7 @@ func TestAccBatchJobQueue_tags(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, batch.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckJobQueueDestroy(ctx), diff --git a/internal/service/batch/scheduling_policy_data_source_test.go b/internal/service/batch/scheduling_policy_data_source_test.go index e397f041f652..150a306d7062 100644 --- a/internal/service/batch/scheduling_policy_data_source_test.go +++ b/internal/service/batch/scheduling_policy_data_source_test.go @@ -16,7 +16,7 @@ func TestAccBatchSchedulingPolicyDataSource_basic(t *testing.T) { datasourceName := "data.aws_batch_scheduling_policy.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, batch.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ diff --git a/internal/service/batch/scheduling_policy_test.go b/internal/service/batch/scheduling_policy_test.go index 057c3df489e1..fda315fd6bab 100644 --- a/internal/service/batch/scheduling_policy_test.go +++ b/internal/service/batch/scheduling_policy_test.go @@ -23,7 +23,7 @@ func TestAccBatchSchedulingPolicy_basic(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, batch.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSchedulingPolicyDestroy(ctx), @@ -71,7 +71,7 @@ func TestAccBatchSchedulingPolicy_disappears(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, batch.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSchedulingPolicyDestroy(ctx), From 29ec493b0189f14e32e0ba3c022af2a24ac301c2 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Fri, 24 Feb 2023 16:36:37 -0500 Subject: [PATCH 102/763] Add 'Context' argument to 'acctest.PreCheck' for budgets. --- internal/service/budgets/budget_action_test.go | 4 ++-- internal/service/budgets/budget_test.go | 18 +++++++++--------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/internal/service/budgets/budget_action_test.go b/internal/service/budgets/budget_action_test.go index 90cd0c58f223..b039fb642064 100644 --- a/internal/service/budgets/budget_action_test.go +++ b/internal/service/budgets/budget_action_test.go @@ -23,7 +23,7 @@ func TestAccBudgetsBudgetAction_basic(t *testing.T) { var conf budgets.Action resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(budgets.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(budgets.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, budgets.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckBudgetActionDestroy(ctx), @@ -64,7 +64,7 @@ func TestAccBudgetsBudgetAction_disappears(t *testing.T) { var conf budgets.Action resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(budgets.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(budgets.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, budgets.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckBudgetActionDestroy(ctx), diff --git a/internal/service/budgets/budget_test.go b/internal/service/budgets/budget_test.go index 52eba81c3ba8..fd5805ea07c8 100644 --- a/internal/service/budgets/budget_test.go +++ b/internal/service/budgets/budget_test.go @@ -52,7 +52,7 @@ func TestAccBudgetsBudget_basic(t *testing.T) { resourceName := "aws_budgets_budget.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(budgets.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(budgets.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, budgets.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckBudgetDestroy(ctx), @@ -97,7 +97,7 @@ func TestAccBudgetsBudget_Name_generated(t *testing.T) { resourceName := "aws_budgets_budget.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(budgets.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(budgets.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, budgets.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckBudgetDestroy(ctx), @@ -141,7 +141,7 @@ func TestAccBudgetsBudget_namePrefix(t *testing.T) { resourceName := "aws_budgets_budget.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(budgets.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(budgets.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, budgets.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckBudgetDestroy(ctx), @@ -180,7 +180,7 @@ func TestAccBudgetsBudget_disappears(t *testing.T) { resourceName := "aws_budgets_budget.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(budgets.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(budgets.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, budgets.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckBudgetDestroy(ctx), @@ -204,7 +204,7 @@ func TestAccBudgetsBudget_autoAdjustDataForecast(t *testing.T) { resourceName := "aws_budgets_budget.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(budgets.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(budgets.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, budgets.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckBudgetDestroy(ctx), @@ -238,7 +238,7 @@ func TestAccBudgetsBudget_autoAdjustDataHistorical(t *testing.T) { resourceName := "aws_budgets_budget.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(budgets.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(budgets.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, budgets.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckBudgetDestroy(ctx), @@ -303,7 +303,7 @@ func TestAccBudgetsBudget_costTypes(t *testing.T) { endDate2 := tfbudgets.TimePeriodTimestampToString(&ts4) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(budgets.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(budgets.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, budgets.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckBudgetDestroy(ctx), @@ -402,7 +402,7 @@ func TestAccBudgetsBudget_notifications(t *testing.T) { emailAddress3 := acctest.RandomEmailAddress(domain) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(budgets.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(budgets.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, budgets.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckBudgetDestroy(ctx), @@ -484,7 +484,7 @@ func TestAccBudgetsBudget_plannedLimits(t *testing.T) { config2, testCheckFuncs2 := generateStartTimes(resourceName, "200.0", now) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(budgets.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(budgets.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, budgets.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckBudgetDestroy(ctx), From 674d6dc633621f9f22f2ff5f0326e0656994fcde Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Fri, 24 Feb 2023 16:36:37 -0500 Subject: [PATCH 103/763] Add 'Context' argument to 'acctest.PreCheck' for ce. --- internal/service/ce/anomaly_monitor_test.go | 10 +++++----- internal/service/ce/anomaly_subscription_test.go | 16 ++++++++-------- internal/service/ce/cost_allocation_tag_test.go | 2 +- .../service/ce/cost_category_data_source_test.go | 2 +- internal/service/ce/cost_category_test.go | 12 ++++++------ internal/service/ce/tags_data_source_test.go | 4 ++-- 6 files changed, 23 insertions(+), 23 deletions(-) diff --git a/internal/service/ce/anomaly_monitor_test.go b/internal/service/ce/anomaly_monitor_test.go index 9542096ac13e..1d8f1f8958cd 100644 --- a/internal/service/ce/anomaly_monitor_test.go +++ b/internal/service/ce/anomaly_monitor_test.go @@ -26,7 +26,7 @@ func TestAccCEAnomalyMonitor_basic(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckAnomalyMonitorDestroy(ctx), ErrorCheck: acctest.ErrorCheck(t, costexplorer.EndpointsID), @@ -57,7 +57,7 @@ func TestAccCEAnomalyMonitor_disappears(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckAnomalyMonitorDestroy(ctx), ErrorCheck: acctest.ErrorCheck(t, costexplorer.EndpointsID), @@ -82,7 +82,7 @@ func TestAccCEAnomalyMonitor_update(t *testing.T) { rName2 := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckAnomalyMonitorDestroy(ctx), ErrorCheck: acctest.ErrorCheck(t, costexplorer.EndpointsID), @@ -117,7 +117,7 @@ func TestAccCEAnomalyMonitor_tags(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckAnomalyMonitorDestroy(ctx), ErrorCheck: acctest.ErrorCheck(t, costexplorer.EndpointsID), @@ -166,7 +166,7 @@ func TestAccCEAnomalyMonitor_Dimensional(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckAnomalyMonitorDestroy(ctx), ErrorCheck: acctest.ErrorCheck(t, costexplorer.EndpointsID), diff --git a/internal/service/ce/anomaly_subscription_test.go b/internal/service/ce/anomaly_subscription_test.go index 978e78b4d702..32b6ef5b4fb1 100644 --- a/internal/service/ce/anomaly_subscription_test.go +++ b/internal/service/ce/anomaly_subscription_test.go @@ -28,7 +28,7 @@ func TestAccCEAnomalySubscription_basic(t *testing.T) { address := acctest.RandomEmailAddress(domain) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckAnomalySubscriptionDestroy(ctx), ErrorCheck: acctest.ErrorCheck(t, costexplorer.EndpointsID), @@ -65,7 +65,7 @@ func TestAccCEAnomalySubscription_thresholdExpression(t *testing.T) { address := acctest.RandomEmailAddress(domain) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckAnomalySubscriptionDestroy(ctx), ErrorCheck: acctest.ErrorCheck(t, costexplorer.EndpointsID), @@ -96,7 +96,7 @@ func TestAccCEAnomalySubscription_disappears(t *testing.T) { address := acctest.RandomEmailAddress(domain) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckAnomalySubscriptionDestroy(ctx), ErrorCheck: acctest.ErrorCheck(t, costexplorer.EndpointsID), @@ -122,7 +122,7 @@ func TestAccCEAnomalySubscription_Frequency(t *testing.T) { address := acctest.RandomEmailAddress(domain) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckAnomalySubscriptionDestroy(ctx), ErrorCheck: acctest.ErrorCheck(t, costexplorer.EndpointsID), @@ -160,7 +160,7 @@ func TestAccCEAnomalySubscription_MonitorARNList(t *testing.T) { address := acctest.RandomEmailAddress(domain) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckAnomalySubscriptionDestroy(ctx), ErrorCheck: acctest.ErrorCheck(t, costexplorer.EndpointsID), @@ -199,7 +199,7 @@ func TestAccCEAnomalySubscription_Subscriber(t *testing.T) { address2 := acctest.RandomEmailAddress(domain) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckAnomalySubscriptionDestroy(ctx), ErrorCheck: acctest.ErrorCheck(t, costexplorer.EndpointsID), @@ -266,7 +266,7 @@ func TestAccCEAnomalySubscription_Threshold(t *testing.T) { address := acctest.RandomEmailAddress(domain) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckAnomalySubscriptionDestroy(ctx), ErrorCheck: acctest.ErrorCheck(t, costexplorer.EndpointsID), @@ -303,7 +303,7 @@ func TestAccCEAnomalySubscription_Tags(t *testing.T) { address := acctest.RandomEmailAddress(domain) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckAnomalySubscriptionDestroy(ctx), ErrorCheck: acctest.ErrorCheck(t, costexplorer.EndpointsID), diff --git a/internal/service/ce/cost_allocation_tag_test.go b/internal/service/ce/cost_allocation_tag_test.go index c038a7ae7a9a..9e5625798e83 100644 --- a/internal/service/ce/cost_allocation_tag_test.go +++ b/internal/service/ce/cost_allocation_tag_test.go @@ -23,7 +23,7 @@ func TestAccCECostAllocationTag_basic(t *testing.T) { rName := "Tag01" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: nil, ErrorCheck: acctest.ErrorCheck(t, costexplorer.EndpointsID), diff --git a/internal/service/ce/cost_category_data_source_test.go b/internal/service/ce/cost_category_data_source_test.go index 095952c5fb2c..9c0e07bbb13b 100644 --- a/internal/service/ce/cost_category_data_source_test.go +++ b/internal/service/ce/cost_category_data_source_test.go @@ -17,7 +17,7 @@ func TestAccCECostCategoryDataSource_basic(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, ErrorCheck: acctest.ErrorCheck(t, costexplorer.EndpointsID), Steps: []resource.TestStep{ diff --git a/internal/service/ce/cost_category_test.go b/internal/service/ce/cost_category_test.go index 738ad0309616..ee3595a62362 100644 --- a/internal/service/ce/cost_category_test.go +++ b/internal/service/ce/cost_category_test.go @@ -23,7 +23,7 @@ func TestAccCECostCategory_basic(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckCostCategoryDestroy(ctx), ErrorCheck: acctest.ErrorCheck(t, costexplorer.EndpointsID), @@ -53,7 +53,7 @@ func TestAccCECostCategory_effectiveStart(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckCostCategoryDestroy(ctx), ErrorCheck: acctest.ErrorCheck(t, costexplorer.EndpointsID), @@ -90,7 +90,7 @@ func TestAccCECostCategory_disappears(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckCostCategoryDestroy(ctx), ErrorCheck: acctest.ErrorCheck(t, costexplorer.EndpointsID), @@ -114,7 +114,7 @@ func TestAccCECostCategory_complete(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckCostCategoryDestroy(ctx), ErrorCheck: acctest.ErrorCheck(t, costexplorer.EndpointsID), @@ -149,7 +149,7 @@ func TestAccCECostCategory_splitCharge(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckCostCategoryDestroy(ctx), ErrorCheck: acctest.ErrorCheck(t, costexplorer.EndpointsID), @@ -184,7 +184,7 @@ func TestAccCECostCategory_tags(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckCostCategoryDestroy(ctx), ErrorCheck: acctest.ErrorCheck(t, costexplorer.EndpointsID), diff --git a/internal/service/ce/tags_data_source_test.go b/internal/service/ce/tags_data_source_test.go index 9d5c38c1bd57..5d37130bf97a 100644 --- a/internal/service/ce/tags_data_source_test.go +++ b/internal/service/ce/tags_data_source_test.go @@ -25,7 +25,7 @@ func TestAccCETagsDataSource_basic(t *testing.T) { endDate := currentTime.Format(formatDate) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, ErrorCheck: acctest.ErrorCheck(t, costexplorer.EndpointsID), Steps: []resource.TestStep{ @@ -54,7 +54,7 @@ func TestAccCETagsDataSource_filter(t *testing.T) { endDate := currentTime.Format(formatDate) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, ErrorCheck: acctest.ErrorCheck(t, costexplorer.EndpointsID), Steps: []resource.TestStep{ From 821944fc92da0dd27a57271153658299f3cd0b60 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Fri, 24 Feb 2023 16:36:37 -0500 Subject: [PATCH 104/763] Add 'Context' argument to 'acctest.PreCheck' for chime. --- internal/service/chime/voice_connector_group_test.go | 6 +++--- internal/service/chime/voice_connector_logging_test.go | 6 +++--- internal/service/chime/voice_connector_origination_test.go | 6 +++--- internal/service/chime/voice_connector_streaming_test.go | 6 +++--- .../chime/voice_connector_termination_credentials_test.go | 6 +++--- internal/service/chime/voice_connector_termination_test.go | 6 +++--- internal/service/chime/voice_connector_test.go | 6 +++--- 7 files changed, 21 insertions(+), 21 deletions(-) diff --git a/internal/service/chime/voice_connector_group_test.go b/internal/service/chime/voice_connector_group_test.go index d3a17ff53101..4edf64dfb9e3 100644 --- a/internal/service/chime/voice_connector_group_test.go +++ b/internal/service/chime/voice_connector_group_test.go @@ -23,7 +23,7 @@ func TestAccChimeVoiceConnectorGroup_basic(t *testing.T) { resourceName := "aws_chime_voice_connector_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, chime.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckVoiceConnectorGroupDestroy(ctx), @@ -54,7 +54,7 @@ func TestAccChimeVoiceConnectorGroup_disappears(t *testing.T) { resourceName := "aws_chime_voice_connector_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, chime.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckVoiceConnectorGroupDestroy(ctx), @@ -79,7 +79,7 @@ func TestAccChimeVoiceConnectorGroup_update(t *testing.T) { resourceName := "aws_chime_voice_connector_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, chime.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckVoiceConnectorGroupDestroy(ctx), diff --git a/internal/service/chime/voice_connector_logging_test.go b/internal/service/chime/voice_connector_logging_test.go index 798f1bc948a5..08a92ab8b801 100644 --- a/internal/service/chime/voice_connector_logging_test.go +++ b/internal/service/chime/voice_connector_logging_test.go @@ -21,7 +21,7 @@ func TestAccChimeVoiceConnectorLogging_basic(t *testing.T) { resourceName := "aws_chime_voice_connector_logging.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, chime.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckVoiceConnectorDestroy(ctx), @@ -49,7 +49,7 @@ func TestAccChimeVoiceConnectorLogging_disappears(t *testing.T) { resourceName := "aws_chime_voice_connector_logging.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, chime.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckVoiceConnectorDestroy(ctx), @@ -72,7 +72,7 @@ func TestAccChimeVoiceConnectorLogging_update(t *testing.T) { resourceName := "aws_chime_voice_connector_logging.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, chime.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckVoiceConnectorDestroy(ctx), diff --git a/internal/service/chime/voice_connector_origination_test.go b/internal/service/chime/voice_connector_origination_test.go index 7f080aa734ea..ee6a959dd5ee 100644 --- a/internal/service/chime/voice_connector_origination_test.go +++ b/internal/service/chime/voice_connector_origination_test.go @@ -22,7 +22,7 @@ func TestAccChimeVoiceConnectorOrigination_basic(t *testing.T) { resourceName := "aws_chime_voice_connector_origination.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, chime.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckVoiceConnectorOriginationDestroy(ctx), @@ -53,7 +53,7 @@ func TestAccChimeVoiceConnectorOrigination_disappears(t *testing.T) { resourceName := "aws_chime_voice_connector_origination.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, chime.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckVoiceConnectorOriginationDestroy(ctx), @@ -76,7 +76,7 @@ func TestAccChimeVoiceConnectorOrigination_update(t *testing.T) { resourceName := "aws_chime_voice_connector_origination.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, chime.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckVoiceConnectorOriginationDestroy(ctx), diff --git a/internal/service/chime/voice_connector_streaming_test.go b/internal/service/chime/voice_connector_streaming_test.go index cbea384af6f6..8ce706a3a76e 100644 --- a/internal/service/chime/voice_connector_streaming_test.go +++ b/internal/service/chime/voice_connector_streaming_test.go @@ -22,7 +22,7 @@ func TestAccChimeVoiceConnectorStreaming_basic(t *testing.T) { resourceName := "aws_chime_voice_connector_streaming.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, chime.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckVoiceConnectorStreamingDestroy(ctx), @@ -51,7 +51,7 @@ func TestAccChimeVoiceConnectorStreaming_disappears(t *testing.T) { resourceName := "aws_chime_voice_connector_streaming.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, chime.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckVoiceConnectorStreamingDestroy(ctx), @@ -74,7 +74,7 @@ func TestAccChimeVoiceConnectorStreaming_update(t *testing.T) { resourceName := "aws_chime_voice_connector_streaming.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, chime.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckVoiceConnectorStreamingDestroy(ctx), diff --git a/internal/service/chime/voice_connector_termination_credentials_test.go b/internal/service/chime/voice_connector_termination_credentials_test.go index 25bea1812130..7ebbbe7222f0 100644 --- a/internal/service/chime/voice_connector_termination_credentials_test.go +++ b/internal/service/chime/voice_connector_termination_credentials_test.go @@ -22,7 +22,7 @@ func TestAccChimeVoiceConnectorTerminationCredentials_basic(t *testing.T) { resourceName := "aws_chime_voice_connector_termination_credentials.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, chime.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckVoiceConnectorTerminationCredentialsDestroy(ctx), @@ -50,7 +50,7 @@ func TestAccChimeVoiceConnectorTerminationCredentials_disappears(t *testing.T) { resourceName := "aws_chime_voice_connector_termination_credentials.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, chime.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckVoiceConnectorTerminationCredentialsDestroy(ctx), @@ -73,7 +73,7 @@ func TestAccChimeVoiceConnectorTerminationCredentials_update(t *testing.T) { resourceName := "aws_chime_voice_connector_termination_credentials.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, chime.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckVoiceConnectorTerminationCredentialsDestroy(ctx), diff --git a/internal/service/chime/voice_connector_termination_test.go b/internal/service/chime/voice_connector_termination_test.go index 389fa2485913..019ae3c65cd0 100644 --- a/internal/service/chime/voice_connector_termination_test.go +++ b/internal/service/chime/voice_connector_termination_test.go @@ -22,7 +22,7 @@ func TestAccChimeVoiceConnectorTermination_basic(t *testing.T) { resourceName := "aws_chime_voice_connector_termination.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, chime.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckVoiceConnectorTerminationDestroy(ctx), @@ -52,7 +52,7 @@ func TestAccChimeVoiceConnectorTermination_disappears(t *testing.T) { resourceName := "aws_chime_voice_connector_termination.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, chime.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckVoiceConnectorTerminationDestroy(ctx), @@ -75,7 +75,7 @@ func TestAccChimeVoiceConnectorTermination_update(t *testing.T) { resourceName := "aws_chime_voice_connector_termination.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, chime.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckVoiceConnectorTerminationDestroy(ctx), diff --git a/internal/service/chime/voice_connector_test.go b/internal/service/chime/voice_connector_test.go index d64c7f18fd4a..6b3142cddd79 100644 --- a/internal/service/chime/voice_connector_test.go +++ b/internal/service/chime/voice_connector_test.go @@ -23,7 +23,7 @@ func TestAccChimeVoiceConnector_basic(t *testing.T) { resourceName := "aws_chime_voice_connector.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, chime.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckVoiceConnectorDestroy(ctx), @@ -54,7 +54,7 @@ func TestAccChimeVoiceConnector_disappears(t *testing.T) { resourceName := "aws_chime_voice_connector.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, chime.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckVoiceConnectorDestroy(ctx), @@ -79,7 +79,7 @@ func TestAccChimeVoiceConnector_update(t *testing.T) { resourceName := "aws_chime_voice_connector.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, chime.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckVoiceConnectorDestroy(ctx), From 7b1d1fc09732111f3803c9476ea9168138e9c7f8 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Fri, 24 Feb 2023 16:36:38 -0500 Subject: [PATCH 105/763] Add 'Context' argument to 'acctest.PreCheck' for cloud9. --- internal/service/cloud9/environment_ec2_test.go | 8 ++++---- internal/service/cloud9/environment_membership_test.go | 6 +++--- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/internal/service/cloud9/environment_ec2_test.go b/internal/service/cloud9/environment_ec2_test.go index d2d04f2ec656..225a92111f6b 100644 --- a/internal/service/cloud9/environment_ec2_test.go +++ b/internal/service/cloud9/environment_ec2_test.go @@ -24,7 +24,7 @@ func TestAccCloud9EnvironmentEC2_basic(t *testing.T) { resourceName := "aws_cloud9_environment_ec2.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(cloud9.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(cloud9.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, cloud9.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckEnvironmentEC2Destroy(ctx), @@ -63,7 +63,7 @@ func TestAccCloud9EnvironmentEC2_allFields(t *testing.T) { resourceName := "aws_cloud9_environment_ec2.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(cloud9.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(cloud9.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, cloud9.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckEnvironmentEC2Destroy(ctx), @@ -109,7 +109,7 @@ func TestAccCloud9EnvironmentEC2_tags(t *testing.T) { resourceName := "aws_cloud9_environment_ec2.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(cloud9.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(cloud9.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, cloud9.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckEnvironmentEC2Destroy(ctx), @@ -157,7 +157,7 @@ func TestAccCloud9EnvironmentEC2_disappears(t *testing.T) { resourceName := "aws_cloud9_environment_ec2.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(cloud9.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(cloud9.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, cloud9.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckEnvironmentEC2Destroy(ctx), diff --git a/internal/service/cloud9/environment_membership_test.go b/internal/service/cloud9/environment_membership_test.go index e7cbda8afab4..e9ff5dc917d0 100644 --- a/internal/service/cloud9/environment_membership_test.go +++ b/internal/service/cloud9/environment_membership_test.go @@ -23,7 +23,7 @@ func TestAccCloud9EnvironmentMembership_basic(t *testing.T) { resourceName := "aws_cloud9_environment_membership.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(cloud9.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(cloud9.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, cloud9.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckEnvironmentMemberDestroy(ctx), @@ -63,7 +63,7 @@ func TestAccCloud9EnvironmentMembership_disappears(t *testing.T) { resourceName := "aws_cloud9_environment_membership.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(cloud9.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(cloud9.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, cloud9.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckEnvironmentMemberDestroy(ctx), @@ -89,7 +89,7 @@ func TestAccCloud9EnvironmentMembership_disappears_env(t *testing.T) { resourceName := "aws_cloud9_environment_membership.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(cloud9.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(cloud9.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, cloud9.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckEnvironmentMemberDestroy(ctx), From 5e6f7878db5b1699e95568bf527e91584d6be8c2 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Fri, 24 Feb 2023 16:36:38 -0500 Subject: [PATCH 106/763] Add 'Context' argument to 'acctest.PreCheck' for cloudcontrol. --- .../cloudcontrol/resource_data_source_test.go | 2 +- .../service/cloudcontrol/resource_test.go | 38 +++++++++---------- 2 files changed, 20 insertions(+), 20 deletions(-) diff --git a/internal/service/cloudcontrol/resource_data_source_test.go b/internal/service/cloudcontrol/resource_data_source_test.go index b6aa8bb8c152..5dc773608135 100644 --- a/internal/service/cloudcontrol/resource_data_source_test.go +++ b/internal/service/cloudcontrol/resource_data_source_test.go @@ -17,7 +17,7 @@ func TestAccCloudControlResourceDataSource_basic(t *testing.T) { resourceName := "aws_cloudcontrolapi_resource.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, cloudcontrolapi.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckResourceDestroy(ctx), diff --git a/internal/service/cloudcontrol/resource_test.go b/internal/service/cloudcontrol/resource_test.go index 3876fb1d2a26..3a8c5353293a 100644 --- a/internal/service/cloudcontrol/resource_test.go +++ b/internal/service/cloudcontrol/resource_test.go @@ -34,7 +34,7 @@ func TestAccCloudControlResource_basic(t *testing.T) { resourceName := "aws_cloudcontrolapi_resource.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, cloudcontrolapi.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckResourceDestroy(ctx), @@ -56,7 +56,7 @@ func TestAccCloudControlResource_disappears(t *testing.T) { resourceName := "aws_cloudcontrolapi_resource.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, cloudcontrolapi.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckResourceDestroy(ctx), @@ -78,7 +78,7 @@ func TestAccCloudControlResource_DesiredState_booleanValueAdded(t *testing.T) { resourceName := "aws_cloudcontrolapi_resource.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, cloudcontrolapi.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckResourceDestroy(ctx), @@ -105,7 +105,7 @@ func TestAccCloudControlResource_DesiredState_booleanValueRemoved(t *testing.T) resourceName := "aws_cloudcontrolapi_resource.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, cloudcontrolapi.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckResourceDestroy(ctx), @@ -132,7 +132,7 @@ func TestAccCloudControlResource_DesiredState_booleanValueUpdate(t *testing.T) { resourceName := "aws_cloudcontrolapi_resource.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, cloudcontrolapi.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckResourceDestroy(ctx), @@ -160,7 +160,7 @@ func TestAccCloudControlResource_DesiredState_createOnly(t *testing.T) { resourceName := "aws_cloudcontrolapi_resource.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, cloudcontrolapi.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckResourceDestroy(ctx), @@ -187,7 +187,7 @@ func TestAccCloudControlResource_DesiredState_integerValueAdded(t *testing.T) { resourceName := "aws_cloudcontrolapi_resource.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, cloudcontrolapi.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckResourceDestroy(ctx), @@ -214,7 +214,7 @@ func TestAccCloudControlResource_DesiredState_integerValueRemoved(t *testing.T) resourceName := "aws_cloudcontrolapi_resource.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, cloudcontrolapi.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckResourceDestroy(ctx), @@ -241,7 +241,7 @@ func TestAccCloudControlResource_DesiredState_integerValueUpdate(t *testing.T) { resourceName := "aws_cloudcontrolapi_resource.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, cloudcontrolapi.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckResourceDestroy(ctx), @@ -267,7 +267,7 @@ func TestAccCloudControlResource_DesiredState_invalidPropertyName(t *testing.T) rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, cloudcontrolapi.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckResourceDestroy(ctx), @@ -285,7 +285,7 @@ func TestAccCloudControlResource_DesiredState_invalidPropertyValue(t *testing.T) rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, cloudcontrolapi.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckResourceDestroy(ctx), @@ -304,7 +304,7 @@ func TestAccCloudControlResource_DesiredState_objectValueAdded(t *testing.T) { resourceName := "aws_cloudcontrolapi_resource.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, cloudcontrolapi.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckResourceDestroy(ctx), @@ -331,7 +331,7 @@ func TestAccCloudControlResource_DesiredState_objectValueRemoved(t *testing.T) { resourceName := "aws_cloudcontrolapi_resource.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, cloudcontrolapi.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckResourceDestroy(ctx), @@ -358,7 +358,7 @@ func TestAccCloudControlResource_DesiredState_objectValueUpdate(t *testing.T) { resourceName := "aws_cloudcontrolapi_resource.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, cloudcontrolapi.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckResourceDestroy(ctx), @@ -391,7 +391,7 @@ func TestAccCloudControlResource_DesiredState_stringValueAdded(t *testing.T) { resourceName := "aws_cloudcontrolapi_resource.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, cloudcontrolapi.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckResourceDestroy(ctx), @@ -418,7 +418,7 @@ func TestAccCloudControlResource_DesiredState_stringValueRemoved(t *testing.T) { resourceName := "aws_cloudcontrolapi_resource.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, cloudcontrolapi.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckResourceDestroy(ctx), @@ -445,7 +445,7 @@ func TestAccCloudControlResource_DesiredState_stringValueUpdate(t *testing.T) { resourceName := "aws_cloudcontrolapi_resource.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, cloudcontrolapi.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckResourceDestroy(ctx), @@ -472,7 +472,7 @@ func TestAccCloudControlResource_resourceSchema(t *testing.T) { resourceName := "aws_cloudcontrolapi_resource.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, cloudcontrolapi.EndpointsID, cloudformation.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckResourceDestroy(ctx), @@ -494,7 +494,7 @@ func TestAccCloudControlResource_lambdaFunction(t *testing.T) { resourceName := "aws_cloudcontrolapi_resource.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, cloudcontrolapi.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckResourceDestroy(ctx), From 327debd6e7e0af99e4557b98a56fefd936aeb21d Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Fri, 24 Feb 2023 16:36:38 -0500 Subject: [PATCH 107/763] Add 'Context' argument to 'acctest.PreCheck' for cloudformation. --- .../cloudformation/export_data_source_test.go | 4 +-- .../cloudformation/stack_data_source_test.go | 4 +-- .../cloudformation/stack_set_instance_test.go | 14 ++++----- .../service/cloudformation/stack_set_test.go | 28 ++++++++--------- internal/service/cloudformation/stack_test.go | 30 +++++++++---------- .../cloudformation/type_data_source_test.go | 8 ++--- internal/service/cloudformation/type_test.go | 8 ++--- 7 files changed, 48 insertions(+), 48 deletions(-) diff --git a/internal/service/cloudformation/export_data_source_test.go b/internal/service/cloudformation/export_data_source_test.go index 01fec729d92f..7d4ca44e43d3 100644 --- a/internal/service/cloudformation/export_data_source_test.go +++ b/internal/service/cloudformation/export_data_source_test.go @@ -15,7 +15,7 @@ func TestAccCloudFormationExportDataSource_basic(t *testing.T) { dataSourceName := "data.aws_cloudformation_export.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, cloudformation.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ @@ -36,7 +36,7 @@ func TestAccCloudFormationExportDataSource_resourceReference(t *testing.T) { resourceName := "aws_cloudformation_stack.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, cloudformation.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ diff --git a/internal/service/cloudformation/stack_data_source_test.go b/internal/service/cloudformation/stack_data_source_test.go index 79b87c3267f7..f7c9ad93dce2 100644 --- a/internal/service/cloudformation/stack_data_source_test.go +++ b/internal/service/cloudformation/stack_data_source_test.go @@ -16,7 +16,7 @@ func TestAccCloudFormationStackDataSource_DataSource_basic(t *testing.T) { resourceName := "data.aws_cloudformation_stack.network" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, cloudformation.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ @@ -102,7 +102,7 @@ func TestAccCloudFormationStackDataSource_DataSource_yaml(t *testing.T) { resourceName := "data.aws_cloudformation_stack.yaml" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, cloudformation.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ diff --git a/internal/service/cloudformation/stack_set_instance_test.go b/internal/service/cloudformation/stack_set_instance_test.go index 572e52171756..6bcca6d78d96 100644 --- a/internal/service/cloudformation/stack_set_instance_test.go +++ b/internal/service/cloudformation/stack_set_instance_test.go @@ -24,7 +24,7 @@ func TestAccCloudFormationStackSetInstance_basic(t *testing.T) { resourceName := "aws_cloudformation_stack_set_instance.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckStackSet(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckStackSet(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, cloudformation.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckStackSetInstanceDestroy(ctx), @@ -63,7 +63,7 @@ func TestAccCloudFormationStackSetInstance_disappears(t *testing.T) { resourceName := "aws_cloudformation_stack_set_instance.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckStackSet(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckStackSet(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, cloudformation.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckStackSetInstanceDestroy(ctx), @@ -89,7 +89,7 @@ func TestAccCloudFormationStackSetInstance_Disappears_stackSet(t *testing.T) { resourceName := "aws_cloudformation_stack_set_instance.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckStackSet(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckStackSet(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, cloudformation.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckStackSetInstanceDestroy(ctx), @@ -115,7 +115,7 @@ func TestAccCloudFormationStackSetInstance_parameterOverrides(t *testing.T) { resourceName := "aws_cloudformation_stack_set_instance.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckStackSet(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckStackSet(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, cloudformation.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckStackSetInstanceDestroy(ctx), @@ -181,7 +181,7 @@ func TestAccCloudFormationStackSetInstance_retainStack(t *testing.T) { resourceName := "aws_cloudformation_stack_set_instance.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckStackSet(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckStackSet(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, cloudformation.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckStackSetInstanceDestroy(ctx), @@ -238,7 +238,7 @@ func TestAccCloudFormationStackSetInstance_deploymentTargets(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) testAccPreCheckStackSet(ctx, t) acctest.PreCheckOrganizationsEnabled(ctx, t) acctest.PreCheckOrganizationManagementAccount(ctx, t) @@ -284,7 +284,7 @@ func TestAccCloudFormationStackSetInstance_operationPreferences(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) testAccPreCheckStackSet(ctx, t) acctest.PreCheckOrganizationsEnabled(ctx, t) acctest.PreCheckOrganizationManagementAccount(ctx, t) diff --git a/internal/service/cloudformation/stack_set_test.go b/internal/service/cloudformation/stack_set_test.go index 4b0a0bc50eee..87bb5a360e55 100644 --- a/internal/service/cloudformation/stack_set_test.go +++ b/internal/service/cloudformation/stack_set_test.go @@ -26,7 +26,7 @@ func TestAccCloudFormationStackSet_basic(t *testing.T) { resourceName := "aws_cloudformation_stack_set.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckStackSet(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckStackSet(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, cloudformation.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckStackSetDestroy(ctx), @@ -71,7 +71,7 @@ func TestAccCloudFormationStackSet_disappears(t *testing.T) { resourceName := "aws_cloudformation_stack_set.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckStackSet(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckStackSet(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, cloudformation.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckStackSetDestroy(ctx), @@ -97,7 +97,7 @@ func TestAccCloudFormationStackSet_administrationRoleARN(t *testing.T) { resourceName := "aws_cloudformation_stack_set.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckStackSet(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckStackSet(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, cloudformation.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckStackSetDestroy(ctx), @@ -137,7 +137,7 @@ func TestAccCloudFormationStackSet_description(t *testing.T) { resourceName := "aws_cloudformation_stack_set.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckStackSet(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckStackSet(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, cloudformation.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckStackSetDestroy(ctx), @@ -177,7 +177,7 @@ func TestAccCloudFormationStackSet_executionRoleName(t *testing.T) { resourceName := "aws_cloudformation_stack_set.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckStackSet(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckStackSet(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, cloudformation.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckStackSetDestroy(ctx), @@ -218,7 +218,7 @@ func TestAccCloudFormationStackSet_name(t *testing.T) { resourceName := "aws_cloudformation_stack_set.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckStackSet(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckStackSet(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, cloudformation.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckStackSetDestroy(ctx), @@ -274,7 +274,7 @@ func TestAccCloudFormationStackSet_operationPreferences(t *testing.T) { resourceName := "aws_cloudformation_stack_set.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckStackSet(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckStackSet(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, cloudformation.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckStackSetDestroy(ctx), @@ -372,7 +372,7 @@ func TestAccCloudFormationStackSet_parameters(t *testing.T) { resourceName := "aws_cloudformation_stack_set.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckStackSet(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckStackSet(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, cloudformation.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckStackSetDestroy(ctx), @@ -434,7 +434,7 @@ func TestAccCloudFormationStackSet_Parameters_default(t *testing.T) { resourceName := "aws_cloudformation_stack_set.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckStackSet(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckStackSet(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, cloudformation.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckStackSetDestroy(ctx), @@ -488,7 +488,7 @@ func TestAccCloudFormationStackSet_Parameters_noEcho(t *testing.T) { resourceName := "aws_cloudformation_stack_set.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckStackSet(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckStackSet(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, cloudformation.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckStackSetDestroy(ctx), @@ -533,7 +533,7 @@ func TestAccCloudFormationStackSet_PermissionModel_serviceManaged(t *testing.T) resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) testAccPreCheckStackSet(ctx, t) acctest.PreCheckOrganizationsAccount(ctx, t) }, @@ -573,7 +573,7 @@ func TestAccCloudFormationStackSet_tags(t *testing.T) { resourceName := "aws_cloudformation_stack_set.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckStackSet(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckStackSet(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, cloudformation.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckStackSetDestroy(ctx), @@ -631,7 +631,7 @@ func TestAccCloudFormationStackSet_templateBody(t *testing.T) { resourceName := "aws_cloudformation_stack_set.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckStackSet(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckStackSet(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, cloudformation.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckStackSetDestroy(ctx), @@ -671,7 +671,7 @@ func TestAccCloudFormationStackSet_templateURL(t *testing.T) { resourceName := "aws_cloudformation_stack_set.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckStackSet(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckStackSet(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, cloudformation.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckStackSetDestroy(ctx), diff --git a/internal/service/cloudformation/stack_test.go b/internal/service/cloudformation/stack_test.go index a912008aca30..0358b89fa1cb 100644 --- a/internal/service/cloudformation/stack_test.go +++ b/internal/service/cloudformation/stack_test.go @@ -23,7 +23,7 @@ func TestAccCloudFormationStack_basic(t *testing.T) { resourceName := "aws_cloudformation_stack.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, cloudformation.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckStackDestroy(ctx), @@ -50,7 +50,7 @@ func TestAccCloudFormationStack_CreationFailure_doNothing(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, cloudformation.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckStackDestroy(ctx), @@ -68,7 +68,7 @@ func TestAccCloudFormationStack_CreationFailure_delete(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, cloudformation.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckStackDestroy(ctx), @@ -86,7 +86,7 @@ func TestAccCloudFormationStack_CreationFailure_rollback(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, cloudformation.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckStackDestroy(ctx), @@ -109,7 +109,7 @@ func TestAccCloudFormationStack_updateFailure(t *testing.T) { vpcCidrInvalid := "1000.0.0.0/16" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, cloudformation.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckStackDestroy(ctx), @@ -135,7 +135,7 @@ func TestAccCloudFormationStack_disappears(t *testing.T) { resourceName := "aws_cloudformation_stack.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, cloudformation.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckStackDestroy(ctx), @@ -159,7 +159,7 @@ func TestAccCloudFormationStack_yaml(t *testing.T) { resourceName := "aws_cloudformation_stack.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, cloudformation.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckStackDestroy(ctx), @@ -186,7 +186,7 @@ func TestAccCloudFormationStack_defaultParams(t *testing.T) { resourceName := "aws_cloudformation_stack.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, cloudformation.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckStackDestroy(ctx), @@ -215,7 +215,7 @@ func TestAccCloudFormationStack_allAttributes(t *testing.T) { expectedPolicyBody := "{\"Statement\":[{\"Action\":\"Update:*\",\"Effect\":\"Deny\",\"Principal\":\"*\",\"Resource\":\"LogicalResourceId/StaticVPC\"},{\"Action\":\"Update:*\",\"Effect\":\"Allow\",\"Principal\":\"*\",\"Resource\":\"*\"}]}" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, cloudformation.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckStackDestroy(ctx), @@ -277,7 +277,7 @@ func TestAccCloudFormationStack_withParams(t *testing.T) { vpcCidrUpdated := "12.0.0.0/16" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, cloudformation.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckStackDestroy(ctx), @@ -316,7 +316,7 @@ func TestAccCloudFormationStack_WithURL_withParams(t *testing.T) { resourceName := "aws_cloudformation_stack.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, cloudformation.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckStackDestroy(ctx), @@ -350,7 +350,7 @@ func TestAccCloudFormationStack_WithURLWithParams_withYAML(t *testing.T) { resourceName := "aws_cloudformation_stack.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, cloudformation.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckStackDestroy(ctx), @@ -379,7 +379,7 @@ func TestAccCloudFormationStack_WithURLWithParams_noUpdate(t *testing.T) { resourceName := "aws_cloudformation_stack.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, cloudformation.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckStackDestroy(ctx), @@ -413,7 +413,7 @@ func TestAccCloudFormationStack_withTransform(t *testing.T) { resourceName := "aws_cloudformation_stack.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, cloudformation.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckStackDestroy(ctx), @@ -443,7 +443,7 @@ func TestAccCloudFormationStack_onFailure(t *testing.T) { resourceName := "aws_cloudformation_stack.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, cloudformation.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckStackDestroy(ctx), diff --git a/internal/service/cloudformation/type_data_source_test.go b/internal/service/cloudformation/type_data_source_test.go index c395f20b8e43..c14cc0bdf9ac 100644 --- a/internal/service/cloudformation/type_data_source_test.go +++ b/internal/service/cloudformation/type_data_source_test.go @@ -20,7 +20,7 @@ func TestAccCloudFormationTypeDataSource_ARN_private(t *testing.T) { dataSourceName := "data.aws_cloudformation_type.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, cloudformation.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTypeDestroy(ctx), @@ -51,7 +51,7 @@ func TestAccCloudFormationTypeDataSource_ARN_public(t *testing.T) { dataSourceName := "data.aws_cloudformation_type.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, cloudformation.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: nil, @@ -86,7 +86,7 @@ func TestAccCloudFormationTypeDataSource_TypeName_private(t *testing.T) { dataSourceName := "data.aws_cloudformation_type.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, cloudformation.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTypeDestroy(ctx), @@ -117,7 +117,7 @@ func TestAccCloudFormationTypeDataSource_TypeName_public(t *testing.T) { dataSourceName := "data.aws_cloudformation_type.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, cloudformation.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: nil, diff --git a/internal/service/cloudformation/type_test.go b/internal/service/cloudformation/type_test.go index 97bc776a050a..55a0c8b287ca 100644 --- a/internal/service/cloudformation/type_test.go +++ b/internal/service/cloudformation/type_test.go @@ -31,7 +31,7 @@ func TestAccCloudFormationType_basic(t *testing.T) { resourceName := "aws_cloudformation_type.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, cloudformation.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTypeDestroy(ctx), @@ -70,7 +70,7 @@ func TestAccCloudFormationType_disappears(t *testing.T) { resourceName := "aws_cloudformation_type.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, cloudformation.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTypeDestroy(ctx), @@ -98,7 +98,7 @@ func TestAccCloudFormationType_executionRoleARN(t *testing.T) { resourceName := "aws_cloudformation_type.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, cloudformation.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTypeDestroy(ctx), @@ -124,7 +124,7 @@ func TestAccCloudFormationType_logging(t *testing.T) { resourceName := "aws_cloudformation_type.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, cloudformation.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTypeDestroy(ctx), From ed129afdabf2822d72eb0fceadb5dba9af2a2959 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Fri, 24 Feb 2023 16:36:39 -0500 Subject: [PATCH 108/763] Add 'Context' argument to 'acctest.PreCheck' for cloudfront. --- .../cache_policy_data_source_test.go | 2 +- .../service/cloudfront/cache_policy_test.go | 8 +-- .../distribution_data_source_test.go | 2 +- .../service/cloudfront/distribution_test.go | 72 +++++++++---------- .../field_level_encryption_config_test.go | 4 +- .../field_level_encryption_profile_test.go | 4 +- .../cloudfront/function_data_source_test.go | 2 +- internal/service/cloudfront/function_test.go | 14 ++-- internal/service/cloudfront/key_group_test.go | 8 +-- ...very_canonical_user_id_data_source_test.go | 6 +- .../monitoring_subscription_test.go | 6 +- .../cloudfront/origin_access_control_test.go | 10 +-- ...igin_access_identities_data_source_test.go | 4 +- ...origin_access_identity_data_source_test.go | 2 +- .../cloudfront/origin_access_identity_test.go | 6 +- .../origin_request_policy_data_source_test.go | 2 +- .../cloudfront/origin_request_policy_test.go | 6 +- .../service/cloudfront/public_key_test.go | 8 +-- .../realtime_log_config_data_source_test.go | 2 +- .../cloudfront/realtime_log_config_test.go | 6 +- ...esponse_headers_policy_data_source_test.go | 2 +- .../response_headers_policy_test.go | 10 +-- 22 files changed, 93 insertions(+), 93 deletions(-) diff --git a/internal/service/cloudfront/cache_policy_data_source_test.go b/internal/service/cloudfront/cache_policy_data_source_test.go index 9e12a8b0a1f6..4a54a9fe317f 100644 --- a/internal/service/cloudfront/cache_policy_data_source_test.go +++ b/internal/service/cloudfront/cache_policy_data_source_test.go @@ -18,7 +18,7 @@ func TestAccCloudFrontCachePolicyDataSource_basic(t *testing.T) { resourceName := "aws_cloudfront_cache_policy.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(cloudfront.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(cloudfront.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, cloudfront.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckPublicKeyDestroy(ctx), diff --git a/internal/service/cloudfront/cache_policy_test.go b/internal/service/cloudfront/cache_policy_test.go index 398ec9e345c7..aa4d8d20725a 100644 --- a/internal/service/cloudfront/cache_policy_test.go +++ b/internal/service/cloudfront/cache_policy_test.go @@ -21,7 +21,7 @@ func TestAccCloudFrontCachePolicy_basic(t *testing.T) { resourceName := "aws_cloudfront_cache_policy.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(cloudfront.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(cloudfront.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, cloudfront.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckCachePolicyDestroy(ctx), @@ -65,7 +65,7 @@ func TestAccCloudFrontCachePolicy_disappears(t *testing.T) { resourceName := "aws_cloudfront_cache_policy.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(cloudfront.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(cloudfront.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, cloudfront.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckCachePolicyDestroy(ctx), @@ -88,7 +88,7 @@ func TestAccCloudFrontCachePolicy_Items(t *testing.T) { resourceName := "aws_cloudfront_cache_policy.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(cloudfront.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(cloudfront.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, cloudfront.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckCachePolicyDestroy(ctx), @@ -170,7 +170,7 @@ func TestAccCloudFrontCachePolicy_ZeroTTLs(t *testing.T) { resourceName := "aws_cloudfront_cache_policy.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(cloudfront.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(cloudfront.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, cloudfront.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckCachePolicyDestroy(ctx), diff --git a/internal/service/cloudfront/distribution_data_source_test.go b/internal/service/cloudfront/distribution_data_source_test.go index 9b83730eebe8..0d0d54377184 100644 --- a/internal/service/cloudfront/distribution_data_source_test.go +++ b/internal/service/cloudfront/distribution_data_source_test.go @@ -15,7 +15,7 @@ func TestAccCloudFrontDistributionDataSource_basic(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(cloudfront.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(cloudfront.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, cloudfront.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ diff --git a/internal/service/cloudfront/distribution_test.go b/internal/service/cloudfront/distribution_test.go index 55676dc78fac..dd95101f577a 100644 --- a/internal/service/cloudfront/distribution_test.go +++ b/internal/service/cloudfront/distribution_test.go @@ -26,7 +26,7 @@ func TestAccCloudFrontDistribution_disappears(t *testing.T) { resourceName := "aws_cloudfront_distribution.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(cloudfront.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(cloudfront.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, cloudfront.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDistributionDestroy(ctx), @@ -58,7 +58,7 @@ func TestAccCloudFrontDistribution_s3Origin(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(cloudfront.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(cloudfront.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, cloudfront.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDistributionDestroy(ctx), @@ -93,7 +93,7 @@ func TestAccCloudFrontDistribution_s3OriginWithTags(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(cloudfront.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(cloudfront.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, cloudfront.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDistributionDestroy(ctx), @@ -142,7 +142,7 @@ func TestAccCloudFrontDistribution_customOrigin(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(cloudfront.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(cloudfront.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, cloudfront.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDistributionDestroy(ctx), @@ -175,7 +175,7 @@ func TestAccCloudFrontDistribution_originPolicyDefault(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(cloudfront.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(cloudfront.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, cloudfront.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDistributionDestroy(ctx), @@ -208,7 +208,7 @@ func TestAccCloudFrontDistribution_originPolicyOrdered(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(cloudfront.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(cloudfront.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, cloudfront.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDistributionDestroy(ctx), @@ -248,7 +248,7 @@ func TestAccCloudFrontDistribution_multiOrigin(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(cloudfront.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(cloudfront.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, cloudfront.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDistributionDestroy(ctx), @@ -291,7 +291,7 @@ func TestAccCloudFrontDistribution_orderedCacheBehavior(t *testing.T) { resourceName := "aws_cloudfront_distribution.main" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(cloudfront.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(cloudfront.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, cloudfront.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDistributionDestroy(ctx), @@ -331,7 +331,7 @@ func TestAccCloudFrontDistribution_orderedCacheBehaviorCachePolicy(t *testing.T) rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(cloudfront.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(cloudfront.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, cloudfront.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDistributionDestroy(ctx), @@ -368,7 +368,7 @@ func TestAccCloudFrontDistribution_orderedCacheBehaviorResponseHeadersPolicy(t * rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(cloudfront.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(cloudfront.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, cloudfront.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDistributionDestroy(ctx), @@ -405,7 +405,7 @@ func TestAccCloudFrontDistribution_forwardedValuesToCachePolicy(t *testing.T) { resourceName := "aws_cloudfront_distribution.main" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(cloudfront.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(cloudfront.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, cloudfront.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDistributionDestroy(ctx), @@ -429,7 +429,7 @@ func TestAccCloudFrontDistribution_forwardedValuesToCachePolicy(t *testing.T) { func TestAccCloudFrontDistribution_Origin_emptyDomainName(t *testing.T) { ctx := acctest.Context(t) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(cloudfront.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(cloudfront.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, cloudfront.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDistributionDestroy(ctx), @@ -445,7 +445,7 @@ func TestAccCloudFrontDistribution_Origin_emptyDomainName(t *testing.T) { func TestAccCloudFrontDistribution_Origin_emptyOriginID(t *testing.T) { ctx := acctest.Context(t) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(cloudfront.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(cloudfront.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, cloudfront.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDistributionDestroy(ctx), @@ -469,7 +469,7 @@ func TestAccCloudFrontDistribution_Origin_connectionAttempts(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService("cloudfront", t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService("cloudfront", t) }, ErrorCheck: acctest.ErrorCheck(t, cloudfront.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDistributionDestroy(ctx), @@ -505,7 +505,7 @@ func TestAccCloudFrontDistribution_Origin_connectionTimeout(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService("cloudfront", t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService("cloudfront", t) }, ErrorCheck: acctest.ErrorCheck(t, cloudfront.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDistributionDestroy(ctx), @@ -541,7 +541,7 @@ func TestAccCloudFrontDistribution_Origin_originShield(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService("cloudfront", t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService("cloudfront", t) }, ErrorCheck: acctest.ErrorCheck(t, cloudfront.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDistributionDestroy(ctx), @@ -589,7 +589,7 @@ func TestAccCloudFrontDistribution_Origin_originAccessControl(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(cloudfront.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(cloudfront.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, cloudfront.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDistributionDestroy(ctx), @@ -636,7 +636,7 @@ func TestAccCloudFrontDistribution_noOptionalItems(t *testing.T) { resourceName := "aws_cloudfront_distribution.no_optional_items" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(cloudfront.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(cloudfront.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, cloudfront.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDistributionDestroy(ctx), @@ -725,7 +725,7 @@ func TestAccCloudFrontDistribution_http11(t *testing.T) { var distribution cloudfront.Distribution resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(cloudfront.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(cloudfront.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, cloudfront.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDistributionDestroy(ctx), @@ -758,7 +758,7 @@ func TestAccCloudFrontDistribution_isIPV6Enabled(t *testing.T) { var distribution cloudfront.Distribution resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(cloudfront.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(cloudfront.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, cloudfront.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDistributionDestroy(ctx), @@ -793,7 +793,7 @@ func TestAccCloudFrontDistribution_noCustomErrorResponse(t *testing.T) { var distribution cloudfront.Distribution resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(cloudfront.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(cloudfront.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, cloudfront.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDistributionDestroy(ctx), @@ -824,7 +824,7 @@ func TestAccCloudFrontDistribution_DefaultCacheBehaviorForwardedValuesCookies_wh retainOnDelete := testAccDistributionRetainOnDeleteFromEnv() resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(cloudfront.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(cloudfront.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, cloudfront.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDistributionDestroy(ctx), @@ -869,7 +869,7 @@ func TestAccCloudFrontDistribution_DefaultCacheBehaviorForwardedValues_headers(t retainOnDelete := testAccDistributionRetainOnDeleteFromEnv() resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(cloudfront.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(cloudfront.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, cloudfront.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDistributionDestroy(ctx), @@ -914,7 +914,7 @@ func TestAccCloudFrontDistribution_DefaultCacheBehavior_trustedKeyGroups(t *test retainOnDelete := testAccDistributionRetainOnDeleteFromEnv() resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(cloudfront.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(cloudfront.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, cloudfront.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDistributionDestroy(ctx), @@ -952,7 +952,7 @@ func TestAccCloudFrontDistribution_DefaultCacheBehavior_trustedSigners(t *testin retainOnDelete := testAccDistributionRetainOnDeleteFromEnv() resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(cloudfront.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(cloudfront.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, cloudfront.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDistributionDestroy(ctx), @@ -990,7 +990,7 @@ func TestAccCloudFrontDistribution_DefaultCacheBehavior_realtimeLogARN(t *testin retainOnDelete := testAccDistributionRetainOnDeleteFromEnv() resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(cloudfront.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(cloudfront.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, cloudfront.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDistributionDestroy(ctx), @@ -1025,7 +1025,7 @@ func TestAccCloudFrontDistribution_OrderedCacheBehavior_realtimeLogARN(t *testin retainOnDelete := testAccDistributionRetainOnDeleteFromEnv() resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(cloudfront.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(cloudfront.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, cloudfront.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDistributionDestroy(ctx), @@ -1061,7 +1061,7 @@ func TestAccCloudFrontDistribution_enabled(t *testing.T) { resourceName := "aws_cloudfront_distribution.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(cloudfront.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(cloudfront.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, cloudfront.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDistributionDestroy(ctx), @@ -1108,7 +1108,7 @@ func TestAccCloudFrontDistribution_retainOnDelete(t *testing.T) { resourceName := "aws_cloudfront_distribution.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(cloudfront.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(cloudfront.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, cloudfront.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDistributionDestroy(ctx), @@ -1144,7 +1144,7 @@ func TestAccCloudFrontDistribution_OrderedCacheBehaviorForwardedValuesCookies_wh retainOnDelete := testAccDistributionRetainOnDeleteFromEnv() resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(cloudfront.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(cloudfront.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, cloudfront.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDistributionDestroy(ctx), @@ -1193,7 +1193,7 @@ func TestAccCloudFrontDistribution_OrderedCacheBehaviorForwardedValues_headers(t retainOnDelete := testAccDistributionRetainOnDeleteFromEnv() resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(cloudfront.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(cloudfront.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, cloudfront.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDistributionDestroy(ctx), @@ -1236,7 +1236,7 @@ func TestAccCloudFrontDistribution_ViewerCertificate_acmCertificateARN(t *testin retainOnDelete := testAccDistributionRetainOnDeleteFromEnv() resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(cloudfront.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(cloudfront.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, cloudfront.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDistributionDestroy(ctx), @@ -1269,7 +1269,7 @@ func TestAccCloudFrontDistribution_ViewerCertificateACMCertificateARN_conflictsW retainOnDelete := testAccDistributionRetainOnDeleteFromEnv() resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(cloudfront.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(cloudfront.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, cloudfront.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDistributionDestroy(ctx), @@ -1304,7 +1304,7 @@ func TestAccCloudFrontDistribution_waitForDeployment(t *testing.T) { resourceName := "aws_cloudfront_distribution.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(cloudfront.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(cloudfront.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, cloudfront.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDistributionDestroy(ctx), @@ -1358,7 +1358,7 @@ func TestAccCloudFrontDistribution_preconditionFailed(t *testing.T) { resourceName := "aws_cloudfront_distribution.main" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(cloudfront.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(cloudfront.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, cloudfront.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDistributionDestroy(ctx), @@ -1628,7 +1628,7 @@ func TestAccCloudFrontDistribution_originGroups(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(cloudfront.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(cloudfront.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, cloudfront.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDistributionDestroy(ctx), diff --git a/internal/service/cloudfront/field_level_encryption_config_test.go b/internal/service/cloudfront/field_level_encryption_config_test.go index f722f4c077ef..2b083b75f011 100644 --- a/internal/service/cloudfront/field_level_encryption_config_test.go +++ b/internal/service/cloudfront/field_level_encryption_config_test.go @@ -22,7 +22,7 @@ func TestAccCloudFrontFieldLevelEncryptionConfig_basic(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(cloudfront.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(cloudfront.EndpointsID, t) }, ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, ErrorCheck: acctest.ErrorCheck(t, cloudfront.EndpointsID), CheckDestroy: testAccCheckFieldLevelEncryptionConfigDestroy(ctx), @@ -87,7 +87,7 @@ func TestAccCloudFrontFieldLevelEncryptionConfig_disappears(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(cloudfront.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(cloudfront.EndpointsID, t) }, ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, ErrorCheck: acctest.ErrorCheck(t, cloudfront.EndpointsID), CheckDestroy: testAccCheckFieldLevelEncryptionConfigDestroy(ctx), diff --git a/internal/service/cloudfront/field_level_encryption_profile_test.go b/internal/service/cloudfront/field_level_encryption_profile_test.go index 97280ad01f27..419d4aaacbc0 100644 --- a/internal/service/cloudfront/field_level_encryption_profile_test.go +++ b/internal/service/cloudfront/field_level_encryption_profile_test.go @@ -22,7 +22,7 @@ func TestAccCloudFrontFieldLevelEncryptionProfile_basic(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(cloudfront.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(cloudfront.EndpointsID, t) }, ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, ErrorCheck: acctest.ErrorCheck(t, cloudfront.EndpointsID), CheckDestroy: testAccCheckFieldLevelEncryptionProfileDestroy(ctx), @@ -78,7 +78,7 @@ func TestAccCloudFrontFieldLevelEncryptionProfile_disappears(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(cloudfront.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(cloudfront.EndpointsID, t) }, ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, ErrorCheck: acctest.ErrorCheck(t, cloudfront.EndpointsID), CheckDestroy: testAccCheckFieldLevelEncryptionProfileDestroy(ctx), diff --git a/internal/service/cloudfront/function_data_source_test.go b/internal/service/cloudfront/function_data_source_test.go index 13446b393c07..37514a4af7bb 100644 --- a/internal/service/cloudfront/function_data_source_test.go +++ b/internal/service/cloudfront/function_data_source_test.go @@ -16,7 +16,7 @@ func TestAccCloudFrontFunctionDataSource_basic(t *testing.T) { resourceName := "aws_cloudfront_function.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(cloudfront.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(cloudfront.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, cloudfront.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ diff --git a/internal/service/cloudfront/function_test.go b/internal/service/cloudfront/function_test.go index 7484095db2d5..753dab28da9e 100644 --- a/internal/service/cloudfront/function_test.go +++ b/internal/service/cloudfront/function_test.go @@ -32,7 +32,7 @@ func TestAccCloudFrontFunction_basic(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(cloudfront.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(cloudfront.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, cloudfront.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckFunctionDestroy(ctx), @@ -69,7 +69,7 @@ func TestAccCloudFrontFunction_disappears(t *testing.T) { resourceName := "aws_cloudfront_function.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(cloudfront.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(cloudfront.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, cloudfront.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckFunctionDestroy(ctx), @@ -93,7 +93,7 @@ func TestAccCloudFrontFunction_publish(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(cloudfront.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(cloudfront.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, cloudfront.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckFunctionDestroy(ctx), @@ -137,7 +137,7 @@ func TestAccCloudFrontFunction_associated(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(cloudfront.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(cloudfront.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, cloudfront.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckFunctionDestroy(ctx), @@ -181,7 +181,7 @@ func TestAccCloudFrontFunction_Update_code(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(cloudfront.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(cloudfront.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, cloudfront.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckFunctionDestroy(ctx), @@ -217,7 +217,7 @@ func TestAccCloudFrontFunction_UpdateCodeAndPublish(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(cloudfront.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(cloudfront.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, cloudfront.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckFunctionDestroy(ctx), @@ -257,7 +257,7 @@ func TestAccCloudFrontFunction_Update_comment(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(cloudfront.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(cloudfront.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, cloudfront.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckFunctionDestroy(ctx), diff --git a/internal/service/cloudfront/key_group_test.go b/internal/service/cloudfront/key_group_test.go index a060e40400db..bc3e10a0a44f 100644 --- a/internal/service/cloudfront/key_group_test.go +++ b/internal/service/cloudfront/key_group_test.go @@ -22,7 +22,7 @@ func TestAccCloudFrontKeyGroup_basic(t *testing.T) { resourceName := "aws_cloudfront_key_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(cloudfront.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(cloudfront.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, cloudfront.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckKeyGroupDestroy(ctx), @@ -53,7 +53,7 @@ func TestAccCloudFrontKeyGroup_disappears(t *testing.T) { resourceName := "aws_cloudfront_key_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(cloudfront.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(cloudfront.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, cloudfront.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckKeyGroupDestroy(ctx), @@ -79,7 +79,7 @@ func TestAccCloudFrontKeyGroup_comment(t *testing.T) { secondComment := "second comment" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(cloudfront.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(cloudfront.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, cloudfront.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckKeyGroupDestroy(ctx), @@ -113,7 +113,7 @@ func TestAccCloudFrontKeyGroup_items(t *testing.T) { resourceName := "aws_cloudfront_key_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(cloudfront.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(cloudfront.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, cloudfront.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckKeyGroupDestroy(ctx), 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 eb15811bf042..7be1f55f37e9 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 @@ -14,7 +14,7 @@ func TestAccCloudFrontLogDeliveryCanonicalUserIDDataSource_basic(t *testing.T) { dataSourceName := "data.aws_cloudfront_log_delivery_canonical_user_id.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(cloudfront.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(cloudfront.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, cloudfront.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ @@ -32,7 +32,7 @@ func TestAccCloudFrontLogDeliveryCanonicalUserIDDataSource_default(t *testing.T) dataSourceName := "data.aws_cloudfront_log_delivery_canonical_user_id.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(cloudfront.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(cloudfront.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, cloudfront.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ @@ -50,7 +50,7 @@ func TestAccCloudFrontLogDeliveryCanonicalUserIDDataSource_cn(t *testing.T) { dataSourceName := "data.aws_cloudfront_log_delivery_canonical_user_id.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(cloudfront.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(cloudfront.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, cloudfront.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ diff --git a/internal/service/cloudfront/monitoring_subscription_test.go b/internal/service/cloudfront/monitoring_subscription_test.go index 293a8149ff62..d4e4ba805788 100644 --- a/internal/service/cloudfront/monitoring_subscription_test.go +++ b/internal/service/cloudfront/monitoring_subscription_test.go @@ -20,7 +20,7 @@ func TestAccCloudFrontMonitoringSubscription_basic(t *testing.T) { resourceName := "aws_cloudfront_monitoring_subscription.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(cloudfront.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(cloudfront.EndpointsID, t) }, ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckMonitoringSubscriptionDestroy(ctx), ErrorCheck: acctest.ErrorCheck(t, cloudfront.EndpointsID), @@ -50,7 +50,7 @@ func TestAccCloudFrontMonitoringSubscription_disappears(t *testing.T) { resourceName := "aws_cloudfront_monitoring_subscription.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(cloudfront.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(cloudfront.EndpointsID, t) }, ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckMonitoringSubscriptionDestroy(ctx), ErrorCheck: acctest.ErrorCheck(t, cloudfront.EndpointsID), @@ -73,7 +73,7 @@ func TestAccCloudFrontMonitoringSubscription_update(t *testing.T) { resourceName := "aws_cloudfront_monitoring_subscription.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(cloudfront.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(cloudfront.EndpointsID, t) }, ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckMonitoringSubscriptionDestroy(ctx), ErrorCheck: acctest.ErrorCheck(t, cloudfront.EndpointsID), diff --git a/internal/service/cloudfront/origin_access_control_test.go b/internal/service/cloudfront/origin_access_control_test.go index db6f0b294bf6..2c029583346a 100644 --- a/internal/service/cloudfront/origin_access_control_test.go +++ b/internal/service/cloudfront/origin_access_control_test.go @@ -27,7 +27,7 @@ func TestAccCloudFrontOriginAccessControl_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(cloudfront.EndpointsID, t) testAccPreCheck(ctx, t) }, @@ -75,7 +75,7 @@ func TestAccCloudFrontOriginAccessControl_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(cloudfront.EndpointsID, t) testAccPreCheck(ctx, t) }, @@ -103,7 +103,7 @@ func TestAccCloudFrontOriginAccessControl_Name(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(cloudfront.EndpointsID, t) testAccPreCheck(ctx, t) }, @@ -139,7 +139,7 @@ func TestAccCloudFrontOriginAccessControl_Description(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(cloudfront.EndpointsID, t) testAccPreCheck(ctx, t) }, @@ -186,7 +186,7 @@ func TestAccCloudFrontOriginAccessControl_SigningBehavior(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(cloudfront.EndpointsID, t) testAccPreCheck(ctx, t) }, 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 f5638bcc3665..75204346c260 100644 --- a/internal/service/cloudfront/origin_access_identities_data_source_test.go +++ b/internal/service/cloudfront/origin_access_identities_data_source_test.go @@ -17,7 +17,7 @@ func TestAccCloudFrontOriginAccessIdentitiesDataSource_comments(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(cloudfront.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(cloudfront.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, cloudfront.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckOriginAccessIdentityDestroy(ctx), @@ -43,7 +43,7 @@ func TestAccCloudFrontOriginAccessIdentitiesDataSource_all(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(cloudfront.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(cloudfront.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, cloudfront.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckOriginAccessIdentityDestroy(ctx), 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 68af3beeb1ad..4ec4ab2dbf8d 100644 --- a/internal/service/cloudfront/origin_access_identity_data_source_test.go +++ b/internal/service/cloudfront/origin_access_identity_data_source_test.go @@ -15,7 +15,7 @@ func TestAccCloudFrontOriginAccessIdentityDataSource_basic(t *testing.T) { resourceName := "aws_cloudfront_origin_access_identity.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(cloudfront.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(cloudfront.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, cloudfront.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckOriginAccessIdentityDestroy(ctx), diff --git a/internal/service/cloudfront/origin_access_identity_test.go b/internal/service/cloudfront/origin_access_identity_test.go index e04598dce736..70a1bc718228 100644 --- a/internal/service/cloudfront/origin_access_identity_test.go +++ b/internal/service/cloudfront/origin_access_identity_test.go @@ -21,7 +21,7 @@ func TestAccCloudFrontOriginAccessIdentity_basic(t *testing.T) { resourceName := "aws_cloudfront_origin_access_identity.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(cloudfront.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(cloudfront.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, cloudfront.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckOriginAccessIdentityDestroy(ctx), @@ -53,7 +53,7 @@ func TestAccCloudFrontOriginAccessIdentity_noComment(t *testing.T) { resourceName := "aws_cloudfront_origin_access_identity.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(cloudfront.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(cloudfront.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, cloudfront.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckOriginAccessIdentityDestroy(ctx), @@ -84,7 +84,7 @@ func TestAccCloudFrontOriginAccessIdentity_disappears(t *testing.T) { resourceName := "aws_cloudfront_origin_access_identity.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(cloudfront.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(cloudfront.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, cloudfront.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckOriginAccessIdentityDestroy(ctx), 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 c2068f2fbc71..f66f5f920316 100644 --- a/internal/service/cloudfront/origin_request_policy_data_source_test.go +++ b/internal/service/cloudfront/origin_request_policy_data_source_test.go @@ -18,7 +18,7 @@ func TestAccCloudFrontOriginRequestPolicyDataSource_basic(t *testing.T) { resourceName := "aws_cloudfront_origin_request_policy.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(cloudfront.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(cloudfront.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, cloudfront.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckPublicKeyDestroy(ctx), diff --git a/internal/service/cloudfront/origin_request_policy_test.go b/internal/service/cloudfront/origin_request_policy_test.go index f4d36a48baef..7fe40915b86a 100644 --- a/internal/service/cloudfront/origin_request_policy_test.go +++ b/internal/service/cloudfront/origin_request_policy_test.go @@ -21,7 +21,7 @@ func TestAccCloudFrontOriginRequestPolicy_basic(t *testing.T) { resourceName := "aws_cloudfront_origin_request_policy.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(cloudfront.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(cloudfront.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, cloudfront.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckOriginRequestPolicyDestroy(ctx), @@ -59,7 +59,7 @@ func TestAccCloudFrontOriginRequestPolicy_disappears(t *testing.T) { resourceName := "aws_cloudfront_origin_request_policy.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(cloudfront.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(cloudfront.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, cloudfront.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckOriginRequestPolicyDestroy(ctx), @@ -83,7 +83,7 @@ func TestAccCloudFrontOriginRequestPolicy_Items(t *testing.T) { resourceName := "aws_cloudfront_origin_request_policy.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(cloudfront.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(cloudfront.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, cloudfront.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckOriginRequestPolicyDestroy(ctx), diff --git a/internal/service/cloudfront/public_key_test.go b/internal/service/cloudfront/public_key_test.go index 50f9e665c6fb..df5292091594 100644 --- a/internal/service/cloudfront/public_key_test.go +++ b/internal/service/cloudfront/public_key_test.go @@ -23,7 +23,7 @@ func TestAccCloudFrontPublicKey_basic(t *testing.T) { resourceName := "aws_cloudfront_public_key.example" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(cloudfront.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(cloudfront.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, cloudfront.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckPublicKeyDestroy(ctx), @@ -52,7 +52,7 @@ func TestAccCloudFrontPublicKey_disappears(t *testing.T) { resourceName := "aws_cloudfront_public_key.example" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(cloudfront.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(cloudfront.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, cloudfront.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckPublicKeyDestroy(ctx), @@ -75,7 +75,7 @@ func TestAccCloudFrontPublicKey_namePrefix(t *testing.T) { resourceName := "aws_cloudfront_public_key.example" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(cloudfront.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(cloudfront.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, cloudfront.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckPublicKeyDestroy(ctx), @@ -105,7 +105,7 @@ func TestAccCloudFrontPublicKey_update(t *testing.T) { resourceName := "aws_cloudfront_public_key.example" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(cloudfront.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(cloudfront.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, cloudfront.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckPublicKeyDestroy(ctx), 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 f5669201bd31..7f670335d31f 100644 --- a/internal/service/cloudfront/realtime_log_config_data_source_test.go +++ b/internal/service/cloudfront/realtime_log_config_data_source_test.go @@ -18,7 +18,7 @@ func TestAccCloudFrontRealtimeLogConfigDataSource_basic(t *testing.T) { dataSourceName := "data.aws_cloudfront_realtime_log_config.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(cloudfront.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(cloudfront.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, cloudfront.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRealtimeLogConfigDestroy(ctx), diff --git a/internal/service/cloudfront/realtime_log_config_test.go b/internal/service/cloudfront/realtime_log_config_test.go index 40cea0d7baec..4fd1e23e0a54 100644 --- a/internal/service/cloudfront/realtime_log_config_test.go +++ b/internal/service/cloudfront/realtime_log_config_test.go @@ -26,7 +26,7 @@ func TestAccCloudFrontRealtimeLogConfig_basic(t *testing.T) { streamResourceName := "aws_kinesis_stream.test.0" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(cloudfront.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(cloudfront.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, cloudfront.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRealtimeLogConfigDestroy(ctx), @@ -65,7 +65,7 @@ func TestAccCloudFrontRealtimeLogConfig_disappears(t *testing.T) { resourceName := "aws_cloudfront_realtime_log_config.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(cloudfront.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(cloudfront.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, cloudfront.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRealtimeLogConfigDestroy(ctx), @@ -95,7 +95,7 @@ func TestAccCloudFrontRealtimeLogConfig_updates(t *testing.T) { stream2ResourceName := "aws_kinesis_stream.test.1" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(cloudfront.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(cloudfront.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, cloudfront.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRealtimeLogConfigDestroy(ctx), 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 a18ba049f9f3..0f0764453cee 100644 --- a/internal/service/cloudfront/response_headers_policy_data_source_test.go +++ b/internal/service/cloudfront/response_headers_policy_data_source_test.go @@ -18,7 +18,7 @@ func TestAccCloudFrontResponseHeadersPolicyDataSource_basic(t *testing.T) { resourceName := "aws_cloudfront_response_headers_policy.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(cloudfront.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(cloudfront.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, cloudfront.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckPublicKeyDestroy(ctx), diff --git a/internal/service/cloudfront/response_headers_policy_test.go b/internal/service/cloudfront/response_headers_policy_test.go index bcf34f4e993c..1595929dda2d 100644 --- a/internal/service/cloudfront/response_headers_policy_test.go +++ b/internal/service/cloudfront/response_headers_policy_test.go @@ -22,7 +22,7 @@ func TestAccCloudFrontResponseHeadersPolicy_cors(t *testing.T) { resourceName := "aws_cloudfront_response_headers_policy.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(cloudfront.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(cloudfront.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, cloudfront.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckResponseHeadersPolicyDestroy(ctx), @@ -100,7 +100,7 @@ func TestAccCloudFrontResponseHeadersPolicy_customHeaders(t *testing.T) { resourceName := "aws_cloudfront_response_headers_policy.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(cloudfront.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(cloudfront.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, cloudfront.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckResponseHeadersPolicyDestroy(ctx), @@ -145,7 +145,7 @@ func TestAccCloudFrontResponseHeadersPolicy_securityHeaders(t *testing.T) { resourceName := "aws_cloudfront_response_headers_policy.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(cloudfront.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(cloudfront.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, cloudfront.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckResponseHeadersPolicyDestroy(ctx), @@ -225,7 +225,7 @@ func TestAccCloudFrontResponseHeadersPolicy_serverTimingHeaders(t *testing.T) { resourceName := "aws_cloudfront_response_headers_policy.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(cloudfront.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(cloudfront.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, cloudfront.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckResponseHeadersPolicyDestroy(ctx), @@ -306,7 +306,7 @@ func TestAccCloudFrontResponseHeadersPolicy_disappears(t *testing.T) { resourceName := "aws_cloudfront_response_headers_policy.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(cloudfront.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(cloudfront.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, cloudfront.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckResponseHeadersPolicyDestroy(ctx), From c8ae5c6709f54bac5d610f16ddd43ff055830eb5 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Fri, 24 Feb 2023 16:36:39 -0500 Subject: [PATCH 109/763] Add 'Context' argument to 'acctest.PreCheck' for cloudhsmv2. --- .../service/cloudhsmv2/cluster_data_source_test.go | 2 +- internal/service/cloudhsmv2/cluster_test.go | 6 +++--- internal/service/cloudhsmv2/hsm_test.go | 10 +++++----- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/internal/service/cloudhsmv2/cluster_data_source_test.go b/internal/service/cloudhsmv2/cluster_data_source_test.go index 6232dfad6cc7..787db1340a1b 100644 --- a/internal/service/cloudhsmv2/cluster_data_source_test.go +++ b/internal/service/cloudhsmv2/cluster_data_source_test.go @@ -15,7 +15,7 @@ func testAccDataSourceCluster_basic(t *testing.T) { dataSourceName := "data.aws_cloudhsm_v2_cluster.default" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, cloudhsmv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ diff --git a/internal/service/cloudhsmv2/cluster_test.go b/internal/service/cloudhsmv2/cluster_test.go index 9339df471854..85b159dac1bc 100644 --- a/internal/service/cloudhsmv2/cluster_test.go +++ b/internal/service/cloudhsmv2/cluster_test.go @@ -20,7 +20,7 @@ func testAccCluster_basic(t *testing.T) { resourceName := "aws_cloudhsm_v2_cluster.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, cloudhsmv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClusterDestroy(ctx), @@ -56,7 +56,7 @@ func testAccCluster_disappears(t *testing.T) { resourceName := "aws_cloudhsm_v2_cluster.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, cloudhsmv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClusterDestroy(ctx), @@ -80,7 +80,7 @@ func testAccCluster_Tags(t *testing.T) { resourceName := "aws_cloudhsm_v2_cluster.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, cloudhsmv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClusterDestroy(ctx), diff --git a/internal/service/cloudhsmv2/hsm_test.go b/internal/service/cloudhsmv2/hsm_test.go index cfc2b097fd4e..29855a8b3249 100644 --- a/internal/service/cloudhsmv2/hsm_test.go +++ b/internal/service/cloudhsmv2/hsm_test.go @@ -20,7 +20,7 @@ func testAccHSM_basic(t *testing.T) { resourceName := "aws_cloudhsm_v2_hsm.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, cloudhsmv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckHSMDestroy(ctx), @@ -52,7 +52,7 @@ func testAccHSM_disappears(t *testing.T) { resourceName := "aws_cloudhsm_v2_hsm.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, cloudhsmv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClusterDestroy(ctx), @@ -77,7 +77,7 @@ func testAccHSM_disappears_Cluster(t *testing.T) { resourceName := "aws_cloudhsm_v2_hsm.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, cloudhsmv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClusterDestroy(ctx), @@ -100,7 +100,7 @@ func testAccHSM_AvailabilityZone(t *testing.T) { resourceName := "aws_cloudhsm_v2_hsm.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, cloudhsmv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckHSMDestroy(ctx), @@ -126,7 +126,7 @@ func testAccHSM_IPAddress(t *testing.T) { resourceName := "aws_cloudhsm_v2_hsm.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, cloudhsmv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckHSMDestroy(ctx), From 2bf42704353b62997ce876399c33307fb7ac4e51 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Fri, 24 Feb 2023 16:36:39 -0500 Subject: [PATCH 110/763] Add 'Context' argument to 'acctest.PreCheck' for cloudsearch. --- .../cloudsearch/domain_service_access_policy_test.go | 4 ++-- internal/service/cloudsearch/domain_test.go | 10 +++++----- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/internal/service/cloudsearch/domain_service_access_policy_test.go b/internal/service/cloudsearch/domain_service_access_policy_test.go index b60a8d28c0df..85d295fc8020 100644 --- a/internal/service/cloudsearch/domain_service_access_policy_test.go +++ b/internal/service/cloudsearch/domain_service_access_policy_test.go @@ -21,7 +21,7 @@ func TestAccCloudSearchDomainServiceAccessPolicy_basic(t *testing.T) { rName := acctest.ResourcePrefix + "-" + sdkacctest.RandString(28-(len(acctest.ResourcePrefix)+1)) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(cloudsearch.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(cloudsearch.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, cloudsearch.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDomainServiceAccessPolicyDestroy(ctx), @@ -48,7 +48,7 @@ func TestAccCloudSearchDomainServiceAccessPolicy_update(t *testing.T) { rName := acctest.ResourcePrefix + "-" + sdkacctest.RandString(28-(len(acctest.ResourcePrefix)+1)) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(cloudsearch.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(cloudsearch.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, cloudsearch.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDomainServiceAccessPolicyDestroy(ctx), diff --git a/internal/service/cloudsearch/domain_test.go b/internal/service/cloudsearch/domain_test.go index 38bef406731f..24c3285b8956 100644 --- a/internal/service/cloudsearch/domain_test.go +++ b/internal/service/cloudsearch/domain_test.go @@ -22,7 +22,7 @@ func TestAccCloudSearchDomain_basic(t *testing.T) { rName := testAccDomainName() resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(cloudsearch.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(cloudsearch.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, cloudsearch.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDomainDestroy(ctx), @@ -61,7 +61,7 @@ func TestAccCloudSearchDomain_disappears(t *testing.T) { rName := testAccDomainName() resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(cloudsearch.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(cloudsearch.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, cloudsearch.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDomainDestroy(ctx), @@ -85,7 +85,7 @@ func TestAccCloudSearchDomain_indexFields(t *testing.T) { rName := testAccDomainName() resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(cloudsearch.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(cloudsearch.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, cloudsearch.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDomainDestroy(ctx), @@ -150,7 +150,7 @@ func TestAccCloudSearchDomain_sourceFields(t *testing.T) { rName := testAccDomainName() resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(cloudsearch.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(cloudsearch.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, cloudsearch.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDomainDestroy(ctx), @@ -225,7 +225,7 @@ func TestAccCloudSearchDomain_update(t *testing.T) { rName := testAccDomainName() resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(cloudsearch.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(cloudsearch.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, cloudsearch.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDomainDestroy(ctx), From c620dcb88ae007d3df542b23990b32b56e125929 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Fri, 24 Feb 2023 16:36:40 -0500 Subject: [PATCH 111/763] Add 'Context' argument to 'acctest.PreCheck' for cloudtrail. --- .../service/cloudtrail/cloudtrail_test.go | 30 +++++++++---------- .../cloudtrail/event_data_store_test.go | 10 +++---- .../service_account_data_source_test.go | 4 +-- 3 files changed, 22 insertions(+), 22 deletions(-) diff --git a/internal/service/cloudtrail/cloudtrail_test.go b/internal/service/cloudtrail/cloudtrail_test.go index 455eb7a51632..63c92b0db850 100644 --- a/internal/service/cloudtrail/cloudtrail_test.go +++ b/internal/service/cloudtrail/cloudtrail_test.go @@ -61,7 +61,7 @@ func testAcc_basic(t *testing.T) { resourceName := "aws_cloudtrail.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, cloudtrail.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTrailDestroy(ctx), @@ -108,7 +108,7 @@ func testAcc_cloudWatch(t *testing.T) { resourceName := "aws_cloudtrail.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, cloudtrail.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTrailDestroy(ctx), @@ -150,7 +150,7 @@ func testAcc_enableLogging(t *testing.T) { resourceName := "aws_cloudtrail.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, cloudtrail.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTrailDestroy(ctx), @@ -205,7 +205,7 @@ func testAcc_multiRegion(t *testing.T) { resourceName := "aws_cloudtrail.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, cloudtrail.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTrailDestroy(ctx), @@ -253,7 +253,7 @@ func testAcc_organization(t *testing.T) { resourceName := "aws_cloudtrail.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckOrganizationsAccount(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckOrganizationsAccount(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, cloudtrail.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTrailDestroy(ctx), @@ -292,7 +292,7 @@ func testAcc_logValidation(t *testing.T) { resourceName := "aws_cloudtrail.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, cloudtrail.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTrailDestroy(ctx), @@ -335,7 +335,7 @@ func testAcc_kmsKey(t *testing.T) { kmsResourceName := "aws_kms_key.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, cloudtrail.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTrailDestroy(ctx), @@ -368,7 +368,7 @@ func testAcc_tags(t *testing.T) { resourceName := "aws_cloudtrail.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, cloudtrail.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTrailDestroy(ctx), @@ -424,7 +424,7 @@ func testAcc_globalServiceEvents(t *testing.T) { resourceName := "aws_cloudtrail.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, cloudtrail.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTrailDestroy(ctx), @@ -451,7 +451,7 @@ func testAcc_eventSelector(t *testing.T) { resourceName := "aws_cloudtrail.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, cloudtrail.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTrailDestroy(ctx), @@ -523,7 +523,7 @@ func testAcc_eventSelectorDynamoDB(t *testing.T) { resourceName := "aws_cloudtrail.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, cloudtrail.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTrailDestroy(ctx), @@ -550,7 +550,7 @@ func testAcc_eventSelectorExclude(t *testing.T) { resourceName := "aws_cloudtrail.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, cloudtrail.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTrailDestroy(ctx), @@ -600,7 +600,7 @@ func testAcc_insightSelector(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, cloudtrail.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTrailDestroy(ctx), @@ -648,7 +648,7 @@ func testAcc_advanced_event_selector(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, cloudtrail.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTrailDestroy(ctx), @@ -748,7 +748,7 @@ func testAcc_disappears(t *testing.T) { resourceName := "aws_cloudtrail.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, cloudtrail.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTrailDestroy(ctx), diff --git a/internal/service/cloudtrail/event_data_store_test.go b/internal/service/cloudtrail/event_data_store_test.go index 2bbc32fd982d..df6b36173c15 100644 --- a/internal/service/cloudtrail/event_data_store_test.go +++ b/internal/service/cloudtrail/event_data_store_test.go @@ -22,7 +22,7 @@ func TestAccCloudTrailEventDataStore_basic(t *testing.T) { resourceName := "aws_cloudtrail_event_data_store.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, cloudtrail.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckEventDataStoreDestroy(ctx), @@ -63,7 +63,7 @@ func TestAccCloudTrailEventDataStore_disappears(t *testing.T) { resourceName := "aws_cloudtrail_event_data_store.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, cloudtrail.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckEventDataStoreDestroy(ctx), @@ -86,7 +86,7 @@ func TestAccCloudTrailEventDataStore_tags(t *testing.T) { resourceName := "aws_cloudtrail_event_data_store.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, cloudtrail.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckEventDataStoreDestroy(ctx), @@ -131,7 +131,7 @@ func TestAccCloudTrailEventDataStore_options(t *testing.T) { resourceName := "aws_cloudtrail_event_data_store.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckOrganizationManagementAccount(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckOrganizationManagementAccount(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, cloudtrail.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckEventDataStoreDestroy(ctx), @@ -171,7 +171,7 @@ func TestAccCloudTrailEventDataStore_advancedEventSelector(t *testing.T) { resourceName := "aws_cloudtrail_event_data_store.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, cloudtrail.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckEventDataStoreDestroy(ctx), diff --git a/internal/service/cloudtrail/service_account_data_source_test.go b/internal/service/cloudtrail/service_account_data_source_test.go index 93e65a12c22d..148eefecc031 100644 --- a/internal/service/cloudtrail/service_account_data_source_test.go +++ b/internal/service/cloudtrail/service_account_data_source_test.go @@ -14,7 +14,7 @@ func TestAccCloudTrailServiceAccountDataSource_basic(t *testing.T) { dataSourceName := "data.aws_cloudtrail_service_account.main" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ @@ -35,7 +35,7 @@ func TestAccCloudTrailServiceAccountDataSource_region(t *testing.T) { dataSourceName := "data.aws_cloudtrail_service_account.regional" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ From 886dc82feb3685d70a384d619945457c956b35b3 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Fri, 24 Feb 2023 16:36:40 -0500 Subject: [PATCH 112/763] Add 'Context' argument to 'acctest.PreCheck' for cloudwatch. --- .../cloudwatch/composite_alarm_test.go | 18 +++++++------- internal/service/cloudwatch/dashboard_test.go | 6 ++--- .../service/cloudwatch/metric_alarm_test.go | 24 +++++++++---------- .../service/cloudwatch/metric_stream_test.go | 18 +++++++------- 4 files changed, 33 insertions(+), 33 deletions(-) diff --git a/internal/service/cloudwatch/composite_alarm_test.go b/internal/service/cloudwatch/composite_alarm_test.go index db4752d051bf..bd428a3cd2af 100644 --- a/internal/service/cloudwatch/composite_alarm_test.go +++ b/internal/service/cloudwatch/composite_alarm_test.go @@ -22,7 +22,7 @@ func TestAccCloudWatchCompositeAlarm_basic(t *testing.T) { resourceName := "aws_cloudwatch_composite_alarm.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, cloudwatch.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckCompositeAlarmDestroy(ctx), @@ -57,7 +57,7 @@ func TestAccCloudWatchCompositeAlarm_disappears(t *testing.T) { resourceName := "aws_cloudwatch_composite_alarm.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, cloudwatch.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckCompositeAlarmDestroy(ctx), @@ -80,7 +80,7 @@ func TestAccCloudWatchCompositeAlarm_actionsEnabled(t *testing.T) { resourceName := "aws_cloudwatch_composite_alarm.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, cloudwatch.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckCompositeAlarmDestroy(ctx), @@ -119,7 +119,7 @@ func TestAccCloudWatchCompositeAlarm_alarmActions(t *testing.T) { resourceName := "aws_cloudwatch_composite_alarm.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, cloudwatch.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckCompositeAlarmDestroy(ctx), @@ -170,7 +170,7 @@ func TestAccCloudWatchCompositeAlarm_description(t *testing.T) { resourceName := "aws_cloudwatch_composite_alarm.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, cloudwatch.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckCompositeAlarmDestroy(ctx), @@ -209,7 +209,7 @@ func TestAccCloudWatchCompositeAlarm_insufficientDataActions(t *testing.T) { resourceName := "aws_cloudwatch_composite_alarm.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, cloudwatch.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckCompositeAlarmDestroy(ctx), @@ -260,7 +260,7 @@ func TestAccCloudWatchCompositeAlarm_okActions(t *testing.T) { resourceName := "aws_cloudwatch_composite_alarm.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, cloudwatch.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckCompositeAlarmDestroy(ctx), @@ -311,7 +311,7 @@ func TestAccCloudWatchCompositeAlarm_allActions(t *testing.T) { resourceName := "aws_cloudwatch_composite_alarm.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, cloudwatch.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckCompositeAlarmDestroy(ctx), @@ -354,7 +354,7 @@ func TestAccCloudWatchCompositeAlarm_updateAlarmRule(t *testing.T) { resourceName := "aws_cloudwatch_composite_alarm.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, cloudwatch.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckCompositeAlarmDestroy(ctx), diff --git a/internal/service/cloudwatch/dashboard_test.go b/internal/service/cloudwatch/dashboard_test.go index 220c93502758..3a59be878c58 100644 --- a/internal/service/cloudwatch/dashboard_test.go +++ b/internal/service/cloudwatch/dashboard_test.go @@ -25,7 +25,7 @@ func TestAccCloudWatchDashboard_basic(t *testing.T) { rInt := sdkacctest.RandInt() resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, cloudwatch.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDashboardDestroy(ctx), @@ -53,7 +53,7 @@ func TestAccCloudWatchDashboard_update(t *testing.T) { rInt := sdkacctest.RandInt() resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, cloudwatch.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDashboardDestroy(ctx), @@ -90,7 +90,7 @@ func TestAccCloudWatchDashboard_updateName(t *testing.T) { rInt := sdkacctest.RandInt() rInt2 := sdkacctest.RandInt() resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, cloudwatch.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDashboardDestroy(ctx), diff --git a/internal/service/cloudwatch/metric_alarm_test.go b/internal/service/cloudwatch/metric_alarm_test.go index 6898e3ff457e..792b6fd2e238 100755 --- a/internal/service/cloudwatch/metric_alarm_test.go +++ b/internal/service/cloudwatch/metric_alarm_test.go @@ -23,7 +23,7 @@ func TestAccCloudWatchMetricAlarm_basic(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, cloudwatch.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckMetricAlarmDestroy(ctx), @@ -65,7 +65,7 @@ func TestAccCloudWatchMetricAlarm_AlarmActions_ec2Automate(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, cloudwatch.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckMetricAlarmDestroy(ctx), @@ -114,7 +114,7 @@ func TestAccCloudWatchMetricAlarm_AlarmActions_snsTopic(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, cloudwatch.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckMetricAlarmDestroy(ctx), @@ -142,7 +142,7 @@ func TestAccCloudWatchMetricAlarm_AlarmActions_swfAction(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, cloudwatch.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckMetricAlarmDestroy(ctx), @@ -170,7 +170,7 @@ func TestAccCloudWatchMetricAlarm_dataPointsToAlarm(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, cloudwatch.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckMetricAlarmDestroy(ctx), @@ -193,7 +193,7 @@ func TestAccCloudWatchMetricAlarm_treatMissingData(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, cloudwatch.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckMetricAlarmDestroy(ctx), @@ -235,7 +235,7 @@ func TestAccCloudWatchMetricAlarm_evaluateLowSampleCountPercentiles(t *testing.T rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, cloudwatch.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckMetricAlarmDestroy(ctx), @@ -265,7 +265,7 @@ func TestAccCloudWatchMetricAlarm_extendedStatistic(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, cloudwatch.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckMetricAlarmDestroy(ctx), @@ -418,7 +418,7 @@ func TestAccCloudWatchMetricAlarm_expression(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, cloudwatch.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckMetricAlarmDestroy(ctx), @@ -482,7 +482,7 @@ func TestAccCloudWatchMetricAlarm_missingStatistic(t *testing.T) { ctx := acctest.Context(t) rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, cloudwatch.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckMetricAlarmDestroy(ctx), @@ -502,7 +502,7 @@ func TestAccCloudWatchMetricAlarm_tags(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, cloudwatch.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckMetricAlarmDestroy(ctx), @@ -548,7 +548,7 @@ func TestAccCloudWatchMetricAlarm_disappears(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, cloudwatch.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckMetricAlarmDestroy(ctx), diff --git a/internal/service/cloudwatch/metric_stream_test.go b/internal/service/cloudwatch/metric_stream_test.go index 0db1eaebfcb4..505c57deeef3 100644 --- a/internal/service/cloudwatch/metric_stream_test.go +++ b/internal/service/cloudwatch/metric_stream_test.go @@ -32,7 +32,7 @@ func TestAccCloudWatchMetricStream_basic(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, cloudwatch.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckMetricStreamDestroy(ctx), @@ -70,7 +70,7 @@ func TestAccCloudWatchMetricStream_disappears(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, cloudwatch.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckMetricStreamDestroy(ctx), @@ -93,7 +93,7 @@ func TestAccCloudWatchMetricStream_nameGenerated(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, cloudwatch.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckMetricStreamDestroy(ctx), @@ -121,7 +121,7 @@ func TestAccCloudWatchMetricStream_namePrefix(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(cloudwatch.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(cloudwatch.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, cloudwatch.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckMetricStreamDestroy(ctx), @@ -149,7 +149,7 @@ func TestAccCloudWatchMetricStream_includeFilters(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, cloudwatch.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckMetricStreamDestroy(ctx), @@ -178,7 +178,7 @@ func TestAccCloudWatchMetricStream_excludeFilters(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, cloudwatch.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckMetricStreamDestroy(ctx), @@ -207,7 +207,7 @@ func TestAccCloudWatchMetricStream_update(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, cloudwatch.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckMetricStreamDestroy(ctx), @@ -275,7 +275,7 @@ func TestAccCloudWatchMetricStream_tags(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, cloudwatch.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckMetricStreamDestroy(ctx), @@ -320,7 +320,7 @@ func TestAccCloudWatchMetricStream_additional_statistics(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, cloudwatch.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckMetricStreamDestroy(ctx), From 2fb07cf9800b9ad93039c7130b959cf68c1a781f Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Fri, 24 Feb 2023 16:36:41 -0500 Subject: [PATCH 113/763] Add 'Context' argument to 'acctest.PreCheck' for codeartifact. --- .../authorization_token_data_source_test.go | 6 +++--- .../codeartifact/domain_permissions_policy_test.go | 10 +++++----- internal/service/codeartifact/domain_test.go | 8 ++++---- .../repository_endpoint_data_source_test.go | 4 ++-- .../repository_permissions_policy_test.go | 10 +++++----- internal/service/codeartifact/repository_test.go | 14 +++++++------- 6 files changed, 26 insertions(+), 26 deletions(-) diff --git a/internal/service/codeartifact/authorization_token_data_source_test.go b/internal/service/codeartifact/authorization_token_data_source_test.go index 64d0e5ade15a..2976ee2375fb 100644 --- a/internal/service/codeartifact/authorization_token_data_source_test.go +++ b/internal/service/codeartifact/authorization_token_data_source_test.go @@ -15,7 +15,7 @@ func testAccAuthorizationTokenDataSource_basic(t *testing.T) { dataSourceName := "data.aws_codeartifact_authorization_token.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(codeartifact.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(codeartifact.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, codeartifact.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ @@ -36,7 +36,7 @@ func testAccAuthorizationTokenDataSource_owner(t *testing.T) { dataSourceName := "data.aws_codeartifact_authorization_token.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(codeartifact.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(codeartifact.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, codeartifact.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ @@ -57,7 +57,7 @@ func testAccAuthorizationTokenDataSource_duration(t *testing.T) { dataSourceName := "data.aws_codeartifact_authorization_token.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(codeartifact.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(codeartifact.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, codeartifact.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ diff --git a/internal/service/codeartifact/domain_permissions_policy_test.go b/internal/service/codeartifact/domain_permissions_policy_test.go index d1c027999ca3..8817910f1a05 100644 --- a/internal/service/codeartifact/domain_permissions_policy_test.go +++ b/internal/service/codeartifact/domain_permissions_policy_test.go @@ -23,7 +23,7 @@ func testAccDomainPermissionsPolicy_basic(t *testing.T) { resourceName := "aws_codeartifact_domain_permissions_policy.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(codeartifact.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(codeartifact.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, codeartifact.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDomainPermissionsDestroy(ctx), @@ -64,7 +64,7 @@ func testAccDomainPermissionsPolicy_ignoreEquivalent(t *testing.T) { resourceName := "aws_codeartifact_domain_permissions_policy.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(codeartifact.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(codeartifact.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, codeartifact.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDomainPermissionsDestroy(ctx), @@ -94,7 +94,7 @@ func testAccDomainPermissionsPolicy_owner(t *testing.T) { resourceName := "aws_codeartifact_domain_permissions_policy.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(codeartifact.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(codeartifact.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, codeartifact.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDomainPermissionsDestroy(ctx), @@ -124,7 +124,7 @@ func testAccDomainPermissionsPolicy_disappears(t *testing.T) { resourceName := "aws_codeartifact_domain_permissions_policy.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(codeartifact.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(codeartifact.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, codeartifact.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDomainPermissionsDestroy(ctx), @@ -147,7 +147,7 @@ func testAccDomainPermissionsPolicy_Disappears_domain(t *testing.T) { resourceName := "aws_codeartifact_domain_permissions_policy.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(codeartifact.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(codeartifact.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, codeartifact.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDomainPermissionsDestroy(ctx), diff --git a/internal/service/codeartifact/domain_test.go b/internal/service/codeartifact/domain_test.go index 9fe5fa16f528..f1433b4e048b 100644 --- a/internal/service/codeartifact/domain_test.go +++ b/internal/service/codeartifact/domain_test.go @@ -23,7 +23,7 @@ func testAccDomain_basic(t *testing.T) { resourceName := "aws_codeartifact_domain.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(codeartifact.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(codeartifact.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, codeartifact.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDomainDestroy(ctx), @@ -57,7 +57,7 @@ func testAccDomain_defaultEncryptionKey(t *testing.T) { resourceName := "aws_codeartifact_domain.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService("codeartifact", t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService("codeartifact", t) }, ErrorCheck: acctest.ErrorCheck(t, codeartifact.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDomainDestroy(ctx), @@ -90,7 +90,7 @@ func testAccDomain_tags(t *testing.T) { resourceName := "aws_codeartifact_domain.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService("codeartifact", t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService("codeartifact", t) }, ErrorCheck: acctest.ErrorCheck(t, codeartifact.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDomainDestroy(ctx), @@ -134,7 +134,7 @@ func testAccDomain_disappears(t *testing.T) { resourceName := "aws_codeartifact_domain.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(codeartifact.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(codeartifact.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, codeartifact.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDomainDestroy(ctx), diff --git a/internal/service/codeartifact/repository_endpoint_data_source_test.go b/internal/service/codeartifact/repository_endpoint_data_source_test.go index fb586d7657e0..466d31e73976 100644 --- a/internal/service/codeartifact/repository_endpoint_data_source_test.go +++ b/internal/service/codeartifact/repository_endpoint_data_source_test.go @@ -15,7 +15,7 @@ func testAccRepositoryEndpointDataSource_basic(t *testing.T) { dataSourceName := "data.aws_codeartifact_repository_endpoint.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(codeartifact.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(codeartifact.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, codeartifact.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ @@ -56,7 +56,7 @@ func testAccRepositoryEndpointDataSource_owner(t *testing.T) { dataSourceName := "data.aws_codeartifact_repository_endpoint.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(codeartifact.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(codeartifact.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, codeartifact.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ diff --git a/internal/service/codeartifact/repository_permissions_policy_test.go b/internal/service/codeartifact/repository_permissions_policy_test.go index 07509f864c7b..05f005042ebe 100644 --- a/internal/service/codeartifact/repository_permissions_policy_test.go +++ b/internal/service/codeartifact/repository_permissions_policy_test.go @@ -23,7 +23,7 @@ func testAccRepositoryPermissionsPolicy_basic(t *testing.T) { resourceName := "aws_codeartifact_repository_permissions_policy.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(codeartifact.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(codeartifact.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, codeartifact.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRepositoryPermissionsDestroy(ctx), @@ -64,7 +64,7 @@ func testAccRepositoryPermissionsPolicy_ignoreEquivalent(t *testing.T) { resourceName := "aws_codeartifact_repository_permissions_policy.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(codeartifact.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(codeartifact.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, codeartifact.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRepositoryPermissionsDestroy(ctx), @@ -93,7 +93,7 @@ func testAccRepositoryPermissionsPolicy_owner(t *testing.T) { resourceName := "aws_codeartifact_repository_permissions_policy.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(codeartifact.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(codeartifact.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, codeartifact.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRepositoryPermissionsDestroy(ctx), @@ -123,7 +123,7 @@ func testAccRepositoryPermissionsPolicy_disappears(t *testing.T) { resourceName := "aws_codeartifact_repository_permissions_policy.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(codeartifact.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(codeartifact.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, codeartifact.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRepositoryPermissionsDestroy(ctx), @@ -146,7 +146,7 @@ func testAccRepositoryPermissionsPolicy_Disappears_domain(t *testing.T) { resourceName := "aws_codeartifact_repository_permissions_policy.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(codeartifact.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(codeartifact.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, codeartifact.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRepositoryPermissionsDestroy(ctx), diff --git a/internal/service/codeartifact/repository_test.go b/internal/service/codeartifact/repository_test.go index 7c8b02a7e4da..fe25763c6238 100644 --- a/internal/service/codeartifact/repository_test.go +++ b/internal/service/codeartifact/repository_test.go @@ -22,7 +22,7 @@ func testAccRepository_basic(t *testing.T) { resourceName := "aws_codeartifact_repository.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(codeartifact.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(codeartifact.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, codeartifact.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRepositoryDestroy(ctx), @@ -57,7 +57,7 @@ func testAccRepository_tags(t *testing.T) { resourceName := "aws_codeartifact_repository.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService("codeartifact", t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService("codeartifact", t) }, ErrorCheck: acctest.ErrorCheck(t, codeartifact.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRepositoryDestroy(ctx), @@ -102,7 +102,7 @@ func testAccRepository_owner(t *testing.T) { resourceName := "aws_codeartifact_repository.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(codeartifact.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(codeartifact.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, codeartifact.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRepositoryDestroy(ctx), @@ -136,7 +136,7 @@ func testAccRepository_description(t *testing.T) { resourceName := "aws_codeartifact_repository.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(codeartifact.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(codeartifact.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, codeartifact.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRepositoryDestroy(ctx), @@ -170,7 +170,7 @@ func testAccRepository_upstreams(t *testing.T) { resourceName := "aws_codeartifact_repository.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(codeartifact.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(codeartifact.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, codeartifact.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRepositoryDestroy(ctx), @@ -215,7 +215,7 @@ func testAccRepository_externalConnection(t *testing.T) { resourceName := "aws_codeartifact_repository.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(codeartifact.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(codeartifact.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, codeartifact.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRepositoryDestroy(ctx), @@ -262,7 +262,7 @@ func testAccRepository_disappears(t *testing.T) { resourceName := "aws_codeartifact_repository.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(codeartifact.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(codeartifact.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, codeartifact.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRepositoryDestroy(ctx), From 0822cb3f936df97aefdb4ab212dd764742fa7187 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Fri, 24 Feb 2023 16:36:41 -0500 Subject: [PATCH 114/763] Add 'Context' argument to 'acctest.PreCheck' for codebuild. --- internal/service/codebuild/project_test.go | 130 +++++++++--------- .../service/codebuild/report_group_test.go | 10 +- .../service/codebuild/resource_policy_test.go | 6 +- .../codebuild/source_credential_test.go | 6 +- internal/service/codebuild/webhook_test.go | 12 +- 5 files changed, 82 insertions(+), 82 deletions(-) diff --git a/internal/service/codebuild/project_test.go b/internal/service/codebuild/project_test.go index 153af118d1d7..6764a8b13bb2 100644 --- a/internal/service/codebuild/project_test.go +++ b/internal/service/codebuild/project_test.go @@ -61,7 +61,7 @@ func TestAccCodeBuildProject_basic(t *testing.T) { roleResourceName := "aws_iam_role.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, codebuild.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckProjectDestroy(ctx), @@ -123,7 +123,7 @@ func TestAccCodeBuildProject_publicVisibility(t *testing.T) { roleResourceName := "aws_iam_role.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, codebuild.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckProjectDestroy(ctx), @@ -167,7 +167,7 @@ func TestAccCodeBuildProject_badgeEnabled(t *testing.T) { resourceName := "aws_codebuild_project.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, codebuild.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckProjectDestroy(ctx), @@ -196,7 +196,7 @@ func TestAccCodeBuildProject_buildTimeout(t *testing.T) { resourceName := "aws_codebuild_project.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, codebuild.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckProjectDestroy(ctx), @@ -231,7 +231,7 @@ func TestAccCodeBuildProject_queuedTimeout(t *testing.T) { resourceName := "aws_codebuild_project.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, codebuild.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckProjectDestroy(ctx), @@ -268,7 +268,7 @@ func TestAccCodeBuildProject_cache(t *testing.T) { s3Location2 := rName + "-2" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, codebuild.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckProjectDestroy(ctx), @@ -352,7 +352,7 @@ func TestAccCodeBuildProject_description(t *testing.T) { resourceName := "aws_codebuild_project.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, codebuild.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckProjectDestroy(ctx), @@ -387,7 +387,7 @@ func TestAccCodeBuildProject_fileSystemLocations(t *testing.T) { resourceName := "aws_codebuild_project.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, codebuild.EndpointsID, "efs"), //using efs.EndpointsID will import efs and make linters sad ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckProjectDestroy(ctx), @@ -438,7 +438,7 @@ func TestAccCodeBuildProject_sourceVersion(t *testing.T) { resourceName := "aws_codebuild_project.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, codebuild.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckProjectDestroy(ctx), @@ -461,7 +461,7 @@ func TestAccCodeBuildProject_encryptionKey(t *testing.T) { resourceName := "aws_codebuild_project.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, codebuild.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckProjectDestroy(ctx), @@ -489,7 +489,7 @@ func TestAccCodeBuildProject_Environment_environmentVariable(t *testing.T) { resourceName := "aws_codebuild_project.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, codebuild.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckProjectDestroy(ctx), @@ -539,7 +539,7 @@ func TestAccCodeBuildProject_EnvironmentEnvironmentVariable_type(t *testing.T) { resourceName := "aws_codebuild_project.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, codebuild.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckProjectDestroy(ctx), @@ -584,7 +584,7 @@ func TestAccCodeBuildProject_EnvironmentEnvironmentVariable_value(t *testing.T) resourceName := "aws_codebuild_project.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, codebuild.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckProjectDestroy(ctx), @@ -634,7 +634,7 @@ func TestAccCodeBuildProject_Environment_certificate(t *testing.T) { resourceName := "aws_codebuild_project.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, codebuild.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckProjectDestroy(ctx), @@ -662,7 +662,7 @@ func TestAccCodeBuildProject_Logs_cloudWatchLogs(t *testing.T) { resourceName := "aws_codebuild_project.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, codebuild.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckProjectDestroy(ctx), @@ -708,7 +708,7 @@ func TestAccCodeBuildProject_Logs_s3Logs(t *testing.T) { resourceName := "aws_codebuild_project.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, codebuild.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckProjectDestroy(ctx), @@ -758,7 +758,7 @@ func TestAccCodeBuildProject_buildBatch(t *testing.T) { } resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, codebuild.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckProjectDestroy(ctx), @@ -803,7 +803,7 @@ func TestAccCodeBuildProject_Source_gitCloneDepth(t *testing.T) { resourceName := "aws_codebuild_project.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, codebuild.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckProjectDestroy(ctx), @@ -838,7 +838,7 @@ func TestAccCodeBuildProject_SourceGitSubmodules_codeCommit(t *testing.T) { resourceName := "aws_codebuild_project.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, codebuild.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckProjectDestroy(ctx), @@ -875,7 +875,7 @@ func TestAccCodeBuildProject_SourceGitSubmodules_gitHub(t *testing.T) { resourceName := "aws_codebuild_project.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, codebuild.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckProjectDestroy(ctx), @@ -908,7 +908,7 @@ func TestAccCodeBuildProject_SourceGitSubmodules_gitHubEnterprise(t *testing.T) resourceName := "aws_codebuild_project.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, codebuild.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckProjectDestroy(ctx), @@ -941,7 +941,7 @@ func TestAccCodeBuildProject_SecondarySourcesGitSubmodules_codeCommit(t *testing resourceName := "aws_codebuild_project.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, codebuild.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckProjectDestroy(ctx), @@ -1003,7 +1003,7 @@ func TestAccCodeBuildProject_SecondarySourcesGitSubmodules_gitHub(t *testing.T) resourceName := "aws_codebuild_project.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, codebuild.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckProjectDestroy(ctx), @@ -1036,7 +1036,7 @@ func TestAccCodeBuildProject_SecondarySourcesGitSubmodules_gitHubEnterprise(t *t resourceName := "aws_codebuild_project.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, codebuild.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckProjectDestroy(ctx), @@ -1069,7 +1069,7 @@ func TestAccCodeBuildProject_SecondarySourcesVersions(t *testing.T) { resourceName := "aws_codebuild_project.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, codebuild.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckProjectDestroy(ctx), @@ -1166,7 +1166,7 @@ func TestAccCodeBuildProject_SourceBuildStatus_gitHubEnterprise(t *testing.T) { } resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, codebuild.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckProjectDestroy(ctx), @@ -1193,7 +1193,7 @@ func TestAccCodeBuildProject_Source_insecureSSL(t *testing.T) { resourceName := "aws_codebuild_project.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, codebuild.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckProjectDestroy(ctx), @@ -1230,7 +1230,7 @@ func TestAccCodeBuildProject_SourceReportBuildStatus_bitbucket(t *testing.T) { sourceLocation := testAccBitbucketSourceLocationFromEnv() resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, codebuild.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckProjectDestroy(ctx), @@ -1265,7 +1265,7 @@ func TestAccCodeBuildProject_SourceReportBuildStatus_gitHub(t *testing.T) { resourceName := "aws_codebuild_project.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, codebuild.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckProjectDestroy(ctx), @@ -1300,7 +1300,7 @@ func TestAccCodeBuildProject_SourceReportBuildStatus_gitHubEnterprise(t *testing resourceName := "aws_codebuild_project.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, codebuild.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckProjectDestroy(ctx), @@ -1337,7 +1337,7 @@ func TestAccCodeBuildProject_SourceType_bitbucket(t *testing.T) { sourceLocation := testAccBitbucketSourceLocationFromEnv() resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, codebuild.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckProjectDestroy(ctx), @@ -1366,7 +1366,7 @@ func TestAccCodeBuildProject_SourceType_codeCommit(t *testing.T) { resourceName := "aws_codebuild_project.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, codebuild.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckProjectDestroy(ctx), @@ -1394,7 +1394,7 @@ func TestAccCodeBuildProject_SourceType_codePipeline(t *testing.T) { resourceName := "aws_codebuild_project.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, codebuild.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckProjectDestroy(ctx), @@ -1422,7 +1422,7 @@ func TestAccCodeBuildProject_SourceType_gitHubEnterprise(t *testing.T) { resourceName := "aws_codebuild_project.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, codebuild.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckProjectDestroy(ctx), @@ -1450,7 +1450,7 @@ func TestAccCodeBuildProject_SourceType_s3(t *testing.T) { resourceName := "aws_codebuild_project.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, codebuild.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckProjectDestroy(ctx), @@ -1484,7 +1484,7 @@ phases: ` resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, codebuild.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckProjectDestroy(ctx), @@ -1517,7 +1517,7 @@ phases: ` resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, codebuild.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckProjectDestroy(ctx), @@ -1541,7 +1541,7 @@ func TestAccCodeBuildProject_tags(t *testing.T) { resourceName := "aws_codebuild_project.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, codebuild.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckProjectDestroy(ctx), @@ -1580,7 +1580,7 @@ func TestAccCodeBuildProject_vpc(t *testing.T) { resourceName := "aws_codebuild_project.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, codebuild.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckProjectDestroy(ctx), @@ -1628,7 +1628,7 @@ func TestAccCodeBuildProject_windowsServer2019Container(t *testing.T) { resourceName := "aws_codebuild_project.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, codebuild.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckProjectDestroy(ctx), @@ -1662,7 +1662,7 @@ func TestAccCodeBuildProject_armContainer(t *testing.T) { resourceName := "aws_codebuild_project.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, codebuild.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckProjectDestroy(ctx), @@ -1692,7 +1692,7 @@ func TestAccCodeBuildProject_Artifacts_artifactIdentifier(t *testing.T) { artifactIdentifier2 := "artifactIdentifier2" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, codebuild.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckProjectDestroy(ctx), @@ -1729,7 +1729,7 @@ func TestAccCodeBuildProject_Artifacts_encryptionDisabled(t *testing.T) { resourceName := "aws_codebuild_project.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, codebuild.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckProjectDestroy(ctx), @@ -1767,7 +1767,7 @@ func TestAccCodeBuildProject_Artifacts_location(t *testing.T) { resourceName := "aws_codebuild_project.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, codebuild.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckProjectDestroy(ctx), @@ -1807,7 +1807,7 @@ func TestAccCodeBuildProject_Artifacts_name(t *testing.T) { name2 := "name2" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, codebuild.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckProjectDestroy(ctx), @@ -1844,7 +1844,7 @@ func TestAccCodeBuildProject_Artifacts_namespaceType(t *testing.T) { resourceName := "aws_codebuild_project.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, codebuild.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckProjectDestroy(ctx), @@ -1881,7 +1881,7 @@ func TestAccCodeBuildProject_Artifacts_overrideArtifactName(t *testing.T) { resourceName := "aws_codebuild_project.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, codebuild.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckProjectDestroy(ctx), @@ -1918,7 +1918,7 @@ func TestAccCodeBuildProject_Artifacts_packaging(t *testing.T) { resourceName := "aws_codebuild_project.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, codebuild.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckProjectDestroy(ctx), @@ -1955,7 +1955,7 @@ func TestAccCodeBuildProject_Artifacts_path(t *testing.T) { resourceName := "aws_codebuild_project.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, codebuild.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckProjectDestroy(ctx), @@ -1995,7 +1995,7 @@ func TestAccCodeBuildProject_Artifacts_type(t *testing.T) { type2 := codebuild.ArtifactsTypeCodepipeline resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, codebuild.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckProjectDestroy(ctx), @@ -2032,7 +2032,7 @@ func TestAccCodeBuildProject_Artifacts_bucketOwnerAccess(t *testing.T) { resourceName := "aws_codebuild_project.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, codebuild.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckProjectDestroy(ctx), @@ -2069,7 +2069,7 @@ func TestAccCodeBuildProject_secondaryArtifacts(t *testing.T) { resourceName := "aws_codebuild_project.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, codebuild.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckProjectDestroy(ctx), @@ -2107,7 +2107,7 @@ func TestAccCodeBuildProject_SecondaryArtifacts_artifactIdentifier(t *testing.T) artifactIdentifier2 := "artifactIdentifier2" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, codebuild.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckProjectDestroy(ctx), @@ -2148,7 +2148,7 @@ func TestAccCodeBuildProject_SecondaryArtifacts_overrideArtifactName(t *testing. resourceName := "aws_codebuild_project.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, codebuild.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckProjectDestroy(ctx), @@ -2189,7 +2189,7 @@ func TestAccCodeBuildProject_SecondaryArtifacts_encryptionDisabled(t *testing.T) resourceName := "aws_codebuild_project.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, codebuild.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckProjectDestroy(ctx), @@ -2231,7 +2231,7 @@ func TestAccCodeBuildProject_SecondaryArtifacts_location(t *testing.T) { resourceName := "aws_codebuild_project.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, codebuild.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckProjectDestroy(ctx), @@ -2278,7 +2278,7 @@ func TestAccCodeBuildProject_SecondaryArtifacts_name(t *testing.T) { name2 := "name2" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, codebuild.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckProjectDestroy(ctx), @@ -2319,7 +2319,7 @@ func TestAccCodeBuildProject_SecondaryArtifacts_namespaceType(t *testing.T) { resourceName := "aws_codebuild_project.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, codebuild.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckProjectDestroy(ctx), @@ -2360,7 +2360,7 @@ func TestAccCodeBuildProject_SecondaryArtifacts_packaging(t *testing.T) { resourceName := "aws_codebuild_project.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, codebuild.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckProjectDestroy(ctx), @@ -2404,7 +2404,7 @@ func TestAccCodeBuildProject_SecondaryArtifacts_path(t *testing.T) { path2 := "path2" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, codebuild.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckProjectDestroy(ctx), @@ -2445,7 +2445,7 @@ func TestAccCodeBuildProject_SecondaryArtifacts_type(t *testing.T) { resourceName := "aws_codebuild_project.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, codebuild.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckProjectDestroy(ctx), @@ -2476,7 +2476,7 @@ func TestAccCodeBuildProject_SecondarySources_codeCommit(t *testing.T) { resourceName := "aws_codebuild_project.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, codebuild.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckProjectDestroy(ctx), @@ -2533,7 +2533,7 @@ func TestAccCodeBuildProject_concurrentBuildLimit(t *testing.T) { resourceName := "aws_codebuild_project.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, ErrorCheck: acctest.ErrorCheck(t, codebuild.EndpointsID), CheckDestroy: testAccCheckProjectDestroy(ctx), @@ -2568,7 +2568,7 @@ func TestAccCodeBuildProject_Environment_registryCredential(t *testing.T) { resourceName := "aws_codebuild_project.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, codebuild.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckProjectDestroy(ctx), @@ -2602,7 +2602,7 @@ func TestAccCodeBuildProject_disappears(t *testing.T) { resourceName := "aws_codebuild_project.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, codebuild.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckProjectDestroy(ctx), diff --git a/internal/service/codebuild/report_group_test.go b/internal/service/codebuild/report_group_test.go index 8f9dfd0aa37d..b8bf5fd37073 100644 --- a/internal/service/codebuild/report_group_test.go +++ b/internal/service/codebuild/report_group_test.go @@ -21,7 +21,7 @@ func TestAccCodeBuildReportGroup_basic(t *testing.T) { resourceName := "aws_codebuild_report_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckReportGroup(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckReportGroup(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, codebuild.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckReportGroupDestroy(ctx), @@ -54,7 +54,7 @@ func TestAccCodeBuildReportGroup_Export_s3(t *testing.T) { resourceName := "aws_codebuild_report_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckReportGroup(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckReportGroup(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, codebuild.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckReportGroupDestroy(ctx), @@ -105,7 +105,7 @@ func TestAccCodeBuildReportGroup_tags(t *testing.T) { resourceName := "aws_codebuild_report_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckReportGroup(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckReportGroup(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, codebuild.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckReportGroupDestroy(ctx), @@ -152,7 +152,7 @@ func TestAccCodeBuildReportGroup_deleteReports(t *testing.T) { resourceName := "aws_codebuild_report_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckReportGroup(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckReportGroup(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, codebuild.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckReportGroupDestroy(ctx), @@ -181,7 +181,7 @@ func TestAccCodeBuildReportGroup_disappears(t *testing.T) { resourceName := "aws_codebuild_report_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckReportGroup(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckReportGroup(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, codebuild.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckReportGroupDestroy(ctx), diff --git a/internal/service/codebuild/resource_policy_test.go b/internal/service/codebuild/resource_policy_test.go index 7d7359df3c0e..5cfdad446b38 100644 --- a/internal/service/codebuild/resource_policy_test.go +++ b/internal/service/codebuild/resource_policy_test.go @@ -22,7 +22,7 @@ func TestAccCodeBuildResourcePolicy_basic(t *testing.T) { resourceName := "aws_codebuild_resource_policy.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, codebuild.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckResourcePolicyDestroy(ctx), @@ -51,7 +51,7 @@ func TestAccCodeBuildResourcePolicy_disappears(t *testing.T) { resourceName := "aws_codebuild_resource_policy.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, codebuild.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckResourcePolicyDestroy(ctx), @@ -76,7 +76,7 @@ func TestAccCodeBuildResourcePolicy_disappears_resource(t *testing.T) { resourceName := "aws_codebuild_resource_policy.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, codebuild.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckResourcePolicyDestroy(ctx), diff --git a/internal/service/codebuild/source_credential_test.go b/internal/service/codebuild/source_credential_test.go index b88f6a4b4aa3..0d9dcf03be73 100644 --- a/internal/service/codebuild/source_credential_test.go +++ b/internal/service/codebuild/source_credential_test.go @@ -23,7 +23,7 @@ func TestAccCodeBuildSourceCredential_basic(t *testing.T) { resourceName := "aws_codebuild_source_credential.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, codebuild.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSourceCredentialDestroy(ctx), @@ -63,7 +63,7 @@ func TestAccCodeBuildSourceCredential_basicAuth(t *testing.T) { resourceName := "aws_codebuild_source_credential.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, codebuild.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSourceCredentialDestroy(ctx), @@ -102,7 +102,7 @@ func TestAccCodeBuildSourceCredential_disappears(t *testing.T) { resourceName := "aws_codebuild_source_credential.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, codebuild.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSourceCredentialDestroy(ctx), diff --git a/internal/service/codebuild/webhook_test.go b/internal/service/codebuild/webhook_test.go index b634df3b5285..988d08ac773a 100644 --- a/internal/service/codebuild/webhook_test.go +++ b/internal/service/codebuild/webhook_test.go @@ -25,7 +25,7 @@ func TestAccCodeBuildWebhook_bitbucket(t *testing.T) { sourceLocation := testAccBitbucketSourceLocationFromEnv() resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, codebuild.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckWebhookDestroy(ctx), @@ -58,7 +58,7 @@ func TestAccCodeBuildWebhook_gitHub(t *testing.T) { resourceName := "aws_codebuild_webhook.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, codebuild.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckWebhookDestroy(ctx), @@ -91,7 +91,7 @@ func TestAccCodeBuildWebhook_gitHubEnterprise(t *testing.T) { resourceName := "aws_codebuild_webhook.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, codebuild.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckWebhookDestroy(ctx), @@ -141,7 +141,7 @@ func TestAccCodeBuildWebhook_buildType(t *testing.T) { resourceName := "aws_codebuild_webhook.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, codebuild.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckWebhookDestroy(ctx), @@ -184,7 +184,7 @@ func TestAccCodeBuildWebhook_branchFilter(t *testing.T) { resourceName := "aws_codebuild_webhook.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, codebuild.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckWebhookDestroy(ctx), @@ -220,7 +220,7 @@ func TestAccCodeBuildWebhook_filterGroup(t *testing.T) { resourceName := "aws_codebuild_webhook.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, codebuild.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckWebhookDestroy(ctx), From 660e5ca9eaab239886b4a23f5cda5fe4ad074f5f Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Fri, 24 Feb 2023 16:36:41 -0500 Subject: [PATCH 115/763] Add 'Context' argument to 'acctest.PreCheck' for codecommit. --- .../approval_rule_template_association_test.go | 6 +++--- .../approval_rule_template_data_source_test.go | 2 +- .../service/codecommit/approval_rule_template_test.go | 8 ++++---- .../service/codecommit/repository_data_source_test.go | 2 +- internal/service/codecommit/repository_test.go | 10 +++++----- internal/service/codecommit/trigger_test.go | 2 +- 6 files changed, 15 insertions(+), 15 deletions(-) diff --git a/internal/service/codecommit/approval_rule_template_association_test.go b/internal/service/codecommit/approval_rule_template_association_test.go index 8fc44951c73f..6ad8b954e093 100644 --- a/internal/service/codecommit/approval_rule_template_association_test.go +++ b/internal/service/codecommit/approval_rule_template_association_test.go @@ -23,7 +23,7 @@ func TestAccCodeCommitApprovalRuleTemplateAssociation_basic(t *testing.T) { templateResourceName := "aws_codecommit_approval_rule_template.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, codecommit.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckApprovalRuleTemplateAssociationDestroy(ctx), @@ -51,7 +51,7 @@ func TestAccCodeCommitApprovalRuleTemplateAssociation_disappears(t *testing.T) { resourceName := "aws_codecommit_approval_rule_template_association.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, codecommit.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckApprovalRuleTemplateAssociationDestroy(ctx), @@ -75,7 +75,7 @@ func TestAccCodeCommitApprovalRuleTemplateAssociation_Disappears_repository(t *t resourceName := "aws_codecommit_approval_rule_template_association.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, codecommit.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckApprovalRuleTemplateAssociationDestroy(ctx), 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 6b60704998a0..10236d0864e8 100644 --- a/internal/service/codecommit/approval_rule_template_data_source_test.go +++ b/internal/service/codecommit/approval_rule_template_data_source_test.go @@ -16,7 +16,7 @@ func TestAccCodeCommitApprovalRuleTemplateDataSource_basic(t *testing.T) { datasourceName := "data.aws_codecommit_approval_rule_template.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, codecommit.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ diff --git a/internal/service/codecommit/approval_rule_template_test.go b/internal/service/codecommit/approval_rule_template_test.go index 98d7b1efc1da..d3a4ed06ef44 100644 --- a/internal/service/codecommit/approval_rule_template_test.go +++ b/internal/service/codecommit/approval_rule_template_test.go @@ -22,7 +22,7 @@ func TestAccCodeCommitApprovalRuleTemplate_basic(t *testing.T) { resourceName := "aws_codecommit_approval_rule_template.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, codecommit.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckApprovalRuleTemplateDestroy(ctx), @@ -55,7 +55,7 @@ func TestAccCodeCommitApprovalRuleTemplate_disappears(t *testing.T) { resourceName := "aws_codecommit_approval_rule_template.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, codecommit.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckApprovalRuleTemplateDestroy(ctx), @@ -78,7 +78,7 @@ func TestAccCodeCommitApprovalRuleTemplate_updateContentAndDescription(t *testin resourceName := "aws_codecommit_approval_rule_template.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, codecommit.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckApprovalRuleTemplateDestroy(ctx), @@ -115,7 +115,7 @@ func TestAccCodeCommitApprovalRuleTemplate_updateName(t *testing.T) { resourceName := "aws_codecommit_approval_rule_template.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, codecommit.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckApprovalRuleTemplateDestroy(ctx), diff --git a/internal/service/codecommit/repository_data_source_test.go b/internal/service/codecommit/repository_data_source_test.go index dd0dffd500f3..444d2bae22be 100644 --- a/internal/service/codecommit/repository_data_source_test.go +++ b/internal/service/codecommit/repository_data_source_test.go @@ -16,7 +16,7 @@ func TestAccCodeCommitRepositoryDataSource_basic(t *testing.T) { datasourceName := "data.aws_codecommit_repository.default" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, codecommit.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ diff --git a/internal/service/codecommit/repository_test.go b/internal/service/codecommit/repository_test.go index 0e74b95dc069..81f2cdeb6497 100644 --- a/internal/service/codecommit/repository_test.go +++ b/internal/service/codecommit/repository_test.go @@ -21,7 +21,7 @@ func TestAccCodeCommitRepository_basic(t *testing.T) { resourceName := "aws_codecommit_repository.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, codecommit.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRepositoryDestroy(ctx), @@ -47,7 +47,7 @@ func TestAccCodeCommitRepository_withChanges(t *testing.T) { resourceName := "aws_codecommit_repository.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, codecommit.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRepositoryDestroy(ctx), @@ -83,7 +83,7 @@ func TestAccCodeCommitRepository_CreateDefault_branch(t *testing.T) { resourceName := "aws_codecommit_repository.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, codecommit.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRepositoryDestroy(ctx), @@ -112,7 +112,7 @@ func TestAccCodeCommitRepository_CreateAndUpdateDefault_branch(t *testing.T) { resourceName := "aws_codecommit_repository.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, codecommit.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRepositoryDestroy(ctx), @@ -148,7 +148,7 @@ func TestAccCodeCommitRepository_tags(t *testing.T) { resourceName := "aws_codecommit_repository.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, codecommit.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRepositoryDestroy(ctx), diff --git a/internal/service/codecommit/trigger_test.go b/internal/service/codecommit/trigger_test.go index 76b5fffcc061..1c29a9130a0d 100644 --- a/internal/service/codecommit/trigger_test.go +++ b/internal/service/codecommit/trigger_test.go @@ -21,7 +21,7 @@ func TestAccCodeCommitTrigger_basic(t *testing.T) { resourceName := "aws_codecommit_trigger.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, codecommit.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTriggerDestroy(ctx), From b6aae02b309aaf74329957a296675a71a78cc2ea Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Fri, 24 Feb 2023 16:36:42 -0500 Subject: [PATCH 116/763] Add 'Context' argument to 'acctest.PreCheck' for codepipeline. --- .../service/codepipeline/codepipeline_test.go | 22 +++++++++---------- .../codepipeline/custom_action_type_test.go | 8 +++---- internal/service/codepipeline/webhook_test.go | 12 +++++----- 3 files changed, 21 insertions(+), 21 deletions(-) diff --git a/internal/service/codepipeline/codepipeline_test.go b/internal/service/codepipeline/codepipeline_test.go index 56971dae9e9f..64ab261c3be4 100644 --- a/internal/service/codepipeline/codepipeline_test.go +++ b/internal/service/codepipeline/codepipeline_test.go @@ -27,7 +27,7 @@ func TestAccCodePipeline_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) testAccPreCheckSupported(ctx, t) acctest.PreCheckPartitionHasService(codestarconnections.EndpointsID, t) }, @@ -133,7 +133,7 @@ func TestAccCodePipeline_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) testAccPreCheckSupported(ctx, t) acctest.PreCheckPartitionHasService(codestarconnections.EndpointsID, t) }, @@ -161,7 +161,7 @@ func TestAccCodePipeline_emptyStageArtifacts(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) testAccPreCheckSupported(ctx, t) acctest.PreCheckPartitionHasService(codestarconnections.EndpointsID, t) }, @@ -204,7 +204,7 @@ func TestAccCodePipeline_deployWithServiceRole(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) testAccPreCheckSupported(ctx, t) acctest.PreCheckPartitionHasService(codestarconnections.EndpointsID, t) }, @@ -238,7 +238,7 @@ func TestAccCodePipeline_tags(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) testAccPreCheckSupported(ctx, t) acctest.PreCheckPartitionHasService(codestarconnections.EndpointsID, t) }, @@ -296,7 +296,7 @@ func TestAccCodePipeline_MultiRegion_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckMultipleRegion(t, 2) testAccPreCheckSupported(ctx, t, acctest.AlternateRegion()) acctest.PreCheckPartitionHasService(codestarconnections.EndpointsID, t) @@ -338,7 +338,7 @@ func TestAccCodePipeline_MultiRegion_update(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckMultipleRegion(t, 2) testAccPreCheckSupported(ctx, t, acctest.AlternateRegion()) acctest.PreCheckPartitionHasService(codestarconnections.EndpointsID, t) @@ -394,7 +394,7 @@ func TestAccCodePipeline_MultiRegion_convertSingleRegion(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckMultipleRegion(t, 2) testAccPreCheckSupported(ctx, t, acctest.AlternateRegion()) acctest.PreCheckPartitionHasService(codestarconnections.EndpointsID, t) @@ -459,7 +459,7 @@ func TestAccCodePipeline_withNamespace(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) testAccPreCheckSupported(ctx, t) acctest.PreCheckPartitionHasService(codestarconnections.EndpointsID, t) }, @@ -494,7 +494,7 @@ func TestAccCodePipeline_withGitHubV1SourceAction(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) testAccPreCheckSupported(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, codepipeline.EndpointsID), @@ -569,7 +569,7 @@ func TestAccCodePipeline_ecr(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) testAccPreCheckSupported(ctx, t) acctest.PreCheckPartitionHasService(codestarconnections.EndpointsID, t) }, diff --git a/internal/service/codepipeline/custom_action_type_test.go b/internal/service/codepipeline/custom_action_type_test.go index 9b4d22f2afdf..b586b00b0b94 100644 --- a/internal/service/codepipeline/custom_action_type_test.go +++ b/internal/service/codepipeline/custom_action_type_test.go @@ -24,7 +24,7 @@ func TestAccCodePipelineCustomActionType_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(codestarconnections.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, codepipeline.EndpointsID), @@ -68,7 +68,7 @@ func TestAccCodePipelineCustomActionType_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(codestarconnections.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, codepipeline.EndpointsID), @@ -95,7 +95,7 @@ func TestAccCodePipelineCustomActionType_tags(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(codestarconnections.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, codepipeline.EndpointsID), @@ -144,7 +144,7 @@ func TestAccCodePipelineCustomActionType_allAttributes(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(codestarconnections.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, codepipeline.EndpointsID), diff --git a/internal/service/codepipeline/webhook_test.go b/internal/service/codepipeline/webhook_test.go index 302fdb22ddc3..013905c6e0c1 100644 --- a/internal/service/codepipeline/webhook_test.go +++ b/internal/service/codepipeline/webhook_test.go @@ -29,7 +29,7 @@ func TestAccCodePipelineWebhook_basic(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) testAccPreCheckSupported(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, codepipeline.EndpointsID), @@ -100,7 +100,7 @@ func TestAccCodePipelineWebhook_ipAuth(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) testAccPreCheckSupported(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, codepipeline.EndpointsID), @@ -136,7 +136,7 @@ func TestAccCodePipelineWebhook_unauthenticated(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) testAccPreCheckSupported(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, codepipeline.EndpointsID), @@ -170,7 +170,7 @@ func TestAccCodePipelineWebhook_tags(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) testAccPreCheckSupported(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, codepipeline.EndpointsID), @@ -235,7 +235,7 @@ func TestAccCodePipelineWebhook_disappears(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) testAccPreCheckSupported(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, codepipeline.EndpointsID), @@ -265,7 +265,7 @@ func TestAccCodePipelineWebhook_UpdateAuthentication_secretToken(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) testAccPreCheckSupported(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, codepipeline.EndpointsID), From 2d8267e0c2aa9dfb0f5cbe1f60c5d9fba6d517ee Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Fri, 24 Feb 2023 16:36:42 -0500 Subject: [PATCH 117/763] Add 'Context' argument to 'acctest.PreCheck' for codestarconnections. --- .../codestarconnections/connection_data_source_test.go | 4 ++-- internal/service/codestarconnections/connection_test.go | 8 ++++---- internal/service/codestarconnections/host_test.go | 6 +++--- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/internal/service/codestarconnections/connection_data_source_test.go b/internal/service/codestarconnections/connection_data_source_test.go index 823a2bbb349a..4653f524af8b 100644 --- a/internal/service/codestarconnections/connection_data_source_test.go +++ b/internal/service/codestarconnections/connection_data_source_test.go @@ -17,7 +17,7 @@ func TestAccCodeStarConnectionsConnectionDataSource_basic(t *testing.T) { resourceName := "aws_codestarconnections_connection.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(codestarconnections.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(codestarconnections.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, codestarconnections.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ @@ -48,7 +48,7 @@ func TestAccCodeStarConnectionsConnectionDataSource_tags(t *testing.T) { resourceName := "aws_codestarconnections_connection.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(codestarconnections.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(codestarconnections.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, codestarconnections.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ diff --git a/internal/service/codestarconnections/connection_test.go b/internal/service/codestarconnections/connection_test.go index b223709d698a..efda863ce9d2 100644 --- a/internal/service/codestarconnections/connection_test.go +++ b/internal/service/codestarconnections/connection_test.go @@ -24,7 +24,7 @@ func TestAccCodeStarConnectionsConnection_basic(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(codestarconnections.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(codestarconnections.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, codestarconnections.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckConnectionDestroy(ctx), @@ -56,7 +56,7 @@ func TestAccCodeStarConnectionsConnection_hostARN(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(codestarconnections.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(codestarconnections.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, codestarconnections.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckConnectionDestroy(ctx), @@ -89,7 +89,7 @@ func TestAccCodeStarConnectionsConnection_disappears(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(codestarconnections.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(codestarconnections.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, codestarconnections.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckConnectionDestroy(ctx), @@ -113,7 +113,7 @@ func TestAccCodeStarConnectionsConnection_tags(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(codestarconnections.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(codestarconnections.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, codestarconnections.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckConnectionDestroy(ctx), diff --git a/internal/service/codestarconnections/host_test.go b/internal/service/codestarconnections/host_test.go index 0d57c667d0c5..838a8cf5e1c6 100644 --- a/internal/service/codestarconnections/host_test.go +++ b/internal/service/codestarconnections/host_test.go @@ -24,7 +24,7 @@ func TestAccCodeStarConnectionsHost_basic(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(codestarconnections.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(codestarconnections.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, codestarconnections.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckHostDestroy(ctx), @@ -56,7 +56,7 @@ func TestAccCodeStarConnectionsHost_disappears(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(codestarconnections.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(codestarconnections.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, codestarconnections.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckHostDestroy(ctx), @@ -80,7 +80,7 @@ func TestAccCodeStarConnectionsHost_vpc(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(codestarconnections.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(codestarconnections.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, codestarconnections.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckHostDestroy(ctx), From 08346119921ee86ec8c15ad9dcc9535a2a4d0981 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Fri, 24 Feb 2023 16:36:42 -0500 Subject: [PATCH 118/763] Add 'Context' argument to 'acctest.PreCheck' for codestarnotifications. --- .../codestarnotifications/notification_rule_test.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/internal/service/codestarnotifications/notification_rule_test.go b/internal/service/codestarnotifications/notification_rule_test.go index 7c09ca8ec195..e7c8bd8cc369 100644 --- a/internal/service/codestarnotifications/notification_rule_test.go +++ b/internal/service/codestarnotifications/notification_rule_test.go @@ -26,7 +26,7 @@ func TestAccCodeStarNotificationsNotificationRule_basic(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, codestarnotifications.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckNotificationRuleDestroy(ctx), @@ -58,7 +58,7 @@ func TestAccCodeStarNotificationsNotificationRule_status(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, codestarnotifications.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckNotificationRuleDestroy(ctx), @@ -96,7 +96,7 @@ func TestAccCodeStarNotificationsNotificationRule_targets(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, codestarnotifications.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckNotificationRuleDestroy(ctx), @@ -134,7 +134,7 @@ func TestAccCodeStarNotificationsNotificationRule_tags(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, codestarnotifications.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckNotificationRuleDestroy(ctx), @@ -178,7 +178,7 @@ func TestAccCodeStarNotificationsNotificationRule_eventTypeIDs(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, codestarnotifications.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckNotificationRuleDestroy(ctx), From 13c16d078e88ca4eb736689daa9d79dd75b24f12 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Fri, 24 Feb 2023 16:36:43 -0500 Subject: [PATCH 119/763] Add 'Context' argument to 'acctest.PreCheck' for cognitoidentity. --- .../pool_provider_principal_tag_test.go | 8 ++++---- .../pool_roles_attachment_test.go | 12 ++++++------ internal/service/cognitoidentity/pool_test.go | 18 +++++++++--------- 3 files changed, 19 insertions(+), 19 deletions(-) diff --git a/internal/service/cognitoidentity/pool_provider_principal_tag_test.go b/internal/service/cognitoidentity/pool_provider_principal_tag_test.go index 0e5962c46c03..b75ffc037d84 100644 --- a/internal/service/cognitoidentity/pool_provider_principal_tag_test.go +++ b/internal/service/cognitoidentity/pool_provider_principal_tag_test.go @@ -23,7 +23,7 @@ func TestAccCognitoIdentityPoolProviderPrincipalTags_basic(t *testing.T) { name := sdkacctest.RandString(10) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, cognitoidentity.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckPoolProviderPrincipalTagsDestroy(ctx), @@ -46,7 +46,7 @@ func TestAccCognitoIdentityPoolProviderPrincipalTags_updated(t *testing.T) { name := sdkacctest.RandString(10) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, cognitoidentity.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckPoolProviderPrincipalTagsDestroy(ctx), @@ -83,7 +83,7 @@ func TestAccCognitoIdentityPoolProviderPrincipalTags_disappears(t *testing.T) { name := sdkacctest.RandString(10) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, cognitoidentity.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckPoolProviderPrincipalTagsDestroy(ctx), @@ -106,7 +106,7 @@ func TestAccCognitoIdentityPoolProviderPrincipalTags_oidc(t *testing.T) { name := sdkacctest.RandString(10) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, cognitoidentity.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckPoolProviderPrincipalTagsDestroy(ctx), diff --git a/internal/service/cognitoidentity/pool_roles_attachment_test.go b/internal/service/cognitoidentity/pool_roles_attachment_test.go index 11d0315daed4..07c00a77b582 100644 --- a/internal/service/cognitoidentity/pool_roles_attachment_test.go +++ b/internal/service/cognitoidentity/pool_roles_attachment_test.go @@ -25,7 +25,7 @@ func TestAccCognitoIdentityPoolRolesAttachment_basic(t *testing.T) { updatedName := sdkacctest.RandString(10) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, cognitoidentity.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckPoolRolesAttachmentDestroy(ctx), @@ -61,7 +61,7 @@ func TestAccCognitoIdentityPoolRolesAttachment_roleMappings(t *testing.T) { name := sdkacctest.RandString(10) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, cognitoidentity.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckPoolRolesAttachmentDestroy(ctx), @@ -117,7 +117,7 @@ func TestAccCognitoIdentityPoolRolesAttachment_disappears(t *testing.T) { name := sdkacctest.RandString(10) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, cognitoidentity.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckPoolRolesAttachmentDestroy(ctx), @@ -139,7 +139,7 @@ func TestAccCognitoIdentityPoolRolesAttachment_roleMappingsWithAmbiguousRoleReso name := sdkacctest.RandString(10) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, cognitoidentity.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckPoolRolesAttachmentDestroy(ctx), @@ -157,7 +157,7 @@ func TestAccCognitoIdentityPoolRolesAttachment_roleMappingsWithRulesTypeError(t name := sdkacctest.RandString(10) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, cognitoidentity.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckPoolRolesAttachmentDestroy(ctx), @@ -175,7 +175,7 @@ func TestAccCognitoIdentityPoolRolesAttachment_roleMappingsWithTokenTypeError(t name := sdkacctest.RandString(10) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, cognitoidentity.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckPoolRolesAttachmentDestroy(ctx), diff --git a/internal/service/cognitoidentity/pool_test.go b/internal/service/cognitoidentity/pool_test.go index 4ea224baa4eb..8189ad4d1df4 100644 --- a/internal/service/cognitoidentity/pool_test.go +++ b/internal/service/cognitoidentity/pool_test.go @@ -26,7 +26,7 @@ func TestAccCognitoIdentityPool_basic(t *testing.T) { resourceName := "aws_cognito_identity_pool.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, cognitoidentity.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckPoolDestroy(ctx), @@ -67,7 +67,7 @@ func TestAccCognitoIdentityPool_DeveloperProviderName(t *testing.T) { resourceName := "aws_cognito_identity_pool.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, cognitoidentity.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckPoolDestroy(ctx), @@ -105,7 +105,7 @@ func TestAccCognitoIdentityPool_supportedLoginProviders(t *testing.T) { resourceName := "aws_cognito_identity_pool.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, cognitoidentity.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckPoolDestroy(ctx), @@ -155,7 +155,7 @@ func TestAccCognitoIdentityPool_openidConnectProviderARNs(t *testing.T) { resourceName := "aws_cognito_identity_pool.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, cognitoidentity.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckPoolDestroy(ctx), @@ -204,7 +204,7 @@ func TestAccCognitoIdentityPool_samlProviderARNs(t *testing.T) { resourceName := "aws_cognito_identity_pool.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, cognitoidentity.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckPoolDestroy(ctx), @@ -253,7 +253,7 @@ func TestAccCognitoIdentityPool_cognitoIdentityProviders(t *testing.T) { resourceName := "aws_cognito_identity_pool.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, cognitoidentity.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckPoolDestroy(ctx), @@ -315,7 +315,7 @@ func TestAccCognitoIdentityPool_addingNewProviderKeepsOldProvider(t *testing.T) resourceName := "aws_cognito_identity_pool.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, cognitoidentity.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckPoolDestroy(ctx), @@ -364,7 +364,7 @@ func TestAccCognitoIdentityPool_tags(t *testing.T) { resourceName := "aws_cognito_identity_pool.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, cognitoidentity.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckPoolDestroy(ctx), @@ -412,7 +412,7 @@ func TestAccCognitoIdentityPool_disappears(t *testing.T) { resourceName := "aws_cognito_identity_pool.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, cognitoidentity.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckPoolDestroy(ctx), From f934a407ea309de32afcf7be8ee22f734c838336 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Fri, 24 Feb 2023 16:36:43 -0500 Subject: [PATCH 120/763] Add 'Context' argument to 'acctest.PreCheck' for cognitoidp. --- .../cognitoidp/identity_provider_test.go | 8 +-- .../cognitoidp/resource_server_test.go | 4 +- .../cognitoidp/risk_configuration_test.go | 8 +-- .../service/cognitoidp/user_group_test.go | 6 +- .../service/cognitoidp/user_in_group_test.go | 4 +- .../user_pool_client_data_source_test.go | 2 +- .../cognitoidp/user_pool_client_test.go | 30 ++++---- .../user_pool_clients_data_source_test.go | 2 +- .../cognitoidp/user_pool_domain_test.go | 6 +- ...ol_signing_certificate_data_source_test.go | 2 +- internal/service/cognitoidp/user_pool_test.go | 72 +++++++++---------- .../user_pool_ui_customization_test.go | 20 +++--- .../cognitoidp/user_pools_data_source_test.go | 2 +- internal/service/cognitoidp/user_test.go | 12 ++-- 14 files changed, 89 insertions(+), 89 deletions(-) diff --git a/internal/service/cognitoidp/identity_provider_test.go b/internal/service/cognitoidp/identity_provider_test.go index 40384151e1d4..a41278b16baf 100644 --- a/internal/service/cognitoidp/identity_provider_test.go +++ b/internal/service/cognitoidp/identity_provider_test.go @@ -23,7 +23,7 @@ func TestAccCognitoIDPIdentityProvider_basic(t *testing.T) { userPoolName := fmt.Sprintf("tf-acc-cognito-user-pool-%s", sdkacctest.RandString(7)) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckIdentityProvider(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckIdentityProvider(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, cognitoidentityprovider.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckIdentityProviderDestroy(ctx), @@ -85,7 +85,7 @@ func TestAccCognitoIDPIdentityProvider_idpIdentifiers(t *testing.T) { userPoolName := fmt.Sprintf("tf-acc-cognito-user-pool-%s", sdkacctest.RandString(7)) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckIdentityProvider(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckIdentityProvider(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, cognitoidentityprovider.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckIdentityProviderDestroy(ctx), @@ -122,7 +122,7 @@ func TestAccCognitoIDPIdentityProvider_disappears(t *testing.T) { userPoolName := fmt.Sprintf("tf-acc-cognito-user-pool-%s", sdkacctest.RandString(7)) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckIdentityProvider(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckIdentityProvider(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, cognitoidentityprovider.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckIdentityProviderDestroy(ctx), @@ -146,7 +146,7 @@ func TestAccCognitoIDPIdentityProvider_Disappears_userPool(t *testing.T) { userPoolName := fmt.Sprintf("tf-acc-cognito-user-pool-%s", sdkacctest.RandString(7)) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckIdentityProvider(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckIdentityProvider(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, cognitoidentityprovider.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckIdentityProviderDestroy(ctx), diff --git a/internal/service/cognitoidp/resource_server_test.go b/internal/service/cognitoidp/resource_server_test.go index 1e7d3d5b2891..c230649c8072 100644 --- a/internal/service/cognitoidp/resource_server_test.go +++ b/internal/service/cognitoidp/resource_server_test.go @@ -27,7 +27,7 @@ func TestAccCognitoIDPResourceServer_basic(t *testing.T) { resourceName := "aws_cognito_resource_server.main" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckIdentityProvider(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckIdentityProvider(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, cognitoidentityprovider.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckResourceServerDestroy(ctx), @@ -70,7 +70,7 @@ func TestAccCognitoIDPResourceServer_scope(t *testing.T) { resourceName := "aws_cognito_resource_server.main" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckIdentityProvider(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckIdentityProvider(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, cognitoidentityprovider.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckResourceServerDestroy(ctx), diff --git a/internal/service/cognitoidp/risk_configuration_test.go b/internal/service/cognitoidp/risk_configuration_test.go index dbb8388f3880..5981fcc8baf4 100644 --- a/internal/service/cognitoidp/risk_configuration_test.go +++ b/internal/service/cognitoidp/risk_configuration_test.go @@ -22,7 +22,7 @@ func TestAccCognitoIDPRiskConfiguration_exception(t *testing.T) { resourceName := "aws_cognito_risk_configuration.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckIdentityProvider(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckIdentityProvider(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, cognitoidentityprovider.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRiskConfigurationDestroy(ctx), @@ -70,7 +70,7 @@ func TestAccCognitoIDPRiskConfiguration_client(t *testing.T) { resourceName := "aws_cognito_risk_configuration.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckIdentityProvider(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckIdentityProvider(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, cognitoidentityprovider.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRiskConfigurationDestroy(ctx), @@ -104,7 +104,7 @@ func TestAccCognitoIDPRiskConfiguration_compromised(t *testing.T) { resourceName := "aws_cognito_risk_configuration.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckIdentityProvider(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckIdentityProvider(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, cognitoidentityprovider.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRiskConfigurationDestroy(ctx), @@ -138,7 +138,7 @@ func TestAccCognitoIDPRiskConfiguration_disappears_userPool(t *testing.T) { resourceName := "aws_cognito_risk_configuration.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckIdentityProvider(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckIdentityProvider(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, cognitoidentityprovider.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRiskConfigurationDestroy(ctx), diff --git a/internal/service/cognitoidp/user_group_test.go b/internal/service/cognitoidp/user_group_test.go index 4f723484712e..3a522788d5fa 100644 --- a/internal/service/cognitoidp/user_group_test.go +++ b/internal/service/cognitoidp/user_group_test.go @@ -24,7 +24,7 @@ func TestAccCognitoIDPUserGroup_basic(t *testing.T) { resourceName := "aws_cognito_user_group.main" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckIdentityProvider(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckIdentityProvider(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, cognitoidentityprovider.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckUserGroupDestroy(ctx), @@ -60,7 +60,7 @@ func TestAccCognitoIDPUserGroup_complex(t *testing.T) { resourceName := "aws_cognito_user_group.main" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckIdentityProvider(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckIdentityProvider(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, cognitoidentityprovider.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckUserGroupDestroy(ctx), @@ -100,7 +100,7 @@ func TestAccCognitoIDPUserGroup_roleARN(t *testing.T) { resourceName := "aws_cognito_user_group.main" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckIdentityProvider(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckIdentityProvider(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, cognitoidentityprovider.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckUserGroupDestroy(ctx), diff --git a/internal/service/cognitoidp/user_in_group_test.go b/internal/service/cognitoidp/user_in_group_test.go index 7f89bc91be9c..8538555a0785 100644 --- a/internal/service/cognitoidp/user_in_group_test.go +++ b/internal/service/cognitoidp/user_in_group_test.go @@ -25,7 +25,7 @@ func TestAccCognitoIDPUserInGroup_basic(t *testing.T) { userResourceName := "aws_cognito_user.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, cognitoidentityprovider.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckUserInGroupDestroy(ctx), @@ -49,7 +49,7 @@ func TestAccCognitoIDPUserInGroup_disappears(t *testing.T) { resourceName := "aws_cognito_user_in_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, cognitoidentityprovider.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckUserInGroupDestroy(ctx), 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 2ce48aba40ea..334bb3f3cb89 100644 --- a/internal/service/cognitoidp/user_pool_client_data_source_test.go +++ b/internal/service/cognitoidp/user_pool_client_data_source_test.go @@ -16,7 +16,7 @@ func TestAccCognitoIDPUserPoolClientDataSource_basic(t *testing.T) { resourceName := "data.aws_cognito_user_pool_client.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckIdentityProvider(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckIdentityProvider(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, cognitoidentityprovider.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckUserPoolClientDestroy(ctx), diff --git a/internal/service/cognitoidp/user_pool_client_test.go b/internal/service/cognitoidp/user_pool_client_test.go index 83ba6228c9b7..1ba9741a26f9 100644 --- a/internal/service/cognitoidp/user_pool_client_test.go +++ b/internal/service/cognitoidp/user_pool_client_test.go @@ -24,7 +24,7 @@ func TestAccCognitoIDPUserPoolClient_basic(t *testing.T) { resourceName := "aws_cognito_user_pool_client.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckIdentityProvider(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckIdentityProvider(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, cognitoidentityprovider.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckUserPoolClientDestroy(ctx), @@ -59,7 +59,7 @@ func TestAccCognitoIDPUserPoolClient_enableRevocation(t *testing.T) { resourceName := "aws_cognito_user_pool_client.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckIdentityProvider(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckIdentityProvider(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, cognitoidentityprovider.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckUserPoolClientDestroy(ctx), @@ -105,7 +105,7 @@ func TestAccCognitoIDPUserPoolClient_refreshTokenValidity(t *testing.T) { resourceName := "aws_cognito_user_pool_client.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckIdentityProvider(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckIdentityProvider(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, cognitoidentityprovider.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckUserPoolClientDestroy(ctx), @@ -141,7 +141,7 @@ func TestAccCognitoIDPUserPoolClient_accessTokenValidity(t *testing.T) { resourceName := "aws_cognito_user_pool_client.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckIdentityProvider(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckIdentityProvider(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, cognitoidentityprovider.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckUserPoolClientDestroy(ctx), @@ -177,7 +177,7 @@ func TestAccCognitoIDPUserPoolClient_idTokenValidity(t *testing.T) { resourceName := "aws_cognito_user_pool_client.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckIdentityProvider(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckIdentityProvider(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, cognitoidentityprovider.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckUserPoolClientDestroy(ctx), @@ -213,7 +213,7 @@ func TestAccCognitoIDPUserPoolClient_tokenValidityUnits(t *testing.T) { resourceName := "aws_cognito_user_pool_client.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckIdentityProvider(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckIdentityProvider(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, cognitoidentityprovider.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckUserPoolClientDestroy(ctx), @@ -255,7 +255,7 @@ func TestAccCognitoIDPUserPoolClient_tokenValidityUnitsWTokenValidity(t *testing resourceName := "aws_cognito_user_pool_client.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckIdentityProvider(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckIdentityProvider(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, cognitoidentityprovider.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckUserPoolClientDestroy(ctx), @@ -299,7 +299,7 @@ func TestAccCognitoIDPUserPoolClient_name(t *testing.T) { resourceName := "aws_cognito_user_pool_client.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckIdentityProvider(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckIdentityProvider(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, cognitoidentityprovider.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckUserPoolClientDestroy(ctx), @@ -335,7 +335,7 @@ func TestAccCognitoIDPUserPoolClient_allFields(t *testing.T) { resourceName := "aws_cognito_user_pool_client.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckIdentityProvider(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckIdentityProvider(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, cognitoidentityprovider.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckUserPoolClientDestroy(ctx), @@ -392,7 +392,7 @@ func TestAccCognitoIDPUserPoolClient_allFieldsUpdatingOneField(t *testing.T) { resourceName := "aws_cognito_user_pool_client.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckIdentityProvider(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckIdentityProvider(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, cognitoidentityprovider.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckUserPoolClientDestroy(ctx), @@ -454,7 +454,7 @@ func TestAccCognitoIDPUserPoolClient_analytics(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) testAccPreCheckIdentityProvider(ctx, t) testAccPreCheckPinpointApp(ctx, t) }, @@ -507,7 +507,7 @@ func TestAccCognitoIDPUserPoolClient_analyticsWithARN(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) testAccPreCheckIdentityProvider(ctx, t) testAccPreCheckPinpointApp(ctx, t) }, @@ -542,7 +542,7 @@ func TestAccCognitoIDPUserPoolClient_authSessionValidity(t *testing.T) { resourceName := "aws_cognito_user_pool_client.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckIdentityProvider(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckIdentityProvider(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, cognitoidentityprovider.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckUserPoolClientDestroy(ctx), @@ -578,7 +578,7 @@ func TestAccCognitoIDPUserPoolClient_disappears(t *testing.T) { resourceName := "aws_cognito_user_pool_client.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckIdentityProvider(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckIdentityProvider(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, cognitoidentityprovider.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckUserPoolClientDestroy(ctx), @@ -602,7 +602,7 @@ func TestAccCognitoIDPUserPoolClient_Disappears_userPool(t *testing.T) { resourceName := "aws_cognito_user_pool_client.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckIdentityProvider(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckIdentityProvider(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, cognitoidentityprovider.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckUserPoolClientDestroy(ctx), 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 17facb552279..304d20a92bea 100644 --- a/internal/service/cognitoidp/user_pool_clients_data_source_test.go +++ b/internal/service/cognitoidp/user_pool_clients_data_source_test.go @@ -16,7 +16,7 @@ func TestAccCognitoIDPUserPoolClientsDataSource_basic(t *testing.T) { datasourceName := "data.aws_cognito_user_pool_clients.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckIdentityProvider(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckIdentityProvider(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, cognitoidentityprovider.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ diff --git a/internal/service/cognitoidp/user_pool_domain_test.go b/internal/service/cognitoidp/user_pool_domain_test.go index 965491a669a7..518ffa10e0f9 100644 --- a/internal/service/cognitoidp/user_pool_domain_test.go +++ b/internal/service/cognitoidp/user_pool_domain_test.go @@ -24,7 +24,7 @@ func TestAccCognitoIDPUserPoolDomain_basic(t *testing.T) { poolName := fmt.Sprintf("tf-acc-test-pool-%s", sdkacctest.RandString(10)) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckIdentityProvider(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckIdentityProvider(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, cognitoidentityprovider.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckUserPoolDomainDestroy(ctx), @@ -61,7 +61,7 @@ func TestAccCognitoIDPUserPoolDomain_custom(t *testing.T) { resourceName := "aws_cognito_user_pool_domain.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckUserPoolCustomDomain(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckUserPoolCustomDomain(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, cognitoidentityprovider.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckUserPoolDomainDestroy(ctx), @@ -96,7 +96,7 @@ func TestAccCognitoIDPUserPoolDomain_disappears(t *testing.T) { resourceName := "aws_cognito_user_pool_domain.main" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckIdentityProvider(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckIdentityProvider(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, cognitoidentityprovider.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckUserPoolDomainDestroy(ctx), 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 50029bbd33a5..9a7f1f913b35 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 @@ -16,7 +16,7 @@ func TestAccCognitoIDPUserPoolSigningCertificateDataSource_basic(t *testing.T) { datasourceName := "data.aws_cognito_user_pool_signing_certificate.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckIdentityProvider(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckIdentityProvider(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, cognitoidentityprovider.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ diff --git a/internal/service/cognitoidp/user_pool_test.go b/internal/service/cognitoidp/user_pool_test.go index 8b8ec9955433..a18ab96d2911 100644 --- a/internal/service/cognitoidp/user_pool_test.go +++ b/internal/service/cognitoidp/user_pool_test.go @@ -36,7 +36,7 @@ func TestAccCognitoIDPUserPool_basic(t *testing.T) { resourceName := "aws_cognito_user_pool.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckIdentityProvider(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckIdentityProvider(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, cognitoidentityprovider.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckUserPoolDestroy(ctx), @@ -88,7 +88,7 @@ func TestAccCognitoIDPUserPool_deletionProtection(t *testing.T) { resourceName := "aws_cognito_user_pool.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckIdentityProvider(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckIdentityProvider(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, cognitoidentityprovider.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckUserPoolDestroy(ctx), @@ -122,7 +122,7 @@ func TestAccCognitoIDPUserPool_recovery(t *testing.T) { resourceName := "aws_cognito_user_pool.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckIdentityProvider(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckIdentityProvider(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, cognitoidentityprovider.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckUserPoolDestroy(ctx), @@ -169,7 +169,7 @@ func TestAccCognitoIDPUserPool_withAdminCreateUser(t *testing.T) { resourceName := "aws_cognito_user_pool.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckIdentityProvider(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckIdentityProvider(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, cognitoidentityprovider.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckUserPoolDestroy(ctx), @@ -209,7 +209,7 @@ func TestAccCognitoIDPUserPool_withAdminCreateUserAndPasswordPolicy(t *testing.T resourceName := "aws_cognito_user_pool.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckIdentityProvider(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckIdentityProvider(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, cognitoidentityprovider.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckUserPoolDestroy(ctx), @@ -237,7 +237,7 @@ func TestAccCognitoIDPUserPool_withAdvancedSecurityMode(t *testing.T) { resourceName := "aws_cognito_user_pool.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckIdentityProvider(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckIdentityProvider(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, cognitoidentityprovider.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckUserPoolDestroy(ctx), @@ -276,7 +276,7 @@ func TestAccCognitoIDPUserPool_withDevice(t *testing.T) { resourceName := "aws_cognito_user_pool.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckIdentityProvider(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckIdentityProvider(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, cognitoidentityprovider.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckUserPoolDestroy(ctx), @@ -315,7 +315,7 @@ func TestAccCognitoIDPUserPool_withEmailVerificationMessage(t *testing.T) { resourceName := "aws_cognito_user_pool.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckIdentityProvider(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckIdentityProvider(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, cognitoidentityprovider.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckUserPoolDestroy(ctx), @@ -351,7 +351,7 @@ func TestAccCognitoIDPUserPool_MFA_sms(t *testing.T) { resourceName := "aws_cognito_user_pool.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckIdentityProvider(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckIdentityProvider(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, cognitoidentityprovider.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckUserPoolDestroy(ctx), @@ -400,7 +400,7 @@ func TestAccCognitoIDPUserPool_MFA_smsAndSoftwareTokenMFA(t *testing.T) { resourceName := "aws_cognito_user_pool.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckIdentityProvider(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckIdentityProvider(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, cognitoidentityprovider.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckUserPoolDestroy(ctx), @@ -451,7 +451,7 @@ func TestAccCognitoIDPUserPool_MFA_smsToSoftwareTokenMFA(t *testing.T) { resourceName := "aws_cognito_user_pool.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckIdentityProvider(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckIdentityProvider(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, cognitoidentityprovider.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckUserPoolDestroy(ctx), @@ -490,7 +490,7 @@ func TestAccCognitoIDPUserPool_MFA_softwareTokenMFA(t *testing.T) { resourceName := "aws_cognito_user_pool.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckIdentityProvider(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckIdentityProvider(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, cognitoidentityprovider.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckUserPoolDestroy(ctx), @@ -537,7 +537,7 @@ func TestAccCognitoIDPUserPool_MFA_softwareTokenMFAToSMS(t *testing.T) { resourceName := "aws_cognito_user_pool.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckIdentityProvider(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckIdentityProvider(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, cognitoidentityprovider.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckUserPoolDestroy(ctx), @@ -578,7 +578,7 @@ func TestAccCognitoIDPUserPool_smsAuthenticationMessage(t *testing.T) { resourceName := "aws_cognito_user_pool.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckIdentityProvider(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckIdentityProvider(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, cognitoidentityprovider.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckUserPoolDestroy(ctx), @@ -613,7 +613,7 @@ func TestAccCognitoIDPUserPool_sms(t *testing.T) { resourceName := "aws_cognito_user_pool.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckIdentityProvider(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckIdentityProvider(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, cognitoidentityprovider.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckUserPoolDestroy(ctx), @@ -659,7 +659,7 @@ func TestAccCognitoIDPUserPool_SMS_snsRegion(t *testing.T) { resourceName := "aws_cognito_user_pool.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckIdentityProvider(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckIdentityProvider(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, cognitoidentityprovider.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckUserPoolDestroy(ctx), @@ -689,7 +689,7 @@ func TestAccCognitoIDPUserPool_SMS_externalID(t *testing.T) { resourceName := "aws_cognito_user_pool.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckIdentityProvider(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckIdentityProvider(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, cognitoidentityprovider.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckUserPoolDestroy(ctx), @@ -728,7 +728,7 @@ func TestAccCognitoIDPUserPool_SMS_snsCallerARN(t *testing.T) { resourceName := "aws_cognito_user_pool.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckIdentityProvider(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckIdentityProvider(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, cognitoidentityprovider.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckUserPoolDestroy(ctx), @@ -768,7 +768,7 @@ func TestAccCognitoIDPUserPool_smsVerificationMessage(t *testing.T) { resourceName := "aws_cognito_user_pool.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckIdentityProvider(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckIdentityProvider(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, cognitoidentityprovider.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckUserPoolDestroy(ctx), @@ -802,7 +802,7 @@ func TestAccCognitoIDPUserPool_withEmail(t *testing.T) { resourceName := "aws_cognito_user_pool.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckIdentityProvider(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckIdentityProvider(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, cognitoidentityprovider.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckUserPoolDestroy(ctx), @@ -839,7 +839,7 @@ func TestAccCognitoIDPUserPool_withEmailSource(t *testing.T) { emailTo := sourceARN[strings.LastIndex(sourceARN, "/")+1:] resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckIdentityProvider(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckIdentityProvider(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, cognitoidentityprovider.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckUserPoolDestroy(ctx), @@ -865,7 +865,7 @@ func TestAccCognitoIDPUserPool_withTags(t *testing.T) { resourceName := "aws_cognito_user_pool.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckIdentityProvider(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckIdentityProvider(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, cognitoidentityprovider.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckUserPoolDestroy(ctx), @@ -909,7 +909,7 @@ func TestAccCognitoIDPUserPool_withAliasAttributes(t *testing.T) { resourceName := "aws_cognito_user_pool.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckIdentityProvider(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckIdentityProvider(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, cognitoidentityprovider.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckUserPoolDestroy(ctx), @@ -948,7 +948,7 @@ func TestAccCognitoIDPUserPool_withUsernameAttributes(t *testing.T) { resourceName := "aws_cognito_user_pool.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckIdentityProvider(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckIdentityProvider(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, cognitoidentityprovider.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckUserPoolDestroy(ctx), @@ -987,7 +987,7 @@ func TestAccCognitoIDPUserPool_withPasswordPolicy(t *testing.T) { resourceName := "aws_cognito_user_pool.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckIdentityProvider(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckIdentityProvider(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, cognitoidentityprovider.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckUserPoolDestroy(ctx), @@ -1032,7 +1032,7 @@ func TestAccCognitoIDPUserPool_withUsername(t *testing.T) { resourceName := "aws_cognito_user_pool.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckIdentityProvider(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckIdentityProvider(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, cognitoidentityprovider.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckUserPoolDestroy(ctx), @@ -1070,7 +1070,7 @@ func TestAccCognitoIDPUserPool_withLambda(t *testing.T) { lambdaUpdatedResourceName := "aws_lambda_function.second" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckIdentityProvider(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckIdentityProvider(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, cognitoidentityprovider.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckUserPoolDestroy(ctx), @@ -1141,7 +1141,7 @@ func TestAccCognitoIDPUserPool_WithLambda_email(t *testing.T) { lambdaUpdatedResourceName := "aws_lambda_function.second" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckIdentityProvider(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckIdentityProvider(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, cognitoidentityprovider.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckUserPoolDestroy(ctx), @@ -1182,7 +1182,7 @@ func TestAccCognitoIDPUserPool_WithLambda_sms(t *testing.T) { lambdaUpdatedResourceName := "aws_lambda_function.second" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckIdentityProvider(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckIdentityProvider(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, cognitoidentityprovider.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckUserPoolDestroy(ctx), @@ -1222,7 +1222,7 @@ func TestAccCognitoIDPUserPool_schemaAttributes(t *testing.T) { resourceName := "aws_cognito_user_pool.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckIdentityProvider(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckIdentityProvider(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, cognitoidentityprovider.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckUserPoolDestroy(ctx), @@ -1307,7 +1307,7 @@ func TestAccCognitoIDPUserPool_schemaAttributesRemoved(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckIdentityProvider(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckIdentityProvider(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, cognitoidentityprovider.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckUserPoolDestroy(ctx), @@ -1328,7 +1328,7 @@ func TestAccCognitoIDPUserPool_schemaAttributesModified(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckIdentityProvider(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckIdentityProvider(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, cognitoidentityprovider.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckUserPoolDestroy(ctx), @@ -1350,7 +1350,7 @@ func TestAccCognitoIDPUserPool_withVerificationMessageTemplate(t *testing.T) { resourceName := "aws_cognito_user_pool.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckIdentityProvider(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckIdentityProvider(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, cognitoidentityprovider.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckUserPoolDestroy(ctx), @@ -1409,7 +1409,7 @@ func TestAccCognitoIDPUserPool_update(t *testing.T) { resourceName := "aws_cognito_user_pool.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckIdentityProvider(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckIdentityProvider(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, cognitoidentityprovider.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckUserPoolDestroy(ctx), @@ -1495,7 +1495,7 @@ func TestAccCognitoIDPUserPool_disappears(t *testing.T) { resourceName := "aws_cognito_user_pool.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckIdentityProvider(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckIdentityProvider(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, cognitoidentityprovider.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckUserPoolDestroy(ctx), @@ -1518,7 +1518,7 @@ func TestAccCognitoIDPUserPool_withUserAttributeUpdateSettings(t *testing.T) { resourceName := "aws_cognito_user_pool.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckIdentityProvider(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckIdentityProvider(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, cognitoidentityprovider.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckUserPoolDestroy(ctx), diff --git a/internal/service/cognitoidp/user_pool_ui_customization_test.go b/internal/service/cognitoidp/user_pool_ui_customization_test.go index 67abeb1d62c4..20b68338fff4 100644 --- a/internal/service/cognitoidp/user_pool_ui_customization_test.go +++ b/internal/service/cognitoidp/user_pool_ui_customization_test.go @@ -26,7 +26,7 @@ func TestAccCognitoIDPUserPoolUICustomization_AllClients_CSS(t *testing.T) { cssUpdated := ".label-customizable {font-weight: 100;}" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, cognitoidentityprovider.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckUserPoolUICustomizationDestroy(ctx), @@ -77,7 +77,7 @@ func TestAccCognitoIDPUserPoolUICustomization_AllClients_disappears(t *testing.T css := ".label-customizable {font-weight: 400;}" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckIdentityProvider(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckIdentityProvider(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, cognitoidentityprovider.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckUserPoolUICustomizationDestroy(ctx), @@ -104,7 +104,7 @@ func TestAccCognitoIDPUserPoolUICustomization_AllClients_imageFile(t *testing.T) updatedFilename := "testdata/logo_modified.png" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, cognitoidentityprovider.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckUserPoolUICustomizationDestroy(ctx), @@ -158,7 +158,7 @@ func TestAccCognitoIDPUserPoolUICustomization_AllClients_CSSAndImageFile(t *test updatedFilename := "testdata/logo_modified.png" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, cognitoidentityprovider.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckUserPoolUICustomizationDestroy(ctx), @@ -226,7 +226,7 @@ func TestAccCognitoIDPUserPoolUICustomization_Client_CSS(t *testing.T) { cssUpdated := ".label-customizable {font-weight: 100;}" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, cognitoidentityprovider.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckUserPoolUICustomizationDestroy(ctx), @@ -277,7 +277,7 @@ func TestAccCognitoIDPUserPoolUICustomization_Client_disappears(t *testing.T) { css := ".label-customizable {font-weight: 400;}" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckIdentityProvider(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckIdentityProvider(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, cognitoidentityprovider.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckUserPoolUICustomizationDestroy(ctx), @@ -305,7 +305,7 @@ func TestAccCognitoIDPUserPoolUICustomization_Client_image(t *testing.T) { updatedFilename := "testdata/logo_modified.png" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, cognitoidentityprovider.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckUserPoolUICustomizationDestroy(ctx), @@ -361,7 +361,7 @@ func TestAccCognitoIDPUserPoolUICustomization_ClientAndAll_cSS(t *testing.T) { clientCSS := ".label-customizable {font-weight: 100;}" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, cognitoidentityprovider.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckUserPoolUICustomizationDestroy(ctx), @@ -434,7 +434,7 @@ func TestAccCognitoIDPUserPoolUICustomization_UpdateClientToAll_cSS(t *testing.T cssUpdated := ".label-customizable {font-weight: 400;}" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, cognitoidentityprovider.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckUserPoolUICustomizationDestroy(ctx), @@ -474,7 +474,7 @@ func TestAccCognitoIDPUserPoolUICustomization_UpdateAllToClient_cSS(t *testing.T cssUpdated := ".label-customizable {font-weight: 400;}" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, cognitoidentityprovider.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckUserPoolUICustomizationDestroy(ctx), diff --git a/internal/service/cognitoidp/user_pools_data_source_test.go b/internal/service/cognitoidp/user_pools_data_source_test.go index 0ab6d28999d1..d756316b5ff4 100644 --- a/internal/service/cognitoidp/user_pools_data_source_test.go +++ b/internal/service/cognitoidp/user_pools_data_source_test.go @@ -15,7 +15,7 @@ func TestAccCognitoIDPUserPoolsDataSource_basic(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckIdentityProvider(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckIdentityProvider(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, cognitoidentityprovider.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ diff --git a/internal/service/cognitoidp/user_test.go b/internal/service/cognitoidp/user_test.go index b2cdd1a992c9..7c2807026a75 100644 --- a/internal/service/cognitoidp/user_test.go +++ b/internal/service/cognitoidp/user_test.go @@ -24,7 +24,7 @@ func TestAccCognitoIDPUser_basic(t *testing.T) { resourceName := "aws_cognito_user.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, cognitoidentityprovider.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckUserDestroy(ctx), @@ -66,7 +66,7 @@ func TestAccCognitoIDPUser_disappears(t *testing.T) { resourceName := "aws_cognito_user.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, cognitoidentityprovider.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckUserDestroy(ctx), @@ -94,7 +94,7 @@ func TestAccCognitoIDPUser_temporaryPassword(t *testing.T) { clientResourceName := "aws_cognito_user_pool_client.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, cognitoidentityprovider.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckUserDestroy(ctx), @@ -151,7 +151,7 @@ func TestAccCognitoIDPUser_password(t *testing.T) { clientResourceName := "aws_cognito_user_pool_client.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, cognitoidentityprovider.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckUserDestroy(ctx), @@ -204,7 +204,7 @@ func TestAccCognitoIDPUser_attributes(t *testing.T) { resourceName := "aws_cognito_user.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, cognitoidentityprovider.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckUserDestroy(ctx), @@ -253,7 +253,7 @@ func TestAccCognitoIDPUser_enabled(t *testing.T) { resourceName := "aws_cognito_user.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, cognitoidentityprovider.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckUserDestroy(ctx), From 33cc88ee525f166e28b4566121375156a64effe4 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Fri, 24 Feb 2023 16:36:43 -0500 Subject: [PATCH 121/763] Add 'Context' argument to 'acctest.PreCheck' for comprehend. --- .../comprehend/document_classifier_test.go | 56 +++++++++---------- .../comprehend/entity_recognizer_test.go | 36 ++++++------ 2 files changed, 46 insertions(+), 46 deletions(-) diff --git a/internal/service/comprehend/document_classifier_test.go b/internal/service/comprehend/document_classifier_test.go index 4ddffd94a8ab..4283b9d8f08b 100644 --- a/internal/service/comprehend/document_classifier_test.go +++ b/internal/service/comprehend/document_classifier_test.go @@ -30,7 +30,7 @@ func TestAccComprehendDocumentClassifier_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(names.ComprehendEndpointID, t) testAccPreCheck(ctx, t) }, @@ -89,7 +89,7 @@ func TestAccComprehendDocumentClassifier_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(names.ComprehendEndpointID, t) testAccPreCheck(ctx, t) }, @@ -123,7 +123,7 @@ func TestAccComprehendDocumentClassifier_versionName(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(names.ComprehendEndpointID, t) testAccPreCheck(ctx, t) }, @@ -183,7 +183,7 @@ func TestAccComprehendDocumentClassifier_versionNameEmpty(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(names.ComprehendEndpointID, t) testAccPreCheck(ctx, t) }, @@ -223,7 +223,7 @@ func TestAccComprehendDocumentClassifier_versionNameGenerated(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(names.ComprehendEndpointID, t) testAccPreCheck(ctx, t) }, @@ -262,7 +262,7 @@ func TestAccComprehendDocumentClassifier_versionNamePrefix(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(names.ComprehendEndpointID, t) testAccPreCheck(ctx, t) }, @@ -301,7 +301,7 @@ func TestAccComprehendDocumentClassifier_testDocuments(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(names.ComprehendEndpointID, t) testAccPreCheck(ctx, t) }, @@ -349,7 +349,7 @@ func TestAccComprehendDocumentClassifier_SingleLabel_ValidateNoDelimiterSet(t *t resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(names.ComprehendEndpointID, t) testAccPreCheck(ctx, t) }, @@ -389,7 +389,7 @@ func TestAccComprehendDocumentClassifier_multiLabel_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(names.ComprehendEndpointID, t) testAccPreCheck(ctx, t) }, @@ -445,7 +445,7 @@ func TestAccComprehendDocumentClassifier_outputDataConfig_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(names.ComprehendEndpointID, t) testAccPreCheck(ctx, t) }, @@ -488,7 +488,7 @@ func TestAccComprehendDocumentClassifier_outputDataConfig_kmsKeyCreateID(t *test resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(names.ComprehendEndpointID, t) testAccPreCheck(ctx, t) }, @@ -530,7 +530,7 @@ func TestAccComprehendDocumentClassifier_outputDataConfig_kmsKeyCreateARN(t *tes resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(names.ComprehendEndpointID, t) testAccPreCheck(ctx, t) }, @@ -572,7 +572,7 @@ func TestAccComprehendDocumentClassifier_outputDataConfig_kmsKeyCreateAliasName( resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(names.ComprehendEndpointID, t) testAccPreCheck(ctx, t) }, @@ -614,7 +614,7 @@ func TestAccComprehendDocumentClassifier_outputDataConfig_kmsKeyCreateAliasARN(t resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(names.ComprehendEndpointID, t) testAccPreCheck(ctx, t) }, @@ -656,7 +656,7 @@ func TestAccComprehendDocumentClassifier_outputDataConfig_kmsKeyAdd(t *testing.T resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(names.ComprehendEndpointID, t) testAccPreCheck(ctx, t) }, @@ -703,7 +703,7 @@ func TestAccComprehendDocumentClassifier_outputDataConfig_kmsKeyUpdate(t *testin resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(names.ComprehendEndpointID, t) testAccPreCheck(ctx, t) }, @@ -750,7 +750,7 @@ func TestAccComprehendDocumentClassifier_outputDataConfig_kmsKeyRemove(t *testin resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(names.ComprehendEndpointID, t) testAccPreCheck(ctx, t) }, @@ -799,7 +799,7 @@ func TestAccComprehendDocumentClassifier_multiLabel_labelDelimiter(t *testing.T) resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(names.ComprehendEndpointID, t) testAccPreCheck(ctx, t) }, @@ -865,7 +865,7 @@ func TestAccComprehendDocumentClassifier_KMSKeys_CreateIDs(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(names.ComprehendEndpointID, t) testAccPreCheck(ctx, t) }, @@ -907,7 +907,7 @@ func TestAccComprehendDocumentClassifier_KMSKeys_CreateARNs(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(names.ComprehendEndpointID, t) testAccPreCheck(ctx, t) }, @@ -949,7 +949,7 @@ func TestAccComprehendDocumentClassifier_KMSKeys_Add(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(names.ComprehendEndpointID, t) testAccPreCheck(ctx, t) }, @@ -996,7 +996,7 @@ func TestAccComprehendDocumentClassifier_KMSKeys_Update(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(names.ComprehendEndpointID, t) testAccPreCheck(ctx, t) }, @@ -1043,7 +1043,7 @@ func TestAccComprehendDocumentClassifier_KMSKeys_Remove(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(names.ComprehendEndpointID, t) testAccPreCheck(ctx, t) }, @@ -1090,7 +1090,7 @@ func TestAccComprehendDocumentClassifier_VPCConfig_Create(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(names.ComprehendEndpointID, t) testAccPreCheck(ctx, t) }, @@ -1150,7 +1150,7 @@ func TestAccComprehendDocumentClassifier_VPCConfig_Add(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(names.ComprehendEndpointID, t) testAccPreCheck(ctx, t) }, @@ -1200,7 +1200,7 @@ func TestAccComprehendDocumentClassifier_VPCConfig_Remove(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(names.ComprehendEndpointID, t) testAccPreCheck(ctx, t) }, @@ -1255,7 +1255,7 @@ func TestAccComprehendDocumentClassifier_tags(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(names.ComprehendEndpointID, t) testAccPreCheck(ctx, t) }, @@ -1314,7 +1314,7 @@ func TestAccComprehendDocumentClassifier_DefaultTags_providerOnly(t *testing.T) resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(names.ComprehendEndpointID, t) testAccPreCheck(ctx, t) }, diff --git a/internal/service/comprehend/entity_recognizer_test.go b/internal/service/comprehend/entity_recognizer_test.go index 72b126ee9d6a..e24560eea15b 100644 --- a/internal/service/comprehend/entity_recognizer_test.go +++ b/internal/service/comprehend/entity_recognizer_test.go @@ -30,7 +30,7 @@ func TestAccComprehendEntityRecognizer_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(names.ComprehendEndpointID, t) testAccPreCheck(ctx, t) }, @@ -86,7 +86,7 @@ func TestAccComprehendEntityRecognizer_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(names.ComprehendEndpointID, t) testAccPreCheck(ctx, t) }, @@ -120,7 +120,7 @@ func TestAccComprehendEntityRecognizer_versionName(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(names.ComprehendEndpointID, t) testAccPreCheck(ctx, t) }, @@ -180,7 +180,7 @@ func TestAccComprehendEntityRecognizer_versionNameEmpty(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(names.ComprehendEndpointID, t) testAccPreCheck(ctx, t) }, @@ -220,7 +220,7 @@ func TestAccComprehendEntityRecognizer_versionNameGenerated(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(names.ComprehendEndpointID, t) testAccPreCheck(ctx, t) }, @@ -259,7 +259,7 @@ func TestAccComprehendEntityRecognizer_versionNamePrefix(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(names.ComprehendEndpointID, t) testAccPreCheck(ctx, t) }, @@ -298,7 +298,7 @@ func TestAccComprehendEntityRecognizer_documents_testDocuments(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(names.ComprehendEndpointID, t) testAccPreCheck(ctx, t) }, @@ -352,7 +352,7 @@ func TestAccComprehendEntityRecognizer_annotations_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(names.ComprehendEndpointID, t) testAccPreCheck(ctx, t) }, @@ -408,7 +408,7 @@ func TestAccComprehendEntityRecognizer_annotations_testDocuments(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(names.ComprehendEndpointID, t) testAccPreCheck(ctx, t) }, @@ -462,7 +462,7 @@ func TestAccComprehendEntityRecognizer_annotations_validateNoTestDocuments(t *te resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(names.ComprehendEndpointID, t) testAccPreCheck(ctx, t) }, @@ -488,7 +488,7 @@ func TestAccComprehendEntityRecognizer_annotations_validateNoTestAnnotations(t * resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(names.ComprehendEndpointID, t) testAccPreCheck(ctx, t) }, @@ -516,7 +516,7 @@ func TestAccComprehendEntityRecognizer_KMSKeys_CreateIDs(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(names.ComprehendEndpointID, t) testAccPreCheck(ctx, t) }, @@ -558,7 +558,7 @@ func TestAccComprehendEntityRecognizer_KMSKeys_CreateARNs(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(names.ComprehendEndpointID, t) testAccPreCheck(ctx, t) }, @@ -600,7 +600,7 @@ func TestAccComprehendEntityRecognizer_KMSKeys_Update(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(names.ComprehendEndpointID, t) testAccPreCheck(ctx, t) }, @@ -670,7 +670,7 @@ func TestAccComprehendEntityRecognizer_VPCConfig_Create(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(names.ComprehendEndpointID, t) testAccPreCheck(ctx, t) }, @@ -730,7 +730,7 @@ func TestAccComprehendEntityRecognizer_VPCConfig_Update(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(names.ComprehendEndpointID, t) testAccPreCheck(ctx, t) }, @@ -793,7 +793,7 @@ func TestAccComprehendEntityRecognizer_tags(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(names.ComprehendEndpointID, t) testAccPreCheck(ctx, t) }, @@ -852,7 +852,7 @@ func TestAccComprehendEntityRecognizer_DefaultTags_providerOnly(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(names.ComprehendEndpointID, t) testAccPreCheck(ctx, t) }, From e19e5b1a6e4b7f2ea0e8afb63d151f58c04612e1 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Fri, 24 Feb 2023 16:36:44 -0500 Subject: [PATCH 122/763] Add 'Context' argument to 'acctest.PreCheck' for configservice. --- .../aggregate_authorization_test.go | 4 +-- .../service/configservice/config_rule_test.go | 18 ++++++------- .../configuration_aggregator_test.go | 10 +++---- .../configuration_recorder_status_test.go | 6 ++--- .../configuration_recorder_test.go | 6 ++--- .../configservice/conformance_pack_test.go | 22 ++++++++-------- .../configservice/delivery_channel_test.go | 6 ++--- .../organization_conformance_pack_test.go | 22 ++++++++-------- .../organization_custom_rule_test.go | 26 +++++++++---------- .../organization_managed_rule_test.go | 24 ++++++++--------- .../remediation_configuration_test.go | 12 ++++----- 11 files changed, 78 insertions(+), 78 deletions(-) diff --git a/internal/service/configservice/aggregate_authorization_test.go b/internal/service/configservice/aggregate_authorization_test.go index d868357b10e7..2d48f50a5bd6 100644 --- a/internal/service/configservice/aggregate_authorization_test.go +++ b/internal/service/configservice/aggregate_authorization_test.go @@ -6,7 +6,7 @@ package configservice_test // dataSourceName := "data.aws_region.current" // resource.ParallelTest(t, resource.TestCase{ -// PreCheck: func() { acctest.PreCheck(t) }, +// PreCheck: func() { acctest.PreCheck(ctx, t) }, // ErrorCheck: acctest.ErrorCheck(t, configservice.EndpointsID), // ProtoV5ProviderFactories:acctest.ProtoV5ProviderFactories, // CheckDestroy: testAccCheckAggregateAuthorizationDestroy, @@ -33,7 +33,7 @@ package configservice_test // resourceName := "aws_config_aggregate_authorization.example" // resource.ParallelTest(t, resource.TestCase{ -// PreCheck: func() { acctest.PreCheck(t) }, +// PreCheck: func() { acctest.PreCheck(ctx, t) }, // ErrorCheck: acctest.ErrorCheck(t, configservice.EndpointsID), // ProtoV5ProviderFactories:acctest.ProtoV5ProviderFactories, // CheckDestroy: testAccCheckAggregateAuthorizationDestroy, diff --git a/internal/service/configservice/config_rule_test.go b/internal/service/configservice/config_rule_test.go index b05eed782417..1b0d2cb75052 100644 --- a/internal/service/configservice/config_rule_test.go +++ b/internal/service/configservice/config_rule_test.go @@ -23,7 +23,7 @@ func testAccConfigRule_basic(t *testing.T) { resourceName := "aws_config_config_rule.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, configservice.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckConfigRuleDestroy(ctx), @@ -50,7 +50,7 @@ func testAccConfigRule_ownerAws(t *testing.T) { // nosemgrep:ci.aws-in-func-name resourceName := "aws_config_config_rule.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, configservice.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckConfigRuleDestroy(ctx), @@ -93,7 +93,7 @@ func testAccConfigRule_customlambda(t *testing.T) { path := "test-fixtures/lambdatest.zip" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, configservice.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckConfigRuleDestroy(ctx), @@ -138,7 +138,7 @@ func testAccConfigRule_ownerPolicy(t *testing.T) { resourceName := "aws_config_config_rule.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, configservice.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckConfigRuleDestroy(ctx), @@ -177,7 +177,7 @@ func testAccConfigRule_Scope_TagKey(t *testing.T) { resourceName := "aws_config_config_rule.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, configservice.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckConfigRuleDestroy(ctx), @@ -209,7 +209,7 @@ func testAccConfigRule_Scope_TagKey_Empty(t *testing.T) { resourceName := "aws_config_config_rule.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, configservice.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckConfigRuleDestroy(ctx), @@ -231,7 +231,7 @@ func testAccConfigRule_Scope_TagValue(t *testing.T) { resourceName := "aws_config_config_rule.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, configservice.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckConfigRuleDestroy(ctx), @@ -263,7 +263,7 @@ func testAccConfigRule_tags(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, configservice.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckConfigRuleDestroy(ctx), @@ -311,7 +311,7 @@ func testAccConfigRule_disappears(t *testing.T) { resourceName := "aws_config_config_rule.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, configservice.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckConfigRuleDestroy(ctx), diff --git a/internal/service/configservice/configuration_aggregator_test.go b/internal/service/configservice/configuration_aggregator_test.go index 53ec54c108e8..f1109b2f4048 100644 --- a/internal/service/configservice/configuration_aggregator_test.go +++ b/internal/service/configservice/configuration_aggregator_test.go @@ -24,7 +24,7 @@ func TestAccConfigServiceConfigurationAggregator_account(t *testing.T) { resourceName := "aws_config_configuration_aggregator.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, configservice.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckConfigurationAggregatorDestroy(ctx), @@ -60,7 +60,7 @@ func TestAccConfigServiceConfigurationAggregator_organization(t *testing.T) { resourceName := "aws_config_configuration_aggregator.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckOrganizationsAccount(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckOrganizationsAccount(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, configservice.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckConfigurationAggregatorDestroy(ctx), @@ -91,7 +91,7 @@ func TestAccConfigServiceConfigurationAggregator_switch(t *testing.T) { resourceName := "aws_config_configuration_aggregator.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckOrganizationsAccount(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckOrganizationsAccount(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, configservice.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckConfigurationAggregatorDestroy(ctx), @@ -121,7 +121,7 @@ func TestAccConfigServiceConfigurationAggregator_tags(t *testing.T) { resourceName := "aws_config_configuration_aggregator.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, configservice.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckConfigurationAggregatorDestroy(ctx), @@ -170,7 +170,7 @@ func TestAccConfigServiceConfigurationAggregator_disappears(t *testing.T) { resourceName := "aws_config_configuration_aggregator.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, configservice.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckConfigurationAggregatorDestroy(ctx), diff --git a/internal/service/configservice/configuration_recorder_status_test.go b/internal/service/configservice/configuration_recorder_status_test.go index d697c073548a..7b8ee5ec74a5 100644 --- a/internal/service/configservice/configuration_recorder_status_test.go +++ b/internal/service/configservice/configuration_recorder_status_test.go @@ -22,7 +22,7 @@ func testAccConfigurationRecorderStatus_basic(t *testing.T) { expectedName := fmt.Sprintf("tf-acc-test-%d", rInt) resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, configservice.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckConfigurationRecorderStatusDestroy(ctx), @@ -49,7 +49,7 @@ func testAccConfigurationRecorderStatus_startEnabled(t *testing.T) { expectedName := fmt.Sprintf("tf-acc-test-%d", rInt) resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, configservice.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckConfigurationRecorderStatusDestroy(ctx), @@ -94,7 +94,7 @@ func testAccConfigurationRecorderStatus_importBasic(t *testing.T) { rInt := sdkacctest.RandInt() resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, configservice.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckConfigurationRecorderStatusDestroy(ctx), diff --git a/internal/service/configservice/configuration_recorder_test.go b/internal/service/configservice/configuration_recorder_test.go index ea22eaeba1e9..947d52bb7e69 100644 --- a/internal/service/configservice/configuration_recorder_test.go +++ b/internal/service/configservice/configuration_recorder_test.go @@ -24,7 +24,7 @@ func testAccConfigurationRecorder_basic(t *testing.T) { resourceName := "aws_config_configuration_recorder.foo" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, configservice.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckConfigurationRecorderDestroy(ctx), @@ -52,7 +52,7 @@ func testAccConfigurationRecorder_allParams(t *testing.T) { resourceName := "aws_config_configuration_recorder.foo" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, configservice.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckConfigurationRecorderDestroy(ctx), @@ -80,7 +80,7 @@ func testAccConfigurationRecorder_importBasic(t *testing.T) { rInt := sdkacctest.RandInt() resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, configservice.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckConfigurationRecorderDestroy(ctx), diff --git a/internal/service/configservice/conformance_pack_test.go b/internal/service/configservice/conformance_pack_test.go index 453e54369cf0..992cfea5fdea 100644 --- a/internal/service/configservice/conformance_pack_test.go +++ b/internal/service/configservice/conformance_pack_test.go @@ -24,7 +24,7 @@ func testAccConformancePack_basic(t *testing.T) { resourceName := "aws_config_conformance_pack.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, configservice.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckConformancePackDestroy(ctx), @@ -60,7 +60,7 @@ func testAccConformancePack_forceNew(t *testing.T) { resourceName := "aws_config_conformance_pack.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, configservice.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckConformancePackDestroy(ctx), @@ -102,7 +102,7 @@ func testAccConformancePack_disappears(t *testing.T) { resourceName := "aws_config_conformance_pack.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, configservice.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckConformancePackDestroy(ctx), @@ -126,7 +126,7 @@ func testAccConformancePack_inputParameters(t *testing.T) { resourceName := "aws_config_conformance_pack.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, configservice.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckConformancePackDestroy(ctx), @@ -163,7 +163,7 @@ func testAccConformancePack_S3Delivery(t *testing.T) { resourceName := "aws_config_conformance_pack.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, configservice.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckConformancePackDestroy(ctx), @@ -196,7 +196,7 @@ func testAccConformancePack_S3Template(t *testing.T) { resourceName := "aws_config_conformance_pack.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, configservice.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckConformancePackDestroy(ctx), @@ -229,7 +229,7 @@ func testAccConformancePack_updateInputParameters(t *testing.T) { resourceName := "aws_config_conformance_pack.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, configservice.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckConformancePackDestroy(ctx), @@ -280,7 +280,7 @@ func testAccConformancePack_updateS3Delivery(t *testing.T) { resourceName := "aws_config_conformance_pack.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, configservice.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckConformancePackDestroy(ctx), @@ -320,7 +320,7 @@ func testAccConformancePack_updateS3Template(t *testing.T) { resourceName := "aws_config_conformance_pack.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, configservice.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckConformancePackDestroy(ctx), @@ -359,7 +359,7 @@ func testAccConformancePack_updateTemplateBody(t *testing.T) { resourceName := "aws_config_conformance_pack.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, configservice.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckConformancePackDestroy(ctx), @@ -400,7 +400,7 @@ func testAccConformancePack_S3TemplateAndTemplateBody(t *testing.T) { resourceName := "aws_config_conformance_pack.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, configservice.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckConformancePackDestroy(ctx), diff --git a/internal/service/configservice/delivery_channel_test.go b/internal/service/configservice/delivery_channel_test.go index f231a2806da3..c61580642e7f 100644 --- a/internal/service/configservice/delivery_channel_test.go +++ b/internal/service/configservice/delivery_channel_test.go @@ -22,7 +22,7 @@ func testAccDeliveryChannel_basic(t *testing.T) { expectedBucketName := fmt.Sprintf("tf-acc-test-awsconfig-%d", rInt) resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, configservice.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDeliveryChannelDestroy(ctx), @@ -49,7 +49,7 @@ func testAccDeliveryChannel_allParams(t *testing.T) { expectedBucketName := fmt.Sprintf("tf-acc-test-awsconfig-%d", rInt) resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, configservice.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDeliveryChannelDestroy(ctx), @@ -77,7 +77,7 @@ func testAccDeliveryChannel_importBasic(t *testing.T) { rInt := sdkacctest.RandInt() resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, configservice.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDeliveryChannelDestroy(ctx), diff --git a/internal/service/configservice/organization_conformance_pack_test.go b/internal/service/configservice/organization_conformance_pack_test.go index fd1886d87d36..7cda954c0d0c 100644 --- a/internal/service/configservice/organization_conformance_pack_test.go +++ b/internal/service/configservice/organization_conformance_pack_test.go @@ -24,7 +24,7 @@ func testAccOrganizationConformancePack_basic(t *testing.T) { resourceName := "aws_config_organization_conformance_pack.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckOrganizationsAccount(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckOrganizationsAccount(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, configservice.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckOrganizationConformancePackDestroy(ctx), @@ -58,7 +58,7 @@ func testAccOrganizationConformancePack_disappears(t *testing.T) { resourceName := "aws_config_organization_conformance_pack.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckOrganizationsAccount(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckOrganizationsAccount(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, configservice.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckOrganizationConformancePackDestroy(ctx), @@ -82,7 +82,7 @@ func testAccOrganizationConformancePack_excludedAccounts(t *testing.T) { resourceName := "aws_config_organization_conformance_pack.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckOrganizationsAccount(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckOrganizationsAccount(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, configservice.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckOrganizationConformancePackDestroy(ctx), @@ -132,7 +132,7 @@ func testAccOrganizationConformancePack_forceNew(t *testing.T) { resourceName := "aws_config_organization_conformance_pack.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckOrganizationsAccount(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckOrganizationsAccount(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, configservice.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckOrganizationConformancePackDestroy(ctx), @@ -175,7 +175,7 @@ func testAccOrganizationConformancePack_inputParameters(t *testing.T) { resourceName := "aws_config_organization_conformance_pack.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckOrganizationsAccount(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckOrganizationsAccount(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, configservice.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckOrganizationConformancePackDestroy(ctx), @@ -209,7 +209,7 @@ func testAccOrganizationConformancePack_S3Delivery(t *testing.T) { resourceName := "aws_config_organization_conformance_pack.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckOrganizationsAccount(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckOrganizationsAccount(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, configservice.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckOrganizationConformancePackDestroy(ctx), @@ -239,7 +239,7 @@ func testAccOrganizationConformancePack_S3Template(t *testing.T) { resourceName := "aws_config_organization_conformance_pack.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckOrganizationsAccount(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckOrganizationsAccount(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, configservice.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckOrganizationConformancePackDestroy(ctx), @@ -273,7 +273,7 @@ func testAccOrganizationConformancePack_updateInputParameters(t *testing.T) { resourceName := "aws_config_organization_conformance_pack.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckOrganizationsAccount(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckOrganizationsAccount(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, configservice.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckOrganizationConformancePackDestroy(ctx), @@ -325,7 +325,7 @@ func testAccOrganizationConformancePack_updateS3Delivery(t *testing.T) { resourceName := "aws_config_organization_conformance_pack.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckOrganizationsAccount(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckOrganizationsAccount(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, configservice.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckOrganizationConformancePackDestroy(ctx), @@ -364,7 +364,7 @@ func testAccOrganizationConformancePack_updateS3Template(t *testing.T) { resourceName := "aws_config_organization_conformance_pack.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckOrganizationsAccount(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckOrganizationsAccount(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, configservice.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckOrganizationConformancePackDestroy(ctx), @@ -398,7 +398,7 @@ func testAccOrganizationConformancePack_updateTemplateBody(t *testing.T) { resourceName := "aws_config_organization_conformance_pack.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckOrganizationsAccount(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckOrganizationsAccount(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, configservice.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckOrganizationConformancePackDestroy(ctx), diff --git a/internal/service/configservice/organization_custom_rule_test.go b/internal/service/configservice/organization_custom_rule_test.go index 25677848d53b..7dfaa61e8e9f 100644 --- a/internal/service/configservice/organization_custom_rule_test.go +++ b/internal/service/configservice/organization_custom_rule_test.go @@ -27,7 +27,7 @@ func testAccOrganizationCustomRule_basic(t *testing.T) { resourceName := "aws_config_organization_custom_rule.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckOrganizationsAccount(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckOrganizationsAccount(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, configservice.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckOrganizationCustomRuleDestroy(ctx), @@ -66,7 +66,7 @@ func testAccOrganizationCustomRule_disappears(t *testing.T) { resourceName := "aws_config_organization_custom_rule.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckOrganizationsAccount(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckOrganizationsAccount(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, configservice.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckOrganizationCustomRuleDestroy(ctx), @@ -88,7 +88,7 @@ func testAccOrganizationCustomRule_errorHandling(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckOrganizationsAccount(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckOrganizationsAccount(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, configservice.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckOrganizationCustomRuleDestroy(ctx), @@ -108,7 +108,7 @@ func testAccOrganizationCustomRule_Description(t *testing.T) { resourceName := "aws_config_organization_custom_rule.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckOrganizationsAccount(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckOrganizationsAccount(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, configservice.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckOrganizationCustomRuleDestroy(ctx), @@ -143,7 +143,7 @@ func testAccOrganizationCustomRule_ExcludedAccounts(t *testing.T) { resourceName := "aws_config_organization_custom_rule.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckOrganizationsAccount(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckOrganizationsAccount(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, configservice.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckOrganizationCustomRuleDestroy(ctx), @@ -181,7 +181,7 @@ func testAccOrganizationCustomRule_InputParameters(t *testing.T) { inputParameters2 := `{"tag1Key":"Department", "tag2Key":"Owner"}` resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckOrganizationsAccount(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckOrganizationsAccount(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, configservice.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckOrganizationCustomRuleDestroy(ctx), @@ -218,7 +218,7 @@ func testAccOrganizationCustomRule_lambdaFunctionARN(t *testing.T) { resourceName := "aws_config_organization_custom_rule.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckOrganizationsAccount(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckOrganizationsAccount(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, configservice.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckOrganizationCustomRuleDestroy(ctx), @@ -253,7 +253,7 @@ func testAccOrganizationCustomRule_MaximumExecutionFrequency(t *testing.T) { resourceName := "aws_config_organization_custom_rule.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckOrganizationsAccount(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckOrganizationsAccount(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, configservice.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckOrganizationCustomRuleDestroy(ctx), @@ -288,7 +288,7 @@ func testAccOrganizationCustomRule_ResourceIdScope(t *testing.T) { resourceName := "aws_config_organization_custom_rule.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckOrganizationsAccount(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckOrganizationsAccount(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, configservice.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckOrganizationCustomRuleDestroy(ctx), @@ -323,7 +323,7 @@ func testAccOrganizationCustomRule_ResourceTypesScope(t *testing.T) { resourceName := "aws_config_organization_custom_rule.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckOrganizationsAccount(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckOrganizationsAccount(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, configservice.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckOrganizationCustomRuleDestroy(ctx), @@ -358,7 +358,7 @@ func testAccOrganizationCustomRule_TagKeyScope(t *testing.T) { resourceName := "aws_config_organization_custom_rule.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckOrganizationsAccount(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckOrganizationsAccount(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, configservice.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckOrganizationCustomRuleDestroy(ctx), @@ -393,7 +393,7 @@ func testAccOrganizationCustomRule_TagValueScope(t *testing.T) { resourceName := "aws_config_organization_custom_rule.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckOrganizationsAccount(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckOrganizationsAccount(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, configservice.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckOrganizationCustomRuleDestroy(ctx), @@ -428,7 +428,7 @@ func testAccOrganizationCustomRule_TriggerTypes(t *testing.T) { resourceName := "aws_config_organization_custom_rule.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckOrganizationsAccount(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckOrganizationsAccount(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, configservice.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckOrganizationCustomRuleDestroy(ctx), diff --git a/internal/service/configservice/organization_managed_rule_test.go b/internal/service/configservice/organization_managed_rule_test.go index 80bf27b51093..0fcbc2a58cf4 100644 --- a/internal/service/configservice/organization_managed_rule_test.go +++ b/internal/service/configservice/organization_managed_rule_test.go @@ -23,7 +23,7 @@ func testAccOrganizationManagedRule_basic(t *testing.T) { resourceName := "aws_config_organization_managed_rule.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckOrganizationsAccount(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckOrganizationsAccount(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, configservice.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckOrganizationManagedRuleDestroy(ctx), @@ -61,7 +61,7 @@ func testAccOrganizationManagedRule_disappears(t *testing.T) { resourceName := "aws_config_organization_managed_rule.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckOrganizationsAccount(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckOrganizationsAccount(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, configservice.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckOrganizationManagedRuleDestroy(ctx), @@ -83,7 +83,7 @@ func testAccOrganizationManagedRule_errorHandling(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckOrganizationsAccount(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckOrganizationsAccount(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, configservice.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckOrganizationManagedRuleDestroy(ctx), @@ -103,7 +103,7 @@ func testAccOrganizationManagedRule_Description(t *testing.T) { resourceName := "aws_config_organization_managed_rule.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckOrganizationsAccount(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckOrganizationsAccount(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, configservice.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckOrganizationManagedRuleDestroy(ctx), @@ -138,7 +138,7 @@ func testAccOrganizationManagedRule_ExcludedAccounts(t *testing.T) { resourceName := "aws_config_organization_managed_rule.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckOrganizationsAccount(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckOrganizationsAccount(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, configservice.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckOrganizationManagedRuleDestroy(ctx), @@ -176,7 +176,7 @@ func testAccOrganizationManagedRule_InputParameters(t *testing.T) { inputParameters2 := `{"tag1Key":"Department", "tag2Key":"Owner"}` resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckOrganizationsAccount(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckOrganizationsAccount(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, configservice.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckOrganizationManagedRuleDestroy(ctx), @@ -211,7 +211,7 @@ func testAccOrganizationManagedRule_MaximumExecutionFrequency(t *testing.T) { resourceName := "aws_config_organization_managed_rule.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckOrganizationsAccount(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckOrganizationsAccount(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, configservice.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckOrganizationManagedRuleDestroy(ctx), @@ -246,7 +246,7 @@ func testAccOrganizationManagedRule_ResourceIdScope(t *testing.T) { resourceName := "aws_config_organization_managed_rule.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckOrganizationsAccount(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckOrganizationsAccount(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, configservice.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckOrganizationManagedRuleDestroy(ctx), @@ -281,7 +281,7 @@ func testAccOrganizationManagedRule_ResourceTypesScope(t *testing.T) { resourceName := "aws_config_organization_managed_rule.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckOrganizationsAccount(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckOrganizationsAccount(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, configservice.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckOrganizationManagedRuleDestroy(ctx), @@ -316,7 +316,7 @@ func testAccOrganizationManagedRule_RuleIdentifier(t *testing.T) { resourceName := "aws_config_organization_managed_rule.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckOrganizationsAccount(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckOrganizationsAccount(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, configservice.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckOrganizationManagedRuleDestroy(ctx), @@ -351,7 +351,7 @@ func testAccOrganizationManagedRule_TagKeyScope(t *testing.T) { resourceName := "aws_config_organization_managed_rule.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckOrganizationsAccount(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckOrganizationsAccount(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, configservice.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckOrganizationManagedRuleDestroy(ctx), @@ -386,7 +386,7 @@ func testAccOrganizationManagedRule_TagValueScope(t *testing.T) { resourceName := "aws_config_organization_managed_rule.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckOrganizationsAccount(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckOrganizationsAccount(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, configservice.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckOrganizationManagedRuleDestroy(ctx), diff --git a/internal/service/configservice/remediation_configuration_test.go b/internal/service/configservice/remediation_configuration_test.go index ee5d5be4d8a7..3c7666e60e1a 100644 --- a/internal/service/configservice/remediation_configuration_test.go +++ b/internal/service/configservice/remediation_configuration_test.go @@ -34,7 +34,7 @@ func testAccRemediationConfiguration_basic(t *testing.T) { expectedName := fmt.Sprintf("%s-tf-acc-test-%d", prefix, rInt) resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, configservice.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRemediationConfigurationDestroy(ctx), @@ -76,7 +76,7 @@ func testAccRemediationConfiguration_basicBackwardCompatible(t *testing.T) { expectedName := fmt.Sprintf("%s-tf-acc-test-%d", prefix, rInt) resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, configservice.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRemediationConfigurationDestroy(ctx), @@ -114,7 +114,7 @@ func testAccRemediationConfiguration_disappears(t *testing.T) { sseAlgorithm := "AES256" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, configservice.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRemediationConfigurationDestroy(ctx), @@ -148,7 +148,7 @@ func testAccRemediationConfiguration_recreates(t *testing.T) { sseAlgorithm := "AES256" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, configservice.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRemediationConfigurationDestroy(ctx), @@ -194,7 +194,7 @@ func testAccRemediationConfiguration_updates(t *testing.T) { updatedSseAlgorithm := "aws:kms" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, configservice.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRemediationConfigurationDestroy(ctx), @@ -247,7 +247,7 @@ func testAccRemediationConfiguration_values(t *testing.T) { sseAlgorithm := "AES256" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, configservice.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRemediationConfigurationDestroy(ctx), From 74ba8f8a99d8b923d6c41471a978e42c17c5d11e Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Fri, 24 Feb 2023 16:36:44 -0500 Subject: [PATCH 123/763] Add 'Context' argument to 'acctest.PreCheck' for connect. --- .../bot_association_data_source_test.go | 2 +- .../service/connect/bot_association_test.go | 4 ++-- .../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 | 8 ++++---- .../connect/instance_data_source_test.go | 2 +- ...nstance_storage_config_data_source_test.go | 8 ++++---- .../connect/instance_storage_config_test.go | 20 +++++++++---------- internal/service/connect/instance_test.go | 6 +++--- ...a_function_association_data_source_test.go | 2 +- .../lambda_function_association_test.go | 4 ++-- internal/service/connect/phone_number_test.go | 12 +++++------ .../connect/prompt_data_source_test.go | 2 +- .../service/connect/queue_data_source_test.go | 4 ++-- internal/service/connect/queue_test.go | 16 +++++++-------- .../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 | 12 +++++------ .../security_profile_data_source_test.go | 4 ++-- .../service/connect/security_profile_test.go | 8 ++++---- .../user_hierarchy_group_data_source_test.go | 4 ++-- .../connect/user_hierarchy_group_test.go | 8 ++++---- ...er_hierarchy_structure_data_source_test.go | 2 +- .../connect/user_hierarchy_structure_test.go | 4 ++-- internal/service/connect/user_test.go | 16 +++++++-------- internal/service/connect/vocabulary_test.go | 6 +++--- 30 files changed, 96 insertions(+), 96 deletions(-) diff --git a/internal/service/connect/bot_association_data_source_test.go b/internal/service/connect/bot_association_data_source_test.go index 079bf6ed60b0..407f6621122a 100644 --- a/internal/service/connect/bot_association_data_source_test.go +++ b/internal/service/connect/bot_association_data_source_test.go @@ -17,7 +17,7 @@ func testAccBotAssociationDataSource_basic(t *testing.T) { datasourceName := "data.aws_connect_bot_association.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, connect.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ diff --git a/internal/service/connect/bot_association_test.go b/internal/service/connect/bot_association_test.go index 207ab53e5adb..e356936b36a8 100644 --- a/internal/service/connect/bot_association_test.go +++ b/internal/service/connect/bot_association_test.go @@ -22,7 +22,7 @@ func testAccBotAssociation_basic(t *testing.T) { resourceName := "aws_connect_bot_association.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, connect.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckBotAssociationDestroy(ctx), @@ -54,7 +54,7 @@ func testAccBotAssociation_disappears(t *testing.T) { instanceResourceName := "aws_connect_bot_association.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, connect.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckBotAssociationDestroy(ctx), diff --git a/internal/service/connect/contact_flow_data_source_test.go b/internal/service/connect/contact_flow_data_source_test.go index b1402911b489..e72e4d6cc603 100644 --- a/internal/service/connect/contact_flow_data_source_test.go +++ b/internal/service/connect/contact_flow_data_source_test.go @@ -16,7 +16,7 @@ func testAccContactFlowDataSource_contactFlowID(t *testing.T) { datasourceName := "data.aws_connect_contact_flow.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, connect.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ @@ -45,7 +45,7 @@ func testAccContactFlowDataSource_name(t *testing.T) { datasourceName := "data.aws_connect_contact_flow.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, connect.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ 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 4b9d75a3c9ef..1cafc4a67c95 100644 --- a/internal/service/connect/contact_flow_module_data_source_test.go +++ b/internal/service/connect/contact_flow_module_data_source_test.go @@ -16,7 +16,7 @@ func testAccContactFlowModuleDataSource_contactFlowModuleID(t *testing.T) { datasourceName := "data.aws_connect_contact_flow_module.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, connect.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ @@ -46,7 +46,7 @@ func testAccContactFlowModuleDataSource_name(t *testing.T) { datasourceName := "data.aws_connect_contact_flow_module.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, connect.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ diff --git a/internal/service/connect/contact_flow_module_test.go b/internal/service/connect/contact_flow_module_test.go index d99d38f5ec48..67ebce63e1ca 100644 --- a/internal/service/connect/contact_flow_module_test.go +++ b/internal/service/connect/contact_flow_module_test.go @@ -24,7 +24,7 @@ func testAccContactFlowModule_basic(t *testing.T) { resourceName := "aws_connect_contact_flow_module.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, connect.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckContactFlowModuleDestroy(ctx), @@ -72,7 +72,7 @@ func testAccContactFlowModule_filename(t *testing.T) { resourceName := "aws_connect_contact_flow_module.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, connect.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckContactFlowModuleDestroy(ctx), @@ -122,7 +122,7 @@ func testAccContactFlowModule_disappears(t *testing.T) { resourceName := "aws_connect_contact_flow_module.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, connect.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckContactFlowModuleDestroy(ctx), diff --git a/internal/service/connect/contact_flow_test.go b/internal/service/connect/contact_flow_test.go index 2acef4b7db10..63df98c624b6 100644 --- a/internal/service/connect/contact_flow_test.go +++ b/internal/service/connect/contact_flow_test.go @@ -24,7 +24,7 @@ func testAccContactFlow_basic(t *testing.T) { resourceName := "aws_connect_contact_flow.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, connect.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckContactFlowDestroy(ctx), @@ -74,7 +74,7 @@ func testAccContactFlow_filename(t *testing.T) { resourceName := "aws_connect_contact_flow.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, connect.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckContactFlowDestroy(ctx), @@ -127,7 +127,7 @@ func testAccContactFlow_disappears(t *testing.T) { resourceName := "aws_connect_contact_flow.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, connect.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckContactFlowDestroy(ctx), 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 0853387a90d4..988dbdb4dc75 100644 --- a/internal/service/connect/hours_of_operation_data_source_test.go +++ b/internal/service/connect/hours_of_operation_data_source_test.go @@ -16,7 +16,7 @@ func testAccHoursOfOperationDataSource_hoursOfOperationID(t *testing.T) { datasourceName := "data.aws_connect_hours_of_operation.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, connect.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ @@ -45,7 +45,7 @@ func testAccHoursOfOperationDataSource_name(t *testing.T) { datasourceName := "data.aws_connect_hours_of_operation.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, connect.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ diff --git a/internal/service/connect/hours_of_operation_test.go b/internal/service/connect/hours_of_operation_test.go index e53c8e2d0330..a915972bb2f5 100644 --- a/internal/service/connect/hours_of_operation_test.go +++ b/internal/service/connect/hours_of_operation_test.go @@ -27,7 +27,7 @@ func testAccHoursOfOperation_basic(t *testing.T) { resourceName := "aws_connect_hours_of_operation.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, connect.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckHoursOfOperationDestroy(ctx), @@ -101,7 +101,7 @@ func testAccHoursOfOperation_updateConfig(t *testing.T) { resourceName := "aws_connect_hours_of_operation.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, connect.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckHoursOfOperationDestroy(ctx), @@ -166,7 +166,7 @@ func testAccHoursOfOperation_updateTags(t *testing.T) { resourceName := "aws_connect_hours_of_operation.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, connect.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckHoursOfOperationDestroy(ctx), @@ -215,7 +215,7 @@ func testAccHoursOfOperation_disappears(t *testing.T) { resourceName := "aws_connect_hours_of_operation.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, connect.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckHoursOfOperationDestroy(ctx), diff --git a/internal/service/connect/instance_data_source_test.go b/internal/service/connect/instance_data_source_test.go index 006e38b2622a..ec4f80d5d6f3 100644 --- a/internal/service/connect/instance_data_source_test.go +++ b/internal/service/connect/instance_data_source_test.go @@ -16,7 +16,7 @@ func testAccInstanceDataSource_basic(t *testing.T) { dataSourceName := "data.aws_connect_instance.test" resourceName := "aws_connect_instance.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, connect.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ 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 3b3d0d15e8ae..f18262e37dd9 100644 --- a/internal/service/connect/instance_storage_config_data_source_test.go +++ b/internal/service/connect/instance_storage_config_data_source_test.go @@ -16,7 +16,7 @@ func testAccInstanceStorageConfigDataSource_KinesisFirehoseConfig(t *testing.T) datasourceName := "data.aws_connect_instance_storage_config.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, connect.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ @@ -43,7 +43,7 @@ func testAccInstanceStorageConfigDataSource_KinesisStreamConfig(t *testing.T) { datasourceName := "data.aws_connect_instance_storage_config.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, connect.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ @@ -69,7 +69,7 @@ func testAccInstanceStorageConfigDataSource_KinesisVideoStreamConfig(t *testing. datasourceName := "data.aws_connect_instance_storage_config.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, connect.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ @@ -100,7 +100,7 @@ func testAccInstanceStorageConfigDataSource_S3Config(t *testing.T) { datasourceName := "data.aws_connect_instance_storage_config.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, connect.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ diff --git a/internal/service/connect/instance_storage_config_test.go b/internal/service/connect/instance_storage_config_test.go index 01dc51d1d973..a29a3b484f99 100644 --- a/internal/service/connect/instance_storage_config_test.go +++ b/internal/service/connect/instance_storage_config_test.go @@ -25,7 +25,7 @@ func testAccInstanceStorageConfig_basic(t *testing.T) { resourceName := "aws_connect_instance_storage_config.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, connect.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckInstanceStorageConfigDestroy(ctx), @@ -63,7 +63,7 @@ func testAccInstanceStorageConfig_KinesisFirehoseConfig_FirehoseARN(t *testing.T resourceName := "aws_connect_instance_storage_config.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, connect.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckInstanceStorageConfigDestroy(ctx), @@ -108,7 +108,7 @@ func testAccInstanceStorageConfig_KinesisStreamConfig_StreamARN(t *testing.T) { resourceName := "aws_connect_instance_storage_config.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, connect.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckInstanceStorageConfigDestroy(ctx), @@ -156,7 +156,7 @@ func testAccInstanceStorageConfig_KinesisVideoStreamConfig_Prefix(t *testing.T) retention := 1 resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, connect.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckInstanceStorageConfigDestroy(ctx), @@ -212,7 +212,7 @@ func testAccInstanceStorageConfig_KinesisVideoStreamConfig_Retention(t *testing. updatedRetention := 87600 resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, connect.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckInstanceStorageConfigDestroy(ctx), @@ -263,7 +263,7 @@ func testAccInstanceStorageConfig_KinesisVideoStreamConfig_EncryptionConfig(t *t resourceName := "aws_connect_instance_storage_config.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, connect.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckInstanceStorageConfigDestroy(ctx), @@ -312,7 +312,7 @@ func testAccInstanceStorageConfig_S3Config_BucketName(t *testing.T) { resourceName := "aws_connect_instance_storage_config.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, connect.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckInstanceStorageConfigDestroy(ctx), @@ -359,7 +359,7 @@ func testAccInstanceStorageConfig_S3Config_BucketPrefix(t *testing.T) { updatedBucketPrefix := "updatedBucketPrefix" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, connect.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckInstanceStorageConfigDestroy(ctx), @@ -403,7 +403,7 @@ func testAccInstanceStorageConfig_S3Config_EncryptionConfig(t *testing.T) { resourceName := "aws_connect_instance_storage_config.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, connect.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckInstanceStorageConfigDestroy(ctx), @@ -453,7 +453,7 @@ func testAccInstanceStorageConfig_disappears(t *testing.T) { resourceName := "aws_connect_instance_storage_config.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, connect.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckInstanceStorageConfigDestroy(ctx), diff --git a/internal/service/connect/instance_test.go b/internal/service/connect/instance_test.go index 8f0423d25f8b..2bd790a74c55 100644 --- a/internal/service/connect/instance_test.go +++ b/internal/service/connect/instance_test.go @@ -23,7 +23,7 @@ func testAccInstance_basic(t *testing.T) { resourceName := "aws_connect_instance.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, connect.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckInstanceDestroy(ctx), @@ -82,7 +82,7 @@ func testAccInstance_directory(t *testing.T) { domainName := acctest.RandomDomainName() resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, connect.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckInstanceDestroy(ctx), @@ -112,7 +112,7 @@ func testAccInstance_saml(t *testing.T) { resourceName := "aws_connect_instance.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, connect.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckInstanceDestroy(ctx), 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 b8fddd741a10..e8a0789635f6 100644 --- a/internal/service/connect/lambda_function_association_data_source_test.go +++ b/internal/service/connect/lambda_function_association_data_source_test.go @@ -17,7 +17,7 @@ func testAccLambdaFunctionAssociationDataSource_basic(t *testing.T) { datasourceName := "data.aws_connect_lambda_function_association.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, connect.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ diff --git a/internal/service/connect/lambda_function_association_test.go b/internal/service/connect/lambda_function_association_test.go index 7d4078f2e948..94f555853362 100644 --- a/internal/service/connect/lambda_function_association_test.go +++ b/internal/service/connect/lambda_function_association_test.go @@ -22,7 +22,7 @@ func testAccLambdaFunctionAssociation_basic(t *testing.T) { resourceName := "aws_connect_lambda_function_association.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, connect.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckLambdaFunctionAssociationDestroy(ctx), @@ -51,7 +51,7 @@ func testAccLambdaFunctionAssociation_disappears(t *testing.T) { resourceName := "aws_connect_lambda_function_association.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, connect.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckLambdaFunctionAssociationDestroy(ctx), diff --git a/internal/service/connect/phone_number_test.go b/internal/service/connect/phone_number_test.go index e73d99967617..25886314479f 100644 --- a/internal/service/connect/phone_number_test.go +++ b/internal/service/connect/phone_number_test.go @@ -24,7 +24,7 @@ func testAccPhoneNumber_basic(t *testing.T) { resourceName := "aws_connect_phone_number.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, connect.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckPhoneNumberDestroy(ctx), @@ -59,7 +59,7 @@ func testAccPhoneNumber_description(t *testing.T) { resourceName := "aws_connect_phone_number.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, connect.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckPhoneNumberDestroy(ctx), @@ -88,7 +88,7 @@ func testAccPhoneNumber_prefix(t *testing.T) { resourceName := "aws_connect_phone_number.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, connect.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckPhoneNumberDestroy(ctx), @@ -120,7 +120,7 @@ func testAccPhoneNumber_targetARN(t *testing.T) { resourceName := "aws_connect_phone_number.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, connect.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckPhoneNumberDestroy(ctx), @@ -155,7 +155,7 @@ func testAccPhoneNumber_tags(t *testing.T) { resourceName := "aws_connect_phone_number.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, connect.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckPhoneNumberDestroy(ctx), @@ -201,7 +201,7 @@ func testAccPhoneNumber_disappears(t *testing.T) { resourceName := "aws_connect_phone_number.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, connect.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckPhoneNumberDestroy(ctx), diff --git a/internal/service/connect/prompt_data_source_test.go b/internal/service/connect/prompt_data_source_test.go index acfc7b4c497f..ca345c36a169 100644 --- a/internal/service/connect/prompt_data_source_test.go +++ b/internal/service/connect/prompt_data_source_test.go @@ -15,7 +15,7 @@ func testAccPromptDataSource_name(t *testing.T) { datasourceName := "data.aws_connect_prompt.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, connect.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ diff --git a/internal/service/connect/queue_data_source_test.go b/internal/service/connect/queue_data_source_test.go index e86ded6e7e58..effc9f66089f 100644 --- a/internal/service/connect/queue_data_source_test.go +++ b/internal/service/connect/queue_data_source_test.go @@ -18,7 +18,7 @@ func testAccQueueDataSource_queueID(t *testing.T) { outboundCallerConfigName := "exampleOutboundCallerConfigName" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, connect.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ @@ -50,7 +50,7 @@ func testAccQueueDataSource_name(t *testing.T) { outboundCallerConfigName := "exampleOutboundCallerConfigName" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, connect.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ diff --git a/internal/service/connect/queue_test.go b/internal/service/connect/queue_test.go index a637f890d597..635629215f8a 100644 --- a/internal/service/connect/queue_test.go +++ b/internal/service/connect/queue_test.go @@ -26,7 +26,7 @@ func testAccQueue_basic(t *testing.T) { updatedDescription := "Updated" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, connect.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckQueueDestroy(ctx), @@ -81,7 +81,7 @@ func testAccQueue_disappears(t *testing.T) { resourceName := "aws_connect_queue.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, connect.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckQueueDestroy(ctx), @@ -106,7 +106,7 @@ func testAccQueue_updateHoursOfOperationId(t *testing.T) { resourceName := "aws_connect_queue.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, connect.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckQueueDestroy(ctx), @@ -183,7 +183,7 @@ func testAccQueue_updateMaxContacts(t *testing.T) { updatedMaxContacts := "2" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, connect.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckQueueDestroy(ctx), @@ -239,7 +239,7 @@ func testAccQueue_updateOutboundCallerConfig(t *testing.T) { updatedOutboundCallerIdName := "updated" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, connect.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckQueueDestroy(ctx), @@ -297,7 +297,7 @@ func testAccQueue_updateStatus(t *testing.T) { updatedStatus := connect.QueueStatusDisabled resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, connect.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckQueueDestroy(ctx), @@ -352,7 +352,7 @@ func testAccQueue_updateQuickConnectIds(t *testing.T) { description := "test queue integrations with quick connects" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, connect.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckQueueDestroy(ctx), @@ -452,7 +452,7 @@ func testAccQueue_updateTags(t *testing.T) { resourceName := "aws_connect_queue.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, connect.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckQueueDestroy(ctx), diff --git a/internal/service/connect/quick_connect_data_source_test.go b/internal/service/connect/quick_connect_data_source_test.go index 62d9833ed6ed..9c29f2ed8892 100644 --- a/internal/service/connect/quick_connect_data_source_test.go +++ b/internal/service/connect/quick_connect_data_source_test.go @@ -18,7 +18,7 @@ func testAccQuickConnectDataSource_id(t *testing.T) { phoneNumber := "+12345678912" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, connect.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ @@ -49,7 +49,7 @@ func testAccQuickConnectDataSource_name(t *testing.T) { phoneNumber := "+12345678912" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, connect.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ diff --git a/internal/service/connect/quick_connect_test.go b/internal/service/connect/quick_connect_test.go index b1748edc0b01..0d05539f78b3 100644 --- a/internal/service/connect/quick_connect_test.go +++ b/internal/service/connect/quick_connect_test.go @@ -24,7 +24,7 @@ func testAccQuickConnect_phoneNumber(t *testing.T) { resourceName := "aws_connect_quick_connect.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, connect.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckQuickConnectDestroy(ctx), @@ -107,7 +107,7 @@ func testAccQuickConnect_updateTags(t *testing.T) { resourceName := "aws_connect_quick_connect.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, connect.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckQuickConnectDestroy(ctx), @@ -156,7 +156,7 @@ func testAccQuickConnect_disappears(t *testing.T) { resourceName := "aws_connect_quick_connect.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, connect.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckQuickConnectDestroy(ctx), diff --git a/internal/service/connect/routing_profile_data_source_test.go b/internal/service/connect/routing_profile_data_source_test.go index e2cfe7ef5138..a19f5178f252 100644 --- a/internal/service/connect/routing_profile_data_source_test.go +++ b/internal/service/connect/routing_profile_data_source_test.go @@ -19,7 +19,7 @@ func testAccRoutingProfileDataSource_routingProfileID(t *testing.T) { datasourceName := "data.aws_connect_routing_profile.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, connect.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ @@ -71,7 +71,7 @@ func testAccRoutingProfileDataSource_name(t *testing.T) { datasourceName := "data.aws_connect_routing_profile.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, connect.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ diff --git a/internal/service/connect/routing_profile_test.go b/internal/service/connect/routing_profile_test.go index faef70e19763..698820a77a1f 100644 --- a/internal/service/connect/routing_profile_test.go +++ b/internal/service/connect/routing_profile_test.go @@ -27,7 +27,7 @@ func testAccRoutingProfile_basic(t *testing.T) { updatedDescription := "Updated" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, connect.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRoutingProfileDestroy(ctx), @@ -85,7 +85,7 @@ func testAccRoutingProfile_disappears(t *testing.T) { resourceName := "aws_connect_routing_profile.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, connect.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRoutingProfileDestroy(ctx), @@ -112,7 +112,7 @@ func testAccRoutingProfile_updateConcurrency(t *testing.T) { description := "testMediaConcurrencies" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, connect.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRoutingProfileDestroy(ctx), @@ -166,7 +166,7 @@ func testAccRoutingProfile_updateDefaultOutboundQueue(t *testing.T) { resourceName := "aws_connect_routing_profile.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, connect.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRoutingProfileDestroy(ctx), @@ -223,7 +223,7 @@ func testAccRoutingProfile_updateQueues(t *testing.T) { description := "testQueueConfigs" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, connect.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRoutingProfileDestroy(ctx), @@ -345,7 +345,7 @@ func testAccRoutingProfile_updateTags(t *testing.T) { resourceName := "aws_connect_routing_profile.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, connect.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRoutingProfileDestroy(ctx), diff --git a/internal/service/connect/security_profile_data_source_test.go b/internal/service/connect/security_profile_data_source_test.go index fd98da99b5a2..4ebfcb61e6e2 100644 --- a/internal/service/connect/security_profile_data_source_test.go +++ b/internal/service/connect/security_profile_data_source_test.go @@ -17,7 +17,7 @@ func testAccSecurityProfileDataSource_securityProfileID(t *testing.T) { datasourceName := "data.aws_connect_security_profile.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, connect.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ @@ -45,7 +45,7 @@ func testAccSecurityProfileDataSource_name(t *testing.T) { datasourceName := "data.aws_connect_security_profile.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, connect.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ diff --git a/internal/service/connect/security_profile_test.go b/internal/service/connect/security_profile_test.go index 5ae716552b0b..bc51bbf33f10 100644 --- a/internal/service/connect/security_profile_test.go +++ b/internal/service/connect/security_profile_test.go @@ -24,7 +24,7 @@ func testAccSecurityProfile_basic(t *testing.T) { resourceName := "aws_connect_security_profile.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, connect.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSecurityProfileDestroy(ctx), @@ -74,7 +74,7 @@ func testAccSecurityProfile_updatePermissions(t *testing.T) { resourceName := "aws_connect_security_profile.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, connect.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSecurityProfileDestroy(ctx), @@ -127,7 +127,7 @@ func testAccSecurityProfile_updateTags(t *testing.T) { resourceName := "aws_connect_security_profile.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, connect.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSecurityProfileDestroy(ctx), @@ -176,7 +176,7 @@ func testAccSecurityProfile_disappears(t *testing.T) { resourceName := "aws_connect_security_profile.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, connect.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSecurityProfileDestroy(ctx), 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 fdf057779349..2c0371511120 100644 --- a/internal/service/connect/user_hierarchy_group_data_source_test.go +++ b/internal/service/connect/user_hierarchy_group_data_source_test.go @@ -19,7 +19,7 @@ func testAccUserHierarchyGroupDataSource_hierarchyGroupID(t *testing.T) { datasourceName := "data.aws_connect_user_hierarchy_group.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, connect.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ @@ -55,7 +55,7 @@ func testAccUserHierarchyGroupDataSource_name(t *testing.T) { datasourceName := "data.aws_connect_user_hierarchy_group.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, connect.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ diff --git a/internal/service/connect/user_hierarchy_group_test.go b/internal/service/connect/user_hierarchy_group_test.go index 49ff1ab98cfb..367e72304d12 100644 --- a/internal/service/connect/user_hierarchy_group_test.go +++ b/internal/service/connect/user_hierarchy_group_test.go @@ -25,7 +25,7 @@ func testAccUserHierarchyGroup_basic(t *testing.T) { resourceName := "aws_connect_user_hierarchy_group.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, connect.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckUserHierarchyGroupDestroy(ctx), @@ -83,7 +83,7 @@ func testAccUserHierarchyGroup_parentGroupId(t *testing.T) { resourceName := "aws_connect_user_hierarchy_group.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, connect.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckUserHierarchyGroupDestroy(ctx), @@ -121,7 +121,7 @@ func testAccUserHierarchyGroup_updateTags(t *testing.T) { resourceName := "aws_connect_user_hierarchy_group.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, connect.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckUserHierarchyGroupDestroy(ctx), @@ -170,7 +170,7 @@ func testAccUserHierarchyGroup_disappears(t *testing.T) { resourceName := "aws_connect_user_hierarchy_group.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, connect.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckUserHierarchyGroupDestroy(ctx), 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 2873641d1300..eb74b7b1863c 100644 --- a/internal/service/connect/user_hierarchy_structure_data_source_test.go +++ b/internal/service/connect/user_hierarchy_structure_data_source_test.go @@ -16,7 +16,7 @@ func testAccUserHierarchyStructureDataSource_instanceID(t *testing.T) { datasourceName := "data.aws_connect_user_hierarchy_structure.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, connect.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ diff --git a/internal/service/connect/user_hierarchy_structure_test.go b/internal/service/connect/user_hierarchy_structure_test.go index 9bd5ce0f0d68..206f207002e2 100644 --- a/internal/service/connect/user_hierarchy_structure_test.go +++ b/internal/service/connect/user_hierarchy_structure_test.go @@ -28,7 +28,7 @@ func testAccUserHierarchyStructure_basic(t *testing.T) { resourceName := "aws_connect_user_hierarchy_structure.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, connect.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckUserHierarchyStructureDestroy(ctx), @@ -189,7 +189,7 @@ func testAccUserHierarchyStructure_disappears(t *testing.T) { levelOneName := sdkacctest.RandomWithPrefix("resource-test-terraform") resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, connect.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckUserHierarchyStructureDestroy(ctx), diff --git a/internal/service/connect/user_test.go b/internal/service/connect/user_test.go index 08e8ab1aed3a..9106773e9286 100644 --- a/internal/service/connect/user_test.go +++ b/internal/service/connect/user_test.go @@ -29,7 +29,7 @@ func testAccUser_basic(t *testing.T) { resourceName := "aws_connect_user.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, connect.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckUserDestroy(ctx), @@ -73,7 +73,7 @@ func testAccUser_updateHierarchyGroupId(t *testing.T) { resourceName := "aws_connect_user.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, connect.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckUserDestroy(ctx), @@ -121,7 +121,7 @@ func testAccUser_updateIdentityInfo(t *testing.T) { resourceName := "aws_connect_user.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, connect.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckUserDestroy(ctx), @@ -174,7 +174,7 @@ func testAccUser_updatePhoneConfig(t *testing.T) { resourceName := "aws_connect_user.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, connect.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckUserDestroy(ctx), @@ -238,7 +238,7 @@ func testAccUser_updateSecurityProfileIds(t *testing.T) { resourceName := "aws_connect_user.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, connect.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckUserDestroy(ctx), @@ -298,7 +298,7 @@ func testAccUser_updateRoutingProfileId(t *testing.T) { resourceName := "aws_connect_user.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, connect.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckUserDestroy(ctx), @@ -339,7 +339,7 @@ func testAccUser_updateTags(t *testing.T) { resourceName := "aws_connect_user.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, connect.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckUserDestroy(ctx), @@ -392,7 +392,7 @@ func testAccUser_disappears(t *testing.T) { resourceName := "aws_connect_user.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, connect.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckUserDestroy(ctx), diff --git a/internal/service/connect/vocabulary_test.go b/internal/service/connect/vocabulary_test.go index 96f89a4cc410..aebef8c3aaca 100644 --- a/internal/service/connect/vocabulary_test.go +++ b/internal/service/connect/vocabulary_test.go @@ -31,7 +31,7 @@ func testAccVocabulary_basic(t *testing.T) { resourceName := "aws_connect_vocabulary.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, connect.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckVocabularyDestroy(ctx), @@ -76,7 +76,7 @@ func testAccVocabulary_disappears(t *testing.T) { resourceName := "aws_connect_vocabulary.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, connect.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckVocabularyDestroy(ctx), @@ -108,7 +108,7 @@ func testAccVocabulary_updateTags(t *testing.T) { resourceName := "aws_connect_vocabulary.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, connect.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckVocabularyDestroy(ctx), From 4342421c99d2997e20080fbc94800b53b09ebe5f Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Fri, 24 Feb 2023 16:36:45 -0500 Subject: [PATCH 124/763] Add 'Context' argument to 'acctest.PreCheck' for controltower. --- internal/service/controltower/control_test.go | 4 ++-- internal/service/controltower/controls_data_source_test.go | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/internal/service/controltower/control_test.go b/internal/service/controltower/control_test.go index e3bce3bf9a6f..ef09f6df6409 100644 --- a/internal/service/controltower/control_test.go +++ b/internal/service/controltower/control_test.go @@ -36,7 +36,7 @@ func testAccControl_basic(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckOrganizationManagementAccount(ctx, t) testAccPreCheck(ctx, t) }, @@ -64,7 +64,7 @@ func testAccControl_disappears(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckOrganizationManagementAccount(ctx, t) testAccPreCheck(ctx, t) }, diff --git a/internal/service/controltower/controls_data_source_test.go b/internal/service/controltower/controls_data_source_test.go index 865b5c152162..3b87f5042f6a 100644 --- a/internal/service/controltower/controls_data_source_test.go +++ b/internal/service/controltower/controls_data_source_test.go @@ -19,7 +19,7 @@ func TestAccControlTowerControlsDataSource_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckOrganizationManagementAccount(ctx, t) testAccPreCheck(ctx, t) }, From df7e497feadd5779b5fbfc401035aa0f1e598e01 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Fri, 24 Feb 2023 16:36:45 -0500 Subject: [PATCH 125/763] Add 'Context' argument to 'acctest.PreCheck' for cur. --- .../cur/report_definition_data_source_test.go | 4 ++-- internal/service/cur/report_definition_test.go | 14 +++++++------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/internal/service/cur/report_definition_data_source_test.go b/internal/service/cur/report_definition_data_source_test.go index 68f09399f7a6..1e78d3018fd0 100644 --- a/internal/service/cur/report_definition_data_source_test.go +++ b/internal/service/cur/report_definition_data_source_test.go @@ -20,7 +20,7 @@ func TestAccCURReportDefinitionDataSource_basic(t *testing.T) { bucketName := fmt.Sprintf("tf-test-bucket-%d", sdkacctest.RandInt()) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, costandusagereportservice.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckReportDefinitionDestroy(ctx), @@ -52,7 +52,7 @@ func TestAccCURReportDefinitionDataSource_additional(t *testing.T) { bucketName := fmt.Sprintf("tf-test-bucket-%d", sdkacctest.RandInt()) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, costandusagereportservice.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckReportDefinitionDestroy(ctx), diff --git a/internal/service/cur/report_definition_test.go b/internal/service/cur/report_definition_test.go index 6ab21705b0af..725bd29b1f7c 100644 --- a/internal/service/cur/report_definition_test.go +++ b/internal/service/cur/report_definition_test.go @@ -23,7 +23,7 @@ func testAccReportDefinition_basic(t *testing.T) { bucketName := fmt.Sprintf("tf-test-bucket-%d", sdkacctest.RandInt()) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, cur.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckReportDefinitionDestroy(ctx), @@ -83,7 +83,7 @@ func testAccReportDefinition_textOrCSV(t *testing.T) { reportVersioning := "CREATE_NEW_REPORT" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, cur.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckReportDefinitionDestroy(ctx), @@ -128,7 +128,7 @@ func testAccReportDefinition_parquet(t *testing.T) { reportVersioning := "CREATE_NEW_REPORT" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, cur.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckReportDefinitionDestroy(ctx), @@ -172,7 +172,7 @@ func testAccReportDefinition_athena(t *testing.T) { reportVersioning := "OVERWRITE_REPORT" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, cur.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckReportDefinitionDestroy(ctx), @@ -217,7 +217,7 @@ func testAccReportDefinition_refresh(t *testing.T) { reportVersioning := "CREATE_NEW_REPORT" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, cur.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckReportDefinitionDestroy(ctx), @@ -262,7 +262,7 @@ func testAccReportDefinition_overwrite(t *testing.T) { reportVersioning := "OVERWRITE_REPORT" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, cur.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckReportDefinitionDestroy(ctx), @@ -300,7 +300,7 @@ func testAccReportDefinition_disappears(t *testing.T) { bucketName := fmt.Sprintf("tf-test-bucket-%d", sdkacctest.RandInt()) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, cur.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckReportDefinitionDestroy(ctx), From 7f0c43b620ff9adc6ddd829b89db4528cf34f114 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Fri, 24 Feb 2023 16:36:45 -0500 Subject: [PATCH 126/763] Add 'Context' argument to 'acctest.PreCheck' for dataexchange. --- internal/service/dataexchange/data_set_test.go | 6 +++--- internal/service/dataexchange/revision_test.go | 8 ++++---- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/internal/service/dataexchange/data_set_test.go b/internal/service/dataexchange/data_set_test.go index 121e5986970e..ed8b0a503030 100644 --- a/internal/service/dataexchange/data_set_test.go +++ b/internal/service/dataexchange/data_set_test.go @@ -24,7 +24,7 @@ func TestAccDataExchangeDataSet_basic(t *testing.T) { resourceName := "aws_dataexchange_data_set.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(dataexchange.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(dataexchange.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, dataexchange.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDataSetDestroy(ctx), @@ -64,7 +64,7 @@ func TestAccDataExchangeDataSet_tags(t *testing.T) { resourceName := "aws_dataexchange_data_set.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(dataexchange.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(dataexchange.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, dataexchange.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDataSetDestroy(ctx), @@ -110,7 +110,7 @@ func TestAccDataExchangeDataSet_disappears(t *testing.T) { resourceName := "aws_dataexchange_data_set.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(dataexchange.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(dataexchange.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, dataexchange.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDataSetDestroy(ctx), diff --git a/internal/service/dataexchange/revision_test.go b/internal/service/dataexchange/revision_test.go index 05bb7004592d..076b89186c33 100644 --- a/internal/service/dataexchange/revision_test.go +++ b/internal/service/dataexchange/revision_test.go @@ -23,7 +23,7 @@ func TestAccDataExchangeRevision_basic(t *testing.T) { resourceName := "aws_dataexchange_revision.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(dataexchange.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(dataexchange.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, dataexchange.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRevisionDestroy(ctx), @@ -53,7 +53,7 @@ func TestAccDataExchangeRevision_tags(t *testing.T) { resourceName := "aws_dataexchange_revision.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(dataexchange.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(dataexchange.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, dataexchange.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRevisionDestroy(ctx), @@ -99,7 +99,7 @@ func TestAccDataExchangeRevision_disappears(t *testing.T) { resourceName := "aws_dataexchange_revision.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(dataexchange.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(dataexchange.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, dataexchange.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRevisionDestroy(ctx), @@ -124,7 +124,7 @@ func TestAccDataExchangeRevision_disappears_dataSet(t *testing.T) { resourceName := "aws_dataexchange_revision.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(dataexchange.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(dataexchange.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, dataexchange.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRevisionDestroy(ctx), From 9ce087ac2efdb8317c3bf5d6394fac3e630665eb Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Fri, 24 Feb 2023 16:36:46 -0500 Subject: [PATCH 127/763] Add 'Context' argument to 'acctest.PreCheck' for datapipeline. --- .../service/datapipeline/pipeline_data_source_test.go | 2 +- .../datapipeline/pipeline_definition_data_source_test.go | 2 +- internal/service/datapipeline/pipeline_definition_test.go | 6 +++--- internal/service/datapipeline/pipeline_test.go | 8 ++++---- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/internal/service/datapipeline/pipeline_data_source_test.go b/internal/service/datapipeline/pipeline_data_source_test.go index 814a787e4114..f9e88a0fea81 100644 --- a/internal/service/datapipeline/pipeline_data_source_test.go +++ b/internal/service/datapipeline/pipeline_data_source_test.go @@ -17,7 +17,7 @@ func TestAccDataPipelinePipelineDataSource_basic(t *testing.T) { rName := sdkacctest.RandomWithPrefix("tf-acc-test") resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckPipelineDefinitionDestroy(ctx), ErrorCheck: acctest.ErrorCheck(t, datapipeline.EndpointsID), diff --git a/internal/service/datapipeline/pipeline_definition_data_source_test.go b/internal/service/datapipeline/pipeline_definition_data_source_test.go index dc55b978b7d2..b88347460598 100644 --- a/internal/service/datapipeline/pipeline_definition_data_source_test.go +++ b/internal/service/datapipeline/pipeline_definition_data_source_test.go @@ -17,7 +17,7 @@ func TestAccDataPipelinePipelineDefinitionDataSource_basic(t *testing.T) { rName := sdkacctest.RandomWithPrefix("tf-acc-test") resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckPipelineDefinitionDestroy(ctx), ErrorCheck: acctest.ErrorCheck(t, datapipeline.EndpointsID), diff --git a/internal/service/datapipeline/pipeline_definition_test.go b/internal/service/datapipeline/pipeline_definition_test.go index dd58ec2a2950..9b14dee4c798 100644 --- a/internal/service/datapipeline/pipeline_definition_test.go +++ b/internal/service/datapipeline/pipeline_definition_test.go @@ -23,7 +23,7 @@ func TestAccDataPipelinePipelineDefinition_basic(t *testing.T) { rName := sdkacctest.RandomWithPrefix("tf-acc-test") resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckPipelineDefinitionDestroy(ctx), ErrorCheck: acctest.ErrorCheck(t, datapipeline.EndpointsID), @@ -54,7 +54,7 @@ func TestAccDataPipelinePipelineDefinition_disappears(t *testing.T) { rName := sdkacctest.RandomWithPrefix("tf-acc-test") resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckPipelineDefinitionDestroy(ctx), ErrorCheck: acctest.ErrorCheck(t, datapipeline.EndpointsID), @@ -77,7 +77,7 @@ func TestAccDataPipelinePipelineDefinition_complete(t *testing.T) { rName := sdkacctest.RandomWithPrefix("tf-acc-test") resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckPipelineDefinitionDestroy(ctx), ErrorCheck: acctest.ErrorCheck(t, datapipeline.EndpointsID), diff --git a/internal/service/datapipeline/pipeline_test.go b/internal/service/datapipeline/pipeline_test.go index ef0adb6e9e39..e2e6903d7048 100644 --- a/internal/service/datapipeline/pipeline_test.go +++ b/internal/service/datapipeline/pipeline_test.go @@ -24,7 +24,7 @@ func TestAccDataPipelinePipeline_basic(t *testing.T) { resourceName := "aws_datapipeline_pipeline.default" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, datapipeline.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckPipelineDestroy(ctx), @@ -60,7 +60,7 @@ func TestAccDataPipelinePipeline_description(t *testing.T) { resourceName := "aws_datapipeline_pipeline.default" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, datapipeline.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckPipelineDestroy(ctx), @@ -96,7 +96,7 @@ func TestAccDataPipelinePipeline_disappears(t *testing.T) { resourceName := "aws_datapipeline_pipeline.default" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, datapipeline.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckPipelineDestroy(ctx), @@ -120,7 +120,7 @@ func TestAccDataPipelinePipeline_tags(t *testing.T) { resourceName := "aws_datapipeline_pipeline.default" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, datapipeline.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckPipelineDestroy(ctx), From 5adae7eed0bfa7bcc9d3ff77839b5d5bda5208f9 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Fri, 24 Feb 2023 16:36:46 -0500 Subject: [PATCH 128/763] Add 'Context' argument to 'acctest.PreCheck' for datasync. --- internal/service/datasync/agent_test.go | 10 ++--- .../service/datasync/location_efs_test.go | 10 ++--- .../location_fsx_lustre_file_system_test.go | 8 ++-- .../location_fsx_openzfs_file_system_test.go | 8 ++-- .../location_fsx_windows_file_system_test.go | 8 ++-- .../service/datasync/location_hdfs_test.go | 6 +-- .../service/datasync/location_nfs_test.go | 12 +++--- .../datasync/location_object_storage_test.go | 6 +-- internal/service/datasync/location_s3_test.go | 8 ++-- .../service/datasync/location_smb_test.go | 6 +-- internal/service/datasync/task_test.go | 40 +++++++++---------- 11 files changed, 61 insertions(+), 61 deletions(-) diff --git a/internal/service/datasync/agent_test.go b/internal/service/datasync/agent_test.go index 35294d4a04f3..5fb668871d81 100644 --- a/internal/service/datasync/agent_test.go +++ b/internal/service/datasync/agent_test.go @@ -25,7 +25,7 @@ func TestAccDataSyncAgent_basic(t *testing.T) { resourceName := "aws_datasync_agent.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, datasync.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckAgentDestroy(ctx), @@ -60,7 +60,7 @@ func TestAccDataSyncAgent_disappears(t *testing.T) { resourceName := "aws_datasync_agent.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, datasync.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckAgentDestroy(ctx), @@ -85,7 +85,7 @@ func TestAccDataSyncAgent_agentName(t *testing.T) { resourceName := "aws_datasync_agent.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, datasync.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckAgentDestroy(ctx), @@ -121,7 +121,7 @@ func TestAccDataSyncAgent_tags(t *testing.T) { resourceName := "aws_datasync_agent.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, datasync.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckAgentDestroy(ctx), @@ -173,7 +173,7 @@ func TestAccDataSyncAgent_vpcEndpointID(t *testing.T) { vpcEndpointResourceName := "aws_vpc_endpoint.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, datasync.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckAgentDestroy(ctx), diff --git a/internal/service/datasync/location_efs_test.go b/internal/service/datasync/location_efs_test.go index 8964e9779c88..ea39eca5ef10 100644 --- a/internal/service/datasync/location_efs_test.go +++ b/internal/service/datasync/location_efs_test.go @@ -27,7 +27,7 @@ func TestAccDataSyncLocationEFS_basic(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, datasync.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckLocationEFSDestroy(ctx), @@ -63,7 +63,7 @@ func TestAccDataSyncLocationEFS_accessPointARN(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, datasync.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckLocationEFSDestroy(ctx), @@ -93,7 +93,7 @@ func TestAccDataSyncLocationEFS_disappears(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, datasync.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckLocationEFSDestroy(ctx), @@ -118,7 +118,7 @@ func TestAccDataSyncLocationEFS_subdirectory(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, datasync.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckLocationEFSDestroy(ctx), @@ -147,7 +147,7 @@ func TestAccDataSyncLocationEFS_tags(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, datasync.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckLocationEFSDestroy(ctx), 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 31648ca581ca..fad15a97a99c 100644 --- a/internal/service/datasync/location_fsx_lustre_file_system_test.go +++ b/internal/service/datasync/location_fsx_lustre_file_system_test.go @@ -24,7 +24,7 @@ func TestAccDataSyncLocationFSxLustreFileSystem_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(fsx.EndpointsID, t) testAccPreCheck(ctx, t) }, @@ -61,7 +61,7 @@ func TestAccDataSyncLocationFSxLustreFileSystem_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(fsx.EndpointsID, t) testAccPreCheck(ctx, t) }, @@ -89,7 +89,7 @@ func TestAccDataSyncLocationFSxLustreFileSystem_subdirectory(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(fsx.EndpointsID, t) testAccPreCheck(ctx, t) }, @@ -121,7 +121,7 @@ func TestAccDataSyncLocationFSxLustreFileSystem_tags(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(fsx.EndpointsID, t) testAccPreCheck(ctx, t) }, 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 28e6bb2f84ed..7a40fa9c1d37 100644 --- a/internal/service/datasync/location_fsx_openzfs_file_system_test.go +++ b/internal/service/datasync/location_fsx_openzfs_file_system_test.go @@ -24,7 +24,7 @@ func TestAccDataSyncLocationFSxOpenZFSFileSystem_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(fsx.EndpointsID, t) testAccPreCheck(ctx, t) }, @@ -61,7 +61,7 @@ func TestAccDataSyncLocationFSxOpenZFSFileSystem_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(fsx.EndpointsID, t) testAccPreCheck(ctx, t) }, @@ -89,7 +89,7 @@ func TestAccDataSyncLocationFSxOpenZFSFileSystem_subdirectory(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(fsx.EndpointsID, t) testAccPreCheck(ctx, t) }, @@ -121,7 +121,7 @@ func TestAccDataSyncLocationFSxOpenZFSFileSystem_tags(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(fsx.EndpointsID, t) testAccPreCheck(ctx, t) }, 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 74953e376e59..4e6615373e3d 100644 --- a/internal/service/datasync/location_fsx_windows_file_system_test.go +++ b/internal/service/datasync/location_fsx_windows_file_system_test.go @@ -28,7 +28,7 @@ func TestAccDataSyncLocationFSxWindowsFileSystem_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(fsx.EndpointsID, t) testAccPreCheck(ctx, t) }, @@ -68,7 +68,7 @@ func TestAccDataSyncLocationFSxWindowsFileSystem_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(fsx.EndpointsID, t) testAccPreCheck(ctx, t) }, @@ -97,7 +97,7 @@ func TestAccDataSyncLocationFSxWindowsFileSystem_subdirectory(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(fsx.EndpointsID, t) testAccPreCheck(ctx, t) }, @@ -132,7 +132,7 @@ func TestAccDataSyncLocationFSxWindowsFileSystem_tags(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(fsx.EndpointsID, t) testAccPreCheck(ctx, t) }, diff --git a/internal/service/datasync/location_hdfs_test.go b/internal/service/datasync/location_hdfs_test.go index 9d3d05c7cce9..36ed1ad282b7 100644 --- a/internal/service/datasync/location_hdfs_test.go +++ b/internal/service/datasync/location_hdfs_test.go @@ -26,7 +26,7 @@ func TestAccDataSyncLocationHDFS_basic(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, datasync.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckLocationHDFSDestroy(ctx), @@ -65,7 +65,7 @@ func TestAccDataSyncLocationHDFS_disappears(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, datasync.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckLocationHDFSDestroy(ctx), @@ -90,7 +90,7 @@ func TestAccDataSyncLocationHDFS_tags(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, datasync.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckLocationHDFSDestroy(ctx), diff --git a/internal/service/datasync/location_nfs_test.go b/internal/service/datasync/location_nfs_test.go index ce9055758005..089b36ac937a 100644 --- a/internal/service/datasync/location_nfs_test.go +++ b/internal/service/datasync/location_nfs_test.go @@ -24,7 +24,7 @@ func TestAccDataSyncLocationNFS_basic(t *testing.T) { resourceName := "aws_datasync_location_nfs.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, datasync.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckLocationNFSDestroy(ctx), @@ -61,7 +61,7 @@ func TestAccDataSyncLocationNFS_mountOptions(t *testing.T) { resourceName := "aws_datasync_location_nfs.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, datasync.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckLocationNFSDestroy(ctx), @@ -97,7 +97,7 @@ func TestAccDataSyncLocationNFS_disappears(t *testing.T) { resourceName := "aws_datasync_location_nfs.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, datasync.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckLocationNFSDestroy(ctx), @@ -121,7 +121,7 @@ func TestAccDataSyncLocationNFS_AgentARNs_multiple(t *testing.T) { resourceName := "aws_datasync_location_nfs.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, datasync.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckLocationNFSDestroy(ctx), @@ -151,7 +151,7 @@ func TestAccDataSyncLocationNFS_subdirectory(t *testing.T) { resourceName := "aws_datasync_location_nfs.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, datasync.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckLocationNFSDestroy(ctx), @@ -187,7 +187,7 @@ func TestAccDataSyncLocationNFS_tags(t *testing.T) { resourceName := "aws_datasync_location_nfs.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, datasync.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckLocationNFSDestroy(ctx), diff --git a/internal/service/datasync/location_object_storage_test.go b/internal/service/datasync/location_object_storage_test.go index 687029071a69..9b86d6fe4bd4 100644 --- a/internal/service/datasync/location_object_storage_test.go +++ b/internal/service/datasync/location_object_storage_test.go @@ -26,7 +26,7 @@ func TestAccDataSyncLocationObjectStorage_basic(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, datasync.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckLocationObjectStorageDestroy(ctx), @@ -59,7 +59,7 @@ func TestAccDataSyncLocationObjectStorage_disappears(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, datasync.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckLocationObjectStorageDestroy(ctx), @@ -84,7 +84,7 @@ func TestAccDataSyncLocationObjectStorage_tags(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, datasync.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckLocationObjectStorageDestroy(ctx), diff --git a/internal/service/datasync/location_s3_test.go b/internal/service/datasync/location_s3_test.go index 6a8ca4d35dc6..d5326a0d0305 100644 --- a/internal/service/datasync/location_s3_test.go +++ b/internal/service/datasync/location_s3_test.go @@ -27,7 +27,7 @@ func TestAccDataSyncLocationS3_basic(t *testing.T) { s3BucketResourceName := "aws_s3_bucket.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, datasync.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckLocationS3Destroy(ctx), @@ -66,7 +66,7 @@ func TestAccDataSyncLocationS3_storageClass(t *testing.T) { s3BucketResourceName := "aws_s3_bucket.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, datasync.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckLocationS3Destroy(ctx), @@ -101,7 +101,7 @@ func TestAccDataSyncLocationS3_disappears(t *testing.T) { resourceName := "aws_datasync_location_s3.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, datasync.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckLocationS3Destroy(ctx), @@ -125,7 +125,7 @@ func TestAccDataSyncLocationS3_tags(t *testing.T) { resourceName := "aws_datasync_location_s3.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, datasync.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckLocationS3Destroy(ctx), diff --git a/internal/service/datasync/location_smb_test.go b/internal/service/datasync/location_smb_test.go index 60340d29117d..0ae0349fbd8b 100644 --- a/internal/service/datasync/location_smb_test.go +++ b/internal/service/datasync/location_smb_test.go @@ -25,7 +25,7 @@ func TestAccDataSyncLocationSMB_basic(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, datasync.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckLocationSMBDestroy(ctx), @@ -73,7 +73,7 @@ func TestAccDataSyncLocationSMB_disappears(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, datasync.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckLocationSMBDestroy(ctx), @@ -97,7 +97,7 @@ func TestAccDataSyncLocationSMB_tags(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, datasync.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckLocationSMBDestroy(ctx), diff --git a/internal/service/datasync/task_test.go b/internal/service/datasync/task_test.go index afb7e2cf8b6d..dd26a86280d5 100644 --- a/internal/service/datasync/task_test.go +++ b/internal/service/datasync/task_test.go @@ -27,7 +27,7 @@ func TestAccDataSyncTask_basic(t *testing.T) { resourceName := "aws_datasync_task.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, datasync.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTaskDestroy(ctx), @@ -78,7 +78,7 @@ func TestAccDataSyncTask_disappears(t *testing.T) { resourceName := "aws_datasync_task.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, datasync.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTaskDestroy(ctx), @@ -102,7 +102,7 @@ func TestAccDataSyncTask_schedule(t *testing.T) { resourceName := "aws_datasync_task.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, datasync.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTaskDestroy(ctx), @@ -139,7 +139,7 @@ func TestAccDataSyncTask_cloudWatchLogGroupARN(t *testing.T) { resourceName := "aws_datasync_task.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, datasync.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTaskDestroy(ctx), @@ -173,7 +173,7 @@ func TestAccDataSyncTask_excludes(t *testing.T) { resourceName := "aws_datasync_task.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, datasync.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTaskDestroy(ctx), @@ -212,7 +212,7 @@ func TestAccDataSyncTask_includes(t *testing.T) { resourceName := "aws_datasync_task.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, datasync.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTaskDestroy(ctx), @@ -251,7 +251,7 @@ func TestAccDataSyncTask_DefaultSyncOptions_atimeMtime(t *testing.T) { resourceName := "aws_datasync_task.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, datasync.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTaskDestroy(ctx), @@ -291,7 +291,7 @@ func TestAccDataSyncTask_DefaultSyncOptions_bytesPerSecond(t *testing.T) { resourceName := "aws_datasync_task.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, datasync.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTaskDestroy(ctx), @@ -329,7 +329,7 @@ func TestAccDataSyncTask_DefaultSyncOptions_gid(t *testing.T) { resourceName := "aws_datasync_task.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, datasync.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTaskDestroy(ctx), @@ -367,7 +367,7 @@ func TestAccDataSyncTask_DefaultSyncOptions_logLevel(t *testing.T) { resourceName := "aws_datasync_task.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, datasync.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTaskDestroy(ctx), @@ -405,7 +405,7 @@ func TestAccDataSyncTask_DefaultSyncOptions_overwriteMode(t *testing.T) { resourceName := "aws_datasync_task.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, datasync.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTaskDestroy(ctx), @@ -443,7 +443,7 @@ func TestAccDataSyncTask_DefaultSyncOptions_posixPermissions(t *testing.T) { resourceName := "aws_datasync_task.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, datasync.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTaskDestroy(ctx), @@ -481,7 +481,7 @@ func TestAccDataSyncTask_DefaultSyncOptions_preserveDeletedFiles(t *testing.T) { resourceName := "aws_datasync_task.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, datasync.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTaskDestroy(ctx), @@ -519,7 +519,7 @@ func TestAccDataSyncTask_DefaultSyncOptions_preserveDevices(t *testing.T) { resourceName := "aws_datasync_task.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, datasync.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTaskDestroy(ctx), @@ -558,7 +558,7 @@ func TestAccDataSyncTask_DefaultSyncOptions_securityDescriptorCopyFlags(t *testi domainName := acctest.RandomDomainName() resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, datasync.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTaskDestroy(ctx), @@ -602,7 +602,7 @@ func TestAccDataSyncTask_DefaultSyncOptions_taskQueueing(t *testing.T) { resourceName := "aws_datasync_task.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, datasync.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTaskDestroy(ctx), @@ -640,7 +640,7 @@ func TestAccDataSyncTask_DefaultSyncOptions_transferMode(t *testing.T) { resourceName := "aws_datasync_task.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, datasync.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTaskDestroy(ctx), @@ -678,7 +678,7 @@ func TestAccDataSyncTask_DefaultSyncOptions_uid(t *testing.T) { resourceName := "aws_datasync_task.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, datasync.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTaskDestroy(ctx), @@ -716,7 +716,7 @@ func TestAccDataSyncTask_DefaultSyncOptions_verifyMode(t *testing.T) { resourceName := "aws_datasync_task.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, datasync.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTaskDestroy(ctx), @@ -763,7 +763,7 @@ func TestAccDataSyncTask_tags(t *testing.T) { resourceName := "aws_datasync_task.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, datasync.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTaskDestroy(ctx), From 47d5805bab30123b6077a34a93e6a59c8ef9b17b Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Fri, 24 Feb 2023 16:36:46 -0500 Subject: [PATCH 129/763] Add 'Context' argument to 'acctest.PreCheck' for dax. --- internal/service/dax/cluster_test.go | 12 ++++++------ internal/service/dax/parameter_group_test.go | 2 +- internal/service/dax/subnet_group_test.go | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/internal/service/dax/cluster_test.go b/internal/service/dax/cluster_test.go index e6ce7eac3b12..8b923c1a1d14 100644 --- a/internal/service/dax/cluster_test.go +++ b/internal/service/dax/cluster_test.go @@ -24,7 +24,7 @@ func TestAccDAXCluster_basic(t *testing.T) { resourceName := "aws_dax_cluster.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, dax.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClusterDestroy(ctx), @@ -81,7 +81,7 @@ func TestAccDAXCluster_resize(t *testing.T) { resourceName := "aws_dax_cluster.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, dax.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClusterDestroy(ctx), @@ -126,7 +126,7 @@ func TestAccDAXCluster_Encryption_disabled(t *testing.T) { resourceName := "aws_dax_cluster.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, dax.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClusterDestroy(ctx), @@ -161,7 +161,7 @@ func TestAccDAXCluster_Encryption_enabled(t *testing.T) { resourceName := "aws_dax_cluster.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, dax.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClusterDestroy(ctx), @@ -197,7 +197,7 @@ func TestAccDAXCluster_EndpointEncryption_disabled(t *testing.T) { clusterEndpointEncryptionType := "NONE" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, dax.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClusterDestroy(ctx), @@ -232,7 +232,7 @@ func TestAccDAXCluster_EndpointEncryption_enabled(t *testing.T) { clusterEndpointEncryptionType := "TLS" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, dax.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClusterDestroy(ctx), diff --git a/internal/service/dax/parameter_group_test.go b/internal/service/dax/parameter_group_test.go index 652be1bc7fd0..e8fe0bcffbed 100644 --- a/internal/service/dax/parameter_group_test.go +++ b/internal/service/dax/parameter_group_test.go @@ -21,7 +21,7 @@ func TestAccDAXParameterGroup_basic(t *testing.T) { resourceName := "aws_dax_parameter_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, dax.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckParameterGroupDestroy(ctx), diff --git a/internal/service/dax/subnet_group_test.go b/internal/service/dax/subnet_group_test.go index a187ce737e29..c8b699b441b5 100644 --- a/internal/service/dax/subnet_group_test.go +++ b/internal/service/dax/subnet_group_test.go @@ -21,7 +21,7 @@ func TestAccDAXSubnetGroup_basic(t *testing.T) { resourceName := "aws_dax_subnet_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, dax.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSubnetGroupDestroy(ctx), From 2e1ef40071c89841cf4a80f55d082f0dfbe874db Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Fri, 24 Feb 2023 16:36:47 -0500 Subject: [PATCH 130/763] Add 'Context' argument to 'acctest.PreCheck' for deploy. --- internal/service/deploy/app_test.go | 14 ++-- .../service/deploy/deployment_config_test.go | 10 +-- .../service/deploy/deployment_group_test.go | 68 +++++++++---------- 3 files changed, 46 insertions(+), 46 deletions(-) diff --git a/internal/service/deploy/app_test.go b/internal/service/deploy/app_test.go index 44e06e0087ef..cd781e0cfdf8 100644 --- a/internal/service/deploy/app_test.go +++ b/internal/service/deploy/app_test.go @@ -24,7 +24,7 @@ func TestAccDeployApp_basic(t *testing.T) { resourceName := "aws_codedeploy_app.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, codedeploy.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckAppDestroy(ctx), @@ -65,7 +65,7 @@ func TestAccDeployApp_computePlatform(t *testing.T) { resourceName := "aws_codedeploy_app.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, codedeploy.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckAppDestroy(ctx), @@ -96,7 +96,7 @@ func TestAccDeployApp_ComputePlatform_ecs(t *testing.T) { resourceName := "aws_codedeploy_app.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, codedeploy.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckAppDestroy(ctx), @@ -124,7 +124,7 @@ func TestAccDeployApp_ComputePlatform_lambda(t *testing.T) { resourceName := "aws_codedeploy_app.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, codedeploy.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckAppDestroy(ctx), @@ -153,7 +153,7 @@ func TestAccDeployApp_name(t *testing.T) { resourceName := "aws_codedeploy_app.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, codedeploy.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckAppDestroy(ctx), @@ -188,7 +188,7 @@ func TestAccDeployApp_tags(t *testing.T) { resourceName := "aws_codedeploy_app.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, codedeploy.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckAppDestroy(ctx), @@ -234,7 +234,7 @@ func TestAccDeployApp_disappears(t *testing.T) { resourceName := "aws_codedeploy_app.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, codedeploy.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckAppDestroy(ctx), diff --git a/internal/service/deploy/deployment_config_test.go b/internal/service/deploy/deployment_config_test.go index 9e20babea045..3dc84840048d 100644 --- a/internal/service/deploy/deployment_config_test.go +++ b/internal/service/deploy/deployment_config_test.go @@ -23,7 +23,7 @@ func TestAccDeployDeploymentConfig_basic(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, codedeploy.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDeploymentConfigDestroy(ctx), @@ -53,7 +53,7 @@ func TestAccDeployDeploymentConfig_fleetPercent(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, codedeploy.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDeploymentConfigDestroy(ctx), @@ -97,7 +97,7 @@ func TestAccDeployDeploymentConfig_hostCount(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, codedeploy.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDeploymentConfigDestroy(ctx), @@ -141,7 +141,7 @@ func TestAccDeployDeploymentConfig_trafficCanary(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, codedeploy.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDeploymentConfigDestroy(ctx), @@ -191,7 +191,7 @@ func TestAccDeployDeploymentConfig_trafficLinear(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, codedeploy.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDeploymentConfigDestroy(ctx), diff --git a/internal/service/deploy/deployment_group_test.go b/internal/service/deploy/deployment_group_test.go index a993b1838231..f5ff5ae7e9c4 100644 --- a/internal/service/deploy/deployment_group_test.go +++ b/internal/service/deploy/deployment_group_test.go @@ -28,7 +28,7 @@ func TestAccDeployDeploymentGroup_basic(t *testing.T) { rName := sdkacctest.RandString(5) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, codedeploy.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDeploymentGroupDestroy(ctx), @@ -102,7 +102,7 @@ func TestAccDeployDeploymentGroup_Basic_tagSet(t *testing.T) { rName := sdkacctest.RandString(5) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, codedeploy.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDeploymentGroupDestroy(ctx), @@ -174,7 +174,7 @@ func TestAccDeployDeploymentGroup_onPremiseTag(t *testing.T) { rName := sdkacctest.RandString(5) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, codedeploy.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDeploymentGroupDestroy(ctx), @@ -216,7 +216,7 @@ func TestAccDeployDeploymentGroup_disappears(t *testing.T) { rName := sdkacctest.RandString(5) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, codedeploy.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDeploymentGroupDestroy(ctx), @@ -240,7 +240,7 @@ func TestAccDeployDeploymentGroup_Disappears_app(t *testing.T) { rName := sdkacctest.RandString(5) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, codedeploy.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDeploymentGroupDestroy(ctx), @@ -265,7 +265,7 @@ func TestAccDeployDeploymentGroup_tags(t *testing.T) { rName := sdkacctest.RandString(5) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, codedeploy.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDeploymentGroupDestroy(ctx), @@ -313,7 +313,7 @@ func TestAccDeployDeploymentGroup_Trigger_basic(t *testing.T) { rName := sdkacctest.RandString(5) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, codedeploy.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDeploymentGroupDestroy(ctx), @@ -363,7 +363,7 @@ func TestAccDeployDeploymentGroup_Trigger_multiple(t *testing.T) { rName := sdkacctest.RandString(5) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, codedeploy.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDeploymentGroupDestroy(ctx), @@ -425,7 +425,7 @@ func TestAccDeployDeploymentGroup_AutoRollback_create(t *testing.T) { rName := sdkacctest.RandString(5) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, codedeploy.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDeploymentGroupDestroy(ctx), @@ -461,7 +461,7 @@ func TestAccDeployDeploymentGroup_AutoRollback_update(t *testing.T) { rName := sdkacctest.RandString(5) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, codedeploy.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDeploymentGroupDestroy(ctx), @@ -511,7 +511,7 @@ func TestAccDeployDeploymentGroup_AutoRollback_delete(t *testing.T) { rName := sdkacctest.RandString(5) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, codedeploy.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDeploymentGroupDestroy(ctx), @@ -555,7 +555,7 @@ func TestAccDeployDeploymentGroup_AutoRollback_disable(t *testing.T) { rName := sdkacctest.RandString(5) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, codedeploy.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDeploymentGroupDestroy(ctx), @@ -604,7 +604,7 @@ func TestAccDeployDeploymentGroup_Alarm_create(t *testing.T) { rName := sdkacctest.RandString(5) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, codedeploy.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDeploymentGroupDestroy(ctx), @@ -642,7 +642,7 @@ func TestAccDeployDeploymentGroup_Alarm_update(t *testing.T) { rName := sdkacctest.RandString(5) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, codedeploy.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDeploymentGroupDestroy(ctx), @@ -696,7 +696,7 @@ func TestAccDeployDeploymentGroup_Alarm_delete(t *testing.T) { rName := sdkacctest.RandString(5) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, codedeploy.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDeploymentGroupDestroy(ctx), @@ -742,7 +742,7 @@ func TestAccDeployDeploymentGroup_Alarm_disable(t *testing.T) { rName := sdkacctest.RandString(5) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, codedeploy.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDeploymentGroupDestroy(ctx), @@ -796,7 +796,7 @@ func TestAccDeployDeploymentGroup_DeploymentStyle_default(t *testing.T) { rName := sdkacctest.RandString(5) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, codedeploy.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDeploymentGroupDestroy(ctx), @@ -831,7 +831,7 @@ func TestAccDeployDeploymentGroup_DeploymentStyle_create(t *testing.T) { rName := sdkacctest.RandString(5) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, codedeploy.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDeploymentGroupDestroy(ctx), @@ -874,7 +874,7 @@ func TestAccDeployDeploymentGroup_DeploymentStyle_update(t *testing.T) { rName := sdkacctest.RandString(5) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, codedeploy.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDeploymentGroupDestroy(ctx), @@ -922,7 +922,7 @@ func TestAccDeployDeploymentGroup_DeploymentStyle_delete(t *testing.T) { rName := sdkacctest.RandString(5) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, codedeploy.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDeploymentGroupDestroy(ctx), @@ -969,7 +969,7 @@ func TestAccDeployDeploymentGroup_LoadBalancerInfo_create(t *testing.T) { rName := sdkacctest.RandString(5) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, codedeploy.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDeploymentGroupDestroy(ctx), @@ -1005,7 +1005,7 @@ func TestAccDeployDeploymentGroup_LoadBalancerInfo_update(t *testing.T) { rName := sdkacctest.RandString(5) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, codedeploy.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDeploymentGroupDestroy(ctx), @@ -1054,7 +1054,7 @@ func TestAccDeployDeploymentGroup_LoadBalancerInfo_delete(t *testing.T) { rName := sdkacctest.RandString(5) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, codedeploy.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDeploymentGroupDestroy(ctx), @@ -1098,7 +1098,7 @@ func TestAccDeployDeploymentGroup_LoadBalancerInfoTargetGroupInfo_create(t *test rName := sdkacctest.RandString(5) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, codedeploy.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDeploymentGroupDestroy(ctx), @@ -1135,7 +1135,7 @@ func TestAccDeployDeploymentGroup_LoadBalancerInfoTargetGroupInfo_update(t *test rName := sdkacctest.RandString(5) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, codedeploy.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDeploymentGroupDestroy(ctx), @@ -1184,7 +1184,7 @@ func TestAccDeployDeploymentGroup_LoadBalancerInfoTargetGroupInfo_delete(t *test rName := sdkacctest.RandString(5) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, codedeploy.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDeploymentGroupDestroy(ctx), @@ -1228,7 +1228,7 @@ func TestAccDeployDeploymentGroup_InPlaceDeploymentWithTrafficControl_create(t * rName := sdkacctest.RandString(5) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, codedeploy.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDeploymentGroupDestroy(ctx), @@ -1271,7 +1271,7 @@ func TestAccDeployDeploymentGroup_InPlaceDeploymentWithTrafficControl_update(t * rName := sdkacctest.RandString(5) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, codedeploy.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDeploymentGroupDestroy(ctx), @@ -1348,7 +1348,7 @@ func TestAccDeployDeploymentGroup_BlueGreenDeployment_create(t *testing.T) { rName := sdkacctest.RandString(5) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, codedeploy.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDeploymentGroupDestroy(ctx), @@ -1405,7 +1405,7 @@ func TestAccDeployDeploymentGroup_BlueGreenDeployment_updateWithASG(t *testing.T rName := sdkacctest.RandString(5) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, codedeploy.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDeploymentGroupDestroy(ctx), @@ -1474,7 +1474,7 @@ func TestAccDeployDeploymentGroup_BlueGreenDeployment_update(t *testing.T) { rName := sdkacctest.RandString(5) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, codedeploy.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDeploymentGroupDestroy(ctx), @@ -1557,7 +1557,7 @@ func TestAccDeployDeploymentGroup_BlueGreenDeployment_delete(t *testing.T) { rName := sdkacctest.RandString(5) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, codedeploy.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDeploymentGroupDestroy(ctx), @@ -1626,7 +1626,7 @@ func TestAccDeployDeploymentGroup_BlueGreenDeployment_complete(t *testing.T) { rName := sdkacctest.RandString(5) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, codedeploy.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDeploymentGroupDestroy(ctx), @@ -1734,7 +1734,7 @@ func TestAccDeployDeploymentGroup_ECS_blueGreen(t *testing.T) { resourceName := "aws_codedeploy_deployment_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, codedeploy.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDeploymentGroupDestroy(ctx), From 91f5e2af9fbb909717ee200e624462c63326342a Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Fri, 24 Feb 2023 16:36:47 -0500 Subject: [PATCH 131/763] Add 'Context' argument to 'acctest.PreCheck' for detective. --- internal/service/detective/graph_test.go | 6 +++--- internal/service/detective/invitation_accepter_test.go | 2 +- internal/service/detective/member_test.go | 6 +++--- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/internal/service/detective/graph_test.go b/internal/service/detective/graph_test.go index 4281016f79e5..8a2b38c462d0 100644 --- a/internal/service/detective/graph_test.go +++ b/internal/service/detective/graph_test.go @@ -21,7 +21,7 @@ func testAccGraph_basic(t *testing.T) { resourceName := "aws_detective_graph.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckGraphDestroy(ctx), ErrorCheck: acctest.ErrorCheck(t, detective.EndpointsID), @@ -48,7 +48,7 @@ func testAccGraph_tags(t *testing.T) { resourceName := "aws_detective_graph.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckGraphDestroy(ctx), ErrorCheck: acctest.ErrorCheck(t, detective.EndpointsID), @@ -105,7 +105,7 @@ func testAccGraph_disappears(t *testing.T) { resourceName := "aws_detective_graph.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckGraphDestroy(ctx), ErrorCheck: acctest.ErrorCheck(t, detective.EndpointsID), diff --git a/internal/service/detective/invitation_accepter_test.go b/internal/service/detective/invitation_accepter_test.go index 63ccbae21bba..b5fcb699d869 100644 --- a/internal/service/detective/invitation_accepter_test.go +++ b/internal/service/detective/invitation_accepter_test.go @@ -22,7 +22,7 @@ func testAccInvitationAccepter_basic(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckAlternateAccount(t) }, ProtoV5ProviderFactories: acctest.ProtoV5FactoriesAlternate(ctx, t), diff --git a/internal/service/detective/member_test.go b/internal/service/detective/member_test.go index 319ad131c70a..99ef1b923172 100644 --- a/internal/service/detective/member_test.go +++ b/internal/service/detective/member_test.go @@ -23,7 +23,7 @@ func testAccMember_basic(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckAlternateAccount(t) }, ProtoV5ProviderFactories: acctest.ProtoV5FactoriesAlternate(ctx, t), @@ -60,7 +60,7 @@ func testAccMember_disappears(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckAlternateAccount(t) }, ProtoV5ProviderFactories: acctest.ProtoV5FactoriesAlternate(ctx, t), @@ -88,7 +88,7 @@ func testAccMember_message(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckAlternateAccount(t) }, ProtoV5ProviderFactories: acctest.ProtoV5FactoriesAlternate(ctx, t), From c384d474030322ddd1fb1b3f69ab80bb2dcaf677 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Fri, 24 Feb 2023 16:36:47 -0500 Subject: [PATCH 132/763] Add 'Context' argument to 'acctest.PreCheck' for devicefarm. --- internal/service/devicefarm/device_pool_test.go | 8 ++++---- internal/service/devicefarm/instance_profile_test.go | 6 +++--- internal/service/devicefarm/network_profile_test.go | 8 ++++---- internal/service/devicefarm/project_test.go | 8 ++++---- internal/service/devicefarm/test_grid_project_test.go | 8 ++++---- internal/service/devicefarm/upload_test.go | 6 +++--- 6 files changed, 22 insertions(+), 22 deletions(-) diff --git a/internal/service/devicefarm/device_pool_test.go b/internal/service/devicefarm/device_pool_test.go index 8a6bb62806b0..2a06e63cdc43 100644 --- a/internal/service/devicefarm/device_pool_test.go +++ b/internal/service/devicefarm/device_pool_test.go @@ -26,7 +26,7 @@ func TestAccDeviceFarmDevicePool_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(devicefarm.EndpointsID, t) // Currently, DeviceFarm is only supported in us-west-2 // https://docs.aws.amazon.com/general/latest/gr/devicefarm.html @@ -72,7 +72,7 @@ func TestAccDeviceFarmDevicePool_tags(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(devicefarm.EndpointsID, t) // Currently, DeviceFarm is only supported in us-west-2 // https://docs.aws.amazon.com/general/latest/gr/devicefarm.html @@ -124,7 +124,7 @@ func TestAccDeviceFarmDevicePool_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(devicefarm.EndpointsID, t) // Currently, DeviceFarm is only supported in us-west-2 // https://docs.aws.amazon.com/general/latest/gr/devicefarm.html @@ -155,7 +155,7 @@ func TestAccDeviceFarmDevicePool_disappears_project(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(devicefarm.EndpointsID, t) // Currently, DeviceFarm is only supported in us-west-2 // https://docs.aws.amazon.com/general/latest/gr/devicefarm.html diff --git a/internal/service/devicefarm/instance_profile_test.go b/internal/service/devicefarm/instance_profile_test.go index 4650d13024cb..38e85a765757 100644 --- a/internal/service/devicefarm/instance_profile_test.go +++ b/internal/service/devicefarm/instance_profile_test.go @@ -26,7 +26,7 @@ func TestAccDeviceFarmInstanceProfile_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(devicefarm.EndpointsID, t) // Currently, DeviceFarm is only supported in us-west-2 // https://docs.aws.amazon.com/general/latest/gr/devicefarm.html @@ -73,7 +73,7 @@ func TestAccDeviceFarmInstanceProfile_tags(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(devicefarm.EndpointsID, t) // Currently, DeviceFarm is only supported in us-west-2 // https://docs.aws.amazon.com/general/latest/gr/devicefarm.html @@ -125,7 +125,7 @@ func TestAccDeviceFarmInstanceProfile_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(devicefarm.EndpointsID, t) // Currently, DeviceFarm is only supported in us-west-2 // https://docs.aws.amazon.com/general/latest/gr/devicefarm.html diff --git a/internal/service/devicefarm/network_profile_test.go b/internal/service/devicefarm/network_profile_test.go index 0a87c1a8a29a..4d708e2737f3 100644 --- a/internal/service/devicefarm/network_profile_test.go +++ b/internal/service/devicefarm/network_profile_test.go @@ -26,7 +26,7 @@ func TestAccDeviceFarmNetworkProfile_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(devicefarm.EndpointsID, t) // Currently, DeviceFarm is only supported in us-west-2 // https://docs.aws.amazon.com/general/latest/gr/devicefarm.html @@ -79,7 +79,7 @@ func TestAccDeviceFarmNetworkProfile_tags(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(devicefarm.EndpointsID, t) // Currently, DeviceFarm is only supported in us-west-2 // https://docs.aws.amazon.com/general/latest/gr/devicefarm.html @@ -131,7 +131,7 @@ func TestAccDeviceFarmNetworkProfile_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(devicefarm.EndpointsID, t) // Currently, DeviceFarm is only supported in us-west-2 // https://docs.aws.amazon.com/general/latest/gr/devicefarm.html @@ -162,7 +162,7 @@ func TestAccDeviceFarmNetworkProfile_disappears_project(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(devicefarm.EndpointsID, t) // Currently, DeviceFarm is only supported in us-west-2 // https://docs.aws.amazon.com/general/latest/gr/devicefarm.html diff --git a/internal/service/devicefarm/project_test.go b/internal/service/devicefarm/project_test.go index 83e7e9a3c133..5eca780b55de 100644 --- a/internal/service/devicefarm/project_test.go +++ b/internal/service/devicefarm/project_test.go @@ -26,7 +26,7 @@ func TestAccDeviceFarmProject_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(devicefarm.EndpointsID, t) // Currently, DeviceFarm is only supported in us-west-2 // https://docs.aws.amazon.com/general/latest/gr/devicefarm.html @@ -70,7 +70,7 @@ func TestAccDeviceFarmProject_timeout(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(devicefarm.EndpointsID, t) // Currently, DeviceFarm is only supported in us-west-2 // https://docs.aws.amazon.com/general/latest/gr/devicefarm.html @@ -113,7 +113,7 @@ func TestAccDeviceFarmProject_tags(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(devicefarm.EndpointsID, t) // Currently, DeviceFarm is only supported in us-west-2 // https://docs.aws.amazon.com/general/latest/gr/devicefarm.html @@ -165,7 +165,7 @@ func TestAccDeviceFarmProject_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(devicefarm.EndpointsID, t) // Currently, DeviceFarm is only supported in us-west-2 // https://docs.aws.amazon.com/general/latest/gr/devicefarm.html diff --git a/internal/service/devicefarm/test_grid_project_test.go b/internal/service/devicefarm/test_grid_project_test.go index a63d919945c8..e5c45286afcc 100644 --- a/internal/service/devicefarm/test_grid_project_test.go +++ b/internal/service/devicefarm/test_grid_project_test.go @@ -26,7 +26,7 @@ func TestAccDeviceFarmTestGridProject_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(devicefarm.EndpointsID, t) // Currently, DeviceFarm is only supported in us-west-2 // https://docs.aws.amazon.com/general/latest/gr/devicefarm.html @@ -71,7 +71,7 @@ func TestAccDeviceFarmTestGridProject_vpc(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(devicefarm.EndpointsID, t) // Currently, DeviceFarm is only supported in us-west-2 // https://docs.aws.amazon.com/general/latest/gr/devicefarm.html @@ -107,7 +107,7 @@ func TestAccDeviceFarmTestGridProject_tags(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(devicefarm.EndpointsID, t) // Currently, DeviceFarm is only supported in us-west-2 // https://docs.aws.amazon.com/general/latest/gr/devicefarm.html @@ -159,7 +159,7 @@ func TestAccDeviceFarmTestGridProject_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(devicefarm.EndpointsID, t) // Currently, DeviceFarm is only supported in us-west-2 // https://docs.aws.amazon.com/general/latest/gr/devicefarm.html diff --git a/internal/service/devicefarm/upload_test.go b/internal/service/devicefarm/upload_test.go index dd4bdcc6927c..fc41c8fa1de4 100644 --- a/internal/service/devicefarm/upload_test.go +++ b/internal/service/devicefarm/upload_test.go @@ -26,7 +26,7 @@ func TestAccDeviceFarmUpload_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(devicefarm.EndpointsID, t) // Currently, DeviceFarm is only supported in us-west-2 // https://docs.aws.amazon.com/general/latest/gr/devicefarm.html @@ -76,7 +76,7 @@ func TestAccDeviceFarmUpload_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(devicefarm.EndpointsID, t) // Currently, DeviceFarm is only supported in us-west-2 // https://docs.aws.amazon.com/general/latest/gr/devicefarm.html @@ -107,7 +107,7 @@ func TestAccDeviceFarmUpload_disappears_project(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(devicefarm.EndpointsID, t) // Currently, DeviceFarm is only supported in us-west-2 // https://docs.aws.amazon.com/general/latest/gr/devicefarm.html From 77b2c30123c4e7c1421c30060c537fbcba959d35 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Fri, 24 Feb 2023 16:36:48 -0500 Subject: [PATCH 133/763] Add 'Context' argument to 'acctest.PreCheck' for directconnect. --- .../service/directconnect/bgp_peer_test.go | 2 +- .../connection_association_test.go | 6 +++--- .../connection_confirmation_test.go | 2 +- .../connection_data_source_test.go | 2 +- .../service/directconnect/connection_test.go | 14 +++++++------- .../gateway_association_proposal_test.go | 12 ++++++------ .../directconnect/gateway_association_test.go | 18 +++++++++--------- .../directconnect/gateway_data_source_test.go | 2 +- internal/service/directconnect/gateway_test.go | 6 +++--- .../directconnect/hosted_connection_test.go | 2 +- .../hosted_private_virtual_interface_test.go | 4 ++-- .../hosted_public_virtual_interface_test.go | 4 ++-- .../hosted_transit_virtual_interface_test.go | 4 ++-- internal/service/directconnect/lag_test.go | 10 +++++----- .../directconnect/location_data_source_test.go | 2 +- .../service/directconnect/macsec_key_test.go | 4 ++-- .../private_virtual_interface_test.go | 8 ++++---- .../public_virtual_interface_test.go | 4 ++-- .../router_configuration_data_source_test.go | 2 +- .../transit_virtual_interface_test.go | 6 +++--- 20 files changed, 57 insertions(+), 57 deletions(-) diff --git a/internal/service/directconnect/bgp_peer_test.go b/internal/service/directconnect/bgp_peer_test.go index 1c5192d4cb12..5ec792af3514 100644 --- a/internal/service/directconnect/bgp_peer_test.go +++ b/internal/service/directconnect/bgp_peer_test.go @@ -26,7 +26,7 @@ func TestAccDirectConnectBGPPeer_basic(t *testing.T) { bgpAsn := sdkacctest.RandIntRange(64512, 65534) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, directconnect.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckBGPPeerDestroy(ctx), diff --git a/internal/service/directconnect/connection_association_test.go b/internal/service/directconnect/connection_association_test.go index 87ba46f09984..03e13de7ebe6 100644 --- a/internal/service/directconnect/connection_association_test.go +++ b/internal/service/directconnect/connection_association_test.go @@ -21,7 +21,7 @@ func TestAccDirectConnectConnectionAssociation_basic(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, directconnect.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckConnectionAssociationDestroy(ctx), @@ -42,7 +42,7 @@ func TestAccDirectConnectConnectionAssociation_lagOnConnection(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, directconnect.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckConnectionAssociationDestroy(ctx), @@ -64,7 +64,7 @@ func TestAccDirectConnectConnectionAssociation_multiple(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, directconnect.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckConnectionAssociationDestroy(ctx), diff --git a/internal/service/directconnect/connection_confirmation_test.go b/internal/service/directconnect/connection_confirmation_test.go index a07847e3b14b..4a2afe30ee50 100644 --- a/internal/service/directconnect/connection_confirmation_test.go +++ b/internal/service/directconnect/connection_confirmation_test.go @@ -33,7 +33,7 @@ func TestAccDirectConnectConnectionConfirmation_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckAlternateAccount(t) }, ErrorCheck: acctest.ErrorCheck(t, directconnect.EndpointsID), diff --git a/internal/service/directconnect/connection_data_source_test.go b/internal/service/directconnect/connection_data_source_test.go index a39ea2287823..c20f35dfd647 100644 --- a/internal/service/directconnect/connection_data_source_test.go +++ b/internal/service/directconnect/connection_data_source_test.go @@ -16,7 +16,7 @@ func TestAccDirectConnectConnectionDataSource_basic(t *testing.T) { datasourceName := "data.aws_dx_connection.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, directconnect.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ diff --git a/internal/service/directconnect/connection_test.go b/internal/service/directconnect/connection_test.go index 95e2c8f9df05..005df2e99a5c 100644 --- a/internal/service/directconnect/connection_test.go +++ b/internal/service/directconnect/connection_test.go @@ -24,7 +24,7 @@ func TestAccDirectConnectConnection_basic(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, directconnect.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckConnectionDestroy(ctx), @@ -61,7 +61,7 @@ func TestAccDirectConnectConnection_disappears(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, directconnect.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckConnectionDestroy(ctx), @@ -98,7 +98,7 @@ func TestAccDirectConnectConnection_encryptionMode(t *testing.T) { cak := testAccDirecConnectMacSecGenerateHex() resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, directconnect.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: acctest.CheckDestroyNoop, @@ -143,7 +143,7 @@ func TestAccDirectConnectConnection_macsecRequested(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, directconnect.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckConnectionDestroy(ctx), @@ -179,7 +179,7 @@ func TestAccDirectConnectConnection_providerName(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, directconnect.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckConnectionDestroy(ctx), @@ -215,7 +215,7 @@ func TestAccDirectConnectConnection_skipDestroy(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, directconnect.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckConnectionNoDestroy(ctx), @@ -238,7 +238,7 @@ func TestAccDirectConnectConnection_tags(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, directconnect.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckConnectionDestroy(ctx), diff --git a/internal/service/directconnect/gateway_association_proposal_test.go b/internal/service/directconnect/gateway_association_proposal_test.go index bc27d9f4386d..3159b834269b 100644 --- a/internal/service/directconnect/gateway_association_proposal_test.go +++ b/internal/service/directconnect/gateway_association_proposal_test.go @@ -27,7 +27,7 @@ func TestAccDirectConnectGatewayAssociationProposal_basicVPNGateway(t *testing.T resourceNameVgw := "aws_vpn_gateway.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckAlternateAccount(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckAlternateAccount(t) }, ErrorCheck: acctest.ErrorCheck(t, directconnect.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5FactoriesAlternate(ctx, t), CheckDestroy: testAccCheckGatewayAssociationProposalDestroy(ctx), @@ -63,7 +63,7 @@ func TestAccDirectConnectGatewayAssociationProposal_basicTransitGateway(t *testi resourceNameTgw := "aws_ec2_transit_gateway.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckAlternateAccount(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckAlternateAccount(t) }, ErrorCheck: acctest.ErrorCheck(t, directconnect.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5FactoriesAlternate(ctx, t), CheckDestroy: testAccCheckGatewayAssociationProposalDestroy(ctx), @@ -99,7 +99,7 @@ func TestAccDirectConnectGatewayAssociationProposal_disappears(t *testing.T) { resourceName := "aws_dx_gateway_association_proposal.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckAlternateAccount(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckAlternateAccount(t) }, ErrorCheck: acctest.ErrorCheck(t, directconnect.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5FactoriesAlternate(ctx, t), CheckDestroy: testAccCheckGatewayAssociationProposalDestroy(ctx), @@ -124,7 +124,7 @@ func TestAccDirectConnectGatewayAssociationProposal_endOfLifeVPN(t *testing.T) { resourceName := "aws_dx_gateway_association_proposal.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckAlternateAccount(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckAlternateAccount(t) }, ErrorCheck: acctest.ErrorCheck(t, directconnect.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5FactoriesAlternate(ctx, t), CheckDestroy: testAccCheckGatewayAssociationProposalDestroy(ctx), @@ -161,7 +161,7 @@ func TestAccDirectConnectGatewayAssociationProposal_endOfLifeTgw(t *testing.T) { resourceName := "aws_dx_gateway_association_proposal.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckAlternateAccount(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckAlternateAccount(t) }, ErrorCheck: acctest.ErrorCheck(t, directconnect.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5FactoriesAlternate(ctx, t), CheckDestroy: testAccCheckGatewayAssociationProposalDestroy(ctx), @@ -198,7 +198,7 @@ func TestAccDirectConnectGatewayAssociationProposal_allowedPrefixes(t *testing.T resourceName := "aws_dx_gateway_association_proposal.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckAlternateAccount(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckAlternateAccount(t) }, ErrorCheck: acctest.ErrorCheck(t, directconnect.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5FactoriesAlternate(ctx, t), CheckDestroy: testAccCheckGatewayAssociationProposalDestroy(ctx), diff --git a/internal/service/directconnect/gateway_association_test.go b/internal/service/directconnect/gateway_association_test.go index 77ec38bd12ee..c15df7286295 100644 --- a/internal/service/directconnect/gateway_association_test.go +++ b/internal/service/directconnect/gateway_association_test.go @@ -26,7 +26,7 @@ func TestAccDirectConnectGatewayAssociation_v0StateUpgrade(t *testing.T) { var gap directconnect.GatewayAssociationProposal resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, directconnect.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckGatewayAssociationDestroy(ctx), @@ -53,7 +53,7 @@ func TestAccDirectConnectGatewayAssociation_basicVPNGatewaySingleAccount(t *test var gap directconnect.GatewayAssociationProposal resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, directconnect.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckGatewayAssociationDestroy(ctx), @@ -93,7 +93,7 @@ func TestAccDirectConnectGatewayAssociation_basicVPNGatewayCrossAccount(t *testi var gap directconnect.GatewayAssociationProposal resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckAlternateAccount(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckAlternateAccount(t) }, ErrorCheck: acctest.ErrorCheck(t, directconnect.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5FactoriesAlternate(ctx, t), CheckDestroy: testAccCheckGatewayAssociationDestroy(ctx), @@ -128,7 +128,7 @@ func TestAccDirectConnectGatewayAssociation_basicTransitGatewaySingleAccount(t * var gap directconnect.GatewayAssociationProposal resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, directconnect.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckGatewayAssociationDestroy(ctx), @@ -169,7 +169,7 @@ func TestAccDirectConnectGatewayAssociation_basicTransitGatewayCrossAccount(t *t var gap directconnect.GatewayAssociationProposal resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckAlternateAccount(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckAlternateAccount(t) }, ErrorCheck: acctest.ErrorCheck(t, directconnect.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5FactoriesAlternate(ctx, t), CheckDestroy: testAccCheckGatewayAssociationDestroy(ctx), @@ -204,7 +204,7 @@ func TestAccDirectConnectGatewayAssociation_multiVPNGatewaysSingleAccount(t *tes var gap directconnect.GatewayAssociationProposal resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, directconnect.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckGatewayAssociationDestroy(ctx), @@ -237,7 +237,7 @@ func TestAccDirectConnectGatewayAssociation_allowedPrefixesVPNGatewaySingleAccou var gap directconnect.GatewayAssociationProposal resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, directconnect.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckGatewayAssociationDestroy(ctx), @@ -283,7 +283,7 @@ func TestAccDirectConnectGatewayAssociation_allowedPrefixesVPNGatewayCrossAccoun var gap directconnect.GatewayAssociationProposal resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckAlternateAccount(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckAlternateAccount(t) }, ErrorCheck: acctest.ErrorCheck(t, directconnect.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5FactoriesAlternate(ctx, t), CheckDestroy: testAccCheckGatewayAssociationDestroy(ctx), @@ -326,7 +326,7 @@ func TestAccDirectConnectGatewayAssociation_recreateProposal(t *testing.T) { var gap1, gap2 directconnect.GatewayAssociationProposal resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckAlternateAccount(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckAlternateAccount(t) }, ErrorCheck: acctest.ErrorCheck(t, directconnect.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5FactoriesAlternate(ctx, t), CheckDestroy: testAccCheckGatewayAssociationDestroy(ctx), diff --git a/internal/service/directconnect/gateway_data_source_test.go b/internal/service/directconnect/gateway_data_source_test.go index 6603eb65e95e..bb4c51b93deb 100644 --- a/internal/service/directconnect/gateway_data_source_test.go +++ b/internal/service/directconnect/gateway_data_source_test.go @@ -17,7 +17,7 @@ func TestAccDirectConnectGatewayDataSource_basic(t *testing.T) { datasourceName := "data.aws_dx_gateway.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, directconnect.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ diff --git a/internal/service/directconnect/gateway_test.go b/internal/service/directconnect/gateway_test.go index 2d9309d6386e..b797117f28f2 100644 --- a/internal/service/directconnect/gateway_test.go +++ b/internal/service/directconnect/gateway_test.go @@ -23,7 +23,7 @@ func TestAccDirectConnectGateway_basic(t *testing.T) { resourceName := "aws_dx_gateway.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, directconnect.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckGatewayDestroy(ctx), @@ -52,7 +52,7 @@ func TestAccDirectConnectGateway_disappears(t *testing.T) { resourceName := "aws_dx_gateway.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, directconnect.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckGatewayDestroy(ctx), @@ -77,7 +77,7 @@ func TestAccDirectConnectGateway_complex(t *testing.T) { resourceName := "aws_dx_gateway.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, directconnect.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckGatewayDestroy(ctx), diff --git a/internal/service/directconnect/hosted_connection_test.go b/internal/service/directconnect/hosted_connection_test.go index d71caeffa157..2e4815d79913 100644 --- a/internal/service/directconnect/hosted_connection_test.go +++ b/internal/service/directconnect/hosted_connection_test.go @@ -34,7 +34,7 @@ func TestAccDirectConnectHostedConnection_basic(t *testing.T) { resourceName := "aws_dx_hosted_connection.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, directconnect.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckHostedConnectionDestroy(ctx, testAccHostedConnectionProvider), diff --git a/internal/service/directconnect/hosted_private_virtual_interface_test.go b/internal/service/directconnect/hosted_private_virtual_interface_test.go index dddab51129df..c7925dc6f238 100644 --- a/internal/service/directconnect/hosted_private_virtual_interface_test.go +++ b/internal/service/directconnect/hosted_private_virtual_interface_test.go @@ -34,7 +34,7 @@ func TestAccDirectConnectHostedPrivateVirtualInterface_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckAlternateAccount(t) }, ErrorCheck: acctest.ErrorCheck(t, directconnect.EndpointsID), @@ -93,7 +93,7 @@ func TestAccDirectConnectHostedPrivateVirtualInterface_accepterTags(t *testing.T resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckAlternateAccount(t) }, ErrorCheck: acctest.ErrorCheck(t, directconnect.EndpointsID), diff --git a/internal/service/directconnect/hosted_public_virtual_interface_test.go b/internal/service/directconnect/hosted_public_virtual_interface_test.go index be9f2ba4abd4..daa97ec5b82b 100644 --- a/internal/service/directconnect/hosted_public_virtual_interface_test.go +++ b/internal/service/directconnect/hosted_public_virtual_interface_test.go @@ -35,7 +35,7 @@ func TestAccDirectConnectHostedPublicVirtualInterface_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckAlternateAccount(t) }, ErrorCheck: acctest.ErrorCheck(t, directconnect.EndpointsID), @@ -96,7 +96,7 @@ func TestAccDirectConnectHostedPublicVirtualInterface_accepterTags(t *testing.T) resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckAlternateAccount(t) }, ErrorCheck: acctest.ErrorCheck(t, directconnect.EndpointsID), diff --git a/internal/service/directconnect/hosted_transit_virtual_interface_test.go b/internal/service/directconnect/hosted_transit_virtual_interface_test.go index 05dccdbfe6d0..f955cd4da425 100644 --- a/internal/service/directconnect/hosted_transit_virtual_interface_test.go +++ b/internal/service/directconnect/hosted_transit_virtual_interface_test.go @@ -46,7 +46,7 @@ func testAccHostedTransitVirtualInterface_basic(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckAlternateAccount(t) }, ErrorCheck: acctest.ErrorCheck(t, directconnect.EndpointsID), @@ -106,7 +106,7 @@ func testAccHostedTransitVirtualInterface_accepterTags(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckAlternateAccount(t) }, ErrorCheck: acctest.ErrorCheck(t, directconnect.EndpointsID), diff --git a/internal/service/directconnect/lag_test.go b/internal/service/directconnect/lag_test.go index 251320f65f56..46741a3e6cdc 100644 --- a/internal/service/directconnect/lag_test.go +++ b/internal/service/directconnect/lag_test.go @@ -24,7 +24,7 @@ func TestAccDirectConnectLag_basic(t *testing.T) { rName2 := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, directconnect.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckLagDestroy(ctx), @@ -80,7 +80,7 @@ func TestAccDirectConnectLag_disappears(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, directconnect.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckLagDestroy(ctx), @@ -105,7 +105,7 @@ func TestAccDirectConnectLag_connectionID(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, directconnect.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckLagDestroy(ctx), @@ -144,7 +144,7 @@ func TestAccDirectConnectLag_providerName(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, directconnect.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckLagDestroy(ctx), @@ -183,7 +183,7 @@ func TestAccDirectConnectLag_tags(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, directconnect.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckLagDestroy(ctx), diff --git a/internal/service/directconnect/location_data_source_test.go b/internal/service/directconnect/location_data_source_test.go index c9eb442e3336..e7f6f1cdb870 100644 --- a/internal/service/directconnect/location_data_source_test.go +++ b/internal/service/directconnect/location_data_source_test.go @@ -12,7 +12,7 @@ func TestAccDirectConnectLocationDataSource_basic(t *testing.T) { dsResourceName := "data.aws_dx_location.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, directconnect.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ diff --git a/internal/service/directconnect/macsec_key_test.go b/internal/service/directconnect/macsec_key_test.go index ca50f1df2ccb..f2af8b36ef93 100644 --- a/internal/service/directconnect/macsec_key_test.go +++ b/internal/service/directconnect/macsec_key_test.go @@ -25,7 +25,7 @@ func TestAccDirectConnectMacSecKey_withCkn(t *testing.T) { cak := testAccDirecConnectMacSecGenerateHex() resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, directconnect.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: nil, @@ -65,7 +65,7 @@ func TestAccDirectConnectMacSecKey_withSecret(t *testing.T) { resourceName := "aws_dx_macsec_key_association.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, directconnect.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: nil, diff --git a/internal/service/directconnect/private_virtual_interface_test.go b/internal/service/directconnect/private_virtual_interface_test.go index a5630adb6b5f..424c6da4369a 100644 --- a/internal/service/directconnect/private_virtual_interface_test.go +++ b/internal/service/directconnect/private_virtual_interface_test.go @@ -32,7 +32,7 @@ func TestAccDirectConnectPrivateVirtualInterface_basic(t *testing.T) { vlan := sdkacctest.RandIntRange(2049, 4094) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, directconnect.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckPrivateVirtualInterfaceDestroy(ctx), @@ -105,7 +105,7 @@ func TestAccDirectConnectPrivateVirtualInterface_tags(t *testing.T) { vlan := sdkacctest.RandIntRange(2049, 4094) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, directconnect.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckPrivateVirtualInterfaceDestroy(ctx), @@ -185,7 +185,7 @@ func TestAccDirectConnectPrivateVirtualInterface_dxGateway(t *testing.T) { vlan := sdkacctest.RandIntRange(2049, 4094) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, directconnect.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckPrivateVirtualInterfaceDestroy(ctx), @@ -238,7 +238,7 @@ func TestAccDirectConnectPrivateVirtualInterface_siteLink(t *testing.T) { vlan := sdkacctest.RandIntRange(2049, 4094) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, directconnect.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckPrivateVirtualInterfaceDestroy(ctx), diff --git a/internal/service/directconnect/public_virtual_interface_test.go b/internal/service/directconnect/public_virtual_interface_test.go index 59da060f9a3c..25e8a24ae826 100644 --- a/internal/service/directconnect/public_virtual_interface_test.go +++ b/internal/service/directconnect/public_virtual_interface_test.go @@ -37,7 +37,7 @@ func TestAccDirectConnectPublicVirtualInterface_basic(t *testing.T) { vlan := sdkacctest.RandIntRange(2049, 4094) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, directconnect.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckPublicVirtualInterfaceDestroy(ctx), @@ -90,7 +90,7 @@ func TestAccDirectConnectPublicVirtualInterface_tags(t *testing.T) { vlan := sdkacctest.RandIntRange(2049, 4094) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, directconnect.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckPublicVirtualInterfaceDestroy(ctx), diff --git a/internal/service/directconnect/router_configuration_data_source_test.go b/internal/service/directconnect/router_configuration_data_source_test.go index 5b3a23d0ae82..ab88b9a4a2dc 100644 --- a/internal/service/directconnect/router_configuration_data_source_test.go +++ b/internal/service/directconnect/router_configuration_data_source_test.go @@ -22,7 +22,7 @@ func TestAccDirectConnectRouterConfigurationDataSource_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(directconnect.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, directconnect.EndpointsID), diff --git a/internal/service/directconnect/transit_virtual_interface_test.go b/internal/service/directconnect/transit_virtual_interface_test.go index f3dd4cb3a965..3bd760b952b1 100644 --- a/internal/service/directconnect/transit_virtual_interface_test.go +++ b/internal/service/directconnect/transit_virtual_interface_test.go @@ -45,7 +45,7 @@ func testAccTransitVirtualInterface_basic(t *testing.T) { vlan := sdkacctest.RandIntRange(2049, 4094) resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, directconnect.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTransitVirtualInterfaceDestroy(ctx), @@ -119,7 +119,7 @@ func testAccTransitVirtualInterface_tags(t *testing.T) { vlan := sdkacctest.RandIntRange(2049, 4094) resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, directconnect.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTransitVirtualInterfaceDestroy(ctx), @@ -199,7 +199,7 @@ func testAccTransitVirtualInterface_siteLink(t *testing.T) { vlan := sdkacctest.RandIntRange(2049, 4094) resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, directconnect.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTransitVirtualInterfaceDestroy(ctx), From f7f5f19e021917e257694c7ce06718452bf647b4 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Fri, 24 Feb 2023 16:36:48 -0500 Subject: [PATCH 134/763] Add 'Context' argument to 'acctest.PreCheck' for dlm. --- internal/service/dlm/lifecycle_policy_test.go | 28 +++++++++---------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/internal/service/dlm/lifecycle_policy_test.go b/internal/service/dlm/lifecycle_policy_test.go index c7a9528abbda..edffb6b598cf 100644 --- a/internal/service/dlm/lifecycle_policy_test.go +++ b/internal/service/dlm/lifecycle_policy_test.go @@ -23,7 +23,7 @@ func TestAccDLMLifecyclePolicy_basic(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, dlm.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckLifecyclePolicyDestroy(ctx), @@ -66,7 +66,7 @@ func TestAccDLMLifecyclePolicy_event(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, dlm.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckLifecyclePolicyDestroy(ctx), @@ -115,7 +115,7 @@ func TestAccDLMLifecyclePolicy_cron(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, dlm.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckLifecyclePolicyDestroy(ctx), @@ -143,7 +143,7 @@ func TestAccDLMLifecyclePolicy_retainInterval(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, dlm.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckLifecyclePolicyDestroy(ctx), @@ -171,7 +171,7 @@ func TestAccDLMLifecyclePolicy_deprecate(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, dlm.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckLifecyclePolicyDestroy(ctx), @@ -199,7 +199,7 @@ func TestAccDLMLifecyclePolicy_fastRestore(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, dlm.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckLifecyclePolicyDestroy(ctx), @@ -228,7 +228,7 @@ func TestAccDLMLifecyclePolicy_shareRule(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, dlm.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckLifecyclePolicyDestroy(ctx), @@ -256,7 +256,7 @@ func TestAccDLMLifecyclePolicy_parameters_instance(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, dlm.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckLifecyclePolicyDestroy(ctx), @@ -285,7 +285,7 @@ func TestAccDLMLifecyclePolicy_parameters_volume(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, dlm.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckLifecyclePolicyDestroy(ctx), @@ -314,7 +314,7 @@ func TestAccDLMLifecyclePolicy_variableTags(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, dlm.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckLifecyclePolicyDestroy(ctx), @@ -341,7 +341,7 @@ func TestAccDLMLifecyclePolicy_full(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, dlm.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckLifecyclePolicyDestroy(ctx), @@ -398,7 +398,7 @@ func TestAccDLMLifecyclePolicy_crossRegionCopyRule(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckMultipleRegion(t, 2) testAccPreCheck(ctx, t) }, @@ -457,7 +457,7 @@ func TestAccDLMLifecyclePolicy_tags(t *testing.T) { resourceName := "aws_dlm_lifecycle_policy.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, dlm.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckLifecyclePolicyDestroy(ctx), @@ -502,7 +502,7 @@ func TestAccDLMLifecyclePolicy_disappears(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, dlm.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckLifecyclePolicyDestroy(ctx), From 7a53507ddbdfdb965d6b6de8812b06ac64e9f351 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Fri, 24 Feb 2023 16:36:48 -0500 Subject: [PATCH 135/763] Add 'Context' argument to 'acctest.PreCheck' for dms. --- internal/service/dms/certificate_test.go | 8 +- internal/service/dms/endpoint_test.go | 104 +++++++++--------- .../service/dms/event_subscription_test.go | 10 +- .../service/dms/replication_instance_test.go | 26 ++--- .../dms/replication_subnet_group_test.go | 2 +- internal/service/dms/replication_task_test.go | 12 +- internal/service/dms/s3_endpoint_test.go | 10 +- 7 files changed, 86 insertions(+), 86 deletions(-) diff --git a/internal/service/dms/certificate_test.go b/internal/service/dms/certificate_test.go index b62169d636a9..c1e33e87c8f0 100644 --- a/internal/service/dms/certificate_test.go +++ b/internal/service/dms/certificate_test.go @@ -22,7 +22,7 @@ func TestAccDMSCertificate_basic(t *testing.T) { randId := sdkacctest.RandString(8) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, dms.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckCertificateDestroy(ctx), @@ -49,7 +49,7 @@ func TestAccDMSCertificate_disappears(t *testing.T) { randId := sdkacctest.RandString(8) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, dms.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: nil, @@ -72,7 +72,7 @@ func TestAccDMSCertificate_certificateWallet(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, dms.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckCertificateDestroy(ctx), @@ -99,7 +99,7 @@ func TestAccDMSCertificate_tags(t *testing.T) { randId := sdkacctest.RandString(8) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, dms.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckCertificateDestroy(ctx), diff --git a/internal/service/dms/endpoint_test.go b/internal/service/dms/endpoint_test.go index 068f6922b287..5cc94b996819 100644 --- a/internal/service/dms/endpoint_test.go +++ b/internal/service/dms/endpoint_test.go @@ -22,7 +22,7 @@ func TestAccDMSEndpoint_basic(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, dms.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckEndpointDestroy(ctx), @@ -64,7 +64,7 @@ func TestAccDMSEndpoint_Aurora_basic(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, dms.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckEndpointDestroy(ctx), @@ -92,7 +92,7 @@ func TestAccDMSEndpoint_Aurora_secretID(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, dms.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckEndpointDestroy(ctx), @@ -119,7 +119,7 @@ func TestAccDMSEndpoint_Aurora_update(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, dms.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckEndpointDestroy(ctx), @@ -160,7 +160,7 @@ func TestAccDMSEndpoint_AuroraPostgreSQL_basic(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, dms.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckEndpointDestroy(ctx), @@ -188,7 +188,7 @@ func TestAccDMSEndpoint_AuroraPostgreSQL_secretID(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, dms.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckEndpointDestroy(ctx), @@ -215,7 +215,7 @@ func TestAccDMSEndpoint_AuroraPostgreSQL_update(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, dms.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckEndpointDestroy(ctx), @@ -256,7 +256,7 @@ func TestAccDMSEndpoint_S3_basic(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, dms.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckEndpointDestroy(ctx), @@ -316,7 +316,7 @@ func TestAccDMSEndpoint_S3_key(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, dms.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckEndpointDestroy(ctx), @@ -336,7 +336,7 @@ func TestAccDMSEndpoint_S3_extraConnectionAttributes(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, dms.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckEndpointDestroy(ctx), @@ -364,7 +364,7 @@ func TestAccDMSEndpoint_S3_SSEKMSKeyARN(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, dms.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckEndpointDestroy(ctx), @@ -393,7 +393,7 @@ func TestAccDMSEndpoint_S3_SSEKMSKeyId(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, dms.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckEndpointDestroy(ctx), @@ -422,7 +422,7 @@ func TestAccDMSEndpoint_dynamoDB(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, dms.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckEndpointDestroy(ctx), @@ -456,7 +456,7 @@ func TestAccDMSEndpoint_OpenSearch_basic(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, dms.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckEndpointDestroy(ctx), @@ -491,7 +491,7 @@ func TestAccDMSEndpoint_OpenSearch_extraConnectionAttributes(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, dms.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckEndpointDestroy(ctx), @@ -519,7 +519,7 @@ func TestAccDMSEndpoint_OpenSearch_errorRetryDuration(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, dms.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckEndpointDestroy(ctx), @@ -558,7 +558,7 @@ func TestAccDMSEndpoint_OpenSearch_fullLoadErrorPercentage(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, dms.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckEndpointDestroy(ctx), @@ -598,7 +598,7 @@ func TestAccDMSEndpoint_kafka(t *testing.T) { resourceName := "aws_dms_endpoint.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, dms.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckEndpointDestroy(ctx), @@ -670,7 +670,7 @@ func TestAccDMSEndpoint_kinesis(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, dms.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckEndpointDestroy(ctx), @@ -723,7 +723,7 @@ func TestAccDMSEndpoint_MongoDB_basic(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, dms.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckEndpointDestroy(ctx), @@ -752,7 +752,7 @@ func TestAccDMSEndpoint_MongoDB_secretID(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, dms.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckEndpointDestroy(ctx), @@ -783,7 +783,7 @@ func TestAccDMSEndpoint_MongoDB_update(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, dms.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckEndpointDestroy(ctx), @@ -835,7 +835,7 @@ func TestAccDMSEndpoint_MariaDB_basic(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, dms.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckEndpointDestroy(ctx), @@ -863,7 +863,7 @@ func TestAccDMSEndpoint_MariaDB_secretID(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, dms.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckEndpointDestroy(ctx), @@ -890,7 +890,7 @@ func TestAccDMSEndpoint_MariaDB_update(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, dms.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckEndpointDestroy(ctx), @@ -931,7 +931,7 @@ func TestAccDMSEndpoint_MySQL_basic(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, dms.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckEndpointDestroy(ctx), @@ -959,7 +959,7 @@ func TestAccDMSEndpoint_MySQL_secretID(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, dms.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckEndpointDestroy(ctx), @@ -986,7 +986,7 @@ func TestAccDMSEndpoint_MySQL_update(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, dms.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckEndpointDestroy(ctx), @@ -1027,7 +1027,7 @@ func TestAccDMSEndpoint_Oracle_basic(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, dms.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckEndpointDestroy(ctx), @@ -1056,7 +1056,7 @@ func TestAccDMSEndpoint_Oracle_secretID(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, dms.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckEndpointDestroy(ctx), @@ -1083,7 +1083,7 @@ func TestAccDMSEndpoint_Oracle_update(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, dms.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckEndpointDestroy(ctx), @@ -1131,7 +1131,7 @@ func TestAccDMSEndpoint_PostgreSQL_basic(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, dms.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckEndpointDestroy(ctx), @@ -1159,7 +1159,7 @@ func TestAccDMSEndpoint_PostgreSQL_secretID(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, dms.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckEndpointDestroy(ctx), @@ -1186,7 +1186,7 @@ func TestAccDMSEndpoint_PostgreSQL_update(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, dms.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckEndpointDestroy(ctx), @@ -1228,7 +1228,7 @@ func TestAccDMSEndpoint_PostgreSQL_kmsKey(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, dms.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckEndpointDestroy(ctx), @@ -1251,7 +1251,7 @@ func TestAccDMSEndpoint_SQLServer_basic(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, dms.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckEndpointDestroy(ctx), @@ -1279,7 +1279,7 @@ func TestAccDMSEndpoint_SQLServer_secretID(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, dms.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckEndpointDestroy(ctx), @@ -1306,7 +1306,7 @@ func TestAccDMSEndpoint_SQLServer_update(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, dms.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckEndpointDestroy(ctx), @@ -1348,7 +1348,7 @@ func TestAccDMSEndpoint_SQLServer_kmsKey(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, dms.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckEndpointDestroy(ctx), @@ -1371,7 +1371,7 @@ func TestAccDMSEndpoint_Sybase_basic(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, dms.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckEndpointDestroy(ctx), @@ -1399,7 +1399,7 @@ func TestAccDMSEndpoint_Sybase_secretID(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, dms.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckEndpointDestroy(ctx), @@ -1426,7 +1426,7 @@ func TestAccDMSEndpoint_Sybase_update(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, dms.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckEndpointDestroy(ctx), @@ -1475,7 +1475,7 @@ func TestAccDMSEndpoint_Sybase_kmsKey(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, dms.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckEndpointDestroy(ctx), @@ -1498,7 +1498,7 @@ func TestAccDMSEndpoint_docDB(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, dms.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckEndpointDestroy(ctx), @@ -1539,7 +1539,7 @@ func TestAccDMSEndpoint_db2(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, dms.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckEndpointDestroy(ctx), @@ -1580,7 +1580,7 @@ func TestAccDMSEndpoint_redis(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, dms.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckEndpointDestroy(ctx), @@ -1629,7 +1629,7 @@ func TestAccDMSEndpoint_Redshift_basic(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, dms.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckEndpointDestroy(ctx), @@ -1664,7 +1664,7 @@ func TestAccDMSEndpoint_Redshift_secretID(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, dms.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckEndpointDestroy(ctx), @@ -1694,7 +1694,7 @@ func TestAccDMSEndpoint_Redshift_update(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, dms.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckEndpointDestroy(ctx), @@ -1749,7 +1749,7 @@ func TestAccDMSEndpoint_Redshift_kmsKey(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, dms.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckEndpointDestroy(ctx), @@ -1778,7 +1778,7 @@ func TestAccDMSEndpoint_Redshift_SSEKMSKeyARN(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, dms.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckEndpointDestroy(ctx), @@ -1808,7 +1808,7 @@ func TestAccDMSEndpoint_Redshift_SSEKMSKeyId(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, dms.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckEndpointDestroy(ctx), diff --git a/internal/service/dms/event_subscription_test.go b/internal/service/dms/event_subscription_test.go index 9a1b293a9b7c..fc4ee7ce1404 100644 --- a/internal/service/dms/event_subscription_test.go +++ b/internal/service/dms/event_subscription_test.go @@ -25,7 +25,7 @@ func TestAccDMSEventSubscription_basic(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, dms.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckEventSubscriptionDestroy(ctx), @@ -60,7 +60,7 @@ func TestAccDMSEventSubscription_disappears(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, dms.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckEventSubscriptionDestroy(ctx), @@ -84,7 +84,7 @@ func TestAccDMSEventSubscription_enabled(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, dms.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckEventSubscriptionDestroy(ctx), @@ -126,7 +126,7 @@ func TestAccDMSEventSubscription_eventCategories(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, dms.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckEventSubscriptionDestroy(ctx), @@ -165,7 +165,7 @@ func TestAccDMSEventSubscription_tags(t *testing.T) { resourceName := "aws_dms_event_subscription.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckEKS(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckEKS(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, dms.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckEventSubscriptionDestroy(ctx), diff --git a/internal/service/dms/replication_instance_test.go b/internal/service/dms/replication_instance_test.go index 1951689e85dd..63bdc7507bb0 100644 --- a/internal/service/dms/replication_instance_test.go +++ b/internal/service/dms/replication_instance_test.go @@ -24,7 +24,7 @@ func TestAccDMSReplicationInstance_basic(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, dms.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckReplicationInstanceDestroy(ctx), @@ -64,7 +64,7 @@ func TestAccDMSReplicationInstance_allocatedStorage(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, dms.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckReplicationInstanceDestroy(ctx), @@ -99,7 +99,7 @@ func TestAccDMSReplicationInstance_autoMinorVersionUpgrade(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, dms.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckReplicationInstanceDestroy(ctx), @@ -142,7 +142,7 @@ func TestAccDMSReplicationInstance_availabilityZone(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, dms.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckReplicationInstanceDestroy(ctx), @@ -192,7 +192,7 @@ func TestAccDMSReplicationInstance_engineVersion(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) engineVersions := testAccReplicationInstanceEngineVersionsPreCheck(t) @@ -228,7 +228,7 @@ func TestAccDMSReplicationInstance_kmsKeyARN(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, dms.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckReplicationInstanceDestroy(ctx), @@ -256,7 +256,7 @@ func TestAccDMSReplicationInstance_multiAz(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, dms.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckReplicationInstanceDestroy(ctx), @@ -298,7 +298,7 @@ func TestAccDMSReplicationInstance_preferredMaintenanceWindow(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, dms.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckReplicationInstanceDestroy(ctx), @@ -333,7 +333,7 @@ func TestAccDMSReplicationInstance_publiclyAccessible(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, dms.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckReplicationInstanceDestroy(ctx), @@ -366,7 +366,7 @@ func TestAccDMSReplicationInstance_replicationInstanceClass(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, dms.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckReplicationInstanceDestroy(ctx), @@ -402,7 +402,7 @@ func TestAccDMSReplicationInstance_replicationSubnetGroupID(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, dms.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckReplicationInstanceDestroy(ctx), @@ -430,7 +430,7 @@ func TestAccDMSReplicationInstance_tags(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, dms.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckReplicationInstanceDestroy(ctx), @@ -476,7 +476,7 @@ func TestAccDMSReplicationInstance_vpcSecurityGroupIDs(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, dms.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckReplicationInstanceDestroy(ctx), diff --git a/internal/service/dms/replication_subnet_group_test.go b/internal/service/dms/replication_subnet_group_test.go index 3b8460854ce9..16e87f470222 100644 --- a/internal/service/dms/replication_subnet_group_test.go +++ b/internal/service/dms/replication_subnet_group_test.go @@ -21,7 +21,7 @@ func TestAccDMSReplicationSubnetGroup_basic(t *testing.T) { randId := sdkacctest.RandString(8) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, dms.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckReplicationSubnetGroupDestroy(ctx), diff --git a/internal/service/dms/replication_task_test.go b/internal/service/dms/replication_task_test.go index d850f5908ac1..04f182fe7d51 100644 --- a/internal/service/dms/replication_task_test.go +++ b/internal/service/dms/replication_task_test.go @@ -31,7 +31,7 @@ func TestAccDMSReplicationTask_basic(t *testing.T) { ` resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, dms.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckReplicationTaskDestroy(ctx), @@ -70,7 +70,7 @@ func TestAccDMSReplicationTask_update(t *testing.T) { resourceName := "aws_dms_replication_task.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, dms.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckReplicationTaskDestroy(ctx), @@ -157,7 +157,7 @@ func TestAccDMSReplicationTask_cdcStartPosition(t *testing.T) { resourceName := "aws_dms_replication_task.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, dms.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckReplicationTaskDestroy(ctx), @@ -189,7 +189,7 @@ func TestAccDMSReplicationTask_startReplicationTask(t *testing.T) { resourceName := "aws_dms_replication_task.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, dms.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckReplicationTaskDestroy(ctx), @@ -233,7 +233,7 @@ func TestAccDMSReplicationTask_s3ToRDS(t *testing.T) { //https://github.com/hashicorp/terraform-provider-aws/issues/28277 resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, dms.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckReplicationTaskDestroy(ctx), @@ -264,7 +264,7 @@ func TestAccDMSReplicationTask_disappears(t *testing.T) { ` resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, dms.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckReplicationTaskDestroy(ctx), diff --git a/internal/service/dms/s3_endpoint_test.go b/internal/service/dms/s3_endpoint_test.go index 3f38f31941bf..2ed939192151 100644 --- a/internal/service/dms/s3_endpoint_test.go +++ b/internal/service/dms/s3_endpoint_test.go @@ -16,7 +16,7 @@ func TestAccDMSS3Endpoint_basic(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, dms.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckEndpointDestroy(ctx), @@ -81,7 +81,7 @@ func TestAccDMSS3Endpoint_update(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, dms.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckEndpointDestroy(ctx), @@ -185,7 +185,7 @@ func TestAccDMSS3Endpoint_simple(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, dms.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckEndpointDestroy(ctx), @@ -249,7 +249,7 @@ func TestAccDMSS3Endpoint_sourceSimple(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, dms.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckEndpointDestroy(ctx), @@ -311,7 +311,7 @@ func TestAccDMSS3Endpoint_source(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, dms.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckEndpointDestroy(ctx), From e18c30b045ce330bab830f6bdc3d7fbe9b468254 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Fri, 24 Feb 2023 16:36:49 -0500 Subject: [PATCH 136/763] Add 'Context' argument to 'acctest.PreCheck' for docdb. --- .../service/docdb/cluster_instance_test.go | 14 ++++---- .../docdb/cluster_parameter_group_test.go | 16 ++++----- .../service/docdb/cluster_snapshot_test.go | 2 +- internal/service/docdb/cluster_test.go | 34 +++++++++---------- .../docdb/engine_version_data_source_test.go | 6 ++-- .../service/docdb/event_subscription_test.go | 12 +++---- internal/service/docdb/global_cluster_test.go | 18 +++++----- .../orderable_db_instance_data_source_test.go | 4 +-- internal/service/docdb/subnet_group_test.go | 10 +++--- 9 files changed, 58 insertions(+), 58 deletions(-) diff --git a/internal/service/docdb/cluster_instance_test.go b/internal/service/docdb/cluster_instance_test.go index 6d68189f26cc..be665951d1f5 100644 --- a/internal/service/docdb/cluster_instance_test.go +++ b/internal/service/docdb/cluster_instance_test.go @@ -25,7 +25,7 @@ func TestAccDocDBClusterInstance_basic(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, docdb.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClusterDestroy(ctx), @@ -76,7 +76,7 @@ func TestAccDocDBClusterInstance_performanceInsights(t *testing.T) { rName := sdkacctest.RandomWithPrefix(rNamePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, docdb.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClusterDestroy(ctx), @@ -113,7 +113,7 @@ func TestAccDocDBClusterInstance_az(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, docdb.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClusterDestroy(ctx), @@ -148,7 +148,7 @@ func TestAccDocDBClusterInstance_namePrefix(t *testing.T) { rName := sdkacctest.RandomWithPrefix(rNamePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, docdb.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClusterDestroy(ctx), @@ -183,7 +183,7 @@ func TestAccDocDBClusterInstance_generatedName(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, docdb.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClusterDestroy(ctx), @@ -217,7 +217,7 @@ func TestAccDocDBClusterInstance_kmsKey(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, docdb.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClusterDestroy(ctx), @@ -251,7 +251,7 @@ func TestAccDocDBClusterInstance_disappears(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, docdb.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClusterDestroy(ctx), diff --git a/internal/service/docdb/cluster_parameter_group_test.go b/internal/service/docdb/cluster_parameter_group_test.go index 788f92ea7ca2..744b304b867d 100644 --- a/internal/service/docdb/cluster_parameter_group_test.go +++ b/internal/service/docdb/cluster_parameter_group_test.go @@ -26,7 +26,7 @@ func TestAccDocDBClusterParameterGroup_basic(t *testing.T) { parameterGroupName := fmt.Sprintf("cluster-parameter-group-test-terraform-%d", sdkacctest.RandInt()) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, docdb.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClusterParameterGroupDestroy(ctx), @@ -61,7 +61,7 @@ func TestAccDocDBClusterParameterGroup_systemParameter(t *testing.T) { parameterGroupName := fmt.Sprintf("cluster-parameter-group-test-terraform-%d", sdkacctest.RandInt()) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, docdb.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClusterParameterGroupDestroy(ctx), @@ -94,7 +94,7 @@ func TestAccDocDBClusterParameterGroup_namePrefix(t *testing.T) { var v docdb.DBClusterParameterGroup resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, docdb.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClusterParameterGroupDestroy(ctx), @@ -121,7 +121,7 @@ func TestAccDocDBClusterParameterGroup_generatedName(t *testing.T) { var v docdb.DBClusterParameterGroup resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, docdb.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClusterParameterGroupDestroy(ctx), @@ -149,7 +149,7 @@ func TestAccDocDBClusterParameterGroup_description(t *testing.T) { parameterGroupName := fmt.Sprintf("cluster-parameter-group-test-terraform-%d", sdkacctest.RandInt()) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, docdb.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClusterParameterGroupDestroy(ctx), @@ -179,7 +179,7 @@ func TestAccDocDBClusterParameterGroup_disappears(t *testing.T) { parameterGroupName := fmt.Sprintf("cluster-parameter-group-test-terraform-%d", sdkacctest.RandInt()) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, docdb.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClusterParameterGroupDestroy(ctx), @@ -204,7 +204,7 @@ func TestAccDocDBClusterParameterGroup_parameter(t *testing.T) { parameterGroupName := fmt.Sprintf("cluster-parameter-group-test-tf-%d", sdkacctest.RandInt()) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, docdb.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClusterParameterGroupDestroy(ctx), @@ -252,7 +252,7 @@ func TestAccDocDBClusterParameterGroup_tags(t *testing.T) { parameterGroupName := fmt.Sprintf("cluster-parameter-group-test-tf-%d", sdkacctest.RandInt()) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, docdb.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClusterParameterGroupDestroy(ctx), diff --git a/internal/service/docdb/cluster_snapshot_test.go b/internal/service/docdb/cluster_snapshot_test.go index 3549d8595d74..f32a61140624 100644 --- a/internal/service/docdb/cluster_snapshot_test.go +++ b/internal/service/docdb/cluster_snapshot_test.go @@ -23,7 +23,7 @@ func TestAccDocDBClusterSnapshot_basic(t *testing.T) { resourceName := "aws_docdb_cluster_snapshot.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, docdb.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClusterSnapshotDestroy(ctx), diff --git a/internal/service/docdb/cluster_test.go b/internal/service/docdb/cluster_test.go index 21a3b580553e..660e634ead38 100644 --- a/internal/service/docdb/cluster_test.go +++ b/internal/service/docdb/cluster_test.go @@ -36,7 +36,7 @@ func TestAccDocDBCluster_basic(t *testing.T) { resourceName := "aws_docdb_cluster.default" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, docdb.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClusterDestroy(ctx), @@ -81,7 +81,7 @@ func TestAccDocDBCluster_namePrefix(t *testing.T) { var v docdb.DBCluster resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, docdb.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClusterDestroy(ctx), @@ -115,7 +115,7 @@ func TestAccDocDBCluster_generatedName(t *testing.T) { var v docdb.DBCluster resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, docdb.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClusterDestroy(ctx), @@ -153,7 +153,7 @@ func TestAccDocDBCluster_GlobalClusterIdentifier(t *testing.T) { resourceName := "aws_docdb_cluster.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckGlobalCluster(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckGlobalCluster(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, docdb.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClusterDestroy(ctx), @@ -193,7 +193,7 @@ func TestAccDocDBCluster_GlobalClusterIdentifier_Add(t *testing.T) { } resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckGlobalCluster(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckGlobalCluster(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, docdb.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClusterDestroy(ctx), @@ -234,7 +234,7 @@ func TestAccDocDBCluster_GlobalClusterIdentifier_Remove(t *testing.T) { resourceName := "aws_docdb_cluster.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckGlobalCluster(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckGlobalCluster(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, docdb.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClusterDestroy(ctx), @@ -279,7 +279,7 @@ func TestAccDocDBCluster_GlobalClusterIdentifier_Update(t *testing.T) { resourceName := "aws_docdb_cluster.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckGlobalCluster(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckGlobalCluster(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, docdb.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClusterDestroy(ctx), @@ -325,7 +325,7 @@ func TestAccDocDBCluster_GlobalClusterIdentifier_PrimarySecondaryClusters(t *tes resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckMultipleRegion(t, 2) testAccPreCheckGlobalCluster(ctx, t) }, @@ -350,7 +350,7 @@ func TestAccDocDBCluster_takeFinalSnapshot(t *testing.T) { rInt := sdkacctest.RandInt() resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, docdb.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClusterSnapshot(ctx, rInt), @@ -382,7 +382,7 @@ func TestAccDocDBCluster_takeFinalSnapshot(t *testing.T) { func TestAccDocDBCluster_missingUserNameCausesError(t *testing.T) { ctx := acctest.Context(t) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, docdb.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClusterDestroy(ctx), @@ -401,7 +401,7 @@ func TestAccDocDBCluster_updateTags(t *testing.T) { ri := sdkacctest.RandInt() resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, docdb.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClusterDestroy(ctx), @@ -444,7 +444,7 @@ func TestAccDocDBCluster_updateCloudWatchLogsExports(t *testing.T) { ri := sdkacctest.RandInt() resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, docdb.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClusterDestroy(ctx), @@ -484,7 +484,7 @@ func TestAccDocDBCluster_kmsKey(t *testing.T) { var v docdb.DBCluster resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, docdb.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClusterDestroy(ctx), @@ -517,7 +517,7 @@ func TestAccDocDBCluster_encrypted(t *testing.T) { var v docdb.DBCluster resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, docdb.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClusterDestroy(ctx), @@ -554,7 +554,7 @@ func TestAccDocDBCluster_backupsUpdate(t *testing.T) { ri := sdkacctest.RandInt() resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, docdb.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClusterDestroy(ctx), @@ -606,7 +606,7 @@ func TestAccDocDBCluster_port(t *testing.T) { resourceName := "aws_docdb_cluster.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, docdb.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClusterDestroy(ctx), @@ -648,7 +648,7 @@ func TestAccDocDBCluster_deleteProtection(t *testing.T) { resourceName := "aws_docdb_cluster.default" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, docdb.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClusterDestroy(ctx), diff --git a/internal/service/docdb/engine_version_data_source_test.go b/internal/service/docdb/engine_version_data_source_test.go index 4c42a8461b69..c32ac5e9bf09 100644 --- a/internal/service/docdb/engine_version_data_source_test.go +++ b/internal/service/docdb/engine_version_data_source_test.go @@ -20,7 +20,7 @@ func TestAccDocDBEngineVersionDataSource_basic(t *testing.T) { version := "3.6.0" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccEngineVersionPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccEngineVersionPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, docdb.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: nil, @@ -47,7 +47,7 @@ func TestAccDocDBEngineVersionDataSource_preferred(t *testing.T) { dataSourceName := "data.aws_docdb_engine_version.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccEngineVersionPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccEngineVersionPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, docdb.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: nil, @@ -67,7 +67,7 @@ func TestAccDocDBEngineVersionDataSource_defaultOnly(t *testing.T) { dataSourceName := "data.aws_docdb_engine_version.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccEngineVersionPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccEngineVersionPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, docdb.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: nil, diff --git a/internal/service/docdb/event_subscription_test.go b/internal/service/docdb/event_subscription_test.go index b02dbf8eb3d4..9299565a373e 100644 --- a/internal/service/docdb/event_subscription_test.go +++ b/internal/service/docdb/event_subscription_test.go @@ -23,7 +23,7 @@ func TestAccDocDBEventSubscription_basic(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, docdb.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckEventSubscriptionDestroy(ctx), @@ -59,7 +59,7 @@ func TestAccDocDBEventSubscription_nameGenerated(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, docdb.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckEventSubscriptionDestroy(ctx), @@ -88,7 +88,7 @@ func TestAccDocDBEventSubscription_disappears(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, docdb.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckEventSubscriptionDestroy(ctx), @@ -112,7 +112,7 @@ func TestAccDocDBEventSubscription_enabled(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, docdb.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckEventSubscriptionDestroy(ctx), @@ -154,7 +154,7 @@ func TestAccDocDBEventSubscription_eventCategories(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, docdb.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckEventSubscriptionDestroy(ctx), @@ -193,7 +193,7 @@ func TestAccDocDBEventSubscription_tags(t *testing.T) { resourceName := "aws_docdb_event_subscription.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, docdb.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckEventSubscriptionDestroy(ctx), diff --git a/internal/service/docdb/global_cluster_test.go b/internal/service/docdb/global_cluster_test.go index dbaaae6fea32..87db654a4432 100644 --- a/internal/service/docdb/global_cluster_test.go +++ b/internal/service/docdb/global_cluster_test.go @@ -26,7 +26,7 @@ func TestAccDocDBGlobalCluster_basic(t *testing.T) { resourceName := "aws_docdb_global_cluster.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckGlobalCluster(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckGlobalCluster(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, docdb.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckGlobalClusterDestroy(ctx), @@ -62,7 +62,7 @@ func TestAccDocDBGlobalCluster_disappears(t *testing.T) { resourceName := "aws_docdb_global_cluster.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckGlobalCluster(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckGlobalCluster(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, docdb.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckGlobalClusterDestroy(ctx), @@ -86,7 +86,7 @@ func TestAccDocDBGlobalCluster_DatabaseName(t *testing.T) { resourceName := "aws_docdb_global_cluster.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckGlobalCluster(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckGlobalCluster(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, docdb.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckGlobalClusterDestroy(ctx), @@ -122,7 +122,7 @@ func TestAccDocDBGlobalCluster_DeletionProtection(t *testing.T) { resourceName := "aws_docdb_global_cluster.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckGlobalCluster(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckGlobalCluster(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, docdb.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckGlobalClusterDestroy(ctx), @@ -158,7 +158,7 @@ func TestAccDocDBGlobalCluster_Engine(t *testing.T) { resourceName := "aws_docdb_global_cluster.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckGlobalCluster(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckGlobalCluster(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, docdb.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckGlobalClusterDestroy(ctx), @@ -186,7 +186,7 @@ func TestAccDocDBGlobalCluster_EngineVersion(t *testing.T) { resourceName := "aws_docdb_global_cluster.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckGlobalCluster(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckGlobalCluster(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, docdb.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckGlobalClusterDestroy(ctx), @@ -215,7 +215,7 @@ func TestAccDocDBGlobalCluster_SourceDBClusterIdentifier_basic(t *testing.T) { resourceName := "aws_docdb_global_cluster.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckGlobalCluster(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckGlobalCluster(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, docdb.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckGlobalClusterDestroy(ctx), @@ -245,7 +245,7 @@ func TestAccDocDBGlobalCluster_SourceDBClusterIdentifier_storageEncrypted(t *tes resourceName := "aws_docdb_global_cluster.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckGlobalCluster(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckGlobalCluster(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, docdb.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckGlobalClusterDestroy(ctx), @@ -274,7 +274,7 @@ func TestAccDocDBGlobalCluster_StorageEncrypted(t *testing.T) { resourceName := "aws_docdb_global_cluster.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckGlobalCluster(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckGlobalCluster(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, docdb.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckGlobalClusterDestroy(ctx), 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 dc3b1c00750b..3a4725e8f49e 100644 --- a/internal/service/docdb/orderable_db_instance_data_source_test.go +++ b/internal/service/docdb/orderable_db_instance_data_source_test.go @@ -21,7 +21,7 @@ func TestAccDocDBOrderableDBInstanceDataSource_basic(t *testing.T) { license := "na" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckOrderableDBInstance(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckOrderableDBInstance(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, docdb.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: nil, @@ -48,7 +48,7 @@ func TestAccDocDBOrderableDBInstanceDataSource_preferred(t *testing.T) { preferredOption := "db.r5.large" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckOrderableDBInstance(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckOrderableDBInstance(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, docdb.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: nil, diff --git a/internal/service/docdb/subnet_group_test.go b/internal/service/docdb/subnet_group_test.go index feca5d881ec1..d795534d3075 100644 --- a/internal/service/docdb/subnet_group_test.go +++ b/internal/service/docdb/subnet_group_test.go @@ -24,7 +24,7 @@ func TestAccDocDBSubnetGroup_basic(t *testing.T) { rName := fmt.Sprintf("tf-test-%d", sdkacctest.RandInt()) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, docdb.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSubnetGroupDestroy(ctx), @@ -55,7 +55,7 @@ func TestAccDocDBSubnetGroup_disappears(t *testing.T) { rName := fmt.Sprintf("tf-test-%d", sdkacctest.RandInt()) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, docdb.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSubnetGroupDestroy(ctx), @@ -77,7 +77,7 @@ func TestAccDocDBSubnetGroup_namePrefix(t *testing.T) { var v docdb.DBSubnetGroup resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, docdb.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSubnetGroupDestroy(ctx), @@ -105,7 +105,7 @@ func TestAccDocDBSubnetGroup_generatedName(t *testing.T) { var v docdb.DBSubnetGroup resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, docdb.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSubnetGroupDestroy(ctx), @@ -132,7 +132,7 @@ func TestAccDocDBSubnetGroup_updateDescription(t *testing.T) { rName := fmt.Sprintf("tf-test-%d", sdkacctest.RandInt()) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, docdb.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSubnetGroupDestroy(ctx), From 41adfe5f89feae5a12f5d7570f59ea1986d59746 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Fri, 24 Feb 2023 16:36:49 -0500 Subject: [PATCH 137/763] Add 'Context' argument to 'acctest.PreCheck' for ds. --- .../service/ds/conditional_forwarder_test.go | 2 +- .../service/ds/directory_data_source_test.go | 8 ++++---- internal/service/ds/directory_test.go | 16 ++++++++-------- internal/service/ds/log_subscription_test.go | 2 +- internal/service/ds/radius_settings_test.go | 4 ++-- internal/service/ds/region_test.go | 8 ++++---- .../service/ds/shared_directory_accepter_test.go | 2 +- internal/service/ds/shared_directory_test.go | 2 +- 8 files changed, 22 insertions(+), 22 deletions(-) diff --git a/internal/service/ds/conditional_forwarder_test.go b/internal/service/ds/conditional_forwarder_test.go index 59be6d0d7700..9db04f7700cb 100644 --- a/internal/service/ds/conditional_forwarder_test.go +++ b/internal/service/ds/conditional_forwarder_test.go @@ -24,7 +24,7 @@ func TestAccDSConditionalForwarder_Condition_basic(t *testing.T) { ip1, ip2, ip3 := "8.8.8.8", "1.1.1.1", "8.8.4.4" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckDirectoryService(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckDirectoryService(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, directoryservice.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckConditionalForwarderDestroy(ctx), diff --git a/internal/service/ds/directory_data_source_test.go b/internal/service/ds/directory_data_source_test.go index fe6cdd6ace0a..9bf5eca4ace1 100644 --- a/internal/service/ds/directory_data_source_test.go +++ b/internal/service/ds/directory_data_source_test.go @@ -19,7 +19,7 @@ func TestAccDSDirectoryDataSource_simpleAD(t *testing.T) { domainName := acctest.RandomDomainName() resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckDirectoryServiceSimpleDirectory(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckDirectoryServiceSimpleDirectory(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, directoryservice.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ @@ -59,7 +59,7 @@ func TestAccDSDirectoryDataSource_microsoftAD(t *testing.T) { domainName := acctest.RandomDomainName() resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, directoryservice.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ @@ -100,7 +100,7 @@ func TestAccDSDirectoryDataSource_connector(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckDirectoryService(ctx, t) acctest.PreCheckDirectoryServiceSimpleDirectory(ctx, t) }, @@ -147,7 +147,7 @@ func TestAccDSDirectoryDataSource_sharedMicrosoftAD(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckDirectoryService(ctx, t) acctest.PreCheckAlternateAccount(t) }, diff --git a/internal/service/ds/directory_test.go b/internal/service/ds/directory_test.go index 3ea97732dda3..071b021733b4 100644 --- a/internal/service/ds/directory_test.go +++ b/internal/service/ds/directory_test.go @@ -24,7 +24,7 @@ func TestAccDSDirectory_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckDirectoryService(ctx, t) acctest.PreCheckDirectoryServiceSimpleDirectory(ctx, t) }, @@ -76,7 +76,7 @@ func TestAccDSDirectory_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckDirectoryService(ctx, t) acctest.PreCheckDirectoryServiceSimpleDirectory(ctx, t) }, @@ -105,7 +105,7 @@ func TestAccDSDirectory_tags(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckDirectoryService(ctx, t) acctest.PreCheckDirectoryServiceSimpleDirectory(ctx, t) }, @@ -158,7 +158,7 @@ func TestAccDSDirectory_microsoft(t *testing.T) { domainName := acctest.RandomDomainName() resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckDirectoryService(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckDirectoryService(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, directoryservice.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDirectoryDestroy(ctx), @@ -206,7 +206,7 @@ func TestAccDSDirectory_microsoftStandard(t *testing.T) { domainName := acctest.RandomDomainName() resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckDirectoryService(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckDirectoryService(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, directoryservice.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDirectoryDestroy(ctx), @@ -255,7 +255,7 @@ func TestAccDSDirectory_connector(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckDirectoryService(ctx, t) acctest.PreCheckDirectoryServiceSimpleDirectory(ctx, t) }, @@ -310,7 +310,7 @@ func TestAccDSDirectory_withAliasAndSSO(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckDirectoryService(ctx, t) acctest.PreCheckDirectoryServiceSimpleDirectory(ctx, t) }, @@ -375,7 +375,7 @@ func TestAccDSDirectory_desiredNumberOfDomainControllers(t *testing.T) { domainName := acctest.RandomDomainName() resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckDirectoryService(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckDirectoryService(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, directoryservice.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDirectoryDestroy(ctx), diff --git a/internal/service/ds/log_subscription_test.go b/internal/service/ds/log_subscription_test.go index d9e38c3cbeca..ce36e17e8b59 100644 --- a/internal/service/ds/log_subscription_test.go +++ b/internal/service/ds/log_subscription_test.go @@ -23,7 +23,7 @@ func TestAccDSLogSubscription_basic(t *testing.T) { domainName := acctest.RandomDomainName() resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckDirectoryService(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckDirectoryService(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, directoryservice.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckLogSubscriptionDestroy(ctx), diff --git a/internal/service/ds/radius_settings_test.go b/internal/service/ds/radius_settings_test.go index 1e36b3a16121..a3c83ef9256c 100644 --- a/internal/service/ds/radius_settings_test.go +++ b/internal/service/ds/radius_settings_test.go @@ -31,7 +31,7 @@ func TestAccDSRadiusSettings_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckDirectoryService(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, directoryservice.EndpointsID), @@ -79,7 +79,7 @@ func TestAccDSRadiusSettings_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckDirectoryService(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, directoryservice.EndpointsID), diff --git a/internal/service/ds/region_test.go b/internal/service/ds/region_test.go index f1fe83964501..5d784d1bd738 100644 --- a/internal/service/ds/region_test.go +++ b/internal/service/ds/region_test.go @@ -24,7 +24,7 @@ func TestAccDSRegion_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckDirectoryService(ctx, t) acctest.PreCheckMultipleRegion(t, 2) }, @@ -59,7 +59,7 @@ func TestAccDSRegion_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckDirectoryService(ctx, t) acctest.PreCheckMultipleRegion(t, 2) }, @@ -88,7 +88,7 @@ func TestAccDSRegion_tags(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckDirectoryService(ctx, t) acctest.PreCheckMultipleRegion(t, 2) }, @@ -139,7 +139,7 @@ func TestAccDSRegion_desiredNumberOfDomainControllers(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckDirectoryService(ctx, t) acctest.PreCheckMultipleRegion(t, 2) }, diff --git a/internal/service/ds/shared_directory_accepter_test.go b/internal/service/ds/shared_directory_accepter_test.go index 4406033779ae..07fd1f3d1dc2 100644 --- a/internal/service/ds/shared_directory_accepter_test.go +++ b/internal/service/ds/shared_directory_accepter_test.go @@ -24,7 +24,7 @@ func TestAccDSSharedDirectoryAccepter_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckAlternateAccount(t) }, ErrorCheck: acctest.ErrorCheck(t, directoryservice.EndpointsID), diff --git a/internal/service/ds/shared_directory_test.go b/internal/service/ds/shared_directory_test.go index 3151100181d8..5348f2e4e5f7 100644 --- a/internal/service/ds/shared_directory_test.go +++ b/internal/service/ds/shared_directory_test.go @@ -24,7 +24,7 @@ func TestAccDSSharedDirectory_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckAlternateAccount(t) }, ErrorCheck: acctest.ErrorCheck(t, directoryservice.EndpointsID), From 4b7ea5b160e614cb13d490b4aab7ca188c3d9829 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Fri, 24 Feb 2023 16:36:50 -0500 Subject: [PATCH 138/763] Add 'Context' argument to 'acctest.PreCheck' for dynamodb. --- .../dynamodb/contributor_insights_test.go | 4 +- .../service/dynamodb/global_table_test.go | 4 +- .../kinesis_streaming_destination_test.go | 6 +- .../dynamodb/table_data_source_test.go | 2 +- .../dynamodb/table_item_data_source_test.go | 6 +- internal/service/dynamodb/table_item_test.go | 18 ++-- .../service/dynamodb/table_replica_test.go | 16 ++-- internal/service/dynamodb/table_test.go | 82 +++++++++---------- internal/service/dynamodb/tag_test.go | 8 +- 9 files changed, 73 insertions(+), 73 deletions(-) diff --git a/internal/service/dynamodb/contributor_insights_test.go b/internal/service/dynamodb/contributor_insights_test.go index fcf852303b10..00f726bd31fe 100644 --- a/internal/service/dynamodb/contributor_insights_test.go +++ b/internal/service/dynamodb/contributor_insights_test.go @@ -25,7 +25,7 @@ func TestAccDynamoDBContributorInsights_basic(t *testing.T) { resourceName := "aws_dynamodb_contributor_insights.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, dynamodb.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckContributorInsightsDestroy(ctx), @@ -60,7 +60,7 @@ func TestAccDynamoDBContributorInsights_disappears(t *testing.T) { resourceName := "aws_dynamodb_contributor_insights.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, dynamodb.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckContributorInsightsDestroy(ctx), diff --git a/internal/service/dynamodb/global_table_test.go b/internal/service/dynamodb/global_table_test.go index 17c232928898..9a2de4218063 100644 --- a/internal/service/dynamodb/global_table_test.go +++ b/internal/service/dynamodb/global_table_test.go @@ -26,7 +26,7 @@ func TestAccDynamoDBGlobalTable_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) testAccPreCheckGlobalTable(ctx, t) testAccGlobalTablePreCheck(t) }, @@ -71,7 +71,7 @@ func TestAccDynamoDBGlobalTable_multipleRegions(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) testAccPreCheckGlobalTable(ctx, t) acctest.PreCheckMultipleRegion(t, 2) testAccGlobalTablePreCheck(t) diff --git a/internal/service/dynamodb/kinesis_streaming_destination_test.go b/internal/service/dynamodb/kinesis_streaming_destination_test.go index 1a5972475a0b..4f4033cfa4ae 100644 --- a/internal/service/dynamodb/kinesis_streaming_destination_test.go +++ b/internal/service/dynamodb/kinesis_streaming_destination_test.go @@ -22,7 +22,7 @@ func TestAccDynamoDBKinesisStreamingDestination_basic(t *testing.T) { resourceName := "aws_dynamodb_kinesis_streaming_destination.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, dynamodb.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckKinesisStreamingDestinationDestroy(ctx), @@ -50,7 +50,7 @@ func TestAccDynamoDBKinesisStreamingDestination_disappears(t *testing.T) { resourceName := "aws_dynamodb_kinesis_streaming_destination.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, dynamodb.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckKinesisStreamingDestinationDestroy(ctx), @@ -75,7 +75,7 @@ func TestAccDynamoDBKinesisStreamingDestination_Disappears_dynamoDBTable(t *test tableResourceName := "aws_dynamodb_table.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, dynamodb.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckKinesisStreamingDestinationDestroy(ctx), diff --git a/internal/service/dynamodb/table_data_source_test.go b/internal/service/dynamodb/table_data_source_test.go index 1c4e8d6f0103..ce9adf059557 100644 --- a/internal/service/dynamodb/table_data_source_test.go +++ b/internal/service/dynamodb/table_data_source_test.go @@ -17,7 +17,7 @@ func TestAccDynamoDBTableDataSource_basic(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, dynamodb.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ diff --git a/internal/service/dynamodb/table_item_data_source_test.go b/internal/service/dynamodb/table_item_data_source_test.go index 90f3b2f4b663..e20754d784ef 100644 --- a/internal/service/dynamodb/table_item_data_source_test.go +++ b/internal/service/dynamodb/table_item_data_source_test.go @@ -26,7 +26,7 @@ func TestAccDynamoDBTableItemDataSource_basic(t *testing.T) { }` resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(dynamodb.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, dynamodb.EndpointsID), @@ -66,7 +66,7 @@ func TestAccDynamoDBTableItemDataSource_projectionExpression(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(dynamodb.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, dynamodb.EndpointsID), @@ -103,7 +103,7 @@ func TestAccDynamoDBTableItemDataSource_expressionAttributeNames(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(dynamodb.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, dynamodb.EndpointsID), diff --git a/internal/service/dynamodb/table_item_test.go b/internal/service/dynamodb/table_item_test.go index 2dd78c801997..6adf55db9e9b 100644 --- a/internal/service/dynamodb/table_item_test.go +++ b/internal/service/dynamodb/table_item_test.go @@ -32,7 +32,7 @@ func TestAccDynamoDBTableItem_basic(t *testing.T) { }` resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, dynamodb.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTableItemDestroy(ctx), @@ -68,7 +68,7 @@ func TestAccDynamoDBTableItem_rangeKey(t *testing.T) { }` resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, dynamodb.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTableItemDestroy(ctx), @@ -113,7 +113,7 @@ func TestAccDynamoDBTableItem_withMultipleItems(t *testing.T) { }` resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, dynamodb.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTableItemDestroy(ctx), @@ -154,7 +154,7 @@ func TestAccDynamoDBTableItem_withDuplicateItemsSameRangeKey(t *testing.T) { }` resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, dynamodb.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTableItemDestroy(ctx), @@ -191,7 +191,7 @@ func TestAccDynamoDBTableItem_withDuplicateItemsDifferentRangeKey(t *testing.T) }` resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, dynamodb.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTableItemDestroy(ctx), @@ -235,7 +235,7 @@ func TestAccDynamoDBTableItem_wonkyItems(t *testing.T) { }` resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, dynamodb.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTableItemDestroy(ctx), @@ -278,7 +278,7 @@ func TestAccDynamoDBTableItem_update(t *testing.T) { }` resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, dynamodb.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTableItemDestroy(ctx), @@ -327,7 +327,7 @@ func TestAccDynamoDBTableItem_updateWithRangeKey(t *testing.T) { }` resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, dynamodb.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTableItemDestroy(ctx), @@ -374,7 +374,7 @@ func TestAccDynamoDBTableItem_disappears(t *testing.T) { }` resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, dynamodb.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTableItemDestroy(ctx), diff --git a/internal/service/dynamodb/table_replica_test.go b/internal/service/dynamodb/table_replica_test.go index 94ea7dbccf48..cbcfea94fa42 100644 --- a/internal/service/dynamodb/table_replica_test.go +++ b/internal/service/dynamodb/table_replica_test.go @@ -30,7 +30,7 @@ func TestAccDynamoDBTableReplica_basic(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckMultipleRegion(t, 2) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckMultipleRegion(t, 2) }, ErrorCheck: acctest.ErrorCheck(t, dynamodb.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5FactoriesMultipleRegions(ctx, t, 3), CheckDestroy: testAccCheckTableReplicaDestroy(ctx), @@ -61,7 +61,7 @@ func TestAccDynamoDBTableReplica_disappears(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckMultipleRegion(t, 2) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckMultipleRegion(t, 2) }, ErrorCheck: acctest.ErrorCheck(t, dynamodb.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5FactoriesMultipleRegions(ctx, t, 3), CheckDestroy: testAccCheckTableReplicaDestroy(ctx), @@ -88,7 +88,7 @@ func TestAccDynamoDBTableReplica_pitr(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckMultipleRegion(t, 2) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckMultipleRegion(t, 2) }, ErrorCheck: acctest.ErrorCheck(t, dynamodb.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5FactoriesMultipleRegions(ctx, t, 3), CheckDestroy: testAccCheckTableReplicaDestroy(ctx), @@ -119,7 +119,7 @@ func TestAccDynamoDBTableReplica_pitrKMS(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckMultipleRegion(t, 2) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckMultipleRegion(t, 2) }, ErrorCheck: acctest.ErrorCheck(t, dynamodb.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5FactoriesMultipleRegions(ctx, t, 3), CheckDestroy: testAccCheckTableReplicaDestroy(ctx), @@ -167,7 +167,7 @@ func TestAccDynamoDBTableReplica_pitrDefault(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckMultipleRegion(t, 2) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckMultipleRegion(t, 2) }, ErrorCheck: acctest.ErrorCheck(t, dynamodb.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5FactoriesMultipleRegions(ctx, t, 3), CheckDestroy: testAccCheckTableReplicaDestroy(ctx), @@ -215,7 +215,7 @@ func TestAccDynamoDBTableReplica_tags(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckMultipleRegion(t, 2) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckMultipleRegion(t, 2) }, ErrorCheck: acctest.ErrorCheck(t, dynamodb.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5FactoriesMultipleRegions(ctx, t, 3), CheckDestroy: testAccCheckTableReplicaDestroy(ctx), @@ -277,7 +277,7 @@ func TestAccDynamoDBTableReplica_tableClass(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckMultipleRegion(t, 2) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckMultipleRegion(t, 2) }, ErrorCheck: acctest.ErrorCheck(t, dynamodb.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5FactoriesMultipleRegions(ctx, t, 3), CheckDestroy: testAccCheckTableReplicaDestroy(ctx), @@ -315,7 +315,7 @@ func TestAccDynamoDBTableReplica_keys(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckMultipleRegion(t, 2) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckMultipleRegion(t, 2) }, ErrorCheck: acctest.ErrorCheck(t, dynamodb.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5FactoriesMultipleRegions(ctx, t, 2), CheckDestroy: testAccCheckTableReplicaDestroy(ctx), diff --git a/internal/service/dynamodb/table_test.go b/internal/service/dynamodb/table_test.go index 5c096127f434..9640211498dd 100644 --- a/internal/service/dynamodb/table_test.go +++ b/internal/service/dynamodb/table_test.go @@ -331,7 +331,7 @@ func TestAccDynamoDBTable_basic(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, dynamodb.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTableDestroy(ctx), @@ -369,7 +369,7 @@ func TestAccDynamoDBTable_disappears(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, dynamodb.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTableDestroy(ctx), @@ -393,7 +393,7 @@ func TestAccDynamoDBTable_Disappears_payPerRequestWithGSI(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, dynamodb.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTableDestroy(ctx), @@ -432,7 +432,7 @@ func TestAccDynamoDBTable_extended(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, dynamodb.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTableDestroy(ctx), @@ -507,7 +507,7 @@ func TestAccDynamoDBTable_enablePITR(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, dynamodb.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTableDestroy(ctx), @@ -543,7 +543,7 @@ func TestAccDynamoDBTable_BillingMode_payPerRequestToProvisioned(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, dynamodb.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTableDestroy(ctx), @@ -582,7 +582,7 @@ func TestAccDynamoDBTable_BillingMode_payPerRequestToProvisionedIgnoreChanges(t rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, dynamodb.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTableDestroy(ctx), @@ -625,7 +625,7 @@ func TestAccDynamoDBTable_BillingMode_provisionedToPayPerRequest(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, dynamodb.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTableDestroy(ctx), @@ -668,7 +668,7 @@ func TestAccDynamoDBTable_BillingMode_provisionedToPayPerRequestIgnoreChanges(t rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, dynamodb.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTableDestroy(ctx), @@ -707,7 +707,7 @@ func TestAccDynamoDBTable_BillingModeGSI_payPerRequestToProvisioned(t *testing.T rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, dynamodb.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTableDestroy(ctx), @@ -744,7 +744,7 @@ func TestAccDynamoDBTable_BillingModeGSI_provisionedToPayPerRequest(t *testing.T rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, dynamodb.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTableDestroy(ctx), @@ -779,7 +779,7 @@ func TestAccDynamoDBTable_streamSpecification(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, dynamodb.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTableDestroy(ctx), @@ -820,7 +820,7 @@ func TestAccDynamoDBTable_streamSpecificationDiffs(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, dynamodb.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTableDestroy(ctx), @@ -902,7 +902,7 @@ func TestAccDynamoDBTable_streamSpecificationDiffs(t *testing.T) { func TestAccDynamoDBTable_streamSpecificationValidation(t *testing.T) { ctx := acctest.Context(t) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, dynamodb.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTableDestroy(ctx), @@ -922,7 +922,7 @@ func TestAccDynamoDBTable_tags(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, dynamodb.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTableDestroy(ctx), @@ -952,7 +952,7 @@ func TestAccDynamoDBTable_gsiUpdateCapacity(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, dynamodb.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTableDestroy(ctx), @@ -1021,7 +1021,7 @@ func TestAccDynamoDBTable_gsiUpdateOtherAttributes(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, dynamodb.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTableDestroy(ctx), @@ -1112,7 +1112,7 @@ func TestAccDynamoDBTable_lsiNonKeyAttributes(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, dynamodb.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTableDestroy(ctx), @@ -1152,7 +1152,7 @@ func TestAccDynamoDBTable_gsiUpdateNonKeyAttributes(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, dynamodb.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTableDestroy(ctx), @@ -1246,7 +1246,7 @@ func TestAccDynamoDBTable_GsiUpdateNonKeyAttributes_emptyPlan(t *testing.T) { reorderedAttributes := fmt.Sprintf("%q, %q", "RandomAttribute", "AnotherAttribute") resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, dynamodb.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTableDestroy(ctx), @@ -1291,7 +1291,7 @@ func TestAccDynamoDBTable_TTL_enabled(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, dynamodb.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTableDestroy(ctx), @@ -1322,7 +1322,7 @@ func TestAccDynamoDBTable_TTL_disabled(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, dynamodb.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTableDestroy(ctx), @@ -1363,7 +1363,7 @@ func TestAccDynamoDBTable_attributeUpdate(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, dynamodb.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTableDestroy(ctx), @@ -1408,7 +1408,7 @@ func TestAccDynamoDBTable_lsiUpdate(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, dynamodb.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTableDestroy(ctx), @@ -1439,7 +1439,7 @@ func TestAccDynamoDBTable_attributeUpdateValidation(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, dynamodb.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTableDestroy(ctx), @@ -1472,7 +1472,7 @@ func TestAccDynamoDBTable_encryption(t *testing.T) { kmsKeyResourceName := "aws_kms_key.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, dynamodb.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTableDestroy(ctx), @@ -1525,7 +1525,7 @@ func TestAccDynamoDBTable_Replica_multiple(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckMultipleRegion(t, 3) }, ErrorCheck: acctest.ErrorCheck(t, dynamodb.EndpointsID), @@ -1575,7 +1575,7 @@ func TestAccDynamoDBTable_Replica_single(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckMultipleRegion(t, 2) }, ErrorCheck: acctest.ErrorCheck(t, dynamodb.EndpointsID), @@ -1633,7 +1633,7 @@ func TestAccDynamoDBTable_Replica_singleStreamSpecification(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckMultipleRegion(t, 2) }, ErrorCheck: acctest.ErrorCheck(t, dynamodb.EndpointsID), @@ -1669,7 +1669,7 @@ func TestAccDynamoDBTable_Replica_singleDefaultKeyEncrypted(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckMultipleRegion(t, 2) }, ErrorCheck: acctest.ErrorCheck(t, dynamodb.EndpointsID), @@ -1714,7 +1714,7 @@ func TestAccDynamoDBTable_Replica_singleCMK(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckMultipleRegion(t, 2) }, ErrorCheck: acctest.ErrorCheck(t, dynamodb.EndpointsID), @@ -1750,7 +1750,7 @@ func TestAccDynamoDBTable_Replica_singleAddCMK(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckMultipleRegion(t, 2) }, ErrorCheck: acctest.ErrorCheck(t, dynamodb.EndpointsID), @@ -1809,7 +1809,7 @@ func TestAccDynamoDBTable_Replica_pitr(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckMultipleRegion(t, 2) }, ErrorCheck: acctest.ErrorCheck(t, dynamodb.EndpointsID), @@ -1872,7 +1872,7 @@ func TestAccDynamoDBTable_Replica_pitrKMS(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckMultipleRegion(t, 2) }, ErrorCheck: acctest.ErrorCheck(t, dynamodb.EndpointsID), @@ -1998,7 +1998,7 @@ func TestAccDynamoDBTable_Replica_tagsOneOfTwo(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckMultipleRegion(t, 2) }, ErrorCheck: acctest.ErrorCheck(t, dynamodb.EndpointsID), @@ -2038,7 +2038,7 @@ func TestAccDynamoDBTable_Replica_tagsTwoOfTwo(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckMultipleRegion(t, 2) }, ErrorCheck: acctest.ErrorCheck(t, dynamodb.EndpointsID), @@ -2077,7 +2077,7 @@ func TestAccDynamoDBTable_Replica_tagsNext(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckMultipleRegion(t, 2) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckMultipleRegion(t, 2) }, ErrorCheck: acctest.ErrorCheck(t, dynamodb.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5FactoriesMultipleRegions(ctx, t, 3), CheckDestroy: testAccCheckTableDestroy(ctx), @@ -2172,7 +2172,7 @@ func TestAccDynamoDBTable_Replica_tagsUpdate(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckMultipleRegion(t, 2) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckMultipleRegion(t, 2) }, ErrorCheck: acctest.ErrorCheck(t, dynamodb.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5FactoriesMultipleRegions(ctx, t, 3), CheckDestroy: testAccCheckTableDestroy(ctx), @@ -2263,7 +2263,7 @@ func TestAccDynamoDBTable_tableClassInfrequentAccess(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, dynamodb.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTableDestroy(ctx), @@ -2308,7 +2308,7 @@ func TestAccDynamoDBTable_backupEncryption(t *testing.T) { kmsKeyResourceName := "aws_kms_key.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, dynamodb.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTableDestroy(ctx), @@ -2348,7 +2348,7 @@ func TestAccDynamoDBTable_backup_overrideEncryption(t *testing.T) { kmsKeyResourceName := "aws_kms_key.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, dynamodb.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTableDestroy(ctx), diff --git a/internal/service/dynamodb/tag_test.go b/internal/service/dynamodb/tag_test.go index 27dbf14a07c6..969c8ab627ef 100644 --- a/internal/service/dynamodb/tag_test.go +++ b/internal/service/dynamodb/tag_test.go @@ -17,7 +17,7 @@ func TestAccDynamoDBTag_basic(t *testing.T) { resourceName := "aws_dynamodb_tag.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, dynamodb.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTagDestroy(ctx), @@ -45,7 +45,7 @@ func TestAccDynamoDBTag_disappears(t *testing.T) { resourceName := "aws_dynamodb_tag.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, dynamodb.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTagDestroy(ctx), @@ -70,7 +70,7 @@ func TestAccDynamoDBTag_ResourceARN_tableReplica(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckMultipleRegion(t, 2) }, ErrorCheck: acctest.ErrorCheck(t, dynamodb.EndpointsID), @@ -99,7 +99,7 @@ func TestAccDynamoDBTag_value(t *testing.T) { resourceName := "aws_dynamodb_tag.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, dynamodb.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTagDestroy(ctx), From fa5ed89875433b14b907bb55c1ab136e5d64301c Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Fri, 24 Feb 2023 16:36:51 -0500 Subject: [PATCH 139/763] Add 'Context' argument to 'acctest.PreCheck' for ec2. --- .../ebs_default_kms_key_data_source_test.go | 2 +- .../service/ec2/ebs_default_kms_key_test.go | 2 +- ..._encryption_by_default_data_source_test.go | 2 +- .../ec2/ebs_encryption_by_default_test.go | 2 +- .../service/ec2/ebs_snapshot_copy_test.go | 14 +- ..._snapshot_create_volume_permission_test.go | 6 +- .../ec2/ebs_snapshot_data_source_test.go | 6 +- .../ec2/ebs_snapshot_ids_data_source_test.go | 6 +- .../service/ec2/ebs_snapshot_import_test.go | 10 +- internal/service/ec2/ebs_snapshot_test.go | 14 +- .../service/ec2/ebs_volume_attachment_test.go | 12 +- .../ec2/ebs_volume_data_source_test.go | 4 +- internal/service/ec2/ebs_volume_test.go | 48 ++-- .../ec2/ebs_volumes_data_source_test.go | 2 +- internal/service/ec2/ec2_ami_copy_test.go | 10 +- .../service/ec2/ec2_ami_data_source_test.go | 10 +- .../service/ec2/ec2_ami_from_instance_test.go | 6 +- .../ec2/ec2_ami_ids_data_source_test.go | 4 +- .../ec2/ec2_ami_launch_permission_test.go | 12 +- internal/service/ec2/ec2_ami_test.go | 22 +- .../ec2_availability_zone_data_source_test.go | 12 +- .../ec2/ec2_availability_zone_group_test.go | 2 +- ...ec2_availability_zones_data_source_test.go | 12 +- .../ec2/ec2_capacity_reservation_test.go | 22 +- .../service/ec2/ec2_eip_association_test.go | 10 +- .../service/ec2/ec2_eip_data_source_test.go | 16 +- internal/service/ec2/ec2_eip_test.go | 38 +-- .../service/ec2/ec2_eips_data_source_test.go | 2 +- internal/service/ec2/ec2_fleet_test.go | 100 +++---- .../service/ec2/ec2_host_data_source_test.go | 4 +- internal/service/ec2/ec2_host_test.go | 10 +- .../ec2/ec2_instance_data_source_test.go | 56 ++-- .../service/ec2/ec2_instance_state_test.go | 6 +- internal/service/ec2/ec2_instance_test.go | 250 +++++++++--------- .../ec2/ec2_instance_type_data_source_test.go | 8 +- ...instance_type_offering_data_source_test.go | 6 +- ...nstance_type_offerings_data_source_test.go | 4 +- .../ec2_instance_types_data_source_test.go | 4 +- .../ec2/ec2_instances_data_source_test.go | 10 +- .../ec2/ec2_key_pair_data_source_test.go | 4 +- internal/service/ec2/ec2_key_pair_test.go | 10 +- .../ec2_launch_template_data_source_test.go | 8 +- .../service/ec2/ec2_launch_template_test.go | 128 ++++----- .../service/ec2/ec2_placement_group_test.go | 10 +- ..._serial_console_access_data_source_test.go | 2 +- .../ec2/ec2_serial_console_access_test.go | 2 +- .../ec2_spot_datafeed_subscription_test.go | 4 +- .../ec2/ec2_spot_fleet_request_test.go | 86 +++--- .../ec2/ec2_spot_instance_request_test.go | 30 +-- .../ec2/ec2_spot_price_data_source_test.go | 4 +- internal/service/ec2/ipam_byoip_test.go | 2 +- .../ipam_organization_admin_account_test.go | 2 +- .../ec2/ipam_pool_cidr_allocation_test.go | 12 +- internal/service/ec2/ipam_pool_cidr_test.go | 8 +- .../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 | 10 +- .../ec2/ipam_pools_data_source_test.go | 4 +- ...ipam_preview_next_cidr_data_source_test.go | 6 +- .../ec2/ipam_preview_next_cidr_test.go | 6 +- ...pam_resource_discovery_association_test.go | 6 +- .../ec2/ipam_resource_discovery_test.go | 8 +- internal/service/ec2/ipam_scope_test.go | 6 +- internal/service/ec2/ipam_test.go | 12 +- .../outposts_coip_pool_data_source_test.go | 4 +- .../outposts_coip_pools_data_source_test.go | 4 +- ...outposts_local_gateway_data_source_test.go | 2 +- ...al_gateway_route_table_data_source_test.go | 8 +- ...ateway_route_table_vpc_association_test.go | 6 +- ...l_gateway_route_tables_data_source_test.go | 4 +- .../ec2/outposts_local_gateway_route_test.go | 4 +- ...eway_virtual_interface_data_source_test.go | 6 +- ...irtual_interface_group_data_source_test.go | 6 +- ...rtual_interface_groups_data_source_test.go | 6 +- ...utposts_local_gateways_data_source_test.go | 2 +- internal/service/ec2/tag_test.go | 6 +- ...nsitgateway_attachment_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 | 12 +- .../ec2/transitgateway_connect_test.go | 12 +- .../ec2/transitgateway_data_source_test.go | 4 +- ..._dx_gateway_attachment_data_source_test.go | 4 +- ...teway_multicast_domain_association_test.go | 8 +- ...teway_multicast_domain_data_source_test.go | 4 +- .../transitgateway_multicast_domain_test.go | 8 +- ...nsitgateway_multicast_group_member_test.go | 8 +- ...nsitgateway_multicast_group_source_test.go | 6 +- ...ateway_peering_attachment_accepter_test.go | 6 +- ...way_peering_attachment_data_source_test.go | 10 +- .../transitgateway_peering_attachment_test.go | 8 +- ...itgateway_policy_table_association_test.go | 4 +- .../ec2/transitgateway_policy_table_test.go | 8 +- ...ansitgateway_prefix_list_reference_test.go | 8 +- ...sitgateway_route_table_association_test.go | 4 +- ...sitgateway_route_table_data_source_test.go | 4 +- ...sitgateway_route_table_propagation_test.go | 4 +- .../ec2/transitgateway_route_table_test.go | 8 +- ...itgateway_route_tables_data_source_test.go | 8 +- .../service/ec2/transitgateway_route_test.go | 10 +- internal/service/ec2/transitgateway_test.go | 24 +- ...sitgateway_vpc_attachment_accepter_test.go | 6 +- ...gateway_vpc_attachment_data_source_test.go | 4 +- .../ec2/transitgateway_vpc_attachment_test.go | 22 +- ...ateway_vpc_attachments_data_source_test.go | 2 +- ...gateway_vpn_attachment_data_source_test.go | 4 +- internal/service/ec2/vpc_data_source_test.go | 4 +- .../ec2/vpc_default_network_acl_test.go | 14 +- .../ec2/vpc_default_route_table_test.go | 22 +- .../ec2/vpc_default_security_group_test.go | 4 +- .../service/ec2/vpc_default_subnet_test.go | 12 +- .../ec2/vpc_default_vpc_dhcp_options_test.go | 6 +- internal/service/ec2/vpc_default_vpc_test.go | 12 +- .../ec2/vpc_dhcp_options_association_test.go | 10 +- .../ec2/vpc_dhcp_options_data_source_test.go | 4 +- internal/service/ec2/vpc_dhcp_options_test.go | 8 +- .../vpc_egress_only_internet_gateway_test.go | 4 +- .../vpc_endpoint_connection_accepter_test.go | 2 +- ...c_endpoint_connection_notification_test.go | 2 +- .../ec2/vpc_endpoint_data_source_test.go | 12 +- .../service/ec2/vpc_endpoint_policy_test.go | 6 +- ...c_endpoint_route_table_association_test.go | 4 +- ...ndpoint_security_group_association_test.go | 8 +- ...endpoint_service_allowed_principal_test.go | 2 +- .../vpc_endpoint_service_data_source_test.go | 14 +- .../service/ec2/vpc_endpoint_service_test.go | 16 +- .../vpc_endpoint_subnet_association_test.go | 6 +- internal/service/ec2/vpc_endpoint_test.go | 24 +- internal/service/ec2/vpc_flow_log_test.go | 34 +-- .../vpc_internet_gateway_attachment_test.go | 4 +- .../vpc_internet_gateway_data_source_test.go | 2 +- .../service/ec2/vpc_internet_gateway_test.go | 8 +- .../vpc_ipv4_cidr_block_association_test.go | 8 +- .../vpc_main_route_table_association_test.go | 2 +- ...pc_managed_prefix_list_data_source_test.go | 6 +- .../ec2/vpc_managed_prefix_list_entry_test.go | 14 +- .../ec2/vpc_managed_prefix_list_test.go | 16 +- ...c_managed_prefix_lists_data_source_test.go | 6 +- .../ec2/vpc_nat_gateway_data_source_test.go | 2 +- internal/service/ec2/vpc_nat_gateway_test.go | 10 +- .../ec2/vpc_nat_gateways_data_source_test.go | 2 +- .../ec2/vpc_network_acl_association_test.go | 12 +- .../service/ec2/vpc_network_acl_rule_test.go | 18 +- internal/service/ec2/vpc_network_acl_test.go | 34 +-- .../ec2/vpc_network_acls_data_source_test.go | 10 +- ...work_insights_analysis_data_source_test.go | 2 +- .../ec2/vpc_network_insights_analysis_test.go | 10 +- ..._network_insights_path_data_source_test.go | 2 +- .../ec2/vpc_network_insights_path_test.go | 12 +- .../vpc_network_interface_attachment_test.go | 2 +- .../vpc_network_interface_data_source_test.go | 10 +- ...pc_network_interface_sg_attachment_test.go | 8 +- .../service/ec2/vpc_network_interface_test.go | 34 +-- ...vpc_network_interfaces_data_source_test.go | 6 +- ...rk_performance_metric_subscription_test.go | 4 +- .../vpc_peering_connection_accepter_test.go | 8 +- ...vpc_peering_connection_data_source_test.go | 10 +- .../vpc_peering_connection_options_test.go | 6 +- .../ec2/vpc_peering_connection_test.go | 18 +- ...pc_peering_connections_data_source_test.go | 4 +- .../ec2/vpc_prefix_list_data_source_test.go | 6 +- .../service/ec2/vpc_route_data_source_test.go | 14 +- .../ec2/vpc_route_table_association_test.go | 10 +- .../ec2/vpc_route_table_data_source_test.go | 4 +- internal/service/ec2/vpc_route_table_test.go | 50 ++-- .../ec2/vpc_route_tables_data_source_test.go | 2 +- internal/service/ec2/vpc_route_test.go | 78 +++--- .../vpc_security_group_data_source_test.go | 2 +- .../vpc_security_group_egress_rule_test.go | 4 +- .../vpc_security_group_ingress_rule_test.go | 38 +-- ...pc_security_group_rule_data_source_test.go | 4 +- .../ec2/vpc_security_group_rule_test.go | 62 ++--- ...c_security_group_rules_data_source_test.go | 4 +- .../service/ec2/vpc_security_group_test.go | 84 +++--- .../vpc_security_groups_data_source_test.go | 6 +- .../ec2/vpc_subnet_cidr_reservation_test.go | 6 +- .../ec2/vpc_subnet_data_source_test.go | 6 +- .../ec2/vpc_subnet_ids_data_source_test.go | 4 +- internal/service/ec2/vpc_subnet_test.go | 44 +-- .../ec2/vpc_subnets_data_source_test.go | 4 +- internal/service/ec2/vpc_test.go | 44 +-- .../vpc_traffic_mirror_filter_rule_test.go | 4 +- .../ec2/vpc_traffic_mirror_filter_test.go | 6 +- .../ec2/vpc_traffic_mirror_session_test.go | 8 +- .../ec2/vpc_traffic_mirror_target_test.go | 10 +- .../service/ec2/vpc_vpcs_data_source_test.go | 8 +- .../ec2/vpnclient_authorization_rule_test.go | 10 +- .../vpnclient_endpoint_data_source_test.go | 2 +- .../service/ec2/vpnclient_endpoint_test.go | 30 +-- .../ec2/vpnclient_network_association_test.go | 10 +- internal/service/ec2/vpnclient_route_test.go | 6 +- .../ec2/vpnsite_connection_route_test.go | 4 +- .../service/ec2/vpnsite_connection_test.go | 46 ++-- ...nsite_customer_gateway_data_source_test.go | 4 +- .../ec2/vpnsite_customer_gateway_test.go | 12 +- .../ec2/vpnsite_gateway_attachment_test.go | 4 +- .../ec2/vpnsite_gateway_data_source_test.go | 4 +- .../vpnsite_gateway_route_propagation_test.go | 4 +- internal/service/ec2/vpnsite_gateway_test.go | 12 +- .../ec2/wavelength_carrier_gateway_test.go | 6 +- 200 files changed, 1303 insertions(+), 1303 deletions(-) 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 e1d73f44167e..a035118862f0 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 @@ -11,7 +11,7 @@ import ( func TestAccEC2EBSDefaultKMSKeyDataSource_basic(t *testing.T) { ctx := acctest.Context(t) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ diff --git a/internal/service/ec2/ebs_default_kms_key_test.go b/internal/service/ec2/ebs_default_kms_key_test.go index 8c43647d662a..9478385f7cf0 100644 --- a/internal/service/ec2/ebs_default_kms_key_test.go +++ b/internal/service/ec2/ebs_default_kms_key_test.go @@ -21,7 +21,7 @@ func TestAccEC2EBSDefaultKMSKey_basic(t *testing.T) { resourceNameKey := "aws_kms_key.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckEBSDefaultKMSKeyDestroy(ctx), 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 87de0e240485..c4c401268b7a 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 @@ -17,7 +17,7 @@ import ( func TestAccEC2EBSEncryptionByDefaultDataSource_basic(t *testing.T) { ctx := acctest.Context(t) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ diff --git a/internal/service/ec2/ebs_encryption_by_default_test.go b/internal/service/ec2/ebs_encryption_by_default_test.go index 38c12bae63d1..870d1c65dcba 100644 --- a/internal/service/ec2/ebs_encryption_by_default_test.go +++ b/internal/service/ec2/ebs_encryption_by_default_test.go @@ -18,7 +18,7 @@ func TestAccEC2EBSEncryptionByDefault_basic(t *testing.T) { resourceName := "aws_ebs_encryption_by_default.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckEncryptionByDefaultDestroy(ctx), diff --git a/internal/service/ec2/ebs_snapshot_copy_test.go b/internal/service/ec2/ebs_snapshot_copy_test.go index 7b2769a66cab..3b296df117e7 100644 --- a/internal/service/ec2/ebs_snapshot_copy_test.go +++ b/internal/service/ec2/ebs_snapshot_copy_test.go @@ -19,7 +19,7 @@ func TestAccEC2EBSSnapshotCopy_basic(t *testing.T) { resourceName := "aws_ebs_snapshot_copy.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckEBSSnapshotDestroy(ctx), @@ -43,7 +43,7 @@ func TestAccEC2EBSSnapshotCopy_disappears(t *testing.T) { resourceName := "aws_ebs_snapshot_copy.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckEBSSnapshotDestroy(ctx), @@ -67,7 +67,7 @@ func TestAccEC2EBSSnapshotCopy_tags(t *testing.T) { resourceName := "aws_ebs_snapshot_copy.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckEBSSnapshotDestroy(ctx), @@ -108,7 +108,7 @@ func TestAccEC2EBSSnapshotCopy_withDescription(t *testing.T) { resourceName := "aws_ebs_snapshot_copy.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckEBSSnapshotDestroy(ctx), @@ -132,7 +132,7 @@ func TestAccEC2EBSSnapshotCopy_withRegions(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckMultipleRegion(t, 2) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), @@ -157,7 +157,7 @@ func TestAccEC2EBSSnapshotCopy_withKMS(t *testing.T) { resourceName := "aws_ebs_snapshot_copy.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckEBSSnapshotDestroy(ctx), @@ -180,7 +180,7 @@ func TestAccEC2EBSSnapshotCopy_storageTier(t *testing.T) { resourceName := "aws_ebs_snapshot_copy.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckEBSSnapshotDestroy(ctx), 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 1808a8a8ff10..947554076ee8 100644 --- a/internal/service/ec2/ebs_snapshot_create_volume_permission_test.go +++ b/internal/service/ec2/ebs_snapshot_create_volume_permission_test.go @@ -23,7 +23,7 @@ func TestAccEC2EBSSnapshotCreateVolumePermission_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckAlternateAccount(t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), @@ -49,7 +49,7 @@ func TestAccEC2EBSSnapshotCreateVolumePermission_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckAlternateAccount(t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), @@ -73,7 +73,7 @@ func TestAccEC2EBSSnapshotCreateVolumePermission_snapshotOwnerExpectError(t *tes rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSnapshotCreateVolumePermissionDestroy(ctx), diff --git a/internal/service/ec2/ebs_snapshot_data_source_test.go b/internal/service/ec2/ebs_snapshot_data_source_test.go index b626838e8fcb..a3929a600d0e 100644 --- a/internal/service/ec2/ebs_snapshot_data_source_test.go +++ b/internal/service/ec2/ebs_snapshot_data_source_test.go @@ -16,7 +16,7 @@ func TestAccEC2EBSSnapshotDataSource_basic(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ @@ -46,7 +46,7 @@ func TestAccEC2EBSSnapshotDataSource_filter(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ @@ -66,7 +66,7 @@ func TestAccEC2EBSSnapshotDataSource_mostRecent(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ 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 a6f0ecf9a3d5..8dd3eb2c9bca 100644 --- a/internal/service/ec2/ebs_snapshot_ids_data_source_test.go +++ b/internal/service/ec2/ebs_snapshot_ids_data_source_test.go @@ -15,7 +15,7 @@ func TestAccEC2EBSSnapshotIDsDataSource_basic(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ @@ -37,7 +37,7 @@ func TestAccEC2EBSSnapshotIDsDataSource_sorted(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ @@ -55,7 +55,7 @@ func TestAccEC2EBSSnapshotIDsDataSource_sorted(t *testing.T) { func TestAccEC2EBSSnapshotIDsDataSource_empty(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ diff --git a/internal/service/ec2/ebs_snapshot_import_test.go b/internal/service/ec2/ebs_snapshot_import_test.go index 24d888960d57..2be07029a830 100644 --- a/internal/service/ec2/ebs_snapshot_import_test.go +++ b/internal/service/ec2/ebs_snapshot_import_test.go @@ -24,7 +24,7 @@ func TestAccEC2EBSSnapshotImport_basic(t *testing.T) { resourceName := "aws_ebs_snapshot_import.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckEBSSnapshotDestroy(ctx), @@ -49,7 +49,7 @@ func TestAccEC2EBSSnapshotImport_disappears(t *testing.T) { resourceName := "aws_ebs_snapshot_import.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckEBSSnapshotDestroy(ctx), @@ -74,7 +74,7 @@ func TestAccEC2EBSSnapshotImport_Disappears_s3Object(t *testing.T) { resourceName := "aws_ebs_snapshot_import.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckEBSSnapshotDestroy(ctx), @@ -98,7 +98,7 @@ func TestAccEC2EBSSnapshotImport_tags(t *testing.T) { resourceName := "aws_ebs_snapshot_import.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckEBSSnapshotDestroy(ctx), @@ -139,7 +139,7 @@ func TestAccEC2EBSSnapshotImport_storageTier(t *testing.T) { resourceName := "aws_ebs_snapshot_import.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckEBSSnapshotDestroy(ctx), diff --git a/internal/service/ec2/ebs_snapshot_test.go b/internal/service/ec2/ebs_snapshot_test.go index f4ade0382bd7..a2a2c4fe3dac 100644 --- a/internal/service/ec2/ebs_snapshot_test.go +++ b/internal/service/ec2/ebs_snapshot_test.go @@ -23,7 +23,7 @@ func TestAccEC2EBSSnapshot_basic(t *testing.T) { resourceName := "aws_ebs_snapshot.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckEBSSnapshotDestroy(ctx), @@ -56,7 +56,7 @@ func TestAccEC2EBSSnapshot_disappears(t *testing.T) { resourceName := "aws_ebs_snapshot.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckEBSSnapshotDestroy(ctx), @@ -80,7 +80,7 @@ func TestAccEC2EBSSnapshot_storageTier(t *testing.T) { resourceName := "aws_ebs_snapshot.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckEBSSnapshotDestroy(ctx), @@ -109,7 +109,7 @@ func TestAccEC2EBSSnapshot_outpost(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckOutpostsOutposts(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckOutpostsOutposts(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckEBSSnapshotDestroy(ctx), @@ -137,7 +137,7 @@ func TestAccEC2EBSSnapshot_tags(t *testing.T) { resourceName := "aws_ebs_snapshot.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckEBSSnapshotDestroy(ctx), @@ -183,7 +183,7 @@ func TestAccEC2EBSSnapshot_withDescription(t *testing.T) { resourceName := "aws_ebs_snapshot.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckEBSSnapshotDestroy(ctx), @@ -212,7 +212,7 @@ func TestAccEC2EBSSnapshot_withKMS(t *testing.T) { resourceName := "aws_ebs_snapshot.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckEBSSnapshotDestroy(ctx), diff --git a/internal/service/ec2/ebs_volume_attachment_test.go b/internal/service/ec2/ebs_volume_attachment_test.go index 69a3fa9c9eb4..b845f726839d 100644 --- a/internal/service/ec2/ebs_volume_attachment_test.go +++ b/internal/service/ec2/ebs_volume_attachment_test.go @@ -23,7 +23,7 @@ func TestAccEC2EBSVolumeAttachment_basic(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckVolumeAttachmentDestroy(ctx), @@ -51,7 +51,7 @@ func TestAccEC2EBSVolumeAttachment_skipDestroy(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckVolumeAttachmentDestroy(ctx), @@ -93,7 +93,7 @@ func TestAccEC2EBSVolumeAttachment_attachStopped(t *testing.T) { } resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckVolumeAttachmentDestroy(ctx), @@ -128,7 +128,7 @@ func TestAccEC2EBSVolumeAttachment_update(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckVolumeAttachmentDestroy(ctx), @@ -179,7 +179,7 @@ func TestAccEC2EBSVolumeAttachment_disappears(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckVolumeAttachmentDestroy(ctx), @@ -204,7 +204,7 @@ func TestAccEC2EBSVolumeAttachment_stopInstance(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckVolumeAttachmentDestroy(ctx), diff --git a/internal/service/ec2/ebs_volume_data_source_test.go b/internal/service/ec2/ebs_volume_data_source_test.go index 32be55d2ace5..ba9376d83cbd 100644 --- a/internal/service/ec2/ebs_volume_data_source_test.go +++ b/internal/service/ec2/ebs_volume_data_source_test.go @@ -17,7 +17,7 @@ func TestAccEC2EBSVolumeDataSource_basic(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ @@ -43,7 +43,7 @@ func TestAccEC2EBSVolumeDataSource_multipleFilters(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ diff --git a/internal/service/ec2/ebs_volume_test.go b/internal/service/ec2/ebs_volume_test.go index 51fc82bf54c5..aa515fd8169f 100644 --- a/internal/service/ec2/ebs_volume_test.go +++ b/internal/service/ec2/ebs_volume_test.go @@ -23,7 +23,7 @@ func TestAccEC2EBSVolume_basic(t *testing.T) { resourceName := "aws_ebs_volume.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckVolumeDestroy(ctx), @@ -60,7 +60,7 @@ func TestAccEC2EBSVolume_disappears(t *testing.T) { resourceName := "aws_ebs_volume.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckVolumeDestroy(ctx), @@ -84,7 +84,7 @@ func TestAccEC2EBSVolume_updateAttachedEBSVolume(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckVolumeDestroy(ctx), @@ -122,7 +122,7 @@ func TestAccEC2EBSVolume_updateSize(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckVolumeDestroy(ctx), @@ -160,7 +160,7 @@ func TestAccEC2EBSVolume_updateType(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckVolumeDestroy(ctx), @@ -198,7 +198,7 @@ func TestAccEC2EBSVolume_UpdateIops_io1(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckVolumeDestroy(ctx), @@ -236,7 +236,7 @@ func TestAccEC2EBSVolume_UpdateIops_io2(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckVolumeDestroy(ctx), @@ -275,7 +275,7 @@ func TestAccEC2EBSVolume_kmsKey(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckVolumeDestroy(ctx), @@ -306,7 +306,7 @@ func TestAccEC2EBSVolume_noIops(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckVolumeDestroy(ctx), @@ -332,7 +332,7 @@ func TestAccEC2EBSVolume_noIops(t *testing.T) { func TestAccEC2EBSVolume_invalidIopsForType(t *testing.T) { ctx := acctest.Context(t) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckVolumeDestroy(ctx), @@ -348,7 +348,7 @@ func TestAccEC2EBSVolume_invalidIopsForType(t *testing.T) { func TestAccEC2EBSVolume_invalidThroughputForType(t *testing.T) { ctx := acctest.Context(t) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckVolumeDestroy(ctx), @@ -367,7 +367,7 @@ func TestAccEC2EBSVolume_withTags(t *testing.T) { resourceName := "aws_ebs_volume.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckVolumeDestroy(ctx), @@ -414,7 +414,7 @@ func TestAccEC2EBSVolume_multiAttach_io1(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckVolumeDestroy(ctx), @@ -445,7 +445,7 @@ func TestAccEC2EBSVolume_multiAttach_io2(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckVolumeDestroy(ctx), @@ -472,7 +472,7 @@ func TestAccEC2EBSVolume_multiAttach_io2(t *testing.T) { func TestAccEC2EBSVolume_multiAttach_gp2(t *testing.T) { ctx := acctest.Context(t) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckVolumeDestroy(ctx), @@ -493,7 +493,7 @@ func TestAccEC2EBSVolume_outpost(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckOutpostsOutposts(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckOutpostsOutposts(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckVolumeDestroy(ctx), @@ -522,7 +522,7 @@ func TestAccEC2EBSVolume_GP3_basic(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckVolumeDestroy(ctx), @@ -562,7 +562,7 @@ func TestAccEC2EBSVolume_GP3_iops(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckVolumeDestroy(ctx), @@ -620,7 +620,7 @@ func TestAccEC2EBSVolume_GP3_throughput(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckVolumeDestroy(ctx), @@ -678,7 +678,7 @@ func TestAccEC2EBSVolume_gp3ToGP2(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckVolumeDestroy(ctx), @@ -736,7 +736,7 @@ func TestAccEC2EBSVolume_io1ToGP3(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckVolumeDestroy(ctx), @@ -795,7 +795,7 @@ func TestAccEC2EBSVolume_snapshotID(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckVolumeDestroy(ctx), @@ -836,7 +836,7 @@ func TestAccEC2EBSVolume_snapshotIDAndSize(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckVolumeDestroy(ctx), @@ -876,7 +876,7 @@ func TestAccEC2EBSVolume_finalSnapshot(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckVolumeDestroy(ctx), diff --git a/internal/service/ec2/ebs_volumes_data_source_test.go b/internal/service/ec2/ebs_volumes_data_source_test.go index a7bd1c69216e..09d88b96dc0b 100644 --- a/internal/service/ec2/ebs_volumes_data_source_test.go +++ b/internal/service/ec2/ebs_volumes_data_source_test.go @@ -15,7 +15,7 @@ func TestAccEC2EBSVolumesDataSource_basic(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckVolumeDestroy(ctx), diff --git a/internal/service/ec2/ec2_ami_copy_test.go b/internal/service/ec2/ec2_ami_copy_test.go index ec04cbbeb35f..da79d21763a3 100644 --- a/internal/service/ec2/ec2_ami_copy_test.go +++ b/internal/service/ec2/ec2_ami_copy_test.go @@ -20,7 +20,7 @@ func TestAccEC2AMICopy_basic(t *testing.T) { resourceName := "aws_ami_copy.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckAMIDestroy(ctx), @@ -49,7 +49,7 @@ func TestAccEC2AMICopy_description(t *testing.T) { resourceName := "aws_ami_copy.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckAMIDestroy(ctx), @@ -79,7 +79,7 @@ func TestAccEC2AMICopy_enaSupport(t *testing.T) { resourceName := "aws_ami_copy.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckAMIDestroy(ctx), @@ -103,7 +103,7 @@ func TestAccEC2AMICopy_destinationOutpost(t *testing.T) { resourceName := "aws_ami_copy.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckOutpostsOutposts(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckOutpostsOutposts(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckAMIDestroy(ctx), @@ -126,7 +126,7 @@ func TestAccEC2AMICopy_tags(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckAMIDestroy(ctx), diff --git a/internal/service/ec2/ec2_ami_data_source_test.go b/internal/service/ec2/ec2_ami_data_source_test.go index b22005f00284..2722da4aa489 100644 --- a/internal/service/ec2/ec2_ami_data_source_test.go +++ b/internal/service/ec2/ec2_ami_data_source_test.go @@ -14,7 +14,7 @@ func TestAccEC2AMIDataSource_natInstance(t *testing.T) { datasourceName := "data.aws_ami.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ @@ -67,7 +67,7 @@ func TestAccEC2AMIDataSource_windowsInstance(t *testing.T) { datasourceName := "data.aws_ami.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ @@ -113,7 +113,7 @@ func TestAccEC2AMIDataSource_instanceStore(t *testing.T) { datasourceName := "data.aws_ami.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ @@ -155,7 +155,7 @@ func TestAccEC2AMIDataSource_localNameFilter(t *testing.T) { datasourceName := "data.aws_ami.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ @@ -175,7 +175,7 @@ func TestAccEC2AMIDataSource_gp3BlockDevice(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ diff --git a/internal/service/ec2/ec2_ami_from_instance_test.go b/internal/service/ec2/ec2_ami_from_instance_test.go index f20f09b6bb41..01693a452f51 100644 --- a/internal/service/ec2/ec2_ami_from_instance_test.go +++ b/internal/service/ec2/ec2_ami_from_instance_test.go @@ -19,7 +19,7 @@ func TestAccEC2AMIFromInstance_basic(t *testing.T) { resourceName := "aws_ami_from_instance.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckAMIDestroy(ctx), @@ -49,7 +49,7 @@ func TestAccEC2AMIFromInstance_tags(t *testing.T) { resourceName := "aws_ami_from_instance.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckAMIDestroy(ctx), @@ -90,7 +90,7 @@ func TestAccEC2AMIFromInstance_disappears(t *testing.T) { resourceName := "aws_ami_from_instance.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckAMIDestroy(ctx), 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 7844dbc160f5..bf99cfd07ae5 100644 --- a/internal/service/ec2/ec2_ami_ids_data_source_test.go +++ b/internal/service/ec2/ec2_ami_ids_data_source_test.go @@ -13,7 +13,7 @@ func TestAccEC2AMIIDsDataSource_basic(t *testing.T) { datasourceName := "data.aws_ami_ids.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ @@ -31,7 +31,7 @@ func TestAccEC2AMIIDsDataSource_sorted(t *testing.T) { datasourceName := "data.aws_ami_ids.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ diff --git a/internal/service/ec2/ec2_ami_launch_permission_test.go b/internal/service/ec2/ec2_ami_launch_permission_test.go index dbedb8d5263a..e6e2ab93c79a 100644 --- a/internal/service/ec2/ec2_ami_launch_permission_test.go +++ b/internal/service/ec2/ec2_ami_launch_permission_test.go @@ -21,7 +21,7 @@ func TestAccEC2AMILaunchPermission_basic(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckAMILaunchPermissionDestroy(ctx), @@ -52,7 +52,7 @@ func TestAccEC2AMILaunchPermission_disappears(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckAMILaunchPermissionDestroy(ctx), @@ -75,7 +75,7 @@ func TestAccEC2AMILaunchPermission_Disappears_ami(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckAMILaunchPermissionDestroy(ctx), @@ -98,7 +98,7 @@ func TestAccEC2AMILaunchPermission_group(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckAMILaunchPermissionDestroy(ctx), @@ -129,7 +129,7 @@ func TestAccEC2AMILaunchPermission_organizationARN(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckOrganizationsEnabled(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckOrganizationsEnabled(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckAMILaunchPermissionDestroy(ctx), @@ -160,7 +160,7 @@ func TestAccEC2AMILaunchPermission_organizationalUnitARN(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckOrganizationsAccount(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckOrganizationsAccount(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckAMILaunchPermissionDestroy(ctx), diff --git a/internal/service/ec2/ec2_ami_test.go b/internal/service/ec2/ec2_ami_test.go index b54db5e3c8d0..81528e53157e 100644 --- a/internal/service/ec2/ec2_ami_test.go +++ b/internal/service/ec2/ec2_ami_test.go @@ -25,7 +25,7 @@ func TestAccEC2AMI_basic(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckAMIDestroy(ctx), @@ -90,7 +90,7 @@ func TestAccEC2AMI_deprecateAt(t *testing.T) { deprecateAtUpdated := "2028-10-15T13:17:00.000Z" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckAMIDestroy(ctx), @@ -183,7 +183,7 @@ func TestAccEC2AMI_description(t *testing.T) { descUpdated := sdkacctest.RandomWithPrefix("desc-updated") resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckAMIDestroy(ctx), @@ -271,7 +271,7 @@ func TestAccEC2AMI_disappears(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckAMIDestroy(ctx), @@ -296,7 +296,7 @@ func TestAccEC2AMI_ephemeralBlockDevices(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckAMIDestroy(ctx), @@ -360,7 +360,7 @@ func TestAccEC2AMI_gp3BlockDevice(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckAMIDestroy(ctx), @@ -426,7 +426,7 @@ func TestAccEC2AMI_tags(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckAMIDestroy(ctx), @@ -475,7 +475,7 @@ func TestAccEC2AMI_outpost(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckOutpostsOutposts(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckOutpostsOutposts(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckAMIDestroy(ctx), @@ -506,7 +506,7 @@ func TestAccEC2AMI_boot(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckAMIDestroy(ctx), @@ -537,7 +537,7 @@ func TestAccEC2AMI_tpmSupport(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckAMIDestroy(ctx), @@ -568,7 +568,7 @@ func TestAccEC2AMI_imdsSupport(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckAMIDestroy(ctx), 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 49acc9efecf6..854faefc91bd 100644 --- a/internal/service/ec2/ec2_availability_zone_data_source_test.go +++ b/internal/service/ec2/ec2_availability_zone_data_source_test.go @@ -18,7 +18,7 @@ func TestAccEC2AvailabilityZoneDataSource_allAvailabilityZones(t *testing.T) { dataSourceName := "data.aws_availability_zone.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ @@ -46,7 +46,7 @@ func TestAccEC2AvailabilityZoneDataSource_filter(t *testing.T) { dataSourceName := "data.aws_availability_zone.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ @@ -75,7 +75,7 @@ func TestAccEC2AvailabilityZoneDataSource_localZone(t *testing.T) { dataSourceName := "data.aws_availability_zone.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckLocalZoneAvailable(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckLocalZoneAvailable(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ @@ -103,7 +103,7 @@ func TestAccEC2AvailabilityZoneDataSource_name(t *testing.T) { dataSourceName := "data.aws_availability_zone.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ @@ -132,7 +132,7 @@ func TestAccEC2AvailabilityZoneDataSource_wavelengthZone(t *testing.T) { dataSourceName := "data.aws_availability_zone.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckWavelengthZoneAvailable(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckWavelengthZoneAvailable(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ @@ -160,7 +160,7 @@ func TestAccEC2AvailabilityZoneDataSource_zoneID(t *testing.T) { dataSourceName := "data.aws_availability_zone.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ diff --git a/internal/service/ec2/ec2_availability_zone_group_test.go b/internal/service/ec2/ec2_availability_zone_group_test.go index b58692c0398f..0034982e6eec 100644 --- a/internal/service/ec2/ec2_availability_zone_group_test.go +++ b/internal/service/ec2/ec2_availability_zone_group_test.go @@ -19,7 +19,7 @@ func TestAccEC2AvailabilityZoneGroup_optInStatus(t *testing.T) { localZone := "us-west-2-lax-1" // lintignore:AWSAT003 resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckRegion(t, endpoints.UsWest2RegionID) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckRegion(t, endpoints.UsWest2RegionID) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: nil, 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 806abc1d0ac9..2b98d9d43ec9 100644 --- a/internal/service/ec2/ec2_availability_zones_data_source_test.go +++ b/internal/service/ec2/ec2_availability_zones_data_source_test.go @@ -78,7 +78,7 @@ func TestAvailabilityZonesSort(t *testing.T) { func TestAccEC2AvailabilityZonesDataSource_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ @@ -96,7 +96,7 @@ func TestAccEC2AvailabilityZonesDataSource_allAvailabilityZones(t *testing.T) { dataSourceName := "data.aws_availability_zones.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ @@ -114,7 +114,7 @@ func TestAccEC2AvailabilityZonesDataSource_filter(t *testing.T) { dataSourceName := "data.aws_availability_zones.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ @@ -133,7 +133,7 @@ func TestAccEC2AvailabilityZonesDataSource_excludeNames(t *testing.T) { excludeDataSourceName := "data.aws_availability_zones.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ @@ -152,7 +152,7 @@ func TestAccEC2AvailabilityZonesDataSource_excludeZoneIDs(t *testing.T) { excludeDataSourceName := "data.aws_availability_zones.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ @@ -168,7 +168,7 @@ func TestAccEC2AvailabilityZonesDataSource_excludeZoneIDs(t *testing.T) { func TestAccEC2AvailabilityZonesDataSource_stateFilter(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ diff --git a/internal/service/ec2/ec2_capacity_reservation_test.go b/internal/service/ec2/ec2_capacity_reservation_test.go index 0e6d665774a9..eef966ef9418 100644 --- a/internal/service/ec2/ec2_capacity_reservation_test.go +++ b/internal/service/ec2/ec2_capacity_reservation_test.go @@ -25,7 +25,7 @@ func TestAccEC2CapacityReservation_basic(t *testing.T) { resourceName := "aws_ec2_capacity_reservation.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckCapacityReservation(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckCapacityReservation(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckCapacityReservationDestroy(ctx), @@ -66,7 +66,7 @@ func TestAccEC2CapacityReservation_disappears(t *testing.T) { resourceName := "aws_ec2_capacity_reservation.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckCapacityReservation(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckCapacityReservation(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckCapacityReservationDestroy(ctx), @@ -90,7 +90,7 @@ func TestAccEC2CapacityReservation_ebsOptimized(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckCapacityReservation(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckCapacityReservation(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckCapacityReservationDestroy(ctx), @@ -120,7 +120,7 @@ func TestAccEC2CapacityReservation_endDate(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckCapacityReservation(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckCapacityReservation(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckCapacityReservationDestroy(ctx), @@ -158,7 +158,7 @@ func TestAccEC2CapacityReservation_endDateType(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckCapacityReservation(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckCapacityReservation(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckCapacityReservationDestroy(ctx), @@ -201,7 +201,7 @@ func TestAccEC2CapacityReservation_ephemeralStorage(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckCapacityReservation(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckCapacityReservation(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckCapacityReservationDestroy(ctx), @@ -229,7 +229,7 @@ func TestAccEC2CapacityReservation_instanceCount(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckCapacityReservation(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckCapacityReservation(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckCapacityReservationDestroy(ctx), @@ -264,7 +264,7 @@ func TestAccEC2CapacityReservation_instanceMatchCriteria(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckCapacityReservation(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckCapacityReservation(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckCapacityReservationDestroy(ctx), @@ -292,7 +292,7 @@ func TestAccEC2CapacityReservation_instanceType(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckCapacityReservation(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckCapacityReservation(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckCapacityReservationDestroy(ctx), @@ -326,7 +326,7 @@ func TestAccEC2CapacityReservation_tags(t *testing.T) { resourceName := "aws_ec2_capacity_reservation.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckCapacityReservation(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckCapacityReservation(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckCapacityReservationDestroy(ctx), @@ -372,7 +372,7 @@ func TestAccEC2CapacityReservation_tenancy(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckCapacityReservation(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckCapacityReservation(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckCapacityReservationDestroy(ctx), diff --git a/internal/service/ec2/ec2_eip_association_test.go b/internal/service/ec2/ec2_eip_association_test.go index 59b8bda98e4b..229076eb1656 100644 --- a/internal/service/ec2/ec2_eip_association_test.go +++ b/internal/service/ec2/ec2_eip_association_test.go @@ -23,7 +23,7 @@ func TestAccEC2EIPAssociation_basic(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckEIPAssociationDestroy(ctx), @@ -50,7 +50,7 @@ func TestAccEC2EIPAssociation_disappears(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckEIPAssociationDestroy(ctx), @@ -75,7 +75,7 @@ func TestAccEC2EIPAssociation_instance(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckEIPAssociationDestroy(ctx), @@ -98,7 +98,7 @@ func TestAccEC2EIPAssociation_networkInterface(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckEIPAssociationDestroy(ctx), @@ -129,7 +129,7 @@ func TestAccEC2EIPAssociation_spotInstance(t *testing.T) { } resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckEIPAssociationDestroy(ctx), diff --git a/internal/service/ec2/ec2_eip_data_source_test.go b/internal/service/ec2/ec2_eip_data_source_test.go index be4c1392598f..fcbef36fb6a3 100644 --- a/internal/service/ec2/ec2_eip_data_source_test.go +++ b/internal/service/ec2/ec2_eip_data_source_test.go @@ -16,7 +16,7 @@ func TestAccEC2EIPDataSource_filter(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ @@ -38,7 +38,7 @@ func TestAccEC2EIPDataSource_id(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ @@ -60,7 +60,7 @@ func TestAccEC2EIPDataSource_publicIP(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ @@ -83,7 +83,7 @@ func TestAccEC2EIPDataSource_tags(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ @@ -105,7 +105,7 @@ func TestAccEC2EIPDataSource_networkInterface(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ @@ -129,7 +129,7 @@ func TestAccEC2EIPDataSource_instance(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ @@ -152,7 +152,7 @@ func TestAccEC2EIPDataSource_carrierIP(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckWavelengthZoneAvailable(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckWavelengthZoneAvailable(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ @@ -174,7 +174,7 @@ func TestAccEC2EIPDataSource_customerOwnedIPv4Pool(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckOutpostsOutposts(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckOutpostsOutposts(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ diff --git a/internal/service/ec2/ec2_eip_test.go b/internal/service/ec2/ec2_eip_test.go index a0ba9017eab6..891326fd96fe 100644 --- a/internal/service/ec2/ec2_eip_test.go +++ b/internal/service/ec2/ec2_eip_test.go @@ -24,7 +24,7 @@ func TestAccEC2EIP_basic(t *testing.T) { resourceName := "aws_eip.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckEIPDestroy(ctx), @@ -53,7 +53,7 @@ func TestAccEC2EIP_disappears(t *testing.T) { resourceName := "aws_eip.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckEIPDestroy(ctx), @@ -76,7 +76,7 @@ func TestAccEC2EIP_noVPC(t *testing.T) { resourceName := "aws_eip.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckEIPDestroy(ctx), @@ -105,7 +105,7 @@ func TestAccEC2EIP_tags(t *testing.T) { resourceName := "aws_eip.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckEIPDestroy(ctx), @@ -152,7 +152,7 @@ func TestAccEC2EIP_instance(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckEIPDestroy(ctx), @@ -184,7 +184,7 @@ func TestAccEC2EIP_Instance_reassociate(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckEIPDestroy(ctx), @@ -219,7 +219,7 @@ func TestAccEC2EIP_Instance_associatedUserPrivateIP(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckEIPDestroy(ctx), @@ -260,7 +260,7 @@ func TestAccEC2EIP_Instance_notAssociated(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckEIPDestroy(ctx), @@ -299,7 +299,7 @@ func TestAccEC2EIP_networkInterface(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckEIPDestroy(ctx), @@ -331,7 +331,7 @@ func TestAccEC2EIP_NetworkInterface_twoEIPsOneInterface(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckEIPDestroy(ctx), @@ -361,7 +361,7 @@ func TestAccEC2EIP_association(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckEIPDestroy(ctx), @@ -407,7 +407,7 @@ func TestAccEC2EIP_PublicIPv4Pool_default(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckEIPDestroy(ctx), @@ -442,7 +442,7 @@ func TestAccEC2EIP_PublicIPv4Pool_custom(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckEIPDestroy(ctx), @@ -471,7 +471,7 @@ func TestAccEC2EIP_customerOwnedIPv4Pool(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckOutpostsOutposts(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckOutpostsOutposts(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckEIPDestroy(ctx), @@ -500,7 +500,7 @@ func TestAccEC2EIP_networkBorderGroup(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckEIPDestroy(ctx), @@ -530,7 +530,7 @@ func TestAccEC2EIP_carrierIP(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckWavelengthZoneAvailable(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckWavelengthZoneAvailable(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckEIPDestroy(ctx), @@ -560,7 +560,7 @@ func TestAccEC2EIP_BYOIPAddress_default(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckEIPDestroy(ctx), @@ -589,7 +589,7 @@ func TestAccEC2EIP_BYOIPAddress_custom(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckEIPDestroy(ctx), @@ -624,7 +624,7 @@ func TestAccEC2EIP_BYOIPAddress_customWithPublicIPv4Pool(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckEIPDestroy(ctx), diff --git a/internal/service/ec2/ec2_eips_data_source_test.go b/internal/service/ec2/ec2_eips_data_source_test.go index cc466229c373..4434296301e4 100644 --- a/internal/service/ec2/ec2_eips_data_source_test.go +++ b/internal/service/ec2/ec2_eips_data_source_test.go @@ -14,7 +14,7 @@ func TestAccEC2EIPsDataSource_basic(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ diff --git a/internal/service/ec2/ec2_fleet_test.go b/internal/service/ec2/ec2_fleet_test.go index ed5aadedad9c..13039a8f57da 100644 --- a/internal/service/ec2/ec2_fleet_test.go +++ b/internal/service/ec2/ec2_fleet_test.go @@ -27,7 +27,7 @@ func TestAccEC2Fleet_basic(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckFleet(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckFleet(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckFleetDestroy(ctx), @@ -77,7 +77,7 @@ func TestAccEC2Fleet_disappears(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckFleet(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckFleet(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckFleetDestroy(ctx), @@ -101,7 +101,7 @@ func TestAccEC2Fleet_tags(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckFleet(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckFleet(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckFleetDestroy(ctx), @@ -148,7 +148,7 @@ func TestAccEC2Fleet_excessCapacityTerminationPolicy(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckFleet(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckFleet(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckFleetDestroy(ctx), @@ -187,7 +187,7 @@ func TestAccEC2Fleet_LaunchTemplateLaunchTemplateSpecification_launchTemplateID( rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckFleet(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckFleet(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckFleetDestroy(ctx), @@ -232,7 +232,7 @@ func TestAccEC2Fleet_LaunchTemplateLaunchTemplateSpecification_launchTemplateNam rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckFleet(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckFleet(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckFleetDestroy(ctx), @@ -277,7 +277,7 @@ func TestAccEC2Fleet_LaunchTemplateLaunchTemplateSpecification_version(t *testin rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckFleet(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckFleet(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckFleetDestroy(ctx), @@ -327,7 +327,7 @@ func TestAccEC2Fleet_LaunchTemplateOverride_availabilityZone(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckFleet(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckFleet(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckFleetDestroy(ctx), @@ -367,7 +367,7 @@ func TestAccEC2Fleet_LaunchTemplateOverride_instanceRequirements_memoryMiBAndVCP resourceName := "aws_ec2_fleet.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckFleet(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckFleet(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckFleetDestroy(ctx), @@ -438,7 +438,7 @@ func TestAccEC2Fleet_LaunchTemplateOverride_instanceRequirements_acceleratorCoun resourceName := "aws_ec2_fleet.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckFleet(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckFleet(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckFleetDestroy(ctx), @@ -536,7 +536,7 @@ func TestAccEC2Fleet_LaunchTemplateOverride_instanceRequirements_acceleratorManu resourceName := "aws_ec2_fleet.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckFleet(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckFleet(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckFleetDestroy(ctx), @@ -604,7 +604,7 @@ func TestAccEC2Fleet_LaunchTemplateOverride_instanceRequirements_acceleratorName resourceName := "aws_ec2_fleet.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckFleet(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckFleet(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckFleetDestroy(ctx), @@ -675,7 +675,7 @@ func TestAccEC2Fleet_LaunchTemplateOverride_instanceRequirements_acceleratorTota resourceName := "aws_ec2_fleet.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckFleet(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckFleet(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckFleetDestroy(ctx), @@ -773,7 +773,7 @@ func TestAccEC2Fleet_LaunchTemplateOverride_instanceRequirements_acceleratorType resourceName := "aws_ec2_fleet.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckFleet(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckFleet(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckFleetDestroy(ctx), @@ -840,7 +840,7 @@ func TestAccEC2Fleet_LaunchTemplateOverride_instanceRequirements_bareMetal(t *te resourceName := "aws_ec2_fleet.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckFleet(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckFleet(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckFleetDestroy(ctx), @@ -927,7 +927,7 @@ func TestAccEC2Fleet_LaunchTemplateOverride_instanceRequirements_baselineEBSBand resourceName := "aws_ec2_fleet.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckFleet(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckFleet(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckFleetDestroy(ctx), @@ -1025,7 +1025,7 @@ func TestAccEC2Fleet_LaunchTemplateOverride_instanceRequirements_burstablePerfor resourceName := "aws_ec2_fleet.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckFleet(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckFleet(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckFleetDestroy(ctx), @@ -1112,7 +1112,7 @@ func TestAccEC2Fleet_LaunchTemplateOverride_instanceRequirements_cpuManufacturer resourceName := "aws_ec2_fleet.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckFleet(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckFleet(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckFleetDestroy(ctx), @@ -1179,7 +1179,7 @@ func TestAccEC2Fleet_LaunchTemplateOverride_instanceRequirements_excludedInstanc resourceName := "aws_ec2_fleet.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckFleet(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckFleet(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckFleetDestroy(ctx), @@ -1246,7 +1246,7 @@ func TestAccEC2Fleet_LaunchTemplateOverride_instanceRequirements_instanceGenerat resourceName := "aws_ec2_fleet.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckFleet(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckFleet(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckFleetDestroy(ctx), @@ -1312,7 +1312,7 @@ func TestAccEC2Fleet_LaunchTemplateOverride_instanceRequirements_localStorage(t resourceName := "aws_ec2_fleet.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckFleet(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckFleet(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckFleetDestroy(ctx), @@ -1399,7 +1399,7 @@ func TestAccEC2Fleet_LaunchTemplateOverride_instanceRequirements_localStorageTyp resourceName := "aws_ec2_fleet.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckFleet(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckFleet(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckFleetDestroy(ctx), @@ -1465,7 +1465,7 @@ func TestAccEC2Fleet_LaunchTemplateOverride_instanceRequirements_memoryGiBPerVCP resourceName := "aws_ec2_fleet.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckFleet(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckFleet(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckFleetDestroy(ctx), @@ -1563,7 +1563,7 @@ func TestAccEC2Fleet_LaunchTemplateOverride_instanceRequirements_networkInterfac resourceName := "aws_ec2_fleet.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckFleet(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckFleet(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckFleetDestroy(ctx), @@ -1661,7 +1661,7 @@ func TestAccEC2Fleet_LaunchTemplateOverride_instanceRequirements_onDemandMaxPric resourceName := "aws_ec2_fleet.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckFleet(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckFleet(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckFleetDestroy(ctx), @@ -1700,7 +1700,7 @@ func TestAccEC2Fleet_LaunchTemplateOverride_instanceRequirements_requireHibernat resourceName := "aws_ec2_fleet.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckFleet(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckFleet(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckFleetDestroy(ctx), @@ -1763,7 +1763,7 @@ func TestAccEC2Fleet_LaunchTemplateOverride_instanceRequirements_spotMaxPricePer resourceName := "aws_ec2_fleet.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckFleet(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckFleet(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckFleetDestroy(ctx), @@ -1802,7 +1802,7 @@ func TestAccEC2Fleet_LaunchTemplateOverride_instanceRequirements_totalLocalStora resourceName := "aws_ec2_fleet.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckFleet(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckFleet(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckFleetDestroy(ctx), @@ -1901,7 +1901,7 @@ func TestAccEC2Fleet_LaunchTemplateOverride_instanceType(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckFleet(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckFleet(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckFleetDestroy(ctx), @@ -1942,7 +1942,7 @@ func TestAccEC2Fleet_LaunchTemplateOverride_maxPrice(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckFleet(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckFleet(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckFleetDestroy(ctx), @@ -1983,7 +1983,7 @@ func TestAccEC2Fleet_LaunchTemplateOverride_priority(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckFleet(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckFleet(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckFleetDestroy(ctx), @@ -2024,7 +2024,7 @@ func TestAccEC2Fleet_LaunchTemplateOverridePriority_multiple(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckFleet(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckFleet(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckFleetDestroy(ctx), @@ -2069,7 +2069,7 @@ func TestAccEC2Fleet_LaunchTemplateOverride_subnetID(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckFleet(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckFleet(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckFleetDestroy(ctx), @@ -2110,7 +2110,7 @@ func TestAccEC2Fleet_LaunchTemplateOverride_weightedCapacity(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckFleet(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckFleet(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckFleetDestroy(ctx), @@ -2151,7 +2151,7 @@ func TestAccEC2Fleet_LaunchTemplateOverrideWeightedCapacity_multiple(t *testing. rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckFleet(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckFleet(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckFleetDestroy(ctx), @@ -2194,7 +2194,7 @@ func TestAccEC2Fleet_OnDemandOptions_allocationStrategy(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckFleet(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckFleet(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckFleetDestroy(ctx), @@ -2233,7 +2233,7 @@ func TestAccEC2Fleet_replaceUnhealthyInstances(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckFleet(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckFleet(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckFleetDestroy(ctx), @@ -2270,7 +2270,7 @@ func TestAccEC2Fleet_SpotOptions_allocationStrategy(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckFleet(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckFleet(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckFleetDestroy(ctx), @@ -2309,7 +2309,7 @@ func TestAccEC2Fleet_SpotOptions_capacityRebalance(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckFleet(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckFleet(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckFleetDestroy(ctx), @@ -2338,7 +2338,7 @@ func TestAccEC2Fleet_capacityRebalanceInvalidType(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckFleet(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckFleet(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckFleetDestroy(ctx), @@ -2358,7 +2358,7 @@ func TestAccEC2Fleet_SpotOptions_instanceInterruptionBehavior(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckFleet(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckFleet(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckFleetDestroy(ctx), @@ -2397,7 +2397,7 @@ func TestAccEC2Fleet_SpotOptions_instancePoolsToUseCount(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckFleet(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckFleet(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckFleetDestroy(ctx), @@ -2436,7 +2436,7 @@ func TestAccEC2Fleet_TargetCapacitySpecification_defaultTargetCapacityType(t *te rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckFleet(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckFleet(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckFleetDestroy(ctx), @@ -2469,7 +2469,7 @@ func TestAccEC2Fleet_TargetCapacitySpecificationDefaultTargetCapacityType_onDema rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckFleet(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckFleet(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckFleetDestroy(ctx), @@ -2499,7 +2499,7 @@ func TestAccEC2Fleet_TargetCapacitySpecificationDefaultTargetCapacityType_spot(t rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckFleet(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckFleet(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckFleetDestroy(ctx), @@ -2529,7 +2529,7 @@ func TestAccEC2Fleet_TargetCapacitySpecification_totalTargetCapacity(t *testing. rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckFleet(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckFleet(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckFleetDestroy(ctx), @@ -2569,7 +2569,7 @@ func TestAccEC2Fleet_TargetCapacitySpecification_targetCapacityUnitType(t *testi targetCapacityUnitType := "vcpu" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckFleet(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckFleet(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckFleetDestroy(ctx), @@ -2599,7 +2599,7 @@ func TestAccEC2Fleet_terminateInstancesWithExpiration(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckFleet(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckFleet(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckFleetDestroy(ctx), @@ -2636,7 +2636,7 @@ func TestAccEC2Fleet_type(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckFleet(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckFleet(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckFleetDestroy(ctx), @@ -2675,7 +2675,7 @@ func TestAccEC2Fleet_templateMultipleNetworkInterfaces(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckFleet(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckFleet(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckFleetDestroy(ctx), diff --git a/internal/service/ec2/ec2_host_data_source_test.go b/internal/service/ec2/ec2_host_data_source_test.go index 74990d562d88..cfc703b3faa6 100644 --- a/internal/service/ec2/ec2_host_data_source_test.go +++ b/internal/service/ec2/ec2_host_data_source_test.go @@ -16,7 +16,7 @@ func TestAccEC2HostDataSource_basic(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ @@ -48,7 +48,7 @@ func TestAccEC2HostDataSource_filter(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ diff --git a/internal/service/ec2/ec2_host_test.go b/internal/service/ec2/ec2_host_test.go index 29ac3cbb618f..8dc698b7d6c6 100644 --- a/internal/service/ec2/ec2_host_test.go +++ b/internal/service/ec2/ec2_host_test.go @@ -22,7 +22,7 @@ func TestAccEC2Host_basic(t *testing.T) { resourceName := "aws_ec2_host.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckHostDestroy(ctx), @@ -56,7 +56,7 @@ func TestAccEC2Host_disappears(t *testing.T) { resourceName := "aws_ec2_host.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckHostDestroy(ctx), @@ -80,7 +80,7 @@ func TestAccEC2Host_instanceFamily(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckHostDestroy(ctx), @@ -128,7 +128,7 @@ func TestAccEC2Host_tags(t *testing.T) { resourceName := "aws_ec2_host.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckHostDestroy(ctx), @@ -175,7 +175,7 @@ func TestAccEC2Host_outpost(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckOutpostsOutposts(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckOutpostsOutposts(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckHostDestroy(ctx), diff --git a/internal/service/ec2/ec2_instance_data_source_test.go b/internal/service/ec2/ec2_instance_data_source_test.go index 35ad044f602a..5a1bbfe42488 100644 --- a/internal/service/ec2/ec2_instance_data_source_test.go +++ b/internal/service/ec2/ec2_instance_data_source_test.go @@ -16,7 +16,7 @@ func TestAccEC2InstanceDataSource_basic(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ @@ -41,7 +41,7 @@ func TestAccEC2InstanceDataSource_tags(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ @@ -63,7 +63,7 @@ func TestAccEC2InstanceDataSource_azUserData(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ @@ -87,7 +87,7 @@ func TestAccEC2InstanceDataSource_gp2IopsDevice(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ @@ -113,7 +113,7 @@ func TestAccEC2InstanceDataSource_gp3ThroughputDevice(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ @@ -139,7 +139,7 @@ func TestAccEC2InstanceDataSource_blockDevices(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ @@ -166,7 +166,7 @@ func TestAccEC2InstanceDataSource_EBSBlockDevice_kmsKeyID(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ @@ -182,7 +182,7 @@ func TestAccEC2InstanceDataSource_RootBlockDevice_kmsKeyID(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ @@ -199,7 +199,7 @@ func TestAccEC2InstanceDataSource_rootInstanceStore(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ @@ -223,7 +223,7 @@ func TestAccEC2InstanceDataSource_privateIP(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ @@ -249,7 +249,7 @@ func TestAccEC2InstanceDataSource_secondaryPrivateIPs(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ @@ -271,7 +271,7 @@ func TestAccEC2InstanceDataSource_ipv6Addresses(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ @@ -298,7 +298,7 @@ func TestAccEC2InstanceDataSource_keyPair(t *testing.T) { } resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ @@ -321,7 +321,7 @@ func TestAccEC2InstanceDataSource_vpc(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ @@ -345,7 +345,7 @@ func TestAccEC2InstanceDataSource_placementGroup(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ @@ -365,7 +365,7 @@ func TestAccEC2InstanceDataSource_securityGroups(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ @@ -389,7 +389,7 @@ func TestAccEC2InstanceDataSource_vpcSecurityGroups(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ @@ -416,7 +416,7 @@ func TestAccEC2InstanceDataSource_GetPasswordData_trueToFalse(t *testing.T) { } resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ @@ -448,7 +448,7 @@ func TestAccEC2InstanceDataSource_GetPasswordData_falseToTrue(t *testing.T) { } resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ @@ -475,7 +475,7 @@ func TestAccEC2InstanceDataSource_getUserData(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ @@ -510,7 +510,7 @@ func TestAccEC2InstanceDataSource_GetUserData_noUserData(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ @@ -547,7 +547,7 @@ func TestAccEC2InstanceDataSource_autoRecovery(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ @@ -575,7 +575,7 @@ func TestAccEC2InstanceDataSource_creditSpecification(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ @@ -598,7 +598,7 @@ func TestAccEC2InstanceDataSource_metadataOptions(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ @@ -622,7 +622,7 @@ func TestAccEC2InstanceDataSource_enclaveOptions(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ @@ -643,7 +643,7 @@ func TestAccEC2InstanceDataSource_blockDeviceTags(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ @@ -662,7 +662,7 @@ func TestAccEC2InstanceDataSource_disableAPIStopTermination(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ @@ -690,7 +690,7 @@ func TestAccEC2InstanceDataSource_timeout(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ diff --git a/internal/service/ec2/ec2_instance_state_test.go b/internal/service/ec2/ec2_instance_state_test.go index 8bdb90f834d5..74ea27a1f71b 100644 --- a/internal/service/ec2/ec2_instance_state_test.go +++ b/internal/service/ec2/ec2_instance_state_test.go @@ -21,7 +21,7 @@ func TestAccEC2InstanceState_basic(t *testing.T) { force := "false" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckInstanceDestroy(ctx), @@ -46,7 +46,7 @@ func TestAccEC2InstanceState_state(t *testing.T) { force := "false" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckInstanceDestroy(ctx), @@ -84,7 +84,7 @@ func TestAccEC2InstanceState_disappears_Instance(t *testing.T) { force := "false" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckInstanceDestroy(ctx), diff --git a/internal/service/ec2/ec2_instance_test.go b/internal/service/ec2/ec2_instance_test.go index c72389054179..ed5bf576b3cf 100644 --- a/internal/service/ec2/ec2_instance_test.go +++ b/internal/service/ec2/ec2_instance_test.go @@ -188,7 +188,7 @@ func TestAccEC2Instance_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ // No subnet_id specified requires default VPC with default subnets. PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) testAccPreCheckHasDefaultVPCDefaultSubnets(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), @@ -221,7 +221,7 @@ func TestAccEC2Instance_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ // No subnet_id specified requires default VPC with default subnets. PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) testAccPreCheckHasDefaultVPCDefaultSubnets(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), @@ -248,7 +248,7 @@ func TestAccEC2Instance_tags(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ // No subnet_id specified requires default VPC with default subnets. PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) testAccPreCheckHasDefaultVPCDefaultSubnets(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), @@ -297,7 +297,7 @@ func TestAccEC2Instance_inDefaultVPCBySgName(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckInstanceDestroy(ctx), @@ -325,7 +325,7 @@ func TestAccEC2Instance_inDefaultVPCBySgID(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckInstanceDestroy(ctx), @@ -353,7 +353,7 @@ func TestAccEC2Instance_atLeastOneOtherEBSVolume(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckInstanceDestroy(ctx), @@ -398,7 +398,7 @@ func TestAccEC2Instance_EBSBlockDevice_kmsKeyARN(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckInstanceDestroy(ctx), @@ -422,7 +422,7 @@ func TestAccEC2Instance_EBSBlockDevice_kmsKeyARN(t *testing.T) { func TestAccEC2Instance_EBSBlockDevice_invalidIopsForVolumeType(t *testing.T) { ctx := acctest.Context(t) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckInstanceDestroy(ctx), @@ -438,7 +438,7 @@ func TestAccEC2Instance_EBSBlockDevice_invalidIopsForVolumeType(t *testing.T) { func TestAccEC2Instance_EBSBlockDevice_invalidThroughputForVolumeType(t *testing.T) { ctx := acctest.Context(t) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckInstanceDestroy(ctx), @@ -461,7 +461,7 @@ func TestAccEC2Instance_EBSBlockDevice_RootBlockDevice_removed(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckInstanceDestroy(ctx), @@ -488,7 +488,7 @@ func TestAccEC2Instance_RootBlockDevice_kmsKeyARN(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckInstanceDestroy(ctx), @@ -519,7 +519,7 @@ func TestAccEC2Instance_userDataBase64(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckInstanceDestroy(ctx), @@ -548,7 +548,7 @@ func TestAccEC2Instance_userDataBase64_updateWithBashFile(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckInstanceDestroy(ctx), @@ -583,7 +583,7 @@ func TestAccEC2Instance_userDataBase64_updateWithZipFile(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckInstanceDestroy(ctx), @@ -618,7 +618,7 @@ func TestAccEC2Instance_userDataBase64_update(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckInstanceDestroy(ctx), @@ -671,7 +671,7 @@ func TestAccEC2Instance_gp2IopsDevice(t *testing.T) { } resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckInstanceDestroy(ctx), @@ -705,7 +705,7 @@ func TestAccEC2Instance_gp2WithIopsValue(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckInstanceDestroy(ctx), @@ -767,7 +767,7 @@ func TestAccEC2Instance_blockDevices(t *testing.T) { rootVolumeSize := "11" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckInstanceDestroy(ctx), @@ -844,7 +844,7 @@ func TestAccEC2Instance_rootInstanceStore(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckInstanceDestroy(ctx), @@ -901,7 +901,7 @@ func TestAccEC2Instance_noAMIEphemeralDevices(t *testing.T) { } resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckInstanceDestroy(ctx), @@ -957,7 +957,7 @@ func TestAccEC2Instance_sourceDestCheck(t *testing.T) { } resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckInstanceDestroy(ctx), @@ -1000,7 +1000,7 @@ func TestAccEC2Instance_autoRecovery(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckInstanceDestroy(ctx), @@ -1038,7 +1038,7 @@ func TestAccEC2Instance_disableAPIStop(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckInstanceDestroy(ctx), @@ -1074,7 +1074,7 @@ func TestAccEC2Instance_disableAPITerminationFinalFalse(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckInstanceDestroy(ctx), @@ -1110,7 +1110,7 @@ func TestAccEC2Instance_disableAPITerminationFinalTrue(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckInstanceDestroy(ctx), @@ -1139,7 +1139,7 @@ func TestAccEC2Instance_dedicatedInstance(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckInstanceDestroy(ctx), @@ -1174,7 +1174,7 @@ func TestAccEC2Instance_outpost(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckOutpostsOutposts(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckOutpostsOutposts(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckInstanceDestroy(ctx), @@ -1203,7 +1203,7 @@ func TestAccEC2Instance_placementGroup(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckInstanceDestroy(ctx), @@ -1232,7 +1232,7 @@ func TestAccEC2Instance_placementPartitionNumber(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckInstanceDestroy(ctx), @@ -1262,7 +1262,7 @@ func TestAccEC2Instance_IPv6_supportAddressCount(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckInstanceDestroy(ctx), @@ -1289,7 +1289,7 @@ func TestAccEC2Instance_ipv6AddressCountAndSingleAddressCausesError(t *testing.T rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckInstanceDestroy(ctx), @@ -1309,7 +1309,7 @@ func TestAccEC2Instance_IPv6_supportAddressCountWithIPv4(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckInstanceDestroy(ctx), @@ -1338,7 +1338,7 @@ func TestAccEC2Instance_networkInstanceSecurityGroups(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckInstanceDestroy(ctx), @@ -1366,7 +1366,7 @@ func TestAccEC2Instance_networkInstanceRemovingAllSecurityGroups(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckInstanceDestroy(ctx), @@ -1405,7 +1405,7 @@ func TestAccEC2Instance_networkInstanceVPCSecurityGroupIDs(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckInstanceDestroy(ctx), @@ -1435,7 +1435,7 @@ func TestAccEC2Instance_BlockDeviceTags_volumeTags(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckInstanceDestroy(ctx), @@ -1489,7 +1489,7 @@ func TestAccEC2Instance_BlockDeviceTags_withAttachedVolume(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckInstanceDestroy(ctx), @@ -1539,7 +1539,7 @@ func TestAccEC2Instance_BlockDeviceTags_ebsAndRoot(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckInstanceDestroy(ctx), @@ -1608,7 +1608,7 @@ func TestAccEC2Instance_instanceProfileChange(t *testing.T) { } resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckInstanceDestroy(ctx), @@ -1666,7 +1666,7 @@ func TestAccEC2Instance_withIAMInstanceProfile(t *testing.T) { } resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckInstanceDestroy(ctx), @@ -1696,7 +1696,7 @@ func TestAccEC2Instance_withIAMInstanceProfilePath(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckInstanceDestroy(ctx), @@ -1734,7 +1734,7 @@ func TestAccEC2Instance_privateIP(t *testing.T) { } resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckInstanceDestroy(ctx), @@ -1773,7 +1773,7 @@ func TestAccEC2Instance_associatePublicIPAndPrivateIP(t *testing.T) { } resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckInstanceDestroy(ctx), @@ -1814,7 +1814,7 @@ func TestAccEC2Instance_Empty_privateIP(t *testing.T) { } resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckInstanceDestroy(ctx), @@ -1843,7 +1843,7 @@ func TestAccEC2Instance_PrivateDNSNameOptions_computed(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckInstanceDestroy(ctx), @@ -1875,7 +1875,7 @@ func TestAccEC2Instance_PrivateDNSNameOptions_configured(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckInstanceDestroy(ctx), @@ -1915,7 +1915,7 @@ func TestAccEC2Instance_keyPairCheck(t *testing.T) { } resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckInstanceDestroy(ctx), @@ -1938,7 +1938,7 @@ func TestAccEC2Instance_rootBlockDeviceMismatch(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckRegion(t, endpoints.UsWest2RegionID) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckRegion(t, endpoints.UsWest2RegionID) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckInstanceDestroy(ctx), @@ -1977,7 +1977,7 @@ func TestAccEC2Instance_forceNewAndTagsDrift(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckInstanceDestroy(ctx), @@ -2014,7 +2014,7 @@ func TestAccEC2Instance_changeInstanceType(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckInstanceDestroy(ctx), @@ -2056,7 +2056,7 @@ func TestAccEC2Instance_changeInstanceTypeAndUserData(t *testing.T) { expectedUserDataUpdated := hex.EncodeToString(hash2[:]) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckInstanceDestroy(ctx), @@ -2094,7 +2094,7 @@ func TestAccEC2Instance_changeInstanceTypeAndUserDataBase64(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckInstanceDestroy(ctx), @@ -2132,7 +2132,7 @@ func TestAccEC2Instance_EBSRootDevice_basic(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckInstanceDestroy(ctx), @@ -2169,7 +2169,7 @@ func TestAccEC2Instance_EBSRootDevice_modifySize(t *testing.T) { updatedSize := "32" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckInstanceDestroy(ctx), @@ -2211,7 +2211,7 @@ func TestAccEC2Instance_EBSRootDevice_modifyType(t *testing.T) { updatedType := "standard" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckInstanceDestroy(ctx), @@ -2254,7 +2254,7 @@ func TestAccEC2Instance_EBSRootDeviceModifyIOPS_io1(t *testing.T) { updatedIOPS := "200" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckInstanceDestroy(ctx), @@ -2299,7 +2299,7 @@ func TestAccEC2Instance_EBSRootDeviceModifyIOPS_io2(t *testing.T) { updatedIOPS := "200" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckInstanceDestroy(ctx), @@ -2344,7 +2344,7 @@ func TestAccEC2Instance_EBSRootDeviceModifyThroughput_gp3(t *testing.T) { updatedThroughput := "300" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckInstanceDestroy(ctx), @@ -2388,7 +2388,7 @@ func TestAccEC2Instance_EBSRootDevice_modifyDeleteOnTermination(t *testing.T) { updatedDeleteOnTermination := "true" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckInstanceDestroy(ctx), @@ -2435,7 +2435,7 @@ func TestAccEC2Instance_EBSRootDevice_modifyAll(t *testing.T) { updatedDeleteOnTermination := "true" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckInstanceDestroy(ctx), @@ -2477,7 +2477,7 @@ func TestAccEC2Instance_EBSRootDeviceMultipleBlockDevices_modifySize(t *testing. updatedRootVolumeSize := "14" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckInstanceDestroy(ctx), @@ -2532,7 +2532,7 @@ func TestAccEC2Instance_EBSRootDeviceMultipleBlockDevices_modifyDeleteOnTerminat updatedDeleteOnTermination := "true" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckInstanceDestroy(ctx), @@ -2584,7 +2584,7 @@ func TestAccEC2Instance_EBSRootDevice_multipleDynamicEBSBlockDevices(t *testing. rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckInstanceDestroy(ctx), @@ -2654,7 +2654,7 @@ func TestAccEC2Instance_gp3RootBlockDevice(t *testing.T) { } resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckInstanceDestroy(ctx), @@ -2690,7 +2690,7 @@ func TestAccEC2Instance_primaryNetworkInterface(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckInstanceDestroy(ctx), @@ -2727,7 +2727,7 @@ func TestAccEC2Instance_networkCardIndex(t *testing.T) { // Only specialized (and expensive) instance types support multiple network cards (and hence network_card_index > 0). // Don't attempt to test with such instance types. resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckInstanceDestroy(ctx), @@ -2762,7 +2762,7 @@ func TestAccEC2Instance_primaryNetworkInterfaceSourceDestCheck(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckInstanceDestroy(ctx), @@ -2797,7 +2797,7 @@ func TestAccEC2Instance_addSecondaryInterface(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckInstanceDestroy(ctx), @@ -2837,7 +2837,7 @@ func TestAccEC2Instance_addSecurityGroupNetworkInterface(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckInstanceDestroy(ctx), @@ -2874,7 +2874,7 @@ func TestAccEC2Instance_NewNetworkInterface_publicIPAndSecondaryPrivateIPs(t *te rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckInstanceDestroy(ctx), @@ -2916,7 +2916,7 @@ func TestAccEC2Instance_NewNetworkInterface_emptyPrivateIPAndSecondaryPrivateIPs secondaryIPs := fmt.Sprintf("%q, %q", "10.1.1.42", "10.1.1.43") resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckInstanceDestroy(ctx), @@ -2949,7 +2949,7 @@ func TestAccEC2Instance_NewNetworkInterface_emptyPrivateIPAndSecondaryPrivateIPs secondaryIPs := fmt.Sprintf("%s, %q", secondaryIP, "10.1.1.43") resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckInstanceDestroy(ctx), @@ -2998,7 +2998,7 @@ func TestAccEC2Instance_NewNetworkInterface_privateIPAndSecondaryPrivateIPs(t *t secondaryIPs := fmt.Sprintf("%q, %q", "10.1.1.43", "10.1.1.44") resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckInstanceDestroy(ctx), @@ -3032,7 +3032,7 @@ func TestAccEC2Instance_NewNetworkInterface_privateIPAndSecondaryPrivateIPsUpdat secondaryIPs := fmt.Sprintf("%s, %q", secondaryIP, "10.1.1.44") resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckInstanceDestroy(ctx), @@ -3079,7 +3079,7 @@ func TestAccEC2Instance_AssociatePublic_defaultPrivate(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckInstanceDestroy(ctx), @@ -3110,7 +3110,7 @@ func TestAccEC2Instance_AssociatePublic_defaultPublic(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckInstanceDestroy(ctx), @@ -3141,7 +3141,7 @@ func TestAccEC2Instance_AssociatePublic_explicitPublic(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckInstanceDestroy(ctx), @@ -3172,7 +3172,7 @@ func TestAccEC2Instance_AssociatePublic_explicitPrivate(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckInstanceDestroy(ctx), @@ -3203,7 +3203,7 @@ func TestAccEC2Instance_AssociatePublic_overridePublic(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckInstanceDestroy(ctx), @@ -3234,7 +3234,7 @@ func TestAccEC2Instance_AssociatePublic_overridePrivate(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckInstanceDestroy(ctx), @@ -3267,7 +3267,7 @@ func TestAccEC2Instance_LaunchTemplate_basic(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckInstanceDestroy(ctx), @@ -3297,7 +3297,7 @@ func TestAccEC2Instance_LaunchTemplate_overrideTemplate(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckInstanceDestroy(ctx), @@ -3323,7 +3323,7 @@ func TestAccEC2Instance_LaunchTemplate_setSpecificVersion(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckInstanceDestroy(ctx), @@ -3357,7 +3357,7 @@ func TestAccEC2Instance_LaunchTemplateModifyTemplate_defaultVersion(t *testing.T rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckInstanceDestroy(ctx), @@ -3391,7 +3391,7 @@ func TestAccEC2Instance_LaunchTemplate_updateTemplateVersion(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckInstanceDestroy(ctx), @@ -3425,7 +3425,7 @@ func TestAccEC2Instance_LaunchTemplate_swapIDAndName(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckInstanceDestroy(ctx), @@ -3459,7 +3459,7 @@ func TestAccEC2Instance_LaunchTemplate_withIAMInstanceProfile(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckInstanceDestroy(ctx), @@ -3484,7 +3484,7 @@ func TestAccEC2Instance_LaunchTemplate_spotAndStop(t *testing.T) { rName := sdkacctest.RandomWithPrefix("tf-acc-test") resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckInstanceDestroy(ctx), @@ -3512,7 +3512,7 @@ func TestAccEC2Instance_GetPasswordData_falseToTrue(t *testing.T) { } resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckInstanceDestroy(ctx), @@ -3556,7 +3556,7 @@ func TestAccEC2Instance_GetPasswordData_trueToFalse(t *testing.T) { } resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckInstanceDestroy(ctx), @@ -3599,7 +3599,7 @@ func TestAccEC2Instance_CreditSpecificationEmpty_nonBurstable(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckInstanceDestroy(ctx), @@ -3628,7 +3628,7 @@ func TestAccEC2Instance_CreditSpecificationUnspecifiedToEmpty_nonBurstable(t *te rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckInstanceDestroy(ctx), @@ -3662,7 +3662,7 @@ func TestAccEC2Instance_CreditSpecification_unspecifiedDefaultsToStandard(t *tes rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckInstanceDestroy(ctx), @@ -3692,7 +3692,7 @@ func TestAccEC2Instance_CreditSpecification_standardCPUCredits(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckInstanceDestroy(ctx), @@ -3730,7 +3730,7 @@ func TestAccEC2Instance_CreditSpecification_unlimitedCPUCredits(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckInstanceDestroy(ctx), @@ -3768,7 +3768,7 @@ func TestAccEC2Instance_CreditSpecificationUnknownCPUCredits_t2(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckInstanceDestroy(ctx), @@ -3798,7 +3798,7 @@ func TestAccEC2Instance_CreditSpecificationUnknownCPUCredits_t3(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckInstanceDestroy(ctx), @@ -3828,7 +3828,7 @@ func TestAccEC2Instance_CreditSpecificationUnknownCPUCredits_t3a(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckInstanceDestroy(ctx), @@ -3858,7 +3858,7 @@ func TestAccEC2Instance_CreditSpecificationUnknownCPUCredits_t4g(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckInstanceDestroy(ctx), @@ -3888,7 +3888,7 @@ func TestAccEC2Instance_CreditSpecification_updateCPUCredits(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckInstanceDestroy(ctx), @@ -3934,7 +3934,7 @@ func TestAccEC2Instance_CreditSpecification_isNotAppliedToNonBurstable(t *testin rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckInstanceDestroy(ctx), @@ -3962,7 +3962,7 @@ func TestAccEC2Instance_CreditSpecificationT3_unspecifiedDefaultsToUnlimited(t * rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckInstanceDestroy(ctx), @@ -3992,7 +3992,7 @@ func TestAccEC2Instance_CreditSpecificationT3_standardCPUCredits(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckInstanceDestroy(ctx), @@ -4030,7 +4030,7 @@ func TestAccEC2Instance_CreditSpecificationT3_unlimitedCPUCredits(t *testing.T) rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckInstanceDestroy(ctx), @@ -4068,7 +4068,7 @@ func TestAccEC2Instance_CreditSpecificationT3_updateCPUCredits(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckInstanceDestroy(ctx), @@ -4114,7 +4114,7 @@ func TestAccEC2Instance_CreditSpecificationStandardCPUCredits_t2Tot3Taint(t *tes rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckInstanceDestroy(ctx), @@ -4153,7 +4153,7 @@ func TestAccEC2Instance_CreditSpecificationUnlimitedCPUCredits_t2Tot3Taint(t *te rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckInstanceDestroy(ctx), @@ -4192,7 +4192,7 @@ func TestAccEC2Instance_UserData(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckInstanceDestroy(ctx), @@ -4220,7 +4220,7 @@ func TestAccEC2Instance_UserData_update(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckInstanceDestroy(ctx), @@ -4254,7 +4254,7 @@ func TestAccEC2Instance_UserData_stringToEncodedString(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckInstanceDestroy(ctx), @@ -4288,7 +4288,7 @@ func TestAccEC2Instance_UserData_emptyStringToUnspecified(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckInstanceDestroy(ctx), @@ -4322,7 +4322,7 @@ func TestAccEC2Instance_UserData_unspecifiedToEmptyString(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckInstanceDestroy(ctx), @@ -4356,7 +4356,7 @@ func TestAccEC2Instance_UserDataReplaceOnChange_On(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckInstanceDestroy(ctx), @@ -4392,7 +4392,7 @@ func TestAccEC2Instance_UserDataReplaceOnChange_On_Base64(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckInstanceDestroy(ctx), @@ -4428,7 +4428,7 @@ func TestAccEC2Instance_UserDataReplaceOnChange_Off(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckInstanceDestroy(ctx), @@ -4464,7 +4464,7 @@ func TestAccEC2Instance_UserDataReplaceOnChange_Off_Base64(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckInstanceDestroy(ctx), @@ -4500,7 +4500,7 @@ func TestAccEC2Instance_hibernation(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckInstanceDestroy(ctx), @@ -4537,7 +4537,7 @@ func TestAccEC2Instance_metadataOptions(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckInstanceDestroy(ctx), @@ -4592,7 +4592,7 @@ func TestAccEC2Instance_enclaveOptions(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckInstanceDestroy(ctx), @@ -4631,7 +4631,7 @@ func TestAccEC2Instance_CapacityReservation_unspecifiedDefaultsToOpen(t *testing rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckInstanceDestroy(ctx), @@ -4668,7 +4668,7 @@ func TestAccEC2Instance_CapacityReservationPreference_open(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckInstanceDestroy(ctx), @@ -4699,7 +4699,7 @@ func TestAccEC2Instance_CapacityReservationPreference_none(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckInstanceDestroy(ctx), @@ -4730,7 +4730,7 @@ func TestAccEC2Instance_CapacityReservation_targetID(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckInstanceDestroy(ctx), @@ -4762,7 +4762,7 @@ func TestAccEC2Instance_CapacityReservation_modifyPreference(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckInstanceDestroy(ctx), @@ -4803,7 +4803,7 @@ func TestAccEC2Instance_CapacityReservation_modifyTarget(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckInstanceDestroy(ctx), 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 c216a19121c5..7db0a363bdf2 100644 --- a/internal/service/ec2/ec2_instance_type_data_source_test.go +++ b/internal/service/ec2/ec2_instance_type_data_source_test.go @@ -12,7 +12,7 @@ func TestAccEC2InstanceTypeDataSource_basic(t *testing.T) { dataSourceName := "data.aws_ec2_instance_type.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ @@ -73,7 +73,7 @@ func TestAccEC2InstanceTypeDataSource_metal(t *testing.T) { dataSourceName := "data.aws_ec2_instance_type.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ @@ -101,7 +101,7 @@ func TestAccEC2InstanceTypeDataSource_gpu(t *testing.T) { dataSourceName := "data.aws_ec2_instance_type.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ @@ -123,7 +123,7 @@ func TestAccEC2InstanceTypeDataSource_fpga(t *testing.T) { dataSourceName := "data.aws_ec2_instance_type.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ 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 caa1ad5f3c54..9111d6a84e24 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 @@ -13,7 +13,7 @@ func TestAccEC2InstanceTypeOfferingDataSource_filter(t *testing.T) { dataSourceName := "data.aws_ec2_instance_type_offering.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckInstanceTypeOfferings(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckInstanceTypeOfferings(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: nil, @@ -33,7 +33,7 @@ func TestAccEC2InstanceTypeOfferingDataSource_locationType(t *testing.T) { dataSourceName := "data.aws_ec2_instance_type_offering.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckInstanceTypeOfferings(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckInstanceTypeOfferings(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: nil, @@ -53,7 +53,7 @@ func TestAccEC2InstanceTypeOfferingDataSource_preferredInstanceTypes(t *testing. dataSourceName := "data.aws_ec2_instance_type_offering.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckInstanceTypeOfferings(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckInstanceTypeOfferings(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: nil, 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 4d2de3cdfb1d..553997c2008c 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 @@ -16,7 +16,7 @@ func TestAccEC2InstanceTypeOfferingsDataSource_filter(t *testing.T) { dataSourceName := "data.aws_ec2_instance_type_offerings.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckInstanceTypeOfferings(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckInstanceTypeOfferings(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: nil, @@ -38,7 +38,7 @@ func TestAccEC2InstanceTypeOfferingsDataSource_locationType(t *testing.T) { dataSourceName := "data.aws_ec2_instance_type_offerings.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckInstanceTypeOfferings(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckInstanceTypeOfferings(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: nil, 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 7d87665ee3fe..9028f3a4cbf6 100644 --- a/internal/service/ec2/ec2_instance_types_data_source_test.go +++ b/internal/service/ec2/ec2_instance_types_data_source_test.go @@ -15,7 +15,7 @@ func TestAccEC2InstanceTypesDataSource_basic(t *testing.T) { dataSourceName := "data.aws_ec2_instance_types.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckInstanceTypes(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckInstanceTypes(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: nil, @@ -35,7 +35,7 @@ func TestAccEC2InstanceTypesDataSource_filter(t *testing.T) { dataSourceName := "data.aws_ec2_instance_types.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckInstanceTypes(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckInstanceTypes(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: nil, diff --git a/internal/service/ec2/ec2_instances_data_source_test.go b/internal/service/ec2/ec2_instances_data_source_test.go index f19a27aeeb58..7827c499a709 100644 --- a/internal/service/ec2/ec2_instances_data_source_test.go +++ b/internal/service/ec2/ec2_instances_data_source_test.go @@ -14,7 +14,7 @@ func TestAccEC2InstancesDataSource_basic(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ @@ -35,7 +35,7 @@ func TestAccEC2InstancesDataSource_tags(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ @@ -53,7 +53,7 @@ func TestAccEC2InstancesDataSource_instanceStateNames(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ @@ -71,7 +71,7 @@ func TestAccEC2InstancesDataSource_empty(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ @@ -91,7 +91,7 @@ func TestAccEC2InstancesDataSource_timeout(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ 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 6dd3f2ec6f73..7d7f775c1950 100644 --- a/internal/service/ec2/ec2_key_pair_data_source_test.go +++ b/internal/service/ec2/ec2_key_pair_data_source_test.go @@ -24,7 +24,7 @@ func TestAccEC2KeyPairDataSource_basic(t *testing.T) { } resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ @@ -65,7 +65,7 @@ func TestAccEC2KeyPairDataSource_includePublicKey(t *testing.T) { } resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ diff --git a/internal/service/ec2/ec2_key_pair_test.go b/internal/service/ec2/ec2_key_pair_test.go index 87e5d5e35774..b319a7714746 100644 --- a/internal/service/ec2/ec2_key_pair_test.go +++ b/internal/service/ec2/ec2_key_pair_test.go @@ -28,7 +28,7 @@ func TestAccEC2KeyPair_basic(t *testing.T) { } resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckKeyPairDestroy(ctx), @@ -66,7 +66,7 @@ func TestAccEC2KeyPair_tags(t *testing.T) { } resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckKeyPairDestroy(ctx), @@ -117,7 +117,7 @@ func TestAccEC2KeyPair_nameGenerated(t *testing.T) { } resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckKeyPairDestroy(ctx), @@ -151,7 +151,7 @@ func TestAccEC2KeyPair_namePrefix(t *testing.T) { } resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckKeyPairDestroy(ctx), @@ -186,7 +186,7 @@ func TestAccEC2KeyPair_disappears(t *testing.T) { } resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckKeyPairDestroy(ctx), 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 ed3ebbcf64c7..5526015e396e 100644 --- a/internal/service/ec2/ec2_launch_template_data_source_test.go +++ b/internal/service/ec2/ec2_launch_template_data_source_test.go @@ -17,7 +17,7 @@ func TestAccEC2LaunchTemplateDataSource_name(t *testing.T) { resourceName := "aws_launch_template.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckLaunchTemplateDestroy(ctx), @@ -75,7 +75,7 @@ func TestAccEC2LaunchTemplateDataSource_id(t *testing.T) { resourceName := "aws_launch_template.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckLaunchTemplateDestroy(ctx), @@ -98,7 +98,7 @@ func TestAccEC2LaunchTemplateDataSource_filter(t *testing.T) { resourceName := "aws_launch_template.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckLaunchTemplateDestroy(ctx), @@ -121,7 +121,7 @@ func TestAccEC2LaunchTemplateDataSource_tags(t *testing.T) { resourceName := "aws_launch_template.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckLaunchTemplateDestroy(ctx), diff --git a/internal/service/ec2/ec2_launch_template_test.go b/internal/service/ec2/ec2_launch_template_test.go index b8dcee991527..de399b719300 100644 --- a/internal/service/ec2/ec2_launch_template_test.go +++ b/internal/service/ec2/ec2_launch_template_test.go @@ -23,7 +23,7 @@ func TestAccEC2LaunchTemplate_basic(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckLaunchTemplateDestroy(ctx), @@ -87,7 +87,7 @@ func TestAccEC2LaunchTemplate_Name_generated(t *testing.T) { resourceName := "aws_launch_template.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckLaunchTemplateDestroy(ctx), @@ -115,7 +115,7 @@ func TestAccEC2LaunchTemplate_Name_prefix(t *testing.T) { resourceName := "aws_launch_template.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckLaunchTemplateDestroy(ctx), @@ -144,7 +144,7 @@ func TestAccEC2LaunchTemplate_disappears(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckLaunchTemplateDestroy(ctx), @@ -168,7 +168,7 @@ func TestAccEC2LaunchTemplate_BlockDeviceMappings_ebs(t *testing.T) { resourceName := "aws_launch_template.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckLaunchTemplateDestroy(ctx), @@ -203,7 +203,7 @@ func TestAccEC2LaunchTemplate_BlockDeviceMappingsEBS_deleteOnTermination(t *test resourceName := "aws_launch_template.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckLaunchTemplateDestroy(ctx), @@ -246,7 +246,7 @@ func TestAccEC2LaunchTemplate_BlockDeviceMappingsEBS_gp3(t *testing.T) { resourceName := "aws_launch_template.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckLaunchTemplateDestroy(ctx), @@ -280,7 +280,7 @@ func TestAccEC2LaunchTemplate_ebsOptimized(t *testing.T) { resourceName := "aws_launch_template.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckLaunchTemplateDestroy(ctx), @@ -336,7 +336,7 @@ func TestAccEC2LaunchTemplate_elasticInferenceAccelerator(t *testing.T) { resourceName := "aws_launch_template.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckLaunchTemplateDestroy(ctx), @@ -373,7 +373,7 @@ func TestAccEC2LaunchTemplate_NetworkInterfaces_deleteOnTermination(t *testing.T resourceName := "aws_launch_template.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckLaunchTemplateDestroy(ctx), @@ -430,7 +430,7 @@ func TestAccEC2LaunchTemplate_data(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckLaunchTemplateDestroy(ctx), @@ -478,7 +478,7 @@ func TestAccEC2LaunchTemplate_description(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckLaunchTemplateDestroy(ctx), @@ -514,7 +514,7 @@ func TestAccEC2LaunchTemplate_update(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckLaunchTemplateDestroy(ctx), @@ -555,7 +555,7 @@ func TestAccEC2LaunchTemplate_tags(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckLaunchTemplateDestroy(ctx), @@ -601,7 +601,7 @@ func TestAccEC2LaunchTemplate_CapacityReservation_preference(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckLaunchTemplateDestroy(ctx), @@ -631,7 +631,7 @@ func TestAccEC2LaunchTemplate_CapacityReservation_target(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckLaunchTemplateDestroy(ctx), @@ -663,7 +663,7 @@ func TestAccEC2LaunchTemplate_cpuOptions(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckLaunchTemplateDestroy(ctx), @@ -685,7 +685,7 @@ func TestAccEC2LaunchTemplate_CreditSpecification_nonBurstable(t *testing.T) { resourceName := "aws_launch_template.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckLaunchTemplateDestroy(ctx), @@ -713,7 +713,7 @@ func TestAccEC2LaunchTemplate_CreditSpecification_t2(t *testing.T) { resourceName := "aws_launch_template.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckLaunchTemplateDestroy(ctx), @@ -742,7 +742,7 @@ func TestAccEC2LaunchTemplate_CreditSpecification_t3(t *testing.T) { resourceName := "aws_launch_template.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckLaunchTemplateDestroy(ctx), @@ -771,7 +771,7 @@ func TestAccEC2LaunchTemplate_CreditSpecification_t4g(t *testing.T) { resourceName := "aws_launch_template.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckLaunchTemplateDestroy(ctx), @@ -801,7 +801,7 @@ func TestAccEC2LaunchTemplate_IAMInstanceProfile_emptyBlock(t *testing.T) { resourceName := "aws_launch_template.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckLaunchTemplateDestroy(ctx), @@ -824,7 +824,7 @@ func TestAccEC2LaunchTemplate_networkInterface(t *testing.T) { resourceName := "aws_launch_template.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckLaunchTemplateDestroy(ctx), @@ -871,7 +871,7 @@ func TestAccEC2LaunchTemplate_networkInterfaceAddresses(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckLaunchTemplateDestroy(ctx), @@ -902,7 +902,7 @@ func TestAccEC2LaunchTemplate_networkInterfaceType(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckLaunchTemplateDestroy(ctx), @@ -931,7 +931,7 @@ func TestAccEC2LaunchTemplate_networkInterfaceCardIndex(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckLaunchTemplateDestroy(ctx), @@ -961,7 +961,7 @@ func TestAccEC2LaunchTemplate_networkInterfaceIPv4PrefixCount(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckLaunchTemplateDestroy(ctx), @@ -990,7 +990,7 @@ func TestAccEC2LaunchTemplate_networkInterfaceIPv4Prefixes(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckLaunchTemplateDestroy(ctx), @@ -1019,7 +1019,7 @@ func TestAccEC2LaunchTemplate_networkInterfaceIPv6PrefixCount(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckLaunchTemplateDestroy(ctx), @@ -1048,7 +1048,7 @@ func TestAccEC2LaunchTemplate_networkInterfaceIPv6Prefixes(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckLaunchTemplateDestroy(ctx), @@ -1077,7 +1077,7 @@ func TestAccEC2LaunchTemplate_associatePublicIPAddress(t *testing.T) { resourceName := "aws_launch_template.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckLaunchTemplateDestroy(ctx), @@ -1128,7 +1128,7 @@ func TestAccEC2LaunchTemplate_associateCarrierIPAddress(t *testing.T) { resourceName := "aws_launch_template.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckLaunchTemplateDestroy(ctx), @@ -1179,7 +1179,7 @@ func TestAccEC2LaunchTemplate_Placement_hostResourceGroupARN(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckLaunchTemplateDestroy(ctx), @@ -1207,7 +1207,7 @@ func TestAccEC2LaunchTemplate_Placement_partitionNum(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckLaunchTemplateDestroy(ctx), @@ -1242,7 +1242,7 @@ func TestAccEC2LaunchTemplate_privateDNSNameOptions(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckLaunchTemplateDestroy(ctx), @@ -1273,7 +1273,7 @@ func TestAccEC2LaunchTemplate_NetworkInterface_ipv6Addresses(t *testing.T) { resourceName := "aws_launch_template.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckLaunchTemplateDestroy(ctx), @@ -1302,7 +1302,7 @@ func TestAccEC2LaunchTemplate_NetworkInterface_ipv6AddressCount(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckLaunchTemplateDestroy(ctx), @@ -1332,7 +1332,7 @@ func TestAccEC2LaunchTemplate_instanceMarketOptions(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckLaunchTemplateDestroy(ctx), @@ -1372,7 +1372,7 @@ func TestAccEC2LaunchTemplate_instanceRequirements_memoryMiBAndVCPUCount(t *test resourceName := "aws_launch_template.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckLaunchTemplateDestroy(ctx), @@ -1435,7 +1435,7 @@ func TestAccEC2LaunchTemplate_instanceRequirements_acceleratorCount(t *testing.T resourceName := "aws_launch_template.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckLaunchTemplateDestroy(ctx), @@ -1521,7 +1521,7 @@ func TestAccEC2LaunchTemplate_instanceRequirements_acceleratorManufacturers(t *t resourceName := "aws_launch_template.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckLaunchTemplateDestroy(ctx), @@ -1581,7 +1581,7 @@ func TestAccEC2LaunchTemplate_instanceRequirements_acceleratorNames(t *testing.T resourceName := "aws_launch_template.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckLaunchTemplateDestroy(ctx), @@ -1644,7 +1644,7 @@ func TestAccEC2LaunchTemplate_instanceRequirements_acceleratorTotalMemoryMiB(t * resourceName := "aws_launch_template.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckLaunchTemplateDestroy(ctx), @@ -1730,7 +1730,7 @@ func TestAccEC2LaunchTemplate_instanceRequirements_acceleratorTypes(t *testing.T resourceName := "aws_launch_template.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckLaunchTemplateDestroy(ctx), @@ -1789,7 +1789,7 @@ func TestAccEC2LaunchTemplate_instanceRequirements_bareMetal(t *testing.T) { resourceName := "aws_launch_template.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckLaunchTemplateDestroy(ctx), @@ -1864,7 +1864,7 @@ func TestAccEC2LaunchTemplate_instanceRequirements_baselineEBSBandwidthMbps(t *t resourceName := "aws_launch_template.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckLaunchTemplateDestroy(ctx), @@ -1950,7 +1950,7 @@ func TestAccEC2LaunchTemplate_instanceRequirements_burstablePerformance(t *testi resourceName := "aws_launch_template.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckLaunchTemplateDestroy(ctx), @@ -2025,7 +2025,7 @@ func TestAccEC2LaunchTemplate_instanceRequirements_cpuManufacturers(t *testing.T resourceName := "aws_launch_template.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckLaunchTemplateDestroy(ctx), @@ -2084,7 +2084,7 @@ func TestAccEC2LaunchTemplate_instanceRequirements_excludedInstanceTypes(t *test resourceName := "aws_launch_template.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckLaunchTemplateDestroy(ctx), @@ -2143,7 +2143,7 @@ func TestAccEC2LaunchTemplate_instanceRequirements_instanceGenerations(t *testin resourceName := "aws_launch_template.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckLaunchTemplateDestroy(ctx), @@ -2201,7 +2201,7 @@ func TestAccEC2LaunchTemplate_instanceRequirements_localStorage(t *testing.T) { resourceName := "aws_launch_template.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckLaunchTemplateDestroy(ctx), @@ -2276,7 +2276,7 @@ func TestAccEC2LaunchTemplate_instanceRequirements_localStorageTypes(t *testing. resourceName := "aws_launch_template.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckLaunchTemplateDestroy(ctx), @@ -2334,7 +2334,7 @@ func TestAccEC2LaunchTemplate_instanceRequirements_memoryGiBPerVCPU(t *testing.T resourceName := "aws_launch_template.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckLaunchTemplateDestroy(ctx), @@ -2420,7 +2420,7 @@ func TestAccEC2LaunchTemplate_instanceRequirements_networkInterfaceCount(t *test resourceName := "aws_launch_template.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckLaunchTemplateDestroy(ctx), @@ -2506,7 +2506,7 @@ func TestAccEC2LaunchTemplate_instanceRequirements_onDemandMaxPricePercentageOve resourceName := "aws_launch_template.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckLaunchTemplateDestroy(ctx), @@ -2541,7 +2541,7 @@ func TestAccEC2LaunchTemplate_instanceRequirements_requireHibernateSupport(t *te resourceName := "aws_launch_template.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckLaunchTemplateDestroy(ctx), @@ -2596,7 +2596,7 @@ func TestAccEC2LaunchTemplate_instanceRequirements_spotMaxPricePercentageOverLow resourceName := "aws_launch_template.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckLaunchTemplateDestroy(ctx), @@ -2631,7 +2631,7 @@ func TestAccEC2LaunchTemplate_instanceRequirements_totalLocalStorageGB(t *testin resourceName := "aws_launch_template.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckLaunchTemplateDestroy(ctx), @@ -2719,7 +2719,7 @@ func TestAccEC2LaunchTemplate_licenseSpecification(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckIAMServiceLinkedRole(ctx, t, "/aws-service-role/license-manager.amazonaws.com") }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), @@ -2749,7 +2749,7 @@ func TestAccEC2LaunchTemplate_metadataOptions(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckLaunchTemplateDestroy(ctx), @@ -2811,7 +2811,7 @@ func TestAccEC2LaunchTemplate_enclaveOptions(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckLaunchTemplateDestroy(ctx), @@ -2853,7 +2853,7 @@ func TestAccEC2LaunchTemplate_hibernation(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckLaunchTemplateDestroy(ctx), @@ -2896,7 +2896,7 @@ func TestAccEC2LaunchTemplate_defaultVersion(t *testing.T) { descriptionNew := "Test Description 2" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckLaunchTemplateDestroy(ctx), @@ -2943,7 +2943,7 @@ func TestAccEC2LaunchTemplate_updateDefaultVersion(t *testing.T) { descriptionNew := "Test Description 2" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckLaunchTemplateDestroy(ctx), diff --git a/internal/service/ec2/ec2_placement_group_test.go b/internal/service/ec2/ec2_placement_group_test.go index 5e6abf0e71c2..958a66100fb9 100644 --- a/internal/service/ec2/ec2_placement_group_test.go +++ b/internal/service/ec2/ec2_placement_group_test.go @@ -22,7 +22,7 @@ func TestAccEC2PlacementGroup_basic(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckPlacementGroupDestroy(ctx), @@ -53,7 +53,7 @@ func TestAccEC2PlacementGroup_disappears(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckPlacementGroupDestroy(ctx), @@ -77,7 +77,7 @@ func TestAccEC2PlacementGroup_tags(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckPlacementGroupDestroy(ctx), @@ -122,7 +122,7 @@ func TestAccEC2PlacementGroup_partitionCount(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckPlacementGroupDestroy(ctx), @@ -152,7 +152,7 @@ func TestAccEC2PlacementGroup_spreadLevel(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckPlacementGroupDestroy(ctx), 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 2c524aceb2d5..f858f2df530e 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 @@ -17,7 +17,7 @@ import ( func TestAccEC2SerialConsoleAccessDataSource_basic(t *testing.T) { ctx := acctest.Context(t) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ diff --git a/internal/service/ec2/ec2_serial_console_access_test.go b/internal/service/ec2/ec2_serial_console_access_test.go index 29abb75a910c..5874fb9be4f4 100644 --- a/internal/service/ec2/ec2_serial_console_access_test.go +++ b/internal/service/ec2/ec2_serial_console_access_test.go @@ -18,7 +18,7 @@ func TestAccEC2SerialConsoleAccess_basic(t *testing.T) { resourceName := "aws_ec2_serial_console_access.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSerialConsoleAccessDestroy(ctx), diff --git a/internal/service/ec2/ec2_spot_datafeed_subscription_test.go b/internal/service/ec2/ec2_spot_datafeed_subscription_test.go index 801656be3d3f..064a2ddfd4d1 100644 --- a/internal/service/ec2/ec2_spot_datafeed_subscription_test.go +++ b/internal/service/ec2/ec2_spot_datafeed_subscription_test.go @@ -34,7 +34,7 @@ func testAccSpotDatafeedSubscription_basic(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckSpotDatafeedSubscription(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckSpotDatafeedSubscription(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSpotDatafeedSubscriptionDestroy(ctx), @@ -61,7 +61,7 @@ func testAccSpotDatafeedSubscription_disappears(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckSpotDatafeedSubscription(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckSpotDatafeedSubscription(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSpotDatafeedSubscriptionDestroy(ctx), diff --git a/internal/service/ec2/ec2_spot_fleet_request_test.go b/internal/service/ec2/ec2_spot_fleet_request_test.go index e94e1ed02d36..12c6dca5849f 100644 --- a/internal/service/ec2/ec2_spot_fleet_request_test.go +++ b/internal/service/ec2/ec2_spot_fleet_request_test.go @@ -33,7 +33,7 @@ func TestAccEC2SpotFleetRequest_basic(t *testing.T) { } resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckSpotFleetRequest(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckSpotFleetRequest(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSpotFleetRequestDestroy(ctx), @@ -72,7 +72,7 @@ func TestAccEC2SpotFleetRequest_targetCapacityUnitType(t *testing.T) { } resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckSpotFleetRequest(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckSpotFleetRequest(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSpotFleetRequestDestroy(ctx), @@ -111,7 +111,7 @@ func TestAccEC2SpotFleetRequest_disappears(t *testing.T) { } resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckSpotFleetRequest(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckSpotFleetRequest(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSpotFleetRequestDestroy(ctx), @@ -141,7 +141,7 @@ func TestAccEC2SpotFleetRequest_tags(t *testing.T) { } resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckSpotFleetRequest(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckSpotFleetRequest(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSpotFleetRequestDestroy(ctx), @@ -194,7 +194,7 @@ func TestAccEC2SpotFleetRequest_associatePublicIPAddress(t *testing.T) { } resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckSpotFleetRequest(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckSpotFleetRequest(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSpotFleetRequestDestroy(ctx), @@ -233,7 +233,7 @@ func TestAccEC2SpotFleetRequest_launchTemplate(t *testing.T) { } resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckSpotFleetRequest(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckSpotFleetRequest(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSpotFleetRequestDestroy(ctx), @@ -270,7 +270,7 @@ func TestAccEC2SpotFleetRequest_LaunchTemplate_multiple(t *testing.T) { } resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckSpotFleetRequest(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckSpotFleetRequest(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSpotFleetRequestDestroy(ctx), @@ -301,7 +301,7 @@ func TestAccEC2SpotFleetRequest_launchTemplateWithInstanceTypeOverrides(t *testi } resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckSpotFleetRequest(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckSpotFleetRequest(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSpotFleetRequestDestroy(ctx), @@ -352,7 +352,7 @@ func TestAccEC2SpotFleetRequest_launchTemplateWithInstanceRequirementsOverrides( } resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckSpotFleetRequest(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckSpotFleetRequest(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSpotFleetRequestDestroy(ctx), @@ -403,7 +403,7 @@ func TestAccEC2SpotFleetRequest_launchTemplateToLaunchSpec(t *testing.T) { } resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckSpotFleetRequest(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckSpotFleetRequest(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSpotFleetRequestDestroy(ctx), @@ -450,7 +450,7 @@ func TestAccEC2SpotFleetRequest_launchSpecToLaunchTemplate(t *testing.T) { } resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckSpotFleetRequest(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckSpotFleetRequest(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSpotFleetRequestDestroy(ctx), @@ -491,7 +491,7 @@ func TestAccEC2SpotFleetRequest_onDemandTargetCapacity(t *testing.T) { } resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckSpotFleetRequest(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckSpotFleetRequest(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSpotFleetRequestDestroy(ctx), @@ -540,7 +540,7 @@ func TestAccEC2SpotFleetRequest_onDemandMaxTotalPrice(t *testing.T) { } resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckSpotFleetRequest(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckSpotFleetRequest(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSpotFleetRequestDestroy(ctx), @@ -575,7 +575,7 @@ func TestAccEC2SpotFleetRequest_onDemandAllocationStrategy(t *testing.T) { } resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckSpotFleetRequest(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckSpotFleetRequest(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSpotFleetRequestDestroy(ctx), @@ -610,7 +610,7 @@ func TestAccEC2SpotFleetRequest_instanceInterruptionBehavior(t *testing.T) { } resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckSpotFleetRequest(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckSpotFleetRequest(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSpotFleetRequestDestroy(ctx), @@ -646,7 +646,7 @@ func TestAccEC2SpotFleetRequest_fleetType(t *testing.T) { } resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckSpotFleetRequest(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckSpotFleetRequest(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSpotFleetRequestDestroy(ctx), @@ -682,7 +682,7 @@ func TestAccEC2SpotFleetRequest_iamInstanceProfileARN(t *testing.T) { } resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckSpotFleetRequest(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckSpotFleetRequest(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSpotFleetRequestDestroy(ctx), @@ -718,7 +718,7 @@ func TestAccEC2SpotFleetRequest_changePriceForcesNewRequest(t *testing.T) { } resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckSpotFleetRequest(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckSpotFleetRequest(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSpotFleetRequestDestroy(ctx), @@ -765,7 +765,7 @@ func TestAccEC2SpotFleetRequest_updateTargetCapacity(t *testing.T) { } resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckSpotFleetRequest(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckSpotFleetRequest(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSpotFleetRequestDestroy(ctx), @@ -816,7 +816,7 @@ func TestAccEC2SpotFleetRequest_updateExcessCapacityTerminationPolicy(t *testing } resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckSpotFleetRequest(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckSpotFleetRequest(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSpotFleetRequestDestroy(ctx), @@ -859,7 +859,7 @@ func TestAccEC2SpotFleetRequest_lowestPriceAzOrSubnetInRegion(t *testing.T) { } resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckSpotFleetRequest(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckSpotFleetRequest(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSpotFleetRequestDestroy(ctx), @@ -896,7 +896,7 @@ func TestAccEC2SpotFleetRequest_lowestPriceAzInGivenList(t *testing.T) { } resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckSpotFleetRequest(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckSpotFleetRequest(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSpotFleetRequestDestroy(ctx), @@ -934,7 +934,7 @@ func TestAccEC2SpotFleetRequest_lowestPriceSubnetInGivenList(t *testing.T) { } resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckSpotFleetRequest(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckSpotFleetRequest(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSpotFleetRequestDestroy(ctx), @@ -972,7 +972,7 @@ func TestAccEC2SpotFleetRequest_multipleInstanceTypesInSameAz(t *testing.T) { } resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckSpotFleetRequest(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckSpotFleetRequest(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSpotFleetRequestDestroy(ctx), @@ -1013,7 +1013,7 @@ func TestAccEC2SpotFleetRequest_multipleInstanceTypesInSameSubnet(t *testing.T) } resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckSpotFleetRequest(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckSpotFleetRequest(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSpotFleetRequestDestroy(ctx), @@ -1050,7 +1050,7 @@ func TestAccEC2SpotFleetRequest_overridingSpotPrice(t *testing.T) { } resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckSpotFleetRequest(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckSpotFleetRequest(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSpotFleetRequestDestroy(ctx), @@ -1092,7 +1092,7 @@ func TestAccEC2SpotFleetRequest_withoutSpotPrice(t *testing.T) { } resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckSpotFleetRequest(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckSpotFleetRequest(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSpotFleetRequestDestroy(ctx), @@ -1128,7 +1128,7 @@ func TestAccEC2SpotFleetRequest_diversifiedAllocation(t *testing.T) { } resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckSpotFleetRequest(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckSpotFleetRequest(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSpotFleetRequestDestroy(ctx), @@ -1165,7 +1165,7 @@ func TestAccEC2SpotFleetRequest_multipleInstancePools(t *testing.T) { } resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckSpotFleetRequest(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckSpotFleetRequest(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSpotFleetRequestDestroy(ctx), @@ -1217,7 +1217,7 @@ func TestAccEC2SpotFleetRequest_withWeightedCapacity(t *testing.T) { } resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckSpotFleetRequest(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckSpotFleetRequest(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSpotFleetRequestDestroy(ctx), @@ -1262,7 +1262,7 @@ func TestAccEC2SpotFleetRequest_withEBSDisk(t *testing.T) { } resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckSpotFleetRequest(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckSpotFleetRequest(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSpotFleetRequestDestroy(ctx), @@ -1297,7 +1297,7 @@ func TestAccEC2SpotFleetRequest_LaunchSpecificationEBSBlockDevice_kmsKeyID(t *te } resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckSpotFleetRequest(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckSpotFleetRequest(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSpotFleetRequestDestroy(ctx), @@ -1331,7 +1331,7 @@ func TestAccEC2SpotFleetRequest_LaunchSpecificationRootBlockDevice_kmsKeyID(t *t } resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckSpotFleetRequest(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckSpotFleetRequest(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSpotFleetRequestDestroy(ctx), @@ -1364,7 +1364,7 @@ func TestAccEC2SpotFleetRequest_LaunchSpecification_ebsBlockDeviceGP3(t *testing } resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckSpotFleetRequest(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckSpotFleetRequest(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSpotFleetRequestDestroy(ctx), @@ -1404,7 +1404,7 @@ func TestAccEC2SpotFleetRequest_LaunchSpecification_rootBlockDeviceGP3(t *testin } resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckSpotFleetRequest(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckSpotFleetRequest(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSpotFleetRequestDestroy(ctx), @@ -1444,7 +1444,7 @@ func TestAccEC2SpotFleetRequest_withTags(t *testing.T) { } resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckSpotFleetRequest(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckSpotFleetRequest(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSpotFleetRequestDestroy(ctx), @@ -1484,7 +1484,7 @@ func TestAccEC2SpotFleetRequest_placementTenancyAndGroup(t *testing.T) { } resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckSpotFleetRequest(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckSpotFleetRequest(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSpotFleetRequestDestroy(ctx), @@ -1520,7 +1520,7 @@ func TestAccEC2SpotFleetRequest_withELBs(t *testing.T) { } resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckSpotFleetRequest(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckSpotFleetRequest(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSpotFleetRequestDestroy(ctx), @@ -1557,7 +1557,7 @@ func TestAccEC2SpotFleetRequest_withTargetGroups(t *testing.T) { } resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckSpotFleetRequest(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckSpotFleetRequest(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSpotFleetRequestDestroy(ctx), @@ -1594,7 +1594,7 @@ func TestAccEC2SpotFleetRequest_Zero_capacity(t *testing.T) { } resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckSpotFleetRequest(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckSpotFleetRequest(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSpotFleetRequestDestroy(ctx), @@ -1643,7 +1643,7 @@ func TestAccEC2SpotFleetRequest_capacityRebalance(t *testing.T) { } resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckSpotFleetRequest(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckSpotFleetRequest(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSpotFleetRequestDestroy(ctx), @@ -1678,7 +1678,7 @@ func TestAccEC2SpotFleetRequest_withInstanceStoreAMI(t *testing.T) { } resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckSpotFleetRequest(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckSpotFleetRequest(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSpotFleetRequestDestroy(ctx), @@ -1716,7 +1716,7 @@ func TestAccEC2SpotFleetRequest_noTerminateInstancesWithExpiration(t *testing.T) } resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckSpotFleetRequest(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckSpotFleetRequest(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSpotFleetRequestDestroy(ctx), diff --git a/internal/service/ec2/ec2_spot_instance_request_test.go b/internal/service/ec2/ec2_spot_instance_request_test.go index 9fb8cb3603a2..34021a3f8fc0 100644 --- a/internal/service/ec2/ec2_spot_instance_request_test.go +++ b/internal/service/ec2/ec2_spot_instance_request_test.go @@ -24,7 +24,7 @@ func TestAccEC2SpotInstanceRequest_basic(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSpotInstanceRequestDestroy(ctx), @@ -57,7 +57,7 @@ func TestAccEC2SpotInstanceRequest_disappears(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSpotInstanceRequestDestroy(ctx), @@ -81,7 +81,7 @@ func TestAccEC2SpotInstanceRequest_tags(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSpotInstanceRequestDestroy(ctx), @@ -134,7 +134,7 @@ func TestAccEC2SpotInstanceRequest_keyName(t *testing.T) { } resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSpotInstanceRequestDestroy(ctx), @@ -163,7 +163,7 @@ func TestAccEC2SpotInstanceRequest_withLaunchGroup(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSpotInstanceRequestDestroy(ctx), @@ -195,7 +195,7 @@ func TestAccEC2SpotInstanceRequest_withBlockDuration(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSpotInstanceRequestDestroy(ctx), @@ -227,7 +227,7 @@ func TestAccEC2SpotInstanceRequest_vpc(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSpotInstanceRequestDestroy(ctx), @@ -260,7 +260,7 @@ func TestAccEC2SpotInstanceRequest_validUntil(t *testing.T) { validUntil := testAccSpotInstanceRequestValidUntil(t) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSpotInstanceRequestDestroy(ctx), @@ -292,7 +292,7 @@ func TestAccEC2SpotInstanceRequest_withoutSpotPrice(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSpotInstanceRequestDestroy(ctx), @@ -323,7 +323,7 @@ func TestAccEC2SpotInstanceRequest_subnetAndSGAndPublicIPAddress(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSpotInstanceRequestDestroy(ctx), @@ -353,7 +353,7 @@ func TestAccEC2SpotInstanceRequest_networkInterfaceAttributes(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSpotInstanceRequestDestroy(ctx), @@ -389,7 +389,7 @@ func TestAccEC2SpotInstanceRequest_getPasswordData(t *testing.T) { } resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSpotInstanceRequestDestroy(ctx), @@ -418,7 +418,7 @@ func TestAccEC2SpotInstanceRequest_interruptStop(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSpotInstanceRequestDestroy(ctx), @@ -449,7 +449,7 @@ func TestAccEC2SpotInstanceRequest_interruptHibernate(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSpotInstanceRequestDestroy(ctx), @@ -480,7 +480,7 @@ func TestAccEC2SpotInstanceRequest_interruptUpdate(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSpotInstanceRequestDestroy(ctx), 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 064fa0c747c7..534fc610756f 100644 --- a/internal/service/ec2/ec2_spot_price_data_source_test.go +++ b/internal/service/ec2/ec2_spot_price_data_source_test.go @@ -17,7 +17,7 @@ func TestAccEC2SpotPriceDataSource_basic(t *testing.T) { dataSourceName := "data.aws_ec2_spot_price.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckSpotPrice(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckSpotPrice(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: nil, @@ -38,7 +38,7 @@ func TestAccEC2SpotPriceDataSource_filter(t *testing.T) { dataSourceName := "data.aws_ec2_spot_price.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckSpotPrice(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckSpotPrice(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: nil, diff --git a/internal/service/ec2/ipam_byoip_test.go b/internal/service/ec2/ipam_byoip_test.go index 2ad7e09e9132..663543e52851 100644 --- a/internal/service/ec2/ipam_byoip_test.go +++ b/internal/service/ec2/ipam_byoip_test.go @@ -49,7 +49,7 @@ func TestAccIPAM_byoipIPv6(t *testing.T) { netmaskLength := 56 resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckVPCIPv6CIDRBlockAssociationDestroy(ctx), diff --git a/internal/service/ec2/ipam_organization_admin_account_test.go b/internal/service/ec2/ipam_organization_admin_account_test.go index a904447b937d..be643f7fee25 100644 --- a/internal/service/ec2/ipam_organization_admin_account_test.go +++ b/internal/service/ec2/ipam_organization_admin_account_test.go @@ -23,7 +23,7 @@ func TestAccIPAMOrganizationAdminAccount_basic(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckAlternateAccount(t) }, ErrorCheck: acctest.ErrorCheck(t, organizations.EndpointsID), diff --git a/internal/service/ec2/ipam_pool_cidr_allocation_test.go b/internal/service/ec2/ipam_pool_cidr_allocation_test.go index 93cf75fa6f49..9815ea5a3e3b 100644 --- a/internal/service/ec2/ipam_pool_cidr_allocation_test.go +++ b/internal/service/ec2/ipam_pool_cidr_allocation_test.go @@ -25,7 +25,7 @@ func TestAccIPAMPoolCIDRAllocation_ipv4Basic(t *testing.T) { cidr := "172.2.0.0/28" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckIPAMPoolAllocationDestroy(ctx), @@ -56,7 +56,7 @@ func TestAccIPAMPoolCIDRAllocation_disappears(t *testing.T) { cidr := "172.2.0.0/28" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckIPAMPoolAllocationDestroy(ctx), @@ -80,7 +80,7 @@ func TestAccIPAMPoolCIDRAllocation_ipv4BasicNetmask(t *testing.T) { netmask := "28" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckIPAMPoolAllocationDestroy(ctx), @@ -111,7 +111,7 @@ func TestAccIPAMPoolCIDRAllocation_ipv4DisallowedCIDR(t *testing.T) { expectedCidr := "172.2.0.16/28" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: nil, @@ -141,7 +141,7 @@ func TestAccIPAMPoolCIDRAllocation_multiple(t *testing.T) { cidr2 := "10.1.0.0/28" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckIPAMPoolAllocationDestroy(ctx), @@ -184,7 +184,7 @@ func TestAccIPAMPoolCIDRAllocation_differentRegion(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckMultipleRegion(t, 2) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), diff --git a/internal/service/ec2/ipam_pool_cidr_test.go b/internal/service/ec2/ipam_pool_cidr_test.go index fe848efd02d4..6fe0ccd96ec5 100644 --- a/internal/service/ec2/ipam_pool_cidr_test.go +++ b/internal/service/ec2/ipam_pool_cidr_test.go @@ -23,7 +23,7 @@ func TestAccIPAMPoolCIDR_basic(t *testing.T) { cidrBlock := "10.0.0.0/24" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckIPAMPoolCIDRDestroy(ctx), @@ -55,7 +55,7 @@ func TestAccIPAMPoolCIDR_basicNetmaskLength(t *testing.T) { netmaskLength := "24" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckIPAMPoolCIDRDestroy(ctx), @@ -88,7 +88,7 @@ func TestAccIPAMPoolCIDR_disappears(t *testing.T) { cidrBlock := "10.0.0.0/24" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckIPAMPoolCIDRDestroy(ctx), @@ -113,7 +113,7 @@ func TestAccIPAMPoolCIDR_Disappears_ipam(t *testing.T) { cidrBlock := "10.0.0.0/24" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckIPAMPoolCIDRDestroy(ctx), 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 cb7b7069830e..7115d0ffaaf3 100644 --- a/internal/service/ec2/ipam_pool_cidrs_data_source_test.go +++ b/internal/service/ec2/ipam_pool_cidrs_data_source_test.go @@ -12,7 +12,7 @@ func TestAccIPAMPoolCIDRsDataSource_basic(t *testing.T) { dataSourceName := "data.aws_vpc_ipam_pool_cidrs.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ diff --git a/internal/service/ec2/ipam_pool_data_source_test.go b/internal/service/ec2/ipam_pool_data_source_test.go index 15d5c6d0c995..f1728099a9c5 100644 --- a/internal/service/ec2/ipam_pool_data_source_test.go +++ b/internal/service/ec2/ipam_pool_data_source_test.go @@ -13,7 +13,7 @@ func TestAccIPAMPoolDataSource_basic(t *testing.T) { dataSourceName := "data.aws_vpc_ipam_pool.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ diff --git a/internal/service/ec2/ipam_pool_test.go b/internal/service/ec2/ipam_pool_test.go index 9e59099d6bcd..49f7aed4490d 100644 --- a/internal/service/ec2/ipam_pool_test.go +++ b/internal/service/ec2/ipam_pool_test.go @@ -20,7 +20,7 @@ func TestAccIPAMPool_basic(t *testing.T) { resourceName := "aws_vpc_ipam_pool.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckIPAMPoolDestroy(ctx), @@ -81,7 +81,7 @@ func TestAccIPAMPool_disappears(t *testing.T) { resourceName := "aws_vpc_ipam_pool.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckIPAMPoolDestroy(ctx), @@ -104,7 +104,7 @@ func TestAccIPAMPool_ipv6Basic(t *testing.T) { resourceName := "aws_vpc_ipam_pool.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckIPAMPoolDestroy(ctx), @@ -132,7 +132,7 @@ func TestAccIPAMPool_ipv6Contiguous(t *testing.T) { resourceName := "aws_vpc_ipam_pool.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckIPAMPoolDestroy(ctx), @@ -161,7 +161,7 @@ func TestAccIPAMPool_tags(t *testing.T) { resourceName := "aws_vpc_ipam_pool.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckIPAMPoolDestroy(ctx), diff --git a/internal/service/ec2/ipam_pools_data_source_test.go b/internal/service/ec2/ipam_pools_data_source_test.go index 6bacdf640fea..b654e9d9034b 100644 --- a/internal/service/ec2/ipam_pools_data_source_test.go +++ b/internal/service/ec2/ipam_pools_data_source_test.go @@ -14,7 +14,7 @@ func TestAccIPAMPoolsDataSource_basic(t *testing.T) { resourceName := "aws_vpc_ipam_pool.testthree" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ @@ -58,7 +58,7 @@ func TestAccIPAMPoolsDataSource_empty(t *testing.T) { dataSourceName := "data.aws_vpc_ipam_pools.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ 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 f0a29c1aa22c..933967512ea0 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 @@ -14,7 +14,7 @@ func TestAccIPAMPreviewNextCIDRDataSource_ipv4Basic(t *testing.T) { netmaskLength := "28" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: nil, @@ -37,7 +37,7 @@ func TestAccIPAMPreviewNextCIDRDataSource_ipv4Allocated(t *testing.T) { allocatedCidr := "172.2.0.0/28" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: nil, @@ -70,7 +70,7 @@ func TestAccIPAMPreviewNextCIDRDataSource_ipv4DisallowedCIDR(t *testing.T) { expectedCidr := "172.2.0.16/28" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: nil, diff --git a/internal/service/ec2/ipam_preview_next_cidr_test.go b/internal/service/ec2/ipam_preview_next_cidr_test.go index 2fd828133906..86ad571dfb95 100644 --- a/internal/service/ec2/ipam_preview_next_cidr_test.go +++ b/internal/service/ec2/ipam_preview_next_cidr_test.go @@ -14,7 +14,7 @@ func TestAccIPAMPreviewNextCIDR_ipv4Basic(t *testing.T) { netmaskLength := "28" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: nil, @@ -38,7 +38,7 @@ func TestAccIPAMPreviewNextCIDR_ipv4Allocated(t *testing.T) { allocatedCidr := "172.2.0.0/28" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: nil, @@ -73,7 +73,7 @@ func TestAccIPAMPreviewNextCIDR_ipv4DisallowedCIDR(t *testing.T) { expectedCidr := "172.2.0.16/28" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: nil, diff --git a/internal/service/ec2/ipam_resource_discovery_association_test.go b/internal/service/ec2/ipam_resource_discovery_association_test.go index 7be5c7208373..7b6a80ce1345 100644 --- a/internal/service/ec2/ipam_resource_discovery_association_test.go +++ b/internal/service/ec2/ipam_resource_discovery_association_test.go @@ -23,7 +23,7 @@ func testAccIPAMResourceDiscoveryAssociation_basic(t *testing.T) { rdName := "aws_vpc_ipam_resource_discovery.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckIPAMResourceDiscoveryAssociationDestroy(ctx), @@ -54,7 +54,7 @@ func testAccIPAMResourceDiscoveryAssociation_tags(t *testing.T) { resourceName := "aws_vpc_ipam_resource_discovery_association.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckIPAMResourceDiscoveryAssociationDestroy(ctx), @@ -97,7 +97,7 @@ func testAccIPAMResourceDiscoveryAssociation_disappears(t *testing.T) { resourceName := "aws_vpc_ipam_resource_discovery_association.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckIPAMResourceDiscoveryAssociationDestroy(ctx), diff --git a/internal/service/ec2/ipam_resource_discovery_test.go b/internal/service/ec2/ipam_resource_discovery_test.go index 4edc0903e8c4..24770aa2bde4 100644 --- a/internal/service/ec2/ipam_resource_discovery_test.go +++ b/internal/service/ec2/ipam_resource_discovery_test.go @@ -42,7 +42,7 @@ func testAccIPAMResourceDiscovery_basic(t *testing.T) { dataSourceRegion := "data.aws_region.current" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckIPAMResourceDiscoveryDestroy(ctx), @@ -76,7 +76,7 @@ func testAccIPAMResourceDiscovery_modify(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckMultipleRegion(t, 2) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), @@ -123,7 +123,7 @@ func testAccIPAMResourceDiscovery_disappears(t *testing.T) { resourceName := "aws_vpc_ipam_resource_discovery.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckIPAMResourceDiscoveryDestroy(ctx), @@ -146,7 +146,7 @@ func testAccIPAMResourceDiscovery_tags(t *testing.T) { resourceName := "aws_vpc_ipam_resource_discovery.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckIPAMResourceDiscoveryDestroy(ctx), diff --git a/internal/service/ec2/ipam_scope_test.go b/internal/service/ec2/ipam_scope_test.go index ce53ad8642ca..60f851055b72 100644 --- a/internal/service/ec2/ipam_scope_test.go +++ b/internal/service/ec2/ipam_scope_test.go @@ -21,7 +21,7 @@ func TestAccIPAMScope_basic(t *testing.T) { ipamName := "aws_vpc_ipam.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckIPAMScopeDestroy(ctx), @@ -60,7 +60,7 @@ func TestAccIPAMScope_disappears(t *testing.T) { resourceName := "aws_vpc_ipam_scope.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckIPAMScopeDestroy(ctx), @@ -83,7 +83,7 @@ func TestAccIPAMScope_tags(t *testing.T) { resourceName := "aws_vpc_ipam_scope.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckIPAMScopeDestroy(ctx), diff --git a/internal/service/ec2/ipam_test.go b/internal/service/ec2/ipam_test.go index cddb04b91a51..b897885c9d27 100644 --- a/internal/service/ec2/ipam_test.go +++ b/internal/service/ec2/ipam_test.go @@ -22,7 +22,7 @@ func TestAccIPAM_basic(t *testing.T) { resourceName := "aws_vpc_ipam.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckIPAMDestroy(ctx), @@ -57,7 +57,7 @@ func TestAccIPAM_disappears(t *testing.T) { resourceName := "aws_vpc_ipam.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckIPAMDestroy(ctx), @@ -80,7 +80,7 @@ func TestAccIPAM_description(t *testing.T) { resourceName := "aws_vpc_ipam.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckIPAMDestroy(ctx), @@ -114,7 +114,7 @@ func TestAccIPAM_operatingRegions(t *testing.T) { resourceName := "aws_vpc_ipam.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckMultipleRegion(t, 2) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckMultipleRegion(t, 2) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5FactoriesMultipleRegions(ctx, t, 2), CheckDestroy: testAccCheckIPAMDestroy(ctx), @@ -155,7 +155,7 @@ func TestAccIPAM_cascade(t *testing.T) { resourceName := "aws_vpc_ipam.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckIPAMDestroy(ctx), @@ -183,7 +183,7 @@ func TestAccIPAM_tags(t *testing.T) { resourceName := "aws_vpc_ipam.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckIPAMDestroy(ctx), 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 11718bc4724f..607c503351bd 100644 --- a/internal/service/ec2/outposts_coip_pool_data_source_test.go +++ b/internal/service/ec2/outposts_coip_pool_data_source_test.go @@ -14,7 +14,7 @@ func TestAccEC2OutpostsCoIPPoolDataSource_filter(t *testing.T) { dataSourceName := "data.aws_ec2_coip_pool.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckOutpostsOutposts(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckOutpostsOutposts(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ @@ -35,7 +35,7 @@ func TestAccEC2OutpostsCoIPPoolDataSource_id(t *testing.T) { dataSourceName := "data.aws_ec2_coip_pool.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckOutpostsOutposts(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckOutpostsOutposts(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ 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 bb0fd94600fb..ae4f2db07bf1 100644 --- a/internal/service/ec2/outposts_coip_pools_data_source_test.go +++ b/internal/service/ec2/outposts_coip_pools_data_source_test.go @@ -13,7 +13,7 @@ func TestAccEC2OutpostsCoIPPoolsDataSource_basic(t *testing.T) { dataSourceName := "data.aws_ec2_coip_pools.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckOutpostsOutposts(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckOutpostsOutposts(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ @@ -32,7 +32,7 @@ func TestAccEC2OutpostsCoIPPoolsDataSource_filter(t *testing.T) { dataSourceName := "data.aws_ec2_coip_pools.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckOutpostsOutposts(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckOutpostsOutposts(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ 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 5f0c92476fe3..2a07812a7d31 100644 --- a/internal/service/ec2/outposts_local_gateway_data_source_test.go +++ b/internal/service/ec2/outposts_local_gateway_data_source_test.go @@ -14,7 +14,7 @@ func TestAccEC2OutpostsLocalGatewayDataSource_basic(t *testing.T) { dataSourceName := "data.aws_ec2_local_gateway.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckOutpostsOutposts(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckOutpostsOutposts(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ 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 0494a855e86e..0a98d5a338d3 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 @@ -14,7 +14,7 @@ func TestAccEC2OutpostsLocalGatewayRouteTableDataSource_basic(t *testing.T) { dataSourceName := "data.aws_ec2_local_gateway_route_table.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckOutpostsOutposts(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckOutpostsOutposts(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ @@ -36,7 +36,7 @@ func TestAccEC2OutpostsLocalGatewayRouteTableDataSource_filter(t *testing.T) { dataSourceName := "data.aws_ec2_local_gateway_route_table.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckOutpostsOutposts(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckOutpostsOutposts(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ @@ -58,7 +58,7 @@ func TestAccEC2OutpostsLocalGatewayRouteTableDataSource_localGatewayID(t *testin dataSourceName := "data.aws_ec2_local_gateway_route_table.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckOutpostsOutposts(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckOutpostsOutposts(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ @@ -80,7 +80,7 @@ func TestAccEC2OutpostsLocalGatewayRouteTableDataSource_outpostARN(t *testing.T) dataSourceName := "data.aws_ec2_local_gateway_route_table.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckOutpostsOutposts(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckOutpostsOutposts(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ 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 a12df59139e0..098a8c8404df 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 @@ -23,7 +23,7 @@ func TestAccEC2OutpostsLocalGatewayRouteTableVPCAssociation_basic(t *testing.T) vpcResourceName := "aws_vpc.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckOutpostsOutposts(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckOutpostsOutposts(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckLocalGatewayRouteTableVPCAssociationDestroy(ctx), @@ -53,7 +53,7 @@ func TestAccEC2OutpostsLocalGatewayRouteTableVPCAssociation_disappears(t *testin resourceName := "aws_ec2_local_gateway_route_table_vpc_association.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckOutpostsOutposts(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckOutpostsOutposts(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckLocalGatewayRouteTableVPCAssociationDestroy(ctx), @@ -76,7 +76,7 @@ func TestAccEC2OutpostsLocalGatewayRouteTableVPCAssociation_tags(t *testing.T) { resourceName := "aws_ec2_local_gateway_route_table_vpc_association.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckOutpostsOutposts(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckOutpostsOutposts(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckLocalGatewayRouteTableVPCAssociationDestroy(ctx), 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 2d26d23c7b22..a7b63fcc7668 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 @@ -13,7 +13,7 @@ func TestAccEC2OutpostsLocalGatewayRouteTablesDataSource_basic(t *testing.T) { dataSourceName := "data.aws_ec2_local_gateway_route_tables.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckOutpostsOutposts(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckOutpostsOutposts(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ @@ -32,7 +32,7 @@ func TestAccEC2OutpostsLocalGatewayRouteTablesDataSource_filter(t *testing.T) { dataSourceName := "data.aws_ec2_local_gateway_route_tables.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckOutpostsOutposts(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckOutpostsOutposts(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ diff --git a/internal/service/ec2/outposts_local_gateway_route_test.go b/internal/service/ec2/outposts_local_gateway_route_test.go index ab17e1ca2f49..695f2e475fbf 100644 --- a/internal/service/ec2/outposts_local_gateway_route_test.go +++ b/internal/service/ec2/outposts_local_gateway_route_test.go @@ -24,7 +24,7 @@ func TestAccEC2OutpostsLocalGatewayRoute_basic(t *testing.T) { resourceName := "aws_ec2_local_gateway_route.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckOutpostsOutposts(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckOutpostsOutposts(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckLocalGatewayRouteDestroy(ctx), @@ -54,7 +54,7 @@ func TestAccEC2OutpostsLocalGatewayRoute_disappears(t *testing.T) { resourceName := "aws_ec2_local_gateway_route.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckOutpostsOutposts(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckOutpostsOutposts(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckLocalGatewayRouteDestroy(ctx), 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 40d2de432b5f..5e52d38573e1 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 @@ -16,7 +16,7 @@ func TestAccEC2OutpostsLocalGatewayVirtualInterfaceDataSource_filter(t *testing. dataSourceName := "data.aws_ec2_local_gateway_virtual_interface.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckOutpostsOutposts(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckOutpostsOutposts(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ @@ -41,7 +41,7 @@ func TestAccEC2OutpostsLocalGatewayVirtualInterfaceDataSource_id(t *testing.T) { dataSourceName := "data.aws_ec2_local_gateway_virtual_interface.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckOutpostsOutposts(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckOutpostsOutposts(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ @@ -68,7 +68,7 @@ func TestAccEC2OutpostsLocalGatewayVirtualInterfaceDataSource_tags(t *testing.T) dataSourceName := "data.aws_ec2_local_gateway_virtual_interface.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckOutpostsOutposts(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckOutpostsOutposts(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ 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 85d50d87ac73..204f7c4ad206 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 @@ -16,7 +16,7 @@ func TestAccEC2OutpostsLocalGatewayVirtualInterfaceGroupDataSource_filter(t *tes dataSourceName := "data.aws_ec2_local_gateway_virtual_interface_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckOutpostsOutposts(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckOutpostsOutposts(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ @@ -37,7 +37,7 @@ func TestAccEC2OutpostsLocalGatewayVirtualInterfaceGroupDataSource_localGatewayI dataSourceName := "data.aws_ec2_local_gateway_virtual_interface_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckOutpostsOutposts(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckOutpostsOutposts(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ @@ -60,7 +60,7 @@ func TestAccEC2OutpostsLocalGatewayVirtualInterfaceGroupDataSource_tags(t *testi dataSourceName := "data.aws_ec2_local_gateway_virtual_interface_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckOutpostsOutposts(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckOutpostsOutposts(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ 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 51b85d734462..d3c3acd27239 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 @@ -15,7 +15,7 @@ func TestAccEC2OutpostsLocalGatewayVirtualInterfaceGroupsDataSource_basic(t *tes dataSourceName := "data.aws_ec2_local_gateway_virtual_interface_groups.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckOutpostsOutposts(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckOutpostsOutposts(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ @@ -35,7 +35,7 @@ func TestAccEC2OutpostsLocalGatewayVirtualInterfaceGroupsDataSource_filter(t *te dataSourceName := "data.aws_ec2_local_gateway_virtual_interface_groups.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckOutpostsOutposts(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckOutpostsOutposts(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ @@ -56,7 +56,7 @@ func TestAccEC2OutpostsLocalGatewayVirtualInterfaceGroupsDataSource_tags(t *test dataSourceName := "data.aws_ec2_local_gateway_virtual_interface_groups.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckOutpostsOutposts(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckOutpostsOutposts(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ 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 ac982d8adf15..3f50e9416e73 100644 --- a/internal/service/ec2/outposts_local_gateways_data_source_test.go +++ b/internal/service/ec2/outposts_local_gateways_data_source_test.go @@ -13,7 +13,7 @@ func TestAccEC2OutpostsLocalGatewaysDataSource_basic(t *testing.T) { dataSourceName := "data.aws_ec2_local_gateways.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckOutpostsOutposts(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckOutpostsOutposts(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ diff --git a/internal/service/ec2/tag_test.go b/internal/service/ec2/tag_test.go index 90fa09417c9f..af0c1808595b 100644 --- a/internal/service/ec2/tag_test.go +++ b/internal/service/ec2/tag_test.go @@ -17,7 +17,7 @@ func TestAccEC2Tag_basic(t *testing.T) { resourceName := "aws_ec2_tag.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckTransitGateway(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckTransitGateway(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTagDestroy(ctx), @@ -45,7 +45,7 @@ func TestAccEC2Tag_disappears(t *testing.T) { resourceName := "aws_ec2_tag.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckTransitGateway(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckTransitGateway(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTagDestroy(ctx), @@ -68,7 +68,7 @@ func TestAccEC2Tag_value(t *testing.T) { resourceName := "aws_ec2_tag.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckTransitGateway(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckTransitGateway(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTagDestroy(ctx), diff --git a/internal/service/ec2/transitgateway_attachment_data_source_test.go b/internal/service/ec2/transitgateway_attachment_data_source_test.go index 6bbb210fc8b7..1ea6af8b0f85 100644 --- a/internal/service/ec2/transitgateway_attachment_data_source_test.go +++ b/internal/service/ec2/transitgateway_attachment_data_source_test.go @@ -17,7 +17,7 @@ func testAccTransitGatewayAttachmentDataSource_Filter(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckTransitGateway(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckTransitGateway(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ @@ -46,7 +46,7 @@ func testAccTransitGatewayAttachmentDataSource_ID(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckTransitGateway(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckTransitGateway(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ diff --git a/internal/service/ec2/transitgateway_connect_data_source_test.go b/internal/service/ec2/transitgateway_connect_data_source_test.go index 60219ca2af19..0e342d448f7a 100644 --- a/internal/service/ec2/transitgateway_connect_data_source_test.go +++ b/internal/service/ec2/transitgateway_connect_data_source_test.go @@ -17,7 +17,7 @@ func testAccTransitGatewayConnectDataSource_Filter(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckTransitGatewayConnect(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckTransitGatewayConnect(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTransitGatewayDestroy(ctx), @@ -43,7 +43,7 @@ func testAccTransitGatewayConnectDataSource_ID(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckTransitGatewayConnect(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckTransitGatewayConnect(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTransitGatewayDestroy(ctx), 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 125484da3505..ad7a8ce1020e 100644 --- a/internal/service/ec2/transitgateway_connect_peer_data_source_test.go +++ b/internal/service/ec2/transitgateway_connect_peer_data_source_test.go @@ -17,7 +17,7 @@ func testAccTransitGatewayConnectPeerDataSource_Filter(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckTransitGatewayConnect(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckTransitGatewayConnect(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTransitGatewayDestroy(ctx), @@ -46,7 +46,7 @@ func testAccTransitGatewayConnectPeerDataSource_ID(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckTransitGatewayConnect(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckTransitGatewayConnect(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTransitGatewayDestroy(ctx), diff --git a/internal/service/ec2/transitgateway_connect_peer_test.go b/internal/service/ec2/transitgateway_connect_peer_test.go index 30289b7d81b5..1687f4ccc7f7 100644 --- a/internal/service/ec2/transitgateway_connect_peer_test.go +++ b/internal/service/ec2/transitgateway_connect_peer_test.go @@ -23,7 +23,7 @@ func testAccTransitGatewayConnectPeer_basic(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckTransitGatewayConnect(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckTransitGatewayConnect(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTransitGatewayConnectPeerDestroy(ctx), @@ -56,7 +56,7 @@ func testAccTransitGatewayConnectPeer_disappears(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckTransitGatewayConnect(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckTransitGatewayConnect(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTransitGatewayConnectPeerDestroy(ctx), @@ -80,7 +80,7 @@ func testAccTransitGatewayConnectPeer_bgpASN(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckTransitGatewayConnect(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckTransitGatewayConnect(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTransitGatewayConnectPeerDestroy(ctx), @@ -103,7 +103,7 @@ func testAccTransitGatewayConnectPeer_insideCIDRBlocks(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckTransitGatewayConnect(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckTransitGatewayConnect(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTransitGatewayConnectPeerDestroy(ctx), @@ -133,7 +133,7 @@ func testAccTransitGatewayConnectPeer_tags(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckTransitGatewayConnect(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckTransitGatewayConnect(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTransitGatewayConnectPeerDestroy(ctx), @@ -179,7 +179,7 @@ func testAccTransitGatewayConnectPeer_TransitGatewayAddress(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckTransitGatewayConnect(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckTransitGatewayConnect(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTransitGatewayConnectPeerDestroy(ctx), diff --git a/internal/service/ec2/transitgateway_connect_test.go b/internal/service/ec2/transitgateway_connect_test.go index 82dfdb03043a..3dc0205fa532 100644 --- a/internal/service/ec2/transitgateway_connect_test.go +++ b/internal/service/ec2/transitgateway_connect_test.go @@ -26,7 +26,7 @@ func testAccTransitGatewayConnect_basic(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckTransitGatewayVPCAttachment(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckTransitGatewayVPCAttachment(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTransitGatewayConnectDestroy(ctx), @@ -59,7 +59,7 @@ func testAccTransitGatewayConnect_disappears(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckTransitGatewayVPCAttachment(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckTransitGatewayVPCAttachment(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTransitGatewayConnectDestroy(ctx), @@ -83,7 +83,7 @@ func testAccTransitGatewayConnect_tags(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckTransitGatewayVPCAttachment(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckTransitGatewayVPCAttachment(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTransitGatewayConnectDestroy(ctx), @@ -131,7 +131,7 @@ func testAccTransitGatewayConnect_TransitGatewayDefaultRouteTableAssociationAndP rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckTransitGatewayVPCAttachment(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckTransitGatewayVPCAttachment(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTransitGatewayConnectDestroy(ctx), @@ -165,7 +165,7 @@ func testAccTransitGatewayConnect_TransitGatewayDefaultRouteTableAssociation(t * rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckTransitGatewayVPCAttachment(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckTransitGatewayVPCAttachment(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTransitGatewayConnectDestroy(ctx), @@ -217,7 +217,7 @@ func testAccTransitGatewayConnect_TransitGatewayDefaultRouteTablePropagation(t * rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckTransitGatewayVPCAttachment(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckTransitGatewayVPCAttachment(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTransitGatewayConnectDestroy(ctx), diff --git a/internal/service/ec2/transitgateway_data_source_test.go b/internal/service/ec2/transitgateway_data_source_test.go index 82ae29471d61..526d001f4014 100644 --- a/internal/service/ec2/transitgateway_data_source_test.go +++ b/internal/service/ec2/transitgateway_data_source_test.go @@ -78,7 +78,7 @@ func testAccTransitGatewayDataSource_Filter(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckTransitGateway(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckTransitGateway(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTransitGatewayDestroy(ctx), @@ -113,7 +113,7 @@ func testAccTransitGatewayDataSource_ID(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckTransitGateway(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckTransitGateway(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTransitGatewayDestroy(ctx), 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 e0fa5cf8c814..b43484e0a555 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 @@ -20,7 +20,7 @@ func testAccTransitGatewayDxGatewayAttachmentDataSource_TransitGatewayIdAndDxGat resource.Test(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) testAccPreCheckTransitGateway(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), @@ -49,7 +49,7 @@ func testAccTransitGatewayDxGatewayAttachmentDataSource_filter(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) testAccPreCheckTransitGateway(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), diff --git a/internal/service/ec2/transitgateway_multicast_domain_association_test.go b/internal/service/ec2/transitgateway_multicast_domain_association_test.go index 123cd49abbf9..71eb8403566d 100644 --- a/internal/service/ec2/transitgateway_multicast_domain_association_test.go +++ b/internal/service/ec2/transitgateway_multicast_domain_association_test.go @@ -22,7 +22,7 @@ func testAccTransitGatewayMulticastDomainAssociation_basic(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckTransitGateway(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckTransitGateway(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTransitGatewayMulticastDomainAssociationDestroy(ctx), @@ -44,7 +44,7 @@ func testAccTransitGatewayMulticastDomainAssociation_disappears(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckTransitGateway(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckTransitGateway(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTransitGatewayMulticastDomainAssociationDestroy(ctx), @@ -69,7 +69,7 @@ func testAccTransitGatewayMulticastDomainAssociation_Disappears_domain(t *testin rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckTransitGateway(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckTransitGateway(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTransitGatewayMulticastDomainAssociationDestroy(ctx), @@ -94,7 +94,7 @@ func testAccTransitGatewayMulticastDomainAssociation_twoAssociations(t *testing. rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckTransitGateway(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckTransitGateway(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTransitGatewayMulticastDomainAssociationDestroy(ctx), 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 7c08f4bf5a01..dbc9492411dd 100644 --- a/internal/service/ec2/transitgateway_multicast_domain_data_source_test.go +++ b/internal/service/ec2/transitgateway_multicast_domain_data_source_test.go @@ -17,7 +17,7 @@ func testAccTransitGatewayMulticastDomainDataSource_Filter(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckTransitGateway(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckTransitGateway(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ @@ -48,7 +48,7 @@ func testAccTransitGatewayMulticastDomainDataSource_ID(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckTransitGateway(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckTransitGateway(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ diff --git a/internal/service/ec2/transitgateway_multicast_domain_test.go b/internal/service/ec2/transitgateway_multicast_domain_test.go index d37612fd621f..1bd059069a77 100644 --- a/internal/service/ec2/transitgateway_multicast_domain_test.go +++ b/internal/service/ec2/transitgateway_multicast_domain_test.go @@ -23,7 +23,7 @@ func testAccTransitGatewayMulticastDomain_basic(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckTransitGateway(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckTransitGateway(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTransitGatewayMulticastDomainDestroy(ctx), @@ -57,7 +57,7 @@ func testAccTransitGatewayMulticastDomain_disappears(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckTransitGateway(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckTransitGateway(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTransitGatewayMulticastDomainDestroy(ctx), @@ -81,7 +81,7 @@ func testAccTransitGatewayMulticastDomain_tags(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckTransitGateway(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckTransitGateway(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTransitGatewayMulticastDomainDestroy(ctx), @@ -125,7 +125,7 @@ func testAccTransitGatewayMulticastDomain_igmpv2Support(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckTransitGateway(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckTransitGateway(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTransitGatewayMulticastDomainDestroy(ctx), diff --git a/internal/service/ec2/transitgateway_multicast_group_member_test.go b/internal/service/ec2/transitgateway_multicast_group_member_test.go index 267cf75f67df..dbc8c93a90c6 100644 --- a/internal/service/ec2/transitgateway_multicast_group_member_test.go +++ b/internal/service/ec2/transitgateway_multicast_group_member_test.go @@ -22,7 +22,7 @@ func testAccTransitGatewayMulticastGroupMember_basic(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckTransitGateway(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckTransitGateway(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTransitGatewayMulticastGroupMemberDestroy(ctx), @@ -44,7 +44,7 @@ func testAccTransitGatewayMulticastGroupMember_disappears(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckTransitGateway(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckTransitGateway(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTransitGatewayMulticastGroupMemberDestroy(ctx), @@ -69,7 +69,7 @@ func testAccTransitGatewayMulticastGroupMember_Disappears_domain(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckTransitGateway(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckTransitGateway(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTransitGatewayMulticastGroupMemberDestroy(ctx), @@ -94,7 +94,7 @@ func testAccTransitGatewayMulticastGroupMember_twoMembers(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckTransitGateway(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckTransitGateway(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTransitGatewayMulticastGroupMemberDestroy(ctx), diff --git a/internal/service/ec2/transitgateway_multicast_group_source_test.go b/internal/service/ec2/transitgateway_multicast_group_source_test.go index ac14f0008407..a4ed8526c932 100644 --- a/internal/service/ec2/transitgateway_multicast_group_source_test.go +++ b/internal/service/ec2/transitgateway_multicast_group_source_test.go @@ -22,7 +22,7 @@ func testAccTransitGatewayMulticastGroupSource_basic(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckTransitGateway(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckTransitGateway(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTransitGatewayMulticastGroupSourceDestroy(ctx), @@ -44,7 +44,7 @@ func testAccTransitGatewayMulticastGroupSource_disappears(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckTransitGateway(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckTransitGateway(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTransitGatewayMulticastGroupSourceDestroy(ctx), @@ -69,7 +69,7 @@ func testAccTransitGatewayMulticastGroupSource_Disappears_domain(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckTransitGateway(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckTransitGateway(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTransitGatewayMulticastGroupSourceDestroy(ctx), diff --git a/internal/service/ec2/transitgateway_peering_attachment_accepter_test.go b/internal/service/ec2/transitgateway_peering_attachment_accepter_test.go index 14949823bc94..e3b479b0332d 100644 --- a/internal/service/ec2/transitgateway_peering_attachment_accepter_test.go +++ b/internal/service/ec2/transitgateway_peering_attachment_accepter_test.go @@ -23,7 +23,7 @@ func testAccTransitGatewayPeeringAttachmentAccepter_basic(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckMultipleRegion(t, 2) testAccPreCheckTransitGateway(ctx, t) }, @@ -61,7 +61,7 @@ func testAccTransitGatewayPeeringAttachmentAccepter_Tags(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckMultipleRegion(t, 2) testAccPreCheckTransitGateway(ctx, t) }, @@ -115,7 +115,7 @@ func testAccTransitGatewayPeeringAttachmentAccepter_differentAccount(t *testing. resource.Test(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckAlternateAccount(t) testAccPreCheckTransitGateway(ctx, t) }, 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 9825447ca2af..a497bca9ce71 100644 --- a/internal/service/ec2/transitgateway_peering_attachment_data_source_test.go +++ b/internal/service/ec2/transitgateway_peering_attachment_data_source_test.go @@ -17,7 +17,7 @@ func testAccTransitGatewayPeeringAttachmentDataSource_Filter_sameAccount(t *test resource.Test(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) testAccPreCheckTransitGateway(ctx, t) acctest.PreCheckMultipleRegion(t, 2) }, @@ -48,7 +48,7 @@ func testAccTransitGatewayPeeringAttachmentDataSource_Filter_differentAccount(t resource.Test(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) testAccPreCheckTransitGateway(ctx, t) acctest.PreCheckMultipleRegion(t, 2) acctest.PreCheckAlternateAccount(t) @@ -78,7 +78,7 @@ func testAccTransitGatewayPeeringAttachmentDataSource_ID_sameAccount(t *testing. resource.Test(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) testAccPreCheckTransitGateway(ctx, t) acctest.PreCheckMultipleRegion(t, 2) }, @@ -109,7 +109,7 @@ func testAccTransitGatewayPeeringAttachmentDataSource_ID_differentAccount(t *tes resource.Test(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) testAccPreCheckTransitGateway(ctx, t) acctest.PreCheckMultipleRegion(t, 2) acctest.PreCheckAlternateAccount(t) @@ -139,7 +139,7 @@ func testAccTransitGatewayPeeringAttachmentDataSource_Tags(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) testAccPreCheckTransitGateway(ctx, t) acctest.PreCheckMultipleRegion(t, 2) }, diff --git a/internal/service/ec2/transitgateway_peering_attachment_test.go b/internal/service/ec2/transitgateway_peering_attachment_test.go index 182bfc95d5de..6ca42d8ee83f 100644 --- a/internal/service/ec2/transitgateway_peering_attachment_test.go +++ b/internal/service/ec2/transitgateway_peering_attachment_test.go @@ -25,7 +25,7 @@ func testAccTransitGatewayPeeringAttachment_basic(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) testAccPreCheckTransitGateway(ctx, t) acctest.PreCheckMultipleRegion(t, 2) }, @@ -62,7 +62,7 @@ func testAccTransitGatewayPeeringAttachment_disappears(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) testAccPreCheckTransitGateway(ctx, t) acctest.PreCheckMultipleRegion(t, 2) }, @@ -90,7 +90,7 @@ func testAccTransitGatewayPeeringAttachment_Tags(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) testAccPreCheckTransitGateway(ctx, t) acctest.PreCheckMultipleRegion(t, 2) }, @@ -143,7 +143,7 @@ func testAccTransitGatewayPeeringAttachment_differentAccount(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) testAccPreCheckTransitGateway(ctx, t) acctest.PreCheckMultipleRegion(t, 2) acctest.PreCheckAlternateAccount(t) diff --git a/internal/service/ec2/transitgateway_policy_table_association_test.go b/internal/service/ec2/transitgateway_policy_table_association_test.go index c0aa850205ae..a53863da5f76 100644 --- a/internal/service/ec2/transitgateway_policy_table_association_test.go +++ b/internal/service/ec2/transitgateway_policy_table_association_test.go @@ -24,7 +24,7 @@ func testAccTransitGatewayPolicyTableAssociation_basic(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckTransitGateway(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckTransitGateway(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTransitGatewayPolicyTableAssociationDestroy(ctx), @@ -55,7 +55,7 @@ func testAccTransitGatewayPolicyTableAssociation_disappears(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckTransitGateway(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckTransitGateway(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTransitGatewayPolicyTableAssociationDestroy(ctx), diff --git a/internal/service/ec2/transitgateway_policy_table_test.go b/internal/service/ec2/transitgateway_policy_table_test.go index a02cac73f197..ab75395b2c38 100644 --- a/internal/service/ec2/transitgateway_policy_table_test.go +++ b/internal/service/ec2/transitgateway_policy_table_test.go @@ -26,7 +26,7 @@ func testAccTransitGatewayPolicyTable_basic(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckTransitGateway(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckTransitGateway(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTransitGatewayPolicyTableDestroy(ctx), @@ -57,7 +57,7 @@ func testAccTransitGatewayPolicyTable_disappears(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckTransitGateway(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckTransitGateway(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTransitGatewayPolicyTableDestroy(ctx), @@ -83,7 +83,7 @@ func testAccTransitGatewayPolicyTable_disappears_TransitGateway(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckTransitGateway(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckTransitGateway(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTransitGatewayPolicyTableDestroy(ctx), @@ -108,7 +108,7 @@ func testAccTransitGatewayPolicyTable_Tags(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckTransitGateway(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckTransitGateway(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTransitGatewayPolicyTableDestroy(ctx), diff --git a/internal/service/ec2/transitgateway_prefix_list_reference_test.go b/internal/service/ec2/transitgateway_prefix_list_reference_test.go index 5a79ddd73d83..b871ec167d3c 100644 --- a/internal/service/ec2/transitgateway_prefix_list_reference_test.go +++ b/internal/service/ec2/transitgateway_prefix_list_reference_test.go @@ -24,7 +24,7 @@ func testAccTransitGatewayPrefixListReference_basic(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) testAccPreCheckTransitGateway(ctx, t) testAccPreCheckManagedPrefixList(ctx, t) }, @@ -59,7 +59,7 @@ func testAccTransitGatewayPrefixListReference_disappears(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) testAccPreCheckTransitGateway(ctx, t) testAccPreCheckManagedPrefixList(ctx, t) }, @@ -87,7 +87,7 @@ func testAccTransitGatewayPrefixListReference_disappears_TransitGateway(t *testi resource.Test(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) testAccPreCheckTransitGateway(ctx, t) testAccPreCheckManagedPrefixList(ctx, t) }, @@ -116,7 +116,7 @@ func testAccTransitGatewayPrefixListReference_TransitGatewayAttachmentID(t *test resource.Test(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) testAccPreCheckTransitGateway(ctx, t) testAccPreCheckManagedPrefixList(ctx, t) }, diff --git a/internal/service/ec2/transitgateway_route_table_association_test.go b/internal/service/ec2/transitgateway_route_table_association_test.go index 186e785d2865..e4caa43290ad 100644 --- a/internal/service/ec2/transitgateway_route_table_association_test.go +++ b/internal/service/ec2/transitgateway_route_table_association_test.go @@ -24,7 +24,7 @@ func testAccTransitGatewayRouteTableAssociation_basic(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckTransitGateway(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckTransitGateway(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTransitGatewayRouteTableAssociationDestroy(ctx), @@ -55,7 +55,7 @@ func testAccTransitGatewayRouteTableAssociation_disappears(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckTransitGateway(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckTransitGateway(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTransitGatewayRouteTableAssociationDestroy(ctx), 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 6a7586c5d7a9..a79fa50cd912 100644 --- a/internal/service/ec2/transitgateway_route_table_data_source_test.go +++ b/internal/service/ec2/transitgateway_route_table_data_source_test.go @@ -17,7 +17,7 @@ func testAccTransitGatewayRouteTableDataSource_Filter(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckTransitGateway(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckTransitGateway(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTransitGatewayDestroy(ctx), @@ -43,7 +43,7 @@ func testAccTransitGatewayRouteTableDataSource_ID(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckTransitGateway(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckTransitGateway(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTransitGatewayDestroy(ctx), diff --git a/internal/service/ec2/transitgateway_route_table_propagation_test.go b/internal/service/ec2/transitgateway_route_table_propagation_test.go index 60d3294284f2..968b39c58978 100644 --- a/internal/service/ec2/transitgateway_route_table_propagation_test.go +++ b/internal/service/ec2/transitgateway_route_table_propagation_test.go @@ -24,7 +24,7 @@ func testAccTransitGatewayRouteTablePropagation_basic(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckTransitGateway(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckTransitGateway(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTransitGatewayRouteTablePropagationDestroy(ctx), @@ -55,7 +55,7 @@ func testAccTransitGatewayRouteTablePropagation_disappears(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckTransitGateway(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckTransitGateway(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTransitGatewayRouteTablePropagationDestroy(ctx), diff --git a/internal/service/ec2/transitgateway_route_table_test.go b/internal/service/ec2/transitgateway_route_table_test.go index a30c6e4d793e..9794717e70af 100644 --- a/internal/service/ec2/transitgateway_route_table_test.go +++ b/internal/service/ec2/transitgateway_route_table_test.go @@ -26,7 +26,7 @@ func testAccTransitGatewayRouteTable_basic(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckTransitGateway(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckTransitGateway(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTransitGatewayRouteTableDestroy(ctx), @@ -58,7 +58,7 @@ func testAccTransitGatewayRouteTable_disappears(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckTransitGateway(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckTransitGateway(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTransitGatewayRouteTableDestroy(ctx), @@ -84,7 +84,7 @@ func testAccTransitGatewayRouteTable_disappears_TransitGateway(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckTransitGateway(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckTransitGateway(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTransitGatewayRouteTableDestroy(ctx), @@ -109,7 +109,7 @@ func testAccTransitGatewayRouteTable_Tags(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckTransitGateway(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckTransitGateway(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTransitGatewayRouteTableDestroy(ctx), 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 ef0b90b16f7a..bb824002429d 100644 --- a/internal/service/ec2/transitgateway_route_tables_data_source_test.go +++ b/internal/service/ec2/transitgateway_route_tables_data_source_test.go @@ -16,7 +16,7 @@ func testAccTransitGatewayRouteTablesDataSource_basic(t *testing.T) { dataSourceName := "data.aws_ec2_transit_gateway_route_tables.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckTransitGateway(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckTransitGateway(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ @@ -36,7 +36,7 @@ func testAccTransitGatewayRouteTablesDataSource_filter(t *testing.T) { dataSourceName := "data.aws_ec2_transit_gateway_route_tables.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckTransitGateway(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckTransitGateway(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ @@ -56,7 +56,7 @@ func testAccTransitGatewayRouteTablesDataSource_tags(t *testing.T) { dataSourceName := "data.aws_ec2_transit_gateway_route_tables.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckTransitGateway(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckTransitGateway(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ @@ -76,7 +76,7 @@ func testAccTransitGatewayRouteTablesDataSource_empty(t *testing.T) { dataSourceName := "data.aws_ec2_transit_gateway_route_tables.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckTransitGateway(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckTransitGateway(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ diff --git a/internal/service/ec2/transitgateway_route_test.go b/internal/service/ec2/transitgateway_route_test.go index 00b7375d6761..a12332a209f8 100644 --- a/internal/service/ec2/transitgateway_route_test.go +++ b/internal/service/ec2/transitgateway_route_test.go @@ -24,7 +24,7 @@ func testAccTransitGatewayRoute_basic(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckTransitGateway(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckTransitGateway(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTransitGatewayRouteDestroy(ctx), @@ -57,7 +57,7 @@ func testAccTransitGatewayRoute_basic_ipv6(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckTransitGateway(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckTransitGateway(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTransitGatewayRouteDestroy(ctx), @@ -89,7 +89,7 @@ func testAccTransitGatewayRoute_blackhole(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckTransitGateway(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckTransitGateway(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTransitGatewayRouteDestroy(ctx), @@ -120,7 +120,7 @@ func testAccTransitGatewayRoute_disappears(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckTransitGateway(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckTransitGateway(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTransitGatewayRouteDestroy(ctx), @@ -145,7 +145,7 @@ func testAccTransitGatewayRoute_disappears_TransitGatewayAttachment(t *testing.T rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckTransitGateway(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckTransitGateway(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTransitGatewayRouteDestroy(ctx), diff --git a/internal/service/ec2/transitgateway_test.go b/internal/service/ec2/transitgateway_test.go index c8f3cbb9656d..5b1233f30db0 100644 --- a/internal/service/ec2/transitgateway_test.go +++ b/internal/service/ec2/transitgateway_test.go @@ -153,7 +153,7 @@ func testAccTransitGateway_basic(t *testing.T) { resourceName := "aws_ec2_transit_gateway.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckTransitGateway(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckTransitGateway(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTransitGatewayDestroy(ctx), @@ -192,7 +192,7 @@ func testAccTransitGateway_disappears(t *testing.T) { resourceName := "aws_ec2_transit_gateway.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckTransitGateway(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckTransitGateway(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTransitGatewayDestroy(ctx), @@ -216,7 +216,7 @@ func testAccTransitGateway_AmazonSideASN(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckTransitGateway(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckTransitGateway(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTransitGatewayDestroy(ctx), @@ -252,7 +252,7 @@ func testAccTransitGateway_AutoAcceptSharedAttachments(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckTransitGateway(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckTransitGateway(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTransitGatewayDestroy(ctx), @@ -288,7 +288,7 @@ func testAccTransitGateway_cidrBlocks(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckTransitGateway(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckTransitGateway(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTransitGatewayDestroy(ctx), @@ -337,7 +337,7 @@ func testAccTransitGateway_DefaultRouteTableAssociationAndPropagationDisabled(t rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckTransitGateway(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckTransitGateway(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTransitGatewayDestroy(ctx), @@ -366,7 +366,7 @@ func testAccTransitGateway_DefaultRouteTableAssociation(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckTransitGateway(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckTransitGateway(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTransitGatewayDestroy(ctx), @@ -410,7 +410,7 @@ func testAccTransitGateway_DefaultRouteTablePropagation(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckTransitGateway(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckTransitGateway(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTransitGatewayDestroy(ctx), @@ -454,7 +454,7 @@ func testAccTransitGateway_DNSSupport(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckTransitGateway(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckTransitGateway(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTransitGatewayDestroy(ctx), @@ -490,7 +490,7 @@ func testAccTransitGateway_VPNECMPSupport(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckTransitGateway(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckTransitGateway(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTransitGatewayDestroy(ctx), @@ -526,7 +526,7 @@ func testAccTransitGateway_Description(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckTransitGateway(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckTransitGateway(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTransitGatewayDestroy(ctx), @@ -561,7 +561,7 @@ func testAccTransitGateway_Tags(t *testing.T) { resourceName := "aws_ec2_transit_gateway.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckTransitGateway(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckTransitGateway(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTransitGatewayDestroy(ctx), diff --git a/internal/service/ec2/transitgateway_vpc_attachment_accepter_test.go b/internal/service/ec2/transitgateway_vpc_attachment_accepter_test.go index 38c45c6b0178..de356affd803 100644 --- a/internal/service/ec2/transitgateway_vpc_attachment_accepter_test.go +++ b/internal/service/ec2/transitgateway_vpc_attachment_accepter_test.go @@ -22,7 +22,7 @@ func testAccTransitGatewayVPCAttachmentAccepter_basic(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckAlternateAccount(t) testAccPreCheckTransitGateway(ctx, t) }, @@ -65,7 +65,7 @@ func testAccTransitGatewayVPCAttachmentAccepter_Tags(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckAlternateAccount(t) testAccPreCheckTransitGateway(ctx, t) }, @@ -118,7 +118,7 @@ func testAccTransitGatewayVPCAttachmentAccepter_TransitGatewayDefaultRouteTableA resource.Test(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckAlternateAccount(t) testAccPreCheckTransitGateway(ctx, t) }, 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 64c1417a0c44..c944ee063ca0 100644 --- a/internal/service/ec2/transitgateway_vpc_attachment_data_source_test.go +++ b/internal/service/ec2/transitgateway_vpc_attachment_data_source_test.go @@ -17,7 +17,7 @@ func testAccTransitGatewayVPCAttachmentDataSource_Filter(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckTransitGateway(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckTransitGateway(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTransitGatewayDestroy(ctx), @@ -46,7 +46,7 @@ func testAccTransitGatewayVPCAttachmentDataSource_ID(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckTransitGateway(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckTransitGateway(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTransitGatewayDestroy(ctx), diff --git a/internal/service/ec2/transitgateway_vpc_attachment_test.go b/internal/service/ec2/transitgateway_vpc_attachment_test.go index 2abb34a86fb5..b78238a6cd27 100644 --- a/internal/service/ec2/transitgateway_vpc_attachment_test.go +++ b/internal/service/ec2/transitgateway_vpc_attachment_test.go @@ -26,7 +26,7 @@ func testAccTransitGatewayVPCAttachment_basic(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckTransitGateway(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckTransitGateway(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTransitGatewayVPCAttachmentDestroy(ctx), @@ -62,7 +62,7 @@ func testAccTransitGatewayVPCAttachment_disappears(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckTransitGateway(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckTransitGateway(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTransitGatewayVPCAttachmentDestroy(ctx), @@ -86,7 +86,7 @@ func testAccTransitGatewayVPCAttachment_ApplianceModeSupport(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckTransitGateway(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckTransitGateway(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTransitGatewayVPCAttachmentDestroy(ctx), @@ -122,7 +122,7 @@ func testAccTransitGatewayVPCAttachment_DNSSupport(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckTransitGateway(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckTransitGateway(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTransitGatewayVPCAttachmentDestroy(ctx), @@ -158,7 +158,7 @@ func testAccTransitGatewayVPCAttachment_IPv6Support(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckTransitGateway(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckTransitGateway(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTransitGatewayVPCAttachmentDestroy(ctx), @@ -195,7 +195,7 @@ func testAccTransitGatewayVPCAttachment_SharedTransitGateway(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckAlternateAccount(t) testAccPreCheckTransitGateway(ctx, t) }, @@ -226,7 +226,7 @@ func testAccTransitGatewayVPCAttachment_SubnetIDs(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckTransitGateway(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckTransitGateway(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTransitGatewayVPCAttachmentDestroy(ctx), @@ -270,7 +270,7 @@ func testAccTransitGatewayVPCAttachment_Tags(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckTransitGateway(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckTransitGateway(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTransitGatewayVPCAttachmentDestroy(ctx), @@ -320,7 +320,7 @@ func testAccTransitGatewayVPCAttachment_TransitGatewayDefaultRouteTableAssociati rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckTransitGateway(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckTransitGateway(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTransitGatewayVPCAttachmentDestroy(ctx), @@ -354,7 +354,7 @@ func testAccTransitGatewayVPCAttachment_TransitGatewayDefaultRouteTableAssociati rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckTransitGateway(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckTransitGateway(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTransitGatewayVPCAttachmentDestroy(ctx), @@ -406,7 +406,7 @@ func testAccTransitGatewayVPCAttachment_TransitGatewayDefaultRouteTablePropagati rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckTransitGateway(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckTransitGateway(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTransitGatewayVPCAttachmentDestroy(ctx), 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 3fb01f95c822..c5dc02affc5e 100644 --- a/internal/service/ec2/transitgateway_vpc_attachments_data_source_test.go +++ b/internal/service/ec2/transitgateway_vpc_attachments_data_source_test.go @@ -15,7 +15,7 @@ func testAccTransitGatewayVPCAttachmentsDataSource_Filter(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckTransitGateway(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckTransitGateway(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ 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 4637ba8e3f01..f02b0e70fd4e 100644 --- a/internal/service/ec2/transitgateway_vpn_attachment_data_source_test.go +++ b/internal/service/ec2/transitgateway_vpn_attachment_data_source_test.go @@ -20,7 +20,7 @@ func testAccTransitGatewayVPNAttachmentDataSource_idAndVPNConnectionID(t *testin resource.Test(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) testAccPreCheckTransitGateway(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), @@ -49,7 +49,7 @@ func testAccTransitGatewayVPNAttachmentDataSource_filter(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) testAccPreCheckTransitGateway(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), diff --git a/internal/service/ec2/vpc_data_source_test.go b/internal/service/ec2/vpc_data_source_test.go index 82746117b567..e67ce80b4a5c 100644 --- a/internal/service/ec2/vpc_data_source_test.go +++ b/internal/service/ec2/vpc_data_source_test.go @@ -23,7 +23,7 @@ func TestAccVPCDataSource_basic(t *testing.T) { ds4ResourceName := "data.aws_vpc.by_filter" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ @@ -68,7 +68,7 @@ func TestAccVPCDataSource_CIDRBlockAssociations_multiple(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckVPCDestroy(ctx), diff --git a/internal/service/ec2/vpc_default_network_acl_test.go b/internal/service/ec2/vpc_default_network_acl_test.go index 09d3fc862409..6d830984a9a0 100644 --- a/internal/service/ec2/vpc_default_network_acl_test.go +++ b/internal/service/ec2/vpc_default_network_acl_test.go @@ -24,7 +24,7 @@ func TestAccVPCDefaultNetworkACL_basic(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDefaultNetworkACLDestroy, @@ -58,7 +58,7 @@ func TestAccVPCDefaultNetworkACL_basicIPv6VPC(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDefaultNetworkACLDestroy, @@ -87,7 +87,7 @@ func TestAccVPCDefaultNetworkACL_tags(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDefaultNetworkACLDestroy, @@ -133,7 +133,7 @@ func TestAccVPCDefaultNetworkACL_Deny_ingress(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDefaultNetworkACLDestroy, @@ -170,7 +170,7 @@ func TestAccVPCDefaultNetworkACL_withIPv6Ingress(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDefaultNetworkACLDestroy, @@ -207,7 +207,7 @@ func TestAccVPCDefaultNetworkACL_subnetRemoval(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDefaultNetworkACLDestroy, @@ -252,7 +252,7 @@ func TestAccVPCDefaultNetworkACL_subnetReassign(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDefaultNetworkACLDestroy, diff --git a/internal/service/ec2/vpc_default_route_table_test.go b/internal/service/ec2/vpc_default_route_table_test.go index 66cf5bb1bd07..fbf9d1c18b98 100644 --- a/internal/service/ec2/vpc_default_route_table_test.go +++ b/internal/service/ec2/vpc_default_route_table_test.go @@ -26,7 +26,7 @@ func TestAccVPCDefaultRouteTable_basic(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRouteTableDestroy(ctx), @@ -72,7 +72,7 @@ func TestAccVPCDefaultRouteTable_Disappears_vpc(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRouteTableDestroy(ctx), @@ -99,7 +99,7 @@ func TestAccVPCDefaultRouteTable_Route_mode(t *testing.T) { destinationCidr := "10.2.0.0/16" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDefaultRouteTableDestroy(ctx), @@ -170,7 +170,7 @@ func TestAccVPCDefaultRouteTable_swap(t *testing.T) { destinationCidr2 := "10.3.0.0/16" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDefaultRouteTableDestroy(ctx), @@ -241,7 +241,7 @@ func TestAccVPCDefaultRouteTable_ipv4ToTransitGateway(t *testing.T) { destinationCidr := "10.2.0.0/16" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRouteTableDestroy(ctx), @@ -278,7 +278,7 @@ func TestAccVPCDefaultRouteTable_ipv4ToVPCEndpoint(t *testing.T) { destinationCidr := "0.0.0.0/0" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckELBv2GatewayLoadBalancer(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckELBv2GatewayLoadBalancer(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID, "elasticloadbalancing"), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRouteTableDestroy(ctx), @@ -320,7 +320,7 @@ func TestAccVPCDefaultRouteTable_vpcEndpointAssociation(t *testing.T) { destinationCidr := "10.2.0.0/16" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDefaultRouteTableDestroy(ctx), @@ -351,7 +351,7 @@ func TestAccVPCDefaultRouteTable_tags(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRouteTableDestroy(ctx), @@ -395,7 +395,7 @@ func TestAccVPCDefaultRouteTable_conditionalCIDRBlock(t *testing.T) { destinationIpv6Cidr := "::/0" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRouteDestroy(ctx), @@ -433,7 +433,7 @@ func TestAccVPCDefaultRouteTable_prefixListToInternetGateway(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckManagedPrefixList(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckManagedPrefixList(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRouteTableDestroy(ctx), @@ -478,7 +478,7 @@ func TestAccVPCDefaultRouteTable_revokeExistingRules(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRouteTableDestroy(ctx), diff --git a/internal/service/ec2/vpc_default_security_group_test.go b/internal/service/ec2/vpc_default_security_group_test.go index 0ac9ec84ac78..1bd543181110 100644 --- a/internal/service/ec2/vpc_default_security_group_test.go +++ b/internal/service/ec2/vpc_default_security_group_test.go @@ -20,7 +20,7 @@ func TestAccVPCDefaultSecurityGroup_basic(t *testing.T) { vpcResourceName := "aws_vpc.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: acctest.CheckDestroyNoop, @@ -74,7 +74,7 @@ func TestAccVPCDefaultSecurityGroup_empty(t *testing.T) { resourceName := "aws_default_security_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: acctest.CheckDestroyNoop, diff --git a/internal/service/ec2/vpc_default_subnet_test.go b/internal/service/ec2/vpc_default_subnet_test.go index bf326ffa9ccd..9eb539e9bc16 100644 --- a/internal/service/ec2/vpc_default_subnet_test.go +++ b/internal/service/ec2/vpc_default_subnet_test.go @@ -81,7 +81,7 @@ func testAccDefaultSubnet_Existing_basic(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckRegionNot(t, endpoints.UsWest2RegionID, endpoints.UsGovWest1RegionID) testAccPreCheckDefaultSubnetExists(ctx, t) }, @@ -126,7 +126,7 @@ func testAccDefaultSubnet_Existing_forceDestroy(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckRegionNot(t, endpoints.UsWest2RegionID, endpoints.UsGovWest1RegionID) testAccPreCheckDefaultSubnetExists(ctx, t) }, @@ -153,7 +153,7 @@ func testAccDefaultSubnet_Existing_ipv6(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckRegionNot(t, endpoints.UsWest2RegionID, endpoints.UsGovWest1RegionID) testAccPreCheckDefaultSubnetExists(ctx, t) }, @@ -199,7 +199,7 @@ func testAccDefaultSubnet_Existing_privateDNSNameOptionsOnLaunch(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckRegionNot(t, endpoints.UsWest2RegionID, endpoints.UsGovWest1RegionID) testAccPreCheckDefaultSubnetExists(ctx, t) }, @@ -245,7 +245,7 @@ func testAccDefaultSubnet_NotFound_basic(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckRegionNot(t, endpoints.UsWest2RegionID, endpoints.UsGovWest1RegionID) testAccPreCheckDefaultSubnetNotFound(ctx, t) }, @@ -290,7 +290,7 @@ func testAccDefaultSubnet_NotFound_ipv6Native(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckRegionNot(t, endpoints.UsWest2RegionID, endpoints.UsGovWest1RegionID) testAccPreCheckDefaultSubnetNotFound(ctx, t) }, 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 b7658aebe2ea..1b30e7ed39a1 100644 --- a/internal/service/ec2/vpc_default_vpc_dhcp_options_test.go +++ b/internal/service/ec2/vpc_default_vpc_dhcp_options_test.go @@ -28,7 +28,7 @@ func testAccDefaultVPCDHCPOptions_basic(t *testing.T) { resourceName := "aws_default_vpc_dhcp_options.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: acctest.CheckDestroyNoop, @@ -55,7 +55,7 @@ func testAccDefaultVPCDHCPOptions_owner(t *testing.T) { resourceName := "aws_default_vpc_dhcp_options.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: acctest.CheckDestroyNoop, @@ -84,7 +84,7 @@ func testAccDefaultVPCDHCPOptions_v420Regression(t *testing.T) { resourceName := "aws_default_vpc_dhcp_options.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), CheckDestroy: acctest.CheckDestroyNoop, Steps: []resource.TestStep{ diff --git a/internal/service/ec2/vpc_default_vpc_test.go b/internal/service/ec2/vpc_default_vpc_test.go index bc58c46976c3..af1771d0ed52 100644 --- a/internal/service/ec2/vpc_default_vpc_test.go +++ b/internal/service/ec2/vpc_default_vpc_test.go @@ -78,7 +78,7 @@ func testAccDefaultVPC_Existing_basic(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckRegionNot(t, endpoints.UsWest2RegionID, endpoints.UsGovWest1RegionID) testAccPreCheckDefaultVPCExists(ctx, t) }, @@ -127,7 +127,7 @@ func testAccDefaultVPC_Existing_assignGeneratedIPv6CIDRBlock(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckRegionNot(t, endpoints.UsWest2RegionID, endpoints.UsGovWest1RegionID) testAccPreCheckDefaultVPCExists(ctx, t) }, @@ -176,7 +176,7 @@ func testAccDefaultVPC_Existing_forceDestroy(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckRegionNot(t, endpoints.UsWest2RegionID, endpoints.UsGovWest1RegionID) testAccPreCheckDefaultVPCExists(ctx, t) }, @@ -204,7 +204,7 @@ func testAccDefaultVPC_NotFound_basic(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckRegionNot(t, endpoints.UsWest2RegionID, endpoints.UsGovWest1RegionID) testAccPreCheckDefaultVPCNotFound(ctx, t) }, @@ -253,7 +253,7 @@ func testAccDefaultVPC_NotFound_assignGeneratedIPv6CIDRBlock(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckRegionNot(t, endpoints.UsWest2RegionID, endpoints.UsGovWest1RegionID) testAccPreCheckDefaultVPCNotFound(ctx, t) }, @@ -302,7 +302,7 @@ func testAccDefaultVPC_NotFound_forceDestroy(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckRegionNot(t, endpoints.UsWest2RegionID, endpoints.UsGovWest1RegionID) testAccPreCheckDefaultVPCNotFound(ctx, t) }, diff --git a/internal/service/ec2/vpc_dhcp_options_association_test.go b/internal/service/ec2/vpc_dhcp_options_association_test.go index 90581d7ed141..60fc4e30634d 100644 --- a/internal/service/ec2/vpc_dhcp_options_association_test.go +++ b/internal/service/ec2/vpc_dhcp_options_association_test.go @@ -21,7 +21,7 @@ func TestAccVPCDHCPOptionsAssociation_basic(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckVPCDHCPOptionsAssociationDestroy(ctx), @@ -48,7 +48,7 @@ func TestAccVPCDHCPOptionsAssociation_Disappears_vpc(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckVPCDHCPOptionsAssociationDestroy(ctx), @@ -71,7 +71,7 @@ func TestAccVPCDHCPOptionsAssociation_Disappears_dhcp(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckVPCDHCPOptionsAssociationDestroy(ctx), @@ -94,7 +94,7 @@ func TestAccVPCDHCPOptionsAssociation_disappears(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckVPCDHCPOptionsAssociationDestroy(ctx), @@ -117,7 +117,7 @@ func TestAccVPCDHCPOptionsAssociation_default(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckVPCDHCPOptionsAssociationDestroy(ctx), 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 cd3d998e4abf..53039461f96d 100644 --- a/internal/service/ec2/vpc_dhcp_options_data_source_test.go +++ b/internal/service/ec2/vpc_dhcp_options_data_source_test.go @@ -16,7 +16,7 @@ func TestAccVPCDHCPOptionsDataSource_basic(t *testing.T) { datasourceName := "data.aws_vpc_dhcp_options.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ @@ -53,7 +53,7 @@ func TestAccVPCDHCPOptionsDataSource_filter(t *testing.T) { datasourceName := "data.aws_vpc_dhcp_options.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ diff --git a/internal/service/ec2/vpc_dhcp_options_test.go b/internal/service/ec2/vpc_dhcp_options_test.go index a5b0e92c2a9d..13379ecf453d 100644 --- a/internal/service/ec2/vpc_dhcp_options_test.go +++ b/internal/service/ec2/vpc_dhcp_options_test.go @@ -22,7 +22,7 @@ func TestAccVPCDHCPOptions_basic(t *testing.T) { resourceName := "aws_vpc_dhcp_options.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDHCPOptionsDestroy(ctx), @@ -58,7 +58,7 @@ func TestAccVPCDHCPOptions_full(t *testing.T) { domainName := acctest.RandomDomainName() resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDHCPOptionsDestroy(ctx), @@ -97,7 +97,7 @@ func TestAccVPCDHCPOptions_tags(t *testing.T) { resourceName := "aws_vpc_dhcp_options.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDHCPOptionsDestroy(ctx), @@ -142,7 +142,7 @@ func TestAccVPCDHCPOptions_disappears(t *testing.T) { resourceName := "aws_vpc_dhcp_options.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDHCPOptionsDestroy(ctx), 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 4334823f4fbc..b0b1df37f439 100644 --- a/internal/service/ec2/vpc_egress_only_internet_gateway_test.go +++ b/internal/service/ec2/vpc_egress_only_internet_gateway_test.go @@ -22,7 +22,7 @@ func TestAccVPCEgressOnlyInternetGateway_basic(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckEgressOnlyInternetGatewayDestroy(ctx), @@ -50,7 +50,7 @@ func TestAccVPCEgressOnlyInternetGateway_tags(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckEgressOnlyInternetGatewayDestroy(ctx), diff --git a/internal/service/ec2/vpc_endpoint_connection_accepter_test.go b/internal/service/ec2/vpc_endpoint_connection_accepter_test.go index 4d3ce8b8708d..22e2f758f79b 100644 --- a/internal/service/ec2/vpc_endpoint_connection_accepter_test.go +++ b/internal/service/ec2/vpc_endpoint_connection_accepter_test.go @@ -22,7 +22,7 @@ func TestAccVPCEndpointConnectionAccepter_crossAccount(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckAlternateAccount(t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), diff --git a/internal/service/ec2/vpc_endpoint_connection_notification_test.go b/internal/service/ec2/vpc_endpoint_connection_notification_test.go index 44713b73aa12..a29ba9ba1fd7 100644 --- a/internal/service/ec2/vpc_endpoint_connection_notification_test.go +++ b/internal/service/ec2/vpc_endpoint_connection_notification_test.go @@ -21,7 +21,7 @@ func TestAccVPCEndpointConnectionNotification_basic(t *testing.T) { resourceName := "aws_vpc_endpoint_connection_notification.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckVPCEndpointConnectionNotificationDestroy(ctx), diff --git a/internal/service/ec2/vpc_endpoint_data_source_test.go b/internal/service/ec2/vpc_endpoint_data_source_test.go index f97f88134c13..77438b3f0113 100644 --- a/internal/service/ec2/vpc_endpoint_data_source_test.go +++ b/internal/service/ec2/vpc_endpoint_data_source_test.go @@ -16,7 +16,7 @@ func TestAccVPCEndpointDataSource_gatewayBasic(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ @@ -55,7 +55,7 @@ func TestAccVPCEndpointDataSource_byID(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ @@ -94,7 +94,7 @@ func TestAccVPCEndpointDataSource_byFilter(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ @@ -133,7 +133,7 @@ func TestAccVPCEndpointDataSource_byTags(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ @@ -172,7 +172,7 @@ func TestAccVPCEndpointDataSource_gatewayWithRouteTableAndTags(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ @@ -211,7 +211,7 @@ func TestAccVPCEndpointDataSource_interface(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ diff --git a/internal/service/ec2/vpc_endpoint_policy_test.go b/internal/service/ec2/vpc_endpoint_policy_test.go index 2c0762e3be20..424d84619282 100644 --- a/internal/service/ec2/vpc_endpoint_policy_test.go +++ b/internal/service/ec2/vpc_endpoint_policy_test.go @@ -19,7 +19,7 @@ func TestAccVPCEndpointPolicy_basic(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckVPCEndpointDestroy(ctx), @@ -52,7 +52,7 @@ func TestAccVPCEndpointPolicy_disappears(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckVPCEndpointDestroy(ctx), @@ -76,7 +76,7 @@ func TestAccVPCEndpointPolicy_disappears_endpoint(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckVPCEndpointDestroy(ctx), 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 981d80caed82..8d1100b92838 100644 --- a/internal/service/ec2/vpc_endpoint_route_table_association_test.go +++ b/internal/service/ec2/vpc_endpoint_route_table_association_test.go @@ -21,7 +21,7 @@ func TestAccVPCEndpointRouteTableAssociation_basic(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckVPCEndpointRouteTableAssociationDestroy(ctx), @@ -48,7 +48,7 @@ func TestAccVPCEndpointRouteTableAssociation_disappears(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckVPCEndpointRouteTableAssociationDestroy(ctx), 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 87a6b9b00de9..baf1a4d08dcb 100644 --- a/internal/service/ec2/vpc_endpoint_security_group_association_test.go +++ b/internal/service/ec2/vpc_endpoint_security_group_association_test.go @@ -22,7 +22,7 @@ func TestAccVPCEndpointSecurityGroupAssociation_basic(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckVPCEndpointSecurityGroupAssociationDestroy(ctx), @@ -45,7 +45,7 @@ func TestAccVPCEndpointSecurityGroupAssociation_disappears(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckVPCEndpointSecurityGroupAssociationDestroy(ctx), @@ -71,7 +71,7 @@ func TestAccVPCEndpointSecurityGroupAssociation_multiple(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckVPCEndpointSecurityGroupAssociationDestroy(ctx), @@ -96,7 +96,7 @@ func TestAccVPCEndpointSecurityGroupAssociation_replaceDefaultAssociation(t *tes rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckVPCEndpointSecurityGroupAssociationDestroy(ctx), 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 8829bb0ee0fc..b17b42c4037d 100644 --- a/internal/service/ec2/vpc_endpoint_service_allowed_principal_test.go +++ b/internal/service/ec2/vpc_endpoint_service_allowed_principal_test.go @@ -21,7 +21,7 @@ func TestAccVPCEndpointServiceAllowedPrincipal_basic(t *testing.T) { rName := sdkacctest.RandomWithPrefix("tfacctest") // 32 character limit resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckVPCEndpointServiceAllowedPrincipalDestroy(ctx), 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 6c7a0875d713..08f59c598bca 100644 --- a/internal/service/ec2/vpc_endpoint_service_data_source_test.go +++ b/internal/service/ec2/vpc_endpoint_service_data_source_test.go @@ -16,7 +16,7 @@ func TestAccVPCEndpointServiceDataSource_gateway(t *testing.T) { datasourceName := "data.aws_vpc_endpoint_service.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ @@ -45,7 +45,7 @@ func TestAccVPCEndpointServiceDataSource_interface(t *testing.T) { datasourceName := "data.aws_vpc_endpoint_service.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ @@ -76,7 +76,7 @@ func TestAccVPCEndpointServiceDataSource_custom(t *testing.T) { rName := sdkacctest.RandomWithPrefix("tfacctest") // 32 character limit resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ @@ -106,7 +106,7 @@ func TestAccVPCEndpointServiceDataSource_Custom_filter(t *testing.T) { rName := sdkacctest.RandomWithPrefix("tfacctest") // 32 character limit resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ @@ -136,7 +136,7 @@ func TestAccVPCEndpointServiceDataSource_CustomFilter_tags(t *testing.T) { rName := sdkacctest.RandomWithPrefix("tfacctest") // 32 character limit resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ @@ -164,7 +164,7 @@ func TestAccVPCEndpointServiceDataSource_ServiceType_gateway(t *testing.T) { datasourceName := "data.aws_vpc_endpoint_service.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ @@ -183,7 +183,7 @@ func TestAccVPCEndpointServiceDataSource_ServiceType_interface(t *testing.T) { datasourceName := "data.aws_vpc_endpoint_service.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ diff --git a/internal/service/ec2/vpc_endpoint_service_test.go b/internal/service/ec2/vpc_endpoint_service_test.go index c2acf5755f8b..b3e10c7c9511 100644 --- a/internal/service/ec2/vpc_endpoint_service_test.go +++ b/internal/service/ec2/vpc_endpoint_service_test.go @@ -23,7 +23,7 @@ func TestAccVPCEndpointService_basic(t *testing.T) { rName := sdkacctest.RandomWithPrefix("tfacctest") // 32 character limit resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckVPCEndpointServiceDestroy(ctx), @@ -65,7 +65,7 @@ func TestAccVPCEndpointService_disappears(t *testing.T) { rName := sdkacctest.RandomWithPrefix("tfacctest") // 32 character limit resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckVPCEndpointServiceDestroy(ctx), @@ -89,7 +89,7 @@ func TestAccVPCEndpointService_tags(t *testing.T) { rName := sdkacctest.RandomWithPrefix("tfacctest") // 32 character limit resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckVPCEndpointServiceDestroy(ctx), @@ -135,7 +135,7 @@ func TestAccVPCEndpointService_networkLoadBalancerARNs(t *testing.T) { rName := sdkacctest.RandomWithPrefix("tfacctest") // 32 character limit resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckVPCEndpointServiceDestroy(ctx), @@ -170,7 +170,7 @@ func TestAccVPCEndpointService_supportedIPAddressTypes(t *testing.T) { rName := sdkacctest.RandomWithPrefix("tfacctest") // 32 character limit resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckVPCEndpointServiceDestroy(ctx), @@ -208,7 +208,7 @@ func TestAccVPCEndpointService_allowedPrincipals(t *testing.T) { rName := sdkacctest.RandomWithPrefix("tfacctest") // 32 character limit resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckVPCEndpointServiceDestroy(ctx), @@ -250,7 +250,7 @@ func TestAccVPCEndpointService_gatewayLoadBalancerARNs(t *testing.T) { rName := sdkacctest.RandomWithPrefix("tfacctest") // 32 character limit resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckELBv2GatewayLoadBalancer(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckELBv2GatewayLoadBalancer(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckVPCEndpointServiceDestroy(ctx), @@ -287,7 +287,7 @@ func TestAccVPCEndpointService_privateDNSName(t *testing.T) { domainName2 := acctest.RandomSubdomain() resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckVPCEndpointServiceDestroy(ctx), diff --git a/internal/service/ec2/vpc_endpoint_subnet_association_test.go b/internal/service/ec2/vpc_endpoint_subnet_association_test.go index 8cde3c13df07..27e1942755b7 100644 --- a/internal/service/ec2/vpc_endpoint_subnet_association_test.go +++ b/internal/service/ec2/vpc_endpoint_subnet_association_test.go @@ -22,7 +22,7 @@ func TestAccVPCEndpointSubnetAssociation_basic(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckVPCEndpointSubnetAssociationDestroy(ctx), @@ -50,7 +50,7 @@ func TestAccVPCEndpointSubnetAssociation_disappears(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckVPCEndpointSubnetAssociationDestroy(ctx), @@ -76,7 +76,7 @@ func TestAccVPCEndpointSubnetAssociation_multiple(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckVPCEndpointSubnetAssociationDestroy(ctx), diff --git a/internal/service/ec2/vpc_endpoint_test.go b/internal/service/ec2/vpc_endpoint_test.go index f91068df4e5f..dbf2cfaf34b9 100644 --- a/internal/service/ec2/vpc_endpoint_test.go +++ b/internal/service/ec2/vpc_endpoint_test.go @@ -23,7 +23,7 @@ func TestAccVPCEndpoint_gatewayBasic(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckVPCEndpointDestroy(ctx), @@ -66,7 +66,7 @@ func TestAccVPCEndpoint_interfaceBasic(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckVPCEndpointDestroy(ctx), @@ -110,7 +110,7 @@ func TestAccVPCEndpoint_disappears(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckVPCEndpointDestroy(ctx), @@ -134,7 +134,7 @@ func TestAccVPCEndpoint_tags(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckVPCEndpointDestroy(ctx), @@ -180,7 +180,7 @@ func TestAccVPCEndpoint_gatewayWithRouteTableAndPolicy(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckVPCEndpointDestroy(ctx), @@ -253,7 +253,7 @@ func TestAccVPCEndpoint_gatewayPolicy(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckVPCEndpointDestroy(ctx), @@ -286,7 +286,7 @@ func TestAccVPCEndpoint_ignoreEquivalent(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckVPCEndpointDestroy(ctx), @@ -312,7 +312,7 @@ func TestAccVPCEndpoint_ipAddressType(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckVPCEndpointDestroy(ctx), @@ -352,7 +352,7 @@ func TestAccVPCEndpoint_interfaceWithSubnetAndSecurityGroup(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckVPCEndpointDestroy(ctx), @@ -391,7 +391,7 @@ func TestAccVPCEndpoint_interfaceNonAWSServiceAcceptOnCreate(t *testing.T) { // rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckVPCEndpointDestroy(ctx), @@ -420,7 +420,7 @@ func TestAccVPCEndpoint_interfaceNonAWSServiceAcceptOnUpdate(t *testing.T) { // rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckVPCEndpointDestroy(ctx), @@ -457,7 +457,7 @@ func TestAccVPCEndpoint_VPCEndpointType_gatewayLoadBalancer(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckELBv2GatewayLoadBalancer(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckELBv2GatewayLoadBalancer(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckVPCEndpointDestroy(ctx), diff --git a/internal/service/ec2/vpc_flow_log_test.go b/internal/service/ec2/vpc_flow_log_test.go index 99b0af570885..fe7861109fb1 100644 --- a/internal/service/ec2/vpc_flow_log_test.go +++ b/internal/service/ec2/vpc_flow_log_test.go @@ -26,7 +26,7 @@ func TestAccVPCFlowLog_vpcID(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckFlowLogDestroy(ctx), @@ -66,7 +66,7 @@ func TestAccVPCFlowLog_logFormat(t *testing.T) { logFormat := "${version} ${vpc-id} ${subnet-id}" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckFlowLogDestroy(ctx), @@ -101,7 +101,7 @@ func TestAccVPCFlowLog_subnetID(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckFlowLogDestroy(ctx), @@ -138,7 +138,7 @@ func TestAccVPCFlowLog_transitGatewayID(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckFlowLogDestroy(ctx), @@ -175,7 +175,7 @@ func TestAccVPCFlowLog_transitGatewayAttachmentID(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckFlowLogDestroy(ctx), @@ -210,7 +210,7 @@ func TestAccVPCFlowLog_LogDestinationType_cloudWatchLogs(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckFlowLogDestroy(ctx), @@ -242,7 +242,7 @@ func TestAccVPCFlowLog_LogDestinationType_kinesisFirehose(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckFlowLogDestroy(ctx), @@ -273,7 +273,7 @@ func TestAccVPCFlowLog_LogDestinationType_s3(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckFlowLogDestroy(ctx), @@ -301,7 +301,7 @@ func TestAccVPCFlowLog_LogDestinationTypeS3_invalid(t *testing.T) { rName := sdkacctest.RandomWithPrefix("tf-acc-test-flow-log-s3-invalid") resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckFlowLogDestroy(ctx), @@ -322,7 +322,7 @@ func TestAccVPCFlowLog_LogDestinationTypeS3DO_plainText(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckFlowLogDestroy(ctx), @@ -354,7 +354,7 @@ func TestAccVPCFlowLog_LogDestinationTypeS3DOPlainText_hiveCompatible(t *testing rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckFlowLogDestroy(ctx), @@ -388,7 +388,7 @@ func TestAccVPCFlowLog_LogDestinationTypeS3DO_parquet(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckFlowLogDestroy(ctx), @@ -420,7 +420,7 @@ func TestAccVPCFlowLog_LogDestinationTypeS3DOParquet_hiveCompatible(t *testing.T rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckFlowLogDestroy(ctx), @@ -453,7 +453,7 @@ func TestAccVPCFlowLog_LogDestinationTypeS3DOParquetHiveCompatible_perHour(t *te rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckFlowLogDestroy(ctx), @@ -486,7 +486,7 @@ func TestAccVPCFlowLog_LogDestinationType_maxAggregationInterval(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckFlowLogDestroy(ctx), @@ -514,7 +514,7 @@ func TestAccVPCFlowLog_tags(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckFlowLogDestroy(ctx), @@ -560,7 +560,7 @@ func TestAccVPCFlowLog_disappears(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckFlowLogDestroy(ctx), diff --git a/internal/service/ec2/vpc_internet_gateway_attachment_test.go b/internal/service/ec2/vpc_internet_gateway_attachment_test.go index b400fabc12e6..cf463b4517e7 100644 --- a/internal/service/ec2/vpc_internet_gateway_attachment_test.go +++ b/internal/service/ec2/vpc_internet_gateway_attachment_test.go @@ -24,7 +24,7 @@ func TestAccVPCInternetGatewayAttachment_basic(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckInternetGatewayAttachmentDestroy(ctx), @@ -53,7 +53,7 @@ func TestAccVPCInternetGatewayAttachment_disappears(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckInternetGatewayAttachmentDestroy(ctx), 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 3e8f7a58c61a..437682b556ea 100644 --- a/internal/service/ec2/vpc_internet_gateway_data_source_test.go +++ b/internal/service/ec2/vpc_internet_gateway_data_source_test.go @@ -19,7 +19,7 @@ func TestAccVPCInternetGatewayDataSource_basic(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ diff --git a/internal/service/ec2/vpc_internet_gateway_test.go b/internal/service/ec2/vpc_internet_gateway_test.go index 904baf1fb146..5a82526b38a0 100644 --- a/internal/service/ec2/vpc_internet_gateway_test.go +++ b/internal/service/ec2/vpc_internet_gateway_test.go @@ -22,7 +22,7 @@ func TestAccVPCInternetGateway_basic(t *testing.T) { resourceName := "aws_internet_gateway.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckInternetGatewayDestroy(ctx), @@ -52,7 +52,7 @@ func TestAccVPCInternetGateway_disappears(t *testing.T) { resourceName := "aws_internet_gateway.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckInternetGatewayDestroy(ctx), @@ -78,7 +78,7 @@ func TestAccVPCInternetGateway_Attachment(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckInternetGatewayDestroy(ctx), @@ -113,7 +113,7 @@ func TestAccVPCInternetGateway_Tags(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckInternetGatewayDestroy(ctx), 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 7ce964048af7..9eaddba62025 100644 --- a/internal/service/ec2/vpc_ipv4_cidr_block_association_test.go +++ b/internal/service/ec2/vpc_ipv4_cidr_block_association_test.go @@ -25,7 +25,7 @@ func TestAccVPCIPv4CIDRBlockAssociation_basic(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckVPCIPv4CIDRBlockAssociationDestroy(ctx), @@ -61,7 +61,7 @@ func TestAccVPCIPv4CIDRBlockAssociation_disappears(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckVPCIPv4CIDRBlockAssociationDestroy(ctx), @@ -89,7 +89,7 @@ func TestAccVPCIPv4CIDRBlockAssociation_ipamBasic(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckVPCIPv4CIDRBlockAssociationDestroy(ctx), @@ -116,7 +116,7 @@ func TestAccVPCIPv4CIDRBlockAssociation_ipamBasicExplicitCIDR(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckVPCIPv4CIDRBlockAssociationDestroy(ctx), 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 364b042badfc..93a75576f093 100644 --- a/internal/service/ec2/vpc_main_route_table_association_test.go +++ b/internal/service/ec2/vpc_main_route_table_association_test.go @@ -22,7 +22,7 @@ func TestAccVPCMainRouteTableAssociation_basic(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckMainRouteTableAssociationDestroy(ctx), 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 c99a1e5a5d7e..e28f8674a804 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 @@ -48,7 +48,7 @@ func TestAccVPCManagedPrefixListDataSource_basic(t *testing.T) { prefixListResourceName := "data.aws_prefix_list.s3_by_id" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckManagedPrefixList(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckManagedPrefixList(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ @@ -104,7 +104,7 @@ func TestAccVPCManagedPrefixListDataSource_filter(t *testing.T) { resourceById := "data.aws_ec2_managed_prefix_list.s3_by_id" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckManagedPrefixList(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckManagedPrefixList(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ @@ -157,7 +157,7 @@ data "aws_ec2_managed_prefix_list" "s3_by_id" { func TestAccVPCManagedPrefixListDataSource_matchesTooMany(t *testing.T) { ctx := acctest.Context(t) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckManagedPrefixList(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckManagedPrefixList(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ 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 359d684312ec..0631579b8e5e 100644 --- a/internal/service/ec2/vpc_managed_prefix_list_entry_test.go +++ b/internal/service/ec2/vpc_managed_prefix_list_entry_test.go @@ -24,7 +24,7 @@ func TestAccVPCManagedPrefixListEntry_ipv4(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckManagedPrefixList(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckManagedPrefixList(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckManagedPrefixListEntryDestroy(ctx), @@ -57,7 +57,7 @@ func TestAccVPCManagedPrefixListEntry_ipv4Multiple(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckManagedPrefixList(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckManagedPrefixList(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckManagedPrefixListEntryDestroy(ctx), @@ -85,7 +85,7 @@ func TestAccVPCManagedPrefixListEntry_ipv6(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckManagedPrefixList(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckManagedPrefixList(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckManagedPrefixListEntryDestroy(ctx), @@ -114,7 +114,7 @@ func TestAccVPCManagedPrefixListEntry_expectInvalidTypeError(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckManagedPrefixList(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckManagedPrefixList(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckManagedPrefixListEntryDestroy(ctx), @@ -132,7 +132,7 @@ func TestAccVPCManagedPrefixListEntry_expectInvalidCIDR(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckManagedPrefixList(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckManagedPrefixList(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckManagedPrefixListEntryDestroy(ctx), @@ -157,7 +157,7 @@ func TestAccVPCManagedPrefixListEntry_description(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckManagedPrefixList(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckManagedPrefixList(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckManagedPrefixListEntryDestroy(ctx), @@ -188,7 +188,7 @@ func TestAccVPCManagedPrefixListEntry_disappears(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckManagedPrefixList(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckManagedPrefixList(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckManagedPrefixListEntryDestroy(ctx), diff --git a/internal/service/ec2/vpc_managed_prefix_list_test.go b/internal/service/ec2/vpc_managed_prefix_list_test.go index cd047db1896b..b33c031a7a9f 100644 --- a/internal/service/ec2/vpc_managed_prefix_list_test.go +++ b/internal/service/ec2/vpc_managed_prefix_list_test.go @@ -22,7 +22,7 @@ func TestAccVPCManagedPrefixList_basic(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckManagedPrefixList(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckManagedPrefixList(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckManagedPrefixListDestroy(ctx), @@ -65,7 +65,7 @@ func TestAccVPCManagedPrefixList_disappears(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckManagedPrefixList(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckManagedPrefixList(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckManagedPrefixListDestroy(ctx), @@ -88,7 +88,7 @@ func TestAccVPCManagedPrefixList_AddressFamily_ipv6(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckManagedPrefixList(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckManagedPrefixList(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckManagedPrefixListDestroy(ctx), @@ -116,7 +116,7 @@ func TestAccVPCManagedPrefixList_Entry_cidr(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckManagedPrefixList(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckManagedPrefixList(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckManagedPrefixListDestroy(ctx), @@ -175,7 +175,7 @@ func TestAccVPCManagedPrefixList_Entry_description(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckManagedPrefixList(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckManagedPrefixList(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckManagedPrefixListDestroy(ctx), @@ -229,7 +229,7 @@ func TestAccVPCManagedPrefixList_updateEntryAndMaxEntry(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckManagedPrefixList(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckManagedPrefixList(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckManagedPrefixListDestroy(ctx), @@ -274,7 +274,7 @@ func TestAccVPCManagedPrefixList_name(t *testing.T) { rName2 := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckManagedPrefixList(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckManagedPrefixList(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckManagedPrefixListDestroy(ctx), @@ -312,7 +312,7 @@ func TestAccVPCManagedPrefixList_tags(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckManagedPrefixList(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckManagedPrefixList(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckManagedPrefixListDestroy(ctx), 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 473a30efdb09..c1f4707a5e7e 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 @@ -12,7 +12,7 @@ import ( func TestAccVPCManagedPrefixListsDataSource_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ @@ -30,7 +30,7 @@ func TestAccVPCManagedPrefixListsDataSource_tags(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ @@ -46,7 +46,7 @@ func TestAccVPCManagedPrefixListsDataSource_tags(t *testing.T) { func TestAccVPCManagedPrefixListsDataSource_noMatches(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ 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 ba25dc96135a..66861d4deebb 100644 --- a/internal/service/ec2/vpc_nat_gateway_data_source_test.go +++ b/internal/service/ec2/vpc_nat_gateway_data_source_test.go @@ -18,7 +18,7 @@ func TestAccVPCNATGatewayDataSource_basic(t *testing.T) { resourceName := "aws_nat_gateway.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ diff --git a/internal/service/ec2/vpc_nat_gateway_test.go b/internal/service/ec2/vpc_nat_gateway_test.go index e9f4a48f5d57..46bb6f1f48ba 100644 --- a/internal/service/ec2/vpc_nat_gateway_test.go +++ b/internal/service/ec2/vpc_nat_gateway_test.go @@ -22,7 +22,7 @@ func TestAccVPCNATGateway_basic(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckNATGatewayDestroy(ctx), @@ -55,7 +55,7 @@ func TestAccVPCNATGateway_disappears(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckNATGatewayDestroy(ctx), @@ -79,7 +79,7 @@ func TestAccVPCNATGateway_ConnectivityType_private(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckNATGatewayDestroy(ctx), @@ -113,7 +113,7 @@ func TestAccVPCNATGateway_privateIP(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckNATGatewayDestroy(ctx), @@ -145,7 +145,7 @@ func TestAccVPCNATGateway_tags(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckNATGatewayDestroy(ctx), 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 d42895a3d394..3d50a24282c8 100644 --- a/internal/service/ec2/vpc_nat_gateways_data_source_test.go +++ b/internal/service/ec2/vpc_nat_gateways_data_source_test.go @@ -14,7 +14,7 @@ func TestAccVPCNATGatewaysDataSource_basic(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ diff --git a/internal/service/ec2/vpc_network_acl_association_test.go b/internal/service/ec2/vpc_network_acl_association_test.go index 8b6a24b4c708..851db371678c 100644 --- a/internal/service/ec2/vpc_network_acl_association_test.go +++ b/internal/service/ec2/vpc_network_acl_association_test.go @@ -24,7 +24,7 @@ func TestAccVPCNetworkACLAssociation_basic(t *testing.T) { subnetResourceName := "aws_subnet.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckNetworkACLAssociationDestroy(ctx), @@ -53,7 +53,7 @@ func TestAccVPCNetworkACLAssociation_disappears(t *testing.T) { resourceName := "aws_network_acl_association.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckNetworkACLAssociationDestroy(ctx), @@ -78,7 +78,7 @@ func TestAccVPCNetworkACLAssociation_disappears_NACL(t *testing.T) { naclResourceName := "aws_network_acl.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckNetworkACLAssociationDestroy(ctx), @@ -103,7 +103,7 @@ func TestAccVPCNetworkACLAssociation_disappears_Subnet(t *testing.T) { subnetResourceName := "aws_subnet.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckNetworkACLAssociationDestroy(ctx), @@ -131,7 +131,7 @@ func TestAccVPCNetworkACLAssociation_twoAssociations(t *testing.T) { subnet2ResourceName := "aws_subnet.test2" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckNetworkACLAssociationDestroy(ctx), @@ -169,7 +169,7 @@ func TestAccVPCNetworkACLAssociation_associateWithDefaultNACL(t *testing.T) { subnetResourceName := "aws_subnet.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckNetworkACLAssociationDestroy(ctx), diff --git a/internal/service/ec2/vpc_network_acl_rule_test.go b/internal/service/ec2/vpc_network_acl_rule_test.go index a11347913a6c..1d69223b888e 100644 --- a/internal/service/ec2/vpc_network_acl_rule_test.go +++ b/internal/service/ec2/vpc_network_acl_rule_test.go @@ -26,7 +26,7 @@ func TestAccVPCNetworkACLRule_basic(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckNetworkACLRuleDestroy(ctx), @@ -94,7 +94,7 @@ func TestAccVPCNetworkACLRule_disappears(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckNetworkACLRuleDestroy(ctx), @@ -117,7 +117,7 @@ func TestAccVPCNetworkACLRule_Disappears_networkACL(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckNetworkACLRuleDestroy(ctx), @@ -140,7 +140,7 @@ func TestAccVPCNetworkACLRule_Disappears_ingressEgressSameNumber(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckNetworkACLRuleDestroy(ctx), @@ -163,7 +163,7 @@ func TestAccVPCNetworkACLRule_ipv6(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckNetworkACLRuleDestroy(ctx), @@ -198,7 +198,7 @@ func TestAccVPCNetworkACLRule_ipv6ICMP(t *testing.T) { resourceName := "aws_network_acl_rule.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckNetworkACLRuleDestroy(ctx), @@ -236,7 +236,7 @@ func TestAccVPCNetworkACLRule_ipv6VPCAssignGeneratedIPv6CIDRBlockUpdate(t *testi resourceName := "aws_network_acl_rule.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckNetworkACLRuleDestroy(ctx), @@ -274,7 +274,7 @@ func TestAccVPCNetworkACLRule_allProtocol(t *testing.T) { resourceName := "aws_network_acl_rule.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckNetworkACLRuleDestroy(ctx), @@ -307,7 +307,7 @@ func TestAccVPCNetworkACLRule_tcpProtocol(t *testing.T) { resourceName := "aws_network_acl_rule.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckNetworkACLRuleDestroy(ctx), diff --git a/internal/service/ec2/vpc_network_acl_test.go b/internal/service/ec2/vpc_network_acl_test.go index 25d7ee0b5ac7..7b6300582196 100644 --- a/internal/service/ec2/vpc_network_acl_test.go +++ b/internal/service/ec2/vpc_network_acl_test.go @@ -24,7 +24,7 @@ func TestAccVPCNetworkACL_basic(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckNetworkACLDestroy(ctx), @@ -58,7 +58,7 @@ func TestAccVPCNetworkACL_disappears(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckNetworkACLDestroy(ctx), @@ -82,7 +82,7 @@ func TestAccVPCNetworkACL_tags(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckNetworkACLDestroy(ctx), @@ -128,7 +128,7 @@ func TestAccVPCNetworkACL_Egress_mode(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckNetworkACLDestroy(ctx), @@ -180,7 +180,7 @@ func TestAccVPCNetworkACL_Ingress_mode(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckNetworkACLDestroy(ctx), @@ -232,7 +232,7 @@ func TestAccVPCNetworkACL_egressAndIngressRules(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckNetworkACLDestroy(ctx), @@ -275,7 +275,7 @@ func TestAccVPCNetworkACL_OnlyIngressRules_basic(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckNetworkACLDestroy(ctx), @@ -310,7 +310,7 @@ func TestAccVPCNetworkACL_OnlyIngressRules_update(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckNetworkACLDestroy(ctx), @@ -365,7 +365,7 @@ func TestAccVPCNetworkACL_caseSensitivityNoChanges(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckNetworkACLDestroy(ctx), @@ -392,7 +392,7 @@ func TestAccVPCNetworkACL_onlyEgressRules(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckNetworkACLDestroy(ctx), @@ -419,7 +419,7 @@ func TestAccVPCNetworkACL_subnetChange(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckNetworkACLDestroy(ctx), @@ -456,7 +456,7 @@ func TestAccVPCNetworkACL_subnets(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckNetworkACLDestroy(ctx), @@ -496,7 +496,7 @@ func TestAccVPCNetworkACL_subnetsDelete(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckNetworkACLDestroy(ctx), @@ -534,7 +534,7 @@ func TestAccVPCNetworkACL_ipv6Rules(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckNetworkACLDestroy(ctx), @@ -571,7 +571,7 @@ func TestAccVPCNetworkACL_ipv6ICMPRules(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckNetworkACLDestroy(ctx), @@ -593,7 +593,7 @@ func TestAccVPCNetworkACL_ipv6VPCRules(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckNetworkACLDestroy(ctx), @@ -624,7 +624,7 @@ func TestAccVPCNetworkACL_espProtocol(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckNetworkACLDestroy(ctx), 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 19e1a28b808e..a4a04ad2b74f 100644 --- a/internal/service/ec2/vpc_network_acls_data_source_test.go +++ b/internal/service/ec2/vpc_network_acls_data_source_test.go @@ -16,7 +16,7 @@ func TestAccVPCNetworkACLsDataSource_basic(t *testing.T) { dataSourceName := "data.aws_network_acls.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckVPCDestroy(ctx), @@ -37,7 +37,7 @@ func TestAccVPCNetworkACLsDataSource_filter(t *testing.T) { dataSourceName := "data.aws_network_acls.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckVPCDestroy(ctx), @@ -58,7 +58,7 @@ func TestAccVPCNetworkACLsDataSource_tags(t *testing.T) { dataSourceName := "data.aws_network_acls.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckVPCDestroy(ctx), @@ -79,7 +79,7 @@ func TestAccVPCNetworkACLsDataSource_vpcID(t *testing.T) { dataSourceName := "data.aws_network_acls.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckVPCDestroy(ctx), @@ -101,7 +101,7 @@ func TestAccVPCNetworkACLsDataSource_empty(t *testing.T) { dataSourceName := "data.aws_network_acls.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckVPCDestroy(ctx), 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 d5dd6645ca7f..a6575a410715 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 @@ -16,7 +16,7 @@ func TestAccVPCNetworkInsightsAnalysisDataSource_basic(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ diff --git a/internal/service/ec2/vpc_network_insights_analysis_test.go b/internal/service/ec2/vpc_network_insights_analysis_test.go index 448fbd9ebcb4..263fde4e7294 100644 --- a/internal/service/ec2/vpc_network_insights_analysis_test.go +++ b/internal/service/ec2/vpc_network_insights_analysis_test.go @@ -22,7 +22,7 @@ func TestAccVPCNetworkInsightsAnalysis_basic(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckNetworkInsightsAnalysisDestroy(ctx), @@ -57,7 +57,7 @@ func TestAccVPCNetworkInsightsAnalysis_disappears(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckNetworkInsightsAnalysisDestroy(ctx), @@ -80,7 +80,7 @@ func TestAccVPCNetworkInsightsAnalysis_tags(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckNetworkInsightsAnalysisDestroy(ctx), @@ -126,7 +126,7 @@ func TestAccVPCNetworkInsightsAnalysis_filterInARNs(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckNetworkInsightsAnalysisDestroy(ctx), @@ -161,7 +161,7 @@ func TestAccVPCNetworkInsightsAnalysis_waitForCompletion(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckNetworkInsightsAnalysisDestroy(ctx), 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 f7e66d2d910f..378addbf4bd7 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 @@ -16,7 +16,7 @@ func TestAccVPCNetworkInsightsPathDataSource_basic(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ diff --git a/internal/service/ec2/vpc_network_insights_path_test.go b/internal/service/ec2/vpc_network_insights_path_test.go index 33d9b6642a6f..441b13a77d6d 100644 --- a/internal/service/ec2/vpc_network_insights_path_test.go +++ b/internal/service/ec2/vpc_network_insights_path_test.go @@ -22,7 +22,7 @@ func TestAccVPCNetworkInsightsPath_basic(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckNetworkInsightsPathDestroy(ctx), @@ -56,7 +56,7 @@ func TestAccVPCNetworkInsightsPath_disappears(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckNetworkInsightsPathDestroy(ctx), @@ -79,7 +79,7 @@ func TestAccVPCNetworkInsightsPath_tags(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckNetworkInsightsPathDestroy(ctx), @@ -124,7 +124,7 @@ func TestAccVPCNetworkInsightsPath_sourceIP(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckNetworkInsightsPathDestroy(ctx), @@ -158,7 +158,7 @@ func TestAccVPCNetworkInsightsPath_destinationIP(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckNetworkInsightsPathDestroy(ctx), @@ -192,7 +192,7 @@ func TestAccVPCNetworkInsightsPath_destinationPort(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckNetworkInsightsPathDestroy(ctx), diff --git a/internal/service/ec2/vpc_network_interface_attachment_test.go b/internal/service/ec2/vpc_network_interface_attachment_test.go index 510cf1bed70e..f1a5d61bf910 100644 --- a/internal/service/ec2/vpc_network_interface_attachment_test.go +++ b/internal/service/ec2/vpc_network_interface_attachment_test.go @@ -17,7 +17,7 @@ func TestAccVPCNetworkInterfaceAttachment_basic(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckENIDestroy(ctx), 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 561b7768ed5a..afbae2715ac3 100644 --- a/internal/service/ec2/vpc_network_interface_data_source_test.go +++ b/internal/service/ec2/vpc_network_interface_data_source_test.go @@ -16,7 +16,7 @@ func TestAccVPCNetworkInterfaceDataSource_basic(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ @@ -46,7 +46,7 @@ func TestAccVPCNetworkInterfaceDataSource_filters(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ @@ -72,7 +72,7 @@ func TestAccVPCNetworkInterfaceDataSource_carrierIPAssociation(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckWavelengthZoneAvailable(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckWavelengthZoneAvailable(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ @@ -120,7 +120,7 @@ func TestAccVPCNetworkInterfaceDataSource_publicIPAssociation(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ @@ -166,7 +166,7 @@ func TestAccVPCNetworkInterfaceDataSource_attachment(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ 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 11127eab638c..ea35601f59b0 100644 --- a/internal/service/ec2/vpc_network_interface_sg_attachment_test.go +++ b/internal/service/ec2/vpc_network_interface_sg_attachment_test.go @@ -23,7 +23,7 @@ func TestAccVPCNetworkInterfaceSgAttachment_basic(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckNetworkInterfaceSGAttachmentDestroy(ctx), @@ -52,7 +52,7 @@ func TestAccVPCNetworkInterfaceSgAttachment_disappears(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckNetworkInterfaceSGAttachmentDestroy(ctx), @@ -77,7 +77,7 @@ func TestAccVPCNetworkInterfaceSgAttachment_instance(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckNetworkInterfaceSGAttachmentDestroy(ctx), @@ -108,7 +108,7 @@ func TestAccVPCNetworkInterfaceSgAttachment_multiple(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckNetworkInterfaceSGAttachmentDestroy(ctx), diff --git a/internal/service/ec2/vpc_network_interface_test.go b/internal/service/ec2/vpc_network_interface_test.go index 687894ee451e..ce6ba18a043d 100644 --- a/internal/service/ec2/vpc_network_interface_test.go +++ b/internal/service/ec2/vpc_network_interface_test.go @@ -52,7 +52,7 @@ func TestAccVPCNetworkInterface_basic(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckENIDestroy(ctx), @@ -96,7 +96,7 @@ func TestAccVPCNetworkInterface_ipv6(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckENIDestroy(ctx), @@ -142,7 +142,7 @@ func TestAccVPCNetworkInterface_tags(t *testing.T) { var conf ec2.NetworkInterface resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckENIDestroy(ctx), @@ -189,7 +189,7 @@ func TestAccVPCNetworkInterface_ipv6Count(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckENIDestroy(ctx), @@ -239,7 +239,7 @@ func TestAccVPCNetworkInterface_disappears(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckENIDestroy(ctx), @@ -265,7 +265,7 @@ func TestAccVPCNetworkInterface_description(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckENIDestroy(ctx), @@ -337,7 +337,7 @@ func TestAccVPCNetworkInterface_attachment(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckENIDestroy(ctx), @@ -372,7 +372,7 @@ func TestAccVPCNetworkInterface_ignoreExternalAttachment(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckENIDestroy(ctx), @@ -401,7 +401,7 @@ func TestAccVPCNetworkInterface_sourceDestCheck(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckENIDestroy(ctx), @@ -444,7 +444,7 @@ func TestAccVPCNetworkInterface_privateIPsCount(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckENIDestroy(ctx), @@ -512,7 +512,7 @@ func TestAccVPCNetworkInterface_ENIInterfaceType_efa(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckENIDestroy(ctx), @@ -541,7 +541,7 @@ func TestAccVPCNetworkInterface_ENI_ipv4Prefix(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckENIDestroy(ctx), @@ -587,7 +587,7 @@ func TestAccVPCNetworkInterface_ENI_ipv4PrefixCount(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckENIDestroy(ctx), @@ -637,7 +637,7 @@ func TestAccVPCNetworkInterface_ENI_ipv6Prefix(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckENIDestroy(ctx), @@ -683,7 +683,7 @@ func TestAccVPCNetworkInterface_ENI_ipv6PrefixCount(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckENIDestroy(ctx), @@ -733,7 +733,7 @@ func TestAccVPCNetworkInterface_privateIPSet(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckENIDestroy(ctx), @@ -829,7 +829,7 @@ func TestAccVPCNetworkInterface_privateIPList(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckENIDestroy(ctx), 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 03296ef17833..2d974bfb10f9 100644 --- a/internal/service/ec2/vpc_network_interfaces_data_source_test.go +++ b/internal/service/ec2/vpc_network_interfaces_data_source_test.go @@ -15,7 +15,7 @@ func TestAccVPCNetworkInterfacesDataSource_filter(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckVPCDestroy(ctx), @@ -35,7 +35,7 @@ func TestAccVPCNetworkInterfacesDataSource_tags(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckVPCDestroy(ctx), @@ -55,7 +55,7 @@ func TestAccVPCNetworkInterfacesDataSource_empty(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckVPCDestroy(ctx), 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 65b262d743d3..b3c890c47969 100644 --- a/internal/service/ec2/vpc_network_performance_metric_subscription_test.go +++ b/internal/service/ec2/vpc_network_performance_metric_subscription_test.go @@ -32,7 +32,7 @@ func testAccNetworkPerformanceMetricSubscription_basic(t *testing.T) { dst := acctest.Region() resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckNetworkPerformanceMetricSubscriptionDestroy(ctx), @@ -59,7 +59,7 @@ func testAccNetworkPerformanceMetricSubscription_disappears(t *testing.T) { dst := acctest.Region() resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckNetworkPerformanceMetricSubscriptionDestroy(ctx), diff --git a/internal/service/ec2/vpc_peering_connection_accepter_test.go b/internal/service/ec2/vpc_peering_connection_accepter_test.go index 01c97bb69211..ede218c5fdb0 100644 --- a/internal/service/ec2/vpc_peering_connection_accepter_test.go +++ b/internal/service/ec2/vpc_peering_connection_accepter_test.go @@ -22,7 +22,7 @@ func TestAccVPCPeeringConnectionAccepter_sameRegionSameAccount(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckVPCPeeringConnectionAccepterDestroy, @@ -78,7 +78,7 @@ func TestAccVPCPeeringConnectionAccepter_differentRegionSameAccount(t *testing.T resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckMultipleRegion(t, 2) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), @@ -123,7 +123,7 @@ func TestAccVPCPeeringConnectionAccepter_sameRegionDifferentAccount(t *testing.T resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckAlternateAccount(t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), @@ -160,7 +160,7 @@ func TestAccVPCPeeringConnectionAccepter_differentRegionDifferentAccount(t *test resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckMultipleRegion(t, 2) acctest.PreCheckAlternateAccount(t) }, 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 dc5890cd45fc..4d144e5b6a1e 100644 --- a/internal/service/ec2/vpc_peering_connection_data_source_test.go +++ b/internal/service/ec2/vpc_peering_connection_data_source_test.go @@ -17,7 +17,7 @@ func TestAccVPCPeeringConnectionDataSource_cidrBlock(t *testing.T) { requesterVpcResourceName := "aws_vpc.requester" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ @@ -40,7 +40,7 @@ func TestAccVPCPeeringConnectionDataSource_id(t *testing.T) { requesterVpcResourceName := "aws_vpc.requester" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ @@ -79,7 +79,7 @@ func TestAccVPCPeeringConnectionDataSource_peerCIDRBlock(t *testing.T) { accepterVpcResourceName := "aws_vpc.accepter" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ @@ -100,7 +100,7 @@ func TestAccVPCPeeringConnectionDataSource_peerVPCID(t *testing.T) { resourceName := "aws_vpc_peering_connection.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ @@ -121,7 +121,7 @@ func TestAccVPCPeeringConnectionDataSource_vpcID(t *testing.T) { resourceName := "aws_vpc_peering_connection.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ diff --git a/internal/service/ec2/vpc_peering_connection_options_test.go b/internal/service/ec2/vpc_peering_connection_options_test.go index 4ca91026465a..34c2f7e5bf58 100644 --- a/internal/service/ec2/vpc_peering_connection_options_test.go +++ b/internal/service/ec2/vpc_peering_connection_options_test.go @@ -24,7 +24,7 @@ func TestAccVPCPeeringConnectionOptions_basic(t *testing.T) { pcxResourceName := "aws_vpc_peering_connection.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckVPCPeeringConnectionDestroy(ctx), @@ -113,7 +113,7 @@ func TestAccVPCPeeringConnectionOptions_differentRegionSameAccount(t *testing.T) resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckMultipleRegion(t, 2) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), @@ -205,7 +205,7 @@ func TestAccVPCPeeringConnectionOptions_sameRegionDifferentAccount(t *testing.T) resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckAlternateAccount(t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), diff --git a/internal/service/ec2/vpc_peering_connection_test.go b/internal/service/ec2/vpc_peering_connection_test.go index f9a8bde7a5eb..c7d411530881 100644 --- a/internal/service/ec2/vpc_peering_connection_test.go +++ b/internal/service/ec2/vpc_peering_connection_test.go @@ -26,7 +26,7 @@ func TestAccVPCPeeringConnection_basic(t *testing.T) { resourceName := "aws_vpc_peering_connection.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckVPCPeeringConnectionDestroy(ctx), @@ -57,7 +57,7 @@ func TestAccVPCPeeringConnection_disappears(t *testing.T) { resourceName := "aws_vpc_peering_connection.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckVPCPeeringConnectionDestroy(ctx), @@ -81,7 +81,7 @@ func TestAccVPCPeeringConnection_tags(t *testing.T) { resourceName := "aws_vpc_peering_connection.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckVPCDestroy(ctx), @@ -144,7 +144,7 @@ func TestAccVPCPeeringConnection_options(t *testing.T) { } resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckVPCPeeringConnectionDestroy(ctx), @@ -268,7 +268,7 @@ func TestAccVPCPeeringConnection_failedState(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckVPCPeeringConnectionDestroy(ctx), @@ -287,7 +287,7 @@ func TestAccVPCPeeringConnection_peerRegionAutoAccept(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckMultipleRegion(t, 2) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), @@ -310,7 +310,7 @@ func TestAccVPCPeeringConnection_region(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckMultipleRegion(t, 2) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), @@ -342,7 +342,7 @@ func TestAccVPCPeeringConnection_accept(t *testing.T) { resourceName := "aws_vpc_peering_connection.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckVPCPeeringConnectionDestroy(ctx), @@ -405,7 +405,7 @@ func TestAccVPCPeeringConnection_optionsNoAutoAccept(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckVPCPeeringConnectionDestroy(ctx), 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 230be633503a..18533ef19b41 100644 --- a/internal/service/ec2/vpc_peering_connections_data_source_test.go +++ b/internal/service/ec2/vpc_peering_connections_data_source_test.go @@ -14,7 +14,7 @@ func TestAccVPCPeeringConnectionsDataSource_basic(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ @@ -32,7 +32,7 @@ func TestAccVPCPeeringConnectionsDataSource_NoMatches(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ 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 7fb0fe4e806e..ebf3f50c0d4f 100644 --- a/internal/service/ec2/vpc_prefix_list_data_source_test.go +++ b/internal/service/ec2/vpc_prefix_list_data_source_test.go @@ -14,7 +14,7 @@ func TestAccVPCPrefixListDataSource_basic(t *testing.T) { ds2Name := "data.aws_prefix_list.s3_by_name" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ @@ -36,7 +36,7 @@ func TestAccVPCPrefixListDataSource_filter(t *testing.T) { ds2Name := "data.aws_prefix_list.s3_by_name" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ @@ -55,7 +55,7 @@ func TestAccVPCPrefixListDataSource_filter(t *testing.T) { func TestAccVPCPrefixListDataSource_nameDoesNotOverrideFilter(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ diff --git a/internal/service/ec2/vpc_route_data_source_test.go b/internal/service/ec2/vpc_route_data_source_test.go index 9a0bdb2a913e..9f867dd7c92d 100644 --- a/internal/service/ec2/vpc_route_data_source_test.go +++ b/internal/service/ec2/vpc_route_data_source_test.go @@ -23,7 +23,7 @@ func TestAccVPCRouteDataSource_basic(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ @@ -60,7 +60,7 @@ func TestAccVPCRouteDataSource_transitGatewayID(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRouteDestroy(ctx), @@ -84,7 +84,7 @@ func TestAccVPCRouteDataSource_ipv6DestinationCIDR(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRouteDestroy(ctx), @@ -107,7 +107,7 @@ func TestAccVPCRouteDataSource_localGatewayID(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckOutpostsOutposts(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckOutpostsOutposts(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRouteDestroy(ctx), @@ -131,7 +131,7 @@ func TestAccVPCRouteDataSource_carrierGatewayID(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckWavelengthZoneAvailable(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckWavelengthZoneAvailable(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRouteDestroy(ctx), @@ -155,7 +155,7 @@ func TestAccVPCRouteDataSource_destinationPrefixListID(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckManagedPrefixList(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckManagedPrefixList(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRouteDestroy(ctx), @@ -181,7 +181,7 @@ func TestAccVPCRouteDataSource_gatewayVPCEndpoint(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRouteDestroy(ctx), diff --git a/internal/service/ec2/vpc_route_table_association_test.go b/internal/service/ec2/vpc_route_table_association_test.go index 8b7804c18d09..49309af2e3dc 100644 --- a/internal/service/ec2/vpc_route_table_association_test.go +++ b/internal/service/ec2/vpc_route_table_association_test.go @@ -24,7 +24,7 @@ func TestAccVPCRouteTableAssociation_Subnet_basic(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRouteTableAssociationDestroy(ctx), @@ -57,7 +57,7 @@ func TestAccVPCRouteTableAssociation_Subnet_changeRouteTable(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRouteTableAssociationDestroy(ctx), @@ -91,7 +91,7 @@ func TestAccVPCRouteTableAssociation_Gateway_basic(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRouteTableAssociationDestroy(ctx), @@ -124,7 +124,7 @@ func TestAccVPCRouteTableAssociation_Gateway_changeRouteTable(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRouteTableAssociationDestroy(ctx), @@ -156,7 +156,7 @@ func TestAccVPCRouteTableAssociation_disappears(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRouteTableAssociationDestroy(ctx), 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 a6c1bdf8b130..16032e97487d 100644 --- a/internal/service/ec2/vpc_route_table_data_source_test.go +++ b/internal/service/ec2/vpc_route_table_data_source_test.go @@ -25,7 +25,7 @@ func TestAccVPCRouteTableDataSource_basic(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ @@ -103,7 +103,7 @@ func TestAccVPCRouteTableDataSource_main(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ diff --git a/internal/service/ec2/vpc_route_table_test.go b/internal/service/ec2/vpc_route_table_test.go index c914ff0fe335..a2d11563a6aa 100644 --- a/internal/service/ec2/vpc_route_table_test.go +++ b/internal/service/ec2/vpc_route_table_test.go @@ -25,7 +25,7 @@ func TestAccVPCRouteTable_basic(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRouteDestroy(ctx), @@ -58,7 +58,7 @@ func TestAccVPCRouteTable_disappears(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRouteDestroy(ctx), @@ -82,7 +82,7 @@ func TestAccVPCRouteTable_Disappears_subnetAssociation(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRouteDestroy(ctx), @@ -110,7 +110,7 @@ func TestAccVPCRouteTable_ipv4ToInternetGateway(t *testing.T) { destinationCidr3 := "10.4.0.0/16" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRouteTableDestroy(ctx), @@ -163,7 +163,7 @@ func TestAccVPCRouteTable_ipv4ToInstance(t *testing.T) { destinationCidr := "10.2.0.0/16" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRouteTableDestroy(ctx), @@ -200,7 +200,7 @@ func TestAccVPCRouteTable_ipv6ToEgressOnlyInternetGateway(t *testing.T) { destinationCidr := "::/0" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRouteTableDestroy(ctx), @@ -240,7 +240,7 @@ func TestAccVPCRouteTable_tags(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRouteTableDestroy(ctx), @@ -288,7 +288,7 @@ func TestAccVPCRouteTable_requireRouteDestination(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRouteTableDestroy(ctx), @@ -306,7 +306,7 @@ func TestAccVPCRouteTable_requireRouteTarget(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRouteTableDestroy(ctx), @@ -329,7 +329,7 @@ func TestAccVPCRouteTable_Route_mode(t *testing.T) { destinationCidr2 := "10.3.0.0/16" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRouteTableDestroy(ctx), @@ -409,7 +409,7 @@ func TestAccVPCRouteTable_ipv4ToTransitGateway(t *testing.T) { destinationCidr := "10.2.0.0/16" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRouteTableDestroy(ctx), @@ -450,7 +450,7 @@ func TestAccVPCRouteTable_ipv4ToVPCEndpoint(t *testing.T) { destinationCidr := "0.0.0.0/0" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckELBv2GatewayLoadBalancer(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckELBv2GatewayLoadBalancer(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID, "elasticloadbalancing"), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRouteTableDestroy(ctx), @@ -487,7 +487,7 @@ func TestAccVPCRouteTable_ipv4ToCarrierGateway(t *testing.T) { destinationCidr := "0.0.0.0/0" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckWavelengthZoneAvailable(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckWavelengthZoneAvailable(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRouteTableDestroy(ctx), @@ -524,7 +524,7 @@ func TestAccVPCRouteTable_ipv4ToLocalGateway(t *testing.T) { destinationCidr := "0.0.0.0/0" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckOutpostsOutposts(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckOutpostsOutposts(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRouteTableDestroy(ctx), @@ -561,7 +561,7 @@ func TestAccVPCRouteTable_ipv4ToVPCPeeringConnection(t *testing.T) { destinationCidr := "10.2.0.0/16" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRouteTableDestroy(ctx), @@ -598,7 +598,7 @@ func TestAccVPCRouteTable_vgwRoutePropagation(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRouteTableDestroy(ctx), @@ -650,7 +650,7 @@ func TestAccVPCRouteTable_conditionalCIDRBlock(t *testing.T) { destinationIpv6Cidr := "::/0" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRouteDestroy(ctx), @@ -687,7 +687,7 @@ func TestAccVPCRouteTable_ipv4ToNatGateway(t *testing.T) { destinationCidr := "10.2.0.0/16" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRouteTableDestroy(ctx), @@ -724,7 +724,7 @@ func TestAccVPCRouteTable_IPv6ToNetworkInterface_unattached(t *testing.T) { destinationCidr := "::/0" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRouteTableDestroy(ctx), @@ -763,7 +763,7 @@ func TestAccVPCRouteTable_IPv4ToNetworkInterfaces_unattached(t *testing.T) { destinationCidr2 := "10.3.0.0/16" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRouteTableDestroy(ctx), @@ -839,7 +839,7 @@ func TestAccVPCRouteTable_vpcMultipleCIDRs(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRouteDestroy(ctx), @@ -873,7 +873,7 @@ func TestAccVPCRouteTable_vpcClassicLink(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRouteDestroy(ctx), @@ -909,7 +909,7 @@ func TestAccVPCRouteTable_gatewayVPCEndpoint(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRouteDestroy(ctx), @@ -955,7 +955,7 @@ func TestAccVPCRouteTable_multipleRoutes(t *testing.T) { destinationCidr4 := "2001:db8::/122" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRouteTableDestroy(ctx), @@ -1035,7 +1035,7 @@ func TestAccVPCRouteTable_prefixListToInternetGateway(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckManagedPrefixList(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckManagedPrefixList(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRouteTableDestroy(ctx), 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 5109268012fd..28cd7e1bd07a 100644 --- a/internal/service/ec2/vpc_route_tables_data_source_test.go +++ b/internal/service/ec2/vpc_route_tables_data_source_test.go @@ -15,7 +15,7 @@ func TestAccVPCRouteTablesDataSource_basic(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckVPCDestroy(ctx), diff --git a/internal/service/ec2/vpc_route_test.go b/internal/service/ec2/vpc_route_test.go index 0235fe3f2792..46c0bff8b247 100644 --- a/internal/service/ec2/vpc_route_test.go +++ b/internal/service/ec2/vpc_route_test.go @@ -28,7 +28,7 @@ func TestAccVPCRoute_basic(t *testing.T) { destinationCidr := "10.3.0.0/16" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRouteDestroy(ctx), @@ -76,7 +76,7 @@ func TestAccVPCRoute_disappears(t *testing.T) { destinationCidr := "10.3.0.0/16" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRouteDestroy(ctx), @@ -102,7 +102,7 @@ func TestAccVPCRoute_Disappears_routeTable(t *testing.T) { destinationCidr := "10.3.0.0/16" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRouteDestroy(ctx), @@ -128,7 +128,7 @@ func TestAccVPCRoute_ipv6ToEgressOnlyInternetGateway(t *testing.T) { destinationCidr := "::/0" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRouteDestroy(ctx), @@ -180,7 +180,7 @@ func TestAccVPCRoute_ipv6ToInternetGateway(t *testing.T) { destinationCidr := "::/0" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRouteDestroy(ctx), @@ -227,7 +227,7 @@ func TestAccVPCRoute_ipv6ToInstance(t *testing.T) { destinationCidr := "::/0" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRouteDestroy(ctx), @@ -274,7 +274,7 @@ func TestAccVPCRoute_IPv6ToNetworkInterface_unattached(t *testing.T) { destinationCidr := "::/0" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRouteDestroy(ctx), @@ -321,7 +321,7 @@ func TestAccVPCRoute_ipv6ToVPCPeeringConnection(t *testing.T) { destinationCidr := "::/0" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRouteDestroy(ctx), @@ -368,7 +368,7 @@ func TestAccVPCRoute_ipv6ToVPNGateway(t *testing.T) { destinationCidr := "::/0" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRouteDestroy(ctx), @@ -415,7 +415,7 @@ func TestAccVPCRoute_ipv4ToVPNGateway(t *testing.T) { destinationCidr := "10.3.0.0/16" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRouteDestroy(ctx), @@ -462,7 +462,7 @@ func TestAccVPCRoute_ipv4ToInstance(t *testing.T) { destinationCidr := "10.3.0.0/16" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRouteDestroy(ctx), @@ -509,7 +509,7 @@ func TestAccVPCRoute_IPv4ToNetworkInterface_unattached(t *testing.T) { destinationCidr := "10.3.0.0/16" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRouteDestroy(ctx), @@ -557,7 +557,7 @@ func TestAccVPCRoute_IPv4ToNetworkInterface_attached(t *testing.T) { destinationCidr := "10.3.0.0/16" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRouteDestroy(ctx), @@ -606,7 +606,7 @@ func TestAccVPCRoute_IPv4ToNetworkInterface_twoAttachments(t *testing.T) { destinationCidr := "10.3.0.0/16" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRouteDestroy(ctx), @@ -676,7 +676,7 @@ func TestAccVPCRoute_ipv4ToVPCPeeringConnection(t *testing.T) { destinationCidr := "10.3.0.0/16" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRouteDestroy(ctx), @@ -723,7 +723,7 @@ func TestAccVPCRoute_ipv4ToNatGateway(t *testing.T) { destinationCidr := "10.3.0.0/16" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRouteDestroy(ctx), @@ -770,7 +770,7 @@ func TestAccVPCRoute_ipv6ToNatGateway(t *testing.T) { destinationCidr := "64:ff9b::/96" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRouteDestroy(ctx), @@ -817,7 +817,7 @@ func TestAccVPCRoute_doesNotCrashWithVPCEndpoint(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRouteDestroy(ctx), @@ -853,7 +853,7 @@ func TestAccVPCRoute_ipv4ToTransitGateway(t *testing.T) { destinationCidr := "10.3.0.0/16" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRouteDestroy(ctx), @@ -904,7 +904,7 @@ func TestAccVPCRoute_ipv6ToTransitGateway(t *testing.T) { destinationCidr := "::/0" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRouteDestroy(ctx), @@ -951,7 +951,7 @@ func TestAccVPCRoute_ipv4ToCarrierGateway(t *testing.T) { destinationCidr := "172.16.1.0/24" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckWavelengthZoneAvailable(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckWavelengthZoneAvailable(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRouteDestroy(ctx), @@ -998,7 +998,7 @@ func TestAccVPCRoute_ipv4ToLocalGateway(t *testing.T) { destinationCidr := "172.16.1.0/24" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckOutpostsOutposts(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckOutpostsOutposts(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRouteDestroy(ctx), @@ -1045,7 +1045,7 @@ func TestAccVPCRoute_ipv6ToLocalGateway(t *testing.T) { destinationCidr := "2002:bc9:1234:1a00::/56" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckOutpostsOutposts(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckOutpostsOutposts(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRouteDestroy(ctx), @@ -1092,7 +1092,7 @@ func TestAccVPCRoute_conditionalCIDRBlock(t *testing.T) { destinationIpv6Cidr := "::/0" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRouteDestroy(ctx), @@ -1143,7 +1143,7 @@ func TestAccVPCRoute_IPv4Update_target(t *testing.T) { destinationCidr := "10.3.0.0/16" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckELBv2GatewayLoadBalancer(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckELBv2GatewayLoadBalancer(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID, "elasticloadbalancing"), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRouteDestroy(ctx), @@ -1361,7 +1361,7 @@ func TestAccVPCRoute_IPv6Update_target(t *testing.T) { destinationCidr := "::/0" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRouteDestroy(ctx), @@ -1527,7 +1527,7 @@ func TestAccVPCRoute_ipv4ToVPCEndpoint(t *testing.T) { destinationCidr := "172.16.1.0/24" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckELBv2GatewayLoadBalancer(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckELBv2GatewayLoadBalancer(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID, "elasticloadbalancing"), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRouteDestroy(ctx), @@ -1576,7 +1576,7 @@ func TestAccVPCRoute_localRoute(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRouteDestroy(ctx), @@ -1615,7 +1615,7 @@ func TestAccVPCRoute_prefixListToInternetGateway(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckManagedPrefixList(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckManagedPrefixList(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRouteDestroy(ctx), @@ -1662,7 +1662,7 @@ func TestAccVPCRoute_prefixListToVPNGateway(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckManagedPrefixList(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckManagedPrefixList(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRouteDestroy(ctx), @@ -1709,7 +1709,7 @@ func TestAccVPCRoute_prefixListToInstance(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckManagedPrefixList(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckManagedPrefixList(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRouteDestroy(ctx), @@ -1756,7 +1756,7 @@ func TestAccVPCRoute_PrefixListToNetworkInterface_unattached(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckManagedPrefixList(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckManagedPrefixList(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRouteDestroy(ctx), @@ -1804,7 +1804,7 @@ func TestAccVPCRoute_PrefixListToNetworkInterface_attached(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckManagedPrefixList(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckManagedPrefixList(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRouteDestroy(ctx), @@ -1851,7 +1851,7 @@ func TestAccVPCRoute_prefixListToVPCPeeringConnection(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckManagedPrefixList(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckManagedPrefixList(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRouteDestroy(ctx), @@ -1898,7 +1898,7 @@ func TestAccVPCRoute_prefixListToNatGateway(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckManagedPrefixList(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckManagedPrefixList(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRouteDestroy(ctx), @@ -1949,7 +1949,7 @@ func TestAccVPCRoute_prefixListToTransitGateway(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckManagedPrefixList(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckManagedPrefixList(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRouteDestroy(ctx), @@ -1997,7 +1997,7 @@ func TestAccVPCRoute_prefixListToCarrierGateway(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) testAccPreCheckManagedPrefixList(ctx, t) testAccPreCheckWavelengthZoneAvailable(ctx, t) }, @@ -2048,7 +2048,7 @@ func TestAccVPCRoute_prefixListToLocalGateway(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) testAccPreCheckManagedPrefixList(ctx, t) acctest.PreCheckOutpostsOutposts(ctx, t) }, @@ -2098,7 +2098,7 @@ func TestAccVPCRoute_prefixListToEgressOnlyInternetGateway(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckManagedPrefixList(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckManagedPrefixList(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRouteDestroy(ctx), 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 984b2db85378..940a12ebe183 100644 --- a/internal/service/ec2/vpc_security_group_data_source_test.go +++ b/internal/service/ec2/vpc_security_group_data_source_test.go @@ -14,7 +14,7 @@ func TestAccVPCSecurityGroupDataSource_basic(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ 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 c3f4bbcf9562..0d1f1fbe386e 100644 --- a/internal/service/ec2/vpc_security_group_egress_rule_test.go +++ b/internal/service/ec2/vpc_security_group_egress_rule_test.go @@ -22,7 +22,7 @@ func TestAccVPCSecurityGroupEgressRule_basic(t *testing.T) { resourceName := "aws_vpc_security_group_egress_rule.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSecurityGroupEgressRuleDestroy(ctx), @@ -60,7 +60,7 @@ func TestAccVPCSecurityGroupEgressRule_disappears(t *testing.T) { resourceName := "aws_vpc_security_group_egress_rule.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSecurityGroupEgressRuleDestroy(ctx), 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 d12ee4066104..fffeeff89f6a 100644 --- a/internal/service/ec2/vpc_security_group_ingress_rule_test.go +++ b/internal/service/ec2/vpc_security_group_ingress_rule_test.go @@ -87,7 +87,7 @@ func TestAccVPCSecurityGroupIngressRule_basic(t *testing.T) { resourceName := "aws_vpc_security_group_ingress_rule.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSecurityGroupIngressRuleDestroy(ctx), @@ -125,7 +125,7 @@ func TestAccVPCSecurityGroupIngressRule_disappears(t *testing.T) { resourceName := "aws_vpc_security_group_ingress_rule.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSecurityGroupIngressRuleDestroy(ctx), @@ -149,7 +149,7 @@ func TestAccVPCSecurityGroupIngressRule_tags(t *testing.T) { resourceName := "aws_vpc_security_group_ingress_rule.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSecurityGroupIngressRuleDestroy(ctx), @@ -195,7 +195,7 @@ func TestAccVPCSecurityGroupIngressRule_DefaultTags_providerOnly(t *testing.T) { resourceName := "aws_vpc_security_group_ingress_rule.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSecurityGroupIngressRuleDestroy(ctx), @@ -253,7 +253,7 @@ func TestAccVPCSecurityGroupIngressRule_DefaultTags_updateToProviderOnly(t *test resourceName := "aws_vpc_security_group_ingress_rule.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSecurityGroupIngressRuleDestroy(ctx), @@ -296,7 +296,7 @@ func TestAccVPCSecurityGroupIngressRule_DefaultTags_updateToResourceOnly(t *test resourceName := "aws_vpc_security_group_ingress_rule.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSecurityGroupIngressRuleDestroy(ctx), @@ -339,7 +339,7 @@ func TestAccVPCSecurityGroupIngressRule_DefaultTagsProviderAndResource_nonOverla resourceName := "aws_vpc_security_group_ingress_rule.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSecurityGroupIngressRuleDestroy(ctx), @@ -404,7 +404,7 @@ func TestAccVPCSecurityGroupIngressRule_DefaultTagsProviderAndResource_overlappi resourceName := "aws_vpc_security_group_ingress_rule.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSecurityGroupIngressRuleDestroy(ctx), @@ -463,7 +463,7 @@ func TestAccVPCSecurityGroupIngressRule_DefaultTagsProviderAndResource_duplicate rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSecurityGroupIngressRuleDestroy(ctx), @@ -487,7 +487,7 @@ func TestAccVPCSecurityGroupIngressRule_updateTagsKnownAtApply(t *testing.T) { resourceName := "aws_vpc_security_group_ingress_rule.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSecurityGroupIngressRuleDestroy(ctx), @@ -524,7 +524,7 @@ func TestAccVPCSecurityGroupIngressRule_defaultAndIgnoreTags(t *testing.T) { resourceName := "aws_vpc_security_group_ingress_rule.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSecurityGroupIngressRuleDestroy(ctx), @@ -562,7 +562,7 @@ func TestAccVPCSecurityGroupIngressRule_ignoreTags(t *testing.T) { resourceName := "aws_vpc_security_group_ingress_rule.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSecurityGroupIngressRuleDestroy(ctx), @@ -600,7 +600,7 @@ func TestAccVPCSecurityGroupIngressRule_cidrIPv4(t *testing.T) { resourceName := "aws_vpc_security_group_ingress_rule.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSecurityGroupIngressRuleDestroy(ctx), @@ -656,7 +656,7 @@ func TestAccVPCSecurityGroupIngressRule_cidrIPv6(t *testing.T) { resourceName := "aws_vpc_security_group_ingress_rule.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSecurityGroupIngressRuleDestroy(ctx), @@ -712,7 +712,7 @@ func TestAccVPCSecurityGroupIngressRule_description(t *testing.T) { resourceName := "aws_vpc_security_group_ingress_rule.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSecurityGroupIngressRuleDestroy(ctx), @@ -750,7 +750,7 @@ func TestAccVPCSecurityGroupIngressRule_prefixListID(t *testing.T) { vpcEndpoint2ResourceName := "aws_vpc_endpoint.test2" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSecurityGroupIngressRuleDestroy(ctx), @@ -808,7 +808,7 @@ func TestAccVPCSecurityGroupIngressRule_referencedSecurityGroupID(t *testing.T) securityGroup2ResourceName := "aws_security_group.test1" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSecurityGroupIngressRuleDestroy(ctx), @@ -865,7 +865,7 @@ func TestAccVPCSecurityGroupIngressRule_ReferencedSecurityGroupID_peerVPC(t *tes resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckAlternateAccount(t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), @@ -905,7 +905,7 @@ func TestAccVPCSecurityGroupIngressRule_updateSourceType(t *testing.T) { resourceName := "aws_vpc_security_group_ingress_rule.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSecurityGroupIngressRuleDestroy(ctx), 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 13d084abd008..4e1b76228d3a 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 @@ -16,7 +16,7 @@ func TestAccVPCSecurityGroupRuleDataSource_basic(t *testing.T) { resourceName := "aws_vpc_security_group_ingress_rule.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ @@ -48,7 +48,7 @@ func TestAccVPCSecurityGroupRuleDataSource_filter(t *testing.T) { resourceName := "aws_vpc_security_group_egress_rule.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ diff --git a/internal/service/ec2/vpc_security_group_rule_test.go b/internal/service/ec2/vpc_security_group_rule_test.go index a9b580adf50e..d70559b5864d 100644 --- a/internal/service/ec2/vpc_security_group_rule_test.go +++ b/internal/service/ec2/vpc_security_group_rule_test.go @@ -119,7 +119,7 @@ func TestAccVPCSecurityGroupRule_Ingress_vpc(t *testing.T) { sgResourceName := "aws_security_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSecurityGroupDestroy(ctx), @@ -161,7 +161,7 @@ func TestAccVPCSecurityGroupRule_IngressSourceWithAccount_id(t *testing.T) { sgResourceName := "aws_security_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSecurityGroupDestroy(ctx), @@ -196,7 +196,7 @@ func TestAccVPCSecurityGroupRule_Ingress_protocol(t *testing.T) { sgResourceName := "aws_security_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSecurityGroupDestroy(ctx), @@ -238,7 +238,7 @@ func TestAccVPCSecurityGroupRule_Ingress_icmpv6(t *testing.T) { sgResourceName := "aws_security_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSecurityGroupDestroy(ctx), @@ -280,7 +280,7 @@ func TestAccVPCSecurityGroupRule_Ingress_ipv6(t *testing.T) { sgResourceName := "aws_security_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSecurityGroupDestroy(ctx), @@ -322,7 +322,7 @@ func TestAccVPCSecurityGroupRule_egress(t *testing.T) { sgResourceName := "aws_security_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSecurityGroupDestroy(ctx), @@ -364,7 +364,7 @@ func TestAccVPCSecurityGroupRule_selfReference(t *testing.T) { sgResourceName := "aws_security_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSecurityGroupDestroy(ctx), @@ -402,7 +402,7 @@ func TestAccVPCSecurityGroupRule_expectInvalidTypeError(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSecurityGroupDestroy(ctx), @@ -420,7 +420,7 @@ func TestAccVPCSecurityGroupRule_expectInvalidCIDR(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSecurityGroupDestroy(ctx), @@ -446,7 +446,7 @@ func TestAccVPCSecurityGroupRule_PartialMatching_basic(t *testing.T) { resource3Name := "aws_security_group_rule.test3" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSecurityGroupDestroy(ctx), @@ -495,7 +495,7 @@ func TestAccVPCSecurityGroupRule_PartialMatching_source(t *testing.T) { resource2Name := "aws_security_group_rule.test2" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSecurityGroupDestroy(ctx), @@ -536,7 +536,7 @@ func TestAccVPCSecurityGroupRule_issue5310(t *testing.T) { sgResourceName := "aws_security_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSecurityGroupDestroy(ctx), @@ -576,7 +576,7 @@ func TestAccVPCSecurityGroupRule_race(t *testing.T) { n := 50 resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSecurityGroupDestroy(ctx), @@ -600,7 +600,7 @@ func TestAccVPCSecurityGroupRule_selfSource(t *testing.T) { sgResourceName := "aws_security_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSecurityGroupDestroy(ctx), @@ -642,7 +642,7 @@ func TestAccVPCSecurityGroupRule_prefixListEgress(t *testing.T) { vpceResourceName := "aws_vpc_endpoint.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSecurityGroupDestroy(ctx), @@ -682,7 +682,7 @@ func TestAccVPCSecurityGroupRule_prefixListEmptyString(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSecurityGroupDestroy(ctx), @@ -703,7 +703,7 @@ func TestAccVPCSecurityGroupRule_ingressDescription(t *testing.T) { sgResourceName := "aws_security_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSecurityGroupDestroy(ctx), @@ -745,7 +745,7 @@ func TestAccVPCSecurityGroupRule_egressDescription(t *testing.T) { sgResourceName := "aws_security_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSecurityGroupDestroy(ctx), @@ -787,7 +787,7 @@ func TestAccVPCSecurityGroupRule_IngressDescription_updates(t *testing.T) { sgResourceName := "aws_security_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSecurityGroupDestroy(ctx), @@ -846,7 +846,7 @@ func TestAccVPCSecurityGroupRule_EgressDescription_updates(t *testing.T) { sgResourceName := "aws_security_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSecurityGroupDestroy(ctx), @@ -905,7 +905,7 @@ func TestAccVPCSecurityGroupRule_Description_allPorts(t *testing.T) { sgResourceName := "aws_security_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSecurityGroupDestroy(ctx), @@ -964,7 +964,7 @@ func TestAccVPCSecurityGroupRule_DescriptionAllPorts_nonZeroPorts(t *testing.T) sgResourceName := "aws_security_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSecurityGroupDestroy(ctx), @@ -1025,7 +1025,7 @@ func TestAccVPCSecurityGroupRule_MultipleRuleSearching_allProtocolCrash(t *testi sgResourceName := "aws_security_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSecurityGroupDestroy(ctx), @@ -1089,7 +1089,7 @@ func TestAccVPCSecurityGroupRule_multiDescription(t *testing.T) { vpceResourceName := "aws_vpc_endpoint.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSecurityGroupDestroy(ctx), @@ -1251,7 +1251,7 @@ func TestAccVPCSecurityGroupRule_Ingress_multipleIPv6(t *testing.T) { sgResourceName := "aws_security_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSecurityGroupDestroy(ctx), @@ -1294,7 +1294,7 @@ func TestAccVPCSecurityGroupRule_Ingress_multiplePrefixLists(t *testing.T) { sgResourceName := "aws_security_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckManagedPrefixList(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckManagedPrefixList(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSecurityGroupDestroy(ctx), @@ -1335,7 +1335,7 @@ func TestAccVPCSecurityGroupRule_Ingress_peeredVPC(t *testing.T) { sgResourceName := "aws_security_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckAlternateAccount(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckAlternateAccount(t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5FactoriesAlternate(ctx, t), CheckDestroy: testAccCheckSecurityGroupDestroy(ctx), @@ -1376,7 +1376,7 @@ func TestAccVPCSecurityGroupRule_Ingress_ipv4AndIPv6(t *testing.T) { sgResourceName := "aws_security_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSecurityGroupDestroy(ctx), @@ -1419,7 +1419,7 @@ func TestAccVPCSecurityGroupRule_Ingress_prefixListAndSelf(t *testing.T) { sgResourceName := "aws_security_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckManagedPrefixList(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckManagedPrefixList(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSecurityGroupDestroy(ctx), @@ -1461,7 +1461,7 @@ func TestAccVPCSecurityGroupRule_Ingress_prefixListAndSource(t *testing.T) { sg2ResourceName := "aws_security_group.test.1" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckManagedPrefixList(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckManagedPrefixList(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSecurityGroupDestroy(ctx), @@ -1503,7 +1503,7 @@ func TestAccVPCSecurityGroupRule_protocolChange(t *testing.T) { sgName := "aws_security_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckManagedPrefixList(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckManagedPrefixList(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSecurityGroupDestroy(ctx), 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 f3a8411412c3..85ec91a34e46 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 @@ -14,7 +14,7 @@ func TestAccVPCSecurityGroupRulesDataSource_basic(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ @@ -32,7 +32,7 @@ func TestAccVPCSecurityGroupRulesDataSource_tags(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ diff --git a/internal/service/ec2/vpc_security_group_test.go b/internal/service/ec2/vpc_security_group_test.go index e41df6b242d9..4c818d2fdede 100644 --- a/internal/service/ec2/vpc_security_group_test.go +++ b/internal/service/ec2/vpc_security_group_test.go @@ -1000,7 +1000,7 @@ func TestAccVPCSecurityGroup_basic(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSecurityGroupDestroy(ctx), @@ -1038,7 +1038,7 @@ func TestAccVPCSecurityGroup_disappears(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSecurityGroupDestroy(ctx), @@ -1062,7 +1062,7 @@ func TestAccVPCSecurityGroup_noVPC(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSecurityGroupDestroy(ctx), @@ -1099,7 +1099,7 @@ func TestAccVPCSecurityGroup_nameGenerated(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSecurityGroupDestroy(ctx), @@ -1130,7 +1130,7 @@ func TestAccVPCSecurityGroup_nameTerraformPrefix(t *testing.T) { rName := sdkacctest.RandomWithPrefix("terraform-test") resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSecurityGroupDestroy(ctx), @@ -1160,7 +1160,7 @@ func TestAccVPCSecurityGroup_namePrefix(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSecurityGroupDestroy(ctx), @@ -1191,7 +1191,7 @@ func TestAccVPCSecurityGroup_namePrefixTerraform(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSecurityGroupDestroy(ctx), @@ -1221,7 +1221,7 @@ func TestAccVPCSecurityGroup_tags(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSecurityGroupDestroy(ctx), @@ -1268,7 +1268,7 @@ func TestAccVPCSecurityGroup_allowAll(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSecurityGroupDestroy(ctx), @@ -1296,7 +1296,7 @@ func TestAccVPCSecurityGroup_sourceSecurityGroup(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSecurityGroupDestroy(ctx), @@ -1324,7 +1324,7 @@ func TestAccVPCSecurityGroup_ipRangeAndSecurityGroupWithSameRules(t *testing.T) rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSecurityGroupDestroy(ctx), @@ -1352,7 +1352,7 @@ func TestAccVPCSecurityGroup_ipRangesWithSameRules(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSecurityGroupDestroy(ctx), @@ -1380,7 +1380,7 @@ func TestAccVPCSecurityGroup_egressMode(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckNetworkACLDestroy(ctx), @@ -1423,7 +1423,7 @@ func TestAccVPCSecurityGroup_ingressMode(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckNetworkACLDestroy(ctx), @@ -1466,7 +1466,7 @@ func TestAccVPCSecurityGroup_ruleGathering(t *testing.T) { resourceName := "aws_security_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSecurityGroupDestroy(ctx), @@ -1580,7 +1580,7 @@ func TestAccVPCSecurityGroup_forceRevokeRulesTrue(t *testing.T) { testRemoveCycle := testRemoveRuleCycle(ctx, &primary, &secondary) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSecurityGroupDestroy(ctx), @@ -1661,7 +1661,7 @@ func TestAccVPCSecurityGroup_forceRevokeRulesFalse(t *testing.T) { testRemoveCycle := testRemoveRuleCycle(ctx, &primary, &secondary) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSecurityGroupDestroy(ctx), @@ -1717,7 +1717,7 @@ func TestAccVPCSecurityGroup_change(t *testing.T) { resourceName := "aws_security_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSecurityGroupDestroy(ctx), @@ -1787,7 +1787,7 @@ func TestAccVPCSecurityGroup_ipv6(t *testing.T) { resourceName := "aws_security_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSecurityGroupDestroy(ctx), @@ -1850,7 +1850,7 @@ func TestAccVPCSecurityGroup_self(t *testing.T) { } resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSecurityGroupDestroy(ctx), @@ -1886,7 +1886,7 @@ func TestAccVPCSecurityGroup_vpc(t *testing.T) { resourceName := "aws_security_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSecurityGroupDestroy(ctx), @@ -1931,7 +1931,7 @@ func TestAccVPCSecurityGroup_vpcNegOneIngress(t *testing.T) { resourceName := "aws_security_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSecurityGroupDestroy(ctx), @@ -1968,7 +1968,7 @@ func TestAccVPCSecurityGroup_vpcProtoNumIngress(t *testing.T) { resourceName := "aws_security_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSecurityGroupDestroy(ctx), @@ -2005,7 +2005,7 @@ func TestAccVPCSecurityGroup_multiIngress(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSecurityGroupDestroy(ctx), @@ -2033,7 +2033,7 @@ func TestAccVPCSecurityGroup_vpcAllEgress(t *testing.T) { resourceName := "aws_security_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSecurityGroupDestroy(ctx), @@ -2070,7 +2070,7 @@ func TestAccVPCSecurityGroup_ruleDescription(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSecurityGroupDestroy(ctx), @@ -2184,7 +2184,7 @@ func TestAccVPCSecurityGroup_defaultEgressVPC(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSecurityGroupDestroy(ctx), @@ -2215,7 +2215,7 @@ func TestAccVPCSecurityGroup_driftComplex(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSecurityGroupDestroy(ctx), @@ -2290,7 +2290,7 @@ func TestAccVPCSecurityGroup_driftComplex(t *testing.T) { func TestAccVPCSecurityGroup_invalidCIDRBlock(t *testing.T) { ctx := acctest.Context(t) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSecurityGroupDestroy(ctx), @@ -2322,7 +2322,7 @@ func TestAccVPCSecurityGroup_cidrAndGroups(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSecurityGroupDestroy(ctx), @@ -2350,7 +2350,7 @@ func TestAccVPCSecurityGroup_ingressWithCIDRAndSGsVPC(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSecurityGroupDestroy(ctx), @@ -2403,7 +2403,7 @@ func TestAccVPCSecurityGroup_egressWithPrefixList(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSecurityGroupDestroy(ctx), @@ -2432,7 +2432,7 @@ func TestAccVPCSecurityGroup_ingressWithPrefixList(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSecurityGroupDestroy(ctx), @@ -2461,7 +2461,7 @@ func TestAccVPCSecurityGroup_ipv4AndIPv6Egress(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSecurityGroupDestroy(ctx), @@ -2515,7 +2515,7 @@ func TestAccVPCSecurityGroup_failWithDiffMismatch(t *testing.T) { resourceName := "aws_security_group.test1" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSecurityGroupDestroy(ctx), @@ -2540,7 +2540,7 @@ var ruleLimit int func testAccSecurityGroup_ruleLimit(t *testing.T) { ctx := acctest.Context(t) resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSecurityGroupDestroy(ctx), @@ -2568,7 +2568,7 @@ func TestAccVPCSecurityGroup_RuleLimit_exceededAppend(t *testing.T) { resourceName := "aws_security_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSecurityGroupDestroy(ctx), @@ -2618,7 +2618,7 @@ func TestAccVPCSecurityGroup_RuleLimit_cidrBlockExceededAppend(t *testing.T) { resourceName := "aws_security_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSecurityGroupDestroy(ctx), @@ -2682,7 +2682,7 @@ func TestAccVPCSecurityGroup_RuleLimit_exceededPrepend(t *testing.T) { resourceName := "aws_security_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSecurityGroupDestroy(ctx), @@ -2730,7 +2730,7 @@ func TestAccVPCSecurityGroup_RuleLimit_exceededAllNew(t *testing.T) { resourceName := "aws_security_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSecurityGroupDestroy(ctx), @@ -2774,7 +2774,7 @@ func TestAccVPCSecurityGroup_rulesDropOnError(t *testing.T) { resourceName := "aws_security_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSecurityGroupDestroy(ctx), @@ -2812,7 +2812,7 @@ func TestAccVPCSecurityGroup_emrDependencyViolation(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSecurityGroupDestroy(ctx), 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 edff77d72dcb..3ab46dc70d8c 100644 --- a/internal/service/ec2/vpc_security_groups_data_source_test.go +++ b/internal/service/ec2/vpc_security_groups_data_source_test.go @@ -15,7 +15,7 @@ func TestAccVPCSecurityGroupsDataSource_tag(t *testing.T) { dataSourceName := "data.aws_security_groups.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ @@ -36,7 +36,7 @@ func TestAccVPCSecurityGroupsDataSource_filter(t *testing.T) { dataSourceName := "data.aws_security_groups.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ @@ -57,7 +57,7 @@ func TestAccVPCSecurityGroupsDataSource_empty(t *testing.T) { dataSourceName := "data.aws_security_groups.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ diff --git a/internal/service/ec2/vpc_subnet_cidr_reservation_test.go b/internal/service/ec2/vpc_subnet_cidr_reservation_test.go index 5c7b12680b9a..5d58b7122597 100644 --- a/internal/service/ec2/vpc_subnet_cidr_reservation_test.go +++ b/internal/service/ec2/vpc_subnet_cidr_reservation_test.go @@ -22,7 +22,7 @@ func TestAccVPCSubnetCIDRReservation_basic(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSubnetCIDRReservationDestroy(ctx), @@ -54,7 +54,7 @@ func TestAccVPCSubnetCIDRReservation_ipv6(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSubnetCIDRReservationDestroy(ctx), @@ -84,7 +84,7 @@ func TestAccVPCSubnetCIDRReservation_disappears(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSubnetCIDRReservationDestroy(ctx), diff --git a/internal/service/ec2/vpc_subnet_data_source_test.go b/internal/service/ec2/vpc_subnet_data_source_test.go index 0e8c7e6f7825..14e8a6c172ca 100644 --- a/internal/service/ec2/vpc_subnet_data_source_test.go +++ b/internal/service/ec2/vpc_subnet_data_source_test.go @@ -26,7 +26,7 @@ func TestAccVPCSubnetDataSource_basic(t *testing.T) { ds6ResourceName := "data.aws_subnet.by_az_id" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckVPCDestroy(ctx), @@ -143,7 +143,7 @@ func TestAccVPCSubnetDataSource_ipv6ByIPv6Filter(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ @@ -166,7 +166,7 @@ func TestAccVPCSubnetDataSource_ipv6ByIPv6CIDRBlock(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ diff --git a/internal/service/ec2/vpc_subnet_ids_data_source_test.go b/internal/service/ec2/vpc_subnet_ids_data_source_test.go index 1e14051f3a7a..bdcea2e2eb97 100644 --- a/internal/service/ec2/vpc_subnet_ids_data_source_test.go +++ b/internal/service/ec2/vpc_subnet_ids_data_source_test.go @@ -16,7 +16,7 @@ func TestAccVPCSubnetIDsDataSource_basic(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckVPCDestroy(ctx), @@ -41,7 +41,7 @@ func TestAccVPCSubnetIDsDataSource_filter(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckVPCDestroy(ctx), diff --git a/internal/service/ec2/vpc_subnet_test.go b/internal/service/ec2/vpc_subnet_test.go index f48ba9b76151..9253faba1f61 100644 --- a/internal/service/ec2/vpc_subnet_test.go +++ b/internal/service/ec2/vpc_subnet_test.go @@ -24,7 +24,7 @@ func TestAccVPCSubnet_basic(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSubnetDestroy(ctx), @@ -67,7 +67,7 @@ func TestAccVPCSubnet_tags(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSubnetDestroy(ctx), @@ -112,7 +112,7 @@ func TestAccVPCSubnet_DefaultTags_providerOnly(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSubnetDestroy(ctx), @@ -170,7 +170,7 @@ func TestAccVPCSubnet_DefaultTags_updateToProviderOnly(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSubnetDestroy(ctx), @@ -213,7 +213,7 @@ func TestAccVPCSubnet_DefaultTags_updateToResourceOnly(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSubnetDestroy(ctx), @@ -256,7 +256,7 @@ func TestAccVPCSubnet_DefaultTagsProviderAndResource_nonOverlappingTag(t *testin rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSubnetDestroy(ctx), @@ -321,7 +321,7 @@ func TestAccVPCSubnet_DefaultTagsProviderAndResource_overlappingTag(t *testing.T rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSubnetDestroy(ctx), @@ -379,7 +379,7 @@ func TestAccVPCSubnet_DefaultTagsProviderAndResource_duplicateTag(t *testing.T) rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: nil, @@ -403,7 +403,7 @@ func TestAccVPCSubnet_defaultAndIgnoreTags(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSubnetDestroy(ctx), @@ -445,7 +445,7 @@ func TestAccVPCSubnet_updateTagsKnownAtApply(t *testing.T) { resourceName := "aws_subnet.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSubnetDestroy(ctx), @@ -482,7 +482,7 @@ func TestAccVPCSubnet_ignoreTags(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckVPCDestroy(ctx), @@ -514,7 +514,7 @@ func TestAccVPCSubnet_ipv6(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSubnetDestroy(ctx), @@ -556,7 +556,7 @@ func TestAccVPCSubnet_enableIPv6(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSubnetDestroy(ctx), @@ -601,7 +601,7 @@ func TestAccVPCSubnet_availabilityZoneID(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSubnetDestroy(ctx), @@ -630,7 +630,7 @@ func TestAccVPCSubnet_disappears(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSubnetDestroy(ctx), @@ -655,7 +655,7 @@ func TestAccVPCSubnet_customerOwnedIPv4Pool(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckOutpostsOutposts(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckOutpostsOutposts(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSubnetDestroy(ctx), @@ -683,7 +683,7 @@ func TestAccVPCSubnet_mapCustomerOwnedIPOnLaunch(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckOutpostsOutposts(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckOutpostsOutposts(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSubnetDestroy(ctx), @@ -711,7 +711,7 @@ func TestAccVPCSubnet_mapPublicIPOnLaunch(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSubnetDestroy(ctx), @@ -754,7 +754,7 @@ func TestAccVPCSubnet_outpost(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckOutpostsOutposts(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckOutpostsOutposts(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSubnetDestroy(ctx), @@ -782,7 +782,7 @@ func TestAccVPCSubnet_enableDNS64(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSubnetDestroy(ctx), @@ -824,7 +824,7 @@ func TestAccVPCSubnet_privateDNSNameOptionsOnLaunch(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSubnetDestroy(ctx), @@ -872,7 +872,7 @@ func TestAccVPCSubnet_ipv6Native(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSubnetDestroy(ctx), diff --git a/internal/service/ec2/vpc_subnets_data_source_test.go b/internal/service/ec2/vpc_subnets_data_source_test.go index 3440a0e18108..2dc879e98a7f 100644 --- a/internal/service/ec2/vpc_subnets_data_source_test.go +++ b/internal/service/ec2/vpc_subnets_data_source_test.go @@ -14,7 +14,7 @@ func TestAccVPCSubnetsDataSource_basic(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ @@ -38,7 +38,7 @@ func TestAccVPCSubnetsDataSource_filter(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ diff --git a/internal/service/ec2/vpc_test.go b/internal/service/ec2/vpc_test.go index 6e0cc710949a..0b23cca5342b 100644 --- a/internal/service/ec2/vpc_test.go +++ b/internal/service/ec2/vpc_test.go @@ -25,7 +25,7 @@ func TestAccVPC_basic(t *testing.T) { resourceName := "aws_vpc.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckVPCDestroy(ctx), @@ -74,7 +74,7 @@ func TestAccVPC_disappears(t *testing.T) { resourceName := "aws_vpc.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckVPCDestroy(ctx), @@ -97,7 +97,7 @@ func TestAccVPC_tags(t *testing.T) { resourceName := "aws_vpc.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckVPCDestroy(ctx), @@ -142,7 +142,7 @@ func TestAccVPC_DefaultTags_providerOnly(t *testing.T) { resourceName := "aws_vpc.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckVPCDestroy(ctx), @@ -199,7 +199,7 @@ func TestAccVPC_DefaultTags_updateToProviderOnly(t *testing.T) { resourceName := "aws_vpc.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckVPCDestroy(ctx), @@ -241,7 +241,7 @@ func TestAccVPC_DefaultTags_updateToResourceOnly(t *testing.T) { resourceName := "aws_vpc.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckVPCDestroy(ctx), @@ -283,7 +283,7 @@ func TestAccVPC_DefaultTagsProviderAndResource_nonOverlappingTag(t *testing.T) { resourceName := "aws_vpc.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckVPCDestroy(ctx), @@ -347,7 +347,7 @@ func TestAccVPC_DefaultTagsProviderAndResource_overlappingTag(t *testing.T) { resourceName := "aws_vpc.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckVPCDestroy(ctx), @@ -403,7 +403,7 @@ func TestAccVPC_DefaultTagsProviderAndResource_overlappingTag(t *testing.T) { func TestAccVPC_DefaultTagsProviderAndResource_duplicateTag(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: nil, @@ -431,7 +431,7 @@ func TestAccVPC_DynamicResourceTagsMergedWithLocals_ignoreChanges(t *testing.T) resourceName := "aws_vpc.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckVPCDestroy(ctx), @@ -486,7 +486,7 @@ func TestAccVPC_DynamicResourceTags_ignoreChanges(t *testing.T) { resourceName := "aws_vpc.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckVPCDestroy(ctx), @@ -532,7 +532,7 @@ func TestAccVPC_defaultAndIgnoreTags(t *testing.T) { resourceName := "aws_vpc.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckVPCDestroy(ctx), @@ -569,7 +569,7 @@ func TestAccVPC_ignoreTags(t *testing.T) { resourceName := "aws_vpc.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckVPCDestroy(ctx), @@ -602,7 +602,7 @@ func TestAccVPC_tenancy(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckVPCDestroy(ctx), @@ -646,7 +646,7 @@ func TestAccVPC_updateDNSHostnames(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckVPCDestroy(ctx), @@ -677,7 +677,7 @@ func TestAccVPC_bothDNSOptionsSet(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckVPCDestroy(ctx), @@ -707,7 +707,7 @@ func TestAccVPC_disabledDNSSupport(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckVPCDestroy(ctx), @@ -735,7 +735,7 @@ func TestAccVPC_enableNetworkAddressUsageMetrics(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionNot(t, endpoints.AwsUsGovPartitionID) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionNot(t, endpoints.AwsUsGovPartitionID) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckVPCDestroy(ctx), @@ -763,7 +763,7 @@ func TestAccVPC_assignGeneratedIPv6CIDRBlock(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckVPCDestroy(ctx), @@ -815,7 +815,7 @@ func TestAccVPC_assignGeneratedIPv6CIDRBlockWithNetworkBorderGroup(t *testing.T) rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckLocalZoneAvailable(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckLocalZoneAvailable(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckVPCDestroy(ctx), @@ -864,7 +864,7 @@ func TestAccVPC_IPAMIPv4BasicNetmask(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckVPCDestroy(ctx), @@ -892,7 +892,7 @@ func TestAccVPC_IPAMIPv4BasicExplicitCIDR(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckVPCDestroy(ctx), 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 45217edef92c..d983b41106e8 100644 --- a/internal/service/ec2/vpc_traffic_mirror_filter_rule_test.go +++ b/internal/service/ec2/vpc_traffic_mirror_filter_rule_test.go @@ -33,7 +33,7 @@ func TestAccVPCTrafficMirrorFilterRule_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) testAccPreCheckTrafficMirrorFilterRule(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), @@ -117,7 +117,7 @@ func TestAccVPCTrafficMirrorFilterRule_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) testAccPreCheckTrafficMirrorFilterRule(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), diff --git a/internal/service/ec2/vpc_traffic_mirror_filter_test.go b/internal/service/ec2/vpc_traffic_mirror_filter_test.go index 8ac9379475be..c4a3c47cf848 100644 --- a/internal/service/ec2/vpc_traffic_mirror_filter_test.go +++ b/internal/service/ec2/vpc_traffic_mirror_filter_test.go @@ -23,7 +23,7 @@ func TestAccVPCTrafficMirrorFilter_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) testAccPreCheckTrafficMirrorFilter(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), @@ -74,7 +74,7 @@ func TestAccVPCTrafficMirrorFilter_tags(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) testAccPreCheckTrafficMirrorFilter(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), @@ -123,7 +123,7 @@ func TestAccVPCTrafficMirrorFilter_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) testAccPreCheckTrafficMirrorFilter(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), diff --git a/internal/service/ec2/vpc_traffic_mirror_session_test.go b/internal/service/ec2/vpc_traffic_mirror_session_test.go index 6405e1d9ce08..a1ba4624451a 100644 --- a/internal/service/ec2/vpc_traffic_mirror_session_test.go +++ b/internal/service/ec2/vpc_traffic_mirror_session_test.go @@ -30,7 +30,7 @@ func TestAccVPCTrafficMirrorSession_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) testAccPreCheckTrafficMirrorSession(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), @@ -92,7 +92,7 @@ func TestAccVPCTrafficMirrorSession_tags(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) testAccPreCheckTrafficMirrorSession(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), @@ -142,7 +142,7 @@ func TestAccVPCTrafficMirrorSession_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) testAccPreCheckTrafficMirrorSession(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), @@ -170,7 +170,7 @@ func TestAccVPCTrafficMirrorSession_updateTrafficMirrorTarget(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) testAccPreCheckTrafficMirrorSession(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), diff --git a/internal/service/ec2/vpc_traffic_mirror_target_test.go b/internal/service/ec2/vpc_traffic_mirror_target_test.go index b8bc81e0c129..a07b4dc4ba56 100644 --- a/internal/service/ec2/vpc_traffic_mirror_target_test.go +++ b/internal/service/ec2/vpc_traffic_mirror_target_test.go @@ -25,7 +25,7 @@ func TestAccVPCTrafficMirrorTarget_nlb(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) testAccPreCheckTrafficMirrorTarget(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), @@ -61,7 +61,7 @@ func TestAccVPCTrafficMirrorTarget_eni(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) testAccPreCheckTrafficMirrorTarget(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), @@ -95,7 +95,7 @@ func TestAccVPCTrafficMirrorTarget_tags(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) testAccPreCheckTrafficMirrorTarget(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), @@ -145,7 +145,7 @@ func TestAccVPCTrafficMirrorTarget_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) testAccPreCheckTrafficMirrorTarget(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), @@ -172,7 +172,7 @@ func TestAccVPCTrafficMirrorTarget_gwlb(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) testAccPreCheckTrafficMirrorTarget(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), diff --git a/internal/service/ec2/vpc_vpcs_data_source_test.go b/internal/service/ec2/vpc_vpcs_data_source_test.go index df2cf6998cf2..527ba27d144a 100644 --- a/internal/service/ec2/vpc_vpcs_data_source_test.go +++ b/internal/service/ec2/vpc_vpcs_data_source_test.go @@ -14,7 +14,7 @@ func TestAccVPCsDataSource_basic(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ @@ -32,7 +32,7 @@ func TestAccVPCsDataSource_tags(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ @@ -50,7 +50,7 @@ func TestAccVPCsDataSource_filters(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ @@ -68,7 +68,7 @@ func TestAccVPCsDataSource_empty(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ diff --git a/internal/service/ec2/vpnclient_authorization_rule_test.go b/internal/service/ec2/vpnclient_authorization_rule_test.go index 04f4169911de..bcf5db529267 100644 --- a/internal/service/ec2/vpnclient_authorization_rule_test.go +++ b/internal/service/ec2/vpnclient_authorization_rule_test.go @@ -24,7 +24,7 @@ func testAccClientVPNAuthorizationRule_basic(t *testing.T) { subnetResourceName := "aws_subnet.test.0" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheckClientVPNSyncronize(t); acctest.PreCheck(t) }, + PreCheck: func() { testAccPreCheckClientVPNSyncronize(t); acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClientVPNAuthorizationRuleDestroy(ctx), @@ -54,7 +54,7 @@ func testAccClientVPNAuthorizationRule_disappears(t *testing.T) { resourceName := "aws_ec2_client_vpn_authorization_rule.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheckClientVPNSyncronize(t); acctest.PreCheck(t) }, + PreCheck: func() { testAccPreCheckClientVPNSyncronize(t); acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClientVPNAuthorizationRuleDestroy(ctx), @@ -78,7 +78,7 @@ func testAccClientVPNAuthorizationRule_Disappears_endpoint(t *testing.T) { resourceName := "aws_ec2_client_vpn_authorization_rule.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheckClientVPNSyncronize(t); acctest.PreCheck(t) }, + PreCheck: func() { testAccPreCheckClientVPNSyncronize(t); acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClientVPNAuthorizationRuleDestroy(ctx), @@ -118,7 +118,7 @@ func testAccClientVPNAuthorizationRule_groups(t *testing.T) { } resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheckClientVPNSyncronize(t); acctest.PreCheck(t) }, + PreCheck: func() { testAccPreCheckClientVPNSyncronize(t); acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClientVPNAuthorizationRuleDestroy(ctx), @@ -190,7 +190,7 @@ func testAccClientVPNAuthorizationRule_subnets(t *testing.T) { } resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheckClientVPNSyncronize(t); acctest.PreCheck(t) }, + PreCheck: func() { testAccPreCheckClientVPNSyncronize(t); acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClientVPNAuthorizationRuleDestroy(ctx), diff --git a/internal/service/ec2/vpnclient_endpoint_data_source_test.go b/internal/service/ec2/vpnclient_endpoint_data_source_test.go index a91fe61dd9da..b3f48dc7989c 100644 --- a/internal/service/ec2/vpnclient_endpoint_data_source_test.go +++ b/internal/service/ec2/vpnclient_endpoint_data_source_test.go @@ -18,7 +18,7 @@ func testAccClientVPNEndpointDataSource_basic(t *testing.T) { datasource3Name := "data.aws_ec2_client_vpn_endpoint.by_tags" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheckClientVPNSyncronize(t); acctest.PreCheck(t) }, + PreCheck: func() { testAccPreCheckClientVPNSyncronize(t); acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClientVPNEndpointDestroy(ctx), diff --git a/internal/service/ec2/vpnclient_endpoint_test.go b/internal/service/ec2/vpnclient_endpoint_test.go index f29e2a9a3881..5446467ce26a 100644 --- a/internal/service/ec2/vpnclient_endpoint_test.go +++ b/internal/service/ec2/vpnclient_endpoint_test.go @@ -97,7 +97,7 @@ func testAccClientVPNEndpoint_basic(t *testing.T) { resourceName := "aws_ec2_client_vpn_endpoint.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheckClientVPNSyncronize(t); acctest.PreCheck(t) }, + PreCheck: func() { testAccPreCheckClientVPNSyncronize(t); acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClientVPNEndpointDestroy(ctx), @@ -153,7 +153,7 @@ func testAccClientVPNEndpoint_disappears(t *testing.T) { resourceName := "aws_ec2_client_vpn_endpoint.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheckClientVPNSyncronize(t); acctest.PreCheck(t) }, + PreCheck: func() { testAccPreCheckClientVPNSyncronize(t); acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClientVPNEndpointDestroy(ctx), @@ -176,7 +176,7 @@ func testAccClientVPNEndpoint_tags(t *testing.T) { resourceName := "aws_ec2_client_vpn_endpoint.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheckClientVPNSyncronize(t); acctest.PreCheck(t) }, + PreCheck: func() { testAccPreCheckClientVPNSyncronize(t); acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClientVPNEndpointDestroy(ctx), @@ -227,7 +227,7 @@ func testAccClientVPNEndpoint_msADAuth(t *testing.T) { } resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheckClientVPNSyncronize(t); acctest.PreCheck(t) }, + PreCheck: func() { testAccPreCheckClientVPNSyncronize(t); acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClientVPNEndpointDestroy(ctx), @@ -263,7 +263,7 @@ func testAccClientVPNEndpoint_msADAuthAndMutualAuth(t *testing.T) { } resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheckClientVPNSyncronize(t); acctest.PreCheck(t) }, + PreCheck: func() { testAccPreCheckClientVPNSyncronize(t); acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClientVPNEndpointDestroy(ctx), @@ -298,7 +298,7 @@ func testAccClientVPNEndpoint_federatedAuth(t *testing.T) { resourceName := "aws_ec2_client_vpn_endpoint.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckClientVPNSyncronize(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckClientVPNSyncronize(t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClientVPNEndpointDestroy(ctx), @@ -330,7 +330,7 @@ func testAccClientVPNEndpoint_federatedAuthWithSelfServiceProvider(t *testing.T) resourceName := "aws_ec2_client_vpn_endpoint.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckClientVPNSyncronize(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckClientVPNSyncronize(t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClientVPNEndpointDestroy(ctx), @@ -363,7 +363,7 @@ func testAccClientVPNEndpoint_withClientConnectOptions(t *testing.T) { lambdaFunction2ResourceName := "aws_lambda_function.test2" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheckClientVPNSyncronize(t); acctest.PreCheck(t) }, + PreCheck: func() { testAccPreCheckClientVPNSyncronize(t); acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClientVPNEndpointDestroy(ctx), @@ -411,7 +411,7 @@ func testAccClientVPNEndpoint_withClientLoginBannerOptions(t *testing.T) { resourceName := "aws_ec2_client_vpn_endpoint.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheckClientVPNSyncronize(t); acctest.PreCheck(t) }, + PreCheck: func() { testAccPreCheckClientVPNSyncronize(t); acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClientVPNEndpointDestroy(ctx), @@ -462,7 +462,7 @@ func testAccClientVPNEndpoint_withConnectionLogOptions(t *testing.T) { logStream2ResourceName := "aws_cloudwatch_log_stream.test2" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheckClientVPNSyncronize(t); acctest.PreCheck(t) }, + PreCheck: func() { testAccPreCheckClientVPNSyncronize(t); acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClientVPNEndpointDestroy(ctx), @@ -523,7 +523,7 @@ func testAccClientVPNEndpoint_withDNSServers(t *testing.T) { resourceName := "aws_ec2_client_vpn_endpoint.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheckClientVPNSyncronize(t); acctest.PreCheck(t) }, + PreCheck: func() { testAccPreCheckClientVPNSyncronize(t); acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClientVPNEndpointDestroy(ctx), @@ -570,7 +570,7 @@ func testAccClientVPNEndpoint_simpleAttributesUpdate(t *testing.T) { serverCertificate2ResourceName := "aws_acm_certificate.test2" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheckClientVPNSyncronize(t); acctest.PreCheck(t) }, + PreCheck: func() { testAccPreCheckClientVPNSyncronize(t); acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClientVPNEndpointDestroy(ctx), @@ -616,7 +616,7 @@ func testAccClientVPNEndpoint_selfServicePortal(t *testing.T) { resourceName := "aws_ec2_client_vpn_endpoint.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheckClientVPNSyncronize(t); acctest.PreCheck(t) }, + PreCheck: func() { testAccPreCheckClientVPNSyncronize(t); acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClientVPNEndpointDestroy(ctx), @@ -653,7 +653,7 @@ func testAccClientVPNEndpoint_vpcNoSecurityGroups(t *testing.T) { vpcResourceName := "aws_vpc.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheckClientVPNSyncronize(t); acctest.PreCheck(t) }, + PreCheck: func() { testAccPreCheckClientVPNSyncronize(t); acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClientVPNEndpointDestroy(ctx), @@ -686,7 +686,7 @@ func testAccClientVPNEndpoint_vpcSecurityGroups(t *testing.T) { vpcResourceName := "aws_vpc.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheckClientVPNSyncronize(t); acctest.PreCheck(t) }, + PreCheck: func() { testAccPreCheckClientVPNSyncronize(t); acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClientVPNEndpointDestroy(ctx), diff --git a/internal/service/ec2/vpnclient_network_association_test.go b/internal/service/ec2/vpnclient_network_association_test.go index e9718b2ee8cd..eedfecea78b7 100644 --- a/internal/service/ec2/vpnclient_network_association_test.go +++ b/internal/service/ec2/vpnclient_network_association_test.go @@ -29,7 +29,7 @@ func testAccClientVPNNetworkAssociation_basic(t *testing.T) { defaultSecurityGroupResourceName := "aws_default_security_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheckClientVPNSyncronize(t); acctest.PreCheck(t) }, + PreCheck: func() { testAccPreCheckClientVPNSyncronize(t); acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClientVPNNetworkAssociationDestroy(ctx), @@ -70,7 +70,7 @@ func testAccClientVPNNetworkAssociation_multipleSubnets(t *testing.T) { defaultSecurityGroupResourceName := "aws_default_security_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheckClientVPNSyncronize(t); acctest.PreCheck(t) }, + PreCheck: func() { testAccPreCheckClientVPNSyncronize(t); acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClientVPNNetworkAssociationDestroy(ctx), @@ -114,7 +114,7 @@ func testAccClientVPNNetworkAssociation_disappears(t *testing.T) { resourceName := "aws_ec2_client_vpn_network_association.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheckClientVPNSyncronize(t); acctest.PreCheck(t) }, + PreCheck: func() { testAccPreCheckClientVPNSyncronize(t); acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClientVPNNetworkAssociationDestroy(ctx), @@ -141,7 +141,7 @@ func testAccClientVPNNetworkAssociation_securityGroups(t *testing.T) { securityGroup2ResourceName := "aws_security_group.test2" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckClientVPNSyncronize(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckClientVPNSyncronize(t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClientVPNNetworkAssociationDestroy(ctx), @@ -183,7 +183,7 @@ func testAccClientVPNNetworkAssociation_securityGroupsOnEndpoint(t *testing.T) { resourceName := "aws_ec2_client_vpn_network_association.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckClientVPNSyncronize(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckClientVPNSyncronize(t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClientVPNNetworkAssociationDestroy(ctx), diff --git a/internal/service/ec2/vpnclient_route_test.go b/internal/service/ec2/vpnclient_route_test.go index f0cf34617069..151a98948ec4 100644 --- a/internal/service/ec2/vpnclient_route_test.go +++ b/internal/service/ec2/vpnclient_route_test.go @@ -24,7 +24,7 @@ func testAccClientVPNRoute_basic(t *testing.T) { subnetResourceName := "aws_subnet.test.0" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheckClientVPNSyncronize(t); acctest.PreCheck(t) }, + PreCheck: func() { testAccPreCheckClientVPNSyncronize(t); acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClientVPNRouteDestroy(ctx), @@ -57,7 +57,7 @@ func testAccClientVPNRoute_disappears(t *testing.T) { resourceName := "aws_ec2_client_vpn_route.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheckClientVPNSyncronize(t); acctest.PreCheck(t) }, + PreCheck: func() { testAccPreCheckClientVPNSyncronize(t); acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClientVPNRouteDestroy(ctx), @@ -81,7 +81,7 @@ func testAccClientVPNRoute_description(t *testing.T) { resourceName := "aws_ec2_client_vpn_route.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheckClientVPNSyncronize(t); acctest.PreCheck(t) }, + PreCheck: func() { testAccPreCheckClientVPNSyncronize(t); acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClientVPNRouteDestroy(ctx), diff --git a/internal/service/ec2/vpnsite_connection_route_test.go b/internal/service/ec2/vpnsite_connection_route_test.go index b24f1d0d42d8..77d25e8eebd1 100644 --- a/internal/service/ec2/vpnsite_connection_route_test.go +++ b/internal/service/ec2/vpnsite_connection_route_test.go @@ -22,7 +22,7 @@ func TestAccSiteVPNConnectionRoute_basic(t *testing.T) { resourceName := "aws_vpn_connection_route.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckVPNConnectionRouteDestroy(ctx), @@ -44,7 +44,7 @@ func TestAccSiteVPNConnectionRoute_disappears(t *testing.T) { resourceName := "aws_vpn_connection_route.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckVPNConnectionRouteDestroy(ctx), diff --git a/internal/service/ec2/vpnsite_connection_test.go b/internal/service/ec2/vpnsite_connection_test.go index 028e961be224..e9b8a7d5549d 100644 --- a/internal/service/ec2/vpnsite_connection_test.go +++ b/internal/service/ec2/vpnsite_connection_test.go @@ -158,7 +158,7 @@ func TestAccSiteVPNConnection_basic(t *testing.T) { var vpn ec2.VpnConnection resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckVPNConnectionDestroy(ctx), @@ -254,7 +254,7 @@ func TestAccSiteVPNConnection_withoutTGWorVGW(t *testing.T) { var vpn ec2.VpnConnection resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckVPNConnectionDestroy(ctx), @@ -348,7 +348,7 @@ func TestAccSiteVPNConnection_cloudWatchLogOptions(t *testing.T) { var vpn ec2.VpnConnection resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckVPNConnectionDestroy(ctx), @@ -398,7 +398,7 @@ func TestAccSiteVPNConnection_transitGatewayID(t *testing.T) { resourceName := "aws_vpn_connection.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckTransitGateway(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckTransitGateway(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckVPNConnectionDestroy(ctx), @@ -428,7 +428,7 @@ func TestAccSiteVPNConnection_tunnel1InsideCIDR(t *testing.T) { var vpn ec2.VpnConnection resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckVPNConnectionDestroy(ctx), @@ -458,7 +458,7 @@ func TestAccSiteVPNConnection_tunnel1InsideIPv6CIDR(t *testing.T) { var vpn ec2.VpnConnection resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckVPNConnectionDestroy(ctx), @@ -488,7 +488,7 @@ func TestAccSiteVPNConnection_tunnel1PreSharedKey(t *testing.T) { var vpn ec2.VpnConnection resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckVPNConnectionDestroy(ctx), @@ -559,7 +559,7 @@ func TestAccSiteVPNConnection_tunnelOptions(t *testing.T) { } resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckVPNConnectionDestroy(ctx), @@ -698,7 +698,7 @@ func TestAccSiteVPNConnection_tunnelOptionsLesser(t *testing.T) { tunnel2Updated.tunnelCidr = tunnel2.tunnelCidr resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckVPNConnectionDestroy(ctx), @@ -1198,7 +1198,7 @@ func TestAccSiteVPNConnection_staticRoutes(t *testing.T) { var vpn ec2.VpnConnection resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckVPNConnectionDestroy(ctx), @@ -1227,7 +1227,7 @@ func TestAccSiteVPNConnection_outsideAddressTypePrivate(t *testing.T) { var vpn ec2.VpnConnection resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckVPNConnectionDestroy(ctx), @@ -1256,7 +1256,7 @@ func TestAccSiteVPNConnection_outsideAddressTypePublic(t *testing.T) { var vpn ec2.VpnConnection resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckVPNConnectionDestroy(ctx), @@ -1285,7 +1285,7 @@ func TestAccSiteVPNConnection_enableAcceleration(t *testing.T) { var vpn ec2.VpnConnection resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckVPNConnectionDestroy(ctx), @@ -1314,7 +1314,7 @@ func TestAccSiteVPNConnection_ipv6(t *testing.T) { var vpn ec2.VpnConnection resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckVPNConnectionDestroy(ctx), @@ -1342,7 +1342,7 @@ func TestAccSiteVPNConnection_tags(t *testing.T) { var vpn ec2.VpnConnection resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckVPNConnectionDestroy(ctx), @@ -1389,7 +1389,7 @@ func TestAccSiteVPNConnection_specifyIPv4(t *testing.T) { var vpn ec2.VpnConnection resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckVPNConnectionDestroy(ctx), @@ -1427,7 +1427,7 @@ func TestAccSiteVPNConnection_specifyIPv6(t *testing.T) { var vpn ec2.VpnConnection resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckVPNConnectionDestroy(ctx), @@ -1452,7 +1452,7 @@ func TestAccSiteVPNConnection_disappears(t *testing.T) { var vpn ec2.VpnConnection resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckVPNConnectionDestroy(ctx), @@ -1478,7 +1478,7 @@ func TestAccSiteVPNConnection_updateCustomerGatewayID(t *testing.T) { var vpn1, vpn2 ec2.VpnConnection resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckVPNConnectionDestroy(ctx), @@ -1515,7 +1515,7 @@ func TestAccSiteVPNConnection_updateVPNGatewayID(t *testing.T) { var vpn1, vpn2 ec2.VpnConnection resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckVPNConnectionDestroy(ctx), @@ -1552,7 +1552,7 @@ func TestAccSiteVPNConnection_updateTransitGatewayID(t *testing.T) { var vpn1, vpn2 ec2.VpnConnection resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckTransitGateway(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckTransitGateway(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckVPNConnectionDestroy(ctx), @@ -1591,7 +1591,7 @@ func TestAccSiteVPNConnection_vpnGatewayIDToTransitGatewayID(t *testing.T) { var vpn1, vpn2 ec2.VpnConnection resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckVPNConnectionDestroy(ctx), @@ -1630,7 +1630,7 @@ func TestAccSiteVPNConnection_transitGatewayIDToVPNGatewayID(t *testing.T) { var vpn1, vpn2 ec2.VpnConnection resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckVPNConnectionDestroy(ctx), 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 7a84cbb3c711..4d294d9f35cc 100644 --- a/internal/service/ec2/vpnsite_customer_gateway_data_source_test.go +++ b/internal/service/ec2/vpnsite_customer_gateway_data_source_test.go @@ -19,7 +19,7 @@ func TestAccSiteVPNCustomerGatewayDataSource_filter(t *testing.T) { hostOctet := sdkacctest.RandIntRange(1, 254) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckCustomerGatewayDestroy(ctx), @@ -49,7 +49,7 @@ func TestAccSiteVPNCustomerGatewayDataSource_id(t *testing.T) { hostOctet := sdkacctest.RandIntRange(1, 254) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckCustomerGatewayDestroy(ctx), diff --git a/internal/service/ec2/vpnsite_customer_gateway_test.go b/internal/service/ec2/vpnsite_customer_gateway_test.go index b3a9edc7e717..e270a9b3b651 100644 --- a/internal/service/ec2/vpnsite_customer_gateway_test.go +++ b/internal/service/ec2/vpnsite_customer_gateway_test.go @@ -25,7 +25,7 @@ func TestAccSiteVPNCustomerGateway_basic(t *testing.T) { resourceName := "aws_customer_gateway.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckCustomerGatewayDestroy(ctx), @@ -59,7 +59,7 @@ func TestAccSiteVPNCustomerGateway_disappears(t *testing.T) { resourceName := "aws_customer_gateway.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckCustomerGatewayDestroy(ctx), @@ -83,7 +83,7 @@ func TestAccSiteVPNCustomerGateway_tags(t *testing.T) { resourceName := "aws_customer_gateway.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckCustomerGatewayDestroy(ctx), @@ -127,7 +127,7 @@ func TestAccSiteVPNCustomerGateway_deviceName(t *testing.T) { resourceName := "aws_customer_gateway.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckCustomerGatewayDestroy(ctx), @@ -156,7 +156,7 @@ func TestAccSiteVPNCustomerGateway_4ByteASN(t *testing.T) { resourceName := "aws_customer_gateway.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckCustomerGatewayDestroy(ctx), @@ -193,7 +193,7 @@ func TestAccSiteVPNCustomerGateway_certificate(t *testing.T) { domain := fmt.Sprintf("%s.%s", sdkacctest.RandString(8), subDomain) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckCustomerGatewayDestroy(ctx), diff --git a/internal/service/ec2/vpnsite_gateway_attachment_test.go b/internal/service/ec2/vpnsite_gateway_attachment_test.go index 7baaf2f9df7c..0ac60dc5da08 100644 --- a/internal/service/ec2/vpnsite_gateway_attachment_test.go +++ b/internal/service/ec2/vpnsite_gateway_attachment_test.go @@ -22,7 +22,7 @@ func TestAccSiteVPNGatewayAttachment_basic(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckVPNGatewayAttachmentDestroy(ctx), @@ -44,7 +44,7 @@ func TestAccSiteVPNGatewayAttachment_disappears(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckVPNGatewayAttachmentDestroy(ctx), diff --git a/internal/service/ec2/vpnsite_gateway_data_source_test.go b/internal/service/ec2/vpnsite_gateway_data_source_test.go index 0b995f41d0e8..722f5ceb123b 100644 --- a/internal/service/ec2/vpnsite_gateway_data_source_test.go +++ b/internal/service/ec2/vpnsite_gateway_data_source_test.go @@ -19,7 +19,7 @@ func TestAccSiteVPNGatewayDataSource_unattached(t *testing.T) { resourceName := "aws_vpn_gateway.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ @@ -45,7 +45,7 @@ func TestAccSiteVPNGatewayDataSource_attached(t *testing.T) { dataSourceName := "data.aws_vpn_gateway.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ diff --git a/internal/service/ec2/vpnsite_gateway_route_propagation_test.go b/internal/service/ec2/vpnsite_gateway_route_propagation_test.go index 7d77372b6bc9..f82837abc07c 100644 --- a/internal/service/ec2/vpnsite_gateway_route_propagation_test.go +++ b/internal/service/ec2/vpnsite_gateway_route_propagation_test.go @@ -21,7 +21,7 @@ func TestAccSiteVPNGatewayRoutePropagation_basic(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckVPNGatewayRoutePropagationDestroy(ctx), @@ -42,7 +42,7 @@ func TestAccSiteVPNGatewayRoutePropagation_disappears(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckVPNGatewayRoutePropagationDestroy(ctx), diff --git a/internal/service/ec2/vpnsite_gateway_test.go b/internal/service/ec2/vpnsite_gateway_test.go index 08fe81e9207c..ecc026628a85 100644 --- a/internal/service/ec2/vpnsite_gateway_test.go +++ b/internal/service/ec2/vpnsite_gateway_test.go @@ -41,7 +41,7 @@ func TestAccSiteVPNGateway_basic(t *testing.T) { } resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckVPNGatewayDestroy(ctx), @@ -78,7 +78,7 @@ func TestAccSiteVPNGateway_withAvailabilityZoneSetToState(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckVPNGatewayDestroy(ctx), @@ -107,7 +107,7 @@ func TestAccSiteVPNGateway_amazonSideASN(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckVPNGatewayDestroy(ctx), @@ -136,7 +136,7 @@ func TestAccSiteVPNGateway_disappears(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckVPNGatewayDestroy(ctx), @@ -196,7 +196,7 @@ func TestAccSiteVPNGateway_reattach(t *testing.T) { } resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckVPNGatewayDestroy(ctx), @@ -251,7 +251,7 @@ func TestAccSiteVPNGateway_tags(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckVPNGatewayDestroy(ctx), diff --git a/internal/service/ec2/wavelength_carrier_gateway_test.go b/internal/service/ec2/wavelength_carrier_gateway_test.go index 4d565270a37f..db4d90662376 100644 --- a/internal/service/ec2/wavelength_carrier_gateway_test.go +++ b/internal/service/ec2/wavelength_carrier_gateway_test.go @@ -24,7 +24,7 @@ func TestAccWavelengthCarrierGateway_basic(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckWavelengthZoneAvailable(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckWavelengthZoneAvailable(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckCarrierGatewayDestroy(ctx), @@ -55,7 +55,7 @@ func TestAccWavelengthCarrierGateway_disappears(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckWavelengthZoneAvailable(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckWavelengthZoneAvailable(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckCarrierGatewayDestroy(ctx), @@ -79,7 +79,7 @@ func TestAccWavelengthCarrierGateway_tags(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckWavelengthZoneAvailable(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckWavelengthZoneAvailable(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckCarrierGatewayDestroy(ctx), From 6f91ffaffbf4ed490d478b3248db465a3fda63ff Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Fri, 24 Feb 2023 16:36:51 -0500 Subject: [PATCH 140/763] Add 'Context' argument to 'acctest.PreCheck' for ecr. --- .../ecr/authorization_token_data_source_test.go | 2 +- internal/service/ecr/image_data_source_test.go | 2 +- internal/service/ecr/lifecycle_policy_test.go | 6 +++--- .../service/ecr/pull_through_cache_rule_test.go | 6 +++--- internal/service/ecr/registry_policy_test.go | 4 ++-- .../ecr/registry_scanning_configuration_test.go | 4 ++-- .../service/ecr/replication_configuration_test.go | 4 ++-- .../service/ecr/repository_data_source_test.go | 6 +++--- internal/service/ecr/repository_policy_test.go | 10 +++++----- internal/service/ecr/repository_test.go | 14 +++++++------- 10 files changed, 29 insertions(+), 29 deletions(-) diff --git a/internal/service/ecr/authorization_token_data_source_test.go b/internal/service/ecr/authorization_token_data_source_test.go index 32af0d95bcd2..a454f5c14a2f 100644 --- a/internal/service/ecr/authorization_token_data_source_test.go +++ b/internal/service/ecr/authorization_token_data_source_test.go @@ -16,7 +16,7 @@ func TestAccECRAuthorizationTokenDataSource_basic(t *testing.T) { dataSourceName := "data.aws_ecr_authorization_token.repo" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ecr.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ diff --git a/internal/service/ecr/image_data_source_test.go b/internal/service/ecr/image_data_source_test.go index 1a117a52669e..c5555a9701ae 100644 --- a/internal/service/ecr/image_data_source_test.go +++ b/internal/service/ecr/image_data_source_test.go @@ -16,7 +16,7 @@ func TestAccECRImageDataSource_basic(t *testing.T) { resourceByMostRecent := "data.aws_ecr_image.by_most_recent" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ecr.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ diff --git a/internal/service/ecr/lifecycle_policy_test.go b/internal/service/ecr/lifecycle_policy_test.go index 080df212b7e6..c3d81223bf2c 100644 --- a/internal/service/ecr/lifecycle_policy_test.go +++ b/internal/service/ecr/lifecycle_policy_test.go @@ -22,7 +22,7 @@ func TestAccECRLifecyclePolicy_basic(t *testing.T) { resourceName := "aws_ecr_lifecycle_policy.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ecr.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckLifecyclePolicyDestroy(ctx), @@ -48,7 +48,7 @@ func TestAccECRLifecyclePolicy_ignoreEquivalent(t *testing.T) { resourceName := "aws_ecr_lifecycle_policy.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ecr.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckLifecyclePolicyDestroy(ctx), @@ -73,7 +73,7 @@ func TestAccECRLifecyclePolicy_detectDiff(t *testing.T) { resourceName := "aws_ecr_lifecycle_policy.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ecr.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckLifecyclePolicyDestroy(ctx), diff --git a/internal/service/ecr/pull_through_cache_rule_test.go b/internal/service/ecr/pull_through_cache_rule_test.go index 39a307f429dd..b82df726887d 100644 --- a/internal/service/ecr/pull_through_cache_rule_test.go +++ b/internal/service/ecr/pull_through_cache_rule_test.go @@ -22,7 +22,7 @@ func TestAccECRPullThroughCacheRule_basic(t *testing.T) { resourceName := "aws_ecr_pull_through_cache_rule.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ecr.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckPullThroughCacheRuleDestroy(ctx), @@ -51,7 +51,7 @@ func TestAccECRPullThroughCacheRule_disappears(t *testing.T) { resourceName := "aws_ecr_pull_through_cache_rule.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ecr.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckPullThroughCacheRuleDestroy(ctx), @@ -78,7 +78,7 @@ func TestAccECRPullThroughCacheRule_failWhenAlreadyExists(t *testing.T) { } resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ecr.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckPullThroughCacheRuleDestroy(ctx), diff --git a/internal/service/ecr/registry_policy_test.go b/internal/service/ecr/registry_policy_test.go index aa8f93250e1b..eaca6d9c7aa5 100644 --- a/internal/service/ecr/registry_policy_test.go +++ b/internal/service/ecr/registry_policy_test.go @@ -32,7 +32,7 @@ func testAccRegistryPolicy_basic(t *testing.T) { resourceName := "aws_ecr_registry_policy.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ecr.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRegistryPolicyDestroy(ctx), @@ -69,7 +69,7 @@ func testAccRegistryPolicy_disappears(t *testing.T) { resourceName := "aws_ecr_registry_policy.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ecr.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRegistryPolicyDestroy(ctx), diff --git a/internal/service/ecr/registry_scanning_configuration_test.go b/internal/service/ecr/registry_scanning_configuration_test.go index 75629fc1b77c..9d9eba9ead59 100644 --- a/internal/service/ecr/registry_scanning_configuration_test.go +++ b/internal/service/ecr/registry_scanning_configuration_test.go @@ -29,7 +29,7 @@ func testAccRegistryScanningConfiguration_basic(t *testing.T) { resourceName := "aws_ecr_registry_scanning_configuration.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ecr.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRegistryScanningConfigurationDestroy(ctx), @@ -58,7 +58,7 @@ func testAccRegistryScanningConfiguration_update(t *testing.T) { resourceName := "aws_ecr_registry_scanning_configuration.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ecr.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRegistryScanningConfigurationDestroy(ctx), diff --git a/internal/service/ecr/replication_configuration_test.go b/internal/service/ecr/replication_configuration_test.go index 4dfe2a5199ea..9fd6608216f6 100644 --- a/internal/service/ecr/replication_configuration_test.go +++ b/internal/service/ecr/replication_configuration_test.go @@ -28,7 +28,7 @@ func testAccReplicationConfiguration_basic(t *testing.T) { resourceName := "aws_ecr_replication_configuration.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ecr.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckReplicationConfigurationDestroy(ctx), @@ -88,7 +88,7 @@ func testAccReplicationConfiguration_repositoryFilter(t *testing.T) { resourceName := "aws_ecr_replication_configuration.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ecr.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckReplicationConfigurationDestroy(ctx), diff --git a/internal/service/ecr/repository_data_source_test.go b/internal/service/ecr/repository_data_source_test.go index 84c9f2c8a1d2..2df141dab229 100644 --- a/internal/service/ecr/repository_data_source_test.go +++ b/internal/service/ecr/repository_data_source_test.go @@ -17,7 +17,7 @@ func TestAccECRRepositoryDataSource_basic(t *testing.T) { dataSourceName := "data.aws_ecr_repository.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ecr.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ @@ -44,7 +44,7 @@ func TestAccECRRepositoryDataSource_encryption(t *testing.T) { dataSourceName := "data.aws_ecr_repository.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ecr.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ @@ -68,7 +68,7 @@ func TestAccECRRepositoryDataSource_encryption(t *testing.T) { func TestAccECRRepositoryDataSource_nonExistent(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ecr.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ diff --git a/internal/service/ecr/repository_policy_test.go b/internal/service/ecr/repository_policy_test.go index 23cc0ef284c4..94d6e2fa43d1 100644 --- a/internal/service/ecr/repository_policy_test.go +++ b/internal/service/ecr/repository_policy_test.go @@ -23,7 +23,7 @@ func TestAccECRRepositoryPolicy_basic(t *testing.T) { resourceName := "aws_ecr_repository_policy.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ecr.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRepositoryPolicyDestroy(ctx), @@ -62,7 +62,7 @@ func TestAccECRRepositoryPolicy_IAM_basic(t *testing.T) { resourceName := "aws_ecr_repository_policy.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ecr.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRepositoryPolicyDestroy(ctx), @@ -91,7 +91,7 @@ func TestAccECRRepositoryPolicy_IAM_principalOrder(t *testing.T) { resourceName := "aws_ecr_repository_policy.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ecr.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRepositoryPolicyDestroy(ctx), @@ -124,7 +124,7 @@ func TestAccECRRepositoryPolicy_disappears(t *testing.T) { resourceName := "aws_ecr_repository_policy.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ecr.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRepositoryPolicyDestroy(ctx), @@ -147,7 +147,7 @@ func TestAccECRRepositoryPolicy_Disappears_repository(t *testing.T) { resourceName := "aws_ecr_repository_policy.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ecr.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRepositoryPolicyDestroy(ctx), diff --git a/internal/service/ecr/repository_test.go b/internal/service/ecr/repository_test.go index 3db624ae5e03..9b314b1ac6cc 100644 --- a/internal/service/ecr/repository_test.go +++ b/internal/service/ecr/repository_test.go @@ -25,7 +25,7 @@ func TestAccECRRepository_basic(t *testing.T) { resourceName := "aws_ecr_repository.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ecr.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRepositoryDestroy(ctx), @@ -59,7 +59,7 @@ func TestAccECRRepository_disappears(t *testing.T) { resourceName := "aws_ecr_repository.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ecr.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRepositoryDestroy(ctx), @@ -83,7 +83,7 @@ func TestAccECRRepository_tags(t *testing.T) { resourceName := "aws_ecr_repository.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ecr.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRepositoryDestroy(ctx), @@ -129,7 +129,7 @@ func TestAccECRRepository_immutability(t *testing.T) { resourceName := "aws_ecr_repository.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ecr.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRepositoryDestroy(ctx), @@ -158,7 +158,7 @@ func TestAccECRRepository_Image_scanning(t *testing.T) { resourceName := "aws_ecr_repository.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ecr.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRepositoryDestroy(ctx), @@ -210,7 +210,7 @@ func TestAccECRRepository_Encryption_kms(t *testing.T) { kmsKeyDataSourceName := "aws_kms_key.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ecr.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRepositoryDestroy(ctx), @@ -256,7 +256,7 @@ func TestAccECRRepository_Encryption_aes256(t *testing.T) { resourceName := "aws_ecr_repository.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ecr.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRepositoryDestroy(ctx), From 559a09157c552cdf02ec6693426cb4b6efaff743 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Fri, 24 Feb 2023 16:36:51 -0500 Subject: [PATCH 141/763] Add 'Context' argument to 'acctest.PreCheck' for ecrpublic. --- .../authorization_token_data_source_test.go | 2 +- .../ecrpublic/repository_policy_test.go | 8 ++++---- internal/service/ecrpublic/repository_test.go | 20 +++++++++---------- 3 files changed, 15 insertions(+), 15 deletions(-) diff --git a/internal/service/ecrpublic/authorization_token_data_source_test.go b/internal/service/ecrpublic/authorization_token_data_source_test.go index 72d43e520e13..ce5a4f160d02 100644 --- a/internal/service/ecrpublic/authorization_token_data_source_test.go +++ b/internal/service/ecrpublic/authorization_token_data_source_test.go @@ -14,7 +14,7 @@ func TestAccECRPublicAuthorizationTokenDataSource_basic(t *testing.T) { dataSourceName := "data.aws_ecrpublic_authorization_token.repo" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ecr.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ diff --git a/internal/service/ecrpublic/repository_policy_test.go b/internal/service/ecrpublic/repository_policy_test.go index be68ccf5cd1b..ecf7f5057701 100644 --- a/internal/service/ecrpublic/repository_policy_test.go +++ b/internal/service/ecrpublic/repository_policy_test.go @@ -21,7 +21,7 @@ func TestAccECRPublicRepositoryPolicy_basic(t *testing.T) { resourceName := "aws_ecrpublic_repository_policy.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ecrpublic.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRepositoryPolicyDestroy(ctx), @@ -55,7 +55,7 @@ func TestAccECRPublicRepositoryPolicy_disappears(t *testing.T) { resourceName := "aws_ecrpublic_repository_policy.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ecrpublic.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRepositoryPolicyDestroy(ctx), @@ -80,7 +80,7 @@ func TestAccECRPublicRepositoryPolicy_Disappears_repository(t *testing.T) { repositoryResourceName := "aws_ecrpublic_repository.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ecrpublic.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRepositoryPolicyDestroy(ctx), @@ -104,7 +104,7 @@ func TestAccECRPublicRepositoryPolicy_iam(t *testing.T) { resourceName := "aws_ecrpublic_repository_policy.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ecrpublic.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRepositoryPolicyDestroy(ctx), diff --git a/internal/service/ecrpublic/repository_test.go b/internal/service/ecrpublic/repository_test.go index 0f8bfa3a76f8..b5811aa17bc1 100644 --- a/internal/service/ecrpublic/repository_test.go +++ b/internal/service/ecrpublic/repository_test.go @@ -24,7 +24,7 @@ func TestAccECRPublicRepository_basic(t *testing.T) { resourceName := "aws_ecrpublic_repository.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ecrpublic.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRepositoryDestroy(ctx), @@ -54,7 +54,7 @@ func TestAccECRPublicRepository_tags(t *testing.T) { resourceName := "aws_ecrpublic_repository.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ecrpublic.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRepositoryDestroy(ctx), @@ -100,7 +100,7 @@ func TestAccECRPublicRepository_CatalogData_aboutText(t *testing.T) { resourceName := "aws_ecrpublic_repository.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ecrpublic.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRepositoryDestroy(ctx), @@ -137,7 +137,7 @@ func TestAccECRPublicRepository_CatalogData_architectures(t *testing.T) { resourceName := "aws_ecrpublic_repository.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ecrpublic.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRepositoryDestroy(ctx), @@ -174,7 +174,7 @@ func TestAccECRPublicRepository_CatalogData_description(t *testing.T) { resourceName := "aws_ecrpublic_repository.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ecrpublic.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRepositoryDestroy(ctx), @@ -211,7 +211,7 @@ func TestAccECRPublicRepository_CatalogData_operatingSystems(t *testing.T) { resourceName := "aws_ecrpublic_repository.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ecrpublic.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRepositoryDestroy(ctx), @@ -248,7 +248,7 @@ func TestAccECRPublicRepository_CatalogData_usageText(t *testing.T) { resourceName := "aws_ecrpublic_repository.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ecrpublic.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRepositoryDestroy(ctx), @@ -285,7 +285,7 @@ func TestAccECRPublicRepository_CatalogData_logoImageBlob(t *testing.T) { resourceName := "aws_ecrpublic_repository.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ecrpublic.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRepositoryDestroy(ctx), @@ -315,7 +315,7 @@ func TestAccECRPublicRepository_Basic_forceDestroy(t *testing.T) { resourceName := "aws_ecrpublic_repository.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ecrpublic.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRepositoryDestroy(ctx), @@ -346,7 +346,7 @@ func TestAccECRPublicRepository_disappears(t *testing.T) { resourceName := "aws_ecrpublic_repository.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ecrpublic.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRepositoryDestroy(ctx), From 56d9b495f502d2d45b4bf94b2b4f4f98df4bbedb Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Fri, 24 Feb 2023 16:36:52 -0500 Subject: [PATCH 142/763] Add 'Context' argument to 'acctest.PreCheck' for ecs. --- .../ecs/account_setting_default_test.go | 10 +- .../service/ecs/capacity_provider_test.go | 10 +- .../ecs/cluster_capacity_providers_test.go | 12 +-- .../service/ecs/cluster_data_source_test.go | 4 +- internal/service/ecs/cluster_test.go | 20 ++-- .../container_definition_data_source_test.go | 2 +- .../service/ecs/service_data_source_test.go | 2 +- internal/service/ecs/service_test.go | 96 +++++++++---------- internal/service/ecs/tag_test.go | 8 +- .../ecs/task_definition_data_source_test.go | 2 +- internal/service/ecs/task_definition_test.go | 58 +++++------ internal/service/ecs/task_set_test.go | 22 ++--- 12 files changed, 123 insertions(+), 123 deletions(-) diff --git a/internal/service/ecs/account_setting_default_test.go b/internal/service/ecs/account_setting_default_test.go index 1901b039c084..7c556064e136 100644 --- a/internal/service/ecs/account_setting_default_test.go +++ b/internal/service/ecs/account_setting_default_test.go @@ -21,7 +21,7 @@ func TestAccECSAccountSettingDefault_containerInstanceLongARNFormat(t *testing.T settingName := ecs.SettingNameContainerInstanceLongArnFormat resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ecs.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckAccountSettingDefaultDestroy(ctx), @@ -50,7 +50,7 @@ func TestAccECSAccountSettingDefault_serviceLongARNFormat(t *testing.T) { settingName := ecs.SettingNameServiceLongArnFormat resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ecs.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckAccountSettingDefaultDestroy(ctx), @@ -79,7 +79,7 @@ func TestAccECSAccountSettingDefault_taskLongARNFormat(t *testing.T) { settingName := ecs.SettingNameTaskLongArnFormat resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ecs.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckAccountSettingDefaultDestroy(ctx), @@ -108,7 +108,7 @@ func TestAccECSAccountSettingDefault_vpcTrunking(t *testing.T) { settingName := ecs.SettingNameAwsvpcTrunking resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ecs.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckAccountSettingDefaultDestroy(ctx), @@ -137,7 +137,7 @@ func TestAccECSAccountSettingDefault_containerInsights(t *testing.T) { settingName := ecs.SettingNameContainerInsights resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ecs.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckAccountSettingDefaultDestroy(ctx), diff --git a/internal/service/ecs/capacity_provider_test.go b/internal/service/ecs/capacity_provider_test.go index ba10dd9d0148..3011579ce174 100644 --- a/internal/service/ecs/capacity_provider_test.go +++ b/internal/service/ecs/capacity_provider_test.go @@ -22,7 +22,7 @@ func TestAccECSCapacityProvider_basic(t *testing.T) { resourceName := "aws_ecs_capacity_provider.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ecs.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckCapacityProviderDestroy(ctx), @@ -61,7 +61,7 @@ func TestAccECSCapacityProvider_disappears(t *testing.T) { resourceName := "aws_ecs_capacity_provider.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ecs.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckCapacityProviderDestroy(ctx), @@ -85,7 +85,7 @@ func TestAccECSCapacityProvider_managedScaling(t *testing.T) { resourceName := "aws_ecs_capacity_provider.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ecs.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckCapacityProviderDestroy(ctx), @@ -135,7 +135,7 @@ func TestAccECSCapacityProvider_managedScalingPartial(t *testing.T) { resourceName := "aws_ecs_capacity_provider.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ecs.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckCapacityProviderDestroy(ctx), @@ -171,7 +171,7 @@ func TestAccECSCapacityProvider_tags(t *testing.T) { resourceName := "aws_ecs_capacity_provider.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ecs.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckCapacityProviderDestroy(ctx), diff --git a/internal/service/ecs/cluster_capacity_providers_test.go b/internal/service/ecs/cluster_capacity_providers_test.go index 8b0ea0f6ca06..87d47b89fb3c 100644 --- a/internal/service/ecs/cluster_capacity_providers_test.go +++ b/internal/service/ecs/cluster_capacity_providers_test.go @@ -20,7 +20,7 @@ func TestAccECSClusterCapacityProviders_basic(t *testing.T) { resourceName := "aws_ecs_cluster_capacity_providers.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ecs.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClusterDestroy(ctx), @@ -56,7 +56,7 @@ func TestAccECSClusterCapacityProviders_disappears(t *testing.T) { resourceName := "aws_ecs_cluster_capacity_providers.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ecs.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClusterDestroy(ctx), @@ -80,7 +80,7 @@ func TestAccECSClusterCapacityProviders_defaults(t *testing.T) { resourceName := "aws_ecs_cluster_capacity_providers.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ecs.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClusterDestroy(ctx), @@ -115,7 +115,7 @@ func TestAccECSClusterCapacityProviders_destroy(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ecs.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClusterDestroy(ctx), @@ -147,7 +147,7 @@ func TestAccECSClusterCapacityProviders_Update_capacityProviders(t *testing.T) { resourceName := "aws_ecs_cluster_capacity_providers.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ecs.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClusterDestroy(ctx), @@ -215,7 +215,7 @@ func TestAccECSClusterCapacityProviders_Update_defaultStrategy(t *testing.T) { resourceName := "aws_ecs_cluster_capacity_providers.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ecs.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClusterDestroy(ctx), diff --git a/internal/service/ecs/cluster_data_source_test.go b/internal/service/ecs/cluster_data_source_test.go index 5e9f365690bf..dd971ca2b88e 100644 --- a/internal/service/ecs/cluster_data_source_test.go +++ b/internal/service/ecs/cluster_data_source_test.go @@ -16,7 +16,7 @@ func TestAccECSClusterDataSource_ecsCluster(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ecs.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ @@ -41,7 +41,7 @@ func TestAccECSClusterDataSource_ecsClusterContainerInsights(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ecs.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ diff --git a/internal/service/ecs/cluster_test.go b/internal/service/ecs/cluster_test.go index d9809f5fdd7f..aa10ab756e70 100644 --- a/internal/service/ecs/cluster_test.go +++ b/internal/service/ecs/cluster_test.go @@ -22,7 +22,7 @@ func TestAccECSCluster_basic(t *testing.T) { resourceName := "aws_ecs_cluster.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ecs.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClusterDestroy(ctx), @@ -62,7 +62,7 @@ func TestAccECSCluster_disappears(t *testing.T) { resourceName := "aws_ecs_cluster.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ecs.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClusterDestroy(ctx), @@ -86,7 +86,7 @@ func TestAccECSCluster_tags(t *testing.T) { resourceName := "aws_ecs_cluster.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ecs.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClusterDestroy(ctx), @@ -136,7 +136,7 @@ func TestAccECSCluster_serviceConnectDefaults(t *testing.T) { namespace2ResourceName := "aws_service_discovery_http_namespace.test.1" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ecs.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClusterDestroy(ctx), @@ -174,7 +174,7 @@ func TestAccECSCluster_singleCapacityProvider(t *testing.T) { resourceName := "aws_ecs_cluster.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ecs.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClusterDestroy(ctx), @@ -202,7 +202,7 @@ func TestAccECSCluster_capacityProviders(t *testing.T) { resourceName := "aws_ecs_cluster.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ecs.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClusterDestroy(ctx), @@ -234,7 +234,7 @@ func TestAccECSCluster_capacityProvidersUpdate(t *testing.T) { resourceName := "aws_ecs_cluster.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ecs.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClusterDestroy(ctx), @@ -274,7 +274,7 @@ func TestAccECSCluster_capacityProvidersNoStrategy(t *testing.T) { resourceName := "aws_ecs_cluster.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ecs.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClusterDestroy(ctx), @@ -308,7 +308,7 @@ func TestAccECSCluster_containerInsights(t *testing.T) { resourceName := "aws_ecs_cluster.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ecs.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClusterDestroy(ctx), @@ -355,7 +355,7 @@ func TestAccECSCluster_configuration(t *testing.T) { resourceName := "aws_ecs_cluster.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ecs.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClusterDestroy(ctx), diff --git a/internal/service/ecs/container_definition_data_source_test.go b/internal/service/ecs/container_definition_data_source_test.go index 38343b5f69d7..9febf99207d8 100644 --- a/internal/service/ecs/container_definition_data_source_test.go +++ b/internal/service/ecs/container_definition_data_source_test.go @@ -17,7 +17,7 @@ func TestAccECSContainerDefinitionDataSource_ecsContainerDefinition(t *testing.T tdName := fmt.Sprintf("tf_acc_td_ds_ecs_containter_definition_%s", rString) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ecs.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ diff --git a/internal/service/ecs/service_data_source_test.go b/internal/service/ecs/service_data_source_test.go index b36a49fd08fd..7fc49a26b24e 100644 --- a/internal/service/ecs/service_data_source_test.go +++ b/internal/service/ecs/service_data_source_test.go @@ -16,7 +16,7 @@ func TestAccECSServiceDataSource_basic(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ecs.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ diff --git a/internal/service/ecs/service_test.go b/internal/service/ecs/service_test.go index 49008bd6d8fa..74b8fc10252d 100644 --- a/internal/service/ecs/service_test.go +++ b/internal/service/ecs/service_test.go @@ -28,7 +28,7 @@ func TestAccECSService_basic(t *testing.T) { resourceName := "aws_ecs_service.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ecs.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckServiceDestroy(ctx), @@ -64,7 +64,7 @@ func TestAccECSService_basicImport(t *testing.T) { importInput := fmt.Sprintf("%s/%s", rName, rName) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ecs.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckServiceDestroy(ctx), @@ -103,7 +103,7 @@ func TestAccECSService_disappears(t *testing.T) { resourceName := "aws_ecs_service.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ecs.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckServiceDestroy(ctx), @@ -127,7 +127,7 @@ func TestAccECSService_PlacementStrategy_unnormalized(t *testing.T) { resourceName := "aws_ecs_service.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ecs.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckServiceDestroy(ctx), @@ -149,7 +149,7 @@ func TestAccECSService_CapacityProviderStrategy_basic(t *testing.T) { resourceName := "aws_ecs_service.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ecs.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckServiceDestroy(ctx), @@ -177,7 +177,7 @@ func TestAccECSService_CapacityProviderStrategy_forceNewDeployment(t *testing.T) resourceName := "aws_ecs_service.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ecs.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckServiceDestroy(ctx), @@ -206,7 +206,7 @@ func TestAccECSService_CapacityProviderStrategy_update(t *testing.T) { resourceName := "aws_ecs_service.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ecs.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckServiceDestroy(ctx), @@ -247,7 +247,7 @@ func TestAccECSService_CapacityProviderStrategy_multiple(t *testing.T) { resourceName := "aws_ecs_service.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ecs.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckServiceDestroy(ctx), @@ -270,7 +270,7 @@ func TestAccECSService_familyAndRevision(t *testing.T) { resourceName := "aws_ecs_service.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ecs.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckServiceDestroy(ctx), @@ -300,7 +300,7 @@ func TestAccECSService_renamedCluster(t *testing.T) { resourceName := "aws_ecs_service.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ecs.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckServiceDestroy(ctx), @@ -335,7 +335,7 @@ func TestAccECSService_healthCheckGracePeriodSeconds(t *testing.T) { } resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ecs.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckServiceDestroy(ctx), @@ -380,7 +380,7 @@ func TestAccECSService_iamRole(t *testing.T) { resourceName := "aws_ecs_service.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ecs.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckServiceDestroy(ctx), @@ -402,7 +402,7 @@ func TestAccECSService_DeploymentControllerType_codeDeploy(t *testing.T) { resourceName := "aws_ecs_service.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ecs.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckServiceDestroy(ctx), @@ -439,7 +439,7 @@ func TestAccECSService_DeploymentControllerType_codeDeployUpdateDesiredCountAndH } resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ecs.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckServiceDestroy(ctx), @@ -478,7 +478,7 @@ func TestAccECSService_DeploymentControllerType_external(t *testing.T) { resourceName := "aws_ecs_service.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ecs.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckServiceDestroy(ctx), @@ -510,7 +510,7 @@ func TestAccECSService_Alarms(t *testing.T) { resourceName := "aws_ecs_service.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ecs.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckServiceDestroy(ctx), @@ -533,7 +533,7 @@ func TestAccECSService_DeploymentValues_basic(t *testing.T) { resourceName := "aws_ecs_service.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ecs.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckServiceDestroy(ctx), @@ -558,7 +558,7 @@ func TestAccECSService_DeploymentValues_minZeroMaxOneHundred(t *testing.T) { resourceName := "aws_ecs_service.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ecs.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckServiceDestroy(ctx), @@ -582,7 +582,7 @@ func TestAccECSService_deploymentCircuitBreaker(t *testing.T) { resourceName := "aws_ecs_service.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ecs.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckServiceDestroy(ctx), @@ -608,7 +608,7 @@ func TestAccECSService_loadBalancerChanges(t *testing.T) { resourceName := "aws_ecs_service.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ecs.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckServiceDestroy(ctx), @@ -638,7 +638,7 @@ func TestAccECSService_clusterName(t *testing.T) { resourceName := "aws_ecs_service.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ecs.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckServiceDestroy(ctx), @@ -661,7 +661,7 @@ func TestAccECSService_alb(t *testing.T) { resourceName := "aws_ecs_service.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ecs.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckServiceDestroy(ctx), @@ -684,7 +684,7 @@ func TestAccECSService_multipleTargetGroups(t *testing.T) { resourceName := "aws_ecs_service.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ecs.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckServiceDestroy(ctx), @@ -707,7 +707,7 @@ func TestAccECSService_forceNewDeployment(t *testing.T) { resourceName := "aws_ecs_service.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ecs.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckServiceDestroy(ctx), @@ -740,7 +740,7 @@ func TestAccECSService_forceNewDeploymentTriggers(t *testing.T) { resourceName := "aws_ecs_service.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ecs.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckServiceDestroy(ctx), @@ -777,7 +777,7 @@ func TestAccECSService_PlacementStrategy_basic(t *testing.T) { resourceName := "aws_ecs_service.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ecs.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckServiceDestroy(ctx), @@ -831,7 +831,7 @@ func TestAccECSService_PlacementStrategy_missing(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ecs.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckServiceDestroy(ctx), @@ -851,7 +851,7 @@ func TestAccECSService_PlacementConstraints_basic(t *testing.T) { resourceName := "aws_ecs_service.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ecs.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckServiceDestroy(ctx), @@ -882,7 +882,7 @@ func TestAccECSService_PlacementConstraints_emptyExpression(t *testing.T) { resourceName := "aws_ecs_service.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ecs.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckServiceDestroy(ctx), @@ -905,7 +905,7 @@ func TestAccECSService_LaunchTypeFargate_basic(t *testing.T) { resourceName := "aws_ecs_service.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ecs.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckServiceDestroy(ctx), @@ -946,7 +946,7 @@ func TestAccECSService_LaunchTypeFargate_platformVersion(t *testing.T) { resourceName := "aws_ecs_service.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ecs.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckServiceDestroy(ctx), @@ -983,7 +983,7 @@ func TestAccECSService_LaunchTypeFargate_waitForSteadyState(t *testing.T) { resourceName := "aws_ecs_service.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ecs.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckServiceDestroy(ctx), @@ -1017,7 +1017,7 @@ func TestAccECSService_LaunchTypeFargate_updateWaitForSteadyState(t *testing.T) resourceName := "aws_ecs_service.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ecs.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckServiceDestroy(ctx), @@ -1059,7 +1059,7 @@ func TestAccECSService_LaunchTypeEC2_network(t *testing.T) { resourceName := "aws_ecs_service.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ecs.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckServiceDestroy(ctx), @@ -1093,7 +1093,7 @@ func TestAccECSService_DaemonSchedulingStrategy_basic(t *testing.T) { resourceName := "aws_ecs_service.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ecs.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckServiceDestroy(ctx), @@ -1116,7 +1116,7 @@ func TestAccECSService_DaemonSchedulingStrategy_setDeploymentMinimum(t *testing. resourceName := "aws_ecs_service.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ecs.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckServiceDestroy(ctx), @@ -1139,7 +1139,7 @@ func TestAccECSService_replicaSchedulingStrategy(t *testing.T) { resourceName := "aws_ecs_service.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ecs.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckServiceDestroy(ctx), @@ -1162,7 +1162,7 @@ func TestAccECSService_ServiceRegistries_basic(t *testing.T) { resourceName := "aws_ecs_service.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(servicediscovery.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(servicediscovery.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, ecs.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckServiceDestroy(ctx), @@ -1185,7 +1185,7 @@ func TestAccECSService_ServiceRegistries_container(t *testing.T) { resourceName := "aws_ecs_service.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(servicediscovery.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(servicediscovery.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, ecs.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckServiceDestroy(ctx), @@ -1214,7 +1214,7 @@ func TestAccECSService_ServiceRegistries_changes(t *testing.T) { } resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(servicediscovery.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(servicediscovery.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, ecs.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckServiceDestroy(ctx), @@ -1244,7 +1244,7 @@ func TestAccECSService_ServiceConnect_basic(t *testing.T) { resourceName := "aws_ecs_service.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ecs.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckServiceDestroy(ctx), @@ -1267,7 +1267,7 @@ func TestAccECSService_ServiceConnect_full(t *testing.T) { resourceName := "aws_ecs_service.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ecs.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckServiceDestroy(ctx), @@ -1290,7 +1290,7 @@ func TestAccECSService_ServiceConnect_ingressPortOverride(t *testing.T) { resourceName := "aws_ecs_service.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ecs.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckServiceDestroy(ctx), @@ -1323,7 +1323,7 @@ func TestAccECSService_ServiceConnect_remove(t *testing.T) { resourceName := "aws_ecs_service.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ecs.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckServiceDestroy(ctx), @@ -1354,7 +1354,7 @@ func TestAccECSService_Tags_basic(t *testing.T) { resourceName := "aws_ecs_service.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ecs.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckServiceDestroy(ctx), @@ -1404,7 +1404,7 @@ func TestAccECSService_Tags_managed(t *testing.T) { resourceName := "aws_ecs_service.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ecs.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckServiceDestroy(ctx), @@ -1428,7 +1428,7 @@ func TestAccECSService_Tags_propagate(t *testing.T) { resourceName := "aws_ecs_service.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ecs.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckServiceDestroy(ctx), @@ -1466,7 +1466,7 @@ func TestAccECSService_executeCommand(t *testing.T) { resourceName := "aws_ecs_service.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ecs.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckServiceDestroy(ctx), diff --git a/internal/service/ecs/tag_test.go b/internal/service/ecs/tag_test.go index 694b6e94cd7f..0e8f04b79327 100644 --- a/internal/service/ecs/tag_test.go +++ b/internal/service/ecs/tag_test.go @@ -20,7 +20,7 @@ func TestAccECSTag_basic(t *testing.T) { resourceName := "aws_ecs_tag.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ecs.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTagDestroy(ctx), @@ -48,7 +48,7 @@ func TestAccECSTag_disappears(t *testing.T) { resourceName := "aws_ecs_tag.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ecs.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTagDestroy(ctx), @@ -72,7 +72,7 @@ func TestAccECSTag_ResourceARN_batchComputeEnvironment(t *testing.T) { resourceName := "aws_ecs_tag.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckBatch(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckBatch(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ecs.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTagDestroy(ctx), @@ -98,7 +98,7 @@ func TestAccECSTag_value(t *testing.T) { resourceName := "aws_ecs_tag.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ecs.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTagDestroy(ctx), diff --git a/internal/service/ecs/task_definition_data_source_test.go b/internal/service/ecs/task_definition_data_source_test.go index 52c915e49602..d41ae79afaf8 100644 --- a/internal/service/ecs/task_definition_data_source_test.go +++ b/internal/service/ecs/task_definition_data_source_test.go @@ -16,7 +16,7 @@ func TestAccECSTaskDefinitionDataSource_ecsTaskDefinition(t *testing.T) { rName := fmt.Sprintf("tf-acc-test-%s", sdkacctest.RandString(5)) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ecs.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ diff --git a/internal/service/ecs/task_definition_test.go b/internal/service/ecs/task_definition_test.go index 60d66f89a528..f2e01f93538e 100644 --- a/internal/service/ecs/task_definition_test.go +++ b/internal/service/ecs/task_definition_test.go @@ -35,7 +35,7 @@ func TestAccECSTaskDefinition_basic(t *testing.T) { resourceName := "aws_ecs_task_definition.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ecs.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTaskDefinitionDestroy(ctx), @@ -74,7 +74,7 @@ func TestAccECSTaskDefinition_scratchVolume(t *testing.T) { resourceName := "aws_ecs_task_definition.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ecs.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTaskDefinitionDestroy(ctx), @@ -104,7 +104,7 @@ func TestAccECSTaskDefinition_DockerVolume_basic(t *testing.T) { resourceName := "aws_ecs_task_definition.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ecs.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTaskDefinitionDestroy(ctx), @@ -148,7 +148,7 @@ func TestAccECSTaskDefinition_DockerVolume_minimal(t *testing.T) { resourceName := "aws_ecs_task_definition.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ecs.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTaskDefinitionDestroy(ctx), @@ -184,7 +184,7 @@ func TestAccECSTaskDefinition_runtimePlatform(t *testing.T) { resourceName := "aws_ecs_task_definition.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartition(t, endpoints.AwsPartitionID) }, // runtime platform not support on GovCloud + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartition(t, endpoints.AwsPartitionID) }, // runtime platform not support on GovCloud ErrorCheck: acctest.ErrorCheck(t, ecs.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTaskDefinitionDestroy(ctx), @@ -219,7 +219,7 @@ func TestAccECSTaskDefinition_Fargate_runtimePlatform(t *testing.T) { resourceName := "aws_ecs_task_definition.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartition(t, endpoints.AwsPartitionID) }, // runtime platform not support on GovCloud + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartition(t, endpoints.AwsPartitionID) }, // runtime platform not support on GovCloud ErrorCheck: acctest.ErrorCheck(t, ecs.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTaskDefinitionDestroy(ctx), @@ -254,7 +254,7 @@ func TestAccECSTaskDefinition_Fargate_runtimePlatformWithoutArch(t *testing.T) { resourceName := "aws_ecs_task_definition.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartition(t, endpoints.AwsPartitionID) }, // runtime platform not support on GovCloud + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartition(t, endpoints.AwsPartitionID) }, // runtime platform not support on GovCloud ErrorCheck: acctest.ErrorCheck(t, ecs.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTaskDefinitionDestroy(ctx), @@ -288,7 +288,7 @@ func TestAccECSTaskDefinition_EFSVolume_minimal(t *testing.T) { resourceName := "aws_ecs_task_definition.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ecs.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTaskDefinitionDestroy(ctx), @@ -324,7 +324,7 @@ func TestAccECSTaskDefinition_EFSVolume_basic(t *testing.T) { resourceName := "aws_ecs_task_definition.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ecs.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTaskDefinitionDestroy(ctx), @@ -360,7 +360,7 @@ func TestAccECSTaskDefinition_EFSVolume_transitEncryption(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resourceName := "aws_ecs_task_definition.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ecs.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTaskDefinitionDestroy(ctx), @@ -399,7 +399,7 @@ func TestAccECSTaskDefinition_EFSVolume_accessPoint(t *testing.T) { resourceName := "aws_ecs_task_definition.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ecs.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTaskDefinitionDestroy(ctx), @@ -451,7 +451,7 @@ func TestAccECSTaskDefinition_fsxWinFileSystem(t *testing.T) { } resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ecs.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTaskDefinitionDestroy(ctx), @@ -491,7 +491,7 @@ func TestAccECSTaskDefinition_DockerVolume_taskScoped(t *testing.T) { resourceName := "aws_ecs_task_definition.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ecs.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTaskDefinitionDestroy(ctx), @@ -525,7 +525,7 @@ func TestAccECSTaskDefinition_service(t *testing.T) { resourceName := "aws_ecs_task_definition.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ecs.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTaskDefinitionDestroy(ctx), @@ -563,7 +563,7 @@ func TestAccECSTaskDefinition_taskRoleARN(t *testing.T) { resourceName := "aws_ecs_task_definition.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ecs.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTaskDefinitionDestroy(ctx), @@ -593,7 +593,7 @@ func TestAccECSTaskDefinition_networkMode(t *testing.T) { resourceName := "aws_ecs_task_definition.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ecs.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTaskDefinitionDestroy(ctx), @@ -624,7 +624,7 @@ func TestAccECSTaskDefinition_ipcMode(t *testing.T) { resourceName := "aws_ecs_task_definition.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ecs.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTaskDefinitionDestroy(ctx), @@ -655,7 +655,7 @@ func TestAccECSTaskDefinition_pidMode(t *testing.T) { resourceName := "aws_ecs_task_definition.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ecs.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTaskDefinitionDestroy(ctx), @@ -686,7 +686,7 @@ func TestAccECSTaskDefinition_constraint(t *testing.T) { resourceName := "aws_ecs_task_definition.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ecs.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTaskDefinitionDestroy(ctx), @@ -719,7 +719,7 @@ func TestAccECSTaskDefinition_changeVolumesForcesNewResource(t *testing.T) { resourceName := "aws_ecs_task_definition.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ecs.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTaskDefinitionDestroy(ctx), @@ -757,7 +757,7 @@ func TestAccECSTaskDefinition_arrays(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ecs.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTaskDefinitionDestroy(ctx), @@ -787,7 +787,7 @@ func TestAccECSTaskDefinition_Fargate_basic(t *testing.T) { resourceName := "aws_ecs_task_definition.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ecs.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTaskDefinitionDestroy(ctx), @@ -825,7 +825,7 @@ func TestAccECSTaskDefinition_Fargate_ephemeralStorage(t *testing.T) { resourceName := "aws_ecs_task_definition.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ecs.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTaskDefinitionDestroy(ctx), @@ -860,7 +860,7 @@ func TestAccECSTaskDefinition_executionRole(t *testing.T) { resourceName := "aws_ecs_task_definition.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ecs.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTaskDefinitionDestroy(ctx), @@ -891,7 +891,7 @@ func TestAccECSTaskDefinition_disappears(t *testing.T) { resourceName := "aws_ecs_task_definition.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ecs.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTaskDefinitionDestroy(ctx), @@ -919,7 +919,7 @@ func TestAccECSTaskDefinition_tags(t *testing.T) { resourceName := "aws_ecs_task_definition.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ecs.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTaskDefinitionDestroy(ctx), @@ -977,7 +977,7 @@ func TestAccECSTaskDefinition_proxy(t *testing.T) { egressIgnoredIPs := "169.254.170.2,169.254.169.254" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ecs.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTaskDefinitionDestroy(ctx), @@ -1008,7 +1008,7 @@ func TestAccECSTaskDefinition_inferenceAccelerator(t *testing.T) { resourceName := "aws_ecs_task_definition.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ecs.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTaskDefinitionDestroy(ctx), @@ -1036,7 +1036,7 @@ func TestAccECSTaskDefinition_invalidContainerDefinition(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ecs.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTaskDefinitionDestroy(ctx), diff --git a/internal/service/ecs/task_set_test.go b/internal/service/ecs/task_set_test.go index 0963dc9415ca..1029c21caf21 100644 --- a/internal/service/ecs/task_set_test.go +++ b/internal/service/ecs/task_set_test.go @@ -23,7 +23,7 @@ func TestAccECSTaskSet_basic(t *testing.T) { resourceName := "aws_ecs_task_set.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ecs.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTaskSetDestroy(ctx), @@ -57,7 +57,7 @@ func TestAccECSTaskSet_withExternalId(t *testing.T) { resourceName := "aws_ecs_task_set.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ecs.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTaskSetDestroy(ctx), @@ -89,7 +89,7 @@ func TestAccECSTaskSet_withScale(t *testing.T) { resourceName := "aws_ecs_task_set.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ecs.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTaskSetDestroy(ctx), @@ -138,7 +138,7 @@ func TestAccECSTaskSet_disappears(t *testing.T) { resourceName := "aws_ecs_task_set.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ecs.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTaskSetDestroy(ctx), @@ -161,7 +161,7 @@ func TestAccECSTaskSet_withCapacityProviderStrategy(t *testing.T) { resourceName := "aws_ecs_task_set.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ecs.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTaskSetDestroy(ctx), @@ -204,7 +204,7 @@ func TestAccECSTaskSet_withMultipleCapacityProviderStrategies(t *testing.T) { resourceName := "aws_ecs_task_set.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ecs.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTaskSetDestroy(ctx), @@ -234,7 +234,7 @@ func TestAccECSTaskSet_withAlb(t *testing.T) { resourceName := "aws_ecs_task_set.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ecs.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTaskSetDestroy(ctx), @@ -264,7 +264,7 @@ func TestAccECSTaskSet_withLaunchTypeFargate(t *testing.T) { resourceName := "aws_ecs_task_set.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ecs.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTaskSetDestroy(ctx), @@ -299,7 +299,7 @@ func TestAccECSTaskSet_withLaunchTypeFargateAndPlatformVersion(t *testing.T) { resourceName := "aws_ecs_task_set.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ecs.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTaskSetDestroy(ctx), @@ -344,7 +344,7 @@ func TestAccECSTaskSet_withServiceRegistries(t *testing.T) { resourceName := "aws_ecs_task_set.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ecs.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTaskSetDestroy(ctx), @@ -374,7 +374,7 @@ func TestAccECSTaskSet_Tags(t *testing.T) { resourceName := "aws_ecs_task_set.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ecs.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTaskSetDestroy(ctx), From a1f7e91ac173ee72a05575da043674ec98108361 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Fri, 24 Feb 2023 16:36:52 -0500 Subject: [PATCH 143/763] Add 'Context' argument to 'acctest.PreCheck' for efs. --- .../efs/access_point_data_source_test.go | 2 +- internal/service/efs/access_point_test.go | 14 ++++++------- .../efs/access_points_data_source_test.go | 4 ++-- internal/service/efs/backup_policy_test.go | 6 +++--- .../efs/file_system_data_source_test.go | 12 +++++------ .../service/efs/file_system_policy_test.go | 10 +++++----- internal/service/efs/file_system_test.go | 20 +++++++++---------- .../efs/mount_target_data_source_test.go | 6 +++--- internal/service/efs/mount_target_test.go | 8 ++++---- .../efs/replication_configuration_test.go | 6 +++--- 10 files changed, 44 insertions(+), 44 deletions(-) diff --git a/internal/service/efs/access_point_data_source_test.go b/internal/service/efs/access_point_data_source_test.go index a329cf280829..05714bc06ffd 100644 --- a/internal/service/efs/access_point_data_source_test.go +++ b/internal/service/efs/access_point_data_source_test.go @@ -17,7 +17,7 @@ func TestAccEFSAccessPointDataSource_basic(t *testing.T) { resourceName := "aws_efs_access_point.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, efs.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckAccessPointDestroy(ctx), diff --git a/internal/service/efs/access_point_test.go b/internal/service/efs/access_point_test.go index 055acb69bfcd..915c54db2405 100644 --- a/internal/service/efs/access_point_test.go +++ b/internal/service/efs/access_point_test.go @@ -25,7 +25,7 @@ func TestAccEFSAccessPoint_basic(t *testing.T) { fsResourceName := "aws_efs_file_system.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, efs.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckAccessPointDestroy(ctx), @@ -60,7 +60,7 @@ func TestAccEFSAccessPoint_Root_directory(t *testing.T) { resourceName := "aws_efs_access_point.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, efs.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckAccessPointDestroy(ctx), @@ -90,7 +90,7 @@ func TestAccEFSAccessPoint_RootDirectoryCreation_info(t *testing.T) { resourceName := "aws_efs_access_point.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, efs.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckAccessPointDestroy(ctx), @@ -123,7 +123,7 @@ func TestAccEFSAccessPoint_POSIX_user(t *testing.T) { resourceName := "aws_efs_access_point.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, efs.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckAccessPointDestroy(ctx), @@ -154,7 +154,7 @@ func TestAccEFSAccessPoint_POSIXUserSecondary_gids(t *testing.T) { resourceName := "aws_efs_access_point.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, efs.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckAccessPointDestroy(ctx), @@ -184,7 +184,7 @@ func TestAccEFSAccessPoint_tags(t *testing.T) { resourceName := "aws_efs_access_point.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, efs.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckAccessPointDestroy(ctx), @@ -230,7 +230,7 @@ func TestAccEFSAccessPoint_disappears(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, efs.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckAccessPointDestroy(ctx), diff --git a/internal/service/efs/access_points_data_source_test.go b/internal/service/efs/access_points_data_source_test.go index 5ebaf5ea24d6..66a937283b48 100644 --- a/internal/service/efs/access_points_data_source_test.go +++ b/internal/service/efs/access_points_data_source_test.go @@ -13,7 +13,7 @@ func TestAccEFSAccessPointsDataSource_basic(t *testing.T) { dataSourceName := "data.aws_efs_access_points.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, efs.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckAccessPointDestroy(ctx), @@ -34,7 +34,7 @@ func TestAccEFSAccessPointsDataSource_empty(t *testing.T) { dataSourceName := "data.aws_efs_access_points.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, efs.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckAccessPointDestroy(ctx), diff --git a/internal/service/efs/backup_policy_test.go b/internal/service/efs/backup_policy_test.go index 910618878e58..5d6f8c993165 100644 --- a/internal/service/efs/backup_policy_test.go +++ b/internal/service/efs/backup_policy_test.go @@ -23,7 +23,7 @@ func TestAccEFSBackupPolicy_basic(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, efs.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckBackupPolicyDestroy(ctx), @@ -53,7 +53,7 @@ func TestAccEFSBackupPolicy_Disappears_fs(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, efs.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckBackupPolicyDestroy(ctx), @@ -77,7 +77,7 @@ func TestAccEFSBackupPolicy_update(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, efs.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckBackupPolicyDestroy(ctx), diff --git a/internal/service/efs/file_system_data_source_test.go b/internal/service/efs/file_system_data_source_test.go index 3c84602f6312..4ab9b342d4d6 100644 --- a/internal/service/efs/file_system_data_source_test.go +++ b/internal/service/efs/file_system_data_source_test.go @@ -17,7 +17,7 @@ func TestAccEFSFileSystemDataSource_id(t *testing.T) { resourceName := "aws_efs_file_system.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, efs.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ @@ -47,7 +47,7 @@ func TestAccEFSFileSystemDataSource_tags(t *testing.T) { resourceName := "aws_efs_file_system.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, efs.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ @@ -77,7 +77,7 @@ func TestAccEFSFileSystemDataSource_name(t *testing.T) { resourceName := "aws_efs_file_system.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, efs.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ @@ -107,7 +107,7 @@ func TestAccEFSFileSystemDataSource_availabilityZone(t *testing.T) { resourceName := "aws_efs_file_system.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, efs.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ @@ -125,7 +125,7 @@ func TestAccEFSFileSystemDataSource_availabilityZone(t *testing.T) { func TestAccEFSFileSystemDataSource_nonExistent_fileSystemID(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, efs.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ @@ -144,7 +144,7 @@ func TestAccEFSFileSystemDataSource_nonExistent_tags(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, efs.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ diff --git a/internal/service/efs/file_system_policy_test.go b/internal/service/efs/file_system_policy_test.go index 8e2aa717bbca..d0b4c1b1af8c 100644 --- a/internal/service/efs/file_system_policy_test.go +++ b/internal/service/efs/file_system_policy_test.go @@ -22,7 +22,7 @@ func TestAccEFSFileSystemPolicy_basic(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, efs.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckFileSystemPolicyDestroy(ctx), @@ -58,7 +58,7 @@ func TestAccEFSFileSystemPolicy_disappears(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, efs.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckFileSystemPolicyDestroy(ctx), @@ -82,7 +82,7 @@ func TestAccEFSFileSystemPolicy_policyBypass(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, efs.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckFileSystemPolicyDestroy(ctx), @@ -119,7 +119,7 @@ func TestAccEFSFileSystemPolicy_equivalentPolicies(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, efs.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckFileSystemPolicyDestroy(ctx), @@ -147,7 +147,7 @@ func TestAccEFSFileSystemPolicy_equivalentPoliciesIAMPolicyDoc(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, efs.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckFileSystemPolicyDestroy(ctx), diff --git a/internal/service/efs/file_system_test.go b/internal/service/efs/file_system_test.go index bf507115731d..280732b5dcac 100644 --- a/internal/service/efs/file_system_test.go +++ b/internal/service/efs/file_system_test.go @@ -22,7 +22,7 @@ func TestAccEFSFileSystem_basic(t *testing.T) { resourceName := "aws_efs_file_system.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, efs.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckFileSystemDestroy(ctx), @@ -62,7 +62,7 @@ func TestAccEFSFileSystem_disappears(t *testing.T) { resourceName := "aws_efs_file_system.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, efs.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckFileSystemDestroy(ctx), @@ -85,7 +85,7 @@ func TestAccEFSFileSystem_performanceMode(t *testing.T) { resourceName := "aws_efs_file_system.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, efs.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckFileSystemDestroy(ctx), @@ -113,7 +113,7 @@ func TestAccEFSFileSystem_availabilityZoneName(t *testing.T) { rName := sdkacctest.RandomWithPrefix("tf-acc") resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, efs.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckFileSystemDestroy(ctx), @@ -142,7 +142,7 @@ func TestAccEFSFileSystem_tags(t *testing.T) { resourceName := "aws_efs_file_system.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, efs.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckFileSystemDestroy(ctx), @@ -206,7 +206,7 @@ func TestAccEFSFileSystem_kmsKey(t *testing.T) { resourceName := "aws_efs_file_system.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, efs.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckFileSystemDestroy(ctx), @@ -233,7 +233,7 @@ func TestAccEFSFileSystem_kmsWithoutEncryption(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, efs.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckFileSystemDestroy(ctx), @@ -252,7 +252,7 @@ func TestAccEFSFileSystem_provisionedThroughputInMibps(t *testing.T) { resourceName := "aws_efs_file_system.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, efs.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckFileSystemDestroy(ctx), @@ -288,7 +288,7 @@ func TestAccEFSFileSystem_throughputMode(t *testing.T) { resourceName := "aws_efs_file_system.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, efs.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckFileSystemDestroy(ctx), @@ -324,7 +324,7 @@ func TestAccEFSFileSystem_lifecyclePolicy(t *testing.T) { resourceName := "aws_efs_file_system.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, efs.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckFileSystemDestroy(ctx), diff --git a/internal/service/efs/mount_target_data_source_test.go b/internal/service/efs/mount_target_data_source_test.go index ba7942ba9c15..6d03963e3f27 100644 --- a/internal/service/efs/mount_target_data_source_test.go +++ b/internal/service/efs/mount_target_data_source_test.go @@ -16,7 +16,7 @@ func TestAccEFSMountTargetDataSource_basic(t *testing.T) { resourceName := "aws_efs_mount_target.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, efs.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ @@ -46,7 +46,7 @@ func TestAccEFSMountTargetDataSource_byAccessPointID(t *testing.T) { resourceName := "aws_efs_mount_target.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, efs.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ @@ -76,7 +76,7 @@ func TestAccEFSMountTargetDataSource_byFileSystemID(t *testing.T) { resourceName := "aws_efs_mount_target.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, efs.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ diff --git a/internal/service/efs/mount_target_test.go b/internal/service/efs/mount_target_test.go index 1df1660234c4..e0f27494b651 100644 --- a/internal/service/efs/mount_target_test.go +++ b/internal/service/efs/mount_target_test.go @@ -24,7 +24,7 @@ func TestAccEFSMountTarget_basic(t *testing.T) { resourceName2 := "aws_efs_mount_target.test2" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, efs.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckMountTargetDestroy(ctx), @@ -68,7 +68,7 @@ func TestAccEFSMountTarget_disappears(t *testing.T) { resourceName := "aws_efs_mount_target.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, efs.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckMountTargetDestroy(ctx), @@ -92,7 +92,7 @@ func TestAccEFSMountTarget_ipAddress(t *testing.T) { resourceName := "aws_efs_mount_target.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, efs.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckMountTargetDestroy(ctx), @@ -121,7 +121,7 @@ func TestAccEFSMountTarget_IPAddress_emptyString(t *testing.T) { resourceName := "aws_efs_mount_target.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, efs.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckMountTargetDestroy(ctx), diff --git a/internal/service/efs/replication_configuration_test.go b/internal/service/efs/replication_configuration_test.go index d2674ce8525d..69792d1fe959 100644 --- a/internal/service/efs/replication_configuration_test.go +++ b/internal/service/efs/replication_configuration_test.go @@ -28,7 +28,7 @@ func TestAccEFSReplicationConfiguration_basic(t *testing.T) { var providers []*schema.Provider resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, efs.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: acctest.CheckWithProviders(testAccCheckReplicationConfigurationDestroyWithProvider(ctx), &providers), @@ -65,7 +65,7 @@ func TestAccEFSReplicationConfiguration_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckMultipleRegion(t, 2) }, ErrorCheck: acctest.ErrorCheck(t, efs.EndpointsID), @@ -98,7 +98,7 @@ func TestAccEFSReplicationConfiguration_allAttributes(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckMultipleRegion(t, 2) }, ErrorCheck: acctest.ErrorCheck(t, efs.EndpointsID), From 9f4795ce56e57b928fd1257b78de835fc492ca13 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Fri, 24 Feb 2023 16:36:53 -0500 Subject: [PATCH 144/763] Add 'Context' argument to 'acctest.PreCheck' for eks. --- .../service/eks/addon_data_source_test.go | 4 +- internal/service/eks/addon_test.go | 34 ++++++------- .../eks/addon_version_data_source_test.go | 2 +- .../eks/cluster_auth_data_source_test.go | 2 +- .../service/eks/cluster_data_source_test.go | 4 +- internal/service/eks/cluster_test.go | 32 ++++++------ .../service/eks/clusters_data_source_test.go | 2 +- internal/service/eks/fargate_profile_test.go | 10 ++-- .../eks/identity_provider_config_test.go | 8 +-- .../eks/node_group_data_source_test.go | 2 +- internal/service/eks/node_group_test.go | 50 +++++++++---------- .../eks/node_groups_data_source_test.go | 2 +- 12 files changed, 76 insertions(+), 76 deletions(-) diff --git a/internal/service/eks/addon_data_source_test.go b/internal/service/eks/addon_data_source_test.go index b11bca0eb79d..b894067b8fb2 100644 --- a/internal/service/eks/addon_data_source_test.go +++ b/internal/service/eks/addon_data_source_test.go @@ -18,7 +18,7 @@ func TestAccEKSAddonDataSource_basic(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), @@ -49,7 +49,7 @@ func TestAccEKSAddonDataSource_configurationValues(t *testing.T) { configurationValues := "{\"env\": {\"WARM_ENI_TARGET\":\"2\",\"ENABLE_POD_ENI\":\"true\"},\"resources\": {\"limits\":{\"cpu\":\"100m\",\"memory\":\"100Mi\"},\"requests\":{\"cpu\":\"100m\",\"memory\":\"100Mi\"}}}" 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), diff --git a/internal/service/eks/addon_test.go b/internal/service/eks/addon_test.go index 27937c4c6373..7e46f7feb291 100644 --- a/internal/service/eks/addon_test.go +++ b/internal/service/eks/addon_test.go @@ -26,7 +26,7 @@ func TestAccEKSAddon_basic(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), @@ -61,7 +61,7 @@ func TestAccEKSAddon_disappears(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), @@ -87,7 +87,7 @@ func TestAccEKSAddon_Disappears_cluster(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), @@ -114,7 +114,7 @@ func TestAccEKSAddon_addonVersion(t *testing.T) { addonVersion2 := "v1.9.0-eksbuild.1" 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), @@ -151,7 +151,7 @@ func TestAccEKSAddon_preserve(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), @@ -181,7 +181,7 @@ func TestAccEKSAddon_resolveConflicts(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), @@ -226,7 +226,7 @@ func TestAccEKSAddon_serviceAccountRoleARN(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), @@ -260,7 +260,7 @@ func TestAccEKSAddon_configurationValues(t *testing.T) { addonVersion := "v1.10.4-eksbuild.1" 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), @@ -308,7 +308,7 @@ func TestAccEKSAddon_tags(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), @@ -355,7 +355,7 @@ func TestAccEKSAddon_DefaultTags_providerOnly(t *testing.T) { addonName := "vpc-cni" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, eks.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckAddonDestroy(ctx), @@ -414,7 +414,7 @@ func TestAccEKSAddon_DefaultTags_updateToProviderOnly(t *testing.T) { addonName := "vpc-cni" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, eks.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckAddonDestroy(ctx), @@ -458,7 +458,7 @@ func TestAccEKSAddon_DefaultTags_updateToResourceOnly(t *testing.T) { addonName := "vpc-cni" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, eks.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckAddonDestroy(ctx), @@ -502,7 +502,7 @@ func TestAccEKSAddon_DefaultTagsProviderAndResource_nonOverlappingTag(t *testing addonName := "vpc-cni" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, eks.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckAddonDestroy(ctx), @@ -568,7 +568,7 @@ func TestAccEKSAddon_DefaultTagsProviderAndResource_overlappingTag(t *testing.T) addonName := "vpc-cni" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, eks.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckAddonDestroy(ctx), @@ -627,7 +627,7 @@ func TestAccEKSAddon_DefaultTagsProviderAndResource_duplicateTag(t *testing.T) { addonName := "vpc-cni" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, eks.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: nil, @@ -652,7 +652,7 @@ func TestAccEKSAddon_defaultAndIgnoreTags(t *testing.T) { addonName := "vpc-cni" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, eks.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckAddonDestroy(ctx), @@ -691,7 +691,7 @@ func TestAccEKSAddon_ignoreTags(t *testing.T) { addonName := "vpc-cni" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, eks.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckAddonDestroy(ctx), diff --git a/internal/service/eks/addon_version_data_source_test.go b/internal/service/eks/addon_version_data_source_test.go index 2ac719866816..bc60c30884ff 100644 --- a/internal/service/eks/addon_version_data_source_test.go +++ b/internal/service/eks/addon_version_data_source_test.go @@ -19,7 +19,7 @@ func TestAccEKSAddonVersionDataSource_basic(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), diff --git a/internal/service/eks/cluster_auth_data_source_test.go b/internal/service/eks/cluster_auth_data_source_test.go index 29f014695b29..12bf6b96296c 100644 --- a/internal/service/eks/cluster_auth_data_source_test.go +++ b/internal/service/eks/cluster_auth_data_source_test.go @@ -15,7 +15,7 @@ func TestAccEKSClusterAuthDataSource_basic(t *testing.T) { dataSourceResourceName := "data.aws_eks_cluster_auth.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, eks.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ diff --git a/internal/service/eks/cluster_data_source_test.go b/internal/service/eks/cluster_data_source_test.go index 52865a5aeeaa..66ea5119e73c 100644 --- a/internal/service/eks/cluster_data_source_test.go +++ b/internal/service/eks/cluster_data_source_test.go @@ -17,7 +17,7 @@ func TestAccEKSClusterDataSource_basic(t *testing.T) { resourceName := "aws_eks_cluster.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, eks.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClusterDestroy(ctx), @@ -66,7 +66,7 @@ func TestAccEKSClusterDataSource_outpost(t *testing.T) { resourceName := "aws_eks_cluster.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckOutpostsOutposts(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckOutpostsOutposts(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, eks.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClusterDestroy(ctx), diff --git a/internal/service/eks/cluster_test.go b/internal/service/eks/cluster_test.go index 75baf037867d..3d7bc88bd509 100644 --- a/internal/service/eks/cluster_test.go +++ b/internal/service/eks/cluster_test.go @@ -31,7 +31,7 @@ func TestAccEKSCluster_basic(t *testing.T) { resourceName := "aws_eks_cluster.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, eks.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClusterDestroy(ctx), @@ -81,7 +81,7 @@ func TestAccEKSCluster_disappears(t *testing.T) { resourceName := "aws_eks_cluster.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, eks.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClusterDestroy(ctx), @@ -106,7 +106,7 @@ func TestAccEKSCluster_Encryption_create(t *testing.T) { kmsKeyResourceName := "aws_kms_key.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, eks.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClusterDestroy(ctx), @@ -138,7 +138,7 @@ func TestAccEKSCluster_Encryption_update(t *testing.T) { kmsKeyResourceName := "aws_kms_key.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, eks.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClusterDestroy(ctx), @@ -179,7 +179,7 @@ func TestAccEKSCluster_Encryption_versionUpdate(t *testing.T) { kmsKeyResourceName := "aws_kms_key.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, eks.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClusterDestroy(ctx), @@ -223,7 +223,7 @@ func TestAccEKSCluster_version(t *testing.T) { resourceName := "aws_eks_cluster.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, eks.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClusterDestroy(ctx), @@ -259,7 +259,7 @@ func TestAccEKSCluster_logging(t *testing.T) { resourceName := "aws_eks_cluster.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, eks.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClusterDestroy(ctx), @@ -307,7 +307,7 @@ func TestAccEKSCluster_tags(t *testing.T) { resourceName := "aws_eks_cluster.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, eks.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClusterDestroy(ctx), @@ -353,7 +353,7 @@ func TestAccEKSCluster_VPC_securityGroupIDs(t *testing.T) { resourceName := "aws_eks_cluster.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, eks.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClusterDestroy(ctx), @@ -382,7 +382,7 @@ func TestAccEKSCluster_VPC_endpointPrivateAccess(t *testing.T) { resourceName := "aws_eks_cluster.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, eks.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClusterDestroy(ctx), @@ -429,7 +429,7 @@ func TestAccEKSCluster_VPC_endpointPublicAccess(t *testing.T) { resourceName := "aws_eks_cluster.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, eks.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClusterDestroy(ctx), @@ -476,7 +476,7 @@ func TestAccEKSCluster_VPC_publicAccessCIDRs(t *testing.T) { resourceName := "aws_eks_cluster.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, eks.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClusterDestroy(ctx), @@ -513,7 +513,7 @@ func TestAccEKSCluster_Network_serviceIPv4CIDR(t *testing.T) { resourceName := "aws_eks_cluster.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, eks.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClusterDestroy(ctx), @@ -576,7 +576,7 @@ func TestAccEKSCluster_Network_ipFamily(t *testing.T) { resourceName := "aws_eks_cluster.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, eks.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClusterDestroy(ctx), @@ -628,7 +628,7 @@ func TestAccEKSCluster_Outpost_create(t *testing.T) { controlPlaneInstanceType := "m5d.large" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckOutpostsOutposts(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckOutpostsOutposts(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, eks.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClusterDestroy(ctx), @@ -660,7 +660,7 @@ func TestAccEKSCluster_Outpost_placement(t *testing.T) { controlPlaneInstanceType := "m5d.large" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckOutpostsOutposts(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckOutpostsOutposts(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, eks.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClusterDestroy(ctx), diff --git a/internal/service/eks/clusters_data_source_test.go b/internal/service/eks/clusters_data_source_test.go index d1ba0e50cf62..0360105eadaa 100644 --- a/internal/service/eks/clusters_data_source_test.go +++ b/internal/service/eks/clusters_data_source_test.go @@ -15,7 +15,7 @@ func TestAccEKSClustersDataSource_basic(t *testing.T) { dataSourceResourceName := "data.aws_eks_clusters.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, eks.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClusterDestroy(ctx), diff --git a/internal/service/eks/fargate_profile_test.go b/internal/service/eks/fargate_profile_test.go index 24644a9e5f76..a009b1190410 100644 --- a/internal/service/eks/fargate_profile_test.go +++ b/internal/service/eks/fargate_profile_test.go @@ -26,7 +26,7 @@ func TestAccEKSFargateProfile_basic(t *testing.T) { resourceName := "aws_eks_fargate_profile.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t); testAccPreCheckFargateProfile(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t); testAccPreCheckFargateProfile(t) }, ErrorCheck: acctest.ErrorCheck(t, eks.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckFargateProfileDestroy(ctx), @@ -61,7 +61,7 @@ func TestAccEKSFargateProfile_disappears(t *testing.T) { resourceName := "aws_eks_fargate_profile.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t); testAccPreCheckFargateProfile(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t); testAccPreCheckFargateProfile(t) }, ErrorCheck: acctest.ErrorCheck(t, eks.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckFargateProfileDestroy(ctx), @@ -86,7 +86,7 @@ func TestAccEKSFargateProfile_Multi_profile(t *testing.T) { resourceName2 := "aws_eks_fargate_profile.test.1" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t); testAccPreCheckFargateProfile(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t); testAccPreCheckFargateProfile(t) }, ErrorCheck: acctest.ErrorCheck(t, eks.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckFargateProfileDestroy(ctx), @@ -109,7 +109,7 @@ func TestAccEKSFargateProfile_Selector_labels(t *testing.T) { resourceName := "aws_eks_fargate_profile.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t); testAccPreCheckFargateProfile(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t); testAccPreCheckFargateProfile(t) }, ErrorCheck: acctest.ErrorCheck(t, eks.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckFargateProfileDestroy(ctx), @@ -136,7 +136,7 @@ func TestAccEKSFargateProfile_tags(t *testing.T) { resourceName := "aws_eks_fargate_profile.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t); testAccPreCheckFargateProfile(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t); testAccPreCheckFargateProfile(t) }, ErrorCheck: acctest.ErrorCheck(t, eks.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckFargateProfileDestroy(ctx), diff --git a/internal/service/eks/identity_provider_config_test.go b/internal/service/eks/identity_provider_config_test.go index e2a4c593e9ab..951825d47fd3 100644 --- a/internal/service/eks/identity_provider_config_test.go +++ b/internal/service/eks/identity_provider_config_test.go @@ -24,7 +24,7 @@ func TestAccEKSIdentityProviderConfig_basic(t *testing.T) { resourceName := "aws_eks_identity_provider_config.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, eks.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckIdentityProviderConfigDestroy(ctx), @@ -67,7 +67,7 @@ func TestAccEKSIdentityProviderConfig_disappears(t *testing.T) { resourceName := "aws_eks_identity_provider_config.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, eks.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckIdentityProviderConfigDestroy(ctx), @@ -91,7 +91,7 @@ func TestAccEKSIdentityProviderConfig_allOIDCOptions(t *testing.T) { resourceName := "aws_eks_identity_provider_config.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, eks.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckIdentityProviderConfigDestroy(ctx), @@ -129,7 +129,7 @@ func TestAccEKSIdentityProviderConfig_tags(t *testing.T) { resourceName := "aws_eks_identity_provider_config.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, eks.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckIdentityProviderConfigDestroy(ctx), diff --git a/internal/service/eks/node_group_data_source_test.go b/internal/service/eks/node_group_data_source_test.go index 98c26fdb35ac..9c37948a68f2 100644 --- a/internal/service/eks/node_group_data_source_test.go +++ b/internal/service/eks/node_group_data_source_test.go @@ -18,7 +18,7 @@ func TestAccEKSNodeGroupDataSource_basic(t *testing.T) { resourceName := "aws_eks_node_group.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, eks.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClusterDestroy(ctx), diff --git a/internal/service/eks/node_group_test.go b/internal/service/eks/node_group_test.go index 5071d5220bba..391b8309609d 100644 --- a/internal/service/eks/node_group_test.go +++ b/internal/service/eks/node_group_test.go @@ -30,7 +30,7 @@ func TestAccEKSNodeGroup_basic(t *testing.T) { resourceName := "aws_eks_node_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, eks.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckNodeGroupDestroy(ctx), @@ -81,7 +81,7 @@ func TestAccEKSNodeGroup_Name_generated(t *testing.T) { resourceName := "aws_eks_node_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, eks.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckNodeGroupDestroy(ctx), @@ -110,7 +110,7 @@ func TestAccEKSNodeGroup_namePrefix(t *testing.T) { resourceName := "aws_eks_node_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, eks.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckNodeGroupDestroy(ctx), @@ -139,7 +139,7 @@ func TestAccEKSNodeGroup_disappears(t *testing.T) { resourceName := "aws_eks_node_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, eks.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckNodeGroupDestroy(ctx), @@ -163,7 +163,7 @@ func TestAccEKSNodeGroup_amiType(t *testing.T) { resourceName := "aws_eks_node_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, eks.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckNodeGroupDestroy(ctx), @@ -198,7 +198,7 @@ func TestAccEKSNodeGroup_CapacityType_spot(t *testing.T) { resourceName := "aws_eks_node_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, eks.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckNodeGroupDestroy(ctx), @@ -226,7 +226,7 @@ func TestAccEKSNodeGroup_diskSize(t *testing.T) { resourceName := "aws_eks_node_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, eks.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckNodeGroupDestroy(ctx), @@ -254,7 +254,7 @@ func TestAccEKSNodeGroup_forceUpdateVersion(t *testing.T) { resourceName := "aws_eks_node_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, eks.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckNodeGroupDestroy(ctx), @@ -291,7 +291,7 @@ func TestAccEKSNodeGroup_InstanceTypes_multiple(t *testing.T) { instanceTypes := fmt.Sprintf("%q, %q, %q, %q", "t2.medium", "t3.medium", "t2.large", "t3.large") resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, eks.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckNodeGroupDestroy(ctx), @@ -323,7 +323,7 @@ func TestAccEKSNodeGroup_InstanceTypes_single(t *testing.T) { resourceName := "aws_eks_node_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, eks.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckNodeGroupDestroy(ctx), @@ -351,7 +351,7 @@ func TestAccEKSNodeGroup_labels(t *testing.T) { resourceName := "aws_eks_node_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, eks.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckNodeGroupDestroy(ctx), @@ -399,7 +399,7 @@ func TestAccEKSNodeGroup_LaunchTemplate_id(t *testing.T) { resourceName := "aws_eks_node_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, eks.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckNodeGroupDestroy(ctx), @@ -439,7 +439,7 @@ func TestAccEKSNodeGroup_LaunchTemplate_name(t *testing.T) { resourceName := "aws_eks_node_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, eks.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckNodeGroupDestroy(ctx), @@ -478,7 +478,7 @@ func TestAccEKSNodeGroup_LaunchTemplate_version(t *testing.T) { resourceName := "aws_eks_node_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, eks.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckNodeGroupDestroy(ctx), @@ -517,7 +517,7 @@ func TestAccEKSNodeGroup_releaseVersion(t *testing.T) { resourceName := "aws_eks_node_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, eks.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckNodeGroupDestroy(ctx), @@ -558,7 +558,7 @@ func TestAccEKSNodeGroup_RemoteAccess_ec2SSHKey(t *testing.T) { } resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, eks.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckNodeGroupDestroy(ctx), @@ -592,7 +592,7 @@ func TestAccEKSNodeGroup_RemoteAccess_sourceSecurityGroupIDs(t *testing.T) { } resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, eks.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckNodeGroupDestroy(ctx), @@ -621,7 +621,7 @@ func TestAccEKSNodeGroup_Scaling_desiredSize(t *testing.T) { resourceName := "aws_eks_node_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, eks.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckNodeGroupDestroy(ctx), @@ -663,7 +663,7 @@ func TestAccEKSNodeGroup_Scaling_maxSize(t *testing.T) { resourceName := "aws_eks_node_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, eks.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckNodeGroupDestroy(ctx), @@ -705,7 +705,7 @@ func TestAccEKSNodeGroup_Scaling_minSize(t *testing.T) { resourceName := "aws_eks_node_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, eks.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckNodeGroupDestroy(ctx), @@ -747,7 +747,7 @@ func TestAccEKSNodeGroup_ScalingZeroDesiredSize_minSize(t *testing.T) { resourceName := "aws_eks_node_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, eks.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckNodeGroupDestroy(ctx), @@ -799,7 +799,7 @@ func TestAccEKSNodeGroup_tags(t *testing.T) { resourceName := "aws_eks_node_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, eks.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckNodeGroupDestroy(ctx), @@ -847,7 +847,7 @@ func TestAccEKSNodeGroup_taints(t *testing.T) { resourceName := "aws_eks_node_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, eks.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckNodeGroupDestroy(ctx), @@ -911,7 +911,7 @@ func TestAccEKSNodeGroup_update(t *testing.T) { resourceName := "aws_eks_node_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, eks.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckNodeGroupDestroy(ctx), @@ -950,7 +950,7 @@ func TestAccEKSNodeGroup_version(t *testing.T) { resourceName := "aws_eks_node_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, eks.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckNodeGroupDestroy(ctx), diff --git a/internal/service/eks/node_groups_data_source_test.go b/internal/service/eks/node_groups_data_source_test.go index be659541e705..bda88c8c31d6 100644 --- a/internal/service/eks/node_groups_data_source_test.go +++ b/internal/service/eks/node_groups_data_source_test.go @@ -16,7 +16,7 @@ func TestAccEKSNodeGroupsDataSource_basic(t *testing.T) { dataSourceResourceName := "data.aws_eks_node_groups.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, eks.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClusterDestroy(ctx), From 518a616eacec1c659636305beac868685633f6d7 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Fri, 24 Feb 2023 16:36:53 -0500 Subject: [PATCH 145/763] Add 'Context' argument to 'acctest.PreCheck' for elasticache. --- .../elasticache/cluster_data_source_test.go | 4 +- internal/service/elasticache/cluster_test.go | 68 +++++------ .../global_replication_group_test.go | 74 ++++++------ .../elasticache/parameter_group_test.go | 20 ++-- .../replication_group_data_source_test.go | 10 +- .../elasticache/replication_group_test.go | 108 +++++++++--------- .../subnet_group_data_source_test.go | 2 +- .../service/elasticache/subnet_group_test.go | 8 +- .../elasticache/user_data_source_test.go | 2 +- .../user_group_association_test.go | 8 +- .../service/elasticache/user_group_test.go | 8 +- internal/service/elasticache/user_test.go | 8 +- 12 files changed, 160 insertions(+), 160 deletions(-) diff --git a/internal/service/elasticache/cluster_data_source_test.go b/internal/service/elasticache/cluster_data_source_test.go index d99d57d235d2..a1228b405cbc 100644 --- a/internal/service/elasticache/cluster_data_source_test.go +++ b/internal/service/elasticache/cluster_data_source_test.go @@ -20,7 +20,7 @@ func TestAccElastiCacheClusterDataSource_Data_basic(t *testing.T) { dataSourceName := "data.aws_elasticache_cluster.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elasticache.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ @@ -52,7 +52,7 @@ func TestAccElastiCacheClusterDataSource_Engine_Redis_LogDeliveryConfigurations( dataSourceName := "data.aws_elasticache_cluster.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elasticache.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ diff --git a/internal/service/elasticache/cluster_test.go b/internal/service/elasticache/cluster_test.go index 755b8d2ec9f8..4e7dd5d4d6d8 100644 --- a/internal/service/elasticache/cluster_test.go +++ b/internal/service/elasticache/cluster_test.go @@ -41,7 +41,7 @@ func TestAccElastiCacheCluster_Engine_memcached(t *testing.T) { resourceName := "aws_elasticache_cluster.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elasticache.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClusterDestroy(ctx), @@ -80,7 +80,7 @@ func TestAccElastiCacheCluster_Engine_redis(t *testing.T) { resourceName := "aws_elasticache_cluster.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elasticache.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClusterDestroy(ctx), @@ -124,7 +124,7 @@ func TestAccElastiCacheCluster_Engine_redis_v5(t *testing.T) { resourceName := "aws_elasticache_cluster.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elasticache.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClusterDestroy(ctx), @@ -156,7 +156,7 @@ func TestAccElastiCacheCluster_Engine_None(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elasticache.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClusterDestroy(ctx), @@ -181,7 +181,7 @@ func TestAccElastiCacheCluster_PortRedis_default(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elasticache.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClusterDestroy(ctx), @@ -209,7 +209,7 @@ func TestAccElastiCacheCluster_ParameterGroupName_default(t *testing.T) { resourceName := "aws_elasticache_cluster.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elasticache.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClusterDestroy(ctx), @@ -247,7 +247,7 @@ func TestAccElastiCacheCluster_ipDiscovery(t *testing.T) { resourceName := "aws_elasticache_cluster.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elasticache.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClusterDestroy(ctx), @@ -284,7 +284,7 @@ func TestAccElastiCacheCluster_port(t *testing.T) { resourceName := "aws_elasticache_cluster.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elasticache.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClusterDestroy(ctx), @@ -322,7 +322,7 @@ func TestAccElastiCacheCluster_snapshotsWithUpdates(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elasticache.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClusterDestroy(ctx), @@ -358,7 +358,7 @@ func TestAccElastiCacheCluster_NumCacheNodes_decrease(t *testing.T) { resourceName := "aws_elasticache_cluster.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elasticache.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClusterDestroy(ctx), @@ -392,7 +392,7 @@ func TestAccElastiCacheCluster_NumCacheNodes_increase(t *testing.T) { resourceName := "aws_elasticache_cluster.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elasticache.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClusterDestroy(ctx), @@ -426,7 +426,7 @@ func TestAccElastiCacheCluster_NumCacheNodes_increaseWithPreferredAvailabilityZo resourceName := "aws_elasticache_cluster.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elasticache.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClusterDestroy(ctx), @@ -462,7 +462,7 @@ func TestAccElastiCacheCluster_vpc(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elasticache.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClusterDestroy(ctx), @@ -490,7 +490,7 @@ func TestAccElastiCacheCluster_multiAZInVPC(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elasticache.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClusterDestroy(ctx), @@ -518,7 +518,7 @@ func TestAccElastiCacheCluster_AZMode_memcached(t *testing.T) { resourceName := "aws_elasticache_cluster.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elasticache.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClusterDestroy(ctx), @@ -557,7 +557,7 @@ func TestAccElastiCacheCluster_AZMode_redis(t *testing.T) { resourceName := "aws_elasticache_cluster.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elasticache.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClusterDestroy(ctx), @@ -592,7 +592,7 @@ func TestAccElastiCacheCluster_EngineVersion_memcached(t *testing.T) { resourceName := "aws_elasticache_cluster.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elasticache.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClusterDestroy(ctx), @@ -638,7 +638,7 @@ func TestAccElastiCacheCluster_EngineVersion_redis(t *testing.T) { resourceName := "aws_elasticache_cluster.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elasticache.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClusterDestroy(ctx), @@ -729,7 +729,7 @@ func TestAccElastiCacheCluster_NodeTypeResize_memcached(t *testing.T) { resourceName := "aws_elasticache_cluster.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elasticache.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClusterDestroy(ctx), @@ -764,7 +764,7 @@ func TestAccElastiCacheCluster_NodeTypeResize_redis(t *testing.T) { resourceName := "aws_elasticache_cluster.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elasticache.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClusterDestroy(ctx), @@ -793,7 +793,7 @@ func TestAccElastiCacheCluster_NumCacheNodes_redis(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elasticache.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClusterDestroy(ctx), @@ -819,7 +819,7 @@ func TestAccElastiCacheCluster_ReplicationGroupID_availabilityZone(t *testing.T) replicationGroupResourceName := "aws_elasticache_replication_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elasticache.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClusterDestroy(ctx), @@ -849,7 +849,7 @@ func TestAccElastiCacheCluster_ReplicationGroupID_singleReplica(t *testing.T) { replicationGroupResourceName := "aws_elasticache_replication_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elasticache.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClusterDestroy(ctx), @@ -883,7 +883,7 @@ func TestAccElastiCacheCluster_ReplicationGroupID_multipleReplica(t *testing.T) replicationGroupResourceName := "aws_elasticache_replication_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elasticache.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClusterDestroy(ctx), @@ -915,7 +915,7 @@ func TestAccElastiCacheCluster_Memcached_finalSnapshot(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elasticache.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClusterDestroy(ctx), @@ -939,7 +939,7 @@ func TestAccElastiCacheCluster_Redis_finalSnapshot(t *testing.T) { resourceName := "aws_elasticache_cluster.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elasticache.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClusterDestroy(ctx), @@ -966,7 +966,7 @@ func TestAccElastiCacheCluster_Redis_autoMinorVersionUpgrade(t *testing.T) { resourceName := "aws_elasticache_cluster.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elasticache.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClusterDestroy(ctx), @@ -1008,7 +1008,7 @@ func TestAccElastiCacheCluster_Engine_Redis_LogDeliveryConfigurations(t *testing resourceName := "aws_elasticache_cluster.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elasticache.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClusterDestroy(ctx), @@ -1136,7 +1136,7 @@ func TestAccElastiCacheCluster_tags(t *testing.T) { resourceName := "aws_elasticache_cluster.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elasticache.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClusterDestroy(ctx), @@ -1194,7 +1194,7 @@ func TestAccElastiCacheCluster_tagWithOtherModification(t *testing.T) { resourceName := "aws_elasticache_cluster.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elasticache.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClusterDestroy(ctx), @@ -1236,7 +1236,7 @@ func TestAccElastiCacheCluster_outpost_memcached(t *testing.T) { resourceName := "aws_elasticache_cluster.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckOutpostsOutposts(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckOutpostsOutposts(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elasticache.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClusterDestroy(ctx), @@ -1276,7 +1276,7 @@ func TestAccElastiCacheCluster_outpost_redis(t *testing.T) { resourceName := "aws_elasticache_cluster.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckOutpostsOutposts(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckOutpostsOutposts(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elasticache.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClusterDestroy(ctx), @@ -1316,7 +1316,7 @@ func TestAccElastiCacheCluster_outpostID_memcached(t *testing.T) { resourceName := "aws_elasticache_cluster.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckOutpostsOutposts(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckOutpostsOutposts(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elasticache.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClusterDestroy(ctx), @@ -1349,7 +1349,7 @@ func TestAccElastiCacheCluster_outpostID_redis(t *testing.T) { resourceName := "aws_elasticache_cluster.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckOutpostsOutposts(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckOutpostsOutposts(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elasticache.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClusterDestroy(ctx), diff --git a/internal/service/elasticache/global_replication_group_test.go b/internal/service/elasticache/global_replication_group_test.go index 8b6cbfb8bf67..24a17fe4bad1 100644 --- a/internal/service/elasticache/global_replication_group_test.go +++ b/internal/service/elasticache/global_replication_group_test.go @@ -35,7 +35,7 @@ func TestAccElastiCacheGlobalReplicationGroup_basic(t *testing.T) { primaryReplicationGroupResourceName := "aws_elasticache_replication_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckGlobalReplicationGroup(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckGlobalReplicationGroup(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elasticache.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: resource.ComposeAggregateTestCheckFunc( @@ -87,7 +87,7 @@ func TestAccElastiCacheGlobalReplicationGroup_disappears(t *testing.T) { resourceName := "aws_elasticache_global_replication_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckGlobalReplicationGroup(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckGlobalReplicationGroup(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elasticache.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckGlobalReplicationGroupDestroy(ctx), @@ -118,7 +118,7 @@ func TestAccElastiCacheGlobalReplicationGroup_description(t *testing.T) { resourceName := "aws_elasticache_global_replication_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckGlobalReplicationGroup(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckGlobalReplicationGroup(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elasticache.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckGlobalReplicationGroupDestroy(ctx), @@ -159,7 +159,7 @@ func TestAccElastiCacheGlobalReplicationGroup_nodeType_createNoChange(t *testing resourceName := "aws_elasticache_global_replication_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckGlobalReplicationGroup(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckGlobalReplicationGroup(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elasticache.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckGlobalReplicationGroupDestroy(ctx), @@ -194,7 +194,7 @@ func TestAccElastiCacheGlobalReplicationGroup_nodeType_createWithChange(t *testi resourceName := "aws_elasticache_global_replication_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckGlobalReplicationGroup(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckGlobalReplicationGroup(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elasticache.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckGlobalReplicationGroupDestroy(ctx), @@ -229,7 +229,7 @@ func TestAccElastiCacheGlobalReplicationGroup_nodeType_setNoChange(t *testing.T) primaryReplicationGroupResourceName := "aws_elasticache_replication_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckGlobalReplicationGroup(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckGlobalReplicationGroup(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elasticache.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckGlobalReplicationGroupDestroy(ctx), @@ -271,7 +271,7 @@ func TestAccElastiCacheGlobalReplicationGroup_nodeType_update(t *testing.T) { resourceName := "aws_elasticache_global_replication_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckGlobalReplicationGroup(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckGlobalReplicationGroup(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elasticache.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckGlobalReplicationGroupDestroy(ctx), @@ -312,7 +312,7 @@ func TestAccElastiCacheGlobalReplicationGroup_automaticFailover_createNoChange(t resourceName := "aws_elasticache_global_replication_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckGlobalReplicationGroup(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckGlobalReplicationGroup(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elasticache.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckGlobalReplicationGroupDestroy(ctx), @@ -347,7 +347,7 @@ func TestAccElastiCacheGlobalReplicationGroup_automaticFailover_createWithChange resourceName := "aws_elasticache_global_replication_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckGlobalReplicationGroup(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckGlobalReplicationGroup(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elasticache.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckGlobalReplicationGroupDestroy(ctx), @@ -382,7 +382,7 @@ func TestAccElastiCacheGlobalReplicationGroup_automaticFailover_setNoChange(t *t primaryReplicationGroupResourceName := "aws_elasticache_replication_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckGlobalReplicationGroup(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckGlobalReplicationGroup(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elasticache.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckGlobalReplicationGroupDestroy(ctx), @@ -424,7 +424,7 @@ func TestAccElastiCacheGlobalReplicationGroup_automaticFailover_update(t *testin resourceName := "aws_elasticache_global_replication_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckGlobalReplicationGroup(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckGlobalReplicationGroup(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elasticache.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckGlobalReplicationGroupDestroy(ctx), @@ -464,7 +464,7 @@ func TestAccElastiCacheGlobalReplicationGroup_multipleSecondaries(t *testing.T) resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckMultipleRegion(t, 3) }, ErrorCheck: acctest.ErrorCheck(t, elasticache.EndpointsID), @@ -493,7 +493,7 @@ func TestAccElastiCacheGlobalReplicationGroup_ReplaceSecondary_differentRegion(t resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckMultipleRegion(t, 3) }, ErrorCheck: acctest.ErrorCheck(t, elasticache.EndpointsID), @@ -531,7 +531,7 @@ func TestAccElastiCacheGlobalReplicationGroup_clusterMode_basic(t *testing.T) { primaryReplicationGroupResourceName := "aws_elasticache_replication_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckGlobalReplicationGroup(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckGlobalReplicationGroup(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elasticache.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckGlobalReplicationGroupDestroy(ctx), @@ -571,7 +571,7 @@ func TestAccElastiCacheGlobalReplicationGroup_SetNumNodeGroupsOnCreate_NoChange( primaryReplicationGroupResourceName := "aws_elasticache_replication_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckGlobalReplicationGroup(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckGlobalReplicationGroup(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elasticache.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckGlobalReplicationGroupDestroy(ctx), @@ -611,7 +611,7 @@ func TestAccElastiCacheGlobalReplicationGroup_SetNumNodeGroupsOnCreate_Increase( primaryReplicationGroupResourceName := "aws_elasticache_replication_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckGlobalReplicationGroup(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckGlobalReplicationGroup(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elasticache.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckGlobalReplicationGroupDestroy(ctx), @@ -660,7 +660,7 @@ func TestAccElastiCacheGlobalReplicationGroup_SetNumNodeGroupsOnCreate_Decrease( primaryReplicationGroupResourceName := "aws_elasticache_replication_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckGlobalReplicationGroup(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckGlobalReplicationGroup(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elasticache.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckGlobalReplicationGroupDestroy(ctx), @@ -704,7 +704,7 @@ func TestAccElastiCacheGlobalReplicationGroup_SetNumNodeGroupsOnUpdate_Increase( primaryReplicationGroupResourceName := "aws_elasticache_replication_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckGlobalReplicationGroup(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckGlobalReplicationGroup(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elasticache.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckGlobalReplicationGroupDestroy(ctx), @@ -770,7 +770,7 @@ func TestAccElastiCacheGlobalReplicationGroup_SetNumNodeGroupsOnUpdate_Decrease( primaryReplicationGroupResourceName := "aws_elasticache_replication_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckGlobalReplicationGroup(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckGlobalReplicationGroup(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elasticache.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckGlobalReplicationGroupDestroy(ctx), @@ -828,7 +828,7 @@ func TestAccElastiCacheGlobalReplicationGroup_SetEngineVersionOnCreate_NoChange_ resourceName := "aws_elasticache_global_replication_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckGlobalReplicationGroup(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckGlobalReplicationGroup(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elasticache.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckGlobalReplicationGroupDestroy(ctx), @@ -861,7 +861,7 @@ func TestAccElastiCacheGlobalReplicationGroup_SetEngineVersionOnCreate_NoChange_ resourceName := "aws_elasticache_global_replication_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckGlobalReplicationGroup(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckGlobalReplicationGroup(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elasticache.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckGlobalReplicationGroupDestroy(ctx), @@ -895,7 +895,7 @@ func TestAccElastiCacheGlobalReplicationGroup_SetEngineVersionOnCreate_NoChange_ resourceName := "aws_elasticache_global_replication_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckGlobalReplicationGroup(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckGlobalReplicationGroup(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elasticache.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckGlobalReplicationGroupDestroy(ctx), @@ -931,7 +931,7 @@ func TestAccElastiCacheGlobalReplicationGroup_SetEngineVersionOnCreate_MinorUpgr primaryReplicationGroupResourceName := "aws_elasticache_replication_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckGlobalReplicationGroup(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckGlobalReplicationGroup(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elasticache.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckGlobalReplicationGroupDestroy(ctx), @@ -969,7 +969,7 @@ func TestAccElastiCacheGlobalReplicationGroup_SetEngineVersionOnCreate_MinorUpgr primaryReplicationGroupResourceName := "aws_elasticache_replication_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckGlobalReplicationGroup(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckGlobalReplicationGroup(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elasticache.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckGlobalReplicationGroupDestroy(ctx), @@ -1002,7 +1002,7 @@ func TestAccElastiCacheGlobalReplicationGroup_SetEngineVersionOnCreate_MajorUpgr primaryReplicationGroupResourceName := "aws_elasticache_replication_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckGlobalReplicationGroup(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckGlobalReplicationGroup(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elasticache.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckGlobalReplicationGroupDestroy(ctx), @@ -1041,7 +1041,7 @@ func TestAccElastiCacheGlobalReplicationGroup_SetEngineVersionOnCreate_MajorUpgr primaryReplicationGroupResourceName := "aws_elasticache_replication_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckGlobalReplicationGroup(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckGlobalReplicationGroup(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elasticache.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckGlobalReplicationGroupDestroy(ctx), @@ -1075,7 +1075,7 @@ func TestAccElastiCacheGlobalReplicationGroup_SetEngineVersionOnCreate_MinorDown primaryReplicationGroupId := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckGlobalReplicationGroup(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckGlobalReplicationGroup(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elasticache.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckGlobalReplicationGroupDestroy(ctx), @@ -1094,7 +1094,7 @@ func TestAccElastiCacheGlobalReplicationGroup_SetParameterGroupOnCreate_NoVersio primaryReplicationGroupId := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckGlobalReplicationGroup(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckGlobalReplicationGroup(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elasticache.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckGlobalReplicationGroupDestroy(ctx), @@ -1114,7 +1114,7 @@ func TestAccElastiCacheGlobalReplicationGroup_SetParameterGroupOnCreate_MinorUpg primaryReplicationGroupId := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckGlobalReplicationGroup(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckGlobalReplicationGroup(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elasticache.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckGlobalReplicationGroupDestroy(ctx), @@ -1140,7 +1140,7 @@ func TestAccElastiCacheGlobalReplicationGroup_SetEngineVersionOnUpdate_MinorUpgr primaryReplicationGroupResourceName := "aws_elasticache_replication_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckGlobalReplicationGroup(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckGlobalReplicationGroup(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elasticache.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckGlobalReplicationGroupDestroy(ctx), @@ -1177,7 +1177,7 @@ func TestAccElastiCacheGlobalReplicationGroup_SetEngineVersionOnUpdate_MinorUpgr primaryReplicationGroupResourceName := "aws_elasticache_replication_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckGlobalReplicationGroup(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckGlobalReplicationGroup(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elasticache.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckGlobalReplicationGroupDestroy(ctx), @@ -1211,7 +1211,7 @@ func TestAccElastiCacheGlobalReplicationGroup_SetEngineVersionOnUpdate_MinorDown primaryReplicationGroupResourceName := "aws_elasticache_replication_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckGlobalReplicationGroup(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckGlobalReplicationGroup(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elasticache.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckGlobalReplicationGroupDestroy(ctx), @@ -1258,7 +1258,7 @@ func TestAccElastiCacheGlobalReplicationGroup_SetEngineVersionOnUpdate_MajorUpgr primaryReplicationGroupResourceName := "aws_elasticache_replication_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckGlobalReplicationGroup(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckGlobalReplicationGroup(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elasticache.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckGlobalReplicationGroupDestroy(ctx), @@ -1300,7 +1300,7 @@ func TestAccElastiCacheGlobalReplicationGroup_SetEngineVersionOnUpdate_MajorUpgr primaryReplicationGroupResourceName := "aws_elasticache_replication_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckGlobalReplicationGroup(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckGlobalReplicationGroup(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elasticache.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckGlobalReplicationGroupDestroy(ctx), @@ -1343,7 +1343,7 @@ func TestAccElastiCacheGlobalReplicationGroup_SetParameterGroupOnUpdate_NoVersio resourceName := "aws_elasticache_global_replication_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckGlobalReplicationGroup(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckGlobalReplicationGroup(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elasticache.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckGlobalReplicationGroupDestroy(ctx), @@ -1378,7 +1378,7 @@ func TestAccElastiCacheGlobalReplicationGroup_SetParameterGroupOnUpdate_MinorUpg resourceName := "aws_elasticache_global_replication_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckGlobalReplicationGroup(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckGlobalReplicationGroup(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elasticache.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckGlobalReplicationGroupDestroy(ctx), @@ -1414,7 +1414,7 @@ func TestAccElastiCacheGlobalReplicationGroup_UpdateParameterGroupName(t *testin resourceName := "aws_elasticache_global_replication_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckGlobalReplicationGroup(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckGlobalReplicationGroup(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elasticache.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckGlobalReplicationGroupDestroy(ctx), diff --git a/internal/service/elasticache/parameter_group_test.go b/internal/service/elasticache/parameter_group_test.go index ed702e4687c9..283f7bdd3631 100644 --- a/internal/service/elasticache/parameter_group_test.go +++ b/internal/service/elasticache/parameter_group_test.go @@ -25,7 +25,7 @@ func TestAccElastiCacheParameterGroup_basic(t *testing.T) { rName := fmt.Sprintf("parameter-group-test-terraform-%d", sdkacctest.RandInt()) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elasticache.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckParameterGroupDestroy(ctx), @@ -57,7 +57,7 @@ func TestAccElastiCacheParameterGroup_addParameter(t *testing.T) { rName := fmt.Sprintf("parameter-group-test-terraform-%d", sdkacctest.RandInt()) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elasticache.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckParameterGroupDestroy(ctx), @@ -105,7 +105,7 @@ func TestAccElastiCacheParameterGroup_removeAllParameters(t *testing.T) { rName := fmt.Sprintf("parameter-group-test-terraform-%d", sdkacctest.RandInt()) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elasticache.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckParameterGroupDestroy(ctx), @@ -145,7 +145,7 @@ func TestAccElastiCacheParameterGroup_RemoveReservedMemoryParameter_allParameter rName := fmt.Sprintf("parameter-group-test-terraform-%d", sdkacctest.RandInt()) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elasticache.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckParameterGroupDestroy(ctx), @@ -186,7 +186,7 @@ func TestAccElastiCacheParameterGroup_RemoveReservedMemoryParameter_remainingPar rName := fmt.Sprintf("parameter-group-test-terraform-%d", sdkacctest.RandInt()) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elasticache.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckParameterGroupDestroy(ctx), @@ -235,7 +235,7 @@ func TestAccElastiCacheParameterGroup_switchReservedMemoryParameter(t *testing.T rName := fmt.Sprintf("parameter-group-test-terraform-%d", sdkacctest.RandInt()) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elasticache.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckParameterGroupDestroy(ctx), @@ -280,7 +280,7 @@ func TestAccElastiCacheParameterGroup_updateReservedMemoryParameter(t *testing.T rName := fmt.Sprintf("parameter-group-test-terraform-%d", sdkacctest.RandInt()) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elasticache.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckParameterGroupDestroy(ctx), @@ -324,7 +324,7 @@ func TestAccElastiCacheParameterGroup_uppercaseName(t *testing.T) { rName := fmt.Sprintf("TF-ELASTIPG-%d", rInt) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elasticache.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckParameterGroupDestroy(ctx), @@ -352,7 +352,7 @@ func TestAccElastiCacheParameterGroup_description(t *testing.T) { rName := fmt.Sprintf("parameter-group-test-terraform-%d", sdkacctest.RandInt()) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elasticache.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckParameterGroupDestroy(ctx), @@ -380,7 +380,7 @@ func TestAccElastiCacheParameterGroup_tags(t *testing.T) { rName := fmt.Sprintf("parameter-group-test-terraform-%d", sdkacctest.RandInt()) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elasticache.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckParameterGroupDestroy(ctx), diff --git a/internal/service/elasticache/replication_group_data_source_test.go b/internal/service/elasticache/replication_group_data_source_test.go index 6b83e898235e..c2c536a0ce18 100644 --- a/internal/service/elasticache/replication_group_data_source_test.go +++ b/internal/service/elasticache/replication_group_data_source_test.go @@ -21,7 +21,7 @@ func TestAccElastiCacheReplicationGroupDataSource_basic(t *testing.T) { dataSourceName := "data.aws_elasticache_replication_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elasticache.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ @@ -59,7 +59,7 @@ func TestAccElastiCacheReplicationGroupDataSource_clusterMode(t *testing.T) { dataSourceName := "data.aws_elasticache_replication_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elasticache.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ @@ -92,7 +92,7 @@ func TestAccElastiCacheReplicationGroupDataSource_multiAZ(t *testing.T) { dataSourceName := "data.aws_elasticache_replication_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elasticache.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ @@ -109,7 +109,7 @@ func TestAccElastiCacheReplicationGroupDataSource_multiAZ(t *testing.T) { func TestAccElastiCacheReplicationGroupDataSource_nonExistent(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elasticache.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ @@ -130,7 +130,7 @@ func TestAccElastiCacheReplicationGroupDataSource_Engine_Redis_LogDeliveryConfig dataSourceName := "data.aws_elasticache_replication_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elasticache.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ diff --git a/internal/service/elasticache/replication_group_test.go b/internal/service/elasticache/replication_group_test.go index 6c638aabec90..6ba84324991d 100644 --- a/internal/service/elasticache/replication_group_test.go +++ b/internal/service/elasticache/replication_group_test.go @@ -32,7 +32,7 @@ func TestAccElastiCacheReplicationGroup_basic(t *testing.T) { resourceName := "aws_elasticache_replication_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elasticache.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckReplicationGroupDestroy(ctx), @@ -79,7 +79,7 @@ func TestAccElastiCacheReplicationGroup_basic_v5(t *testing.T) { resourceName := "aws_elasticache_replication_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elasticache.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckReplicationGroupDestroy(ctx), @@ -116,7 +116,7 @@ func TestAccElastiCacheReplicationGroup_uppercase(t *testing.T) { resourceName := "aws_elasticache_replication_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elasticache.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckReplicationGroupDestroy(ctx), @@ -149,7 +149,7 @@ func TestAccElastiCacheReplicationGroup_EngineVersion_update(t *testing.T) { resourceName := "aws_elasticache_replication_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elasticache.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckReplicationGroupDestroy(ctx), @@ -252,7 +252,7 @@ func TestAccElastiCacheReplicationGroup_disappears(t *testing.T) { resourceName := "aws_elasticache_replication_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elasticache.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckReplicationGroupDestroy(ctx), @@ -280,7 +280,7 @@ func TestAccElastiCacheReplicationGroup_updateDescription(t *testing.T) { resourceName := "aws_elasticache_replication_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elasticache.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckReplicationGroupDestroy(ctx), @@ -322,7 +322,7 @@ func TestAccElastiCacheReplicationGroup_updateMaintenanceWindow(t *testing.T) { resourceName := "aws_elasticache_replication_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elasticache.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckReplicationGroupDestroy(ctx), @@ -364,7 +364,7 @@ func TestAccElastiCacheReplicationGroup_updateUserGroups(t *testing.T) { resourceName := "aws_elasticache_replication_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elasticache.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckReplicationGroupDestroy(ctx), @@ -406,7 +406,7 @@ func TestAccElastiCacheReplicationGroup_updateNodeSize(t *testing.T) { resourceName := "aws_elasticache_replication_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elasticache.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckReplicationGroupDestroy(ctx), @@ -451,7 +451,7 @@ func TestAccElastiCacheReplicationGroup_updateParameterGroup(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elasticache.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckReplicationGroupDestroy(ctx), @@ -491,7 +491,7 @@ func TestAccElastiCacheReplicationGroup_updateAuthToken(t *testing.T) { resourceName := "aws_elasticache_replication_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elasticache.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckReplicationGroupDestroy(ctx), @@ -530,7 +530,7 @@ func TestAccElastiCacheReplicationGroup_vpc(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elasticache.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckReplicationGroupDestroy(ctx), @@ -564,7 +564,7 @@ func TestAccElastiCacheReplicationGroup_depecatedAvailabilityZones_vpc(t *testin rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elasticache.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckReplicationGroupDestroy(ctx), @@ -598,7 +598,7 @@ func TestAccElastiCacheReplicationGroup_multiAzNotInVPC(t *testing.T) { resourceName := "aws_elasticache_replication_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elasticache.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckReplicationGroupDestroy(ctx), @@ -637,7 +637,7 @@ func TestAccElastiCacheReplicationGroup_multiAzNotInVPC_repeated(t *testing.T) { resourceName := "aws_elasticache_replication_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elasticache.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckReplicationGroupDestroy(ctx), @@ -678,7 +678,7 @@ func TestAccElastiCacheReplicationGroup_deprecatedAvailabilityZones_multiAzNotIn resourceName := "aws_elasticache_replication_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elasticache.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckReplicationGroupDestroy(ctx), @@ -733,7 +733,7 @@ func TestAccElastiCacheReplicationGroup_multiAzInVPC(t *testing.T) { resourceName := "aws_elasticache_replication_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elasticache.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckReplicationGroupDestroy(ctx), @@ -778,7 +778,7 @@ func TestAccElastiCacheReplicationGroup_deprecatedAvailabilityZones_multiAzInVPC resourceName := "aws_elasticache_replication_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elasticache.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckReplicationGroupDestroy(ctx), @@ -817,7 +817,7 @@ func TestAccElastiCacheReplicationGroup_ValidationMultiAz_noAutomaticFailover(t rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elasticache.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckReplicationGroupDestroy(ctx), @@ -841,7 +841,7 @@ func TestAccElastiCacheReplicationGroup_ClusterMode_basic(t *testing.T) { resourceName := "aws_elasticache_replication_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elasticache.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckReplicationGroupDestroy(ctx), @@ -884,7 +884,7 @@ func TestAccElastiCacheReplicationGroup_ClusterMode_nonClusteredParameterGroup(t resourceName := "aws_elasticache_replication_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elasticache.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckReplicationGroupDestroy(ctx), @@ -926,7 +926,7 @@ func TestAccElastiCacheReplicationGroup_ClusterModeUpdateNumNodeGroups_scaleUp(t clusterDataSourcePrefix := "data.aws_elasticache_cluster.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elasticache.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckReplicationGroupDestroy(ctx), @@ -977,7 +977,7 @@ func TestAccElastiCacheReplicationGroup_ClusterModeUpdateNumNodeGroups_scaleDown resourceName := "aws_elasticache_replication_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elasticache.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckReplicationGroupDestroy(ctx), @@ -1023,7 +1023,7 @@ func TestAccElastiCacheReplicationGroup_ClusterMode_updateReplicasPerNodeGroup(t resourceName := "aws_elasticache_replication_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elasticache.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckReplicationGroupDestroy(ctx), @@ -1082,7 +1082,7 @@ func TestAccElastiCacheReplicationGroup_ClusterModeUpdateNumNodeGroupsAndReplica resourceName := "aws_elasticache_replication_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elasticache.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckReplicationGroupDestroy(ctx), @@ -1128,7 +1128,7 @@ func TestAccElastiCacheReplicationGroup_ClusterModeUpdateNumNodeGroupsAndReplica resourceName := "aws_elasticache_replication_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elasticache.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckReplicationGroupDestroy(ctx), @@ -1174,7 +1174,7 @@ func TestAccElastiCacheReplicationGroup_ClusterMode_singleNode(t *testing.T) { resourceName := "aws_elasticache_replication_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elasticache.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckReplicationGroupDestroy(ctx), @@ -1209,7 +1209,7 @@ func TestAccElastiCacheReplicationGroup_clusteringAndCacheNodesCausesError(t *te rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elasticache.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckReplicationGroupDestroy(ctx), @@ -1233,7 +1233,7 @@ func TestAccElastiCacheReplicationGroup_enableSnapshotting(t *testing.T) { resourceName := "aws_elasticache_replication_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elasticache.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckReplicationGroupDestroy(ctx), @@ -1273,7 +1273,7 @@ func TestAccElastiCacheReplicationGroup_enableAuthTokenTransitEncryption(t *test resourceName := "aws_elasticache_replication_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elasticache.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckReplicationGroupDestroy(ctx), @@ -1306,7 +1306,7 @@ func TestAccElastiCacheReplicationGroup_enableAtRestEncryption(t *testing.T) { resourceName := "aws_elasticache_replication_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elasticache.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckReplicationGroupDestroy(ctx), @@ -1338,7 +1338,7 @@ func TestAccElastiCacheReplicationGroup_useCMKKMSKeyID(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resourceName := "aws_elasticache_replication_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elasticache.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckReplicationGroupDestroy(ctx), @@ -1366,7 +1366,7 @@ func TestAccElastiCacheReplicationGroup_NumberCacheClusters_basic(t *testing.T) clusterDataSourcePrefix := "data.aws_elasticache_cluster.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elasticache.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckReplicationGroupDestroy(ctx), @@ -1434,7 +1434,7 @@ func TestAccElastiCacheReplicationGroup_NumberCacheClustersFailover_autoFailover multiAZEnabled := false resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elasticache.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckReplicationGroupDestroy(ctx), @@ -1492,7 +1492,7 @@ func TestAccElastiCacheReplicationGroup_NumberCacheClustersFailover_autoFailover multiAZEnabled := false resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elasticache.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckReplicationGroupDestroy(ctx), @@ -1555,7 +1555,7 @@ func TestAccElastiCacheReplicationGroup_NumberCacheClusters_multiAZEnabled(t *te multiAZEnabled := true resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elasticache.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckReplicationGroupDestroy(ctx), @@ -1615,7 +1615,7 @@ func TestAccElastiCacheReplicationGroup_NumberCacheClustersMemberClusterDisappea resourceName := "aws_elasticache_replication_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elasticache.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckReplicationGroupDestroy(ctx), @@ -1666,7 +1666,7 @@ func TestAccElastiCacheReplicationGroup_NumberCacheClustersMemberClusterDisappea resourceName := "aws_elasticache_replication_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elasticache.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckReplicationGroupDestroy(ctx), @@ -1717,7 +1717,7 @@ func TestAccElastiCacheReplicationGroup_NumberCacheClustersMemberClusterDisappea resourceName := "aws_elasticache_replication_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elasticache.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckReplicationGroupDestroy(ctx), @@ -1768,7 +1768,7 @@ func TestAccElastiCacheReplicationGroup_NumberCacheClustersMemberClusterDisappea resourceName := "aws_elasticache_replication_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elasticache.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckReplicationGroupDestroy(ctx), @@ -1820,7 +1820,7 @@ func TestAccElastiCacheReplicationGroup_tags(t *testing.T) { clusterDataSourcePrefix := "data.aws_elasticache_cluster.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elasticache.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckReplicationGroupDestroy(ctx), @@ -1875,7 +1875,7 @@ func TestAccElastiCacheReplicationGroup_tagWithOtherModification(t *testing.T) { clusterDataSourcePrefix := "data.aws_elasticache_cluster.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elasticache.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckReplicationGroupDestroy(ctx), @@ -1915,7 +1915,7 @@ func TestAccElastiCacheReplicationGroup_finalSnapshot(t *testing.T) { resourceName := "aws_elasticache_replication_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elasticache.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckReplicationGroupDestroy(ctx), @@ -1942,7 +1942,7 @@ func TestAccElastiCacheReplicationGroup_autoMinorVersionUpgrade(t *testing.T) { resourceName := "aws_elasticache_replication_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elasticache.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClusterDestroy(ctx), @@ -1979,7 +1979,7 @@ func TestAccElastiCacheReplicationGroup_Validation_noNodeType(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckMultipleRegion(t, 2) }, ErrorCheck: acctest.ErrorCheck(t, elasticache.EndpointsID), @@ -2004,7 +2004,7 @@ func TestAccElastiCacheReplicationGroup_Validation_globalReplicationGroupIdAndNo resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckMultipleRegion(t, 2) }, ErrorCheck: acctest.ErrorCheck(t, elasticache.EndpointsID), @@ -2033,7 +2033,7 @@ func TestAccElastiCacheReplicationGroup_GlobalReplicationGroupID_basic(t *testin resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckMultipleRegion(t, 2) }, ErrorCheck: acctest.ErrorCheck(t, elasticache.EndpointsID), @@ -2085,7 +2085,7 @@ func TestAccElastiCacheReplicationGroup_GlobalReplicationGroupID_full(t *testing resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckMultipleRegion(t, 2) }, ErrorCheck: acctest.ErrorCheck(t, elasticache.EndpointsID), @@ -2150,7 +2150,7 @@ func TestAccElastiCacheReplicationGroup_GlobalReplicationGroupID_disappears(t *t resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckMultipleRegion(t, 2) }, ErrorCheck: acctest.ErrorCheck(t, elasticache.EndpointsID), @@ -2183,7 +2183,7 @@ func TestAccElastiCacheReplicationGroup_GlobalReplicationGroupIDClusterMode_basi resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckMultipleRegion(t, 2) }, ErrorCheck: acctest.ErrorCheck(t, elasticache.EndpointsID), @@ -2245,7 +2245,7 @@ func TestAccElastiCacheReplicationGroup_GlobalReplicationGroupIDClusterModeValid resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckMultipleRegion(t, 2) }, ErrorCheck: acctest.ErrorCheck(t, elasticache.EndpointsID), @@ -2271,7 +2271,7 @@ func TestAccElastiCacheReplicationGroup_dataTiering(t *testing.T) { resourceName := "aws_elasticache_replication_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elasticache.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckReplicationGroupDestroy(ctx), @@ -2306,7 +2306,7 @@ func TestAccElastiCacheReplicationGroup_Engine_Redis_LogDeliveryConfigurations_C resourceName := "aws_elasticache_replication_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elasticache.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckReplicationGroupDestroy(ctx), @@ -2401,7 +2401,7 @@ func TestAccElastiCacheReplicationGroup_Engine_Redis_LogDeliveryConfigurations_C resourceName := "aws_elasticache_replication_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elasticache.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckReplicationGroupDestroy(ctx), diff --git a/internal/service/elasticache/subnet_group_data_source_test.go b/internal/service/elasticache/subnet_group_data_source_test.go index 6ef48c325155..c32233527ec1 100644 --- a/internal/service/elasticache/subnet_group_data_source_test.go +++ b/internal/service/elasticache/subnet_group_data_source_test.go @@ -23,7 +23,7 @@ func TestAccElastiCacheSubnetGroupDataSource_basic(t *testing.T) { dataSourceName := "data.aws_elasticache_subnet_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(t) }, ErrorCheck: acctest.ErrorCheck(t, elasticache.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ diff --git a/internal/service/elasticache/subnet_group_test.go b/internal/service/elasticache/subnet_group_test.go index ac5485a15231..b16cb2eb3549 100644 --- a/internal/service/elasticache/subnet_group_test.go +++ b/internal/service/elasticache/subnet_group_test.go @@ -22,7 +22,7 @@ func TestAccElastiCacheSubnetGroup_basic(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elasticache.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSubnetGroupDestroy(ctx), @@ -56,7 +56,7 @@ func TestAccElastiCacheSubnetGroup_disappears(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elasticache.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSubnetGroupDestroy(ctx), @@ -80,7 +80,7 @@ func TestAccElastiCacheSubnetGroup_tags(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elasticache.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSubnetGroupDestroy(ctx), @@ -128,7 +128,7 @@ func TestAccElastiCacheSubnetGroup_update(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elasticache.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSubnetGroupDestroy(ctx), diff --git a/internal/service/elasticache/user_data_source_test.go b/internal/service/elasticache/user_data_source_test.go index a18a9c5b6533..56463a7288e3 100644 --- a/internal/service/elasticache/user_data_source_test.go +++ b/internal/service/elasticache/user_data_source_test.go @@ -16,7 +16,7 @@ func TestAccElastiCacheUserDataSource_basic(t *testing.T) { rName := sdkacctest.RandomWithPrefix("tf-acc") resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, ErrorCheck: acctest.ErrorCheck(t, elasticache.EndpointsID), Steps: []resource.TestStep{ diff --git a/internal/service/elasticache/user_group_association_test.go b/internal/service/elasticache/user_group_association_test.go index ae18ca0f83c6..1228ddfb31e7 100644 --- a/internal/service/elasticache/user_group_association_test.go +++ b/internal/service/elasticache/user_group_association_test.go @@ -27,7 +27,7 @@ func TestAccElastiCacheUserGroupAssociation_basic(t *testing.T) { resourceName := "aws_elasticache_user_group_association.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elasticache.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckUserGroupAssociationDestroy(ctx), @@ -59,7 +59,7 @@ func TestAccElastiCacheUserGroupAssociation_update(t *testing.T) { resourceName := "aws_elasticache_user_group_association.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elasticache.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckUserGroupAssociationDestroy(ctx), @@ -90,7 +90,7 @@ func TestAccElastiCacheUserGroupAssociation_disappears(t *testing.T) { resourceName := "aws_elasticache_user_group_association.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elasticache.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckUserGroupAssociationDestroy(ctx), @@ -118,7 +118,7 @@ func TestAccElastiCacheUserGroupAssociation_multiple(t *testing.T) { resourceName2 := "aws_elasticache_user_group_association.test2" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elasticache.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckUserGroupAssociationDestroy(ctx), diff --git a/internal/service/elasticache/user_group_test.go b/internal/service/elasticache/user_group_test.go index 08b501ff15bb..f7964f9252f6 100644 --- a/internal/service/elasticache/user_group_test.go +++ b/internal/service/elasticache/user_group_test.go @@ -23,7 +23,7 @@ func TestAccElastiCacheUserGroup_basic(t *testing.T) { resourceName := "aws_elasticache_user_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elasticache.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckUserGroupDestroy(ctx), @@ -53,7 +53,7 @@ func TestAccElastiCacheUserGroup_update(t *testing.T) { resourceName := "aws_elasticache_user_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elasticache.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckUserGroupDestroy(ctx), @@ -96,7 +96,7 @@ func TestAccElastiCacheUserGroup_tags(t *testing.T) { resourceName := "aws_elasticache_user_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elasticache.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckUserGroupDestroy(ctx), @@ -137,7 +137,7 @@ func TestAccElastiCacheUserGroup_disappears(t *testing.T) { resourceName := "aws_elasticache_user_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elasticache.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckUserGroupDestroy(ctx), diff --git a/internal/service/elasticache/user_test.go b/internal/service/elasticache/user_test.go index 5728f46a4e54..d4d47594494a 100644 --- a/internal/service/elasticache/user_test.go +++ b/internal/service/elasticache/user_test.go @@ -24,7 +24,7 @@ func TestAccElastiCacheUser_basic(t *testing.T) { resourceName := "aws_elasticache_user.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elasticache.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckUserDestroy(ctx), @@ -59,7 +59,7 @@ func TestAccElastiCacheUser_update(t *testing.T) { resourceName := "aws_elasticache_user.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elasticache.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckUserDestroy(ctx), @@ -97,7 +97,7 @@ func TestAccElastiCacheUser_tags(t *testing.T) { resourceName := "aws_elasticache_user.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elasticache.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckUserDestroy(ctx), @@ -148,7 +148,7 @@ func TestAccElastiCacheUser_disappears(t *testing.T) { resourceName := "aws_elasticache_user.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elasticache.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckUserDestroy(ctx), From e2990a088d355f77666555681e3d8ac67d071b09 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Fri, 24 Feb 2023 16:36:53 -0500 Subject: [PATCH 146/763] Add 'Context' argument to 'acctest.PreCheck' for elasticbeanstalk. --- .../application_data_source_test.go | 2 +- .../elasticbeanstalk/application_test.go | 6 ++--- .../application_version_test.go | 6 ++--- .../configuration_template_test.go | 8 +++---- .../elasticbeanstalk/environment_test.go | 24 +++++++++---------- .../hosted_zone_data_source_test.go | 4 ++-- .../solution_stack_data_source_test.go | 2 +- 7 files changed, 26 insertions(+), 26 deletions(-) diff --git a/internal/service/elasticbeanstalk/application_data_source_test.go b/internal/service/elasticbeanstalk/application_data_source_test.go index 1dfaf95c50b9..bf4fa4ded1d0 100644 --- a/internal/service/elasticbeanstalk/application_data_source_test.go +++ b/internal/service/elasticbeanstalk/application_data_source_test.go @@ -16,7 +16,7 @@ func TestAccElasticBeanstalkApplicationDataSource_basic(t *testing.T) { resourceName := "aws_elastic_beanstalk_application.tftest" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elasticbeanstalk.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ diff --git a/internal/service/elasticbeanstalk/application_test.go b/internal/service/elasticbeanstalk/application_test.go index a00c88dfac2b..87f37ee9086e 100644 --- a/internal/service/elasticbeanstalk/application_test.go +++ b/internal/service/elasticbeanstalk/application_test.go @@ -22,7 +22,7 @@ func TestAccElasticBeanstalkApplication_BeanstalkApp_basic(t *testing.T) { resourceName := "aws_elastic_beanstalk_application.tftest" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elasticbeanstalk.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckApplicationDestroy(ctx), @@ -48,7 +48,7 @@ func TestAccElasticBeanstalkApplication_BeanstalkApp_appVersionLifecycle(t *test rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elasticbeanstalk.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckApplicationDestroy(ctx), @@ -110,7 +110,7 @@ func TestAccElasticBeanstalkApplication_BeanstalkApp_tags(t *testing.T) { resourceName := "aws_elastic_beanstalk_application.tftest" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elasticbeanstalk.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckApplicationDestroy(ctx), diff --git a/internal/service/elasticbeanstalk/application_version_test.go b/internal/service/elasticbeanstalk/application_version_test.go index 3f6f431689b4..43a6a1008a8c 100644 --- a/internal/service/elasticbeanstalk/application_version_test.go +++ b/internal/service/elasticbeanstalk/application_version_test.go @@ -21,7 +21,7 @@ func TestAccElasticBeanstalkApplicationVersion_BeanstalkApp_basic(t *testing.T) var appVersion elasticbeanstalk.ApplicationVersionDescription resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elasticbeanstalk.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckApplicationVersionDestroy(ctx), @@ -42,7 +42,7 @@ func TestAccElasticBeanstalkApplicationVersion_BeanstalkApp_duplicateLabels(t *t var secondAppVersion elasticbeanstalk.ApplicationVersionDescription resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elasticbeanstalk.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckApplicationVersionDestroy(ctx), @@ -64,7 +64,7 @@ func TestAccElasticBeanstalkApplicationVersion_BeanstalkApp_tags(t *testing.T) { resourceName := "aws_elastic_beanstalk_application_version.default" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elasticbeanstalk.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckApplicationVersionDestroy(ctx), diff --git a/internal/service/elasticbeanstalk/configuration_template_test.go b/internal/service/elasticbeanstalk/configuration_template_test.go index b4e7c06256e7..3b2985ac42d5 100644 --- a/internal/service/elasticbeanstalk/configuration_template_test.go +++ b/internal/service/elasticbeanstalk/configuration_template_test.go @@ -22,7 +22,7 @@ func TestAccElasticBeanstalkConfigurationTemplate_basic(t *testing.T) { resourceName := "aws_elastic_beanstalk_configuration_template.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elasticbeanstalk.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckConfigurationTemplateDestroy(ctx), @@ -44,7 +44,7 @@ func TestAccElasticBeanstalkConfigurationTemplate_disappears(t *testing.T) { resourceName := "aws_elastic_beanstalk_configuration_template.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elasticbeanstalk.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckConfigurationTemplateDestroy(ctx), @@ -68,7 +68,7 @@ func TestAccElasticBeanstalkConfigurationTemplate_vpc(t *testing.T) { resourceName := "aws_elastic_beanstalk_configuration_template.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elasticbeanstalk.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckConfigurationTemplateDestroy(ctx), @@ -90,7 +90,7 @@ func TestAccElasticBeanstalkConfigurationTemplate_settings(t *testing.T) { resourceName := "aws_elastic_beanstalk_configuration_template.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elasticbeanstalk.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckConfigurationTemplateDestroy(ctx), diff --git a/internal/service/elasticbeanstalk/environment_test.go b/internal/service/elasticbeanstalk/environment_test.go index 80fbc597730f..b21878235e2a 100644 --- a/internal/service/elasticbeanstalk/environment_test.go +++ b/internal/service/elasticbeanstalk/environment_test.go @@ -32,7 +32,7 @@ func TestAccElasticBeanstalkEnvironment_basic(t *testing.T) { beanstalkEndpointURL := regexp.MustCompile("awseb.+?EBLoa[^,].+?elb.amazonaws.com") resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elasticbeanstalk.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckEnvironmentDestroy(ctx), @@ -69,7 +69,7 @@ func TestAccElasticBeanstalkEnvironment_disappears(t *testing.T) { resourceName := "aws_elastic_beanstalk_environment.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elasticbeanstalk.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckEnvironmentDestroy(ctx), @@ -94,7 +94,7 @@ func TestAccElasticBeanstalkEnvironment_tier(t *testing.T) { beanstalkQueuesNameRegexp := regexp.MustCompile("https://sqs.+?awseb[^,]+") resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elasticbeanstalk.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckEnvironmentDestroy(ctx), @@ -128,7 +128,7 @@ func TestAccElasticBeanstalkEnvironment_cnamePrefix(t *testing.T) { beanstalkCnameRegexp := regexp.MustCompile("^" + rName + ".+?elasticbeanstalk.com$") resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elasticbeanstalk.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckEnvironmentDestroy(ctx), @@ -160,7 +160,7 @@ func TestAccElasticBeanstalkEnvironment_beanstalkEnv(t *testing.T) { resourceName := "aws_elastic_beanstalk_environment.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elasticbeanstalk.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckEnvironmentDestroy(ctx), @@ -207,7 +207,7 @@ func TestAccElasticBeanstalkEnvironment_resource(t *testing.T) { resourceName := "aws_elastic_beanstalk_environment.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elasticbeanstalk.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckEnvironmentDestroy(ctx), @@ -238,7 +238,7 @@ func TestAccElasticBeanstalkEnvironment_tags(t *testing.T) { resourceName := "aws_elastic_beanstalk_environment.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elasticbeanstalk.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckEnvironmentDestroy(ctx), @@ -288,7 +288,7 @@ func TestAccElasticBeanstalkEnvironment_changeStack(t *testing.T) { resourceName := "aws_elastic_beanstalk_environment.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elasticbeanstalk.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckEnvironmentDestroy(ctx), @@ -322,7 +322,7 @@ func TestAccElasticBeanstalkEnvironment_update(t *testing.T) { resourceName := "aws_elastic_beanstalk_environment.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elasticbeanstalk.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckEnvironmentDestroy(ctx), @@ -366,7 +366,7 @@ func TestAccElasticBeanstalkEnvironment_label(t *testing.T) { resourceName := "aws_elastic_beanstalk_environment.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elasticbeanstalk.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckEnvironmentDestroy(ctx), @@ -410,7 +410,7 @@ func TestAccElasticBeanstalkEnvironment_settingWithJSONValue(t *testing.T) { } resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elasticbeanstalk.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckEnvironmentDestroy(ctx), @@ -441,7 +441,7 @@ func TestAccElasticBeanstalkEnvironment_platformARN(t *testing.T) { resourceName := "aws_elastic_beanstalk_environment.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elasticbeanstalk.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckEnvironmentDestroy(ctx), diff --git a/internal/service/elasticbeanstalk/hosted_zone_data_source_test.go b/internal/service/elasticbeanstalk/hosted_zone_data_source_test.go index 6c160f3c60e8..6f74b0a269d4 100644 --- a/internal/service/elasticbeanstalk/hosted_zone_data_source_test.go +++ b/internal/service/elasticbeanstalk/hosted_zone_data_source_test.go @@ -16,7 +16,7 @@ func TestAccElasticBeanstalkHostedZoneDataSource_basic(t *testing.T) { dataSourceName := "data.aws_elastic_beanstalk_hosted_zone.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elasticbeanstalk.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ @@ -34,7 +34,7 @@ func TestAccElasticBeanstalkHostedZoneDataSource_region(t *testing.T) { dataSourceName := "data.aws_elastic_beanstalk_hosted_zone.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elasticbeanstalk.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ diff --git a/internal/service/elasticbeanstalk/solution_stack_data_source_test.go b/internal/service/elasticbeanstalk/solution_stack_data_source_test.go index 431719d0a520..6ae51ef65273 100644 --- a/internal/service/elasticbeanstalk/solution_stack_data_source_test.go +++ b/internal/service/elasticbeanstalk/solution_stack_data_source_test.go @@ -13,7 +13,7 @@ import ( func TestAccElasticBeanstalkSolutionStackDataSource_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elasticbeanstalk.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ From dd0eefaa760907a051a7861bc7aaac6471f92863 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Fri, 24 Feb 2023 16:36:54 -0500 Subject: [PATCH 147/763] Add 'Context' argument to 'acctest.PreCheck' for elasticsearch. --- .../elasticsearch/domain_data_source_test.go | 4 +- .../elasticsearch/domain_policy_test.go | 2 +- .../elasticsearch/domain_saml_options_test.go | 10 +-- internal/service/elasticsearch/domain_test.go | 76 +++++++++---------- 4 files changed, 46 insertions(+), 46 deletions(-) diff --git a/internal/service/elasticsearch/domain_data_source_test.go b/internal/service/elasticsearch/domain_data_source_test.go index 301aa85bbb99..008ad29095e5 100644 --- a/internal/service/elasticsearch/domain_data_source_test.go +++ b/internal/service/elasticsearch/domain_data_source_test.go @@ -21,7 +21,7 @@ func TestAccElasticsearchDomainDataSource_basic(t *testing.T) { resourceName := "aws_elasticsearch_domain.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckIAMServiceLinkedRole(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckIAMServiceLinkedRole(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elasticsearchservice.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ @@ -65,7 +65,7 @@ func TestAccElasticsearchDomainDataSource_advanced(t *testing.T) { resourceName := "aws_elasticsearch_domain.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckIAMServiceLinkedRole(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckIAMServiceLinkedRole(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elasticsearchservice.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ diff --git a/internal/service/elasticsearch/domain_policy_test.go b/internal/service/elasticsearch/domain_policy_test.go index 853319a66d06..237a45e56b47 100644 --- a/internal/service/elasticsearch/domain_policy_test.go +++ b/internal/service/elasticsearch/domain_policy_test.go @@ -47,7 +47,7 @@ func TestAccElasticsearchDomainPolicy_basic(t *testing.T) { name := fmt.Sprintf("tf-test-%d", ri) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elasticsearch.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDomainDestroy(ctx), diff --git a/internal/service/elasticsearch/domain_saml_options_test.go b/internal/service/elasticsearch/domain_saml_options_test.go index 5d2efbb2196f..6883fda83797 100644 --- a/internal/service/elasticsearch/domain_saml_options_test.go +++ b/internal/service/elasticsearch/domain_saml_options_test.go @@ -27,7 +27,7 @@ func TestAccElasticsearchDomainSAMLOptions_basic(t *testing.T) { esDomainResourceName := "aws_elasticsearch_domain.example" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elasticsearch.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckESDomainSAMLOptionsDestroy(ctx), @@ -62,7 +62,7 @@ func TestAccElasticsearchDomainSAMLOptions_disappears(t *testing.T) { esDomainResourceName := "aws_elasticsearch_domain.example" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elasticsearch.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckESDomainSAMLOptionsDestroy(ctx), @@ -88,7 +88,7 @@ func TestAccElasticsearchDomainSAMLOptions_disappears_Domain(t *testing.T) { esDomainResourceName := "aws_elasticsearch_domain.example" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elasticsearch.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckESDomainSAMLOptionsDestroy(ctx), @@ -115,7 +115,7 @@ func TestAccElasticsearchDomainSAMLOptions_Update(t *testing.T) { esDomainResourceName := "aws_elasticsearch_domain.example" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elasticsearch.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckESDomainSAMLOptionsDestroy(ctx), @@ -150,7 +150,7 @@ func TestAccElasticsearchDomainSAMLOptions_Disabled(t *testing.T) { esDomainResourceName := "aws_elasticsearch_domain.example" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elasticsearch.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckESDomainSAMLOptionsDestroy(ctx), diff --git a/internal/service/elasticsearch/domain_test.go b/internal/service/elasticsearch/domain_test.go index d801c55e9ee9..5c0bdc7ca612 100644 --- a/internal/service/elasticsearch/domain_test.go +++ b/internal/service/elasticsearch/domain_test.go @@ -30,7 +30,7 @@ func TestAccElasticsearchDomain_basic(t *testing.T) { resourceName := "aws_elasticsearch_domain.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckIAMServiceLinkedRole(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckIAMServiceLinkedRole(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elasticsearch.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDomainDestroy(ctx), @@ -61,7 +61,7 @@ func TestAccElasticsearchDomain_requireHTTPS(t *testing.T) { rName := testAccRandomDomainName() resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elasticsearch.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDomainDestroy(ctx), @@ -105,7 +105,7 @@ func TestAccElasticsearchDomain_customEndpoint(t *testing.T) { certificate := acctest.TLSRSAX509SelfSignedCertificatePEM(t, certKey, customEndpoint) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elasticsearch.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDomainDestroy(ctx), @@ -153,7 +153,7 @@ func TestAccElasticsearchDomain_Cluster_zoneAwareness(t *testing.T) { resourceName := "aws_elasticsearch_domain.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckIAMServiceLinkedRole(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckIAMServiceLinkedRole(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elasticsearch.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDomainDestroy(ctx), @@ -213,7 +213,7 @@ func TestAccElasticsearchDomain_warm(t *testing.T) { resourceName := "aws_elasticsearch_domain.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckIAMServiceLinkedRole(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckIAMServiceLinkedRole(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elasticsearch.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDomainDestroy(ctx), @@ -271,7 +271,7 @@ func TestAccElasticsearchDomain_withColdStorageOptions(t *testing.T) { resourceName := "aws_elasticsearch_domain.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckIAMServiceLinkedRole(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckIAMServiceLinkedRole(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elasticsearch.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDomainDestroy(ctx), @@ -309,7 +309,7 @@ func TestAccElasticsearchDomain_withDedicatedMaster(t *testing.T) { resourceName := "aws_elasticsearch_domain.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckIAMServiceLinkedRole(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckIAMServiceLinkedRole(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elasticsearch.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDomainDestroy(ctx), @@ -353,7 +353,7 @@ func TestAccElasticsearchDomain_duplicate(t *testing.T) { resourceName := "aws_elasticsearch_domain.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckIAMServiceLinkedRole(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckIAMServiceLinkedRole(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elasticsearch.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: func(s *terraform.State) error { @@ -407,7 +407,7 @@ func TestAccElasticsearchDomain_v23(t *testing.T) { resourceName := "aws_elasticsearch_domain.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckIAMServiceLinkedRole(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckIAMServiceLinkedRole(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elasticsearch.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDomainDestroy(ctx), @@ -441,7 +441,7 @@ func TestAccElasticsearchDomain_complex(t *testing.T) { resourceName := "aws_elasticsearch_domain.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckIAMServiceLinkedRole(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckIAMServiceLinkedRole(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elasticsearch.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDomainDestroy(ctx), @@ -473,7 +473,7 @@ func TestAccElasticsearchDomain_vpc(t *testing.T) { resourceName := "aws_elasticsearch_domain.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckIAMServiceLinkedRole(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckIAMServiceLinkedRole(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elasticsearch.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDomainDestroy(ctx), @@ -501,7 +501,7 @@ func TestAccElasticsearchDomain_VPC_update(t *testing.T) { resourceName := "aws_elasticsearch_domain.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckIAMServiceLinkedRole(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckIAMServiceLinkedRole(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elasticsearch.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDomainDestroy(ctx), @@ -541,7 +541,7 @@ func TestAccElasticsearchDomain_internetToVPCEndpoint(t *testing.T) { resourceName := "aws_elasticsearch_domain.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckIAMServiceLinkedRole(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckIAMServiceLinkedRole(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elasticsearch.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDomainDestroy(ctx), @@ -580,7 +580,7 @@ func TestAccElasticsearchDomain_AutoTuneOptions(t *testing.T) { resourceName := "aws_elasticsearch_domain.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckIAMServiceLinkedRole(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckIAMServiceLinkedRole(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elasticsearch.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDomainDestroy(ctx), @@ -624,7 +624,7 @@ func TestAccElasticsearchDomain_AdvancedSecurityOptions_userDB(t *testing.T) { resourceName := "aws_elasticsearch_domain.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckIAMServiceLinkedRole(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckIAMServiceLinkedRole(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elasticsearch.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDomainDestroy(ctx), @@ -662,7 +662,7 @@ func TestAccElasticsearchDomain_AdvancedSecurityOptions_iam(t *testing.T) { resourceName := "aws_elasticsearch_domain.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckIAMServiceLinkedRole(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckIAMServiceLinkedRole(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elasticsearch.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDomainDestroy(ctx), @@ -700,7 +700,7 @@ func TestAccElasticsearchDomain_AdvancedSecurityOptions_disabled(t *testing.T) { resourceName := "aws_elasticsearch_domain.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckIAMServiceLinkedRole(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckIAMServiceLinkedRole(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elasticsearch.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDomainDestroy(ctx), @@ -738,7 +738,7 @@ func TestAccElasticsearchDomain_LogPublishingOptions_indexSlowLogs(t *testing.T) resourceName := "aws_elasticsearch_domain.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckIAMServiceLinkedRole(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckIAMServiceLinkedRole(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elasticsearch.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDomainDestroy(ctx), @@ -774,7 +774,7 @@ func TestAccElasticsearchDomain_LogPublishingOptions_searchSlowLogs(t *testing.T resourceName := "aws_elasticsearch_domain.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckIAMServiceLinkedRole(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckIAMServiceLinkedRole(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elasticsearch.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDomainDestroy(ctx), @@ -810,7 +810,7 @@ func TestAccElasticsearchDomain_LogPublishingOptions_esApplicationLogs(t *testin resourceName := "aws_elasticsearch_domain.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckIAMServiceLinkedRole(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckIAMServiceLinkedRole(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elasticsearch.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDomainDestroy(ctx), @@ -846,7 +846,7 @@ func TestAccElasticsearchDomain_LogPublishingOptions_auditLogs(t *testing.T) { resourceName := "aws_elasticsearch_domain.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckIAMServiceLinkedRole(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckIAMServiceLinkedRole(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elasticsearch.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDomainDestroy(ctx), @@ -885,7 +885,7 @@ func TestAccElasticsearchDomain_cognitoOptionsCreateAndRemove(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) testAccPreCheckCognitoIdentityProvider(ctx, t) testAccPreCheckIAMServiceLinkedRole(ctx, t) }, @@ -929,7 +929,7 @@ func TestAccElasticsearchDomain_cognitoOptionsUpdate(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) testAccPreCheckCognitoIdentityProvider(ctx, t) testAccPreCheckIAMServiceLinkedRole(ctx, t) }, @@ -972,7 +972,7 @@ func TestAccElasticsearchDomain_policy(t *testing.T) { rName := testAccRandomDomainName() resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckIAMServiceLinkedRole(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckIAMServiceLinkedRole(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elasticsearch.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDomainDestroy(ctx), @@ -1004,7 +1004,7 @@ func TestAccElasticsearchDomain_policyIgnoreEquivalent(t *testing.T) { rName := testAccRandomDomainName() resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckIAMServiceLinkedRole(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckIAMServiceLinkedRole(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elasticsearch.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDomainDestroy(ctx), @@ -1034,7 +1034,7 @@ func TestAccElasticsearchDomain_Encryption_atRestDefaultKey(t *testing.T) { rName := testAccRandomDomainName() resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckIAMServiceLinkedRole(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckIAMServiceLinkedRole(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elasticsearch.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDomainDestroy(ctx), @@ -1067,7 +1067,7 @@ func TestAccElasticsearchDomain_Encryption_atRestSpecifyKey(t *testing.T) { rName := testAccRandomDomainName() resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckIAMServiceLinkedRole(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckIAMServiceLinkedRole(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elasticsearch.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDomainDestroy(ctx), @@ -1100,7 +1100,7 @@ func TestAccElasticsearchDomain_Encryption_atRestEnable(t *testing.T) { resourceName := "aws_elasticsearch_domain.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckIAMServiceLinkedRole(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckIAMServiceLinkedRole(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elasticsearch.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDomainDestroy(ctx), @@ -1142,7 +1142,7 @@ func TestAccElasticsearchDomain_Encryption_atRestEnableLegacy(t *testing.T) { resourceName := "aws_elasticsearch_domain.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckIAMServiceLinkedRole(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckIAMServiceLinkedRole(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elasticsearch.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDomainDestroy(ctx), @@ -1176,7 +1176,7 @@ func TestAccElasticsearchDomain_Encryption_nodeToNode(t *testing.T) { rName := testAccRandomDomainName() resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckIAMServiceLinkedRole(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckIAMServiceLinkedRole(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elasticsearch.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDomainDestroy(ctx), @@ -1209,7 +1209,7 @@ func TestAccElasticsearchDomain_Encryption_nodeToNodeEnable(t *testing.T) { rName := testAccRandomDomainName() resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckIAMServiceLinkedRole(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckIAMServiceLinkedRole(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elasticsearch.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDomainDestroy(ctx), @@ -1251,7 +1251,7 @@ func TestAccElasticsearchDomain_Encryption_nodeToNodeEnableLegacy(t *testing.T) rName := testAccRandomDomainName() resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckIAMServiceLinkedRole(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckIAMServiceLinkedRole(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elasticsearch.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDomainDestroy(ctx), @@ -1292,7 +1292,7 @@ func TestAccElasticsearchDomain_tags(t *testing.T) { resourceName := "aws_elasticsearch_domain.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckIAMServiceLinkedRole(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckIAMServiceLinkedRole(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elasticsearch.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDomainDestroy(ctx), @@ -1343,7 +1343,7 @@ func TestAccElasticsearchDomain_update(t *testing.T) { resourceName := "aws_elasticsearch_domain.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckIAMServiceLinkedRole(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckIAMServiceLinkedRole(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elasticsearch.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDomainDestroy(ctx), @@ -1385,7 +1385,7 @@ func TestAccElasticsearchDomain_VolumeType_update(t *testing.T) { resourceName := "aws_elasticsearch_domain.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckIAMServiceLinkedRole(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckIAMServiceLinkedRole(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elasticsearch.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDomainDestroy(ctx), @@ -1439,7 +1439,7 @@ func TestAccElasticsearchDomain_VolumeType_missing(t *testing.T) { rName := testAccRandomDomainName() resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckIAMServiceLinkedRole(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckIAMServiceLinkedRole(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elasticsearch.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDomainDestroy(ctx), @@ -1474,7 +1474,7 @@ func TestAccElasticsearchDomain_Update_version(t *testing.T) { resourceName := "aws_elasticsearch_domain.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckIAMServiceLinkedRole(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckIAMServiceLinkedRole(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elasticsearch.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDomainDestroy(ctx), @@ -1521,7 +1521,7 @@ func TestAccElasticsearchDomain_disappears(t *testing.T) { resourceName := "aws_elasticsearch_domain.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckIAMServiceLinkedRole(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckIAMServiceLinkedRole(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elasticsearch.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDomainDestroy(ctx), From 5b34dae5fcf457f103fc91f29e999dbc7b20a2cb Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Fri, 24 Feb 2023 16:36:54 -0500 Subject: [PATCH 148/763] Add 'Context' argument to 'acctest.PreCheck' for elastictranscoder. --- .../service/elastictranscoder/pipeline_test.go | 12 ++++++------ .../service/elastictranscoder/preset_test.go | 16 ++++++++-------- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/internal/service/elastictranscoder/pipeline_test.go b/internal/service/elastictranscoder/pipeline_test.go index 96ea69792933..ff54f5daa8cf 100644 --- a/internal/service/elastictranscoder/pipeline_test.go +++ b/internal/service/elastictranscoder/pipeline_test.go @@ -26,7 +26,7 @@ func TestAccElasticTranscoderPipeline_basic(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elastictranscoder.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckPipelineDestroy(ctx), @@ -55,7 +55,7 @@ func TestAccElasticTranscoderPipeline_kmsKey(t *testing.T) { keyResourceName := "aws_kms_key.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elastictranscoder.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckPipelineDestroy(ctx), @@ -84,7 +84,7 @@ func TestAccElasticTranscoderPipeline_notifications(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elastictranscoder.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckPipelineDestroy(ctx), @@ -154,7 +154,7 @@ func TestAccElasticTranscoderPipeline_withContent(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elastictranscoder.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckPipelineDestroy(ctx), @@ -188,7 +188,7 @@ func TestAccElasticTranscoderPipeline_withPermissions(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elastictranscoder.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckPipelineDestroy(ctx), @@ -215,7 +215,7 @@ func TestAccElasticTranscoderPipeline_disappears(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elastictranscoder.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckPipelineDestroy(ctx), diff --git a/internal/service/elastictranscoder/preset_test.go b/internal/service/elastictranscoder/preset_test.go index 7e5d8fe26862..2ff55e6a2db7 100644 --- a/internal/service/elastictranscoder/preset_test.go +++ b/internal/service/elastictranscoder/preset_test.go @@ -24,7 +24,7 @@ func TestAccElasticTranscoderPreset_basic(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elastictranscoder.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckPresetDestroy(ctx), @@ -52,7 +52,7 @@ func TestAccElasticTranscoderPreset_video_noCodec(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elastictranscoder.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckPresetDestroy(ctx), @@ -80,7 +80,7 @@ func TestAccElasticTranscoderPreset_audio_noBitRate(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elastictranscoder.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckPresetDestroy(ctx), @@ -107,7 +107,7 @@ func TestAccElasticTranscoderPreset_disappears(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elastictranscoder.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckPresetDestroy(ctx), @@ -132,7 +132,7 @@ func TestAccElasticTranscoderPreset_AudioCodecOptions_empty(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elastictranscoder.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckPresetDestroy(ctx), @@ -160,7 +160,7 @@ func TestAccElasticTranscoderPreset_description(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elastictranscoder.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckPresetDestroy(ctx), @@ -189,7 +189,7 @@ func TestAccElasticTranscoderPreset_full(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elastictranscoder.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckPresetDestroy(ctx), @@ -240,7 +240,7 @@ func TestAccElasticTranscoderPreset_Video_frameRate(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elastictranscoder.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckPresetDestroy(ctx), From 731cca3a5654a889792214189138475296599320 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Fri, 24 Feb 2023 16:36:55 -0500 Subject: [PATCH 149/763] Add 'Context' argument to 'acctest.PreCheck' for elb. --- .../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 | 2 +- internal/service/elb/load_balancer_test.go | 40 +++++++++---------- internal/service/elb/policy_test.go | 14 +++---- .../service/elb/proxy_protocol_policy_test.go | 2 +- .../elb/service_account_data_source_test.go | 4 +- 12 files changed, 49 insertions(+), 49 deletions(-) diff --git a/internal/service/elb/app_cookie_stickiness_policy_test.go b/internal/service/elb/app_cookie_stickiness_policy_test.go index e59e488b8737..cd818f73b320 100644 --- a/internal/service/elb/app_cookie_stickiness_policy_test.go +++ b/internal/service/elb/app_cookie_stickiness_policy_test.go @@ -21,7 +21,7 @@ func TestAccELBAppCookieStickinessPolicy_basic(t *testing.T) { resourceName := "aws_app_cookie_stickiness_policy.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elb.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckAppCookieStickinessPolicyDestroy(ctx), @@ -57,7 +57,7 @@ func TestAccELBAppCookieStickinessPolicy_disappears(t *testing.T) { resourceName := "aws_app_cookie_stickiness_policy.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elb.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckAppCookieStickinessPolicyDestroy(ctx), @@ -81,7 +81,7 @@ func TestAccELBAppCookieStickinessPolicy_Disappears_elb(t *testing.T) { elbResourceName := "aws_elb.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elb.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckAppCookieStickinessPolicyDestroy(ctx), diff --git a/internal/service/elb/attachment_test.go b/internal/service/elb/attachment_test.go index 0a06f7ef1388..5d60475e36c9 100644 --- a/internal/service/elb/attachment_test.go +++ b/internal/service/elb/attachment_test.go @@ -18,7 +18,7 @@ func TestAccELBAttachment_basic(t *testing.T) { resourceName := "aws_elb.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elb.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckLoadBalancerDestroy(ctx), @@ -78,7 +78,7 @@ func TestAccELBAttachment_drift(t *testing.T) { } resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elb.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckLoadBalancerDestroy(ctx), diff --git a/internal/service/elb/backend_server_policy_test.go b/internal/service/elb/backend_server_policy_test.go index 5e7c5af6a437..205117428b82 100644 --- a/internal/service/elb/backend_server_policy_test.go +++ b/internal/service/elb/backend_server_policy_test.go @@ -26,7 +26,7 @@ func TestAccELBBackendServerPolicy_basic(t *testing.T) { resourceName := "aws_load_balancer_backend_server_policy.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elb.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckBackendServerPolicyDestroy(ctx), @@ -55,7 +55,7 @@ func TestAccELBBackendServerPolicy_disappears(t *testing.T) { resourceName := "aws_load_balancer_backend_server_policy.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elb.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckBackendServerPolicyDestroy(ctx), @@ -83,7 +83,7 @@ func TestAccELBBackendServerPolicy_update(t *testing.T) { resourceName := "aws_load_balancer_backend_server_policy.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elb.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckBackendServerPolicyDestroy(ctx), 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 23dc7d33e6d9..a9ce0d615dfb 100644 --- a/internal/service/elb/hosted_zone_id_data_source_test.go +++ b/internal/service/elb/hosted_zone_id_data_source_test.go @@ -11,7 +11,7 @@ import ( func TestAccELBHostedZoneIDDataSource_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elb.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ diff --git a/internal/service/elb/lb_cookie_stickiness_policy_test.go b/internal/service/elb/lb_cookie_stickiness_policy_test.go index 8b578e10e7bd..e9116abb883e 100644 --- a/internal/service/elb/lb_cookie_stickiness_policy_test.go +++ b/internal/service/elb/lb_cookie_stickiness_policy_test.go @@ -21,7 +21,7 @@ func TestAccELBCookieStickinessPolicy_basic(t *testing.T) { resourceName := "aws_lb_cookie_stickiness_policy.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elb.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckLBCookieStickinessPolicyDestroy(ctx), @@ -52,7 +52,7 @@ func TestAccELBCookieStickinessPolicy_disappears(t *testing.T) { resourceName := "aws_lb_cookie_stickiness_policy.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elb.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckLBCookieStickinessPolicyDestroy(ctx), @@ -76,7 +76,7 @@ func TestAccELBCookieStickinessPolicy_Disappears_elb(t *testing.T) { elbResourceName := "aws_elb.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elb.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckLBCookieStickinessPolicyDestroy(ctx), diff --git a/internal/service/elb/lb_ssl_negotiation_policy_test.go b/internal/service/elb/lb_ssl_negotiation_policy_test.go index f57a61e04171..f6a84e718cfb 100644 --- a/internal/service/elb/lb_ssl_negotiation_policy_test.go +++ b/internal/service/elb/lb_ssl_negotiation_policy_test.go @@ -23,7 +23,7 @@ func TestAccELBSSLNegotiationPolicy_basic(t *testing.T) { resourceName := "aws_lb_ssl_negotiation_policy.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elb.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckLBSSLNegotiationPolicyDestroy(ctx), @@ -47,7 +47,7 @@ func TestAccELBSSLNegotiationPolicy_update(t *testing.T) { resourceName := "aws_lb_ssl_negotiation_policy.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elb.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckLBSSLNegotiationPolicyDestroy(ctx), @@ -82,7 +82,7 @@ func TestAccELBSSLNegotiationPolicy_disappears(t *testing.T) { resourceName := "aws_lb_ssl_negotiation_policy.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elb.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckLBSSLNegotiationPolicyDestroy(ctx), diff --git a/internal/service/elb/listener_policy_test.go b/internal/service/elb/listener_policy_test.go index 73607b3afb98..32851061182f 100644 --- a/internal/service/elb/listener_policy_test.go +++ b/internal/service/elb/listener_policy_test.go @@ -21,7 +21,7 @@ func TestAccELBListenerPolicy_basic(t *testing.T) { resourceName := "aws_load_balancer_listener_policy.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elb.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckListenerPolicyDestroy(ctx), @@ -47,7 +47,7 @@ func TestAccELBListenerPolicy_update(t *testing.T) { resourceName := "aws_load_balancer_listener_policy.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elb.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckListenerPolicyDestroy(ctx), @@ -84,7 +84,7 @@ func TestAccELBListenerPolicy_disappears(t *testing.T) { resourceName := "aws_load_balancer_listener_policy.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elb.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckListenerPolicyDestroy(ctx), diff --git a/internal/service/elb/load_balancer_data_source_test.go b/internal/service/elb/load_balancer_data_source_test.go index cb3eec8ae0ac..4816ee0e220c 100644 --- a/internal/service/elb/load_balancer_data_source_test.go +++ b/internal/service/elb/load_balancer_data_source_test.go @@ -16,7 +16,7 @@ func TestAccELBLoadBalancerDataSource_basic(t *testing.T) { dataSourceName := "data.aws_elb.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elb.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ diff --git a/internal/service/elb/load_balancer_test.go b/internal/service/elb/load_balancer_test.go index bdad5b030725..92b8ccfdcfdf 100644 --- a/internal/service/elb/load_balancer_test.go +++ b/internal/service/elb/load_balancer_test.go @@ -26,7 +26,7 @@ func TestAccELBLoadBalancer_basic(t *testing.T) { resourceName := "aws_elb.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elb.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckLoadBalancerDestroy(ctx), @@ -65,7 +65,7 @@ func TestAccELBLoadBalancer_disappears(t *testing.T) { resourceName := "aws_elb.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elb.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckLoadBalancerDestroy(ctx), @@ -89,7 +89,7 @@ func TestAccELBLoadBalancer_fullCharacterRange(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elb.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckLoadBalancerDestroy(ctx), @@ -112,7 +112,7 @@ func TestAccELBLoadBalancer_AccessLogs_enabled(t *testing.T) { rName := fmt.Sprintf("tf-test-access-logs-%d", sdkacctest.RandInt()) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elb.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckLoadBalancerDestroy(ctx), @@ -153,7 +153,7 @@ func TestAccELBLoadBalancer_AccessLogs_disabled(t *testing.T) { rName := fmt.Sprintf("tf-test-access-logs-%d", sdkacctest.RandInt()) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elb.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckLoadBalancerDestroy(ctx), @@ -193,7 +193,7 @@ func TestAccELBLoadBalancer_namePrefix(t *testing.T) { resourceName := "aws_elb.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elb.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckLoadBalancerDestroy(ctx), @@ -216,7 +216,7 @@ func TestAccELBLoadBalancer_generatedName(t *testing.T) { resourceName := "aws_elb.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elb.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckLoadBalancerDestroy(ctx), @@ -239,7 +239,7 @@ func TestAccELBLoadBalancer_generatesNameForZeroValue(t *testing.T) { resourceName := "aws_elb.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elb.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckLoadBalancerDestroy(ctx), @@ -261,7 +261,7 @@ func TestAccELBLoadBalancer_availabilityZones(t *testing.T) { resourceName := "aws_elb.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elb.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckLoadBalancerDestroy(ctx), @@ -291,7 +291,7 @@ func TestAccELBLoadBalancer_tags(t *testing.T) { resourceName := "aws_elb.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elb.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckLoadBalancerDestroy(ctx), @@ -351,7 +351,7 @@ func TestAccELBLoadBalancer_ListenerSSLCertificateID_iamServerCertificate(t *tes } resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elb.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckLoadBalancerDestroy(ctx), @@ -381,7 +381,7 @@ func TestAccELBLoadBalancer_Swap_subnets(t *testing.T) { resourceName := "aws_elb.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elb.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckLoadBalancerDestroy(ctx), @@ -420,7 +420,7 @@ func TestAccELBLoadBalancer_instanceAttaching(t *testing.T) { } resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elb.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckLoadBalancerDestroy(ctx), @@ -450,7 +450,7 @@ func TestAccELBLoadBalancer_listener(t *testing.T) { resourceName := "aws_elb.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elb.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckLoadBalancerDestroy(ctx), @@ -577,7 +577,7 @@ func TestAccELBLoadBalancer_healthCheck(t *testing.T) { resourceName := "aws_elb.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elb.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckLoadBalancerDestroy(ctx), @@ -604,7 +604,7 @@ func TestAccELBLoadBalancer_timeout(t *testing.T) { resourceName := "aws_elb.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elb.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckLoadBalancerDestroy(ctx), @@ -630,7 +630,7 @@ func TestAccELBLoadBalancer_connectionDraining(t *testing.T) { resourceName := "aws_elb.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elb.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckLoadBalancerDestroy(ctx), @@ -664,7 +664,7 @@ func TestAccELBLoadBalancer_securityGroups(t *testing.T) { resourceName := "aws_elb.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elb.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckLoadBalancerDestroy(ctx), @@ -692,7 +692,7 @@ func TestAccELBLoadBalancer_desyncMitigationMode(t *testing.T) { resourceName := "aws_elb.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elb.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckLoadBalancerDestroy(ctx), @@ -717,7 +717,7 @@ func TestAccELBLoadBalancer_desyncMitigationMode_update(t *testing.T) { resourceName := "aws_elb.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elb.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckLoadBalancerDestroy(ctx), diff --git a/internal/service/elb/policy_test.go b/internal/service/elb/policy_test.go index cb24f4b9b545..f2a8fb76a117 100644 --- a/internal/service/elb/policy_test.go +++ b/internal/service/elb/policy_test.go @@ -23,7 +23,7 @@ func TestAccELBPolicy_basic(t *testing.T) { rInt := sdkacctest.RandInt() resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elb.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckPolicyDestroy(ctx), @@ -45,7 +45,7 @@ func TestAccELBPolicy_disappears(t *testing.T) { rInt := sdkacctest.RandInt() resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elb.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckPolicyDestroy(ctx), @@ -70,7 +70,7 @@ func TestAccELBPolicy_LBCookieStickinessPolicyType_computedAttributesOnly(t *tes policyTypeName := "LBCookieStickinessPolicyType" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elb.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckPolicyDestroy(ctx), @@ -94,7 +94,7 @@ func TestAccELBPolicy_SSLNegotiationPolicyType_computedAttributesOnly(t *testing rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elb.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckPolicyDestroy(ctx), @@ -118,7 +118,7 @@ func TestAccELBPolicy_SSLNegotiationPolicyType_customPolicy(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elb.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckPolicyDestroy(ctx), @@ -170,7 +170,7 @@ func TestAccELBPolicy_SSLSecurityPolicy_predefined(t *testing.T) { predefinedSecurityPolicyUpdated := "ELBSecurityPolicy-2016-08" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elb.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckPolicyDestroy(ctx), @@ -210,7 +210,7 @@ func TestAccELBPolicy_updateWhileAssigned(t *testing.T) { rInt := sdkacctest.RandInt() resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elb.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckPolicyDestroy(ctx), diff --git a/internal/service/elb/proxy_protocol_policy_test.go b/internal/service/elb/proxy_protocol_policy_test.go index abbd9c5b97d9..e44951644ea5 100644 --- a/internal/service/elb/proxy_protocol_policy_test.go +++ b/internal/service/elb/proxy_protocol_policy_test.go @@ -19,7 +19,7 @@ func TestAccELBProxyProtocolPolicy_basic(t *testing.T) { ctx := acctest.Context(t) lbName := fmt.Sprintf("tf-test-lb-%s", sdkacctest.RandString(5)) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elb.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckProxyProtocolPolicyDestroy(ctx), diff --git a/internal/service/elb/service_account_data_source_test.go b/internal/service/elb/service_account_data_source_test.go index 663488953f84..aac9eb843feb 100644 --- a/internal/service/elb/service_account_data_source_test.go +++ b/internal/service/elb/service_account_data_source_test.go @@ -15,7 +15,7 @@ func TestAccELBServiceAccountDataSource_basic(t *testing.T) { dataSourceName := "data.aws_elb_service_account.main" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elb.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ @@ -36,7 +36,7 @@ func TestAccELBServiceAccountDataSource_region(t *testing.T) { dataSourceName := "data.aws_elb_service_account.regional" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elb.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ From 7d5b34ba0ec389297be750145d4f00675a7d776d Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Fri, 24 Feb 2023 16:36:55 -0500 Subject: [PATCH 150/763] Add 'Context' argument to 'acctest.PreCheck' for elbv2. --- .../elbv2/hosted_zone_id_data_source_test.go | 2 +- .../elbv2/listener_certificate_test.go | 8 +- .../elbv2/listener_data_source_test.go | 8 +- internal/service/elbv2/listener_rule_test.go | 50 ++++---- internal/service/elbv2/listener_test.go | 28 ++--- .../elbv2/load_balancer_data_source_test.go | 6 +- internal/service/elbv2/load_balancer_test.go | 60 +++++----- .../elbv2/load_balancers_data_source_test.go | 2 +- .../elbv2/target_group_attachment_test.go | 12 +- .../elbv2/target_group_data_source_test.go | 8 +- internal/service/elbv2/target_group_test.go | 108 +++++++++--------- 11 files changed, 146 insertions(+), 146 deletions(-) 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 d9386820e339..465d2400340b 100644 --- a/internal/service/elbv2/hosted_zone_id_data_source_test.go +++ b/internal/service/elbv2/hosted_zone_id_data_source_test.go @@ -11,7 +11,7 @@ import ( func TestAccELBV2HostedZoneIDDataSource_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elbv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ diff --git a/internal/service/elbv2/listener_certificate_test.go b/internal/service/elbv2/listener_certificate_test.go index ffd55f017a52..905263c3dc7c 100644 --- a/internal/service/elbv2/listener_certificate_test.go +++ b/internal/service/elbv2/listener_certificate_test.go @@ -27,7 +27,7 @@ func TestAccELBV2ListenerCertificate_basic(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elbv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckListenerCertificateDestroy(ctx), @@ -60,7 +60,7 @@ func TestAccELBV2ListenerCertificate_CertificateARN_underscores(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elbv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckListenerCertificateDestroy(ctx), @@ -95,7 +95,7 @@ func TestAccELBV2ListenerCertificate_multiple(t *testing.T) { resourceName := "aws_lb_listener_certificate.default" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elbv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckListenerCertificateDestroy(ctx), @@ -163,7 +163,7 @@ func TestAccELBV2ListenerCertificate_disappears(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elbv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckListenerCertificateDestroy(ctx), diff --git a/internal/service/elbv2/listener_data_source_test.go b/internal/service/elbv2/listener_data_source_test.go index bc670bf2fb82..a77e7619b6d7 100644 --- a/internal/service/elbv2/listener_data_source_test.go +++ b/internal/service/elbv2/listener_data_source_test.go @@ -16,7 +16,7 @@ func TestAccELBV2ListenerDataSource_basic(t *testing.T) { dataSourceName2 := "data.aws_lb_listener.from_lb_and_port" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elbv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ @@ -51,7 +51,7 @@ func TestAccELBV2ListenerDataSource_backwardsCompatibility(t *testing.T) { dataSourceName2 := "data.aws_alb_listener.from_lb_and_port" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elbv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ @@ -86,7 +86,7 @@ func TestAccELBV2ListenerDataSource_https(t *testing.T) { dataSourceName2 := "data.aws_lb_listener.from_lb_and_port" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elbv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ @@ -123,7 +123,7 @@ func TestAccELBV2ListenerDataSource_DefaultAction_forward(t *testing.T) { resourceName := "aws_lb_listener.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elbv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ diff --git a/internal/service/elbv2/listener_rule_test.go b/internal/service/elbv2/listener_rule_test.go index ee20e079ee55..9d05655840ed 100644 --- a/internal/service/elbv2/listener_rule_test.go +++ b/internal/service/elbv2/listener_rule_test.go @@ -74,7 +74,7 @@ func TestAccELBV2ListenerRule_basic(t *testing.T) { targetGroupResourceName := "aws_lb_target_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elbv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckListenerRuleDestroy(ctx), @@ -121,7 +121,7 @@ func TestAccELBV2ListenerRule_tags(t *testing.T) { resourceName := "aws_lb_listener_rule.static" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elbv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckListenerRuleDestroy(ctx), @@ -167,7 +167,7 @@ func TestAccELBV2ListenerRule_forwardWeighted(t *testing.T) { targetGroup1ResourceName := "aws_lb_target_group.test1" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elbv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckListenerRuleDestroy(ctx), @@ -247,7 +247,7 @@ func TestAccELBV2ListenerRule_backwardsCompatibility(t *testing.T) { targetGroupResourceName := "aws_alb_target_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elbv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckListenerRuleDestroy(ctx), @@ -293,7 +293,7 @@ func TestAccELBV2ListenerRule_redirect(t *testing.T) { frontEndListenerResourceName := "aws_lb_listener.front_end" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elbv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckListenerRuleDestroy(ctx), @@ -383,7 +383,7 @@ func TestAccELBV2ListenerRule_fixedResponse(t *testing.T) { frontEndListenerResourceName := "aws_lb_listener.front_end" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elbv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckListenerRuleDestroy(ctx), @@ -422,7 +422,7 @@ func TestAccELBV2ListenerRule_updateFixedResponse(t *testing.T) { resourceName := "aws_lb_listener_rule.static" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elbv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckListenerRuleDestroy(ctx), @@ -454,7 +454,7 @@ func TestAccELBV2ListenerRule_updateRulePriority(t *testing.T) { resourceName := "aws_lb_listener_rule.static" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elbv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckListenerRuleDestroy(ctx), @@ -487,7 +487,7 @@ func TestAccELBV2ListenerRule_changeListenerRuleARNForcesNew(t *testing.T) { resourceName := "aws_lb_listener_rule.static" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elbv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckListenerRuleDestroy(ctx), @@ -520,7 +520,7 @@ func TestAccELBV2ListenerRule_priority(t *testing.T) { } resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elbv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckListenerRuleDestroy(ctx), @@ -603,7 +603,7 @@ func TestAccELBV2ListenerRule_cognito(t *testing.T) { cognitoPoolDomainResourceName := "aws_cognito_user_pool_domain.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elbv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckListenerRuleDestroy(ctx), @@ -645,7 +645,7 @@ func TestAccELBV2ListenerRule_oidc(t *testing.T) { targetGroupResourceName := "aws_lb_target_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elbv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckListenerRuleDestroy(ctx), @@ -687,7 +687,7 @@ func TestAccELBV2ListenerRule_Action_order(t *testing.T) { resourceName := "aws_lb_listener_rule.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elbv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckListenerRuleDestroy(ctx), @@ -715,7 +715,7 @@ func TestAccELBV2ListenerRule_ActionOrder_recreates(t *testing.T) { resourceName := "aws_lb_listener_rule.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elbv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckListenerRuleDestroy(ctx), @@ -740,7 +740,7 @@ func TestAccELBV2ListenerRule_conditionAttributesCount(t *testing.T) { err_many := regexp.MustCompile("Only one of host_header, http_header, http_request_method, path_pattern, query_string or source_ip can be set in a condition block") resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elbv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckListenerRuleDestroy(ctx), @@ -778,7 +778,7 @@ func TestAccELBV2ListenerRule_conditionHostHeader(t *testing.T) { frontEndListenerResourceName := "aws_lb_listener.front_end" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elbv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckListenerRuleDestroy(ctx), @@ -818,7 +818,7 @@ func TestAccELBV2ListenerRule_conditionHTTPHeader(t *testing.T) { frontEndListenerResourceName := "aws_lb_listener.front_end" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elbv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckListenerRuleDestroy(ctx), @@ -864,7 +864,7 @@ func TestAccELBV2ListenerRule_conditionHTTPHeader(t *testing.T) { func TestAccELBV2ListenerRule_ConditionHTTPHeader_invalid(t *testing.T) { ctx := acctest.Context(t) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elbv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckListenerRuleDestroy(ctx), @@ -886,7 +886,7 @@ func TestAccELBV2ListenerRule_conditionHTTPRequestMethod(t *testing.T) { frontEndListenerResourceName := "aws_lb_listener.front_end" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elbv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckListenerRuleDestroy(ctx), @@ -926,7 +926,7 @@ func TestAccELBV2ListenerRule_conditionPathPattern(t *testing.T) { frontEndListenerResourceName := "aws_lb_listener.front_end" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elbv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckListenerRuleDestroy(ctx), @@ -966,7 +966,7 @@ func TestAccELBV2ListenerRule_conditionQueryString(t *testing.T) { frontEndListenerResourceName := "aws_lb_listener.front_end" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elbv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckListenerRuleDestroy(ctx), @@ -1030,7 +1030,7 @@ func TestAccELBV2ListenerRule_conditionSourceIP(t *testing.T) { frontEndListenerResourceName := "aws_lb_listener.front_end" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elbv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckListenerRuleDestroy(ctx), @@ -1074,7 +1074,7 @@ func TestAccELBV2ListenerRule_conditionUpdateMixed(t *testing.T) { } resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elbv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckListenerRuleDestroy(ctx), @@ -1149,7 +1149,7 @@ func TestAccELBV2ListenerRule_conditionMultiple(t *testing.T) { frontEndListenerResourceName := "aws_lb_listener.front_end" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elbv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckListenerRuleDestroy(ctx), @@ -1233,7 +1233,7 @@ func TestAccELBV2ListenerRule_conditionUpdateMultiple(t *testing.T) { frontEndListenerResourceName := "aws_lb_listener.front_end" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elbv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckListenerRuleDestroy(ctx), diff --git a/internal/service/elbv2/listener_test.go b/internal/service/elbv2/listener_test.go index 439f62a40e58..dd3f95ab1df4 100644 --- a/internal/service/elbv2/listener_test.go +++ b/internal/service/elbv2/listener_test.go @@ -26,7 +26,7 @@ func TestAccELBV2Listener_basic(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elbv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckListenerDestroy(ctx), @@ -64,7 +64,7 @@ func TestAccELBV2Listener_tags(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elbv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckListenerDestroy(ctx), @@ -111,7 +111,7 @@ func TestAccELBV2Listener_forwardWeighted(t *testing.T) { rName2 := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elbv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckListenerDestroy(ctx), @@ -191,7 +191,7 @@ func TestAccELBV2Listener_Protocol_upd(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elbv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckListenerDestroy(ctx), @@ -228,7 +228,7 @@ func TestAccELBV2Listener_backwardsCompatibility(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elbv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckListenerDestroy(ctx), @@ -267,7 +267,7 @@ func TestAccELBV2Listener_Protocol_https(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elbv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckListenerDestroy(ctx), @@ -311,7 +311,7 @@ func TestAccELBV2Listener_LoadBalancerARN_gatewayLoadBalancer(t *testing.T) { } resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elbv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckListenerDestroy(ctx), @@ -343,7 +343,7 @@ func TestAccELBV2Listener_Protocol_tls(t *testing.T) { } resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elbv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckListenerDestroy(ctx), @@ -372,7 +372,7 @@ func TestAccELBV2Listener_redirect(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elbv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckListenerDestroy(ctx), @@ -415,7 +415,7 @@ func TestAccELBV2Listener_fixedResponse(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elbv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckListenerDestroy(ctx), @@ -457,7 +457,7 @@ func TestAccELBV2Listener_cognito(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elbv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckListenerDestroy(ctx), @@ -502,7 +502,7 @@ func TestAccELBV2Listener_oidc(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elbv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckListenerDestroy(ctx), @@ -551,7 +551,7 @@ func TestAccELBV2Listener_DefaultAction_order(t *testing.T) { resourceName := "aws_lb_listener.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elbv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckListenerDestroy(ctx), @@ -585,7 +585,7 @@ func TestAccELBV2Listener_DefaultAction_orderRecreates(t *testing.T) { resourceName := "aws_lb_listener.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elbv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckListenerDestroy(ctx), diff --git a/internal/service/elbv2/load_balancer_data_source_test.go b/internal/service/elbv2/load_balancer_data_source_test.go index a822b2508d21..b08af1cd09d1 100644 --- a/internal/service/elbv2/load_balancer_data_source_test.go +++ b/internal/service/elbv2/load_balancer_data_source_test.go @@ -18,7 +18,7 @@ func TestAccELBV2LoadBalancerDataSource_basic(t *testing.T) { resourceName := "aws_lb.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elbv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ @@ -86,7 +86,7 @@ func TestAccELBV2LoadBalancerDataSource_outpost(t *testing.T) { resourceName := "aws_lb.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckOutpostsOutposts(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckOutpostsOutposts(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elbv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ @@ -123,7 +123,7 @@ func TestAccELBV2LoadBalancerDataSource_backwardsCompatibility(t *testing.T) { resourceName := "aws_alb.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elbv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ diff --git a/internal/service/elbv2/load_balancer_test.go b/internal/service/elbv2/load_balancer_test.go index 4ad6677a14ed..2137bc95cb44 100644 --- a/internal/service/elbv2/load_balancer_test.go +++ b/internal/service/elbv2/load_balancer_test.go @@ -70,7 +70,7 @@ func TestAccELBV2LoadBalancer_ALB_basic(t *testing.T) { resourceName := "aws_lb.lb_test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elbv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckLoadBalancerDestroy(ctx), @@ -109,7 +109,7 @@ func TestAccELBV2LoadBalancer_NLB_basic(t *testing.T) { resourceName := "aws_lb.lb_test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elbv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckLoadBalancerDestroy(ctx), @@ -143,7 +143,7 @@ func TestAccELBV2LoadBalancer_LoadBalancerType_gateway(t *testing.T) { resourceName := "aws_lb.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckGatewayLoadBalancer(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckGatewayLoadBalancer(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elbv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckLoadBalancerDestroy(ctx), @@ -178,7 +178,7 @@ func TestAccELBV2LoadBalancer_disappears(t *testing.T) { resourceName := "aws_lb.lb_test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elbv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckLoadBalancerDestroy(ctx), @@ -202,7 +202,7 @@ func TestAccELBV2LoadBalancer_ipv6SubnetMapping(t *testing.T) { resourceName := "aws_lb.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elbv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckLoadBalancerDestroy(ctx), @@ -237,7 +237,7 @@ func TestAccELBV2LoadBalancer_LoadBalancerTypeGateway_enableCrossZoneLoadBalanci resourceName := "aws_lb.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckGatewayLoadBalancer(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckGatewayLoadBalancer(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elbv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckLoadBalancerDestroy(ctx), @@ -282,7 +282,7 @@ func TestAccELBV2LoadBalancer_ALB_outpost(t *testing.T) { resourceName := "aws_lb.lb_test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckOutpostsOutposts(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckOutpostsOutposts(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elbv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckLoadBalancerDestroy(ctx), @@ -322,7 +322,7 @@ func TestAccELBV2LoadBalancer_networkLoadBalancerEIP(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elbv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckLoadBalancerDestroy(ctx), @@ -353,7 +353,7 @@ func TestAccELBV2LoadBalancer_NLB_privateIPv4Address(t *testing.T) { resourceName := "aws_lb.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elbv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckLoadBalancerDestroy(ctx), @@ -383,7 +383,7 @@ func TestAccELBV2LoadBalancer_backwardsCompatibility(t *testing.T) { resourceName := "aws_alb.lb_test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elbv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckLoadBalancerDestroy(ctx), @@ -419,7 +419,7 @@ func TestAccELBV2LoadBalancer_generatedName(t *testing.T) { resourceName := "aws_lb.lb_test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elbv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckLoadBalancerDestroy(ctx), @@ -442,7 +442,7 @@ func TestAccELBV2LoadBalancer_generatesNameForZeroValue(t *testing.T) { resourceName := "aws_lb.lb_test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elbv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckLoadBalancerDestroy(ctx), @@ -465,7 +465,7 @@ func TestAccELBV2LoadBalancer_namePrefix(t *testing.T) { resourceName := "aws_lb.lb_test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elbv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckLoadBalancerDestroy(ctx), @@ -490,7 +490,7 @@ func TestAccELBV2LoadBalancer_tags(t *testing.T) { resourceName := "aws_lb.lb_test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elbv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckLoadBalancerDestroy(ctx), @@ -535,7 +535,7 @@ func TestAccELBV2LoadBalancer_NetworkLoadBalancer_updateCrossZone(t *testing.T) } resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elbv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckLoadBalancerDestroy(ctx), @@ -581,7 +581,7 @@ func TestAccELBV2LoadBalancer_ApplicationLoadBalancer_updateHTTP2(t *testing.T) } resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elbv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckLoadBalancerDestroy(ctx), @@ -626,7 +626,7 @@ func TestAccELBV2LoadBalancer_ApplicationLoadBalancer_updateDropInvalidHeaderFie } resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elbv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckLoadBalancerDestroy(ctx), @@ -671,7 +671,7 @@ func TestAccELBV2LoadBalancer_ApplicationLoadBalancer_updatePreserveHostHeader(t } resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elbv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckLoadBalancerDestroy(ctx), @@ -717,7 +717,7 @@ func TestAccELBV2LoadBalancer_ApplicationLoadBalancer_updateDeletionProtection(t } resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elbv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckLoadBalancerDestroy(ctx), @@ -763,7 +763,7 @@ func TestAccELBV2LoadBalancer_ApplicationLoadBalancer_updateWAFFailOpen(t *testi } resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elbv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckLoadBalancerDestroy(ctx), @@ -816,7 +816,7 @@ func TestAccELBV2LoadBalancer_updatedSecurityGroups(t *testing.T) { } resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elbv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckLoadBalancerDestroy(ctx), @@ -851,7 +851,7 @@ func TestAccELBV2LoadBalancer_updatedSubnets(t *testing.T) { } resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elbv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckLoadBalancerDestroy(ctx), @@ -882,7 +882,7 @@ func TestAccELBV2LoadBalancer_updatedIPAddressType(t *testing.T) { resourceName := "aws_lb.lb_test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elbv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckLoadBalancerDestroy(ctx), @@ -915,7 +915,7 @@ func TestAccELBV2LoadBalancer_noSecurityGroup(t *testing.T) { resourceName := "aws_lb.lb_test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elbv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckLoadBalancerDestroy(ctx), @@ -952,7 +952,7 @@ func TestAccELBV2LoadBalancer_ALB_accessLogs(t *testing.T) { } resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elbv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckLoadBalancerDestroy(ctx), @@ -1044,7 +1044,7 @@ func TestAccELBV2LoadBalancer_ALBAccessLogs_prefix(t *testing.T) { } resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elbv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckLoadBalancerDestroy(ctx), @@ -1118,7 +1118,7 @@ func TestAccELBV2LoadBalancer_NLB_accessLogs(t *testing.T) { } resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elbv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckLoadBalancerDestroy(ctx), @@ -1210,7 +1210,7 @@ func TestAccELBV2LoadBalancer_NLBAccessLogs_prefix(t *testing.T) { } resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elbv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckLoadBalancerDestroy(ctx), @@ -1280,7 +1280,7 @@ func TestAccELBV2LoadBalancer_NetworkLoadBalancerSubnet_change(t *testing.T) { resourceName := "aws_lb.lb_test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elbv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckLoadBalancerDestroy(ctx), @@ -1311,7 +1311,7 @@ func TestAccELBV2LoadBalancer_updateDesyncMitigationMode(t *testing.T) { } resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elbv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckLoadBalancerDestroy(ctx), diff --git a/internal/service/elbv2/load_balancers_data_source_test.go b/internal/service/elbv2/load_balancers_data_source_test.go index 342a3ccaea30..4e89154c132f 100644 --- a/internal/service/elbv2/load_balancers_data_source_test.go +++ b/internal/service/elbv2/load_balancers_data_source_test.go @@ -26,7 +26,7 @@ func TestAccELBV2LoadBalancersDataSource_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(elbv2.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, elbv2.EndpointsID), diff --git a/internal/service/elbv2/target_group_attachment_test.go b/internal/service/elbv2/target_group_attachment_test.go index 0b10c00440e2..76aa282ff69d 100644 --- a/internal/service/elbv2/target_group_attachment_test.go +++ b/internal/service/elbv2/target_group_attachment_test.go @@ -22,7 +22,7 @@ func TestAccELBV2TargetGroupAttachment_basic(t *testing.T) { targetGroupName := fmt.Sprintf("test-target-group-%s", sdkacctest.RandString(10)) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elbv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTargetGroupAttachmentDestroy(ctx), @@ -41,7 +41,7 @@ func TestAccELBV2TargetGroupAttachment_disappears(t *testing.T) { ctx := acctest.Context(t) targetGroupName := fmt.Sprintf("test-target-group-%s", sdkacctest.RandString(10)) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elbv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTargetGroupAttachmentDestroy(ctx), @@ -63,7 +63,7 @@ func TestAccELBV2TargetGroupAttachment_backwardsCompatibility(t *testing.T) { targetGroupName := fmt.Sprintf("test-target-group-%s", sdkacctest.RandString(10)) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elbv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTargetGroupAttachmentDestroy(ctx), @@ -83,7 +83,7 @@ func TestAccELBV2TargetGroupAttachment_port(t *testing.T) { targetGroupName := fmt.Sprintf("test-target-group-%s", sdkacctest.RandString(10)) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elbv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTargetGroupAttachmentDestroy(ctx), @@ -103,7 +103,7 @@ func TestAccELBV2TargetGroupAttachment_ipAddress(t *testing.T) { targetGroupName := fmt.Sprintf("test-target-group-%s", sdkacctest.RandString(10)) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elbv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTargetGroupAttachmentDestroy(ctx), @@ -123,7 +123,7 @@ func TestAccELBV2TargetGroupAttachment_lambda(t *testing.T) { targetGroupName := fmt.Sprintf("test-target-group-%s", sdkacctest.RandString(10)) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elbv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTargetGroupAttachmentDestroy(ctx), diff --git a/internal/service/elbv2/target_group_data_source_test.go b/internal/service/elbv2/target_group_data_source_test.go index e2d6ab54aa24..c54292ca8ac2 100644 --- a/internal/service/elbv2/target_group_data_source_test.go +++ b/internal/service/elbv2/target_group_data_source_test.go @@ -16,7 +16,7 @@ func TestAccELBV2TargetGroupDataSource_basic(t *testing.T) { datasourceNameByName := "data.aws_lb_target_group.alb_tg_test_with_name" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elbv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ @@ -76,7 +76,7 @@ func TestAccELBV2TargetGroupDataSource_appCookie(t *testing.T) { resourceNameArn := "data.aws_lb_target_group.alb_tg_test_with_arn" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elbv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ @@ -118,7 +118,7 @@ func TestAccELBV2TargetGroupDataSource_backwardsCompatibility(t *testing.T) { resourceName := "data.aws_alb_target_group.alb_tg_test_with_name" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elbv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ @@ -183,7 +183,7 @@ func TestAccELBV2TargetGroupDataSource_tags(t *testing.T) { dataSourceMatchFirstTagAndName := "data.aws_lb_target_group.tag_and_arn_match_first" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elbv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ diff --git a/internal/service/elbv2/target_group_test.go b/internal/service/elbv2/target_group_test.go index dcbbf0dec819..075ec873e3d9 100644 --- a/internal/service/elbv2/target_group_test.go +++ b/internal/service/elbv2/target_group_test.go @@ -91,7 +91,7 @@ func TestAccELBV2TargetGroup_backwardsCompatibility(t *testing.T) { resourceName := "aws_alb_target_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elbv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTargetGroupDestroy(ctx), @@ -135,7 +135,7 @@ func TestAccELBV2TargetGroup_ProtocolVersion_basic(t *testing.T) { resourceName := "aws_lb_target_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elbv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTargetGroupDestroy(ctx), @@ -189,7 +189,7 @@ func TestAccELBV2TargetGroup_ProtocolVersion_grpcHealthCheck(t *testing.T) { resourceName := "aws_lb_target_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elbv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTargetGroupDestroy(ctx), @@ -214,7 +214,7 @@ func TestAccELBV2TargetGroup_ProtocolVersion_grpcUpdate(t *testing.T) { resourceName := "aws_lb_target_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elbv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTargetGroupDestroy(ctx), @@ -246,7 +246,7 @@ func TestAccELBV2TargetGroup_ipAddressType(t *testing.T) { resourceName := "aws_lb_target_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elbv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTargetGroupDestroy(ctx), @@ -281,7 +281,7 @@ func TestAccELBV2TargetGroup_tls(t *testing.T) { resourceName := "aws_lb_target_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elbv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTargetGroupDestroy(ctx), @@ -304,7 +304,7 @@ func TestAccELBV2TargetGroup_HealthCheck_tcpHTTPS(t *testing.T) { resourceName := "aws_lb_target_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elbv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTargetGroupDestroy(ctx), @@ -364,7 +364,7 @@ func TestAccELBV2TargetGroup_attrsOnCreate(t *testing.T) { resourceName := "aws_lb_target_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elbv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTargetGroupDestroy(ctx), @@ -398,7 +398,7 @@ func TestAccELBV2TargetGroup_basic(t *testing.T) { resourceName := "aws_lb_target_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elbv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTargetGroupDestroy(ctx), @@ -445,7 +445,7 @@ func TestAccELBV2TargetGroup_udp(t *testing.T) { resourceName := "aws_lb_target_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elbv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTargetGroupDestroy(ctx), @@ -478,7 +478,7 @@ func TestAccELBV2TargetGroup_ForceNew_name(t *testing.T) { resourceName := "aws_lb_target_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elbv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTargetGroupDestroy(ctx), @@ -509,7 +509,7 @@ func TestAccELBV2TargetGroup_ForceNew_port(t *testing.T) { resourceName := "aws_lb_target_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elbv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTargetGroupDestroy(ctx), @@ -540,7 +540,7 @@ func TestAccELBV2TargetGroup_ForceNew_protocol(t *testing.T) { resourceName := "aws_lb_target_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elbv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTargetGroupDestroy(ctx), @@ -571,7 +571,7 @@ func TestAccELBV2TargetGroup_ForceNew_vpc(t *testing.T) { resourceName := "aws_lb_target_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elbv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTargetGroupDestroy(ctx), @@ -600,7 +600,7 @@ func TestAccELBV2TargetGroup_Defaults_application(t *testing.T) { resourceName := "aws_lb_target_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elbv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTargetGroupDestroy(ctx), @@ -657,7 +657,7 @@ timeout = 4 ` resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elbv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTargetGroupDestroy(ctx), @@ -703,7 +703,7 @@ func TestAccELBV2TargetGroup_HealthCheck_enable(t *testing.T) { resourceName := "aws_lb_target_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elbv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTargetGroupDestroy(ctx), @@ -739,7 +739,7 @@ func TestAccELBV2TargetGroup_Name_generated(t *testing.T) { resourceName := "aws_lb_target_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elbv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTargetGroupDestroy(ctx), @@ -761,7 +761,7 @@ func TestAccELBV2TargetGroup_Name_prefix(t *testing.T) { resourceName := "aws_lb_target_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elbv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTargetGroupDestroy(ctx), @@ -784,7 +784,7 @@ func TestAccELBV2TargetGroup_NetworkLB_tcpHealthCheckUpdated(t *testing.T) { resourceName := "aws_lb_target_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elbv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTargetGroupDestroy(ctx), @@ -847,7 +847,7 @@ func TestAccELBV2TargetGroup_networkLB_TargetGroupWithConnectionTermination(t *t resourceName := "aws_lb_target_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elbv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTargetGroupDestroy(ctx), @@ -877,7 +877,7 @@ func TestAccELBV2TargetGroup_NetworkLB_targetGroupWithProxy(t *testing.T) { resourceName := "aws_lb_target_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elbv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTargetGroupDestroy(ctx), @@ -907,7 +907,7 @@ func TestAccELBV2TargetGroup_preserveClientIPValid(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elbv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTargetGroupDestroy(ctx), @@ -937,7 +937,7 @@ func TestAccELBV2TargetGroup_Geneve_basic(t *testing.T) { resourceName := "aws_lb_target_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckGatewayLoadBalancer(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckGatewayLoadBalancer(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elbv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTargetGroupDestroy(ctx), @@ -973,7 +973,7 @@ func TestAccELBV2TargetGroup_Geneve_notSticky(t *testing.T) { resourceName := "aws_lb_target_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckGatewayLoadBalancer(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckGatewayLoadBalancer(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elbv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTargetGroupDestroy(ctx), @@ -1014,7 +1014,7 @@ func TestAccELBV2TargetGroup_Geneve_Sticky(t *testing.T) { resourceName := "aws_lb_target_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckGatewayLoadBalancer(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckGatewayLoadBalancer(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elbv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTargetGroupDestroy(ctx), @@ -1052,7 +1052,7 @@ func TestAccELBV2TargetGroup_Geneve_targetFailover(t *testing.T) { resourceName := "aws_lb_target_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckGatewayLoadBalancer(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckGatewayLoadBalancer(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elbv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTargetGroupDestroy(ctx), @@ -1110,7 +1110,7 @@ func TestAccELBV2TargetGroup_Stickiness_defaultALB(t *testing.T) { resourceName := "aws_lb_target_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elbv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTargetGroupDestroy(ctx), @@ -1135,7 +1135,7 @@ func TestAccELBV2TargetGroup_Stickiness_defaultNLB(t *testing.T) { resourceName := "aws_lb_target_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elbv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTargetGroupDestroy(ctx), @@ -1176,7 +1176,7 @@ func TestAccELBV2TargetGroup_Stickiness_invalidALB(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elbv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTargetGroupDestroy(ctx), @@ -1207,7 +1207,7 @@ func TestAccELBV2TargetGroup_Stickiness_invalidNLB(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elbv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTargetGroupDestroy(ctx), @@ -1239,7 +1239,7 @@ func TestAccELBV2TargetGroup_Stickiness_validALB(t *testing.T) { resourceName := "aws_lb_target_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elbv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTargetGroupDestroy(ctx), @@ -1275,7 +1275,7 @@ func TestAccELBV2TargetGroup_Stickiness_validNLB(t *testing.T) { resourceName := "aws_lb_target_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elbv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTargetGroupDestroy(ctx), @@ -1327,7 +1327,7 @@ func TestAccELBV2TargetGroup_tags(t *testing.T) { resourceName := "aws_lb_target_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elbv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTargetGroupDestroy(ctx), @@ -1368,7 +1368,7 @@ func TestAccELBV2TargetGroup_Stickiness_updateAppEnabled(t *testing.T) { resourceName := "aws_lb_target_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elbv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTargetGroupDestroy(ctx), @@ -1457,7 +1457,7 @@ func TestAccELBV2TargetGroup_HealthCheck_update(t *testing.T) { resourceName := "aws_lb_target_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elbv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTargetGroupDestroy(ctx), @@ -1523,7 +1523,7 @@ func TestAccELBV2TargetGroup_Stickiness_updateEnabled(t *testing.T) { resourceName := "aws_lb_target_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elbv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTargetGroupDestroy(ctx), @@ -1610,7 +1610,7 @@ func TestAccELBV2TargetGroup_HealthCheck_without(t *testing.T) { resourceName := "aws_lb_target_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elbv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTargetGroupDestroy(ctx), @@ -1636,7 +1636,7 @@ func TestAccELBV2TargetGroup_ALBAlias_basic(t *testing.T) { resourceName := "aws_alb_target_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elbv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTargetGroupDestroy(ctx), @@ -1682,7 +1682,7 @@ func TestAccELBV2TargetGroup_ALBAlias_changeNameForceNew(t *testing.T) { resourceName := "aws_alb_target_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elbv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTargetGroupDestroy(ctx), @@ -1712,7 +1712,7 @@ func TestAccELBV2TargetGroup_ALBAlias_changePortForceNew(t *testing.T) { resourceName := "aws_alb_target_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elbv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTargetGroupDestroy(ctx), @@ -1742,7 +1742,7 @@ func TestAccELBV2TargetGroup_ALBAlias_changeProtocolForceNew(t *testing.T) { resourceName := "aws_alb_target_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elbv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTargetGroupDestroy(ctx), @@ -1772,7 +1772,7 @@ func TestAccELBV2TargetGroup_ALBAlias_changeVPCForceNew(t *testing.T) { resourceName := "aws_alb_target_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elbv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTargetGroupDestroy(ctx), @@ -1800,7 +1800,7 @@ func TestAccELBV2TargetGroup_ALBAlias_generatedName(t *testing.T) { resourceName := "aws_alb_target_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elbv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTargetGroupDestroy(ctx), @@ -1822,7 +1822,7 @@ func TestAccELBV2TargetGroup_ALBAlias_lambda(t *testing.T) { resourceName := "aws_alb_target_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elbv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTargetGroupDestroy(ctx), @@ -1858,7 +1858,7 @@ func TestAccELBV2TargetGroup_ALBAlias_lambdaMultiValueHeadersEnabled(t *testing. resourceName := "aws_alb_target_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elbv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTargetGroupDestroy(ctx), @@ -1908,7 +1908,7 @@ func TestAccELBV2TargetGroup_ALBAlias_missingPortProtocolVPC(t *testing.T) { rName := fmt.Sprintf("test-target-group-%s", sdkacctest.RandString(10)) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elbv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTargetGroupDestroy(ctx), @@ -1936,7 +1936,7 @@ func TestAccELBV2TargetGroup_ALBAlias_namePrefix(t *testing.T) { resourceName := "aws_alb_target_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elbv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTargetGroupDestroy(ctx), @@ -1959,7 +1959,7 @@ func TestAccELBV2TargetGroup_ALBAlias_setAndUpdateSlowStart(t *testing.T) { resourceName := "aws_alb_target_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elbv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTargetGroupDestroy(ctx), @@ -1989,7 +1989,7 @@ func TestAccELBV2TargetGroup_ALBAlias_tags(t *testing.T) { resourceName := "aws_alb_target_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elbv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTargetGroupDestroy(ctx), @@ -2022,7 +2022,7 @@ func TestAccELBV2TargetGroup_ALBAlias_updateHealthCheck(t *testing.T) { resourceName := "aws_alb_target_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elbv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTargetGroupDestroy(ctx), @@ -2086,7 +2086,7 @@ func TestAccELBV2TargetGroup_ALBAlias_updateLoadBalancingAlgorithmType(t *testin resourceName := "aws_alb_target_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elbv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTargetGroupDestroy(ctx), @@ -2129,7 +2129,7 @@ func TestAccELBV2TargetGroup_ALBAlias_updateStickinessEnabled(t *testing.T) { resourceName := "aws_alb_target_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elbv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTargetGroupDestroy(ctx), @@ -2216,7 +2216,7 @@ func TestAccELBV2TargetGroup_Name_noDuplicates(t *testing.T) { resourceName := "aws_lb_target_group.first" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elbv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTargetGroupDestroy(ctx), From f985a7d63bb5f4e13ce08f6886f79d73b2f4ee08 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Fri, 24 Feb 2023 16:36:55 -0500 Subject: [PATCH 151/763] Add 'Context' argument to 'acctest.PreCheck' for emr. --- internal/service/emr/cluster_test.go | 68 +++++++++---------- internal/service/emr/instance_fleet_test.go | 8 +-- internal/service/emr/instance_group_test.go | 16 ++--- .../emr/managed_scaling_policy_test.go | 10 +-- .../emr/release_labels_data_source_test.go | 10 +-- .../emr/security_configuration_test.go | 2 +- .../emr/studio_session_mapping_test.go | 4 +- internal/service/emr/studio_test.go | 8 +-- 8 files changed, 63 insertions(+), 63 deletions(-) diff --git a/internal/service/emr/cluster_test.go b/internal/service/emr/cluster_test.go index 781c62a1f983..7c202f9258bd 100644 --- a/internal/service/emr/cluster_test.go +++ b/internal/service/emr/cluster_test.go @@ -27,7 +27,7 @@ func TestAccEMRCluster_basic(t *testing.T) { resourceName := "aws_emr_cluster.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, emr.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClusterDestroy(ctx), @@ -83,7 +83,7 @@ func TestAccEMRCluster_autoTerminationPolicy(t *testing.T) { resourceName := "aws_emr_cluster.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionNot(t, endpoints.AwsUsGovPartitionID) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionNot(t, endpoints.AwsUsGovPartitionID) }, ErrorCheck: acctest.ErrorCheck(t, emr.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClusterDestroy(ctx), @@ -147,7 +147,7 @@ func TestAccEMRCluster_additionalInfo(t *testing.T) { resourceName := "aws_emr_cluster.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, emr.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClusterDestroy(ctx), @@ -183,7 +183,7 @@ func TestAccEMRCluster_disappears(t *testing.T) { resourceName := "aws_emr_cluster.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, emr.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClusterDestroy(ctx), @@ -208,7 +208,7 @@ func TestAccEMRCluster_sJSON(t *testing.T) { resourceName := "aws_emr_cluster.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, emr.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClusterDestroy(ctx), @@ -308,7 +308,7 @@ func TestAccEMRCluster_CoreInstanceGroup_autoScalingPolicy(t *testing.T) { resourceName := "aws_emr_cluster.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, emr.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClusterDestroy(ctx), @@ -360,7 +360,7 @@ func TestAccEMRCluster_CoreInstanceGroup_bidPrice(t *testing.T) { resourceName := "aws_emr_cluster.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, emr.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClusterDestroy(ctx), @@ -403,7 +403,7 @@ func TestAccEMRCluster_CoreInstanceGroup_instanceCount(t *testing.T) { resourceName := "aws_emr_cluster.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, emr.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClusterDestroy(ctx), @@ -455,7 +455,7 @@ func TestAccEMRCluster_CoreInstanceGroup_instanceType(t *testing.T) { resourceName := "aws_emr_cluster.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, emr.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClusterDestroy(ctx), @@ -498,7 +498,7 @@ func TestAccEMRCluster_CoreInstanceGroup_name(t *testing.T) { resourceName := "aws_emr_cluster.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, emr.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClusterDestroy(ctx), @@ -544,7 +544,7 @@ func TestAccEMRCluster_EC2Attributes_defaultManagedSecurityGroups(t *testing.T) vpcResourceName := "aws_vpc.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, emr.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClusterDestroy(ctx), @@ -586,7 +586,7 @@ func TestAccEMRCluster_Kerberos_clusterDedicatedKdc(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) password := fmt.Sprintf("NeverKeepPasswordsInPlainText%s!", rName) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, emr.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClusterDestroy(ctx), @@ -622,7 +622,7 @@ func TestAccEMRCluster_MasterInstanceGroup_bidPrice(t *testing.T) { resourceName := "aws_emr_cluster.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, emr.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClusterDestroy(ctx), @@ -665,7 +665,7 @@ func TestAccEMRCluster_MasterInstanceGroup_instanceCount(t *testing.T) { resourceName := "aws_emr_cluster.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, emr.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClusterDestroy(ctx), @@ -708,7 +708,7 @@ func TestAccEMRCluster_MasterInstanceGroup_instanceType(t *testing.T) { resourceName := "aws_emr_cluster.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, emr.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClusterDestroy(ctx), @@ -751,7 +751,7 @@ func TestAccEMRCluster_MasterInstanceGroup_name(t *testing.T) { resourceName := "aws_emr_cluster.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, emr.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClusterDestroy(ctx), @@ -794,7 +794,7 @@ func TestAccEMRCluster_security(t *testing.T) { resourceName := "aws_emr_cluster.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, emr.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClusterDestroy(ctx), @@ -827,7 +827,7 @@ func TestAccEMRCluster_Step_basic(t *testing.T) { resourceName := "aws_emr_cluster.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, emr.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClusterDestroy(ctx), @@ -866,7 +866,7 @@ func TestAccEMRCluster_Step_mode(t *testing.T) { resourceName := "aws_emr_cluster.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, emr.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClusterDestroy(ctx), @@ -933,7 +933,7 @@ func TestAccEMRCluster_Step_multiple(t *testing.T) { resourceName := "aws_emr_cluster.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, emr.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClusterDestroy(ctx), @@ -976,7 +976,7 @@ func TestAccEMRCluster_Step_multiple_listStates(t *testing.T) { resourceName := "aws_emr_cluster.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, emr.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClusterDestroy(ctx), @@ -1020,7 +1020,7 @@ func TestAccEMRCluster_Bootstrap_ordering(t *testing.T) { resourceName := "aws_emr_cluster.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, emr.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClusterDestroy(ctx), @@ -1121,7 +1121,7 @@ func TestAccEMRCluster_terminationProtected(t *testing.T) { resourceName := "aws_emr_cluster.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, emr.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClusterDestroy(ctx), @@ -1179,7 +1179,7 @@ func TestAccEMRCluster_keepJob(t *testing.T) { resourceName := "aws_emr_cluster.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, emr.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClusterDestroy(ctx), @@ -1212,7 +1212,7 @@ func TestAccEMRCluster_visibleToAllUsers(t *testing.T) { resourceName := "aws_emr_cluster.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, emr.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClusterDestroy(ctx), @@ -1263,7 +1263,7 @@ func TestAccEMRCluster_s3Logging(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) bucketName := fmt.Sprintf("s3n://%s/", rName) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, emr.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClusterDestroy(ctx), @@ -1297,7 +1297,7 @@ func TestAccEMRCluster_s3LogEncryption(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) bucketName := fmt.Sprintf("s3n://%s/", rName) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, emr.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClusterDestroy(ctx), @@ -1331,7 +1331,7 @@ func TestAccEMRCluster_tags(t *testing.T) { resourceName := "aws_emr_cluster.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, emr.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClusterDestroy(ctx), @@ -1377,7 +1377,7 @@ func TestAccEMRCluster_RootVolume_size(t *testing.T) { resourceName := "aws_emr_cluster.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, emr.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClusterDestroy(ctx), @@ -1416,7 +1416,7 @@ func TestAccEMRCluster_StepConcurrency_level(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resourceName := "aws_emr_cluster.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, emr.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClusterDestroy(ctx), @@ -1455,7 +1455,7 @@ func TestAccEMRCluster_ebs(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resourceName := "aws_emr_cluster.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, emr.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClusterDestroy(ctx), @@ -1489,7 +1489,7 @@ func TestAccEMRCluster_CustomAMI_id(t *testing.T) { resourceName := "aws_emr_cluster.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, emr.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClusterDestroy(ctx), @@ -1525,7 +1525,7 @@ func TestAccEMRCluster_InstanceFleet_basic(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, emr.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClusterDestroy(ctx), @@ -1590,7 +1590,7 @@ func TestAccEMRCluster_InstanceFleetMaster_only(t *testing.T) { resourceName := "aws_emr_cluster.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, emr.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClusterDestroy(ctx), diff --git a/internal/service/emr/instance_fleet_test.go b/internal/service/emr/instance_fleet_test.go index 5b67de2b0b83..ace9edebc1cb 100644 --- a/internal/service/emr/instance_fleet_test.go +++ b/internal/service/emr/instance_fleet_test.go @@ -21,7 +21,7 @@ func TestAccEMRInstanceFleet_basic(t *testing.T) { resourceName := "aws_emr_instance_fleet.task" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, emr.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: acctest.CheckDestroyNoop, @@ -51,7 +51,7 @@ func TestAccEMRInstanceFleet_Zero_count(t *testing.T) { resourceName := "aws_emr_instance_fleet.task" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, emr.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: acctest.CheckDestroyNoop, @@ -89,7 +89,7 @@ func TestAccEMRInstanceFleet_ebsBasic(t *testing.T) { resourceName := "aws_emr_instance_fleet.task" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, emr.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: acctest.CheckDestroyNoop, @@ -119,7 +119,7 @@ func TestAccEMRInstanceFleet_full(t *testing.T) { resourceName := "aws_emr_instance_fleet.task" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, emr.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: acctest.CheckDestroyNoop, diff --git a/internal/service/emr/instance_group_test.go b/internal/service/emr/instance_group_test.go index 2442d48343c1..2ee036c4d905 100644 --- a/internal/service/emr/instance_group_test.go +++ b/internal/service/emr/instance_group_test.go @@ -22,7 +22,7 @@ func TestAccEMRInstanceGroup_basic(t *testing.T) { resourceName := "aws_emr_instance_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, emr.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: acctest.CheckDestroyNoop, @@ -54,7 +54,7 @@ func TestAccEMRInstanceGroup_disappears(t *testing.T) { resourceName := "aws_emr_instance_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, emr.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: acctest.CheckDestroyNoop, @@ -82,7 +82,7 @@ func TestAccEMRInstanceGroup_Disappears_emrCluster(t *testing.T) { emrClusterResourceName := "aws_emr_cluster.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, emr.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: acctest.CheckDestroyNoop, @@ -107,7 +107,7 @@ func TestAccEMRInstanceGroup_bidPrice(t *testing.T) { resourceName := "aws_emr_instance_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, emr.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: acctest.CheckDestroyNoop, @@ -160,7 +160,7 @@ func TestAccEMRInstanceGroup_sJSON(t *testing.T) { resourceName := "aws_emr_instance_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, emr.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: acctest.CheckDestroyNoop, @@ -204,7 +204,7 @@ func TestAccEMRInstanceGroup_autoScalingPolicy(t *testing.T) { resourceName := "aws_emr_instance_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, emr.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: acctest.CheckDestroyNoop, @@ -250,7 +250,7 @@ func TestAccEMRInstanceGroup_instanceCount(t *testing.T) { resourceName := "aws_emr_instance_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, emr.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: acctest.CheckDestroyNoop, @@ -281,7 +281,7 @@ func TestAccEMRInstanceGroup_EBS_ebsOptimized(t *testing.T) { resourceName := "aws_emr_instance_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, emr.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: acctest.CheckDestroyNoop, diff --git a/internal/service/emr/managed_scaling_policy_test.go b/internal/service/emr/managed_scaling_policy_test.go index eabede808f51..8865f8590f77 100644 --- a/internal/service/emr/managed_scaling_policy_test.go +++ b/internal/service/emr/managed_scaling_policy_test.go @@ -34,7 +34,7 @@ func TestAccEMRManagedScalingPolicy_basic(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, emr.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckManagedScalingPolicyDestroy(ctx), @@ -61,7 +61,7 @@ func TestAccEMRManagedScalingPolicy_disappears(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, emr.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckManagedScalingPolicyDestroy(ctx), @@ -84,7 +84,7 @@ func TestAccEMRManagedScalingPolicy_ComputeLimits_maximumCoreCapacityUnits(t *te rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, emr.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckManagedScalingPolicyDestroy(ctx), @@ -111,7 +111,7 @@ func TestAccEMRManagedScalingPolicy_ComputeLimits_maximumOnDemandCapacityUnits(t rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, emr.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckManagedScalingPolicyDestroy(ctx), @@ -138,7 +138,7 @@ func TestAccEMRManagedScalingPolicy_ComputeLimits_maximumOnDemandCapacityUnitsSp rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, emr.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckManagedScalingPolicyDestroy(ctx), diff --git a/internal/service/emr/release_labels_data_source_test.go b/internal/service/emr/release_labels_data_source_test.go index f79112a677fc..83f761760a1a 100644 --- a/internal/service/emr/release_labels_data_source_test.go +++ b/internal/service/emr/release_labels_data_source_test.go @@ -12,7 +12,7 @@ func TestAccEMRReleaseLabels_basic(t *testing.T) { dataSourceResourceName := "data.aws_emr_release_labels.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, emr.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: nil, @@ -31,7 +31,7 @@ func TestAccEMRReleaseLabels_prefix(t *testing.T) { dataSourceResourceName := "data.aws_emr_release_labels.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, emr.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: nil, @@ -50,7 +50,7 @@ func TestAccEMRReleaseLabels_application(t *testing.T) { dataSourceResourceName := "data.aws_emr_release_labels.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, emr.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: nil, @@ -69,7 +69,7 @@ func TestAccEMRReleaseLabels_full(t *testing.T) { dataSourceResourceName := "data.aws_emr_release_labels.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, emr.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: nil, @@ -88,7 +88,7 @@ func TestAccEMRReleaseLabels_empty(t *testing.T) { dataSourceResourceName := "data.aws_emr_release_labels.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, emr.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: nil, diff --git a/internal/service/emr/security_configuration_test.go b/internal/service/emr/security_configuration_test.go index 6e1f9cc988eb..20de0e8b6149 100644 --- a/internal/service/emr/security_configuration_test.go +++ b/internal/service/emr/security_configuration_test.go @@ -19,7 +19,7 @@ func TestAccEMRSecurityConfiguration_basic(t *testing.T) { resourceName := "aws_emr_security_configuration.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, emr.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSecurityConfigurationDestroy(ctx), diff --git a/internal/service/emr/studio_session_mapping_test.go b/internal/service/emr/studio_session_mapping_test.go index 7d9f536e4aea..235217afcfe3 100644 --- a/internal/service/emr/studio_session_mapping_test.go +++ b/internal/service/emr/studio_session_mapping_test.go @@ -26,7 +26,7 @@ func TestAccEMRStudioSessionMapping_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) testAccPreCheckUserID(t) }, ErrorCheck: acctest.ErrorCheck(t, emr.EndpointsID), @@ -71,7 +71,7 @@ func TestAccEMRStudioSessionMapping_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) testAccPreCheckUserID(t) }, ErrorCheck: acctest.ErrorCheck(t, emr.EndpointsID), diff --git a/internal/service/emr/studio_test.go b/internal/service/emr/studio_test.go index 32923c89c1df..54722a154bed 100644 --- a/internal/service/emr/studio_test.go +++ b/internal/service/emr/studio_test.go @@ -23,7 +23,7 @@ func TestAccEMRStudio_sso(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, emr.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckStudioDestroy(ctx), @@ -61,7 +61,7 @@ func TestAccEMRStudio_iam(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, emr.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckStudioDestroy(ctx), @@ -97,7 +97,7 @@ func TestAccEMRStudio_disappears(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, emr.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckStudioDestroy(ctx), @@ -122,7 +122,7 @@ func TestAccEMRStudio_tags(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, emr.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckStudioDestroy(ctx), From 99b0db288806405b9305756300bc213dfe2686a4 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Fri, 24 Feb 2023 16:36:55 -0500 Subject: [PATCH 152/763] Add 'Context' argument to 'acctest.PreCheck' for emrcontainers. --- .../emrcontainers/virtual_cluster_data_source_test.go | 2 +- internal/service/emrcontainers/virtual_cluster_test.go | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/internal/service/emrcontainers/virtual_cluster_data_source_test.go b/internal/service/emrcontainers/virtual_cluster_data_source_test.go index 30fe4479cd8a..d6f22b5751d6 100644 --- a/internal/service/emrcontainers/virtual_cluster_data_source_test.go +++ b/internal/service/emrcontainers/virtual_cluster_data_source_test.go @@ -23,7 +23,7 @@ func TestAccEMRContainersVirtualClusterDataSource_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckIAMServiceLinkedRole(ctx, t, "/aws-service-role/emr-containers.amazonaws.com") }, ErrorCheck: acctest.ErrorCheck(t, eks.EndpointsID), diff --git a/internal/service/emrcontainers/virtual_cluster_test.go b/internal/service/emrcontainers/virtual_cluster_test.go index da2f54e01583..537c5d38fd4d 100644 --- a/internal/service/emrcontainers/virtual_cluster_test.go +++ b/internal/service/emrcontainers/virtual_cluster_test.go @@ -29,7 +29,7 @@ func TestAccEMRContainersVirtualCluster_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckIAMServiceLinkedRole(ctx, t, "/aws-service-role/emr-containers.amazonaws.com") }, ErrorCheck: acctest.ErrorCheck(t, emrcontainers.EndpointsID), @@ -85,7 +85,7 @@ func TestAccEMRContainersVirtualCluster_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckIAMServiceLinkedRole(ctx, t, "/aws-service-role/emr-containers.amazonaws.com") }, ErrorCheck: acctest.ErrorCheck(t, emrcontainers.EndpointsID), @@ -119,7 +119,7 @@ func TestAccEMRContainersVirtualCluster_tags(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckIAMServiceLinkedRole(ctx, t, "/aws-service-role/emr-containers.amazonaws.com") }, ErrorCheck: acctest.ErrorCheck(t, emrcontainers.EndpointsID), From 01b0de0919500e09fb01d88f74909d1ac5e9d710 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Fri, 24 Feb 2023 16:36:56 -0500 Subject: [PATCH 153/763] Add 'Context' argument to 'acctest.PreCheck' for emrserverless. --- internal/service/emrserverless/application_test.go | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/internal/service/emrserverless/application_test.go b/internal/service/emrserverless/application_test.go index 7d757b17e70c..ed88261e753d 100644 --- a/internal/service/emrserverless/application_test.go +++ b/internal/service/emrserverless/application_test.go @@ -23,7 +23,7 @@ func TestAccEMRServerlessApplication_basic(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, emrserverless.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckApplicationDestroy(ctx), @@ -62,7 +62,7 @@ func TestAccEMRServerlessApplication_arch(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, emrserverless.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckApplicationDestroy(ctx), @@ -97,7 +97,7 @@ func TestAccEMRServerlessApplication_initialCapacity(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, emrserverless.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckApplicationDestroy(ctx), @@ -144,7 +144,7 @@ func TestAccEMRServerlessApplication_maxCapacity(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, emrserverless.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckApplicationDestroy(ctx), @@ -182,7 +182,7 @@ func TestAccEMRServerlessApplication_network(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, emrserverless.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckApplicationDestroy(ctx), @@ -212,7 +212,7 @@ func TestAccEMRServerlessApplication_disappears(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, emrserverless.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckApplicationDestroy(ctx), @@ -237,7 +237,7 @@ func TestAccEMRServerlessApplication_tags(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, emrserverless.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckApplicationDestroy(ctx), From f73d604a9af14117f5b1fb17476846f47b6ad737 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Fri, 24 Feb 2023 16:36:56 -0500 Subject: [PATCH 154/763] Add 'Context' argument to 'acctest.PreCheck' for events. --- .../service/events/api_destination_test.go | 6 +-- internal/service/events/archive_test.go | 8 ++-- .../service/events/bus_data_source_test.go | 2 +- internal/service/events/bus_policy_test.go | 6 +-- internal/service/events/bus_test.go | 10 ++-- .../events/connection_data_source_test.go | 2 +- internal/service/events/connection_test.go | 10 ++-- internal/service/events/permission_test.go | 12 ++--- internal/service/events/rule_test.go | 24 +++++----- .../service/events/source_data_source_test.go | 2 +- internal/service/events/target_test.go | 46 +++++++++---------- 11 files changed, 64 insertions(+), 64 deletions(-) diff --git a/internal/service/events/api_destination_test.go b/internal/service/events/api_destination_test.go index f45af0fa467e..1e685f821720 100644 --- a/internal/service/events/api_destination_test.go +++ b/internal/service/events/api_destination_test.go @@ -32,7 +32,7 @@ func TestAccEventsAPIDestination_basic(t *testing.T) { resourceName := "aws_cloudwatch_event_api_destination.basic" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, eventbridge.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckAPIDestinationDestroy(ctx), @@ -106,7 +106,7 @@ func TestAccEventsAPIDestination_optional(t *testing.T) { resourceName := "aws_cloudwatch_event_api_destination.optional" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, eventbridge.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckAPIDestinationDestroy(ctx), @@ -183,7 +183,7 @@ func TestAccEventsAPIDestination_disappears(t *testing.T) { resourceName := "aws_cloudwatch_event_api_destination.basic" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, eventbridge.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckAPIDestinationDestroy(ctx), diff --git a/internal/service/events/archive_test.go b/internal/service/events/archive_test.go index 8f969d33aeea..5c2f92bd428c 100644 --- a/internal/service/events/archive_test.go +++ b/internal/service/events/archive_test.go @@ -22,7 +22,7 @@ func TestAccEventsArchive_basic(t *testing.T) { resourceName := "aws_cloudwatch_event_archive.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, eventbridge.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckArchiveDestroy(ctx), @@ -54,7 +54,7 @@ func TestAccEventsArchive_update(t *testing.T) { archiveName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, eventbridge.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckArchiveDestroy(ctx), @@ -85,7 +85,7 @@ func TestAccEventsArchive_disappears(t *testing.T) { resourceName := "aws_cloudwatch_event_archive.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, eventbridge.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckArchiveDestroy(ctx), @@ -160,7 +160,7 @@ func TestAccEventsArchive_retentionSetOnCreation(t *testing.T) { resourceName := "aws_cloudwatch_event_archive.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, eventbridge.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckArchiveDestroy(ctx), diff --git a/internal/service/events/bus_data_source_test.go b/internal/service/events/bus_data_source_test.go index eac219d95ee7..e7a5eb160856 100644 --- a/internal/service/events/bus_data_source_test.go +++ b/internal/service/events/bus_data_source_test.go @@ -16,7 +16,7 @@ func TestAccEventsBusDataSource_basic(t *testing.T) { resourceName := "aws_cloudwatch_event_bus.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, eventbridge.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ diff --git a/internal/service/events/bus_policy_test.go b/internal/service/events/bus_policy_test.go index 5eb8d8311ab0..48d9da4ff488 100644 --- a/internal/service/events/bus_policy_test.go +++ b/internal/service/events/bus_policy_test.go @@ -22,7 +22,7 @@ func TestAccEventsBusPolicy_basic(t *testing.T) { rstring := sdkacctest.RandString(5) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, eventbridge.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckBusDestroy(ctx), @@ -56,7 +56,7 @@ func TestAccEventsBusPolicy_ignoreEquivalent(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, eventbridge.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckBusDestroy(ctx), @@ -82,7 +82,7 @@ func TestAccEventsBusPolicy_disappears(t *testing.T) { rstring := sdkacctest.RandString(5) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, eventbridge.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckBusDestroy(ctx), diff --git a/internal/service/events/bus_test.go b/internal/service/events/bus_test.go index ba41a3b83c56..4d7601ba0a5a 100644 --- a/internal/service/events/bus_test.go +++ b/internal/service/events/bus_test.go @@ -26,7 +26,7 @@ func TestAccEventsBus_basic(t *testing.T) { resourceName := "aws_cloudwatch_event_bus.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, eventbridge.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckBusDestroy(ctx), @@ -78,7 +78,7 @@ func TestAccEventsBus_tags(t *testing.T) { resourceName := "aws_cloudwatch_event_bus.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, eventbridge.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckBusDestroy(ctx), @@ -130,7 +130,7 @@ func TestAccEventsBus_tags(t *testing.T) { func TestAccEventsBus_default(t *testing.T) { ctx := acctest.Context(t) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, eventbridge.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckBusDestroy(ctx), @@ -151,7 +151,7 @@ func TestAccEventsBus_disappears(t *testing.T) { resourceName := "aws_cloudwatch_event_bus.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, eventbridge.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckBusDestroy(ctx), @@ -180,7 +180,7 @@ func TestAccEventsBus_partnerEventSource(t *testing.T) { resourceName := "aws_cloudwatch_event_bus.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, eventbridge.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckBusDestroy(ctx), diff --git a/internal/service/events/connection_data_source_test.go b/internal/service/events/connection_data_source_test.go index 4becdc90f38a..86e16e560b7c 100644 --- a/internal/service/events/connection_data_source_test.go +++ b/internal/service/events/connection_data_source_test.go @@ -19,7 +19,7 @@ func TestAccEventsConnectionDataSource_Connection_basic(t *testing.T) { value := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ diff --git a/internal/service/events/connection_test.go b/internal/service/events/connection_test.go index 7735e4e7e158..90edca801556 100644 --- a/internal/service/events/connection_test.go +++ b/internal/service/events/connection_test.go @@ -35,7 +35,7 @@ func TestAccEventsConnection_apiKey(t *testing.T) { resourceName := "aws_cloudwatch_event_connection.api_key" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, eventbridge.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckConnectionDestroy(ctx), @@ -118,7 +118,7 @@ func TestAccEventsConnection_basic(t *testing.T) { resourceName := "aws_cloudwatch_event_connection.basic" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, eventbridge.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckConnectionDestroy(ctx), @@ -238,7 +238,7 @@ func TestAccEventsConnection_oAuth(t *testing.T) { resourceName := "aws_cloudwatch_event_connection.oauth" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, eventbridge.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckConnectionDestroy(ctx), @@ -404,7 +404,7 @@ func TestAccEventsConnection_invocationHTTPParameters(t *testing.T) { resourceName := "aws_cloudwatch_event_connection.invocation_http_parameters" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, eventbridge.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckConnectionDestroy(ctx), @@ -551,7 +551,7 @@ func TestAccEventsConnection_disappears(t *testing.T) { resourceName := "aws_cloudwatch_event_connection.api_key" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, eventbridge.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckConnectionDestroy(ctx), diff --git a/internal/service/events/permission_test.go b/internal/service/events/permission_test.go index 6991e59de4c8..8e50884a6506 100644 --- a/internal/service/events/permission_test.go +++ b/internal/service/events/permission_test.go @@ -27,7 +27,7 @@ func TestAccEventsPermission_basic(t *testing.T) { resourceName := "aws_cloudwatch_event_permission.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, eventbridge.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckPermissionDestroy(ctx), @@ -100,7 +100,7 @@ func TestAccEventsPermission_eventBusName(t *testing.T) { resourceName := "aws_cloudwatch_event_permission.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, eventbridge.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckPermissionDestroy(ctx), @@ -132,7 +132,7 @@ func TestAccEventsPermission_action(t *testing.T) { resourceName := "aws_cloudwatch_event_permission.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, eventbridge.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckPermissionDestroy(ctx), @@ -175,7 +175,7 @@ func TestAccEventsPermission_condition(t *testing.T) { resourceName := "aws_cloudwatch_event_permission.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, eventbridge.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckPermissionDestroy(ctx), @@ -219,7 +219,7 @@ func TestAccEventsPermission_multiple(t *testing.T) { resourceName2 := "aws_cloudwatch_event_permission.test2" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, eventbridge.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckPermissionDestroy(ctx), @@ -254,7 +254,7 @@ func TestAccEventsPermission_disappears(t *testing.T) { statementID := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, eventbridge.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckPermissionDestroy(ctx), diff --git a/internal/service/events/rule_test.go b/internal/service/events/rule_test.go index 4d751d0feebc..2d1ecb910590 100644 --- a/internal/service/events/rule_test.go +++ b/internal/service/events/rule_test.go @@ -37,7 +37,7 @@ func TestAccEventsRule_basic(t *testing.T) { resourceName := "aws_cloudwatch_event_rule.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, eventbridge.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRuleDestroy(ctx), @@ -109,7 +109,7 @@ func TestAccEventsRule_eventBusName(t *testing.T) { resourceName := "aws_cloudwatch_event_rule.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, eventbridge.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRuleDestroy(ctx), @@ -160,7 +160,7 @@ func TestAccEventsRule_role(t *testing.T) { iamRoleResourceName := "aws_iam_role.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, eventbridge.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRuleDestroy(ctx), @@ -189,7 +189,7 @@ func TestAccEventsRule_description(t *testing.T) { resourceName := "aws_cloudwatch_event_rule.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, eventbridge.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRuleDestroy(ctx), @@ -226,7 +226,7 @@ func TestAccEventsRule_pattern(t *testing.T) { resourceName := "aws_cloudwatch_event_rule.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, eventbridge.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRuleDestroy(ctx), @@ -264,7 +264,7 @@ func TestAccEventsRule_scheduleAndPattern(t *testing.T) { resourceName := "aws_cloudwatch_event_rule.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, eventbridge.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRuleDestroy(ctx), @@ -294,7 +294,7 @@ func TestAccEventsRule_namePrefix(t *testing.T) { resourceName := "aws_cloudwatch_event_rule.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, eventbridge.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRuleDestroy(ctx), @@ -322,7 +322,7 @@ func TestAccEventsRule_Name_generated(t *testing.T) { resourceName := "aws_cloudwatch_event_rule.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, eventbridge.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRuleDestroy(ctx), @@ -351,7 +351,7 @@ func TestAccEventsRule_tags(t *testing.T) { resourceName := "aws_cloudwatch_event_rule.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, eventbridge.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRuleDestroy(ctx), @@ -404,7 +404,7 @@ func TestAccEventsRule_isEnabled(t *testing.T) { resourceName := "aws_cloudwatch_event_rule.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, eventbridge.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRuleDestroy(ctx), @@ -455,7 +455,7 @@ func TestAccEventsRule_partnerEventBus(t *testing.T) { resourceName := "aws_cloudwatch_event_rule.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, eventbridge.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRuleDestroy(ctx), @@ -492,7 +492,7 @@ func TestAccEventsRule_eventBusARN(t *testing.T) { eventBusName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, eventbridge.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRuleDestroy(ctx), diff --git a/internal/service/events/source_data_source_test.go b/internal/service/events/source_data_source_test.go index e8e2263db1c6..16c554cfc4a6 100644 --- a/internal/service/events/source_data_source_test.go +++ b/internal/service/events/source_data_source_test.go @@ -27,7 +27,7 @@ func TestAccEventsSourceDataSource_basic(t *testing.T) { dataSourceName := "data.aws_cloudwatch_event_source.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, eventbridge.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ diff --git a/internal/service/events/target_test.go b/internal/service/events/target_test.go index 1e426a23a82c..6838c021d604 100644 --- a/internal/service/events/target_test.go +++ b/internal/service/events/target_test.go @@ -28,7 +28,7 @@ func TestAccEventsTarget_basic(t *testing.T) { snsTopicResourceName := "aws_sns_topic.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, eventbridge.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTargetDestroy(ctx), @@ -81,7 +81,7 @@ func TestAccEventsTarget_disappears(t *testing.T) { resourceName := "aws_cloudwatch_event_target.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, eventbridge.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTargetDestroy(ctx), @@ -105,7 +105,7 @@ func TestAccEventsTarget_eventBusName(t *testing.T) { resourceName := "aws_cloudwatch_event_target.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, eventbridge.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTargetDestroy(ctx), @@ -146,7 +146,7 @@ func TestAccEventsTarget_eventBusARN(t *testing.T) { destinationEventBusName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, eventbridge.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTargetDestroy(ctx), @@ -181,7 +181,7 @@ func TestAccEventsTarget_generatedTargetID(t *testing.T) { snsTopicName := sdkacctest.RandomWithPrefix("tf-acc") resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, eventbridge.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTargetDestroy(ctx), @@ -214,7 +214,7 @@ func TestAccEventsTarget_RetryPolicy_deadLetter(t *testing.T) { queueResourceName := "aws_sqs_queue.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, eventbridge.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTargetDestroy(ctx), @@ -254,7 +254,7 @@ func TestAccEventsTarget_full(t *testing.T) { targetID := sdkacctest.RandomWithPrefix("tf-acc-cw-target-full") resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, eventbridge.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTargetDestroy(ctx), @@ -287,7 +287,7 @@ func TestAccEventsTarget_ssmDocument(t *testing.T) { rName := sdkacctest.RandomWithPrefix("tf_ssm_Document") resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, eventbridge.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTargetDestroy(ctx), @@ -320,7 +320,7 @@ func TestAccEventsTarget_http(t *testing.T) { rName := sdkacctest.RandomWithPrefix("tf_http_target") resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, eventbridge.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTargetDestroy(ctx), @@ -357,7 +357,7 @@ func TestAccEventsTarget_http_params(t *testing.T) { rName := sdkacctest.RandomWithPrefix("tf_http_target") resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, eventbridge.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTargetDestroy(ctx), @@ -410,7 +410,7 @@ func TestAccEventsTarget_ecs(t *testing.T) { ecsTaskDefinitionResourceName := "aws_ecs_task_definition.task" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, eventbridge.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTargetDestroy(ctx), @@ -445,7 +445,7 @@ func TestAccEventsTarget_redshift(t *testing.T) { resourceName := "aws_cloudwatch_event_target.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, eventbridge.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTargetDestroy(ctx), @@ -482,7 +482,7 @@ func TestAccEventsTarget_ecsWithoutLaunchType(t *testing.T) { ecsTaskDefinitionResourceName := "aws_ecs_task_definition.task" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, eventbridge.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTargetDestroy(ctx), @@ -543,7 +543,7 @@ func TestAccEventsTarget_ecsWithBlankLaunchType(t *testing.T) { ecsTaskDefinitionResourceName := "aws_ecs_task_definition.task" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, eventbridge.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTargetDestroy(ctx), @@ -598,7 +598,7 @@ func TestAccEventsTarget_ecsWithBlankTaskCount(t *testing.T) { resourceName := "aws_cloudwatch_event_target.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, eventbridge.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTargetDestroy(ctx), @@ -628,7 +628,7 @@ func TestAccEventsTarget_ecsFull(t *testing.T) { resourceName := "aws_cloudwatch_event_target.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, eventbridge.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTargetDestroy(ctx), @@ -666,7 +666,7 @@ func TestAccEventsTarget_ecsCapacityProvider(t *testing.T) { resourceName := "aws_cloudwatch_event_target.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, eventbridge.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTargetDestroy(ctx), @@ -701,7 +701,7 @@ func TestAccEventsTarget_batch(t *testing.T) { rName := sdkacctest.RandomWithPrefix("tf_batch_target") resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, eventbridge.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTargetDestroy(ctx), @@ -732,7 +732,7 @@ func TestAccEventsTarget_kinesis(t *testing.T) { rName := sdkacctest.RandomWithPrefix("tf_kinesis_target") resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, eventbridge.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTargetDestroy(ctx), @@ -761,7 +761,7 @@ func TestAccEventsTarget_sqs(t *testing.T) { resourceName := "aws_cloudwatch_event_target.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, eventbridge.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTargetDestroy(ctx), @@ -813,7 +813,7 @@ func TestAccEventsTarget_Input_transformer(t *testing.T) { `) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, eventbridge.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTargetDestroy(ctx), @@ -850,7 +850,7 @@ func TestAccEventsTarget_inputTransformerJSONString(t *testing.T) { resourceName := "aws_cloudwatch_event_target.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, eventbridge.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTargetDestroy(ctx), @@ -883,7 +883,7 @@ func TestAccEventsTarget_partnerEventBus(t *testing.T) { snsTopicResourceName := "aws_sns_topic.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, eventbridge.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTargetDestroy(ctx), From d5a85bded49bb4ff95aba8c697659d8e343d6ea7 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Fri, 24 Feb 2023 16:36:57 -0500 Subject: [PATCH 155/763] Add 'Context' argument to 'acctest.PreCheck' for evidently. --- internal/service/evidently/feature_test.go | 22 +++++++++++----------- internal/service/evidently/launch_test.go | 18 +++++++++--------- internal/service/evidently/project_test.go | 14 +++++++------- internal/service/evidently/segment_test.go | 10 +++++----- 4 files changed, 32 insertions(+), 32 deletions(-) diff --git a/internal/service/evidently/feature_test.go b/internal/service/evidently/feature_test.go index c31311dd87b6..945f3f7dcb98 100644 --- a/internal/service/evidently/feature_test.go +++ b/internal/service/evidently/feature_test.go @@ -26,7 +26,7 @@ func TestAccEvidentlyFeature_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(cloudwatchevidently.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, cloudwatchevidently.EndpointsID), @@ -78,7 +78,7 @@ func TestAccEvidentlyFeature_updateDefaultVariation(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(cloudwatchevidently.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, cloudwatchevidently.EndpointsID), @@ -120,7 +120,7 @@ func TestAccEvidentlyFeature_updateDescription(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(cloudwatchevidently.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, cloudwatchevidently.EndpointsID), @@ -162,7 +162,7 @@ func TestAccEvidentlyFeature_updateEntityOverrides(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(cloudwatchevidently.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, cloudwatchevidently.EndpointsID), @@ -227,7 +227,7 @@ func TestAccEvidentlyFeature_updateEvaluationStrategy(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(cloudwatchevidently.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, cloudwatchevidently.EndpointsID), @@ -273,7 +273,7 @@ func TestAccEvidentlyFeature_updateVariationsBoolValue(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(cloudwatchevidently.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, cloudwatchevidently.EndpointsID), @@ -338,7 +338,7 @@ func TestAccEvidentlyFeature_updateVariationsDoubleValue(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(cloudwatchevidently.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, cloudwatchevidently.EndpointsID), @@ -403,7 +403,7 @@ func TestAccEvidentlyFeature_updateVariationsLongValue(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(cloudwatchevidently.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, cloudwatchevidently.EndpointsID), @@ -469,7 +469,7 @@ func TestAccEvidentlyFeature_updateVariationsStringValue(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(cloudwatchevidently.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, cloudwatchevidently.EndpointsID), @@ -547,7 +547,7 @@ func TestAccEvidentlyFeature_tags(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(cloudwatchevidently.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, cloudwatchevidently.EndpointsID), @@ -597,7 +597,7 @@ func TestAccEvidentlyFeature_disappears(t *testing.T) { resourceName := "aws_evidently_feature.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, cloudwatchevidently.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckFeatureDestroy(ctx), diff --git a/internal/service/evidently/launch_test.go b/internal/service/evidently/launch_test.go index aebdfacb5095..d0a4679d3966 100644 --- a/internal/service/evidently/launch_test.go +++ b/internal/service/evidently/launch_test.go @@ -28,7 +28,7 @@ func TestAccEvidentlyLaunch_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(cloudwatchevidently.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, cloudwatchevidently.EndpointsID), @@ -84,7 +84,7 @@ func TestAccEvidentlyLaunch_updateDescription(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(cloudwatchevidently.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, cloudwatchevidently.EndpointsID), @@ -128,7 +128,7 @@ func TestAccEvidentlyLaunch_updateGroups(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(cloudwatchevidently.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, cloudwatchevidently.EndpointsID), @@ -210,7 +210,7 @@ func TestAccEvidentlyLaunch_updateMetricMonitors(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(cloudwatchevidently.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, cloudwatchevidently.EndpointsID), @@ -302,7 +302,7 @@ func TestAccEvidentlyLaunch_updateRandomizationSalt(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(cloudwatchevidently.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, cloudwatchevidently.EndpointsID), @@ -348,7 +348,7 @@ func TestAccEvidentlyLaunch_scheduledSplitsConfig_updateSteps(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(cloudwatchevidently.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, cloudwatchevidently.EndpointsID), @@ -437,7 +437,7 @@ func TestAccEvidentlyLaunch_scheduledSplitsConfig_steps_updateSegmentOverrides(t resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(cloudwatchevidently.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, cloudwatchevidently.EndpointsID), @@ -544,7 +544,7 @@ func TestAccEvidentlyLaunch_tags(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(cloudwatchevidently.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, cloudwatchevidently.EndpointsID), @@ -596,7 +596,7 @@ func TestAccEvidentlyLaunch_disappears(t *testing.T) { resourceName := "aws_evidently_launch.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, cloudwatchevidently.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckLaunchDestroy(ctx), diff --git a/internal/service/evidently/project_test.go b/internal/service/evidently/project_test.go index 02c983b0948c..1189ef93a12c 100644 --- a/internal/service/evidently/project_test.go +++ b/internal/service/evidently/project_test.go @@ -26,7 +26,7 @@ func TestAccEvidentlyProject_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(cloudwatchevidently.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, cloudwatchevidently.EndpointsID), @@ -89,7 +89,7 @@ func TestAccEvidentlyProject_tags(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(cloudwatchevidently.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, cloudwatchevidently.EndpointsID), @@ -150,7 +150,7 @@ func TestAccEvidentlyProject_updateDataDeliveryCloudWatchLogGroup(t *testing.T) resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(cloudwatchevidently.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, cloudwatchevidently.EndpointsID), @@ -196,7 +196,7 @@ func TestAccEvidentlyProject_updateDataDeliveryS3Bucket(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(cloudwatchevidently.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, cloudwatchevidently.EndpointsID), @@ -247,7 +247,7 @@ func TestAccEvidentlyProject_updateDataDeliveryS3Prefix(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(cloudwatchevidently.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, cloudwatchevidently.EndpointsID), @@ -297,7 +297,7 @@ func TestAccEvidentlyProject_updateDataDeliveryCloudWatchToS3(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(cloudwatchevidently.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, cloudwatchevidently.EndpointsID), @@ -340,7 +340,7 @@ func TestAccEvidentlyProject_disappears(t *testing.T) { resourceName := "aws_evidently_project.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, cloudwatchevidently.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckProjectDestroy(ctx), diff --git a/internal/service/evidently/segment_test.go b/internal/service/evidently/segment_test.go index 82d90b765728..ff6a8a44ee89 100644 --- a/internal/service/evidently/segment_test.go +++ b/internal/service/evidently/segment_test.go @@ -25,7 +25,7 @@ func TestAccEvidentlySegment_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(cloudwatchevidently.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, cloudwatchevidently.EndpointsID), @@ -65,7 +65,7 @@ func TestAccEvidentlySegment_description(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(cloudwatchevidently.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, cloudwatchevidently.EndpointsID), @@ -98,7 +98,7 @@ func TestAccEvidentlySegment_patternJSON(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(cloudwatchevidently.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, cloudwatchevidently.EndpointsID), @@ -130,7 +130,7 @@ func TestAccEvidentlySegment_tags(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(cloudwatchevidently.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, cloudwatchevidently.EndpointsID), @@ -185,7 +185,7 @@ func TestAccEvidentlySegment_disappears(t *testing.T) { resourceName := "aws_evidently_segment.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, cloudwatchevidently.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSegmentDestroy(ctx), From 4603efcf2ce66ce72088cdcd7fffadcadaa35fa6 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Fri, 24 Feb 2023 16:36:57 -0500 Subject: [PATCH 156/763] Add 'Context' argument to 'acctest.PreCheck' for firehose. --- .../delivery_stream_data_source_test.go | 2 +- .../service/firehose/delivery_stream_test.go | 80 +++++++++---------- 2 files changed, 41 insertions(+), 41 deletions(-) diff --git a/internal/service/firehose/delivery_stream_data_source_test.go b/internal/service/firehose/delivery_stream_data_source_test.go index a75520576136..cd72e19f6f46 100644 --- a/internal/service/firehose/delivery_stream_data_source_test.go +++ b/internal/service/firehose/delivery_stream_data_source_test.go @@ -17,7 +17,7 @@ func TestAccFirehoseDeliveryStreamDataSource_basic(t *testing.T) { resourceName := "aws_kinesis_firehose_delivery_stream.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, firehose.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDeliveryStreamDestroy(ctx), diff --git a/internal/service/firehose/delivery_stream_test.go b/internal/service/firehose/delivery_stream_test.go index e82182a0c8df..d7656cec62cc 100644 --- a/internal/service/firehose/delivery_stream_test.go +++ b/internal/service/firehose/delivery_stream_test.go @@ -27,7 +27,7 @@ func TestAccFirehoseDeliveryStream_basic(t *testing.T) { resourceName := "aws_kinesis_firehose_delivery_stream.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, firehose.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDeliveryStreamDestroy(ctx), @@ -68,7 +68,7 @@ func TestAccFirehoseDeliveryStream_disappears(t *testing.T) { resourceName := "aws_kinesis_firehose_delivery_stream.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, firehose.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDeliveryStreamDestroy(ctx), @@ -92,7 +92,7 @@ func TestAccFirehoseDeliveryStream_s3basic(t *testing.T) { resourceName := "aws_kinesis_firehose_delivery_stream.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, firehose.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDeliveryStreamDestroy(ctx), @@ -115,7 +115,7 @@ func TestAccFirehoseDeliveryStream_s3basicWithPrefixes(t *testing.T) { resourceName := "aws_kinesis_firehose_delivery_stream.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, firehose.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDeliveryStreamDestroy(ctx), @@ -171,7 +171,7 @@ func TestAccFirehoseDeliveryStream_s3basicWithSSE(t *testing.T) { resourceName := "aws_kinesis_firehose_delivery_stream.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, firehose.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDeliveryStreamDestroy(ctx), @@ -220,7 +220,7 @@ func TestAccFirehoseDeliveryStream_s3basicWithSSEAndKeyARN(t *testing.T) { resourceName := "aws_kinesis_firehose_delivery_stream.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, firehose.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDeliveryStreamDestroy(ctx), @@ -267,7 +267,7 @@ func TestAccFirehoseDeliveryStream_s3basicWithSSEAndKeyType(t *testing.T) { resourceName := "aws_kinesis_firehose_delivery_stream.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, firehose.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDeliveryStreamDestroy(ctx), @@ -312,7 +312,7 @@ func TestAccFirehoseDeliveryStream_s3basicWithTags(t *testing.T) { resourceName := "aws_kinesis_firehose_delivery_stream.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, firehose.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDeliveryStreamDestroy(ctx), @@ -354,7 +354,7 @@ func TestAccFirehoseDeliveryStream_s3KinesisStreamSource(t *testing.T) { resourceName := "aws_kinesis_firehose_delivery_stream.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, firehose.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDeliveryStreamDestroy(ctx), @@ -377,7 +377,7 @@ func TestAccFirehoseDeliveryStream_s3WithCloudWatchLogging(t *testing.T) { resourceName := "aws_kinesis_firehose_delivery_stream.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, firehose.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDeliveryStreamDestroy(ctx), @@ -407,7 +407,7 @@ func TestAccFirehoseDeliveryStream_s3Updates(t *testing.T) { } resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, firehose.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDeliveryStreamDestroy(ctx), @@ -437,7 +437,7 @@ func TestAccFirehoseDeliveryStream_extendedS3basic(t *testing.T) { resourceName := "aws_kinesis_firehose_delivery_stream.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, firehose.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDeliveryStreamDestroy_ExtendedS3(ctx), @@ -467,7 +467,7 @@ func TestAccFirehoseDeliveryStream_ExtendedS3DataFormatConversion_enabled(t *tes resourceName := "aws_kinesis_firehose_delivery_stream.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, firehose.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDeliveryStreamDestroy_ExtendedS3(ctx), @@ -515,7 +515,7 @@ func TestAccFirehoseDeliveryStream_ExtendedS3_externalUpdate(t *testing.T) { resourceName := "aws_kinesis_firehose_delivery_stream.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, firehose.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDeliveryStreamDestroy_ExtendedS3(ctx), @@ -575,7 +575,7 @@ func TestAccFirehoseDeliveryStream_ExtendedS3DataFormatConversionDeserializer_up resourceName := "aws_kinesis_firehose_delivery_stream.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, firehose.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDeliveryStreamDestroy_ExtendedS3(ctx), @@ -618,7 +618,7 @@ func TestAccFirehoseDeliveryStream_ExtendedS3DataFormatConversionHiveJSONSerDe_e resourceName := "aws_kinesis_firehose_delivery_stream.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, firehose.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDeliveryStreamDestroy_ExtendedS3(ctx), @@ -650,7 +650,7 @@ func TestAccFirehoseDeliveryStream_ExtendedS3DataFormatConversionOpenXJSONSerDe_ resourceName := "aws_kinesis_firehose_delivery_stream.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, firehose.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDeliveryStreamDestroy_ExtendedS3(ctx), @@ -682,7 +682,7 @@ func TestAccFirehoseDeliveryStream_ExtendedS3DataFormatConversionOrcSerDe_empty( resourceName := "aws_kinesis_firehose_delivery_stream.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, firehose.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDeliveryStreamDestroy_ExtendedS3(ctx), @@ -714,7 +714,7 @@ func TestAccFirehoseDeliveryStream_ExtendedS3DataFormatConversionParquetSerDe_em resourceName := "aws_kinesis_firehose_delivery_stream.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, firehose.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDeliveryStreamDestroy_ExtendedS3(ctx), @@ -746,7 +746,7 @@ func TestAccFirehoseDeliveryStream_ExtendedS3DataFormatConversionSerializer_upda resourceName := "aws_kinesis_firehose_delivery_stream.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, firehose.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDeliveryStreamDestroy_ExtendedS3(ctx), @@ -789,7 +789,7 @@ func TestAccFirehoseDeliveryStream_ExtendedS3_errorOutputPrefix(t *testing.T) { resourceName := "aws_kinesis_firehose_delivery_stream.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, firehose.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDeliveryStreamDestroy_ExtendedS3(ctx), @@ -841,7 +841,7 @@ func TestAccFirehoseDeliveryStream_ExtendedS3_S3BackupConfiguration_ErrorOutputP resourceName := "aws_kinesis_firehose_delivery_stream.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, firehose.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDeliveryStreamDestroy_ExtendedS3(ctx), @@ -893,7 +893,7 @@ func TestAccFirehoseDeliveryStream_ExtendedS3Processing_empty(t *testing.T) { resourceName := "aws_kinesis_firehose_delivery_stream.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, firehose.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDeliveryStreamDestroy_ExtendedS3(ctx), @@ -922,7 +922,7 @@ func TestAccFirehoseDeliveryStream_extendedS3KMSKeyARN(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, firehose.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDeliveryStreamDestroy_ExtendedS3(ctx), @@ -951,7 +951,7 @@ func TestAccFirehoseDeliveryStream_extendedS3DynamicPartitioning(t *testing.T) { resourceName := "aws_kinesis_firehose_delivery_stream.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, firehose.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDeliveryStreamDestroy_ExtendedS3(ctx), @@ -981,7 +981,7 @@ func TestAccFirehoseDeliveryStream_extendedS3DynamicPartitioningUpdate(t *testin resourceName := "aws_kinesis_firehose_delivery_stream.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, firehose.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDeliveryStreamDestroy_ExtendedS3(ctx), @@ -1047,7 +1047,7 @@ func TestAccFirehoseDeliveryStream_extendedS3Updates(t *testing.T) { } resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, firehose.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDeliveryStreamDestroy_ExtendedS3(ctx), @@ -1089,7 +1089,7 @@ func TestAccFirehoseDeliveryStream_ExtendedS3_kinesisStreamSource(t *testing.T) resourceName := "aws_kinesis_firehose_delivery_stream.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, firehose.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDeliveryStreamDestroy(ctx), @@ -1138,7 +1138,7 @@ func TestAccFirehoseDeliveryStream_redshiftUpdates(t *testing.T) { } resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, firehose.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDeliveryStreamDestroy(ctx), @@ -1174,7 +1174,7 @@ func TestAccFirehoseDeliveryStream_tagUpdates(t *testing.T) { resourceName := "aws_kinesis_firehose_delivery_stream.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, firehose.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDeliveryStreamDestroy(ctx), @@ -1234,7 +1234,7 @@ func TestAccFirehoseDeliveryStream_splunkUpdates(t *testing.T) { } resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, firehose.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDeliveryStreamDestroy(ctx), @@ -1269,7 +1269,7 @@ func TestAccFirehoseDeliveryStream_Splunk_ErrorOutputPrefix(t *testing.T) { resourceName := "aws_kinesis_firehose_delivery_stream.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, firehose.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDeliveryStreamDestroy_ExtendedS3(ctx), @@ -1341,7 +1341,7 @@ func TestAccFirehoseDeliveryStream_httpEndpoint(t *testing.T) { } resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, firehose.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDeliveryStreamDestroy(ctx), @@ -1376,7 +1376,7 @@ func TestAccFirehoseDeliveryStream_HTTPEndpoint_ErrorOutputPrefix(t *testing.T) resourceName := "aws_kinesis_firehose_delivery_stream.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, firehose.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDeliveryStreamDestroy_ExtendedS3(ctx), @@ -1426,7 +1426,7 @@ func TestAccFirehoseDeliveryStream_HTTPEndpoint_retryDuration(t *testing.T) { resourceName := "aws_kinesis_firehose_delivery_stream.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, firehose.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDeliveryStreamDestroy(ctx), @@ -1479,7 +1479,7 @@ func TestAccFirehoseDeliveryStream_elasticSearchUpdates(t *testing.T) { } resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, firehose.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDeliveryStreamDestroy(ctx), @@ -1534,7 +1534,7 @@ func TestAccFirehoseDeliveryStream_elasticSearchEndpointUpdates(t *testing.T) { } resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, firehose.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDeliveryStreamDestroy(ctx), @@ -1591,7 +1591,7 @@ func TestAccFirehoseDeliveryStream_elasticSearchWithVPCUpdates(t *testing.T) { } resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckIAMServiceLinkedRoleEs(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckIAMServiceLinkedRoleEs(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, firehose.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDeliveryStreamDestroy(ctx), @@ -1634,7 +1634,7 @@ func TestAccFirehoseDeliveryStream_Elasticsearch_ErrorOutputPrefix(t *testing.T) resourceName := "aws_kinesis_firehose_delivery_stream.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, firehose.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDeliveryStreamDestroy_ExtendedS3(ctx), @@ -1685,7 +1685,7 @@ func TestAccFirehoseDeliveryStream_missingProcessing(t *testing.T) { resourceName := "aws_kinesis_firehose_delivery_stream.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, firehose.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDeliveryStreamDestroy(ctx), From 7aecee90b9293b00284f4f008e0abb86ba51b6ef Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Fri, 24 Feb 2023 16:36:57 -0500 Subject: [PATCH 157/763] Add 'Context' argument to 'acctest.PreCheck' for fis. --- internal/service/fis/experiment_template_test.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/internal/service/fis/experiment_template_test.go b/internal/service/fis/experiment_template_test.go index 5ca761989424..21ebb0281766 100644 --- a/internal/service/fis/experiment_template_test.go +++ b/internal/service/fis/experiment_template_test.go @@ -25,7 +25,7 @@ func TestAccFISExperimentTemplate_basic(t *testing.T) { var conf types.ExperimentTemplate resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, fis.ServiceID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckExperimentTemplateDestroy(ctx), @@ -75,7 +75,7 @@ func TestAccFISExperimentTemplate_disappears(t *testing.T) { var conf types.ExperimentTemplate resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, fis.ServiceID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckExperimentTemplateDestroy(ctx), @@ -99,7 +99,7 @@ func TestAccFISExperimentTemplate_update(t *testing.T) { var conf types.ExperimentTemplate resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, fis.ServiceID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckExperimentTemplateDestroy(ctx), @@ -169,7 +169,7 @@ func TestAccFISExperimentTemplate_spot(t *testing.T) { var conf types.ExperimentTemplate resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, fis.ServiceID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckExperimentTemplateDestroy(ctx), From 5929337487997be6981159876ad02f3ba9e0b686 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Fri, 24 Feb 2023 16:36:58 -0500 Subject: [PATCH 158/763] Add 'Context' argument to 'acctest.PreCheck' for fms. --- internal/service/fms/admin_account_test.go | 2 +- internal/service/fms/policy_test.go | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/internal/service/fms/admin_account_test.go b/internal/service/fms/admin_account_test.go index 52e444f6d806..b04becc18c9e 100644 --- a/internal/service/fms/admin_account_test.go +++ b/internal/service/fms/admin_account_test.go @@ -20,7 +20,7 @@ func testAccAdminAccount_basic(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) testAccPreCheckAdmin(ctx, t) acctest.PreCheckOrganizationsAccount(ctx, t) }, diff --git a/internal/service/fms/policy_test.go b/internal/service/fms/policy_test.go index 0ac28906d471..8664c6e5d689 100644 --- a/internal/service/fms/policy_test.go +++ b/internal/service/fms/policy_test.go @@ -22,7 +22,7 @@ func testAccPolicy_basic(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) testAccPreCheckAdmin(ctx, t) acctest.PreCheckOrganizationsEnabled(ctx, t) acctest.PreCheckOrganizationManagementAccount(ctx, t) @@ -59,7 +59,7 @@ func testAccPolicy_cloudFrontDistribution(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) testAccPreCheckAdmin(ctx, t) acctest.PreCheckOrganizationsEnabled(ctx, t) acctest.PreCheckOrganizationManagementAccount(ctx, t) @@ -93,7 +93,7 @@ func testAccPolicy_includeMap(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) testAccPreCheckAdmin(ctx, t) acctest.PreCheckOrganizationsEnabled(ctx, t) acctest.PreCheckOrganizationManagementAccount(ctx, t) @@ -128,7 +128,7 @@ func testAccPolicy_update(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) testAccPreCheckAdmin(ctx, t) acctest.PreCheckOrganizationsEnabled(ctx, t) acctest.PreCheckOrganizationManagementAccount(ctx, t) @@ -159,7 +159,7 @@ func testAccPolicy_resourceTags(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) testAccPreCheckAdmin(ctx, t) acctest.PreCheckOrganizationsEnabled(ctx, t) acctest.PreCheckOrganizationManagementAccount(ctx, t) @@ -195,7 +195,7 @@ func testAccPolicy_tags(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) testAccPreCheckAdmin(ctx, t) acctest.PreCheckOrganizationsEnabled(ctx, t) acctest.PreCheckOrganizationManagementAccount(ctx, t) From d5c0f8932220146c24585f00a05061d63be89f34 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Fri, 24 Feb 2023 16:36:58 -0500 Subject: [PATCH 159/763] Add 'Context' argument to 'acctest.PreCheck' for fsx. --- internal/service/fsx/backup_test.go | 16 +++---- .../fsx/data_repository_association_test.go | 26 +++++----- internal/service/fsx/file_cache_test.go | 18 +++---- .../service/fsx/lustre_file_system_test.go | 48 +++++++++---------- .../service/fsx/ontap_file_system_test.go | 30 ++++++------ .../fsx/ontap_storage_virtual_machine_test.go | 14 +++--- internal/service/fsx/ontap_volume_test.go | 18 +++---- .../service/fsx/openzfs_file_system_test.go | 30 ++++++------ .../fsx/openzfs_snapshot_data_source_test.go | 2 +- internal/service/fsx/openzfs_snapshot_test.go | 12 ++--- internal/service/fsx/openzfs_volume_test.go | 22 ++++----- .../service/fsx/windows_file_system_test.go | 38 +++++++-------- 12 files changed, 137 insertions(+), 137 deletions(-) diff --git a/internal/service/fsx/backup_test.go b/internal/service/fsx/backup_test.go index 5d9aefcc8830..e8b5a2289a87 100644 --- a/internal/service/fsx/backup_test.go +++ b/internal/service/fsx/backup_test.go @@ -24,7 +24,7 @@ func TestAccFSxBackup_basic(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(fsx.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(fsx.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, fsx.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckBackupDestroy(ctx), @@ -56,7 +56,7 @@ func TestAccFSxBackup_ontapBasic(t *testing.T) { vName := strings.Replace(sdkacctest.RandomWithPrefix(acctest.ResourcePrefix), "-", "_", -1) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(fsx.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(fsx.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, fsx.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckBackupDestroy(ctx), @@ -86,7 +86,7 @@ func TestAccFSxBackup_openzfsBasic(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(fsx.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(fsx.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, fsx.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckBackupDestroy(ctx), @@ -116,7 +116,7 @@ func TestAccFSxBackup_windowsBasic(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(fsx.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(fsx.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, fsx.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckBackupDestroy(ctx), @@ -146,7 +146,7 @@ func TestAccFSxBackup_disappears(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(fsx.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(fsx.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, fsx.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckBackupDestroy(ctx), @@ -170,7 +170,7 @@ func TestAccFSxBackup_Disappears_filesystem(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(fsx.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(fsx.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, fsx.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckBackupDestroy(ctx), @@ -194,7 +194,7 @@ func TestAccFSxBackup_tags(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(fsx.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(fsx.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, fsx.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckBackupDestroy(ctx), @@ -239,7 +239,7 @@ func TestAccFSxBackup_implicitTags(t *testing.T) { resourceName := "aws_fsx_backup.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(fsx.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(fsx.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, fsx.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckBackupDestroy(ctx), diff --git a/internal/service/fsx/data_repository_association_test.go b/internal/service/fsx/data_repository_association_test.go index 4dd704d5758d..860bc4aaa34d 100644 --- a/internal/service/fsx/data_repository_association_test.go +++ b/internal/service/fsx/data_repository_association_test.go @@ -32,7 +32,7 @@ func TestAccFSxDataRepositoryAssociation_basic(t *testing.T) { fileSystemPath := "/test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(fsx.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(fsx.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, fsx.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDataRepositoryAssociationDestroy(ctx), @@ -71,7 +71,7 @@ func TestAccFSxDataRepositoryAssociation_disappears(t *testing.T) { fileSystemPath := "/test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(fsx.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(fsx.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, fsx.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDataRepositoryAssociationDestroy(ctx), @@ -101,7 +101,7 @@ func TestAccFSxDataRepositoryAssociation_disappears_ParentFileSystem(t *testing. fileSystemPath := "/test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(fsx.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(fsx.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, fsx.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDataRepositoryAssociationDestroy(ctx), @@ -131,7 +131,7 @@ func TestAccFSxDataRepositoryAssociation_fileSystemPathUpdated(t *testing.T) { fileSystemPath2 := "/test2" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(fsx.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(fsx.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, fsx.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDataRepositoryAssociationDestroy(ctx), @@ -176,7 +176,7 @@ func TestAccFSxDataRepositoryAssociation_dataRepositoryPathUpdated(t *testing.T) fileSystemPath := "/test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(fsx.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(fsx.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, fsx.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDataRepositoryAssociationDestroy(ctx), @@ -219,7 +219,7 @@ func TestAccFSxDataRepositoryAssociation_importedFileChunkSize(t *testing.T) { fileSystemPath := "/test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(fsx.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(fsx.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, fsx.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDataRepositoryAssociationDestroy(ctx), @@ -254,7 +254,7 @@ func TestAccFSxDataRepositoryAssociation_importedFileChunkSizeUpdated(t *testing fileSystemPath := "/test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(fsx.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(fsx.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, fsx.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDataRepositoryAssociationDestroy(ctx), @@ -296,7 +296,7 @@ func TestAccFSxDataRepositoryAssociation_deleteDataInFilesystem(t *testing.T) { fileSystemPath := "/test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(fsx.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(fsx.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, fsx.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDataRepositoryAssociationDestroy(ctx), @@ -331,7 +331,7 @@ func TestAccFSxDataRepositoryAssociation_s3AutoExportPolicy(t *testing.T) { events := []string{"NEW", "CHANGED", "DELETED"} resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(fsx.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(fsx.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, fsx.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDataRepositoryAssociationDestroy(ctx), @@ -369,7 +369,7 @@ func TestAccFSxDataRepositoryAssociation_s3AutoExportPolicyUpdate(t *testing.T) events2 := []string{"NEW"} resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(fsx.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(fsx.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, fsx.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDataRepositoryAssociationDestroy(ctx), @@ -414,7 +414,7 @@ func TestAccFSxDataRepositoryAssociation_s3AutoImportPolicy(t *testing.T) { events := []string{"NEW", "CHANGED", "DELETED"} resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(fsx.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(fsx.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, fsx.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDataRepositoryAssociationDestroy(ctx), @@ -452,7 +452,7 @@ func TestAccFSxDataRepositoryAssociation_s3AutoImportPolicyUpdate(t *testing.T) events2 := []string{"NEW"} resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(fsx.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(fsx.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, fsx.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDataRepositoryAssociationDestroy(ctx), @@ -496,7 +496,7 @@ func TestAccFSxDataRepositoryAssociation_s3FullPolicy(t *testing.T) { fileSystemPath := "/test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(fsx.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(fsx.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, fsx.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDataRepositoryAssociationDestroy(ctx), diff --git a/internal/service/fsx/file_cache_test.go b/internal/service/fsx/file_cache_test.go index ef0d488a6b20..17cb3f7fd7d1 100644 --- a/internal/service/fsx/file_cache_test.go +++ b/internal/service/fsx/file_cache_test.go @@ -51,7 +51,7 @@ func TestAccFSxFileCache_basic(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(fsx.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, fsx.EndpointsID), @@ -96,7 +96,7 @@ func TestAccFSxFileCache_disappears(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(fsx.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, fsx.EndpointsID), @@ -127,7 +127,7 @@ func testAccFileCache_copyTagsToDataRepositoryAssociations(t *testing.T) { resourceName := "aws_fsx_file_cache.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(fsx.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(fsx.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, fsx.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckFileCacheDestroy(ctx), @@ -160,7 +160,7 @@ func testAccFileCache_dataRepositoryAssociation_multiple(t *testing.T) { resourceName := "aws_fsx_file_cache.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(fsx.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(fsx.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, fsx.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckFileCacheDestroy(ctx), @@ -192,7 +192,7 @@ func testAccFileCache_dataRepositoryAssociation_nfs(t *testing.T) { resourceName := "aws_fsx_file_cache.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(fsx.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(fsx.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, fsx.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckFileCacheDestroy(ctx), @@ -229,7 +229,7 @@ func testAccFileCache_dataRepositoryAssociation_s3(t *testing.T) { bucketName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(fsx.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(fsx.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, fsx.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckFileCacheDestroy(ctx), @@ -265,7 +265,7 @@ func testAccFileCache_kmsKeyID(t *testing.T) { resourceName := "aws_fsx_file_cache.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(fsx.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(fsx.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, fsx.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckFileCacheDestroy(ctx), @@ -311,7 +311,7 @@ func testAccFileCache_securityGroupId(t *testing.T) { resourceName := "aws_fsx_file_cache.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(fsx.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(fsx.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, fsx.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckFileCacheDestroy(ctx), @@ -343,7 +343,7 @@ func testAccFileCache_tags(t *testing.T) { resourceName := "aws_fsx_file_cache.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(fsx.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(fsx.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, fsx.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckFileCacheDestroy(ctx), diff --git a/internal/service/fsx/lustre_file_system_test.go b/internal/service/fsx/lustre_file_system_test.go index 30485441f81d..2aae5df244a0 100644 --- a/internal/service/fsx/lustre_file_system_test.go +++ b/internal/service/fsx/lustre_file_system_test.go @@ -29,7 +29,7 @@ func TestAccFSxLustreFileSystem_basic(t *testing.T) { } resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(fsx.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(fsx.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, fsx.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckLustreFileSystemDestroy(ctx), @@ -77,7 +77,7 @@ func TestAccFSxLustreFileSystem_disappears(t *testing.T) { resourceName := "aws_fsx_lustre_file_system.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(fsx.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(fsx.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, fsx.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckLustreFileSystemDestroy(ctx), @@ -100,7 +100,7 @@ func TestAccFSxLustreFileSystem_dataCompression(t *testing.T) { resourceName := "aws_fsx_lustre_file_system.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(fsx.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(fsx.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, fsx.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckLustreFileSystemDestroy(ctx), @@ -143,7 +143,7 @@ func TestAccFSxLustreFileSystem_exportPath(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(fsx.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(fsx.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, fsx.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckLustreFileSystemDestroy(ctx), @@ -183,7 +183,7 @@ func TestAccFSxLustreFileSystem_importPath(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(fsx.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(fsx.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, fsx.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckLustreFileSystemDestroy(ctx), @@ -221,7 +221,7 @@ func TestAccFSxLustreFileSystem_importedFileChunkSize(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(fsx.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(fsx.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, fsx.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckLustreFileSystemDestroy(ctx), @@ -257,7 +257,7 @@ func TestAccFSxLustreFileSystem_securityGroupIDs(t *testing.T) { resourceName := "aws_fsx_lustre_file_system.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(fsx.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(fsx.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, fsx.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckLustreFileSystemDestroy(ctx), @@ -293,7 +293,7 @@ func TestAccFSxLustreFileSystem_storageCapacity(t *testing.T) { resourceName := "aws_fsx_lustre_file_system.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(fsx.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(fsx.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, fsx.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckLustreFileSystemDestroy(ctx), @@ -329,7 +329,7 @@ func TestAccFSxLustreFileSystem_storageCapacityUpdate(t *testing.T) { resourceName := "aws_fsx_lustre_file_system.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(fsx.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(fsx.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, fsx.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckLustreFileSystemDestroy(ctx), @@ -373,7 +373,7 @@ func TestAccFSxLustreFileSystem_fileSystemTypeVersion(t *testing.T) { resourceName := "aws_fsx_lustre_file_system.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(fsx.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(fsx.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, fsx.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckLustreFileSystemDestroy(ctx), @@ -409,7 +409,7 @@ func TestAccFSxLustreFileSystem_tags(t *testing.T) { resourceName := "aws_fsx_lustre_file_system.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(fsx.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(fsx.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, fsx.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckLustreFileSystemDestroy(ctx), @@ -457,7 +457,7 @@ func TestAccFSxLustreFileSystem_weeklyMaintenanceStartTime(t *testing.T) { resourceName := "aws_fsx_lustre_file_system.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(fsx.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(fsx.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, fsx.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckLustreFileSystemDestroy(ctx), @@ -493,7 +493,7 @@ func TestAccFSxLustreFileSystem_automaticBackupRetentionDays(t *testing.T) { resourceName := "aws_fsx_lustre_file_system.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(fsx.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(fsx.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, fsx.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckLustreFileSystemDestroy(ctx), @@ -536,7 +536,7 @@ func TestAccFSxLustreFileSystem_dailyAutomaticBackupStartTime(t *testing.T) { resourceName := "aws_fsx_lustre_file_system.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(fsx.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(fsx.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, fsx.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckLustreFileSystemDestroy(ctx), @@ -572,7 +572,7 @@ func TestAccFSxLustreFileSystem_deploymentTypePersistent1(t *testing.T) { resourceName := "aws_fsx_lustre_file_system.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(fsx.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(fsx.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, fsx.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckLustreFileSystemDestroy(ctx), @@ -606,7 +606,7 @@ func TestAccFSxLustreFileSystem_deploymentTypePersistent2(t *testing.T) { resourceName := "aws_fsx_lustre_file_system.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(fsx.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(fsx.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, fsx.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckLustreFileSystemDestroy(ctx), @@ -641,7 +641,7 @@ func TestAccFSxLustreFileSystem_logConfig(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(fsx.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(fsx.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, fsx.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckLustreFileSystemDestroy(ctx), @@ -680,7 +680,7 @@ func TestAccFSxLustreFileSystem_fromBackup(t *testing.T) { resourceName := "aws_fsx_lustre_file_system.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(fsx.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(fsx.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, fsx.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckLustreFileSystemDestroy(ctx), @@ -712,7 +712,7 @@ func TestAccFSxLustreFileSystem_kmsKeyID(t *testing.T) { kmsKeyResourceName2 := "aws_kms_key.test2" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(fsx.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(fsx.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, fsx.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckLustreFileSystemDestroy(ctx), @@ -750,7 +750,7 @@ func TestAccFSxLustreFileSystem_deploymentTypeScratch2(t *testing.T) { resourceName := "aws_fsx_lustre_file_system.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(fsx.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(fsx.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, fsx.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckLustreFileSystemDestroy(ctx), @@ -780,7 +780,7 @@ func TestAccFSxLustreFileSystem_storageTypeHddDriveCacheRead(t *testing.T) { resourceName := "aws_fsx_lustre_file_system.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(fsx.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(fsx.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, fsx.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckLustreFileSystemDestroy(ctx), @@ -809,7 +809,7 @@ func TestAccFSxLustreFileSystem_storageTypeHddDriveCacheNone(t *testing.T) { resourceName := "aws_fsx_lustre_file_system.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(fsx.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(fsx.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, fsx.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckLustreFileSystemDestroy(ctx), @@ -838,7 +838,7 @@ func TestAccFSxLustreFileSystem_copyTagsToBackups(t *testing.T) { resourceName := "aws_fsx_lustre_file_system.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(fsx.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(fsx.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, fsx.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckLustreFileSystemDestroy(ctx), @@ -867,7 +867,7 @@ func TestAccFSxLustreFileSystem_autoImportPolicy(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(fsx.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(fsx.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, fsx.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckLustreFileSystemDestroy(ctx), diff --git a/internal/service/fsx/ontap_file_system_test.go b/internal/service/fsx/ontap_file_system_test.go index dfdd603aebb3..6bbd91b340a5 100644 --- a/internal/service/fsx/ontap_file_system_test.go +++ b/internal/service/fsx/ontap_file_system_test.go @@ -24,7 +24,7 @@ func TestAccFSxOntapFileSystem_basic(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(fsx.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(fsx.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, fsx.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckOntapFileSystemDestroy(ctx), @@ -79,7 +79,7 @@ func TestAccFSxOntapFileSystem_fsxSingleAz(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(fsx.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(fsx.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, fsx.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckOntapFileSystemDestroy(ctx), @@ -111,7 +111,7 @@ func TestAccFSxOntapFileSystem_fsxAdminPassword(t *testing.T) { pass2 := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(fsx.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(fsx.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, fsx.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckOntapFileSystemDestroy(ctx), @@ -148,7 +148,7 @@ func TestAccFSxOntapFileSystem_endpointIPAddressRange(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(fsx.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(fsx.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, fsx.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckOntapFileSystemDestroy(ctx), @@ -177,7 +177,7 @@ func TestAccFSxOntapFileSystem_diskIops(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(fsx.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(fsx.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, fsx.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckOntapFileSystemDestroy(ctx), @@ -217,7 +217,7 @@ func TestAccFSxOntapFileSystem_disappears(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(fsx.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(fsx.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, fsx.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckOntapFileSystemDestroy(ctx), @@ -241,7 +241,7 @@ func TestAccFSxOntapFileSystem_securityGroupIDs(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(fsx.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(fsx.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, fsx.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckOntapFileSystemDestroy(ctx), @@ -278,7 +278,7 @@ func TestAccFSxOntapFileSystem_routeTableIDs(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(fsx.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(fsx.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, fsx.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckOntapFileSystemDestroy(ctx), @@ -308,7 +308,7 @@ func TestAccFSxOntapFileSystem_tags(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(fsx.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(fsx.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, fsx.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckOntapFileSystemDestroy(ctx), @@ -357,7 +357,7 @@ func TestAccFSxOntapFileSystem_weeklyMaintenanceStartTime(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(fsx.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(fsx.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, fsx.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckOntapFileSystemDestroy(ctx), @@ -394,7 +394,7 @@ func TestAccFSxOntapFileSystem_automaticBackupRetentionDays(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(fsx.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(fsx.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, fsx.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckOntapFileSystemDestroy(ctx), @@ -438,7 +438,7 @@ func TestAccFSxOntapFileSystem_kmsKeyID(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(fsx.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(fsx.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, fsx.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckOntapFileSystemDestroy(ctx), @@ -467,7 +467,7 @@ func TestAccFSxOntapFileSystem_dailyAutomaticBackupStartTime(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(fsx.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(fsx.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, fsx.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckLustreFileSystemDestroy(ctx), @@ -504,7 +504,7 @@ func TestAccFSxOntapFileSystem_throughputCapacity(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(fsx.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(fsx.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, fsx.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckOntapFileSystemDestroy(ctx), @@ -541,7 +541,7 @@ func TestAccFSxOntapFileSystem_storageCapacity(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(fsx.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(fsx.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, fsx.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckOntapFileSystemDestroy(ctx), diff --git a/internal/service/fsx/ontap_storage_virtual_machine_test.go b/internal/service/fsx/ontap_storage_virtual_machine_test.go index ce0ced9f7958..e219993a35b9 100644 --- a/internal/service/fsx/ontap_storage_virtual_machine_test.go +++ b/internal/service/fsx/ontap_storage_virtual_machine_test.go @@ -25,7 +25,7 @@ func TestAccFSxOntapStorageVirtualMachine_basic(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(fsx.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(fsx.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, fsx.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckOntapStorageVirtualMachineDestroy(ctx), @@ -65,7 +65,7 @@ func TestAccFSxOntapStorageVirtualMachine_rootVolumeSecurityStyle(t *testing.T) rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(fsx.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(fsx.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, fsx.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckOntapStorageVirtualMachineDestroy(ctx), @@ -105,7 +105,7 @@ func TestAccFSxOntapStorageVirtualMachine_svmAdminPassword(t *testing.T) { pass2 := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(fsx.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(fsx.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, fsx.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckOntapStorageVirtualMachineDestroy(ctx), @@ -142,7 +142,7 @@ func TestAccFSxOntapStorageVirtualMachine_disappears(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(fsx.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(fsx.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, fsx.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckOntapStorageVirtualMachineDestroy(ctx), @@ -167,7 +167,7 @@ func TestAccFSxOntapStorageVirtualMachine_name(t *testing.T) { rName2 := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(fsx.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(fsx.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, fsx.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckOntapStorageVirtualMachineDestroy(ctx), @@ -203,7 +203,7 @@ func TestAccFSxOntapStorageVirtualMachine_tags(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(fsx.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(fsx.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, fsx.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckOntapStorageVirtualMachineDestroy(ctx), @@ -255,7 +255,7 @@ func TestAccFSxOntapStorageVirtualMachine_activeDirectory(t *testing.T) { domainPassword1 := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(fsx.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(fsx.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, fsx.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckOntapStorageVirtualMachineDestroy(ctx), diff --git a/internal/service/fsx/ontap_volume_test.go b/internal/service/fsx/ontap_volume_test.go index 7b00e0c6725e..c2c865f93a6f 100644 --- a/internal/service/fsx/ontap_volume_test.go +++ b/internal/service/fsx/ontap_volume_test.go @@ -24,7 +24,7 @@ func TestAccFSxOntapVolume_basic(t *testing.T) { rName := fmt.Sprintf("tf_acc_test_%d", sdkacctest.RandInt()) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(fsx.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(fsx.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, fsx.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckOntapVolumeDestroy(ctx), @@ -63,7 +63,7 @@ func TestAccFSxOntapVolume_disappears(t *testing.T) { rName := fmt.Sprintf("tf_acc_test_%d", sdkacctest.RandInt()) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(fsx.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(fsx.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, fsx.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckOntapVolumeDestroy(ctx), @@ -88,7 +88,7 @@ func TestAccFSxOntapVolume_name(t *testing.T) { rName2 := fmt.Sprintf("tf_acc_test_%d", sdkacctest.RandInt()) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(fsx.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(fsx.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, fsx.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckOntapVolumeDestroy(ctx), @@ -126,7 +126,7 @@ func TestAccFSxOntapVolume_junctionPath(t *testing.T) { jPath2 := "/path2" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(fsx.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(fsx.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, fsx.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckOntapVolumeDestroy(ctx), @@ -164,7 +164,7 @@ func TestAccFSxOntapVolume_securityStyle(t *testing.T) { rName := fmt.Sprintf("tf_acc_test_%d", sdkacctest.RandInt()) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(fsx.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(fsx.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, fsx.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckOntapVolumeDestroy(ctx), @@ -213,7 +213,7 @@ func TestAccFSxOntapVolume_size(t *testing.T) { size2 := 2048 resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(fsx.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(fsx.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, fsx.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckOntapVolumeDestroy(ctx), @@ -251,7 +251,7 @@ func TestAccFSxOntapVolume_storageEfficiency(t *testing.T) { rName := fmt.Sprintf("tf_acc_test_%d", sdkacctest.RandInt()) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(fsx.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(fsx.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, fsx.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckOntapVolumeDestroy(ctx), @@ -289,7 +289,7 @@ func TestAccFSxOntapVolume_tags(t *testing.T) { rName := fmt.Sprintf("tf_acc_test_%d", sdkacctest.RandInt()) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(fsx.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(fsx.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, fsx.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckOntapVolumeDestroy(ctx), @@ -337,7 +337,7 @@ func TestAccFSxOntapVolume_tieringPolicy(t *testing.T) { rName := fmt.Sprintf("tf_acc_test_%d", sdkacctest.RandInt()) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(fsx.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(fsx.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, fsx.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckOntapVolumeDestroy(ctx), diff --git a/internal/service/fsx/openzfs_file_system_test.go b/internal/service/fsx/openzfs_file_system_test.go index 1938f88de880..eda4bdb48405 100644 --- a/internal/service/fsx/openzfs_file_system_test.go +++ b/internal/service/fsx/openzfs_file_system_test.go @@ -34,7 +34,7 @@ func TestAccFSxOpenzfsFileSystem_basic(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(fsx.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(fsx.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, fsx.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckOpenzfsFileSystemDestroy(ctx), @@ -92,7 +92,7 @@ func TestAccFSxOpenzfsFileSystem_diskIops(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(fsx.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(fsx.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, fsx.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckOpenzfsFileSystemDestroy(ctx), @@ -132,7 +132,7 @@ func TestAccFSxOpenzfsFileSystem_disappears(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(fsx.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(fsx.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, fsx.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckOpenzfsFileSystemDestroy(ctx), @@ -156,7 +156,7 @@ func TestAccFSxOpenzfsFileSystem_rootVolume(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(fsx.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(fsx.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, fsx.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckOpenzfsFileSystemDestroy(ctx), @@ -299,7 +299,7 @@ func TestAccFSxOpenzfsFileSystem_securityGroupIDs(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(fsx.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(fsx.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, fsx.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckOpenzfsFileSystemDestroy(ctx), @@ -336,7 +336,7 @@ func TestAccFSxOpenzfsFileSystem_tags(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(fsx.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(fsx.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, fsx.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckOpenzfsFileSystemDestroy(ctx), @@ -385,7 +385,7 @@ func TestAccFSxOpenzfsFileSystem_copyTags(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(fsx.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(fsx.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, fsx.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckOpenzfsFileSystemDestroy(ctx), @@ -427,7 +427,7 @@ func TestAccFSxOpenzfsFileSystem_throughput(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(fsx.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(fsx.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, fsx.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckOpenzfsFileSystemDestroy(ctx), @@ -464,7 +464,7 @@ func TestAccFSxOpenzfsFileSystem_storageType(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(fsx.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(fsx.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, fsx.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckOpenzfsFileSystemDestroy(ctx), @@ -493,7 +493,7 @@ func TestAccFSxOpenzfsFileSystem_weeklyMaintenanceStartTime(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(fsx.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(fsx.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, fsx.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckOpenzfsFileSystemDestroy(ctx), @@ -530,7 +530,7 @@ func TestAccFSxOpenzfsFileSystem_automaticBackupRetentionDays(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(fsx.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(fsx.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, fsx.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckOpenzfsFileSystemDestroy(ctx), @@ -574,7 +574,7 @@ func TestAccFSxOpenzfsFileSystem_kmsKeyID(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(fsx.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(fsx.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, fsx.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckOpenzfsFileSystemDestroy(ctx), @@ -603,7 +603,7 @@ func TestAccFSxOpenzfsFileSystem_dailyAutomaticBackupStartTime(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(fsx.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(fsx.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, fsx.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckOpenzfsFileSystemDestroy(ctx), @@ -640,7 +640,7 @@ func TestAccFSxOpenzfsFileSystem_throughputCapacity(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(fsx.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(fsx.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, fsx.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckOpenzfsFileSystemDestroy(ctx), @@ -677,7 +677,7 @@ func TestAccFSxOpenzfsFileSystem_storageCapacity(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(fsx.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(fsx.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, fsx.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckOpenzfsFileSystemDestroy(ctx), diff --git a/internal/service/fsx/openzfs_snapshot_data_source_test.go b/internal/service/fsx/openzfs_snapshot_data_source_test.go index 5e2a38eeede6..456212d1fa82 100644 --- a/internal/service/fsx/openzfs_snapshot_data_source_test.go +++ b/internal/service/fsx/openzfs_snapshot_data_source_test.go @@ -19,7 +19,7 @@ func TestAccFSxOpenzfsSnapshotDataSource_basic(t *testing.T) { rName2 := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(fsx.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(fsx.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, fsx.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckOpenzfsSnapshotDestroy(ctx), diff --git a/internal/service/fsx/openzfs_snapshot_test.go b/internal/service/fsx/openzfs_snapshot_test.go index 709a19b55187..ff1f2cce09e7 100644 --- a/internal/service/fsx/openzfs_snapshot_test.go +++ b/internal/service/fsx/openzfs_snapshot_test.go @@ -24,7 +24,7 @@ func TestAccFSxOpenzfsSnapshot_basic(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(fsx.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(fsx.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, fsx.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckOpenzfsSnapshotDestroy(ctx), @@ -56,7 +56,7 @@ func TestAccFSxOpenzfsSnapshot_disappears(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(fsx.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(fsx.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, fsx.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckOpenzfsSnapshotDestroy(ctx), @@ -80,7 +80,7 @@ func TestAccFSxOpenzfsSnapshot_tags(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(fsx.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(fsx.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, fsx.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckOpenzfsSnapshotDestroy(ctx), @@ -127,7 +127,7 @@ func TestAccFSxOpenzfsSnapshot_name(t *testing.T) { rName2 := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(fsx.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(fsx.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, fsx.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckOpenzfsSnapshotDestroy(ctx), @@ -163,7 +163,7 @@ func TestAccFSxOpenzfsSnapshot_childVolume(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(fsx.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(fsx.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, fsx.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckOpenzfsSnapshotDestroy(ctx), @@ -194,7 +194,7 @@ func TestAccFSxOpenzfsSnapshot_volumeId(t *testing.T) { rName2 := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(fsx.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(fsx.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, fsx.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckOpenzfsSnapshotDestroy(ctx), diff --git a/internal/service/fsx/openzfs_volume_test.go b/internal/service/fsx/openzfs_volume_test.go index acf0fd41fb3d..ec1af9a7dc83 100644 --- a/internal/service/fsx/openzfs_volume_test.go +++ b/internal/service/fsx/openzfs_volume_test.go @@ -24,7 +24,7 @@ func TestAccFSxOpenzfsVolume_basic(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(fsx.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(fsx.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, fsx.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckOpenzfsVolumeDestroy(ctx), @@ -67,7 +67,7 @@ func TestAccFSxOpenzfsVolume_parentVolume(t *testing.T) { rName2 := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(fsx.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(fsx.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, fsx.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckOpenzfsVolumeDestroy(ctx), @@ -99,7 +99,7 @@ func TestAccFSxOpenzfsVolume_tags(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(fsx.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(fsx.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, fsx.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckOpenzfsVolumeDestroy(ctx), @@ -147,7 +147,7 @@ func TestAccFSxOpenzfsVolume_copyTags(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(fsx.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(fsx.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, fsx.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckOpenzfsVolumeDestroy(ctx), @@ -187,7 +187,7 @@ func TestAccFSxOpenzfsVolume_name(t *testing.T) { rName2 := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(fsx.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(fsx.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, fsx.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckOpenzfsVolumeDestroy(ctx), @@ -223,7 +223,7 @@ func TestAccFSxOpenzfsVolume_dataCompressionType(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(fsx.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(fsx.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, fsx.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckOpenzfsVolumeDestroy(ctx), @@ -259,7 +259,7 @@ func TestAccFSxOpenzfsVolume_readOnly(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(fsx.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(fsx.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, fsx.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckOpenzfsVolumeDestroy(ctx), @@ -295,7 +295,7 @@ func TestAccFSxOpenzfsVolume_recordSizeKib(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(fsx.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(fsx.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, fsx.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckOpenzfsVolumeDestroy(ctx), @@ -331,7 +331,7 @@ func TestAccFSxOpenzfsVolume_storageCapacity(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(fsx.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(fsx.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, fsx.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckOpenzfsVolumeDestroy(ctx), @@ -369,7 +369,7 @@ func TestAccFSxOpenzfsVolume_nfsExports(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(fsx.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(fsx.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, fsx.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckOpenzfsVolumeDestroy(ctx), @@ -421,7 +421,7 @@ func TestAccFSxOpenzfsVolume_userAndGroupQuotas(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(fsx.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(fsx.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, fsx.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckOpenzfsVolumeDestroy(ctx), diff --git a/internal/service/fsx/windows_file_system_test.go b/internal/service/fsx/windows_file_system_test.go index 047b1dd294db..8599fbace226 100644 --- a/internal/service/fsx/windows_file_system_test.go +++ b/internal/service/fsx/windows_file_system_test.go @@ -23,7 +23,7 @@ func TestAccFSxWindowsFileSystem_basic(t *testing.T) { resourceName := "aws_fsx_windows_file_system.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(fsx.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(fsx.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, fsx.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckWindowsFileSystemDestroy(ctx), @@ -80,7 +80,7 @@ func TestAccFSxWindowsFileSystem_singleAz2(t *testing.T) { resourceName := "aws_fsx_windows_file_system.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(fsx.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(fsx.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, fsx.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckWindowsFileSystemDestroy(ctx), @@ -130,7 +130,7 @@ func TestAccFSxWindowsFileSystem_storageTypeHdd(t *testing.T) { resourceName := "aws_fsx_windows_file_system.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(fsx.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(fsx.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, fsx.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckWindowsFileSystemDestroy(ctx), @@ -162,7 +162,7 @@ func TestAccFSxWindowsFileSystem_multiAz(t *testing.T) { resourceName := "aws_fsx_windows_file_system.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(fsx.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(fsx.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, fsx.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckWindowsFileSystemDestroy(ctx), @@ -211,7 +211,7 @@ func TestAccFSxWindowsFileSystem_disappears(t *testing.T) { resourceName := "aws_fsx_windows_file_system.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(fsx.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(fsx.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, fsx.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckWindowsFileSystemDestroy(ctx), @@ -234,7 +234,7 @@ func TestAccFSxWindowsFileSystem_aliases(t *testing.T) { resourceName := "aws_fsx_windows_file_system.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(fsx.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(fsx.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, fsx.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckWindowsFileSystemDestroy(ctx), @@ -285,7 +285,7 @@ func TestAccFSxWindowsFileSystem_automaticBackupRetentionDays(t *testing.T) { resourceName := "aws_fsx_windows_file_system.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(fsx.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(fsx.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, fsx.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckWindowsFileSystemDestroy(ctx), @@ -332,7 +332,7 @@ func TestAccFSxWindowsFileSystem_copyTagsToBackups(t *testing.T) { resourceName := "aws_fsx_windows_file_system.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(fsx.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(fsx.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, fsx.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckWindowsFileSystemDestroy(ctx), @@ -371,7 +371,7 @@ func TestAccFSxWindowsFileSystem_dailyAutomaticBackupStartTime(t *testing.T) { resourceName := "aws_fsx_windows_file_system.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(fsx.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(fsx.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, fsx.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckWindowsFileSystemDestroy(ctx), @@ -412,7 +412,7 @@ func TestAccFSxWindowsFileSystem_kmsKeyID(t *testing.T) { resourceName := "aws_fsx_windows_file_system.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(fsx.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(fsx.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, fsx.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckWindowsFileSystemDestroy(ctx), @@ -451,7 +451,7 @@ func TestAccFSxWindowsFileSystem_securityGroupIDs(t *testing.T) { resourceName := "aws_fsx_windows_file_system.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(fsx.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(fsx.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, fsx.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckWindowsFileSystemDestroy(ctx), @@ -490,7 +490,7 @@ func TestAccFSxWindowsFileSystem_selfManagedActiveDirectory(t *testing.T) { resourceName := "aws_fsx_windows_file_system.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(fsx.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(fsx.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, fsx.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckWindowsFileSystemDestroy(ctx), @@ -522,7 +522,7 @@ func TestAccFSxWindowsFileSystem_SelfManagedActiveDirectory_username(t *testing. resourceName := "aws_fsx_windows_file_system.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(fsx.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(fsx.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, fsx.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckWindowsFileSystemDestroy(ctx), @@ -561,7 +561,7 @@ func TestAccFSxWindowsFileSystem_storageCapacity(t *testing.T) { resourceName := "aws_fsx_windows_file_system.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(fsx.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(fsx.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, fsx.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckWindowsFileSystemDestroy(ctx), @@ -600,7 +600,7 @@ func TestAccFSxWindowsFileSystem_fromBackup(t *testing.T) { resourceName := "aws_fsx_windows_file_system.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(fsx.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(fsx.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, fsx.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckWindowsFileSystemDestroy(ctx), @@ -632,7 +632,7 @@ func TestAccFSxWindowsFileSystem_tags(t *testing.T) { resourceName := "aws_fsx_windows_file_system.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(fsx.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(fsx.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, fsx.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckWindowsFileSystemDestroy(ctx), @@ -683,7 +683,7 @@ func TestAccFSxWindowsFileSystem_throughputCapacity(t *testing.T) { resourceName := "aws_fsx_windows_file_system.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(fsx.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(fsx.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, fsx.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckWindowsFileSystemDestroy(ctx), @@ -722,7 +722,7 @@ func TestAccFSxWindowsFileSystem_weeklyMaintenanceStartTime(t *testing.T) { resourceName := "aws_fsx_windows_file_system.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(fsx.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(fsx.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, fsx.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckWindowsFileSystemDestroy(ctx), @@ -762,7 +762,7 @@ func TestAccFSxWindowsFileSystem_audit(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(fsx.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(fsx.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, fsx.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckWindowsFileSystemDestroy(ctx), From b5bab299a8a4ec7f6f21c1e766282af17eb6bb0e Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Fri, 24 Feb 2023 16:36:58 -0500 Subject: [PATCH 160/763] Add 'Context' argument to 'acctest.PreCheck' for gamelift. --- internal/service/gamelift/alias_test.go | 8 ++--- internal/service/gamelift/build_test.go | 6 ++-- internal/service/gamelift/fleet_test.go | 12 ++++---- .../gamelift/game_server_group_test.go | 30 +++++++++---------- .../gamelift/game_session_queue_test.go | 6 ++-- internal/service/gamelift/script_test.go | 6 ++-- 6 files changed, 34 insertions(+), 34 deletions(-) diff --git a/internal/service/gamelift/alias_test.go b/internal/service/gamelift/alias_test.go index f277b27ce758..d3e1a7cd4739 100644 --- a/internal/service/gamelift/alias_test.go +++ b/internal/service/gamelift/alias_test.go @@ -34,7 +34,7 @@ func TestAccGameLiftAlias_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(gamelift.EndpointsID, t) testAccPreCheck(ctx, t) }, @@ -86,7 +86,7 @@ func TestAccGameLiftAlias_tags(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(gamelift.EndpointsID, t) testAccPreCheck(ctx, t) }, @@ -164,7 +164,7 @@ func TestAccGameLiftAlias_fleetRouting(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(gamelift.EndpointsID, t) testAccPreCheck(ctx, t) }, @@ -207,7 +207,7 @@ func TestAccGameLiftAlias_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(gamelift.EndpointsID, t) testAccPreCheck(ctx, t) }, diff --git a/internal/service/gamelift/build_test.go b/internal/service/gamelift/build_test.go index 50d7b810cb15..a33565d56257 100644 --- a/internal/service/gamelift/build_test.go +++ b/internal/service/gamelift/build_test.go @@ -43,7 +43,7 @@ func TestAccGameLiftBuild_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(gamelift.EndpointsID, t) testAccPreCheck(ctx, t) }, @@ -114,7 +114,7 @@ func TestAccGameLiftBuild_tags(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(gamelift.EndpointsID, t) testAccPreCheck(ctx, t) }, @@ -182,7 +182,7 @@ func TestAccGameLiftBuild_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(gamelift.EndpointsID, t) testAccPreCheck(ctx, t) }, diff --git a/internal/service/gamelift/fleet_test.go b/internal/service/gamelift/fleet_test.go index b95b1d4346e6..e1c63976676c 100644 --- a/internal/service/gamelift/fleet_test.go +++ b/internal/service/gamelift/fleet_test.go @@ -185,7 +185,7 @@ func TestAccGameLiftFleet_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(gamelift.EndpointsID, t) testAccPreCheck(ctx, t) }, @@ -279,7 +279,7 @@ func TestAccGameLiftFleet_tags(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(gamelift.EndpointsID, t) testAccPreCheck(ctx, t) }, @@ -360,7 +360,7 @@ func TestAccGameLiftFleet_allFields(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(gamelift.EndpointsID, t) testAccPreCheck(ctx, t) }, @@ -501,7 +501,7 @@ func TestAccGameLiftFleet_cert(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(gamelift.EndpointsID, t) testAccPreCheck(ctx, t) }, @@ -541,7 +541,7 @@ func TestAccGameLiftFleet_script(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(gamelift.EndpointsID, t) testAccPreCheck(ctx, t) }, @@ -613,7 +613,7 @@ func TestAccGameLiftFleet_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(gamelift.EndpointsID, t) testAccPreCheck(ctx, t) }, diff --git a/internal/service/gamelift/game_server_group_test.go b/internal/service/gamelift/game_server_group_test.go index 9d34d97520c7..3d432d91db9d 100644 --- a/internal/service/gamelift/game_server_group_test.go +++ b/internal/service/gamelift/game_server_group_test.go @@ -23,7 +23,7 @@ func TestAccGameLiftGameServerGroup_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(gamelift.EndpointsID, t) testAccPreCheck(ctx, t) }, @@ -61,7 +61,7 @@ func TestAccGameLiftGameServerGroup_AutoScalingPolicy(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(gamelift.EndpointsID, t) testAccPreCheck(ctx, t) }, @@ -94,7 +94,7 @@ func TestAccGameLiftGameServerGroup_AutoScalingPolicy_EstimatedInstanceWarmup(t resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(gamelift.EndpointsID, t) testAccPreCheck(ctx, t) }, @@ -127,7 +127,7 @@ func TestAccGameLiftGameServerGroup_BalancingStrategy(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(gamelift.EndpointsID, t) testAccPreCheck(ctx, t) }, @@ -163,7 +163,7 @@ func TestAccGameLiftGameServerGroup_GameServerGroupName(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(gamelift.EndpointsID, t) testAccPreCheck(ctx, t) }, @@ -202,7 +202,7 @@ func TestAccGameLiftGameServerGroup_InstanceDefinition(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(gamelift.EndpointsID, t) testAccPreCheck(ctx, t) }, @@ -241,7 +241,7 @@ func TestAccGameLiftGameServerGroup_InstanceDefinition_WeightedCapacity(t *testi resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(gamelift.EndpointsID, t) testAccPreCheck(ctx, t) }, @@ -284,7 +284,7 @@ func TestAccGameLiftGameServerGroup_LaunchTemplate_Id(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(gamelift.EndpointsID, t) testAccPreCheck(ctx, t) }, @@ -318,7 +318,7 @@ func TestAccGameLiftGameServerGroup_LaunchTemplate_Name(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(gamelift.EndpointsID, t) testAccPreCheck(ctx, t) }, @@ -352,7 +352,7 @@ func TestAccGameLiftGameServerGroup_LaunchTemplate_Version(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(gamelift.EndpointsID, t) testAccPreCheck(ctx, t) }, @@ -386,7 +386,7 @@ func TestAccGameLiftGameServerGroup_GameServerProtectionPolicy(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(gamelift.EndpointsID, t) testAccPreCheck(ctx, t) }, @@ -422,7 +422,7 @@ func TestAccGameLiftGameServerGroup_MaxSize(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(gamelift.EndpointsID, t) testAccPreCheck(ctx, t) }, @@ -465,7 +465,7 @@ func TestAccGameLiftGameServerGroup_MinSize(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(gamelift.EndpointsID, t) testAccPreCheck(ctx, t) }, @@ -504,7 +504,7 @@ func TestAccGameLiftGameServerGroup_roleARN(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(gamelift.EndpointsID, t) testAccPreCheck(ctx, t) }, @@ -549,7 +549,7 @@ func TestAccGameLiftGameServerGroup_vpcSubnets(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(gamelift.EndpointsID, t) testAccPreCheck(ctx, t) }, diff --git a/internal/service/gamelift/game_session_queue_test.go b/internal/service/gamelift/game_session_queue_test.go index 5fd8f9c81239..74ef4b2c2a71 100644 --- a/internal/service/gamelift/game_session_queue_test.go +++ b/internal/service/gamelift/game_session_queue_test.go @@ -52,7 +52,7 @@ func TestAccGameLiftGameSessionQueue_basic(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(gamelift.EndpointsID, t) testAccPreCheck(ctx, t) }, @@ -118,7 +118,7 @@ func TestAccGameLiftGameSessionQueue_tags(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(gamelift.EndpointsID, t) testAccPreCheck(ctx, t) }, @@ -180,7 +180,7 @@ func TestAccGameLiftGameSessionQueue_disappears(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(gamelift.EndpointsID, t) testAccPreCheck(ctx, t) }, diff --git a/internal/service/gamelift/script_test.go b/internal/service/gamelift/script_test.go index 301e549d1b47..bed5752e6c72 100644 --- a/internal/service/gamelift/script_test.go +++ b/internal/service/gamelift/script_test.go @@ -28,7 +28,7 @@ func TestAccGameLiftScript_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(gamelift.EndpointsID, t) testAccPreCheck(ctx, t) }, @@ -77,7 +77,7 @@ func TestAccGameLiftScript_tags(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(gamelift.EndpointsID, t) testAccPreCheck(ctx, t) }, @@ -129,7 +129,7 @@ func TestAccGameLiftScript_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(gamelift.EndpointsID, t) testAccPreCheck(ctx, t) }, From 5c9c8334880c11e4a92ec384f069239ac96047f8 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Fri, 24 Feb 2023 16:36:59 -0500 Subject: [PATCH 161/763] Add 'Context' argument to 'acctest.PreCheck' for glacier. --- internal/service/glacier/vault_lock_test.go | 6 +++--- internal/service/glacier/vault_test.go | 12 ++++++------ 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/internal/service/glacier/vault_lock_test.go b/internal/service/glacier/vault_lock_test.go index d1fca2576b33..c596f45f0d50 100644 --- a/internal/service/glacier/vault_lock_test.go +++ b/internal/service/glacier/vault_lock_test.go @@ -23,7 +23,7 @@ func TestAccGlacierVaultLock_basic(t *testing.T) { resourceName := "aws_glacier_vault_lock.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, glacier.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckVaultLockDestroy(ctx), @@ -56,7 +56,7 @@ func TestAccGlacierVaultLock_completeLock(t *testing.T) { resourceName := "aws_glacier_vault_lock.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, glacier.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckVaultLockDestroy(ctx), @@ -89,7 +89,7 @@ func TestAccGlacierVaultLock_ignoreEquivalentPolicy(t *testing.T) { resourceName := "aws_glacier_vault_lock.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, glacier.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckVaultLockDestroy(ctx), diff --git a/internal/service/glacier/vault_test.go b/internal/service/glacier/vault_test.go index 50fe8347aad2..403e7c9b9dde 100644 --- a/internal/service/glacier/vault_test.go +++ b/internal/service/glacier/vault_test.go @@ -24,7 +24,7 @@ func TestAccGlacierVault_basic(t *testing.T) { resourceName := "aws_glacier_vault.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, glacier.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckVaultDestroy(ctx), @@ -57,7 +57,7 @@ func TestAccGlacierVault_notification(t *testing.T) { snsResourceName := "aws_sns_topic.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, glacier.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckVaultDestroy(ctx), @@ -104,7 +104,7 @@ func TestAccGlacierVault_policy(t *testing.T) { resourceName := "aws_glacier_vault.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, glacier.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckVaultDestroy(ctx), @@ -150,7 +150,7 @@ func TestAccGlacierVault_tags(t *testing.T) { resourceName := "aws_glacier_vault.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, glacier.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckVaultDestroy(ctx), @@ -196,7 +196,7 @@ func TestAccGlacierVault_disappears(t *testing.T) { resourceName := "aws_glacier_vault.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, glacier.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckVaultDestroy(ctx), @@ -220,7 +220,7 @@ func TestAccGlacierVault_ignoreEquivalent(t *testing.T) { resourceName := "aws_glacier_vault.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, glacier.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckVaultDestroy(ctx), From bb84a050fcb429ade96e3221426735677a8ce7fd Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Fri, 24 Feb 2023 16:36:59 -0500 Subject: [PATCH 162/763] Add 'Context' argument to 'acctest.PreCheck' for globalaccelerator. --- .../accelerator_data_source_test.go | 2 +- .../globalaccelerator/accelerator_test.go | 14 +++++++------- .../globalaccelerator/endpoint_group_test.go | 16 ++++++++-------- .../service/globalaccelerator/listener_test.go | 6 +++--- 4 files changed, 19 insertions(+), 19 deletions(-) diff --git a/internal/service/globalaccelerator/accelerator_data_source_test.go b/internal/service/globalaccelerator/accelerator_data_source_test.go index 8401073c7429..79dcc2ead448 100644 --- a/internal/service/globalaccelerator/accelerator_data_source_test.go +++ b/internal/service/globalaccelerator/accelerator_data_source_test.go @@ -18,7 +18,7 @@ func TestAccGlobalAcceleratorAcceleratorDataSource_basic(t *testing.T) { dataSource2Name := "data.aws_globalaccelerator_accelerator.test_by_name" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, globalaccelerator.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ diff --git a/internal/service/globalaccelerator/accelerator_test.go b/internal/service/globalaccelerator/accelerator_test.go index 600567b28343..063d3d58fc38 100644 --- a/internal/service/globalaccelerator/accelerator_test.go +++ b/internal/service/globalaccelerator/accelerator_test.go @@ -26,7 +26,7 @@ func TestAccGlobalAcceleratorAccelerator_basic(t *testing.T) { dnsNameRegex := regexp.MustCompile(`^a[a-f0-9]{16}\.awsglobalaccelerator\.com$`) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, globalaccelerator.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckAcceleratorDestroy(ctx), @@ -67,7 +67,7 @@ func TestAccGlobalAcceleratorAccelerator_ipAddressType_dualStack(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, globalaccelerator.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckAcceleratorDestroy(ctx), @@ -103,7 +103,7 @@ func TestAccGlobalAcceleratorAccelerator_byoip(t *testing.T) { matches := 0 resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t); testAccCheckBYOIPExists(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t); testAccCheckBYOIPExists(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, globalaccelerator.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckAcceleratorDestroy(ctx), @@ -150,7 +150,7 @@ func TestAccGlobalAcceleratorAccelerator_disappears(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, globalaccelerator.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckAcceleratorDestroy(ctx), @@ -174,7 +174,7 @@ func TestAccGlobalAcceleratorAccelerator_update(t *testing.T) { newName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, globalaccelerator.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckAcceleratorDestroy(ctx), @@ -223,7 +223,7 @@ func TestAccGlobalAcceleratorAccelerator_attributes(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, globalaccelerator.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckAcceleratorDestroy(ctx), @@ -283,7 +283,7 @@ func TestAccGlobalAcceleratorAccelerator_tags(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, globalaccelerator.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckAcceleratorDestroy(ctx), diff --git a/internal/service/globalaccelerator/endpoint_group_test.go b/internal/service/globalaccelerator/endpoint_group_test.go index 8b9fe2a2d1c6..0d10bf79a665 100644 --- a/internal/service/globalaccelerator/endpoint_group_test.go +++ b/internal/service/globalaccelerator/endpoint_group_test.go @@ -26,7 +26,7 @@ func TestAccGlobalAcceleratorEndpointGroup_basic(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, globalaccelerator.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckEndpointGroupDestroy(ctx), @@ -64,7 +64,7 @@ func TestAccGlobalAcceleratorEndpointGroup_disappears(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, globalaccelerator.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckEndpointGroupDestroy(ctx), @@ -91,7 +91,7 @@ func TestAccGlobalAcceleratorEndpointGroup_ALBEndpoint_clientIP(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, globalaccelerator.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckEndpointGroupDestroy(ctx), @@ -166,7 +166,7 @@ func TestAccGlobalAcceleratorEndpointGroup_instanceEndpoint(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, globalaccelerator.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckEndpointGroupDestroy(ctx), @@ -217,7 +217,7 @@ func TestAccGlobalAcceleratorEndpointGroup_multiRegion(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckMultipleRegion(t, 2); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckMultipleRegion(t, 2); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, globalaccelerator.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5FactoriesAlternate(ctx, t), CheckDestroy: testAccCheckEndpointGroupDestroy(ctx), @@ -260,7 +260,7 @@ func TestAccGlobalAcceleratorEndpointGroup_portOverrides(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, globalaccelerator.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckEndpointGroupDestroy(ctx), @@ -328,7 +328,7 @@ func TestAccGlobalAcceleratorEndpointGroup_tcpHealthCheckProtocol(t *testing.T) rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, globalaccelerator.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckEndpointGroupDestroy(ctx), @@ -372,7 +372,7 @@ func TestAccGlobalAcceleratorEndpointGroup_update(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, globalaccelerator.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckEndpointGroupDestroy(ctx), diff --git a/internal/service/globalaccelerator/listener_test.go b/internal/service/globalaccelerator/listener_test.go index deb814fbea20..2de4aab2db07 100644 --- a/internal/service/globalaccelerator/listener_test.go +++ b/internal/service/globalaccelerator/listener_test.go @@ -21,7 +21,7 @@ func TestAccGlobalAcceleratorListener_basic(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, globalaccelerator.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckListenerDestroy(ctx), @@ -54,7 +54,7 @@ func TestAccGlobalAcceleratorListener_disappears(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, globalaccelerator.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckListenerDestroy(ctx), @@ -77,7 +77,7 @@ func TestAccGlobalAcceleratorListener_update(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, globalaccelerator.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckListenerDestroy(ctx), From ddba4a90c73a7a3ffbcb564d1525ac60350e8a31 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Fri, 24 Feb 2023 16:37:00 -0500 Subject: [PATCH 163/763] Add 'Context' argument to 'acctest.PreCheck' for glue. --- .../service/glue/catalog_database_test.go | 8 +-- .../glue/catalog_table_data_source_test.go | 2 +- internal/service/glue/catalog_table_test.go | 32 ++++----- internal/service/glue/classifier_test.go | 18 ++--- .../glue/connection_data_source_test.go | 2 +- internal/service/glue/connection_test.go | 18 ++--- internal/service/glue/crawler_test.go | 72 +++++++++---------- ...og_encryption_settings_data_source_test.go | 2 +- .../data_catalog_encryption_settings_test.go | 2 +- internal/service/glue/dev_endpoint_test.go | 28 ++++---- internal/service/glue/job_test.go | 38 +++++----- internal/service/glue/ml_transform_test.go | 20 +++--- internal/service/glue/partition_index_test.go | 8 +-- internal/service/glue/partition_test.go | 10 +-- internal/service/glue/registry_test.go | 8 +-- internal/service/glue/resource_policy_test.go | 10 +-- internal/service/glue/schema_test.go | 18 ++--- .../service/glue/script_data_source_test.go | 4 +- .../glue/security_configuration_test.go | 10 +-- internal/service/glue/trigger_test.go | 28 ++++---- .../glue/user_defined_function_test.go | 6 +- internal/service/glue/workflow_test.go | 12 ++-- 22 files changed, 178 insertions(+), 178 deletions(-) diff --git a/internal/service/glue/catalog_database_test.go b/internal/service/glue/catalog_database_test.go index f864def5a583..b703b790fcd9 100644 --- a/internal/service/glue/catalog_database_test.go +++ b/internal/service/glue/catalog_database_test.go @@ -22,7 +22,7 @@ func TestAccGlueCatalogDatabase_full(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, glue.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDatabaseDestroy(ctx), @@ -78,7 +78,7 @@ func TestAccGlueCatalogDatabase_createTablePermission(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, glue.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDatabaseDestroy(ctx), @@ -122,7 +122,7 @@ func TestAccGlueCatalogDatabase_targetDatabase(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, glue.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDatabaseDestroy(ctx), @@ -162,7 +162,7 @@ func TestAccGlueCatalogDatabase_disappears(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, glue.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDatabaseDestroy(ctx), diff --git a/internal/service/glue/catalog_table_data_source_test.go b/internal/service/glue/catalog_table_data_source_test.go index e0d89c249bdb..c8210807fe22 100644 --- a/internal/service/glue/catalog_table_data_source_test.go +++ b/internal/service/glue/catalog_table_data_source_test.go @@ -18,7 +18,7 @@ func TestAccGlueCatalogTableDataSource_basic(t *testing.T) { tName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, glue.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ diff --git a/internal/service/glue/catalog_table_test.go b/internal/service/glue/catalog_table_test.go index 8411c6391f87..98fa61158ad0 100644 --- a/internal/service/glue/catalog_table_test.go +++ b/internal/service/glue/catalog_table_test.go @@ -32,7 +32,7 @@ func TestAccGlueCatalogTable_basic(t *testing.T) { resourceName := "aws_glue_catalog_table.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, glue.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTableDestroy(ctx), @@ -67,7 +67,7 @@ func TestAccGlueCatalogTable_columnParameters(t *testing.T) { resourceName := "aws_glue_catalog_table.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, glue.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTableDestroy(ctx), @@ -99,7 +99,7 @@ func TestAccGlueCatalogTable_full(t *testing.T) { resourceName := "aws_glue_catalog_table.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, glue.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTableDestroy(ctx), @@ -164,7 +164,7 @@ func TestAccGlueCatalogTable_Update_addValues(t *testing.T) { resourceName := "aws_glue_catalog_table.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, glue.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTableDestroy(ctx), @@ -238,7 +238,7 @@ func TestAccGlueCatalogTable_Update_replaceValues(t *testing.T) { resourceName := "aws_glue_catalog_table.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, glue.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTableDestroy(ctx), @@ -353,7 +353,7 @@ func TestAccGlueCatalogTable_StorageDescriptor_emptyBlock(t *testing.T) { resourceName := "aws_glue_catalog_table.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, glue.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTableDestroy(ctx), @@ -375,7 +375,7 @@ func TestAccGlueCatalogTable_StorageDescriptorSerDeInfo_emptyBlock(t *testing.T) resourceName := "aws_glue_catalog_table.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, glue.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTableDestroy(ctx), @@ -398,7 +398,7 @@ func TestAccGlueCatalogTable_StorageDescriptorSerDeInfo_updateValues(t *testing. resourceName := "aws_glue_catalog_table.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, glue.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTableDestroy(ctx), @@ -440,7 +440,7 @@ func TestAccGlueCatalogTable_StorageDescriptorSkewedInfo_emptyBlock(t *testing.T resourceName := "aws_glue_catalog_table.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, glue.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTableDestroy(ctx), @@ -463,7 +463,7 @@ func TestAccGlueCatalogTable_StorageDescriptor_schemaReference(t *testing.T) { resourceName := "aws_glue_catalog_table.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, glue.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTableDestroy(ctx), @@ -506,7 +506,7 @@ func TestAccGlueCatalogTable_StorageDescriptor_schemaReferenceARN(t *testing.T) resourceName := "aws_glue_catalog_table.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, glue.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTableDestroy(ctx), @@ -537,7 +537,7 @@ func TestAccGlueCatalogTable_partitionIndexesSingle(t *testing.T) { resourceName := "aws_glue_catalog_table.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, glue.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTableDestroy(ctx), @@ -569,7 +569,7 @@ func TestAccGlueCatalogTable_partitionIndexesMultiple(t *testing.T) { resourceName := "aws_glue_catalog_table.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, glue.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTableDestroy(ctx), @@ -604,7 +604,7 @@ func TestAccGlueCatalogTable_Disappears_database(t *testing.T) { resourceName := "aws_glue_catalog_table.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, glue.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTableDestroy(ctx), @@ -629,7 +629,7 @@ func TestAccGlueCatalogTable_targetTable(t *testing.T) { resourceName := "aws_glue_catalog_table.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, glue.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTableDestroy(ctx), @@ -660,7 +660,7 @@ func TestAccGlueCatalogTable_disappears(t *testing.T) { resourceName := "aws_glue_catalog_table.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, glue.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTableDestroy(ctx), diff --git a/internal/service/glue/classifier_test.go b/internal/service/glue/classifier_test.go index 2a32c23158b0..b06d32396599 100644 --- a/internal/service/glue/classifier_test.go +++ b/internal/service/glue/classifier_test.go @@ -23,7 +23,7 @@ func TestAccGlueClassifier_csvClassifier(t *testing.T) { resourceName := "aws_glue_classifier.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, glue.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClassifierDestroy(ctx), @@ -79,7 +79,7 @@ func TestAccGlueClassifier_CSVClassifier_quoteSymbol(t *testing.T) { resourceName := "aws_glue_classifier.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, glue.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClassifierDestroy(ctx), @@ -117,7 +117,7 @@ func TestAccGlueClassifier_CSVClassifier_custom(t *testing.T) { resourceName := "aws_glue_classifier.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, glue.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClassifierDestroy(ctx), @@ -159,7 +159,7 @@ func TestAccGlueClassifier_grokClassifier(t *testing.T) { resourceName := "aws_glue_classifier.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, glue.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClassifierDestroy(ctx), @@ -209,7 +209,7 @@ func TestAccGlueClassifier_GrokClassifier_customPatterns(t *testing.T) { resourceName := "aws_glue_classifier.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, glue.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClassifierDestroy(ctx), @@ -259,7 +259,7 @@ func TestAccGlueClassifier_jsonClassifier(t *testing.T) { resourceName := "aws_glue_classifier.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, glue.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClassifierDestroy(ctx), @@ -305,7 +305,7 @@ func TestAccGlueClassifier_typeChange(t *testing.T) { resourceName := "aws_glue_classifier.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, glue.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClassifierDestroy(ctx), @@ -375,7 +375,7 @@ func TestAccGlueClassifier_xmlClassifier(t *testing.T) { resourceName := "aws_glue_classifier.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, glue.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClassifierDestroy(ctx), @@ -423,7 +423,7 @@ func TestAccGlueClassifier_disappears(t *testing.T) { resourceName := "aws_glue_classifier.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, glue.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClassifierDestroy(ctx), diff --git a/internal/service/glue/connection_data_source_test.go b/internal/service/glue/connection_data_source_test.go index 7dffc3c0fcb2..9e5083274fd3 100644 --- a/internal/service/glue/connection_data_source_test.go +++ b/internal/service/glue/connection_data_source_test.go @@ -19,7 +19,7 @@ func TestAccGlueConnectionDataSource_basic(t *testing.T) { jdbcConnectionUrl := fmt.Sprintf("jdbc:mysql://%s/testdatabase", acctest.RandomDomainName()) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, glue.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ diff --git a/internal/service/glue/connection_test.go b/internal/service/glue/connection_test.go index d9c7b36460f6..95a7f6996471 100644 --- a/internal/service/glue/connection_test.go +++ b/internal/service/glue/connection_test.go @@ -25,7 +25,7 @@ func TestAccGlueConnection_basic(t *testing.T) { jdbcConnectionUrl := fmt.Sprintf("jdbc:mysql://%s/testdatabase", acctest.RandomDomainName()) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, glue.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckConnectionDestroy(ctx), @@ -63,7 +63,7 @@ func TestAccGlueConnection_tags(t *testing.T) { jdbcConnectionUrl := fmt.Sprintf("jdbc:mysql://%s/testdatabase", acctest.RandomDomainName()) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, glue.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckConnectionDestroy(ctx), @@ -112,7 +112,7 @@ func TestAccGlueConnection_mongoDB(t *testing.T) { connectionUrl := fmt.Sprintf("mongodb://%s:27017/testdatabase", acctest.RandomDomainName()) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, glue.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckConnectionDestroy(ctx), @@ -149,7 +149,7 @@ func TestAccGlueConnection_kafka(t *testing.T) { bootstrapServers := fmt.Sprintf("%s:9094,%s:9094", acctest.RandomDomainName(), acctest.RandomDomainName()) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, glue.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckConnectionDestroy(ctx), @@ -182,7 +182,7 @@ func TestAccGlueConnection_network(t *testing.T) { resourceName := "aws_glue_connection.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, glue.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckConnectionDestroy(ctx), @@ -219,7 +219,7 @@ func TestAccGlueConnection_description(t *testing.T) { jdbcConnectionUrl := fmt.Sprintf("jdbc:mysql://%s/testdatabase", acctest.RandomDomainName()) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, glue.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckConnectionDestroy(ctx), @@ -257,7 +257,7 @@ func TestAccGlueConnection_matchCriteria(t *testing.T) { jdbcConnectionUrl := fmt.Sprintf("jdbc:mysql://%s/testdatabase", acctest.RandomDomainName()) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, glue.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckConnectionDestroy(ctx), @@ -308,7 +308,7 @@ func TestAccGlueConnection_physicalConnectionRequirements(t *testing.T) { resourceName := "aws_glue_connection.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, glue.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckConnectionDestroy(ctx), @@ -348,7 +348,7 @@ func TestAccGlueConnection_disappears(t *testing.T) { jdbcConnectionUrl := fmt.Sprintf("jdbc:mysql://%s/testdatabase", acctest.RandomDomainName()) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, glue.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckConnectionDestroy(ctx), diff --git a/internal/service/glue/crawler_test.go b/internal/service/glue/crawler_test.go index 11099de6bdc0..496efad4cedc 100644 --- a/internal/service/glue/crawler_test.go +++ b/internal/service/glue/crawler_test.go @@ -27,7 +27,7 @@ func TestAccGlueCrawler_dynamoDBTarget(t *testing.T) { resourceName := "aws_glue_crawler.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, glue.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckCrawlerDestroy(ctx), @@ -96,7 +96,7 @@ func TestAccGlueCrawler_DynamoDBTarget_scanAll(t *testing.T) { resourceName := "aws_glue_crawler.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, glue.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckCrawlerDestroy(ctx), @@ -141,7 +141,7 @@ func TestAccGlueCrawler_DynamoDBTarget_scanRate(t *testing.T) { resourceName := "aws_glue_crawler.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, glue.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckCrawlerDestroy(ctx), @@ -188,7 +188,7 @@ func TestAccGlueCrawler_jdbcTarget(t *testing.T) { jdbcConnectionUrl := fmt.Sprintf("jdbc:mysql://%s/testdatabase", acctest.RandomDomainName()) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, glue.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckCrawlerDestroy(ctx), @@ -261,7 +261,7 @@ func TestAccGlueCrawler_JDBCTarget_exclusions(t *testing.T) { jdbcConnectionUrl := fmt.Sprintf("jdbc:mysql://%s/testdatabase", acctest.RandomDomainName()) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, glue.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckCrawlerDestroy(ctx), @@ -305,7 +305,7 @@ func TestAccGlueCrawler_JDBCTarget_multiple(t *testing.T) { jdbcConnectionUrl := fmt.Sprintf("jdbc:mysql://%s/testdatabase", acctest.RandomDomainName()) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, glue.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckCrawlerDestroy(ctx), @@ -367,7 +367,7 @@ func TestAccGlueCrawler_mongoDBTarget(t *testing.T) { connectionUrl := fmt.Sprintf("mongodb://%s:27017/testdatabase", acctest.RandomDomainName()) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, glue.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckCrawlerDestroy(ctx), @@ -410,7 +410,7 @@ func TestAccGlueCrawler_MongoDBTargetScan_all(t *testing.T) { connectionUrl := fmt.Sprintf("mongodb://%s:27017/testdatabase", acctest.RandomDomainName()) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, glue.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckCrawlerDestroy(ctx), @@ -463,7 +463,7 @@ func TestAccGlueCrawler_MongoDBTarget_multiple(t *testing.T) { connectionUrl := fmt.Sprintf("mongodb://%s:27017/testdatabase", acctest.RandomDomainName()) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, glue.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckCrawlerDestroy(ctx), @@ -522,7 +522,7 @@ func TestAccGlueCrawler_deltaTarget(t *testing.T) { connectionUrl := fmt.Sprintf("mongodb://%s:27017/testdatabase", acctest.RandomDomainName()) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, glue.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckCrawlerDestroy(ctx), @@ -565,7 +565,7 @@ func TestAccGlueCrawler_s3Target(t *testing.T) { resourceName := "aws_glue_crawler.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, glue.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckCrawlerDestroy(ctx), @@ -635,7 +635,7 @@ func TestAccGlueCrawler_S3Target_connectionName(t *testing.T) { connectionName := "aws_glue_connection.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, glue.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckCrawlerDestroy(ctx), @@ -665,7 +665,7 @@ func TestAccGlueCrawler_S3Target_sampleSize(t *testing.T) { resourceName := "aws_glue_crawler.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, glue.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckCrawlerDestroy(ctx), @@ -702,7 +702,7 @@ func TestAccGlueCrawler_S3Target_exclusions(t *testing.T) { resourceName := "aws_glue_crawler.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, glue.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckCrawlerDestroy(ctx), @@ -744,7 +744,7 @@ func TestAccGlueCrawler_S3Target_eventqueue(t *testing.T) { resourceName := "aws_glue_crawler.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, glue.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckCrawlerDestroy(ctx), @@ -775,7 +775,7 @@ func TestAccGlueCrawler_CatalogTarget_dlqeventqueue(t *testing.T) { resourceName := "aws_glue_crawler.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, glue.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckCrawlerDestroy(ctx), @@ -806,7 +806,7 @@ func TestAccGlueCrawler_S3Target_dlqeventqueue(t *testing.T) { resourceName := "aws_glue_crawler.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, glue.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckCrawlerDestroy(ctx), @@ -838,7 +838,7 @@ func TestAccGlueCrawler_S3Target_multiple(t *testing.T) { resourceName := "aws_glue_crawler.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, glue.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckCrawlerDestroy(ctx), @@ -893,7 +893,7 @@ func TestAccGlueCrawler_catalogTarget(t *testing.T) { resourceName := "aws_glue_crawler.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, glue.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckCrawlerDestroy(ctx), @@ -967,7 +967,7 @@ func TestAccGlueCrawler_CatalogTarget_multiple(t *testing.T) { resourceName := "aws_glue_crawler.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, glue.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckCrawlerDestroy(ctx), @@ -1024,7 +1024,7 @@ func TestAccGlueCrawler_disappears(t *testing.T) { resourceName := "aws_glue_crawler.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, glue.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckCrawlerDestroy(ctx), @@ -1048,7 +1048,7 @@ func TestAccGlueCrawler_classifiers(t *testing.T) { resourceName := "aws_glue_crawler.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, glue.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckCrawlerDestroy(ctx), @@ -1096,7 +1096,7 @@ func TestAccGlueCrawler_Configuration(t *testing.T) { resourceName := "aws_glue_crawler.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, glue.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckCrawlerDestroy(ctx), @@ -1138,7 +1138,7 @@ func TestAccGlueCrawler_description(t *testing.T) { resourceName := "aws_glue_crawler.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, glue.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckCrawlerDestroy(ctx), @@ -1174,7 +1174,7 @@ func TestAccGlueCrawler_RoleARN_noPath(t *testing.T) { resourceName := "aws_glue_crawler.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, glue.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckCrawlerDestroy(ctx), @@ -1202,7 +1202,7 @@ func TestAccGlueCrawler_RoleARN_path(t *testing.T) { resourceName := "aws_glue_crawler.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, glue.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckCrawlerDestroy(ctx), @@ -1230,7 +1230,7 @@ func TestAccGlueCrawler_RoleName_path(t *testing.T) { resourceName := "aws_glue_crawler.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, glue.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckCrawlerDestroy(ctx), @@ -1258,7 +1258,7 @@ func TestAccGlueCrawler_schedule(t *testing.T) { resourceName := "aws_glue_crawler.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, glue.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckCrawlerDestroy(ctx), @@ -1300,7 +1300,7 @@ func TestAccGlueCrawler_schemaChangePolicy(t *testing.T) { resourceName := "aws_glue_crawler.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, glue.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckCrawlerDestroy(ctx), @@ -1339,7 +1339,7 @@ func TestAccGlueCrawler_tablePrefix(t *testing.T) { resourceName := "aws_glue_crawler.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, glue.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckCrawlerDestroy(ctx), @@ -1374,7 +1374,7 @@ func TestAccGlueCrawler_removeTablePrefix(t *testing.T) { resourceName := "aws_glue_crawler.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, glue.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckCrawlerDestroy(ctx), @@ -1409,7 +1409,7 @@ func TestAccGlueCrawler_tags(t *testing.T) { resourceName := "aws_glue_crawler.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, glue.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckCrawlerDestroy(ctx), @@ -1455,7 +1455,7 @@ func TestAccGlueCrawler_security(t *testing.T) { resourceName := "aws_glue_crawler.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, glue.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckCrawlerDestroy(ctx), @@ -1490,7 +1490,7 @@ func TestAccGlueCrawler_lineage(t *testing.T) { resourceName := "aws_glue_crawler.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, glue.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckCrawlerDestroy(ctx), @@ -1534,7 +1534,7 @@ func TestAccGlueCrawler_lakeformation(t *testing.T) { resourceName := "aws_glue_crawler.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, glue.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckCrawlerDestroy(ctx), @@ -1570,7 +1570,7 @@ func TestAccGlueCrawler_reCrawlPolicy(t *testing.T) { resourceName := "aws_glue_crawler.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, glue.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckCrawlerDestroy(ctx), 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 ba951e721127..558b8d0a317a 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 @@ -15,7 +15,7 @@ func testAccDataCatalogEncryptionSettingsDataSource_basic(t *testing.T) { dataSourceName := "data.aws_glue_data_catalog_encryption_settings.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, glue.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ diff --git a/internal/service/glue/data_catalog_encryption_settings_test.go b/internal/service/glue/data_catalog_encryption_settings_test.go index bd03c763cfba..35919142a5f3 100644 --- a/internal/service/glue/data_catalog_encryption_settings_test.go +++ b/internal/service/glue/data_catalog_encryption_settings_test.go @@ -26,7 +26,7 @@ func testAccDataCatalogEncryptionSettings_basic(t *testing.T) { keyResourceName := "aws_kms_key.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, glue.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: nil, diff --git a/internal/service/glue/dev_endpoint_test.go b/internal/service/glue/dev_endpoint_test.go index ae9503c71e81..b094928f07d0 100644 --- a/internal/service/glue/dev_endpoint_test.go +++ b/internal/service/glue/dev_endpoint_test.go @@ -24,7 +24,7 @@ func TestAccGlueDevEndpoint_basic(t *testing.T) { resourceName := "aws_glue_dev_endpoint.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, glue.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDevEndpointDestroy(ctx), @@ -59,7 +59,7 @@ func TestAccGlueDevEndpoint_arguments(t *testing.T) { resourceName := "aws_glue_dev_endpoint.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, glue.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDevEndpointDestroy(ctx), @@ -108,7 +108,7 @@ func TestAccGlueDevEndpoint_extraJarsS3Path(t *testing.T) { resourceName := "aws_glue_dev_endpoint.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, glue.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDevEndpointDestroy(ctx), @@ -146,7 +146,7 @@ func TestAccGlueDevEndpoint_extraPythonLibsS3Path(t *testing.T) { resourceName := "aws_glue_dev_endpoint.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, glue.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDevEndpointDestroy(ctx), @@ -182,7 +182,7 @@ func TestAccGlueDevEndpoint_glueVersion(t *testing.T) { resourceName := "aws_glue_dev_endpoint.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, glue.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDevEndpointDestroy(ctx), @@ -222,7 +222,7 @@ func TestAccGlueDevEndpoint_numberOfNodes(t *testing.T) { resourceName := "aws_glue_dev_endpoint.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, glue.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDevEndpointDestroy(ctx), @@ -262,7 +262,7 @@ func TestAccGlueDevEndpoint_numberOfWorkers(t *testing.T) { resourceName := "aws_glue_dev_endpoint.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, glue.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDevEndpointDestroy(ctx), @@ -311,7 +311,7 @@ func TestAccGlueDevEndpoint_publicKey(t *testing.T) { } resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, glue.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDevEndpointDestroy(ctx), @@ -364,7 +364,7 @@ func TestAccGlueDevEndpoint_publicKeys(t *testing.T) { } resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, glue.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDevEndpointDestroy(ctx), @@ -407,7 +407,7 @@ func TestAccGlueDevEndpoint_security(t *testing.T) { resourceName := "aws_glue_dev_endpoint.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, glue.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDevEndpointDestroy(ctx), @@ -437,7 +437,7 @@ func TestAccGlueDevEndpoint_SubnetID_securityGroupIDs(t *testing.T) { resourceName := "aws_glue_dev_endpoint.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, glue.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDevEndpointDestroy(ctx), @@ -469,7 +469,7 @@ func TestAccGlueDevEndpoint_tags(t *testing.T) { resourceName := "aws_glue_dev_endpoint.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, glue.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDevEndpointDestroy(ctx), @@ -516,7 +516,7 @@ func TestAccGlueDevEndpoint_workerType(t *testing.T) { resourceName := "aws_glue_dev_endpoint.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, glue.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDevEndpointDestroy(ctx), @@ -559,7 +559,7 @@ func TestAccGlueDevEndpoint_disappears(t *testing.T) { resourceName := "aws_glue_dev_endpoint.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, glue.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDevEndpointDestroy(ctx), diff --git a/internal/service/glue/job_test.go b/internal/service/glue/job_test.go index 4a4c74b589c6..535be0a24b27 100644 --- a/internal/service/glue/job_test.go +++ b/internal/service/glue/job_test.go @@ -24,7 +24,7 @@ func TestAccGlueJob_basic(t *testing.T) { roleResourceName := "aws_iam_role.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, glue.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckJobDestroy(ctx), @@ -61,7 +61,7 @@ func TestAccGlueJob_disappears(t *testing.T) { resourceName := "aws_glue_job.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, glue.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckJobDestroy(ctx), @@ -86,7 +86,7 @@ func TestAccGlueJob_basicStreaming(t *testing.T) { roleResourceName := "aws_iam_role.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, glue.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckJobDestroy(ctx), @@ -123,7 +123,7 @@ func TestAccGlueJob_command(t *testing.T) { resourceName := "aws_glue_job.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, glue.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckJobDestroy(ctx), @@ -160,7 +160,7 @@ func TestAccGlueJob_defaultArguments(t *testing.T) { resourceName := "aws_glue_job.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, glue.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckJobDestroy(ctx), @@ -199,7 +199,7 @@ func TestAccGlueJob_nonOverridableArguments(t *testing.T) { resourceName := "aws_glue_job.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, glue.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckJobDestroy(ctx), @@ -238,7 +238,7 @@ func TestAccGlueJob_description(t *testing.T) { resourceName := "aws_glue_job.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, glue.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckJobDestroy(ctx), @@ -273,7 +273,7 @@ func TestAccGlueJob_glueVersion(t *testing.T) { resourceName := "aws_glue_job.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, glue.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckJobDestroy(ctx), @@ -315,7 +315,7 @@ func TestAccGlueJob_executionClass(t *testing.T) { resourceName := "aws_glue_job.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, glue.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckJobDestroy(ctx), @@ -350,7 +350,7 @@ func TestAccGlueJob_executionProperty(t *testing.T) { resourceName := "aws_glue_job.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, glue.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckJobDestroy(ctx), @@ -391,7 +391,7 @@ func TestAccGlueJob_maxRetries(t *testing.T) { resourceName := "aws_glue_job.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, glue.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckJobDestroy(ctx), @@ -430,7 +430,7 @@ func TestAccGlueJob_notificationProperty(t *testing.T) { resourceName := "aws_glue_job.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, glue.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckJobDestroy(ctx), @@ -471,7 +471,7 @@ func TestAccGlueJob_tags(t *testing.T) { resourceName := "aws_glue_job.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, glue.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckJobDestroy(ctx), @@ -517,7 +517,7 @@ func TestAccGlueJob_streamingTimeout(t *testing.T) { resourceName := "aws_glue_job.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, glue.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckJobDestroy(ctx), @@ -552,7 +552,7 @@ func TestAccGlueJob_timeout(t *testing.T) { resourceName := "aws_glue_job.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, glue.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckJobDestroy(ctx), @@ -587,7 +587,7 @@ func TestAccGlueJob_security(t *testing.T) { resourceName := "aws_glue_job.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, glue.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckJobDestroy(ctx), @@ -622,7 +622,7 @@ func TestAccGlueJob_workerType(t *testing.T) { resourceName := "aws_glue_job.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, glue.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckJobDestroy(ctx), @@ -664,7 +664,7 @@ func TestAccGlueJob_pythonShell(t *testing.T) { resourceName := "aws_glue_job.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, glue.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckJobDestroy(ctx), @@ -730,7 +730,7 @@ func TestAccGlueJob_maxCapacity(t *testing.T) { resourceName := "aws_glue_job.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, glue.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckJobDestroy(ctx), diff --git a/internal/service/glue/ml_transform_test.go b/internal/service/glue/ml_transform_test.go index e66acb3c2e4a..ce040e120791 100644 --- a/internal/service/glue/ml_transform_test.go +++ b/internal/service/glue/ml_transform_test.go @@ -27,7 +27,7 @@ func TestAccGlueMlTransform_basic(t *testing.T) { tableResourceName := "aws_glue_catalog_table.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, glue.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckMLTransformDestroy(ctx), @@ -76,7 +76,7 @@ func TestAccGlueMlTransform_typeFindMatchesFull(t *testing.T) { resourceName := "aws_glue_ml_transform.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, glue.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckMLTransformDestroy(ctx), @@ -137,7 +137,7 @@ func TestAccGlueMlTransform_description(t *testing.T) { resourceName := "aws_glue_ml_transform.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, glue.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckMLTransformDestroy(ctx), @@ -173,7 +173,7 @@ func TestAccGlueMlTransform_glueVersion(t *testing.T) { resourceName := "aws_glue_ml_transform.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, glue.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckMLTransformDestroy(ctx), @@ -209,7 +209,7 @@ func TestAccGlueMlTransform_maxRetries(t *testing.T) { resourceName := "aws_glue_ml_transform.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, glue.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckMLTransformDestroy(ctx), @@ -249,7 +249,7 @@ func TestAccGlueMlTransform_tags(t *testing.T) { resourceName := "aws_glue_ml_transform.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, glue.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckMLTransformDestroy(ctx), @@ -296,7 +296,7 @@ func TestAccGlueMlTransform_timeout(t *testing.T) { resourceName := "aws_glue_ml_transform.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, glue.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckMLTransformDestroy(ctx), @@ -332,7 +332,7 @@ func TestAccGlueMlTransform_workerType(t *testing.T) { resourceName := "aws_glue_ml_transform.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, glue.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckMLTransformDestroy(ctx), @@ -370,7 +370,7 @@ func TestAccGlueMlTransform_maxCapacity(t *testing.T) { resourceName := "aws_glue_ml_transform.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, glue.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckMLTransformDestroy(ctx), @@ -406,7 +406,7 @@ func TestAccGlueMlTransform_disappears(t *testing.T) { resourceName := "aws_glue_ml_transform.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, glue.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckMLTransformDestroy(ctx), diff --git a/internal/service/glue/partition_index_test.go b/internal/service/glue/partition_index_test.go index 6df59b49b740..482ea3bc1943 100644 --- a/internal/service/glue/partition_index_test.go +++ b/internal/service/glue/partition_index_test.go @@ -21,7 +21,7 @@ func TestAccGluePartitionIndex_basic(t *testing.T) { resourceName := "aws_glue_partition_index.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, glue.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckPartitionIndexDestroy(ctx), @@ -53,7 +53,7 @@ func TestAccGluePartitionIndex_disappears(t *testing.T) { resourceName := "aws_glue_partition_index.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, glue.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckPartitionIndexDestroy(ctx), @@ -78,7 +78,7 @@ func TestAccGluePartitionIndex_Disappears_table(t *testing.T) { resourceName := "aws_glue_partition_index.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, glue.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckPartitionIndexDestroy(ctx), @@ -103,7 +103,7 @@ func TestAccGluePartitionIndex_Disappears_database(t *testing.T) { resourceName := "aws_glue_partition_index.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, glue.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckPartitionIndexDestroy(ctx), diff --git a/internal/service/glue/partition_test.go b/internal/service/glue/partition_test.go index 33c509d2f4d0..c02e3ba91f24 100644 --- a/internal/service/glue/partition_test.go +++ b/internal/service/glue/partition_test.go @@ -22,7 +22,7 @@ func TestAccGluePartition_basic(t *testing.T) { resourceName := "aws_glue_partition.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, glue.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckPartitionDestroy(ctx), @@ -56,7 +56,7 @@ func TestAccGluePartition_multipleValues(t *testing.T) { resourceName := "aws_glue_partition.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, glue.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckPartitionDestroy(ctx), @@ -86,7 +86,7 @@ func TestAccGluePartition_parameters(t *testing.T) { resourceName := "aws_glue_partition.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, glue.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckPartitionDestroy(ctx), @@ -132,7 +132,7 @@ func TestAccGluePartition_disappears(t *testing.T) { resourceName := "aws_glue_partition.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, glue.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckPartitionDestroy(ctx), @@ -156,7 +156,7 @@ func TestAccGluePartition_Disappears_table(t *testing.T) { resourceName := "aws_glue_partition.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, glue.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckPartitionDestroy(ctx), diff --git a/internal/service/glue/registry_test.go b/internal/service/glue/registry_test.go index df23fa7e50e2..72a0b42452e2 100644 --- a/internal/service/glue/registry_test.go +++ b/internal/service/glue/registry_test.go @@ -24,7 +24,7 @@ func TestAccGlueRegistry_basic(t *testing.T) { resourceName := "aws_glue_registry.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckRegistry(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckRegistry(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, glue.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRegistryDestroy(ctx), @@ -56,7 +56,7 @@ func TestAccGlueRegistry_description(t *testing.T) { resourceName := "aws_glue_registry.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckRegistry(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckRegistry(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, glue.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRegistryDestroy(ctx), @@ -91,7 +91,7 @@ func TestAccGlueRegistry_tags(t *testing.T) { resourceName := "aws_glue_registry.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckRegistry(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckRegistry(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, glue.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRegistryDestroy(ctx), @@ -138,7 +138,7 @@ func TestAccGlueRegistry_disappears(t *testing.T) { resourceName := "aws_glue_registry.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckRegistry(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckRegistry(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, glue.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRegistryDestroy(ctx), diff --git a/internal/service/glue/resource_policy_test.go b/internal/service/glue/resource_policy_test.go index 5c0d9a4b74b6..6d9136f8ebd6 100644 --- a/internal/service/glue/resource_policy_test.go +++ b/internal/service/glue/resource_policy_test.go @@ -20,7 +20,7 @@ func testAccResourcePolicy_basic(t *testing.T) { ctx := acctest.Context(t) resourceName := "aws_glue_resource_policy.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, glue.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckResourcePolicyDestroy(ctx), @@ -44,7 +44,7 @@ func testAccResourcePolicy_hybrid(t *testing.T) { ctx := acctest.Context(t) resourceName := "aws_glue_resource_policy.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, glue.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckResourcePolicyDestroy(ctx), @@ -81,7 +81,7 @@ func testAccResourcePolicy_disappears(t *testing.T) { ctx := acctest.Context(t) resourceName := "aws_glue_resource_policy.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, glue.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckResourcePolicyDestroy(ctx), @@ -103,7 +103,7 @@ func testAccResourcePolicy_update(t *testing.T) { ctx := acctest.Context(t) resourceName := "aws_glue_resource_policy.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, glue.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckResourcePolicyDestroy(ctx), @@ -134,7 +134,7 @@ func testAccResourcePolicy_ignoreEquivalent(t *testing.T) { resourceName := "aws_glue_resource_policy.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, glue.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckResourcePolicyDestroy(ctx), diff --git a/internal/service/glue/schema_test.go b/internal/service/glue/schema_test.go index 7dc322f65b3f..3c55f08e4b43 100644 --- a/internal/service/glue/schema_test.go +++ b/internal/service/glue/schema_test.go @@ -25,7 +25,7 @@ func TestAccGlueSchema_basic(t *testing.T) { registryResourceName := "aws_glue_registry.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckSchema(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckSchema(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, glue.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSchemaDestroy(ctx), @@ -65,7 +65,7 @@ func TestAccGlueSchema_json(t *testing.T) { resourceName := "aws_glue_schema.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckSchema(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckSchema(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, glue.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSchemaDestroy(ctx), @@ -95,7 +95,7 @@ func TestAccGlueSchema_protobuf(t *testing.T) { resourceName := "aws_glue_schema.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckSchema(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckSchema(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, glue.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSchemaDestroy(ctx), @@ -125,7 +125,7 @@ func TestAccGlueSchema_description(t *testing.T) { resourceName := "aws_glue_schema.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckSchema(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckSchema(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, glue.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSchemaDestroy(ctx), @@ -161,7 +161,7 @@ func TestAccGlueSchema_compatibility(t *testing.T) { resourceName := "aws_glue_schema.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckSchema(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckSchema(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, glue.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSchemaDestroy(ctx), @@ -196,7 +196,7 @@ func TestAccGlueSchema_tags(t *testing.T) { resourceName := "aws_glue_schema.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckSchema(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckSchema(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, glue.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSchemaDestroy(ctx), @@ -243,7 +243,7 @@ func TestAccGlueSchema_schemaDefUpdated(t *testing.T) { resourceName := "aws_glue_schema.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckSchema(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckSchema(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, glue.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSchemaDestroy(ctx), @@ -283,7 +283,7 @@ func TestAccGlueSchema_disappears(t *testing.T) { resourceName := "aws_glue_schema.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckSchema(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckSchema(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, glue.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSchemaDestroy(ctx), @@ -308,7 +308,7 @@ func TestAccGlueSchema_Disappears_registry(t *testing.T) { resourceName := "aws_glue_schema.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckSchema(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckSchema(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, glue.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSchemaDestroy(ctx), diff --git a/internal/service/glue/script_data_source_test.go b/internal/service/glue/script_data_source_test.go index c32e3dbe7fd7..2fb6b93774d9 100644 --- a/internal/service/glue/script_data_source_test.go +++ b/internal/service/glue/script_data_source_test.go @@ -13,7 +13,7 @@ func TestAccGlueScriptDataSource_Language_python(t *testing.T) { dataSourceName := "data.aws_glue_script.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, glue.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ @@ -31,7 +31,7 @@ func TestAccGlueScriptDataSource_Language_scala(t *testing.T) { dataSourceName := "data.aws_glue_script.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, glue.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ diff --git a/internal/service/glue/security_configuration_test.go b/internal/service/glue/security_configuration_test.go index 3b444b5329dd..3029cef0fe2d 100644 --- a/internal/service/glue/security_configuration_test.go +++ b/internal/service/glue/security_configuration_test.go @@ -23,7 +23,7 @@ func TestAccGlueSecurityConfiguration_basic(t *testing.T) { resourceName := "aws_glue_security_configuration.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, glue.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSecurityConfigurationDestroy(ctx), @@ -63,7 +63,7 @@ func TestAccGlueSecurityConfiguration_CloudWatchEncryptionCloudWatchEncryptionMo resourceName := "aws_glue_security_configuration.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, glue.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSecurityConfigurationDestroy(ctx), @@ -96,7 +96,7 @@ func TestAccGlueSecurityConfiguration_JobBookmarksEncryptionJobBookmarksEncrypti resourceName := "aws_glue_security_configuration.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, glue.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSecurityConfigurationDestroy(ctx), @@ -129,7 +129,7 @@ func TestAccGlueSecurityConfiguration_S3EncryptionS3EncryptionMode_sseKMS(t *tes resourceName := "aws_glue_security_configuration.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, glue.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSecurityConfigurationDestroy(ctx), @@ -161,7 +161,7 @@ func TestAccGlueSecurityConfiguration_S3EncryptionS3EncryptionMode_sseS3(t *test resourceName := "aws_glue_security_configuration.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, glue.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSecurityConfigurationDestroy(ctx), diff --git a/internal/service/glue/trigger_test.go b/internal/service/glue/trigger_test.go index 465dc6b6349a..d8fdca1fa6a5 100644 --- a/internal/service/glue/trigger_test.go +++ b/internal/service/glue/trigger_test.go @@ -24,7 +24,7 @@ func TestAccGlueTrigger_basic(t *testing.T) { resourceName := "aws_glue_trigger.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, glue.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTriggerDestroy(ctx), @@ -66,7 +66,7 @@ func TestAccGlueTrigger_crawler(t *testing.T) { resourceName := "aws_glue_trigger.test_trigger" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, glue.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTriggerDestroy(ctx), @@ -115,7 +115,7 @@ func TestAccGlueTrigger_description(t *testing.T) { resourceName := "aws_glue_trigger.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, glue.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTriggerDestroy(ctx), @@ -152,7 +152,7 @@ func TestAccGlueTrigger_enabled(t *testing.T) { resourceName := "aws_glue_trigger.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, glue.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTriggerDestroy(ctx), @@ -196,7 +196,7 @@ func TestAccGlueTrigger_predicate(t *testing.T) { resourceName := "aws_glue_trigger.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, glue.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTriggerDestroy(ctx), @@ -241,7 +241,7 @@ func TestAccGlueTrigger_schedule(t *testing.T) { resourceName := "aws_glue_trigger.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, glue.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTriggerDestroy(ctx), @@ -278,7 +278,7 @@ func TestAccGlueTrigger_startOnCreate(t *testing.T) { resourceName := "aws_glue_trigger.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, glue.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTriggerDestroy(ctx), @@ -308,7 +308,7 @@ func TestAccGlueTrigger_tags(t *testing.T) { resourceName := "aws_glue_trigger.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, glue.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTriggerDestroy(ctx), @@ -356,7 +356,7 @@ func TestAccGlueTrigger_workflowName(t *testing.T) { resourceName := "aws_glue_trigger.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, glue.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTriggerDestroy(ctx), @@ -386,7 +386,7 @@ func TestAccGlueTrigger_Actions_notify(t *testing.T) { resourceName := "aws_glue_trigger.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, glue.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTriggerDestroy(ctx), @@ -439,7 +439,7 @@ func TestAccGlueTrigger_Actions_security(t *testing.T) { resourceName := "aws_glue_trigger.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, glue.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTriggerDestroy(ctx), @@ -471,7 +471,7 @@ func TestAccGlueTrigger_onDemandDisable(t *testing.T) { resourceName := "aws_glue_trigger.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, glue.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTriggerDestroy(ctx), @@ -518,7 +518,7 @@ func TestAccGlueTrigger_eventBatchingCondition(t *testing.T) { resourceName := "aws_glue_trigger.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, glue.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTriggerDestroy(ctx), @@ -561,7 +561,7 @@ func TestAccGlueTrigger_disappears(t *testing.T) { resourceName := "aws_glue_trigger.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, glue.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTriggerDestroy(ctx), diff --git a/internal/service/glue/user_defined_function_test.go b/internal/service/glue/user_defined_function_test.go index cd926a808e25..7e34d0d5c4a5 100644 --- a/internal/service/glue/user_defined_function_test.go +++ b/internal/service/glue/user_defined_function_test.go @@ -23,7 +23,7 @@ func TestAccGlueUserDefinedFunction_basic(t *testing.T) { resourceName := "aws_glue_user_defined_function.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, glue.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckUDFDestroy(ctx), @@ -64,7 +64,7 @@ func TestAccGlueUserDefinedFunction_Resource_uri(t *testing.T) { resourceName := "aws_glue_user_defined_function.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, glue.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckUDFDestroy(ctx), @@ -105,7 +105,7 @@ func TestAccGlueUserDefinedFunction_disappears(t *testing.T) { resourceName := "aws_glue_user_defined_function.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, glue.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckUDFDestroy(ctx), diff --git a/internal/service/glue/workflow_test.go b/internal/service/glue/workflow_test.go index 5af52c65108f..662cadb9ff45 100644 --- a/internal/service/glue/workflow_test.go +++ b/internal/service/glue/workflow_test.go @@ -24,7 +24,7 @@ func TestAccGlueWorkflow_basic(t *testing.T) { resourceName := "aws_glue_workflow.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckWorkflow(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckWorkflow(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, glue.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckWorkflowDestroy(ctx), @@ -55,7 +55,7 @@ func TestAccGlueWorkflow_maxConcurrentRuns(t *testing.T) { resourceName := "aws_glue_workflow.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckWorkflow(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckWorkflow(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, glue.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckWorkflowDestroy(ctx), @@ -98,7 +98,7 @@ func TestAccGlueWorkflow_defaultRunProperties(t *testing.T) { resourceName := "aws_glue_workflow.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckWorkflow(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckWorkflow(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, glue.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckWorkflowDestroy(ctx), @@ -129,7 +129,7 @@ func TestAccGlueWorkflow_description(t *testing.T) { resourceName := "aws_glue_workflow.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckWorkflow(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckWorkflow(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, glue.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckWorkflowDestroy(ctx), @@ -164,7 +164,7 @@ func TestAccGlueWorkflow_tags(t *testing.T) { resourceName := "aws_glue_workflow.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckWorkflow(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckWorkflow(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, glue.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckWorkflowDestroy(ctx), @@ -211,7 +211,7 @@ func TestAccGlueWorkflow_disappears(t *testing.T) { resourceName := "aws_glue_workflow.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckWorkflow(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckWorkflow(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, glue.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckWorkflowDestroy(ctx), From bda06d8106fc9fcd6c12551801e3a6b43905bbe4 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Fri, 24 Feb 2023 16:37:00 -0500 Subject: [PATCH 164/763] Add 'Context' argument to 'acctest.PreCheck' for grafana. --- .../grafana/license_association_test.go | 2 +- .../service/grafana/role_association_test.go | 12 +++++------ .../service/grafana/workspace_api_key_test.go | 2 +- .../grafana/workspace_data_source_test.go | 2 +- .../workspace_saml_configuration_test.go | 6 +++--- internal/service/grafana/workspace_test.go | 20 +++++++++---------- 6 files changed, 22 insertions(+), 22 deletions(-) diff --git a/internal/service/grafana/license_association_test.go b/internal/service/grafana/license_association_test.go index 513058c868a7..d178cc84e916 100644 --- a/internal/service/grafana/license_association_test.go +++ b/internal/service/grafana/license_association_test.go @@ -22,7 +22,7 @@ func testAccLicenseAssociation_freeTrial(t *testing.T) { workspaceResourceName := "aws_grafana_workspace.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(managedgrafana.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(managedgrafana.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, managedgrafana.EndpointsID), CheckDestroy: testAccCheckLicenseAssociationDestroy(ctx), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, diff --git a/internal/service/grafana/role_association_test.go b/internal/service/grafana/role_association_test.go index 1aa696566142..afb18e16d467 100644 --- a/internal/service/grafana/role_association_test.go +++ b/internal/service/grafana/role_association_test.go @@ -32,7 +32,7 @@ func testAccRoleAssociation_usersAdmin(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(managedgrafana.EndpointsID, t) acctest.PreCheckSSOAdminInstances(ctx, t) }, @@ -70,7 +70,7 @@ func testAccRoleAssociation_usersEditor(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(managedgrafana.EndpointsID, t) acctest.PreCheckSSOAdminInstances(ctx, t) }, @@ -108,7 +108,7 @@ func testAccRoleAssociation_groupsAdmin(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(managedgrafana.EndpointsID, t) acctest.PreCheckSSOAdminInstances(ctx, t) }, @@ -146,7 +146,7 @@ func testAccRoleAssociation_groupsEditor(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(managedgrafana.EndpointsID, t) acctest.PreCheckSSOAdminInstances(ctx, t) }, @@ -189,7 +189,7 @@ func testAccRoleAssociation_usersAndGroupsAdmin(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(managedgrafana.EndpointsID, t) acctest.PreCheckSSOAdminInstances(ctx, t) }, @@ -234,7 +234,7 @@ func testAccRoleAssociation_usersAndGroupsEditor(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(managedgrafana.EndpointsID, t) acctest.PreCheckSSOAdminInstances(ctx, t) }, diff --git a/internal/service/grafana/workspace_api_key_test.go b/internal/service/grafana/workspace_api_key_test.go index 343edd08e114..dde0665e74c1 100644 --- a/internal/service/grafana/workspace_api_key_test.go +++ b/internal/service/grafana/workspace_api_key_test.go @@ -16,7 +16,7 @@ func testAccWorkspaceAPIKey_basic(t *testing.T) { workspaceResourceName := "aws_grafana_workspace.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(managedgrafana.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(managedgrafana.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, managedgrafana.EndpointsID), CheckDestroy: acctest.CheckDestroyNoop, ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, diff --git a/internal/service/grafana/workspace_data_source_test.go b/internal/service/grafana/workspace_data_source_test.go index 6d15e366f13d..c1167258d005 100644 --- a/internal/service/grafana/workspace_data_source_test.go +++ b/internal/service/grafana/workspace_data_source_test.go @@ -16,7 +16,7 @@ func testAccWorkspaceDataSource_basic(t *testing.T) { dataSourceName := "data.aws_grafana_workspace.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(managedgrafana.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(managedgrafana.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, managedgrafana.EndpointsID), CheckDestroy: nil, ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, diff --git a/internal/service/grafana/workspace_saml_configuration_test.go b/internal/service/grafana/workspace_saml_configuration_test.go index 29ac3039dd5c..b69723314919 100644 --- a/internal/service/grafana/workspace_saml_configuration_test.go +++ b/internal/service/grafana/workspace_saml_configuration_test.go @@ -21,7 +21,7 @@ func testAccWorkspaceSAMLConfiguration_basic(t *testing.T) { workspaceResourceName := "aws_grafana_workspace.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(managedgrafana.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(managedgrafana.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, managedgrafana.EndpointsID), CheckDestroy: nil, ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, @@ -50,7 +50,7 @@ func testAccWorkspaceSAMLConfiguration_loginValidity(t *testing.T) { workspaceResourceName := "aws_grafana_workspace.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(managedgrafana.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(managedgrafana.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, managedgrafana.EndpointsID), CheckDestroy: nil, ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, @@ -80,7 +80,7 @@ func testAccWorkspaceSAMLConfiguration_assertions(t *testing.T) { workspaceResourceName := "aws_grafana_workspace.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(managedgrafana.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(managedgrafana.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, managedgrafana.EndpointsID), CheckDestroy: nil, ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, diff --git a/internal/service/grafana/workspace_test.go b/internal/service/grafana/workspace_test.go index a9e0cceaf2df..e504d46caa92 100644 --- a/internal/service/grafana/workspace_test.go +++ b/internal/service/grafana/workspace_test.go @@ -66,7 +66,7 @@ func testAccWorkspace_saml(t *testing.T) { iamRoleResourceName := "aws_iam_role.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(managedgrafana.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(managedgrafana.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, managedgrafana.EndpointsID), CheckDestroy: testAccCheckWorkspaceDestroy(ctx), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, @@ -110,7 +110,7 @@ func testAccWorkspace_vpc(t *testing.T) { resourceName := "aws_grafana_workspace.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(managedgrafana.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(managedgrafana.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, managedgrafana.EndpointsID), CheckDestroy: testAccCheckWorkspaceDestroy(ctx), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, @@ -150,7 +150,7 @@ func testAccWorkspace_sso(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(managedgrafana.EndpointsID, t) acctest.PreCheckSSOAdminInstances(ctx, t) }, @@ -196,7 +196,7 @@ func testAccWorkspace_disappears(t *testing.T) { resourceName := "aws_grafana_workspace.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(managedgrafana.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(managedgrafana.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, managedgrafana.EndpointsID), CheckDestroy: testAccCheckWorkspaceDestroy(ctx), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, @@ -220,7 +220,7 @@ func testAccWorkspace_organization(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(managedgrafana.EndpointsID, t) acctest.PreCheckOrganizationsEnabled(ctx, t) acctest.PreCheckOrganizationManagementAccount(ctx, t) @@ -255,7 +255,7 @@ func testAccWorkspace_tags(t *testing.T) { resourceName := "aws_grafana_workspace.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(managedgrafana.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(managedgrafana.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, managedgrafana.EndpointsID), CheckDestroy: testAccCheckWorkspaceDestroy(ctx), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, @@ -301,7 +301,7 @@ func testAccWorkspace_dataSources(t *testing.T) { iamRoleResourceName := "aws_iam_role.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(managedgrafana.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(managedgrafana.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, managedgrafana.EndpointsID), CheckDestroy: testAccCheckWorkspaceDestroy(ctx), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, @@ -346,7 +346,7 @@ func testAccWorkspace_permissionType(t *testing.T) { resourceName := "aws_grafana_workspace.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(managedgrafana.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(managedgrafana.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, managedgrafana.EndpointsID), CheckDestroy: testAccCheckWorkspaceDestroy(ctx), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, @@ -380,7 +380,7 @@ func testAccWorkspace_notificationDestinations(t *testing.T) { resourceName := "aws_grafana_workspace.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(managedgrafana.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(managedgrafana.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, managedgrafana.EndpointsID), CheckDestroy: testAccCheckWorkspaceDestroy(ctx), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, @@ -419,7 +419,7 @@ func testAccWorkspace_configuration(t *testing.T) { resourceName := "aws_grafana_workspace.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(managedgrafana.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(managedgrafana.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, managedgrafana.EndpointsID), CheckDestroy: testAccCheckWorkspaceDestroy(ctx), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, From 1ba56488e7b235e1de1a964e7da425e67d39d816 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Fri, 24 Feb 2023 16:37:01 -0500 Subject: [PATCH 165/763] Add 'Context' argument to 'acctest.PreCheck' for guardduty. --- .../service/guardduty/detector_data_source_test.go | 4 ++-- internal/service/guardduty/detector_test.go | 12 ++++++------ internal/service/guardduty/filter_test.go | 8 ++++---- internal/service/guardduty/invite_accepter_test.go | 2 +- internal/service/guardduty/ipset_test.go | 4 ++-- internal/service/guardduty/member_test.go | 8 ++++---- .../guardduty/organization_admin_account_test.go | 2 +- .../guardduty/organization_configuration_test.go | 8 ++++---- .../service/guardduty/publishing_destination_test.go | 4 ++-- internal/service/guardduty/threatintelset_test.go | 4 ++-- 10 files changed, 28 insertions(+), 28 deletions(-) diff --git a/internal/service/guardduty/detector_data_source_test.go b/internal/service/guardduty/detector_data_source_test.go index 8998d2142247..fc37b90a76c5 100644 --- a/internal/service/guardduty/detector_data_source_test.go +++ b/internal/service/guardduty/detector_data_source_test.go @@ -10,7 +10,7 @@ import ( func testAccDetectorDataSource_basic(t *testing.T) { resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, guardduty.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, PreventPostDestroyRefresh: true, @@ -34,7 +34,7 @@ func testAccDetectorDataSource_basic(t *testing.T) { func testAccDetectorDataSource_ID(t *testing.T) { resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, guardduty.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ diff --git a/internal/service/guardduty/detector_test.go b/internal/service/guardduty/detector_test.go index 92145e296dfb..ae112613615a 100644 --- a/internal/service/guardduty/detector_test.go +++ b/internal/service/guardduty/detector_test.go @@ -20,7 +20,7 @@ func testAccDetector_basic(t *testing.T) { resourceName := "aws_guardduty_detector.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, guardduty.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDetectorDestroy(ctx), @@ -74,7 +74,7 @@ func testAccDetector_tags(t *testing.T) { resourceName := "aws_guardduty_detector.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, guardduty.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDetectorDestroy(ctx), @@ -118,7 +118,7 @@ func testAccDetector_datasources_s3logs(t *testing.T) { resourceName := "aws_guardduty_detector.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, guardduty.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDetectorDestroy(ctx), @@ -155,7 +155,7 @@ func testAccDetector_datasources_kubernetes_audit_logs(t *testing.T) { resourceName := "aws_guardduty_detector.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, guardduty.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDetectorDestroy(ctx), @@ -192,7 +192,7 @@ func testAccDetector_datasources_malware_protection(t *testing.T) { resourceName := "aws_guardduty_detector.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, guardduty.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDetectorDestroy(ctx), @@ -232,7 +232,7 @@ func testAccDetector_datasources_all(t *testing.T) { resourceName := "aws_guardduty_detector.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, guardduty.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDetectorDestroy(ctx), diff --git a/internal/service/guardduty/filter_test.go b/internal/service/guardduty/filter_test.go index edd5ebd91d73..9748c760e517 100644 --- a/internal/service/guardduty/filter_test.go +++ b/internal/service/guardduty/filter_test.go @@ -27,7 +27,7 @@ func testAccFilter_basic(t *testing.T) { endDate := "2020-02-01T00:00:00Z" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, guardduty.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckFilterDestroy(ctx), @@ -94,7 +94,7 @@ func testAccFilter_update(t *testing.T) { endDate := "2020-02-01T00:00:00Z" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, guardduty.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckFilterDestroy(ctx), @@ -139,7 +139,7 @@ func testAccFilter_tags(t *testing.T) { endDate := "2020-02-01T00:00:00Z" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, guardduty.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckFilterDestroy(ctx), @@ -181,7 +181,7 @@ func testAccFilter_disappears(t *testing.T) { endDate := "2020-02-01T00:00:00Z" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, guardduty.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckACMPCACertificateAuthorityDestroy(ctx), diff --git a/internal/service/guardduty/invite_accepter_test.go b/internal/service/guardduty/invite_accepter_test.go index 95c4bcc62d2a..b6bbf10432f5 100644 --- a/internal/service/guardduty/invite_accepter_test.go +++ b/internal/service/guardduty/invite_accepter_test.go @@ -23,7 +23,7 @@ func testAccInviteAccepter_basic(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckAlternateAccount(t) }, ErrorCheck: acctest.ErrorCheck(t, guardduty.EndpointsID), diff --git a/internal/service/guardduty/ipset_test.go b/internal/service/guardduty/ipset_test.go index 3414ed7b96fc..701b80344aca 100644 --- a/internal/service/guardduty/ipset_test.go +++ b/internal/service/guardduty/ipset_test.go @@ -27,7 +27,7 @@ func testAccIPSet_basic(t *testing.T) { resourceName := "aws_guardduty_ipset.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, guardduty.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckIPSetDestroy(ctx), @@ -67,7 +67,7 @@ func testAccIPSet_tags(t *testing.T) { resourceName := "aws_guardduty_ipset.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, guardduty.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckIPSetDestroy(ctx), diff --git a/internal/service/guardduty/member_test.go b/internal/service/guardduty/member_test.go index 021a0cddf7cb..d8a0170f3c59 100644 --- a/internal/service/guardduty/member_test.go +++ b/internal/service/guardduty/member_test.go @@ -21,7 +21,7 @@ func testAccMember_basic(t *testing.T) { accountID := "111111111111" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, guardduty.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckMemberDestroy(ctx), @@ -51,7 +51,7 @@ func testAccMember_invite_disassociate(t *testing.T) { accountID, email := testAccMemberFromEnv(t) resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, guardduty.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckMemberDestroy(ctx), @@ -91,7 +91,7 @@ func testAccMember_invite_onUpdate(t *testing.T) { accountID, email := testAccMemberFromEnv(t) resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, guardduty.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckMemberDestroy(ctx), @@ -132,7 +132,7 @@ func testAccMember_invitationMessage(t *testing.T) { invitationMessage := "inviting" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, guardduty.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckMemberDestroy(ctx), diff --git a/internal/service/guardduty/organization_admin_account_test.go b/internal/service/guardduty/organization_admin_account_test.go index 92ed0714f5e1..e0b223bf8097 100644 --- a/internal/service/guardduty/organization_admin_account_test.go +++ b/internal/service/guardduty/organization_admin_account_test.go @@ -20,7 +20,7 @@ func testAccOrganizationAdminAccount_basic(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckOrganizationsAccount(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, guardduty.EndpointsID), diff --git a/internal/service/guardduty/organization_configuration_test.go b/internal/service/guardduty/organization_configuration_test.go index c87708e2b853..a3824b9ef52e 100644 --- a/internal/service/guardduty/organization_configuration_test.go +++ b/internal/service/guardduty/organization_configuration_test.go @@ -16,7 +16,7 @@ func testAccOrganizationConfiguration_basic(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckOrganizationsAccount(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, guardduty.EndpointsID), @@ -55,7 +55,7 @@ func testAccOrganizationConfiguration_s3logs(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckOrganizationsAccount(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, guardduty.EndpointsID), @@ -98,7 +98,7 @@ func testAccOrganizationConfiguration_kubernetes(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckOrganizationsAccount(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, guardduty.EndpointsID), @@ -143,7 +143,7 @@ func testAccOrganizationConfiguration_malwareprotection(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckOrganizationsAccount(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, guardduty.EndpointsID), diff --git a/internal/service/guardduty/publishing_destination_test.go b/internal/service/guardduty/publishing_destination_test.go index 0257de141a8c..eabd7e87da7a 100644 --- a/internal/service/guardduty/publishing_destination_test.go +++ b/internal/service/guardduty/publishing_destination_test.go @@ -24,7 +24,7 @@ func testAccPublishingDestination_basic(t *testing.T) { kmsKeyResourceName := "aws_kms_key.gd_key" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, guardduty.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckPublishingDestinationDestroy(ctx), @@ -53,7 +53,7 @@ func testAccPublishingDestination_disappears(t *testing.T) { bucketName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, guardduty.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckPublishingDestinationDestroy(ctx), diff --git a/internal/service/guardduty/threatintelset_test.go b/internal/service/guardduty/threatintelset_test.go index 99ab813a3bbc..dd8f55d68fa8 100644 --- a/internal/service/guardduty/threatintelset_test.go +++ b/internal/service/guardduty/threatintelset_test.go @@ -27,7 +27,7 @@ func testAccThreatIntelSet_basic(t *testing.T) { resourceName := "aws_guardduty_threatintelset.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, guardduty.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckThreatIntelSetDestroy(ctx), @@ -67,7 +67,7 @@ func testAccThreatIntelSet_tags(t *testing.T) { resourceName := "aws_guardduty_threatintelset.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, guardduty.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckThreatIntelSetDestroy(ctx), From 708e59b765917253463b46c13f8a66e7576f5c74 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Fri, 24 Feb 2023 16:37:01 -0500 Subject: [PATCH 166/763] Add 'Context' argument to 'acctest.PreCheck' for iam. --- internal/service/iam/access_key_test.go | 6 +-- .../iam/account_alias_data_source_test.go | 2 +- internal/service/iam/account_alias_test.go | 2 +- .../iam/account_password_policy_test.go | 4 +- .../service/iam/group_data_source_test.go | 4 +- internal/service/iam/group_membership_test.go | 4 +- .../iam/group_policy_attachment_test.go | 2 +- internal/service/iam/group_policy_test.go | 10 ++-- internal/service/iam/group_test.go | 8 +-- .../iam/instance_profile_data_source_test.go | 2 +- internal/service/iam/instance_profile_test.go | 12 ++--- .../iam/instance_profiles_data_source_test.go | 2 +- ...penid_connect_provider_data_source_test.go | 6 +-- .../iam/openid_connect_provider_test.go | 6 +-- .../service/iam/policy_attachment_test.go | 10 ++-- .../service/iam/policy_data_source_test.go | 14 +++--- .../iam/policy_document_data_source_test.go | 40 +++++++-------- internal/service/iam/policy_test.go | 16 +++--- internal/service/iam/role_data_source_test.go | 4 +- .../iam/role_policy_attachment_test.go | 6 +-- internal/service/iam/role_policy_test.go | 16 +++--- internal/service/iam/role_test.go | 50 +++++++++---------- .../service/iam/roles_data_source_test.go | 10 ++-- .../iam/saml_provider_data_source_test.go | 2 +- internal/service/iam/saml_provider_test.go | 6 +-- .../server_certificate_data_source_test.go | 6 +-- .../service/iam/server_certificate_test.go | 14 +++--- .../service/iam/service_linked_role_test.go | 12 ++--- .../iam/service_specific_credential_test.go | 8 +-- .../iam/session_context_data_source_test.go | 10 ++-- .../service/iam/signing_certificate_test.go | 6 +-- internal/service/iam/user_data_source_test.go | 4 +- .../service/iam/user_group_membership_test.go | 2 +- .../service/iam/user_login_profile_test.go | 14 +++--- .../iam/user_policy_attachment_test.go | 2 +- internal/service/iam/user_policy_test.go | 12 ++--- .../iam/user_ssh_key_data_source_test.go | 2 +- internal/service/iam/user_ssh_key_test.go | 6 +-- internal/service/iam/user_test.go | 24 ++++----- .../service/iam/users_data_source_test.go | 8 +-- .../service/iam/virtual_mfa_device_test.go | 6 +-- 41 files changed, 190 insertions(+), 190 deletions(-) diff --git a/internal/service/iam/access_key_test.go b/internal/service/iam/access_key_test.go index 9ae29cd77f45..118889f57899 100644 --- a/internal/service/iam/access_key_test.go +++ b/internal/service/iam/access_key_test.go @@ -26,7 +26,7 @@ func TestAccIAMAccessKey_basic(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, iam.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckAccessKeyDestroy(ctx), @@ -61,7 +61,7 @@ func TestAccIAMAccessKey_encrypted(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, iam.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckAccessKeyDestroy(ctx), @@ -96,7 +96,7 @@ func TestAccIAMAccessKey_status(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, iam.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckAccessKeyDestroy(ctx), diff --git a/internal/service/iam/account_alias_data_source_test.go b/internal/service/iam/account_alias_data_source_test.go index 284e103c912d..abb171626b5c 100644 --- a/internal/service/iam/account_alias_data_source_test.go +++ b/internal/service/iam/account_alias_data_source_test.go @@ -18,7 +18,7 @@ func testAccAccountAliasDataSource_basic(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, iam.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckAccountAliasDestroy(ctx), diff --git a/internal/service/iam/account_alias_test.go b/internal/service/iam/account_alias_test.go index 8d61b1fa5a38..2777354a34ee 100644 --- a/internal/service/iam/account_alias_test.go +++ b/internal/service/iam/account_alias_test.go @@ -35,7 +35,7 @@ func testAccAccountAlias_basic(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, iam.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckAccountAliasDestroy(ctx), diff --git a/internal/service/iam/account_password_policy_test.go b/internal/service/iam/account_password_policy_test.go index 9647095220a6..76cd8a4673e8 100644 --- a/internal/service/iam/account_password_policy_test.go +++ b/internal/service/iam/account_password_policy_test.go @@ -31,7 +31,7 @@ func testAccAccountPasswordPolicy_basic(t *testing.T) { resourceName := "aws_iam_account_password_policy.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, iam.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckAccountPasswordPolicyDestroy(ctx), @@ -65,7 +65,7 @@ func testAccAccountPasswordPolicy_disappears(t *testing.T) { resourceName := "aws_iam_account_password_policy.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, iam.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckAccountPasswordPolicyDestroy(ctx), diff --git a/internal/service/iam/group_data_source_test.go b/internal/service/iam/group_data_source_test.go index 0342ed5d94c4..b7ba69fe1d2b 100644 --- a/internal/service/iam/group_data_source_test.go +++ b/internal/service/iam/group_data_source_test.go @@ -14,7 +14,7 @@ func TestAccIAMGroupDataSource_basic(t *testing.T) { groupName := fmt.Sprintf("test-datasource-user-%d", sdkacctest.RandInt()) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, iam.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ @@ -38,7 +38,7 @@ func TestAccIAMGroupDataSource_users(t *testing.T) { userCount := 101 resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, iam.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ diff --git a/internal/service/iam/group_membership_test.go b/internal/service/iam/group_membership_test.go index d8cd46d3c587..6d6985379ba9 100644 --- a/internal/service/iam/group_membership_test.go +++ b/internal/service/iam/group_membership_test.go @@ -28,7 +28,7 @@ func TestAccIAMGroupMembership_basic(t *testing.T) { membershipName := fmt.Sprintf("tf-acc-membership-gm-basic-%s", rString) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, iam.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckGroupMembershipDestroy(ctx), @@ -70,7 +70,7 @@ func TestAccIAMGroupMembership_paginatedUserList(t *testing.T) { userNamePrefix := fmt.Sprintf("tf-acc-user-gm-pul-%s-", rString) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, iam.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckGroupMembershipDestroy(ctx), diff --git a/internal/service/iam/group_policy_attachment_test.go b/internal/service/iam/group_policy_attachment_test.go index 986d51e437db..65b32b97d35d 100644 --- a/internal/service/iam/group_policy_attachment_test.go +++ b/internal/service/iam/group_policy_attachment_test.go @@ -27,7 +27,7 @@ func TestAccIAMGroupPolicyAttachment_basic(t *testing.T) { policyName3 := fmt.Sprintf("tf-acc-policy-gpa-basic-3-%s", rString) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, iam.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckGroupPolicyAttachmentDestroy, diff --git a/internal/service/iam/group_policy_test.go b/internal/service/iam/group_policy_test.go index da518db4b00a..06ce5f73c66d 100644 --- a/internal/service/iam/group_policy_test.go +++ b/internal/service/iam/group_policy_test.go @@ -23,7 +23,7 @@ func TestAccIAMGroupPolicy_basic(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, iam.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckGroupPolicyDestroy(ctx), @@ -67,7 +67,7 @@ func TestAccIAMGroupPolicy_disappears(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, iam.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckGroupPolicyDestroy(ctx), @@ -93,7 +93,7 @@ func TestAccIAMGroupPolicy_namePrefix(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, iam.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckGroupPolicyDestroy(ctx), @@ -133,7 +133,7 @@ func TestAccIAMGroupPolicy_generatedName(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, iam.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckGroupPolicyDestroy(ctx), @@ -179,7 +179,7 @@ func TestAccIAMGroupPolicy_unknownsInPolicy(t *testing.T) { groupName := "aws_iam_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, iam.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRolePolicyDestroy(ctx), diff --git a/internal/service/iam/group_test.go b/internal/service/iam/group_test.go index d764803b2cc9..cc5c0acd6146 100644 --- a/internal/service/iam/group_test.go +++ b/internal/service/iam/group_test.go @@ -22,7 +22,7 @@ func TestAccIAMGroup_basic(t *testing.T) { resourceName := "aws_iam_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, iam.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckGroupDestroy(ctx), @@ -54,7 +54,7 @@ func TestAccIAMGroup_disappears(t *testing.T) { resourceName := "aws_iam_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, iam.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckGroupDestroy(ctx), @@ -79,7 +79,7 @@ func TestAccIAMGroup_nameChange(t *testing.T) { resourceName := "aws_iam_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, iam.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckGroupDestroy(ctx), @@ -111,7 +111,7 @@ func TestAccIAMGroup_path(t *testing.T) { resourceName := "aws_iam_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, iam.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckGroupDestroy(ctx), diff --git a/internal/service/iam/instance_profile_data_source_test.go b/internal/service/iam/instance_profile_data_source_test.go index a0095b28aff8..7602ec750744 100644 --- a/internal/service/iam/instance_profile_data_source_test.go +++ b/internal/service/iam/instance_profile_data_source_test.go @@ -17,7 +17,7 @@ func TestAccIAMInstanceProfileDataSource_basic(t *testing.T) { profileName := fmt.Sprintf("tf-acc-ds-instance-profile-%d", sdkacctest.RandInt()) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, iam.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ diff --git a/internal/service/iam/instance_profile_test.go b/internal/service/iam/instance_profile_test.go index 1072844dce32..9b72735efb4f 100644 --- a/internal/service/iam/instance_profile_test.go +++ b/internal/service/iam/instance_profile_test.go @@ -24,7 +24,7 @@ func TestAccIAMInstanceProfile_basic(t *testing.T) { rName := sdkacctest.RandString(5) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, iam.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckInstanceProfileDestroy(ctx), @@ -54,7 +54,7 @@ func TestAccIAMInstanceProfile_withoutRole(t *testing.T) { resourceName := "aws_iam_instance_profile.test" rName := sdkacctest.RandString(5) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, iam.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckInstanceProfileDestroy(ctx), @@ -82,7 +82,7 @@ func TestAccIAMInstanceProfile_tags(t *testing.T) { rName := sdkacctest.RandString(5) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, iam.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckInstanceProfileDestroy(ctx), @@ -129,7 +129,7 @@ func TestAccIAMInstanceProfile_namePrefix(t *testing.T) { resourceName := "aws_iam_instance_profile.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, iam.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckInstanceProfileDestroy(ctx), @@ -159,7 +159,7 @@ func TestAccIAMInstanceProfile_disappears(t *testing.T) { rName := sdkacctest.RandString(5) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, iam.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckInstanceProfileDestroy(ctx), @@ -183,7 +183,7 @@ func TestAccIAMInstanceProfile_Disappears_role(t *testing.T) { rName := sdkacctest.RandString(5) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, iam.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckInstanceProfileDestroy(ctx), diff --git a/internal/service/iam/instance_profiles_data_source_test.go b/internal/service/iam/instance_profiles_data_source_test.go index 69fb59b53655..9859cec0885e 100644 --- a/internal/service/iam/instance_profiles_data_source_test.go +++ b/internal/service/iam/instance_profiles_data_source_test.go @@ -16,7 +16,7 @@ func TestAccIAMInstanceProfilesDataSource_basic(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, iam.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ 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 6c13741606c2..a5af5eace5a4 100644 --- a/internal/service/iam/openid_connect_provider_data_source_test.go +++ b/internal/service/iam/openid_connect_provider_data_source_test.go @@ -17,7 +17,7 @@ func TestAccIAMOpenidConnectProviderDataSource_basic(t *testing.T) { resourceName := "aws_iam_openid_connect_provider.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, iam.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckOpenIDConnectProviderDestroy(ctx), @@ -44,7 +44,7 @@ func TestAccIAMOpenidConnectProviderDataSource_url(t *testing.T) { resourceName := "aws_iam_openid_connect_provider.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, iam.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckOpenIDConnectProviderDestroy(ctx), @@ -71,7 +71,7 @@ func TestAccIAMOpenidConnectProviderDataSource_tags(t *testing.T) { resourceName := "aws_iam_openid_connect_provider.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, iam.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckOpenIDConnectProviderDestroy(ctx), diff --git a/internal/service/iam/openid_connect_provider_test.go b/internal/service/iam/openid_connect_provider_test.go index 47e2350beeb0..2f9d0bbd55e4 100644 --- a/internal/service/iam/openid_connect_provider_test.go +++ b/internal/service/iam/openid_connect_provider_test.go @@ -23,7 +23,7 @@ func TestAccIAMOpenIDConnectProvider_basic(t *testing.T) { resourceName := "aws_iam_openid_connect_provider.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, iam.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckOpenIDConnectProviderDestroy(ctx), @@ -70,7 +70,7 @@ func TestAccIAMOpenIDConnectProvider_tags(t *testing.T) { resourceName := "aws_iam_openid_connect_provider.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, iam.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckInstanceProfileDestroy(ctx), @@ -116,7 +116,7 @@ func TestAccIAMOpenIDConnectProvider_disappears(t *testing.T) { resourceName := "aws_iam_openid_connect_provider.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, iam.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckOpenIDConnectProviderDestroy(ctx), diff --git a/internal/service/iam/policy_attachment_test.go b/internal/service/iam/policy_attachment_test.go index 89b8c78983f2..4d9d02d8b3f4 100644 --- a/internal/service/iam/policy_attachment_test.go +++ b/internal/service/iam/policy_attachment_test.go @@ -32,7 +32,7 @@ func TestAccIAMPolicyAttachment_basic(t *testing.T) { attachmentName := fmt.Sprintf("tf-acc-attachment-pa-basic-%s", rString) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, iam.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckPolicyAttachmentDestroy, @@ -69,7 +69,7 @@ func TestAccIAMPolicyAttachment_paginatedEntities(t *testing.T) { attachmentName := fmt.Sprintf("tf-acc-attachment-pa-pe-%s-", rString) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, iam.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckPolicyAttachmentDestroy, @@ -94,7 +94,7 @@ func TestAccIAMPolicyAttachment_Groups_renamedGroup(t *testing.T) { resourceName := "aws_iam_policy_attachment.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, iam.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckPolicyAttachmentDestroy, @@ -127,7 +127,7 @@ func TestAccIAMPolicyAttachment_Roles_renamedRole(t *testing.T) { resourceName := "aws_iam_policy_attachment.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, iam.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckPolicyAttachmentDestroy, @@ -160,7 +160,7 @@ func TestAccIAMPolicyAttachment_Users_renamedUser(t *testing.T) { resourceName := "aws_iam_policy_attachment.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, iam.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckPolicyAttachmentDestroy, diff --git a/internal/service/iam/policy_data_source_test.go b/internal/service/iam/policy_data_source_test.go index c074e7169c1f..d189f4a280b4 100644 --- a/internal/service/iam/policy_data_source_test.go +++ b/internal/service/iam/policy_data_source_test.go @@ -62,7 +62,7 @@ func TestAccIAMPolicyDataSource_arn(t *testing.T) { policyName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, iam.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ @@ -88,7 +88,7 @@ func TestAccIAMPolicyDataSource_arnTags(t *testing.T) { policyName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, iam.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ @@ -115,7 +115,7 @@ func TestAccIAMPolicyDataSource_name(t *testing.T) { policyName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, iam.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ @@ -141,7 +141,7 @@ func TestAccIAMPolicyDataSource_nameTags(t *testing.T) { policyName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, iam.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ @@ -170,7 +170,7 @@ func TestAccIAMPolicyDataSource_nameAndPathPrefix(t *testing.T) { policyPath := "/test-path/" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, iam.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ @@ -198,7 +198,7 @@ func TestAccIAMPolicyDataSource_nameAndPathPrefixTags(t *testing.T) { policyPath := "/test-path/" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, iam.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ @@ -224,7 +224,7 @@ func TestAccIAMPolicyDataSource_nonExistent(t *testing.T) { policyPath := "/test-path/" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, iam.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ diff --git a/internal/service/iam/policy_document_data_source_test.go b/internal/service/iam/policy_document_data_source_test.go index 643bde2f0f51..ab5acca5163b 100644 --- a/internal/service/iam/policy_document_data_source_test.go +++ b/internal/service/iam/policy_document_data_source_test.go @@ -16,7 +16,7 @@ func TestAccIAMPolicyDocumentDataSource_basic(t *testing.T) { // acceptance test, but just instantiating the AWS provider requires // some AWS API calls, and so this needs valid AWS credentials to work. resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, iam.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ @@ -36,7 +36,7 @@ func TestAccIAMPolicyDocumentDataSource_singleConditionValue(t *testing.T) { dataSourceName := "data.aws_iam_policy_document.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, iam.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ @@ -52,7 +52,7 @@ func TestAccIAMPolicyDocumentDataSource_singleConditionValue(t *testing.T) { func TestAccIAMPolicyDocumentDataSource_conditionWithBoolValue(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, iam.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ @@ -73,7 +73,7 @@ func TestAccIAMPolicyDocumentDataSource_source(t *testing.T) { // acceptance test, but just instantiating the AWS provider requires // some AWS API calls, and so this needs valid AWS credentials to work. resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, iam.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ @@ -99,7 +99,7 @@ func TestAccIAMPolicyDocumentDataSource_source(t *testing.T) { func TestAccIAMPolicyDocumentDataSource_sourceList(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, iam.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ @@ -117,7 +117,7 @@ func TestAccIAMPolicyDocumentDataSource_sourceList(t *testing.T) { func TestAccIAMPolicyDocumentDataSource_sourceConflicting(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, iam.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ @@ -135,7 +135,7 @@ func TestAccIAMPolicyDocumentDataSource_sourceConflicting(t *testing.T) { func TestAccIAMPolicyDocumentDataSource_sourceListConflicting(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, iam.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ @@ -149,7 +149,7 @@ func TestAccIAMPolicyDocumentDataSource_sourceListConflicting(t *testing.T) { func TestAccIAMPolicyDocumentDataSource_override(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, iam.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ @@ -167,7 +167,7 @@ func TestAccIAMPolicyDocumentDataSource_override(t *testing.T) { func TestAccIAMPolicyDocumentDataSource_overrideList(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, iam.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ @@ -185,7 +185,7 @@ func TestAccIAMPolicyDocumentDataSource_overrideList(t *testing.T) { func TestAccIAMPolicyDocumentDataSource_noStatementMerge(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, iam.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ @@ -203,7 +203,7 @@ func TestAccIAMPolicyDocumentDataSource_noStatementMerge(t *testing.T) { func TestAccIAMPolicyDocumentDataSource_noStatementOverride(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, iam.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ @@ -221,7 +221,7 @@ func TestAccIAMPolicyDocumentDataSource_noStatementOverride(t *testing.T) { func TestAccIAMPolicyDocumentDataSource_duplicateSid(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, iam.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ @@ -243,7 +243,7 @@ func TestAccIAMPolicyDocumentDataSource_duplicateSid(t *testing.T) { func TestAccIAMPolicyDocumentDataSource_sourcePolicyValidJSON(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, iam.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ @@ -265,7 +265,7 @@ func TestAccIAMPolicyDocumentDataSource_sourcePolicyValidJSON(t *testing.T) { func TestAccIAMPolicyDocumentDataSource_overridePolicyDocumentValidJSON(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, iam.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ @@ -287,7 +287,7 @@ func TestAccIAMPolicyDocumentDataSource_overridePolicyDocumentValidJSON(t *testi func TestAccIAMPolicyDocumentDataSource_overrideJSONValidJSON(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, iam.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ @@ -309,7 +309,7 @@ func TestAccIAMPolicyDocumentDataSource_overrideJSONValidJSON(t *testing.T) { func TestAccIAMPolicyDocumentDataSource_sourceJSONValidJSON(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, iam.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ @@ -334,7 +334,7 @@ func TestAccIAMPolicyDocumentDataSource_StatementPrincipalIdentifiers_stringAndS dataSourceName := "data.aws_iam_policy_document.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, iam.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ @@ -353,7 +353,7 @@ func TestAccIAMPolicyDocumentDataSource_StatementPrincipalIdentifiers_multiplePr dataSourceName := "data.aws_iam_policy_document.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartition(t, endpoints.AwsPartitionID) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartition(t, endpoints.AwsPartitionID) }, ErrorCheck: acctest.ErrorCheck(t, iam.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ @@ -371,7 +371,7 @@ func TestAccIAMPolicyDocumentDataSource_StatementPrincipalIdentifiers_multiplePr dataSourceName := "data.aws_iam_policy_document.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartition(t, endpoints.AwsUsGovPartitionID) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartition(t, endpoints.AwsUsGovPartitionID) }, ErrorCheck: acctest.ErrorCheck(t, iam.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ @@ -387,7 +387,7 @@ func TestAccIAMPolicyDocumentDataSource_StatementPrincipalIdentifiers_multiplePr func TestAccIAMPolicyDocumentDataSource_version20081017(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, iam.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ diff --git a/internal/service/iam/policy_test.go b/internal/service/iam/policy_test.go index c1da8b4eb25e..69ae314a8dae 100644 --- a/internal/service/iam/policy_test.go +++ b/internal/service/iam/policy_test.go @@ -25,7 +25,7 @@ func TestAccIAMPolicy_basic(t *testing.T) { expectedPolicyText := `{"Statement":[{"Action":["ec2:Describe*"],"Effect":"Allow","Resource":"*"}],"Version":"2012-10-17"}` resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, iam.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckPolicyDestroy(ctx), @@ -59,7 +59,7 @@ func TestAccIAMPolicy_description(t *testing.T) { resourceName := "aws_iam_policy.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, iam.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckPolicyDestroy(ctx), @@ -87,7 +87,7 @@ func TestAccIAMPolicy_tags(t *testing.T) { resourceName := "aws_iam_policy.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, iam.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckPolicyDestroy(ctx), @@ -133,7 +133,7 @@ func TestAccIAMPolicy_disappears(t *testing.T) { resourceName := "aws_iam_policy.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, iam.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckPolicyDestroy(ctx), @@ -156,7 +156,7 @@ func TestAccIAMPolicy_namePrefix(t *testing.T) { resourceName := "aws_iam_policy.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, iam.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckPolicyDestroy(ctx), @@ -185,7 +185,7 @@ func TestAccIAMPolicy_path(t *testing.T) { resourceName := "aws_iam_policy.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, iam.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckPolicyDestroy(ctx), @@ -215,7 +215,7 @@ func TestAccIAMPolicy_policy(t *testing.T) { policy2 := `{"Statement":[{"Action":["ec2:*"],"Effect":"Allow","Resource":"*"}],"Version":"2012-10-17"}` resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, iam.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckPolicyDestroy(ctx), @@ -255,7 +255,7 @@ func TestAccIAMPolicy_diffs(t *testing.T) { resourceName := "aws_iam_policy.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, iam.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckPolicyDestroy(ctx), diff --git a/internal/service/iam/role_data_source_test.go b/internal/service/iam/role_data_source_test.go index e01b7752dfa5..9efccfc548ce 100644 --- a/internal/service/iam/role_data_source_test.go +++ b/internal/service/iam/role_data_source_test.go @@ -16,7 +16,7 @@ func TestAccIAMRoleDataSource_basic(t *testing.T) { resourceName := "aws_iam_role.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, iam.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ @@ -44,7 +44,7 @@ func TestAccIAMRoleDataSource_tags(t *testing.T) { resourceName := "aws_iam_role.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, iam.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ diff --git a/internal/service/iam/role_policy_attachment_test.go b/internal/service/iam/role_policy_attachment_test.go index 09ebf25c8fda..39d8695f7c64 100644 --- a/internal/service/iam/role_policy_attachment_test.go +++ b/internal/service/iam/role_policy_attachment_test.go @@ -27,7 +27,7 @@ func TestAccIAMRolePolicyAttachment_basic(t *testing.T) { testPolicy3 := fmt.Sprintf("tf-acctest3-%d", rInt) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, iam.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRolePolicyAttachmentDestroy(ctx), @@ -79,7 +79,7 @@ func TestAccIAMRolePolicyAttachment_disappears(t *testing.T) { resourceName := "aws_iam_role_policy_attachment.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, iam.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRolePolicyAttachmentDestroy(ctx), @@ -106,7 +106,7 @@ func TestAccIAMRolePolicyAttachment_Disappears_role(t *testing.T) { resourceName := "aws_iam_role_policy_attachment.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, iam.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRolePolicyAttachmentDestroy(ctx), diff --git a/internal/service/iam/role_policy_test.go b/internal/service/iam/role_policy_test.go index 46d08131e6d8..94c21d6d9470 100644 --- a/internal/service/iam/role_policy_test.go +++ b/internal/service/iam/role_policy_test.go @@ -27,7 +27,7 @@ func TestAccIAMRolePolicy_basic(t *testing.T) { roleName := "aws_iam_role.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, iam.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRolePolicyDestroy(ctx), @@ -73,7 +73,7 @@ func TestAccIAMRolePolicy_disappears(t *testing.T) { rolePolicyResourceName := "aws_iam_role_policy.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, iam.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRolePolicyDestroy(ctx), @@ -101,7 +101,7 @@ func TestAccIAMRolePolicy_policyOrder(t *testing.T) { roleName := "aws_iam_role.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, iam.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRolePolicyDestroy(ctx), @@ -131,7 +131,7 @@ func TestAccIAMRolePolicy_namePrefix(t *testing.T) { roleName := "aws_iam_role.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, iam.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRolePolicyDestroy(ctx), @@ -175,7 +175,7 @@ func TestAccIAMRolePolicy_generatedName(t *testing.T) { roleName := "aws_iam_role.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, iam.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRolePolicyDestroy(ctx), @@ -215,7 +215,7 @@ func TestAccIAMRolePolicy_invalidJSON(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, iam.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRolePolicyDestroy(ctx), @@ -233,7 +233,7 @@ func TestAccIAMRolePolicy_Policy_invalidResource(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, iam.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRolePolicyDestroy(ctx), @@ -259,7 +259,7 @@ func TestAccIAMRolePolicy_unknownsInPolicy(t *testing.T) { roleName := "aws_iam_role.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, iam.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRolePolicyDestroy(ctx), diff --git a/internal/service/iam/role_test.go b/internal/service/iam/role_test.go index d1affa83ae44..28cdb92a7ef6 100644 --- a/internal/service/iam/role_test.go +++ b/internal/service/iam/role_test.go @@ -25,7 +25,7 @@ func TestAccIAMRole_basic(t *testing.T) { resourceName := "aws_iam_role.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, iam.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRoleDestroy(ctx), @@ -54,7 +54,7 @@ func TestAccIAMRole_description(t *testing.T) { resourceName := "aws_iam_role.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, iam.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRoleDestroy(ctx), @@ -98,7 +98,7 @@ func TestAccIAMRole_nameGenerated(t *testing.T) { resourceName := "aws_iam_role.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, iam.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRoleDestroy(ctx), @@ -126,7 +126,7 @@ func TestAccIAMRole_namePrefix(t *testing.T) { resourceName := "aws_iam_role.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, iam.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRoleDestroy(ctx), @@ -155,7 +155,7 @@ func TestAccIAMRole_testNameChange(t *testing.T) { resourceName := "aws_iam_role.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, iam.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRoleDestroy(ctx), @@ -190,7 +190,7 @@ func TestAccIAMRole_diffs(t *testing.T) { resourceName := "aws_iam_role.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, iam.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRoleDestroy(ctx), @@ -327,7 +327,7 @@ func TestAccIAMRole_diffsCondition(t *testing.T) { resourceName := "aws_iam_role.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, iam.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRoleDestroy(ctx), @@ -371,7 +371,7 @@ func TestAccIAMRole_badJSON(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, iam.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRoleDestroy(ctx), @@ -392,7 +392,7 @@ func TestAccIAMRole_disappears(t *testing.T) { resourceName := "aws_iam_role.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, iam.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRoleDestroy(ctx), @@ -416,7 +416,7 @@ func TestAccIAMRole_policiesForceDetach(t *testing.T) { resourceName := "aws_iam_role.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, iam.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRoleDestroy(ctx), @@ -445,7 +445,7 @@ func TestAccIAMRole_maxSessionDuration(t *testing.T) { resourceName := "aws_iam_role.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, iam.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRoleDestroy(ctx), @@ -497,7 +497,7 @@ func TestAccIAMRole_permissionsBoundary(t *testing.T) { permissionsBoundary2 := fmt.Sprintf("arn:%s:iam::aws:policy/ReadOnlyAccess", acctest.Partition()) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, iam.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckUserDestroy(ctx), @@ -567,7 +567,7 @@ func TestAccIAMRole_tags(t *testing.T) { resourceName := "aws_iam_role.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, iam.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckUserDestroy(ctx), @@ -608,7 +608,7 @@ func TestAccIAMRole_InlinePolicy_basic(t *testing.T) { resourceName := "aws_iam_role.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, iam.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRoleDestroy(ctx), @@ -656,7 +656,7 @@ func TestAccIAMRole_InlinePolicy_ignoreOrder(t *testing.T) { resourceName := "aws_iam_role.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, iam.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRoleDestroy(ctx), @@ -694,7 +694,7 @@ func TestAccIAMRole_InlinePolicy_empty(t *testing.T) { resourceName := "aws_iam_role.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, iam.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRoleDestroy(ctx), @@ -719,7 +719,7 @@ func TestAccIAMRole_ManagedPolicy_basic(t *testing.T) { resourceName := "aws_iam_role.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, iam.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRoleDestroy(ctx), @@ -765,7 +765,7 @@ func TestAccIAMRole_ManagedPolicy_outOfBandRemovalAddedBack(t *testing.T) { resourceName := "aws_iam_role.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, iam.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRoleDestroy(ctx), @@ -799,7 +799,7 @@ func TestAccIAMRole_InlinePolicy_outOfBandRemovalAddedBack(t *testing.T) { resourceName := "aws_iam_role.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, iam.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRoleDestroy(ctx), @@ -834,7 +834,7 @@ func TestAccIAMRole_ManagedPolicy_outOfBandAdditionRemoved(t *testing.T) { resourceName := "aws_iam_role.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, iam.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRoleDestroy(ctx), @@ -869,7 +869,7 @@ func TestAccIAMRole_InlinePolicy_outOfBandAdditionRemoved(t *testing.T) { resourceName := "aws_iam_role.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, iam.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRoleDestroy(ctx), @@ -905,7 +905,7 @@ func TestAccIAMRole_InlinePolicy_outOfBandAdditionIgnored(t *testing.T) { resourceName := "aws_iam_role.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, iam.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRoleDestroy(ctx), @@ -946,7 +946,7 @@ func TestAccIAMRole_ManagedPolicy_outOfBandAdditionIgnored(t *testing.T) { resourceName := "aws_iam_role.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, iam.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRoleDestroy(ctx), @@ -979,7 +979,7 @@ func TestAccIAMRole_InlinePolicy_outOfBandAdditionRemovedEmpty(t *testing.T) { resourceName := "aws_iam_role.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, iam.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRoleDestroy(ctx), @@ -1012,7 +1012,7 @@ func TestAccIAMRole_ManagedPolicy_outOfBandAdditionRemovedEmpty(t *testing.T) { resourceName := "aws_iam_role.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, iam.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRoleDestroy(ctx), diff --git a/internal/service/iam/roles_data_source_test.go b/internal/service/iam/roles_data_source_test.go index 1e2a13acc013..950afe605c4e 100644 --- a/internal/service/iam/roles_data_source_test.go +++ b/internal/service/iam/roles_data_source_test.go @@ -16,7 +16,7 @@ func TestAccIAMRolesDataSource_basic(t *testing.T) { dataSourceName := "data.aws_iam_roles.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, iam.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ @@ -36,7 +36,7 @@ func TestAccIAMRolesDataSource_nameRegex(t *testing.T) { dataSourceName := "data.aws_iam_roles.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, iam.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ @@ -58,7 +58,7 @@ func TestAccIAMRolesDataSource_pathPrefix(t *testing.T) { dataSourceName := "data.aws_iam_roles.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, iam.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ @@ -77,7 +77,7 @@ func TestAccIAMRolesDataSource_nonExistentPathPrefix(t *testing.T) { dataSourceName := "data.aws_iam_roles.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, iam.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ @@ -99,7 +99,7 @@ func TestAccIAMRolesDataSource_nameRegexAndPathPrefix(t *testing.T) { dataSourceName := "data.aws_iam_roles.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, iam.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ diff --git a/internal/service/iam/saml_provider_data_source_test.go b/internal/service/iam/saml_provider_data_source_test.go index f3af5abd7c82..29e5a01ca3a9 100644 --- a/internal/service/iam/saml_provider_data_source_test.go +++ b/internal/service/iam/saml_provider_data_source_test.go @@ -17,7 +17,7 @@ func TestAccIAMSAMLProviderDataSource_basic(t *testing.T) { resourceName := "aws_iam_saml_provider.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, iam.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ diff --git a/internal/service/iam/saml_provider_test.go b/internal/service/iam/saml_provider_test.go index c64e40a90788..7e4f3cc48c63 100644 --- a/internal/service/iam/saml_provider_test.go +++ b/internal/service/iam/saml_provider_test.go @@ -23,7 +23,7 @@ func TestAccIAMSAMLProvider_basic(t *testing.T) { resourceName := "aws_iam_saml_provider.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, iam.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSAMLProviderDestroy(ctx), @@ -63,7 +63,7 @@ func TestAccIAMSAMLProvider_tags(t *testing.T) { resourceName := "aws_iam_saml_provider.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, iam.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSAMLProviderDestroy(ctx), @@ -109,7 +109,7 @@ func TestAccIAMSAMLProvider_disappears(t *testing.T) { resourceName := "aws_iam_saml_provider.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, iam.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSAMLProviderDestroy(ctx), diff --git a/internal/service/iam/server_certificate_data_source_test.go b/internal/service/iam/server_certificate_data_source_test.go index f17e678e7350..2037c1036456 100644 --- a/internal/service/iam/server_certificate_data_source_test.go +++ b/internal/service/iam/server_certificate_data_source_test.go @@ -46,7 +46,7 @@ func TestAccIAMServerCertificateDataSource_basic(t *testing.T) { certificate := acctest.TLSRSAX509SelfSignedCertificatePEM(t, key, "example.com") resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, iam.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckServerCertificateDestroy(ctx), @@ -71,7 +71,7 @@ func TestAccIAMServerCertificateDataSource_basic(t *testing.T) { func TestAccIAMServerCertificateDataSource_matchNamePrefix(t *testing.T) { ctx := acctest.Context(t) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, iam.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckServerCertificateDestroy(ctx), @@ -94,7 +94,7 @@ func TestAccIAMServerCertificateDataSource_path(t *testing.T) { certificate := acctest.TLSRSAX509SelfSignedCertificatePEM(t, key, "example.com") resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, iam.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckServerCertificateDestroy(ctx), diff --git a/internal/service/iam/server_certificate_test.go b/internal/service/iam/server_certificate_test.go index 24be9a5e45da..9e003ee6a583 100644 --- a/internal/service/iam/server_certificate_test.go +++ b/internal/service/iam/server_certificate_test.go @@ -25,7 +25,7 @@ func TestAccIAMServerCertificate_basic(t *testing.T) { certificate := acctest.TLSRSAX509SelfSignedCertificatePEM(t, key, "example.com") resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, iam.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckServerCertificateDestroy(ctx), @@ -63,7 +63,7 @@ func TestAccIAMServerCertificate_nameGenerated(t *testing.T) { certificate := acctest.TLSRSAX509SelfSignedCertificatePEM(t, key, "example.com") resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, iam.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckServerCertificateDestroy(ctx), @@ -88,7 +88,7 @@ func TestAccIAMServerCertificate_namePrefix(t *testing.T) { certificate := acctest.TLSRSAX509SelfSignedCertificatePEM(t, key, "example.com") resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, iam.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckServerCertificateDestroy(ctx), @@ -114,7 +114,7 @@ func TestAccIAMServerCertificate_disappears(t *testing.T) { certificate := acctest.TLSRSAX509SelfSignedCertificatePEM(t, key, "example.com") resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, iam.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckServerCertificateDestroy(ctx), @@ -140,7 +140,7 @@ func TestAccIAMServerCertificate_tags(t *testing.T) { certificate := acctest.TLSRSAX509SelfSignedCertificatePEM(t, key, "example.com") resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, iam.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckServerCertificateDestroy(ctx), @@ -190,7 +190,7 @@ func TestAccIAMServerCertificate_file(t *testing.T) { resourceName := "aws_iam_server_certificate.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, iam.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckServerCertificateDestroy(ctx), @@ -227,7 +227,7 @@ func TestAccIAMServerCertificate_path(t *testing.T) { certificate := acctest.TLSRSAX509SelfSignedCertificatePEM(t, key, "example.com") resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, iam.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckServerCertificateDestroy(ctx), diff --git a/internal/service/iam/service_linked_role_test.go b/internal/service/iam/service_linked_role_test.go index aabdb8e39fe9..ce5b42f37554 100644 --- a/internal/service/iam/service_linked_role_test.go +++ b/internal/service/iam/service_linked_role_test.go @@ -86,7 +86,7 @@ func TestAccIAMServiceLinkedRole_basic(t *testing.T) { arnResource := fmt.Sprintf("role%s%s", path, name) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, iam.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckServiceLinkedRoleDestroy(ctx), @@ -142,7 +142,7 @@ func TestAccIAMServiceLinkedRole_customSuffix(t *testing.T) { path := fmt.Sprintf("/aws-service-role/%s/", awsServiceName) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, iam.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckServiceLinkedRoleDestroy(ctx), @@ -172,7 +172,7 @@ func TestAccIAMServiceLinkedRole_CustomSuffix_diffSuppressFunc(t *testing.T) { name := "AWSServiceRoleForApplicationAutoScaling_CustomResource" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, iam.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckServiceLinkedRoleDestroy(ctx), @@ -202,7 +202,7 @@ func TestAccIAMServiceLinkedRole_description(t *testing.T) { customSuffix := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, iam.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckServiceLinkedRoleDestroy(ctx), @@ -237,7 +237,7 @@ func TestAccIAMServiceLinkedRole_tags(t *testing.T) { customSuffix := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, iam.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckServiceLinkedRoleDestroy(ctx), @@ -283,7 +283,7 @@ func TestAccIAMServiceLinkedRole_disappears(t *testing.T) { customSuffix := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, iam.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckServiceLinkedRoleDestroy(ctx), diff --git a/internal/service/iam/service_specific_credential_test.go b/internal/service/iam/service_specific_credential_test.go index 34660a73c510..59d1923cdb56 100644 --- a/internal/service/iam/service_specific_credential_test.go +++ b/internal/service/iam/service_specific_credential_test.go @@ -23,7 +23,7 @@ func TestAccIAMServiceSpecificCredential_basic(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, iam.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckServiceSpecificCredentialDestroy(ctx), @@ -58,7 +58,7 @@ func TestAccIAMServiceSpecificCredential_multi(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, iam.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckServiceSpecificCredentialDestroy(ctx), @@ -97,7 +97,7 @@ func TestAccIAMServiceSpecificCredential_status(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, iam.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckServiceSpecificCredentialDestroy(ctx), @@ -141,7 +141,7 @@ func TestAccIAMServiceSpecificCredential_disappears(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, iam.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckServiceSpecificCredentialDestroy(ctx), diff --git a/internal/service/iam/session_context_data_source_test.go b/internal/service/iam/session_context_data_source_test.go index 8a2eefb59d47..1bdce4dbf993 100644 --- a/internal/service/iam/session_context_data_source_test.go +++ b/internal/service/iam/session_context_data_source_test.go @@ -103,7 +103,7 @@ func TestAccIAMSessionContextDataSource_basic(t *testing.T) { resourceName := "aws_iam_role.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, iam.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ @@ -126,7 +126,7 @@ func TestAccIAMSessionContextDataSource_withPath(t *testing.T) { resourceName := "aws_iam_role.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, iam.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ @@ -148,7 +148,7 @@ func TestAccIAMSessionContextDataSource_notAssumedRole(t *testing.T) { resourceName := "aws_iam_role.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, iam.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ @@ -170,7 +170,7 @@ func TestAccIAMSessionContextDataSource_notAssumedRoleWithPath(t *testing.T) { resourceName := "aws_iam_role.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, iam.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ @@ -191,7 +191,7 @@ func TestAccIAMSessionContextDataSource_notAssumedRoleUser(t *testing.T) { dataSourceName := "data.aws_iam_session_context.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, iam.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ diff --git a/internal/service/iam/signing_certificate_test.go b/internal/service/iam/signing_certificate_test.go index b9435f9668d2..9c67cf1a4495 100644 --- a/internal/service/iam/signing_certificate_test.go +++ b/internal/service/iam/signing_certificate_test.go @@ -25,7 +25,7 @@ func TestAccIAMSigningCertificate_basic(t *testing.T) { certificate := acctest.TLSRSAX509SelfSignedCertificatePEM(t, key, "example.com") resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, iam.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSigningCertificateDestroy(ctx), @@ -59,7 +59,7 @@ func TestAccIAMSigningCertificate_status(t *testing.T) { certificate := acctest.TLSRSAX509SelfSignedCertificatePEM(t, key, "example.com") resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, iam.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSigningCertificateDestroy(ctx), @@ -104,7 +104,7 @@ func TestAccIAMSigningCertificate_disappears(t *testing.T) { certificate := acctest.TLSRSAX509SelfSignedCertificatePEM(t, key, "example.com") resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, iam.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSigningCertificateDestroy(ctx), diff --git a/internal/service/iam/user_data_source_test.go b/internal/service/iam/user_data_source_test.go index 3c0f8f51b5f0..988260aa88cf 100644 --- a/internal/service/iam/user_data_source_test.go +++ b/internal/service/iam/user_data_source_test.go @@ -17,7 +17,7 @@ func TestAccIAMUserDataSource_basic(t *testing.T) { userName := fmt.Sprintf("test-datasource-user-%d", sdkacctest.RandInt()) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, iam.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ @@ -43,7 +43,7 @@ func TestAccIAMUserDataSource_tags(t *testing.T) { userName := fmt.Sprintf("test-datasource-user-%d", sdkacctest.RandInt()) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, iam.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ diff --git a/internal/service/iam/user_group_membership_test.go b/internal/service/iam/user_group_membership_test.go index d26aedba71c1..369f2ca3b60e 100644 --- a/internal/service/iam/user_group_membership_test.go +++ b/internal/service/iam/user_group_membership_test.go @@ -25,7 +25,7 @@ func TestAccIAMUserGroupMembership_basic(t *testing.T) { groupName3 := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, iam.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckUserGroupMembershipDestroy(ctx), diff --git a/internal/service/iam/user_login_profile_test.go b/internal/service/iam/user_login_profile_test.go index 2ce583893e4e..af61c942bff2 100644 --- a/internal/service/iam/user_login_profile_test.go +++ b/internal/service/iam/user_login_profile_test.go @@ -79,7 +79,7 @@ func TestAccIAMUserLoginProfile_basic(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, iam.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckUserLoginProfileDestroy(ctx), @@ -118,7 +118,7 @@ func TestAccIAMUserLoginProfile_keybase(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, iam.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckUserLoginProfileDestroy(ctx), @@ -153,7 +153,7 @@ func TestAccIAMUserLoginProfile_keybaseDoesntExist(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, iam.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckUserLoginProfileDestroy(ctx), @@ -172,7 +172,7 @@ func TestAccIAMUserLoginProfile_notAKey(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, iam.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckUserLoginProfileDestroy(ctx), @@ -194,7 +194,7 @@ func TestAccIAMUserLoginProfile_passwordLength(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, iam.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckUserLoginProfileDestroy(ctx), @@ -229,7 +229,7 @@ func TestAccIAMUserLoginProfile_nogpg(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, iam.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckUserLoginProfileDestroy(ctx), @@ -265,7 +265,7 @@ func TestAccIAMUserLoginProfile_disappears(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, iam.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckUserLoginProfileDestroy(ctx), diff --git a/internal/service/iam/user_policy_attachment_test.go b/internal/service/iam/user_policy_attachment_test.go index 9bb090e8c60c..fd6309796e52 100644 --- a/internal/service/iam/user_policy_attachment_test.go +++ b/internal/service/iam/user_policy_attachment_test.go @@ -25,7 +25,7 @@ func TestAccIAMUserPolicyAttachment_basic(t *testing.T) { policyName3 := fmt.Sprintf("test-policy-%s", sdkacctest.RandString(10)) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, iam.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckUserPolicyAttachmentDestroy, diff --git a/internal/service/iam/user_policy_test.go b/internal/service/iam/user_policy_test.go index 7edb8d9b64e4..ade211c90660 100644 --- a/internal/service/iam/user_policy_test.go +++ b/internal/service/iam/user_policy_test.go @@ -27,7 +27,7 @@ func TestAccIAMUserPolicy_basic(t *testing.T) { userResourceName := "aws_iam_user.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, iam.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckUserPolicyDestroy(ctx), @@ -71,7 +71,7 @@ func TestAccIAMUserPolicy_disappears(t *testing.T) { resourceName := "aws_iam_user_policy.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, iam.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckUserPolicyDestroy(ctx), @@ -97,7 +97,7 @@ func TestAccIAMUserPolicy_namePrefix(t *testing.T) { userResourceName := "aws_iam_user.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, iam.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckUserPolicyDestroy(ctx), @@ -139,7 +139,7 @@ func TestAccIAMUserPolicy_generatedName(t *testing.T) { userResourceName := "aws_iam_user.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, iam.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckUserPolicyDestroy(ctx), @@ -180,7 +180,7 @@ func TestAccIAMUserPolicy_multiplePolicies(t *testing.T) { userResourceName := "aws_iam_user.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, iam.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckUserPolicyDestroy(ctx), @@ -237,7 +237,7 @@ func TestAccIAMUserPolicy_policyOrder(t *testing.T) { userResourceName := "aws_iam_user.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, iam.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckUserPolicyDestroy(ctx), 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 64dfc0ff079b..474230f6e940 100644 --- a/internal/service/iam/user_ssh_key_data_source_test.go +++ b/internal/service/iam/user_ssh_key_data_source_test.go @@ -21,7 +21,7 @@ func TestAccIAMUserSSHKeyDataSource_basic(t *testing.T) { } resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, iam.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ diff --git a/internal/service/iam/user_ssh_key_test.go b/internal/service/iam/user_ssh_key_test.go index 76310c02df71..561f504a6f9f 100644 --- a/internal/service/iam/user_ssh_key_test.go +++ b/internal/service/iam/user_ssh_key_test.go @@ -27,7 +27,7 @@ func TestAccIAMUserSSHKey_basic(t *testing.T) { } resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, iam.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckUserSSHKeyDestroy(ctx), @@ -61,7 +61,7 @@ func TestAccIAMUserSSHKey_disappears(t *testing.T) { } resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, iam.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckUserSSHKeyDestroy(ctx), @@ -85,7 +85,7 @@ func TestAccIAMUserSSHKey_pemEncoding(t *testing.T) { resourceName := "aws_iam_user_ssh_key.user" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, iam.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckUserSSHKeyDestroy(ctx), diff --git a/internal/service/iam/user_test.go b/internal/service/iam/user_test.go index 8f7b4ec59136..feb745b27237 100644 --- a/internal/service/iam/user_test.go +++ b/internal/service/iam/user_test.go @@ -29,7 +29,7 @@ func TestAccIAMUser_basic(t *testing.T) { resourceName := "aws_iam_user.user" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, iam.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckUserDestroy(ctx), @@ -67,7 +67,7 @@ func TestAccIAMUser_disappears(t *testing.T) { resourceName := "aws_iam_user.user" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, iam.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckUserDestroy(ctx), @@ -92,7 +92,7 @@ func TestAccIAMUser_ForceDestroy_accessKey(t *testing.T) { resourceName := "aws_iam_user.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, iam.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckUserDestroy(ctx), @@ -123,7 +123,7 @@ func TestAccIAMUser_ForceDestroy_loginProfile(t *testing.T) { resourceName := "aws_iam_user.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, iam.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckUserDestroy(ctx), @@ -154,7 +154,7 @@ func TestAccIAMUser_ForceDestroy_mfaDevice(t *testing.T) { resourceName := "aws_iam_user.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, iam.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckUserDestroy(ctx), @@ -185,7 +185,7 @@ func TestAccIAMUser_ForceDestroy_sshKey(t *testing.T) { resourceName := "aws_iam_user.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, iam.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckUserDestroy(ctx), @@ -215,7 +215,7 @@ func TestAccIAMUser_ForceDestroy_serviceSpecificCred(t *testing.T) { resourceName := "aws_iam_user.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, iam.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckUserDestroy(ctx), @@ -245,7 +245,7 @@ func TestAccIAMUser_ForceDestroy_signingCertificate(t *testing.T) { resourceName := "aws_iam_user.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, iam.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckUserDestroy(ctx), @@ -278,7 +278,7 @@ func TestAccIAMUser_nameChange(t *testing.T) { resourceName := "aws_iam_user.user" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, iam.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckUserDestroy(ctx), @@ -316,7 +316,7 @@ func TestAccIAMUser_pathChange(t *testing.T) { resourceName := "aws_iam_user.user" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, iam.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckUserDestroy(ctx), @@ -355,7 +355,7 @@ func TestAccIAMUser_permissionsBoundary(t *testing.T) { permissionsBoundary2 := fmt.Sprintf("arn:%s:iam::aws:policy/ReadOnlyAccess", acctest.Partition()) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, iam.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckUserDestroy(ctx), @@ -431,7 +431,7 @@ func TestAccIAMUser_tags(t *testing.T) { resourceName := "aws_iam_user.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, iam.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckUserDestroy(ctx), diff --git a/internal/service/iam/users_data_source_test.go b/internal/service/iam/users_data_source_test.go index 5a2f9263d169..26ba93043b3f 100644 --- a/internal/service/iam/users_data_source_test.go +++ b/internal/service/iam/users_data_source_test.go @@ -17,7 +17,7 @@ func TestAccIAMUsersDataSource_nameRegex(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, iam.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ @@ -39,7 +39,7 @@ func TestAccIAMUsersDataSource_pathPrefix(t *testing.T) { rPathPrefix := sdkacctest.RandomWithPrefix("tf-acc-path") resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, iam.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ @@ -58,7 +58,7 @@ func TestAccIAMUsersDataSource_nonExistentNameRegex(t *testing.T) { dataSourceName := "data.aws_iam_users.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, iam.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ @@ -77,7 +77,7 @@ func TestAccIAMUsersDataSource_nonExistentPathPrefix(t *testing.T) { dataSourceName := "data.aws_iam_users.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, iam.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ diff --git a/internal/service/iam/virtual_mfa_device_test.go b/internal/service/iam/virtual_mfa_device_test.go index 5a89aac20042..8cba7d540430 100644 --- a/internal/service/iam/virtual_mfa_device_test.go +++ b/internal/service/iam/virtual_mfa_device_test.go @@ -24,7 +24,7 @@ func TestAccIAMVirtualMFADevice_basic(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, iam.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckVirtualMFADeviceDestroy(ctx), @@ -56,7 +56,7 @@ func TestAccIAMVirtualMFADevice_tags(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, iam.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckVirtualMFADeviceDestroy(ctx), @@ -104,7 +104,7 @@ func TestAccIAMVirtualMFADevice_disappears(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, iam.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckVirtualMFADeviceDestroy(ctx), From 5e6a417d729bf97719e3f9e6b92a7248da600e8f Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Fri, 24 Feb 2023 16:37:02 -0500 Subject: [PATCH 167/763] Add 'Context' argument to 'acctest.PreCheck' for identitystore. --- .../identitystore/group_data_source_test.go | 20 +++++------ .../identitystore/group_membership_test.go | 8 ++--- internal/service/identitystore/group_test.go | 4 +-- .../identitystore/user_data_source_test.go | 20 +++++------ internal/service/identitystore/user_test.go | 36 +++++++++---------- 5 files changed, 44 insertions(+), 44 deletions(-) diff --git a/internal/service/identitystore/group_data_source_test.go b/internal/service/identitystore/group_data_source_test.go index 6025087e20f2..b55ab3e5c900 100644 --- a/internal/service/identitystore/group_data_source_test.go +++ b/internal/service/identitystore/group_data_source_test.go @@ -22,7 +22,7 @@ func TestAccIdentityStoreGroupDataSource_filterDisplayName(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) testAccPreCheckSSOAdminInstances(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, identitystore.EndpointsID), @@ -50,7 +50,7 @@ func TestAccIdentityStoreGroupDataSource_uniqueAttributeDisplayName(t *testing.T resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) testAccPreCheckSSOAdminInstances(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, identitystore.EndpointsID), @@ -78,7 +78,7 @@ func TestAccIdentityStoreGroupDataSource_filterDisplayNameAndGroupId(t *testing. resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) testAccPreCheckSSOAdminInstances(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, identitystore.EndpointsID), @@ -101,7 +101,7 @@ func TestAccIdentityStoreGroupDataSource_filterDisplayNameAndGroupId(t *testing. func TestAccIdentityStoreGroupDataSource_nonExistent(t *testing.T) { ctx := acctest.Context(t) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckSSOAdminInstances(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckSSOAdminInstances(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, identitystore.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckGroupDestroy(ctx), @@ -121,7 +121,7 @@ func TestAccIdentityStoreGroupDataSource_groupIdFilterMismatch(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) testAccPreCheckSSOAdminInstances(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, identitystore.EndpointsID), @@ -140,7 +140,7 @@ func TestAccIdentityStoreGroupDataSource_externalIdConflictsWithUniqueAttribute( ctx := acctest.Context(t) resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) testAccPreCheckSSOAdminInstances(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, identitystore.EndpointsID), @@ -161,7 +161,7 @@ func TestAccIdentityStoreGroupDataSource_filterConflictsWithUniqueAttribute(t *t resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) testAccPreCheckSSOAdminInstances(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, identitystore.EndpointsID), @@ -182,7 +182,7 @@ func TestAccIdentityStoreGroupDataSource_groupIdConflictsWithUniqueAttribute(t * resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) testAccPreCheckSSOAdminInstances(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, identitystore.EndpointsID), @@ -203,7 +203,7 @@ func TestAccIdentityStoreGroupDataSource_filterConflictsWithExternalId(t *testin resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) testAccPreCheckSSOAdminInstances(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, identitystore.EndpointsID), @@ -224,7 +224,7 @@ func TestAccIdentityStoreGroupDataSource_groupIdConflictsWithExternalId(t *testi resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) testAccPreCheckSSOAdminInstances(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, identitystore.EndpointsID), diff --git a/internal/service/identitystore/group_membership_test.go b/internal/service/identitystore/group_membership_test.go index a5cb246c988b..46071990d275 100644 --- a/internal/service/identitystore/group_membership_test.go +++ b/internal/service/identitystore/group_membership_test.go @@ -32,7 +32,7 @@ func TestAccIdentityStoreGroupMembership_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(names.IdentityStoreEndpointID, t) testAccPreCheck(ctx, t) }, @@ -70,7 +70,7 @@ func TestAccIdentityStoreGroupMembership_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(names.IdentityStoreEndpointID, t) testAccPreCheckSSOAdminInstances(ctx, t) testAccPreCheck(ctx, t) @@ -104,7 +104,7 @@ func TestAccIdentityStoreGroupMembership_GroupId(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(names.IdentityStoreEndpointID, t) testAccPreCheck(ctx, t) }, @@ -148,7 +148,7 @@ func TestAccIdentityStoreGroupMembership_MemberId(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(names.IdentityStoreEndpointID, t) testAccPreCheck(ctx, t) }, diff --git a/internal/service/identitystore/group_test.go b/internal/service/identitystore/group_test.go index a5fe7f46d514..664fa486e0a0 100644 --- a/internal/service/identitystore/group_test.go +++ b/internal/service/identitystore/group_test.go @@ -25,7 +25,7 @@ func TestAccIdentityStoreGroup_basic(t *testing.T) { displayName := "Acceptance Test" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(names.IdentityStoreEndpointID, t) testAccPreCheck(ctx, t) }, @@ -59,7 +59,7 @@ func TestAccIdentityStoreGroup_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(names.IdentityStoreEndpointID, t) testAccPreCheckSSOAdminInstances(ctx, t) testAccPreCheck(ctx, t) diff --git a/internal/service/identitystore/user_data_source_test.go b/internal/service/identitystore/user_data_source_test.go index 4c675d7b69b9..817a047b25a0 100644 --- a/internal/service/identitystore/user_data_source_test.go +++ b/internal/service/identitystore/user_data_source_test.go @@ -20,7 +20,7 @@ func TestAccIdentityStoreUserDataSource_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) testAccPreCheckSSOAdminInstances(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, identitystore.EndpointsID), @@ -62,7 +62,7 @@ func TestAccIdentityStoreUserDataSource_filterUserName(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) testAccPreCheckSSOAdminInstances(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, identitystore.EndpointsID), @@ -89,7 +89,7 @@ func TestAccIdentityStoreUserDataSource_uniqueAttributeUserName(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) testAccPreCheckSSOAdminInstances(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, identitystore.EndpointsID), @@ -116,7 +116,7 @@ func TestAccIdentityStoreUserDataSource_email(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) testAccPreCheckSSOAdminInstances(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, identitystore.EndpointsID), @@ -143,7 +143,7 @@ func TestAccIdentityStoreUserDataSource_userID(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) testAccPreCheckSSOAdminInstances(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, identitystore.EndpointsID), @@ -164,7 +164,7 @@ func TestAccIdentityStoreUserDataSource_userID(t *testing.T) { func TestAccIdentityStoreUserDataSource_nonExistent(t *testing.T) { ctx := acctest.Context(t) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckSSOAdminInstances(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckSSOAdminInstances(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, identitystore.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckUserDestroy(ctx), @@ -185,7 +185,7 @@ func TestAccIdentityStoreUserDataSource_userIdFilterMismatch(t *testing.T) { email2 := acctest.RandomEmailAddress(acctest.RandomDomainName()) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckSSOAdminInstances(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckSSOAdminInstances(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, identitystore.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckUserDestroy(ctx), @@ -201,7 +201,7 @@ func TestAccIdentityStoreUserDataSource_userIdFilterMismatch(t *testing.T) { func TestAccIdentityStoreUserDataSource_externalIdConflictsWithUniqueAttribute(t *testing.T) { ctx := acctest.Context(t) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckSSOAdminInstances(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckSSOAdminInstances(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, identitystore.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckUserDestroy(ctx), @@ -220,7 +220,7 @@ func TestAccIdentityStoreUserDataSource_filterConflictsWithExternalId(t *testing email := acctest.RandomEmailAddress(acctest.RandomDomainName()) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckSSOAdminInstances(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckSSOAdminInstances(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, identitystore.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckUserDestroy(ctx), @@ -239,7 +239,7 @@ func TestAccIdentityStoreUserDataSource_userIdConflictsWithExternalId(t *testing email := acctest.RandomEmailAddress(acctest.RandomDomainName()) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckSSOAdminInstances(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckSSOAdminInstances(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, identitystore.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckUserDestroy(ctx), diff --git a/internal/service/identitystore/user_test.go b/internal/service/identitystore/user_test.go index 91fc6ca0bc5c..d7e238f11c61 100644 --- a/internal/service/identitystore/user_test.go +++ b/internal/service/identitystore/user_test.go @@ -29,7 +29,7 @@ func TestAccIdentityStoreUser_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(names.IdentityStoreEndpointID, t) testAccPreCheck(ctx, t) }, @@ -81,7 +81,7 @@ func TestAccIdentityStoreUser_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(names.IdentityStoreEndpointID, t) testAccPreCheckSSOAdminInstances(ctx, t) testAccPreCheck(ctx, t) @@ -110,7 +110,7 @@ func TestAccIdentityStoreUser_Addresses(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(names.IdentityStoreEndpointID, t) testAccPreCheck(ctx, t) }, @@ -205,7 +205,7 @@ func TestAccIdentityStoreUser_Emails(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(names.IdentityStoreEndpointID, t) testAccPreCheck(ctx, t) }, @@ -282,7 +282,7 @@ func TestAccIdentityStoreUser_Locale(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(names.IdentityStoreEndpointID, t) testAccPreCheck(ctx, t) }, @@ -333,7 +333,7 @@ func TestAccIdentityStoreUser_NameFamilyName(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(names.IdentityStoreEndpointID, t) testAccPreCheck(ctx, t) }, @@ -372,7 +372,7 @@ func TestAccIdentityStoreUser_NameFormatted(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(names.IdentityStoreEndpointID, t) testAccPreCheck(ctx, t) }, @@ -423,7 +423,7 @@ func TestAccIdentityStoreUser_NameGivenName(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(names.IdentityStoreEndpointID, t) testAccPreCheck(ctx, t) }, @@ -462,7 +462,7 @@ func TestAccIdentityStoreUser_NameHonorificPrefix(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(names.IdentityStoreEndpointID, t) testAccPreCheck(ctx, t) }, @@ -501,7 +501,7 @@ func TestAccIdentityStoreUser_NameHonorificSuffix(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(names.IdentityStoreEndpointID, t) testAccPreCheck(ctx, t) }, @@ -552,7 +552,7 @@ func TestAccIdentityStoreUser_NameMiddleName(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(names.IdentityStoreEndpointID, t) testAccPreCheck(ctx, t) }, @@ -603,7 +603,7 @@ func TestAccIdentityStoreUser_NickName(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(names.IdentityStoreEndpointID, t) testAccPreCheck(ctx, t) }, @@ -654,7 +654,7 @@ func TestAccIdentityStoreUser_PhoneNumbers(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(names.IdentityStoreEndpointID, t) testAccPreCheck(ctx, t) }, @@ -731,7 +731,7 @@ func TestAccIdentityStoreUser_PreferredLanguage(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(names.IdentityStoreEndpointID, t) testAccPreCheck(ctx, t) }, @@ -782,7 +782,7 @@ func TestAccIdentityStoreUser_ProfileURL(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(names.IdentityStoreEndpointID, t) testAccPreCheck(ctx, t) }, @@ -833,7 +833,7 @@ func TestAccIdentityStoreUser_Timezone(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(names.IdentityStoreEndpointID, t) testAccPreCheck(ctx, t) }, @@ -884,7 +884,7 @@ func TestAccIdentityStoreUser_Title(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(names.IdentityStoreEndpointID, t) testAccPreCheck(ctx, t) }, @@ -935,7 +935,7 @@ func TestAccIdentityStoreUser_UserType(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(names.IdentityStoreEndpointID, t) testAccPreCheck(ctx, t) }, From ab29062d628e6fc61ef08061bfeb28707f0c3393 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Fri, 24 Feb 2023 16:37:02 -0500 Subject: [PATCH 168/763] Add 'Context' argument to 'acctest.PreCheck' for imagebuilder. --- .../component_data_source_test.go | 2 +- .../service/imagebuilder/component_test.go | 18 +++---- .../components_data_source_test.go | 2 +- .../container_recipe_data_source_test.go | 2 +- .../imagebuilder/container_recipe_test.go | 42 ++++++++-------- .../container_recipes_data_source_test.go | 2 +- ...ribution_configuration_data_source_test.go | 2 +- .../distribution_configuration_test.go | 46 +++++++++--------- ...ibution_configurations_data_source_test.go | 2 +- .../imagebuilder/image_data_source_test.go | 6 +-- .../image_pipeline_data_source_test.go | 4 +- .../imagebuilder/image_pipeline_test.go | 30 ++++++------ .../image_pipelines_data_source_test.go | 2 +- .../image_recipe_data_source_test.go | 2 +- .../service/imagebuilder/image_recipe_test.go | 48 +++++++++---------- .../image_recipes_data_source_test.go | 4 +- internal/service/imagebuilder/image_test.go | 16 +++---- ...tructure_configuration_data_source_test.go | 2 +- .../infrastructure_configuration_test.go | 30 ++++++------ ...ructure_configurations_data_source_test.go | 2 +- 20 files changed, 132 insertions(+), 132 deletions(-) diff --git a/internal/service/imagebuilder/component_data_source_test.go b/internal/service/imagebuilder/component_data_source_test.go index 374be0db576a..afa4798b8b66 100644 --- a/internal/service/imagebuilder/component_data_source_test.go +++ b/internal/service/imagebuilder/component_data_source_test.go @@ -17,7 +17,7 @@ func TestAccImageBuilderComponentDataSource_arn(t *testing.T) { resourceName := "aws_imagebuilder_component.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, imagebuilder.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckComponentDestroy(ctx), diff --git a/internal/service/imagebuilder/component_test.go b/internal/service/imagebuilder/component_test.go index b73f5b1852b0..f4f31e1b722e 100644 --- a/internal/service/imagebuilder/component_test.go +++ b/internal/service/imagebuilder/component_test.go @@ -23,7 +23,7 @@ func TestAccImageBuilderComponent_basic(t *testing.T) { resourceName := "aws_imagebuilder_component.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, imagebuilder.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckComponentDestroy(ctx), @@ -64,7 +64,7 @@ func TestAccImageBuilderComponent_disappears(t *testing.T) { resourceName := "aws_imagebuilder_component.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, imagebuilder.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckComponentDestroy(ctx), @@ -87,7 +87,7 @@ func TestAccImageBuilderComponent_changeDescription(t *testing.T) { resourceName := "aws_imagebuilder_component.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, imagebuilder.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckComponentDestroy(ctx), @@ -115,7 +115,7 @@ func TestAccImageBuilderComponent_description(t *testing.T) { resourceName := "aws_imagebuilder_component.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, imagebuilder.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckComponentDestroy(ctx), @@ -144,7 +144,7 @@ func TestAccImageBuilderComponent_kmsKeyID(t *testing.T) { resourceName := "aws_imagebuilder_component.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, imagebuilder.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckComponentDestroy(ctx), @@ -172,7 +172,7 @@ func TestAccImageBuilderComponent_Platform_windows(t *testing.T) { resourceName := "aws_imagebuilder_component.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, imagebuilder.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckComponentDestroy(ctx), @@ -200,7 +200,7 @@ func TestAccImageBuilderComponent_supportedOsVersions(t *testing.T) { resourceName := "aws_imagebuilder_component.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, imagebuilder.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckComponentDestroy(ctx), @@ -228,7 +228,7 @@ func TestAccImageBuilderComponent_tags(t *testing.T) { resourceName := "aws_imagebuilder_component.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, imagebuilder.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckComponentDestroy(ctx), @@ -274,7 +274,7 @@ func TestAccImageBuilderComponent_uri(t *testing.T) { resourceName := "aws_imagebuilder_component.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, imagebuilder.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckComponentDestroy(ctx), diff --git a/internal/service/imagebuilder/components_data_source_test.go b/internal/service/imagebuilder/components_data_source_test.go index 18c98fc6bf45..530465fd013c 100644 --- a/internal/service/imagebuilder/components_data_source_test.go +++ b/internal/service/imagebuilder/components_data_source_test.go @@ -16,7 +16,7 @@ func TestAccImageBuilderComponentsDataSource_filter(t *testing.T) { dataSourceName := "data.aws_imagebuilder_components.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, imagebuilder.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckComponentDestroy(ctx), diff --git a/internal/service/imagebuilder/container_recipe_data_source_test.go b/internal/service/imagebuilder/container_recipe_data_source_test.go index 26cbde9477f4..9d001eb04c29 100644 --- a/internal/service/imagebuilder/container_recipe_data_source_test.go +++ b/internal/service/imagebuilder/container_recipe_data_source_test.go @@ -17,7 +17,7 @@ func TestAccImageBuilderContainerRecipeDataSource_arn(t *testing.T) { resourceName := "aws_imagebuilder_container_recipe.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, imagebuilder.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckContainerRecipeDestroy(ctx), diff --git a/internal/service/imagebuilder/container_recipe_test.go b/internal/service/imagebuilder/container_recipe_test.go index 18f0695ed62e..0726d22a44fa 100644 --- a/internal/service/imagebuilder/container_recipe_test.go +++ b/internal/service/imagebuilder/container_recipe_test.go @@ -23,7 +23,7 @@ func TestAccImageBuilderContainerRecipe_basic(t *testing.T) { resourceName := "aws_imagebuilder_container_recipe.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, imagebuilder.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckContainerRecipeDestroy(ctx), @@ -70,7 +70,7 @@ func TestAccImageBuilderContainerRecipe_disappears(t *testing.T) { resourceName := "aws_imagebuilder_container_recipe.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, imagebuilder.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckContainerRecipeDestroy(ctx), @@ -93,7 +93,7 @@ func TestAccImageBuilderContainerRecipe_component(t *testing.T) { resourceName := "aws_imagebuilder_container_recipe.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, imagebuilder.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckContainerRecipeDestroy(ctx), @@ -122,7 +122,7 @@ func TestAccImageBuilderContainerRecipe_componentParameter(t *testing.T) { resourceName := "aws_imagebuilder_container_recipe.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, imagebuilder.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckContainerRecipeDestroy(ctx), @@ -154,7 +154,7 @@ func TestAccImageBuilderContainerRecipe_description(t *testing.T) { resourceName := "aws_imagebuilder_container_recipe.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, imagebuilder.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckContainerRecipeDestroy(ctx), @@ -181,7 +181,7 @@ func TestAccImageBuilderContainerRecipe_dockerfileTemplateURI(t *testing.T) { resourceName := "aws_imagebuilder_container_recipe.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, imagebuilder.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckContainerRecipeDestroy(ctx), @@ -209,7 +209,7 @@ func TestAccImageBuilderContainerRecipe_InstanceConfiguration_BlockDeviceMapping resourceName := "aws_imagebuilder_container_recipe.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, imagebuilder.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckContainerRecipeDestroy(ctx), @@ -238,7 +238,7 @@ func TestAccImageBuilderContainerRecipe_InstanceConfiguration_BlockDeviceMapping resourceName := "aws_imagebuilder_container_recipe.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, imagebuilder.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckContainerRecipeDestroy(ctx), @@ -268,7 +268,7 @@ func TestAccImageBuilderContainerRecipe_InstanceConfiguration_BlockDeviceMapping resourceName := "aws_imagebuilder_container_recipe.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, imagebuilder.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckContainerRecipeDestroy(ctx), @@ -298,7 +298,7 @@ func TestAccImageBuilderContainerRecipe_InstanceConfiguration_BlockDeviceMapping resourceName := "aws_imagebuilder_container_recipe.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, imagebuilder.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckContainerRecipeDestroy(ctx), @@ -329,7 +329,7 @@ func TestAccImageBuilderContainerRecipe_InstanceConfiguration_BlockDeviceMapping resourceName := "aws_imagebuilder_container_recipe.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, imagebuilder.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckContainerRecipeDestroy(ctx), @@ -360,7 +360,7 @@ func TestAccImageBuilderContainerRecipe_InstanceConfiguration_BlockDeviceMapping resourceName := "aws_imagebuilder_container_recipe.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, imagebuilder.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckContainerRecipeDestroy(ctx), @@ -390,7 +390,7 @@ func TestAccImageBuilderContainerRecipe_InstanceConfiguration_BlockDeviceMapping resourceName := "aws_imagebuilder_container_recipe.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, imagebuilder.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckContainerRecipeDestroy(ctx), @@ -420,7 +420,7 @@ func TestAccImageBuilderContainerRecipe_InstanceConfiguration_BlockDeviceMapping resourceName := "aws_imagebuilder_container_recipe.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, imagebuilder.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckContainerRecipeDestroy(ctx), @@ -450,7 +450,7 @@ func TestAccImageBuilderContainerRecipe_InstanceConfiguration_BlockDeviceMapping resourceName := "aws_imagebuilder_container_recipe.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, imagebuilder.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckContainerRecipeDestroy(ctx), @@ -480,7 +480,7 @@ func TestAccImageBuilderContainerRecipe_InstanceConfiguration_BlockDeviceMapping resourceName := "aws_imagebuilder_container_recipe.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, imagebuilder.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckContainerRecipeDestroy(ctx), @@ -509,7 +509,7 @@ func TestAccImageBuilderContainerRecipe_InstanceConfiguration_BlockDeviceMapping resourceName := "aws_imagebuilder_container_recipe.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, imagebuilder.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckContainerRecipeDestroy(ctx), @@ -539,7 +539,7 @@ func TestAccImageBuilderContainerRecipe_InstanceConfiguration_Image(t *testing.T resourceName := "aws_imagebuilder_container_recipe.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, imagebuilder.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckContainerRecipeDestroy(ctx), @@ -568,7 +568,7 @@ func TestAccImageBuilderContainerRecipe_kmsKeyID(t *testing.T) { resourceName := "aws_imagebuilder_container_recipe.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, imagebuilder.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckContainerRecipeDestroy(ctx), @@ -595,7 +595,7 @@ func TestAccImageBuilderContainerRecipe_tags(t *testing.T) { resourceName := "aws_imagebuilder_container_recipe.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, imagebuilder.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckContainerRecipeDestroy(ctx), @@ -640,7 +640,7 @@ func TestAccImageBuilderContainerRecipe_workingDirectory(t *testing.T) { resourceName := "aws_imagebuilder_container_recipe.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, imagebuilder.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckContainerRecipeDestroy(ctx), diff --git a/internal/service/imagebuilder/container_recipes_data_source_test.go b/internal/service/imagebuilder/container_recipes_data_source_test.go index 610449ce3ecc..7ec756de3578 100644 --- a/internal/service/imagebuilder/container_recipes_data_source_test.go +++ b/internal/service/imagebuilder/container_recipes_data_source_test.go @@ -17,7 +17,7 @@ func TestAccImageBuilderContainerRecipesDataSource_filter(t *testing.T) { resourceName := "aws_imagebuilder_container_recipe.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, imagebuilder.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckContainerRecipeDestroy(ctx), diff --git a/internal/service/imagebuilder/distribution_configuration_data_source_test.go b/internal/service/imagebuilder/distribution_configuration_data_source_test.go index 7b1ce2268cde..ccbc3d4d8f9b 100644 --- a/internal/service/imagebuilder/distribution_configuration_data_source_test.go +++ b/internal/service/imagebuilder/distribution_configuration_data_source_test.go @@ -17,7 +17,7 @@ func TestAccImageBuilderDistributionConfigurationDataSource_arn(t *testing.T) { resourceName := "aws_imagebuilder_distribution_configuration.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, imagebuilder.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDistributionConfigurationDestroy(ctx), diff --git a/internal/service/imagebuilder/distribution_configuration_test.go b/internal/service/imagebuilder/distribution_configuration_test.go index c66902f166c1..2f015997a3e6 100644 --- a/internal/service/imagebuilder/distribution_configuration_test.go +++ b/internal/service/imagebuilder/distribution_configuration_test.go @@ -32,7 +32,7 @@ func TestAccImageBuilderDistributionConfiguration_basic(t *testing.T) { resourceName := "aws_imagebuilder_distribution_configuration.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, imagebuilder.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDistributionConfigurationDestroy(ctx), @@ -64,7 +64,7 @@ func TestAccImageBuilderDistributionConfiguration_disappears(t *testing.T) { resourceName := "aws_imagebuilder_distribution_configuration.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, imagebuilder.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDistributionConfigurationDestroy(ctx), @@ -87,7 +87,7 @@ func TestAccImageBuilderDistributionConfiguration_description(t *testing.T) { resourceName := "aws_imagebuilder_distribution_configuration.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, imagebuilder.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDistributionConfigurationDestroy(ctx), @@ -123,7 +123,7 @@ func TestAccImageBuilderDistributionConfiguration_distribution(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckMultipleRegion(t, 2) }, ErrorCheck: acctest.ErrorCheck(t, imagebuilder.EndpointsID), @@ -152,7 +152,7 @@ func TestAccImageBuilderDistributionConfiguration_DistributionAMIDistribution_am resourceName := "aws_imagebuilder_distribution_configuration.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, imagebuilder.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDistributionConfigurationDestroy(ctx), @@ -197,7 +197,7 @@ func TestAccImageBuilderDistributionConfiguration_DistributionAMIDistribution_de resourceName := "aws_imagebuilder_distribution_configuration.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, imagebuilder.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDistributionConfigurationDestroy(ctx), @@ -242,7 +242,7 @@ func TestAccImageBuilderDistributionConfiguration_DistributionAMIDistribution_km resourceName := "aws_imagebuilder_distribution_configuration.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, imagebuilder.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDistributionConfigurationDestroy(ctx), @@ -279,7 +279,7 @@ func TestAccImageBuilderDistributionConfiguration_DistributionAMIDistributionLau resourceName := "aws_imagebuilder_distribution_configuration.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, imagebuilder.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDistributionConfigurationDestroy(ctx), @@ -307,7 +307,7 @@ func TestAccImageBuilderDistributionConfiguration_DistributionAMIDistributionLau resourceName := "aws_imagebuilder_distribution_configuration.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, imagebuilder.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDistributionConfigurationDestroy(ctx), @@ -346,7 +346,7 @@ func TestAccImageBuilderDistributionConfiguration_DistributionAMIDistributionLau resource.Test(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckOrganizationsAccount(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, imagebuilder.EndpointsID), @@ -379,7 +379,7 @@ func TestAccImageBuilderDistributionConfiguration_DistributionAMIDistributionLau resource.Test(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckOrganizationsAccount(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, imagebuilder.EndpointsID), @@ -409,7 +409,7 @@ func TestAccImageBuilderDistributionConfiguration_DistributionAMIDistribution_na resourceName := "aws_imagebuilder_distribution_configuration.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, imagebuilder.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDistributionConfigurationDestroy(ctx), @@ -452,7 +452,7 @@ func TestAccImageBuilderDistributionConfiguration_DistributionAMIDistribution_ta resourceName := "aws_imagebuilder_distribution_configuration.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, imagebuilder.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDistributionConfigurationDestroy(ctx), @@ -489,7 +489,7 @@ func TestAccImageBuilderDistributionConfiguration_DistributionContainerDistribut resourceName := "aws_imagebuilder_distribution_configuration.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, imagebuilder.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDistributionConfigurationDestroy(ctx), @@ -528,7 +528,7 @@ func TestAccImageBuilderDistributionConfiguration_DistributionContainerDistribut resourceName := "aws_imagebuilder_distribution_configuration.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, imagebuilder.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDistributionConfigurationDestroy(ctx), @@ -567,7 +567,7 @@ func TestAccImageBuilderDistributionConfiguration_DistributionContainerDistribut resourceName := "aws_imagebuilder_distribution_configuration.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, imagebuilder.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDistributionConfigurationDestroy(ctx), @@ -610,7 +610,7 @@ func TestAccImageBuilderDistributionConfiguration_DistributionFastLaunchConfigur resourceName := "aws_imagebuilder_distribution_configuration.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, imagebuilder.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDistributionConfigurationDestroy(ctx), @@ -650,7 +650,7 @@ func TestAccImageBuilderDistributionConfiguration_DistributionFastLaunchConfigur launchTemplateResourceName2 := "aws_launch_template.test2" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, imagebuilder.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDistributionConfigurationDestroy(ctx), @@ -694,7 +694,7 @@ func TestAccImageBuilderDistributionConfiguration_DistributionFastLaunchConfigur resourceName := "aws_imagebuilder_distribution_configuration.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, imagebuilder.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDistributionConfigurationDestroy(ctx), @@ -732,7 +732,7 @@ func TestAccImageBuilderDistributionConfiguration_DistributionFastLaunchConfigur resourceName := "aws_imagebuilder_distribution_configuration.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, imagebuilder.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDistributionConfigurationDestroy(ctx), @@ -773,7 +773,7 @@ func TestAccImageBuilderDistributionConfiguration_Distribution_launchTemplateCon resourceName := "aws_imagebuilder_distribution_configuration.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, imagebuilder.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDistributionConfigurationDestroy(ctx), @@ -829,7 +829,7 @@ func TestAccImageBuilderDistributionConfiguration_Distribution_licenseARNs(t *te resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckIAMServiceLinkedRole(ctx, t, "/aws-service-role/license-manager.amazonaws.com") }, ErrorCheck: acctest.ErrorCheck(t, imagebuilder.EndpointsID), @@ -868,7 +868,7 @@ func TestAccImageBuilderDistributionConfiguration_tags(t *testing.T) { resourceName := "aws_imagebuilder_distribution_configuration.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, imagebuilder.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDistributionConfigurationDestroy(ctx), diff --git a/internal/service/imagebuilder/distribution_configurations_data_source_test.go b/internal/service/imagebuilder/distribution_configurations_data_source_test.go index 9ce715b1cb62..04175df0fd19 100644 --- a/internal/service/imagebuilder/distribution_configurations_data_source_test.go +++ b/internal/service/imagebuilder/distribution_configurations_data_source_test.go @@ -17,7 +17,7 @@ func TestAccImageBuilderDistributionConfigurationsDataSource_filter(t *testing.T resourceName := "aws_imagebuilder_distribution_configuration.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, imagebuilder.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDistributionConfigurationDestroy(ctx), diff --git a/internal/service/imagebuilder/image_data_source_test.go b/internal/service/imagebuilder/image_data_source_test.go index 4a5b5e08b6c6..143c4ba72379 100644 --- a/internal/service/imagebuilder/image_data_source_test.go +++ b/internal/service/imagebuilder/image_data_source_test.go @@ -16,7 +16,7 @@ func TestAccImageBuilderImageDataSource_ARN_aws(t *testing.T) { // nosemgrep:ci. dataSourceName := "data.aws_imagebuilder_image.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, imagebuilder.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckImageDestroy(ctx), @@ -52,7 +52,7 @@ func TestAccImageBuilderImageDataSource_ARN_self(t *testing.T) { resourceName := "aws_imagebuilder_image.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, imagebuilder.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckImageDestroy(ctx), @@ -87,7 +87,7 @@ func TestAccImageBuilderImageDataSource_ARN_containerRecipeARN(t *testing.T) { resourceName := "aws_imagebuilder_image.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, imagebuilder.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckImageDestroy(ctx), diff --git a/internal/service/imagebuilder/image_pipeline_data_source_test.go b/internal/service/imagebuilder/image_pipeline_data_source_test.go index a9ca5ca4ad74..1b66b6d053f9 100644 --- a/internal/service/imagebuilder/image_pipeline_data_source_test.go +++ b/internal/service/imagebuilder/image_pipeline_data_source_test.go @@ -17,7 +17,7 @@ func TestAccImageBuilderImagePipelineDataSource_arn(t *testing.T) { resourceName := "aws_imagebuilder_image_pipeline.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, imagebuilder.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckImagePipelineDestroy(ctx), @@ -55,7 +55,7 @@ func TestAccImageBuilderImagePipelineDataSource_containerRecipeARN(t *testing.T) resourceName := "aws_imagebuilder_image_pipeline.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, imagebuilder.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckImagePipelineDestroy(ctx), diff --git a/internal/service/imagebuilder/image_pipeline_test.go b/internal/service/imagebuilder/image_pipeline_test.go index a84d3f29392e..536511c48cc0 100644 --- a/internal/service/imagebuilder/image_pipeline_test.go +++ b/internal/service/imagebuilder/image_pipeline_test.go @@ -24,7 +24,7 @@ func TestAccImageBuilderImagePipeline_basic(t *testing.T) { resourceName := "aws_imagebuilder_image_pipeline.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, imagebuilder.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckImagePipelineDestroy(ctx), @@ -68,7 +68,7 @@ func TestAccImageBuilderImagePipeline_disappears(t *testing.T) { resourceName := "aws_imagebuilder_image_pipeline.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, imagebuilder.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckImagePipelineDestroy(ctx), @@ -91,7 +91,7 @@ func TestAccImageBuilderImagePipeline_description(t *testing.T) { resourceName := "aws_imagebuilder_image_pipeline.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, imagebuilder.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckImagePipelineDestroy(ctx), @@ -126,7 +126,7 @@ func TestAccImageBuilderImagePipeline_distributionARN(t *testing.T) { resourceName := "aws_imagebuilder_image_pipeline.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, imagebuilder.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckImagePipelineDestroy(ctx), @@ -160,7 +160,7 @@ func TestAccImageBuilderImagePipeline_enhancedImageMetadataEnabled(t *testing.T) resourceName := "aws_imagebuilder_image_pipeline.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, imagebuilder.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckImagePipelineDestroy(ctx), @@ -196,7 +196,7 @@ func TestAccImageBuilderImagePipeline_imageRecipeARN(t *testing.T) { resourceName := "aws_imagebuilder_image_pipeline.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, imagebuilder.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckImagePipelineDestroy(ctx), @@ -232,7 +232,7 @@ func TestAccImageBuilderImagePipeline_containerRecipeARN(t *testing.T) { resourceName := "aws_imagebuilder_image_pipeline.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, imagebuilder.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckImagePipelineDestroy(ctx), @@ -266,7 +266,7 @@ func TestAccImageBuilderImagePipeline_ImageTests_imageTestsEnabled(t *testing.T) resourceName := "aws_imagebuilder_image_pipeline.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, imagebuilder.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckImagePipelineDestroy(ctx), @@ -302,7 +302,7 @@ func TestAccImageBuilderImagePipeline_ImageTests_timeoutMinutes(t *testing.T) { resourceName := "aws_imagebuilder_image_pipeline.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, imagebuilder.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckImagePipelineDestroy(ctx), @@ -340,7 +340,7 @@ func TestAccImageBuilderImagePipeline_infrastructureARN(t *testing.T) { resourceName := "aws_imagebuilder_image_pipeline.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, imagebuilder.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckImagePipelineDestroy(ctx), @@ -374,7 +374,7 @@ func TestAccImageBuilderImagePipeline_Schedule_pipelineExecutionStartCondition(t resourceName := "aws_imagebuilder_image_pipeline.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, imagebuilder.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckImagePipelineDestroy(ctx), @@ -410,7 +410,7 @@ func TestAccImageBuilderImagePipeline_Schedule_scheduleExpression(t *testing.T) resourceName := "aws_imagebuilder_image_pipeline.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, imagebuilder.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckImagePipelineDestroy(ctx), @@ -446,7 +446,7 @@ func TestAccImageBuilderImagePipeline_Schedule_timezone(t *testing.T) { resourceName := "aws_imagebuilder_image_pipeline.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, imagebuilder.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckImagePipelineDestroy(ctx), @@ -484,7 +484,7 @@ func TestAccImageBuilderImagePipeline_status(t *testing.T) { resourceName := "aws_imagebuilder_image_pipeline.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, imagebuilder.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckImagePipelineDestroy(ctx), @@ -518,7 +518,7 @@ func TestAccImageBuilderImagePipeline_tags(t *testing.T) { resourceName := "aws_imagebuilder_image_pipeline.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, imagebuilder.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckImagePipelineDestroy(ctx), diff --git a/internal/service/imagebuilder/image_pipelines_data_source_test.go b/internal/service/imagebuilder/image_pipelines_data_source_test.go index e95cba2cafee..10f311c4a298 100644 --- a/internal/service/imagebuilder/image_pipelines_data_source_test.go +++ b/internal/service/imagebuilder/image_pipelines_data_source_test.go @@ -17,7 +17,7 @@ func TestAccImageBuilderImagePipelinesDataSource_filter(t *testing.T) { resourceName := "aws_imagebuilder_image_pipeline.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, imagebuilder.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckImagePipelineDestroy(ctx), diff --git a/internal/service/imagebuilder/image_recipe_data_source_test.go b/internal/service/imagebuilder/image_recipe_data_source_test.go index 1826bdb57a24..b1b68f99dea5 100644 --- a/internal/service/imagebuilder/image_recipe_data_source_test.go +++ b/internal/service/imagebuilder/image_recipe_data_source_test.go @@ -17,7 +17,7 @@ func TestAccImageBuilderImageRecipeDataSource_arn(t *testing.T) { resourceName := "aws_imagebuilder_image_recipe.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, imagebuilder.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckImageRecipeDestroy(ctx), diff --git a/internal/service/imagebuilder/image_recipe_test.go b/internal/service/imagebuilder/image_recipe_test.go index 9a685eeb5d13..b5acd9ddad2e 100644 --- a/internal/service/imagebuilder/image_recipe_test.go +++ b/internal/service/imagebuilder/image_recipe_test.go @@ -24,7 +24,7 @@ func TestAccImageBuilderImageRecipe_basic(t *testing.T) { resourceName := "aws_imagebuilder_image_recipe.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, imagebuilder.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckImageRecipeDestroy(ctx), @@ -61,7 +61,7 @@ func TestAccImageBuilderImageRecipe_disappears(t *testing.T) { resourceName := "aws_imagebuilder_image_recipe.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, imagebuilder.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckImageRecipeDestroy(ctx), @@ -84,7 +84,7 @@ func TestAccImageBuilderImageRecipe_BlockDeviceMapping_deviceName(t *testing.T) resourceName := "aws_imagebuilder_image_recipe.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, imagebuilder.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckImageRecipeDestroy(ctx), @@ -114,7 +114,7 @@ func TestAccImageBuilderImageRecipe_BlockDeviceMappingEBS_deleteOnTermination(t resourceName := "aws_imagebuilder_image_recipe.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, imagebuilder.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckImageRecipeDestroy(ctx), @@ -144,7 +144,7 @@ func TestAccImageBuilderImageRecipe_BlockDeviceMappingEBS_encrypted(t *testing.T resourceName := "aws_imagebuilder_image_recipe.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, imagebuilder.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckImageRecipeDestroy(ctx), @@ -174,7 +174,7 @@ func TestAccImageBuilderImageRecipe_BlockDeviceMappingEBS_iops(t *testing.T) { resourceName := "aws_imagebuilder_image_recipe.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, imagebuilder.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckImageRecipeDestroy(ctx), @@ -205,7 +205,7 @@ func TestAccImageBuilderImageRecipe_BlockDeviceMappingEBS_kmsKeyID(t *testing.T) resourceName := "aws_imagebuilder_image_recipe.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, imagebuilder.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckImageRecipeDestroy(ctx), @@ -234,7 +234,7 @@ func TestAccImageBuilderImageRecipe_BlockDeviceMappingEBS_snapshotID(t *testing. resourceName := "aws_imagebuilder_image_recipe.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, imagebuilder.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckImageRecipeDestroy(ctx), @@ -262,7 +262,7 @@ func TestAccImageBuilderImageRecipe_BlockDeviceMappingEBS_throughput(t *testing. resourceName := "aws_imagebuilder_image_recipe.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, imagebuilder.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckImageRecipeDestroy(ctx), @@ -292,7 +292,7 @@ func TestAccImageBuilderImageRecipe_BlockDeviceMappingEBS_volumeSize(t *testing. resourceName := "aws_imagebuilder_image_recipe.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, imagebuilder.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckImageRecipeDestroy(ctx), @@ -322,7 +322,7 @@ func TestAccImageBuilderImageRecipe_BlockDeviceMappingEBS_volumeTypeGP2(t *testi resourceName := "aws_imagebuilder_image_recipe.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, imagebuilder.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckImageRecipeDestroy(ctx), @@ -352,7 +352,7 @@ func TestAccImageBuilderImageRecipe_BlockDeviceMappingEBS_volumeTypeGP3(t *testi resourceName := "aws_imagebuilder_image_recipe.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, imagebuilder.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckImageRecipeDestroy(ctx), @@ -382,7 +382,7 @@ func TestAccImageBuilderImageRecipe_BlockDeviceMapping_noDevice(t *testing.T) { resourceName := "aws_imagebuilder_image_recipe.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, imagebuilder.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckImageRecipeDestroy(ctx), @@ -412,7 +412,7 @@ func TestAccImageBuilderImageRecipe_BlockDeviceMapping_virtualName(t *testing.T) resourceName := "aws_imagebuilder_image_recipe.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, imagebuilder.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckImageRecipeDestroy(ctx), @@ -442,7 +442,7 @@ func TestAccImageBuilderImageRecipe_component(t *testing.T) { resourceName := "aws_imagebuilder_image_recipe.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, imagebuilder.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckImageRecipeDestroy(ctx), @@ -472,7 +472,7 @@ func TestAccImageBuilderImageRecipe_componentParameter(t *testing.T) { resourceName := "aws_imagebuilder_image_recipe.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, imagebuilder.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckImageRecipeDestroy(ctx), @@ -499,7 +499,7 @@ func TestAccImageBuilderImageRecipe_description(t *testing.T) { resourceName := "aws_imagebuilder_image_recipe.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, imagebuilder.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckImageRecipeDestroy(ctx), @@ -526,7 +526,7 @@ func TestAccImageBuilderImageRecipe_tags(t *testing.T) { resourceName := "aws_imagebuilder_image_recipe.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, imagebuilder.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckImageRecipeDestroy(ctx), @@ -571,7 +571,7 @@ func TestAccImageBuilderImageRecipe_workingDirectory(t *testing.T) { resourceName := "aws_imagebuilder_image_recipe.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, imagebuilder.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckImageRecipeDestroy(ctx), @@ -598,7 +598,7 @@ func TestAccImageBuilderImageRecipe_pipelineUpdateDependency(t *testing.T) { resourceName := "aws_imagebuilder_image_recipe.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, imagebuilder.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckImageRecipeDestroy(ctx), @@ -625,7 +625,7 @@ func TestAccImageBuilderImageRecipe_systemsManagerAgent(t *testing.T) { resourceName := "aws_imagebuilder_image_recipe.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, imagebuilder.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckImageRecipeDestroy(ctx), @@ -653,7 +653,7 @@ func TestAccImageBuilderImageRecipe_updateDependency(t *testing.T) { resourceName := "aws_imagebuilder_image_recipe.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, imagebuilder.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckImageRecipeDestroy(ctx), @@ -689,7 +689,7 @@ func TestAccImageBuilderImageRecipe_userDataBase64(t *testing.T) { resourceName := "aws_imagebuilder_image_recipe.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, imagebuilder.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckImageRecipeDestroy(ctx), @@ -716,7 +716,7 @@ func TestAccImageBuilderImageRecipe_windowsBaseImage(t *testing.T) { resourceName := "aws_imagebuilder_image_recipe.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, imagebuilder.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckImageRecipeDestroy(ctx), diff --git a/internal/service/imagebuilder/image_recipes_data_source_test.go b/internal/service/imagebuilder/image_recipes_data_source_test.go index 34cdc575d304..59b3b148a150 100644 --- a/internal/service/imagebuilder/image_recipes_data_source_test.go +++ b/internal/service/imagebuilder/image_recipes_data_source_test.go @@ -20,7 +20,7 @@ func TestAccImageBuilderImageRecipesDataSource_owner(t *testing.T) { // Not a good test since it is susceptible to fail with parallel tests or if anything else // ImageBuilder is going on in the account resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, imagebuilder.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckImageRecipeDestroy(ctx), @@ -47,7 +47,7 @@ func TestAccImageBuilderImageRecipesDataSource_filter(t *testing.T) { resourceName := "aws_imagebuilder_image_recipe.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, imagebuilder.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckImageRecipeDestroy(ctx), diff --git a/internal/service/imagebuilder/image_test.go b/internal/service/imagebuilder/image_test.go index 9be39206dcc9..a3e4d8f3ad1b 100644 --- a/internal/service/imagebuilder/image_test.go +++ b/internal/service/imagebuilder/image_test.go @@ -25,7 +25,7 @@ func TestAccImageBuilderImage_basic(t *testing.T) { resourceName := "aws_imagebuilder_image.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, imagebuilder.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckImageDestroy(ctx), @@ -67,7 +67,7 @@ func TestAccImageBuilderImage_disappears(t *testing.T) { resourceName := "aws_imagebuilder_image.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, imagebuilder.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckImageDestroy(ctx), @@ -91,7 +91,7 @@ func TestAccImageBuilderImage_distributionARN(t *testing.T) { resourceName := "aws_imagebuilder_image.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, imagebuilder.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckImageDestroy(ctx), @@ -118,7 +118,7 @@ func TestAccImageBuilderImage_enhancedImageMetadataEnabled(t *testing.T) { resourceName := "aws_imagebuilder_image.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, imagebuilder.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckImageDestroy(ctx), @@ -145,7 +145,7 @@ func TestAccImageBuilderImage_ImageTests_imageTestsEnabled(t *testing.T) { resourceName := "aws_imagebuilder_image.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, imagebuilder.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckImageDestroy(ctx), @@ -173,7 +173,7 @@ func TestAccImageBuilderImage_ImageTests_timeoutMinutes(t *testing.T) { resourceName := "aws_imagebuilder_image.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, imagebuilder.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckImageDestroy(ctx), @@ -201,7 +201,7 @@ func TestAccImageBuilderImage_tags(t *testing.T) { resourceName := "aws_imagebuilder_image.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, imagebuilder.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckImageDestroy(ctx), @@ -247,7 +247,7 @@ func TestAccImageBuilderImage_containerRecipeARN(t *testing.T) { containerRecipeResourceName := "aws_imagebuilder_container_recipe.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, imagebuilder.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckImageDestroy(ctx), diff --git a/internal/service/imagebuilder/infrastructure_configuration_data_source_test.go b/internal/service/imagebuilder/infrastructure_configuration_data_source_test.go index b4326ee3bfdb..07cbd6ce4787 100644 --- a/internal/service/imagebuilder/infrastructure_configuration_data_source_test.go +++ b/internal/service/imagebuilder/infrastructure_configuration_data_source_test.go @@ -17,7 +17,7 @@ func TestAccImageBuilderInfrastructureConfigurationDataSource_arn(t *testing.T) resourceName := "aws_imagebuilder_infrastructure_configuration.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, imagebuilder.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckInfrastructureConfigurationDestroy(ctx), diff --git a/internal/service/imagebuilder/infrastructure_configuration_test.go b/internal/service/imagebuilder/infrastructure_configuration_test.go index 6a4765ad909f..75bb57b6d5d9 100644 --- a/internal/service/imagebuilder/infrastructure_configuration_test.go +++ b/internal/service/imagebuilder/infrastructure_configuration_test.go @@ -23,7 +23,7 @@ func TestAccImageBuilderInfrastructureConfiguration_basic(t *testing.T) { resourceName := "aws_imagebuilder_infrastructure_configuration.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, imagebuilder.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckInfrastructureConfigurationDestroy(ctx), @@ -65,7 +65,7 @@ func TestAccImageBuilderInfrastructureConfiguration_disappears(t *testing.T) { resourceName := "aws_imagebuilder_infrastructure_configuration.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, imagebuilder.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckInfrastructureConfigurationDestroy(ctx), @@ -88,7 +88,7 @@ func TestAccImageBuilderInfrastructureConfiguration_description(t *testing.T) { resourceName := "aws_imagebuilder_infrastructure_configuration.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, imagebuilder.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckInfrastructureConfigurationDestroy(ctx), @@ -123,7 +123,7 @@ func TestAccImageBuilderInfrastructureConfiguration_instanceMetadataOptions(t *t resourceName := "aws_imagebuilder_infrastructure_configuration.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, imagebuilder.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckInfrastructureConfigurationDestroy(ctx), @@ -154,7 +154,7 @@ func TestAccImageBuilderInfrastructureConfiguration_instanceProfileName(t *testi resourceName := "aws_imagebuilder_infrastructure_configuration.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, imagebuilder.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckInfrastructureConfigurationDestroy(ctx), @@ -189,7 +189,7 @@ func TestAccImageBuilderInfrastructureConfiguration_instanceTypes(t *testing.T) resourceName := "aws_imagebuilder_infrastructure_configuration.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, imagebuilder.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckInfrastructureConfigurationDestroy(ctx), @@ -235,7 +235,7 @@ func TestAccImageBuilderInfrastructureConfiguration_keyPair(t *testing.T) { } resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, imagebuilder.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckInfrastructureConfigurationDestroy(ctx), @@ -272,7 +272,7 @@ func TestAccImageBuilderInfrastructureConfiguration_LoggingS3Logs_s3BucketName(t resourceName := "aws_imagebuilder_infrastructure_configuration.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, imagebuilder.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckInfrastructureConfigurationDestroy(ctx), @@ -311,7 +311,7 @@ func TestAccImageBuilderInfrastructureConfiguration_LoggingS3Logs_s3KeyPrefix(t resourceName := "aws_imagebuilder_infrastructure_configuration.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, imagebuilder.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckInfrastructureConfigurationDestroy(ctx), @@ -350,7 +350,7 @@ func TestAccImageBuilderInfrastructureConfiguration_resourceTags(t *testing.T) { resourceName := "aws_imagebuilder_infrastructure_configuration.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, imagebuilder.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckInfrastructureConfigurationDestroy(ctx), @@ -389,7 +389,7 @@ func TestAccImageBuilderInfrastructureConfiguration_securityGroupIDs(t *testing. resourceName := "aws_imagebuilder_infrastructure_configuration.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, imagebuilder.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckInfrastructureConfigurationDestroy(ctx), @@ -428,7 +428,7 @@ func TestAccImageBuilderInfrastructureConfiguration_snsTopicARN(t *testing.T) { resourceName := "aws_imagebuilder_infrastructure_configuration.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, imagebuilder.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckInfrastructureConfigurationDestroy(ctx), @@ -465,7 +465,7 @@ func TestAccImageBuilderInfrastructureConfiguration_subnetID(t *testing.T) { resourceName := "aws_imagebuilder_infrastructure_configuration.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, imagebuilder.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckInfrastructureConfigurationDestroy(ctx), @@ -500,7 +500,7 @@ func TestAccImageBuilderInfrastructureConfiguration_tags(t *testing.T) { resourceName := "aws_imagebuilder_infrastructure_configuration.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, imagebuilder.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckInfrastructureConfigurationDestroy(ctx), @@ -545,7 +545,7 @@ func TestAccImageBuilderInfrastructureConfiguration_terminateInstanceOnFailure(t resourceName := "aws_imagebuilder_infrastructure_configuration.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, imagebuilder.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckInfrastructureConfigurationDestroy(ctx), diff --git a/internal/service/imagebuilder/infrastructure_configurations_data_source_test.go b/internal/service/imagebuilder/infrastructure_configurations_data_source_test.go index f4bb91085105..f9a8307b8499 100644 --- a/internal/service/imagebuilder/infrastructure_configurations_data_source_test.go +++ b/internal/service/imagebuilder/infrastructure_configurations_data_source_test.go @@ -17,7 +17,7 @@ func TestAccImageBuilderInfrastructureConfigurationsDataSource_filter(t *testing resourceName := "aws_imagebuilder_infrastructure_configuration.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, imagebuilder.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckInfrastructureConfigurationDestroy(ctx), From 40fc14e7e9a2ba5c8cfc369ee98c71c206cca1e6 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Fri, 24 Feb 2023 16:37:02 -0500 Subject: [PATCH 169/763] Add 'Context' argument to 'acctest.PreCheck' for inspector. --- internal/service/inspector/assessment_target_test.go | 8 ++++---- internal/service/inspector/assessment_template_test.go | 8 ++++---- internal/service/inspector/resource_group_test.go | 2 +- .../service/inspector/rules_packages_data_source_test.go | 2 +- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/internal/service/inspector/assessment_target_test.go b/internal/service/inspector/assessment_target_test.go index c34ca952818f..46385cc2eafa 100644 --- a/internal/service/inspector/assessment_target_test.go +++ b/internal/service/inspector/assessment_target_test.go @@ -22,7 +22,7 @@ func TestAccInspectorAssessmentTarget_basic(t *testing.T) { resourceName := "aws_inspector_assessment_target.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, inspector.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTargetAssessmentDestroy(ctx), @@ -52,7 +52,7 @@ func TestAccInspectorAssessmentTarget_disappears(t *testing.T) { resourceName := "aws_inspector_assessment_target.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, inspector.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTargetAssessmentDestroy(ctx), @@ -77,7 +77,7 @@ func TestAccInspectorAssessmentTarget_name(t *testing.T) { resourceName := "aws_inspector_assessment_target.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, inspector.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTargetAssessmentDestroy(ctx), @@ -114,7 +114,7 @@ func TestAccInspectorAssessmentTarget_resourceGroupARN(t *testing.T) { resourceName := "aws_inspector_assessment_target.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, inspector.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTargetAssessmentDestroy(ctx), diff --git a/internal/service/inspector/assessment_template_test.go b/internal/service/inspector/assessment_template_test.go index cda7299667cd..3c676c618b04 100644 --- a/internal/service/inspector/assessment_template_test.go +++ b/internal/service/inspector/assessment_template_test.go @@ -23,7 +23,7 @@ func TestAccInspectorAssessmentTemplate_basic(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, inspector.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTemplateDestroy(ctx), @@ -56,7 +56,7 @@ func TestAccInspectorAssessmentTemplate_disappears(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, inspector.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTemplateDestroy(ctx), @@ -80,7 +80,7 @@ func TestAccInspectorAssessmentTemplate_tags(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, inspector.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTemplateDestroy(ctx), @@ -137,7 +137,7 @@ func TestAccInspectorAssessmentTemplate_eventSubscription(t *testing.T) { event2 := "ASSESSMENT_RUN_STATE_CHANGED" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, inspector.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTemplateDestroy(ctx), diff --git a/internal/service/inspector/resource_group_test.go b/internal/service/inspector/resource_group_test.go index 1d8a7cb52d2b..cb2c0c4d0a73 100644 --- a/internal/service/inspector/resource_group_test.go +++ b/internal/service/inspector/resource_group_test.go @@ -20,7 +20,7 @@ func TestAccInspectorResourceGroup_basic(t *testing.T) { resourceName := "aws_inspector_resource_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, inspector.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: nil, diff --git a/internal/service/inspector/rules_packages_data_source_test.go b/internal/service/inspector/rules_packages_data_source_test.go index d33014f8426d..a2fb30b0471d 100644 --- a/internal/service/inspector/rules_packages_data_source_test.go +++ b/internal/service/inspector/rules_packages_data_source_test.go @@ -10,7 +10,7 @@ import ( func TestAccInspectorRulesPackagesDataSource_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, inspector.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ From 70490a0f28e97b427c52d8bb0fc189a3524a501e Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Fri, 24 Feb 2023 16:37:03 -0500 Subject: [PATCH 170/763] Add 'Context' argument to 'acctest.PreCheck' for inspector2. --- internal/service/inspector2/delegated_admin_account_test.go | 4 ++-- internal/service/inspector2/enabler_test.go | 6 +++--- .../service/inspector2/organization_configuration_test.go | 6 +++--- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/internal/service/inspector2/delegated_admin_account_test.go b/internal/service/inspector2/delegated_admin_account_test.go index 73db55688c70..513372100c18 100644 --- a/internal/service/inspector2/delegated_admin_account_test.go +++ b/internal/service/inspector2/delegated_admin_account_test.go @@ -35,7 +35,7 @@ func testAccDelegatedAdminAccount_basic(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(names.Inspector2EndpointID, t) testAccPreCheck(ctx, t) acctest.PreCheckOrganizationManagementAccount(ctx, t) @@ -86,7 +86,7 @@ func testAccDelegatedAdminAccount_disappears(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(names.Inspector2EndpointID, t) testAccPreCheck(ctx, t) acctest.PreCheckOrganizationManagementAccount(ctx, t) diff --git a/internal/service/inspector2/enabler_test.go b/internal/service/inspector2/enabler_test.go index fc823cae63ac..49ae2b2db2fb 100644 --- a/internal/service/inspector2/enabler_test.go +++ b/internal/service/inspector2/enabler_test.go @@ -35,7 +35,7 @@ func testAccEnabler_basic(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(names.Inspector2EndpointID, t) testAccPreCheck(ctx, t) acctest.PreCheckOrganizationManagementAccount(ctx, t) @@ -64,7 +64,7 @@ func testAccEnabler_accountID(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(names.Inspector2EndpointID, t) testAccPreCheck(ctx, t) acctest.PreCheckOrganizationManagementAccount(ctx, t) @@ -94,7 +94,7 @@ func testAccEnabler_disappears(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(names.Inspector2EndpointID, t) testAccPreCheck(ctx, t) acctest.PreCheckOrganizationManagementAccount(ctx, t) diff --git a/internal/service/inspector2/organization_configuration_test.go b/internal/service/inspector2/organization_configuration_test.go index e23eef0def9b..b66658fc134f 100644 --- a/internal/service/inspector2/organization_configuration_test.go +++ b/internal/service/inspector2/organization_configuration_test.go @@ -37,7 +37,7 @@ func testAccOrganizationConfiguration_basic(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(names.Inspector2EndpointID, t) testAccPreCheck(ctx, t) acctest.PreCheckOrganizationManagementAccount(ctx, t) @@ -64,7 +64,7 @@ func testAccOrganizationConfiguration_disappears(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(names.Inspector2EndpointID, t) testAccPreCheck(ctx, t) acctest.PreCheckOrganizationManagementAccount(ctx, t) @@ -91,7 +91,7 @@ func testAccOrganizationConfiguration_ec2ECR(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(names.Inspector2EndpointID, t) testAccPreCheck(ctx, t) acctest.PreCheckOrganizationManagementAccount(ctx, t) From 66d36269f88b9feea5ce613efcacbc4a0bf4ab81 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Fri, 24 Feb 2023 16:37:03 -0500 Subject: [PATCH 171/763] Add 'Context' argument to 'acctest.PreCheck' for iot. --- internal/service/iot/authorizer_test.go | 8 +-- internal/service/iot/certificate_test.go | 6 +-- .../service/iot/endpoint_data_source_test.go | 10 ++-- .../iot/indexing_configuration_test.go | 4 +- internal/service/iot/logging_options_test.go | 4 +- .../service/iot/policy_attachment_test.go | 2 +- internal/service/iot/policy_test.go | 4 +- .../service/iot/provisioning_template_test.go | 8 +-- internal/service/iot/role_alias_test.go | 2 +- .../iot/thing_group_membership_test.go | 10 ++-- internal/service/iot/thing_group_test.go | 10 ++-- .../iot/thing_principal_attachment_test.go | 2 +- internal/service/iot/thing_test.go | 4 +- internal/service/iot/thing_type_test.go | 6 +-- .../iot/topic_rule_destination_test.go | 6 +-- internal/service/iot/topic_rule_test.go | 52 +++++++++---------- 16 files changed, 69 insertions(+), 69 deletions(-) diff --git a/internal/service/iot/authorizer_test.go b/internal/service/iot/authorizer_test.go index 75f264860d67..0b5818551d4d 100644 --- a/internal/service/iot/authorizer_test.go +++ b/internal/service/iot/authorizer_test.go @@ -22,7 +22,7 @@ func TestAccIoTAuthorizer_basic(t *testing.T) { resourceName := "aws_iot_authorizer.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, iot.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckAuthorizerDestroy(ctx), @@ -57,7 +57,7 @@ func TestAccIoTAuthorizer_disappears(t *testing.T) { resourceName := "aws_iot_authorizer.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, iot.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckAuthorizerDestroy(ctx), @@ -81,7 +81,7 @@ func TestAccIoTAuthorizer_signingDisabled(t *testing.T) { resourceName := "aws_iot_authorizer.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, iot.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckAuthorizerDestroy(ctx), @@ -114,7 +114,7 @@ func TestAccIoTAuthorizer_update(t *testing.T) { resourceName := "aws_iot_authorizer.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, iot.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckAuthorizerDestroy(ctx), diff --git a/internal/service/iot/certificate_test.go b/internal/service/iot/certificate_test.go index 4ff0b1dca674..189fddcfcb55 100644 --- a/internal/service/iot/certificate_test.go +++ b/internal/service/iot/certificate_test.go @@ -17,7 +17,7 @@ import ( func TestAccIoTCertificate_csr(t *testing.T) { ctx := acctest.Context(t) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, iot.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckCertificateDestroy_basic(ctx), @@ -40,7 +40,7 @@ func TestAccIoTCertificate_csr(t *testing.T) { func TestAccIoTCertificate_Keys_certificate(t *testing.T) { ctx := acctest.Context(t) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, iot.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckCertificateDestroy_basic(ctx), @@ -66,7 +66,7 @@ func TestAccIoTCertificate_Keys_existingCertificate(t *testing.T) { certificate := acctest.TLSRSAX509SelfSignedCertificatePEM(t, key, "testcert") resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, iot.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckCertificateDestroy_basic(ctx), diff --git a/internal/service/iot/endpoint_data_source_test.go b/internal/service/iot/endpoint_data_source_test.go index d9c7ec17816c..30018cf232c5 100644 --- a/internal/service/iot/endpoint_data_source_test.go +++ b/internal/service/iot/endpoint_data_source_test.go @@ -14,7 +14,7 @@ func TestAccIoTEndpointDataSource_basic(t *testing.T) { dataSourceName := "data.aws_iot_endpoint.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, iot.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ @@ -32,7 +32,7 @@ func TestAccIoTEndpointDataSource_EndpointType_iotCredentialProvider(t *testing. dataSourceName := "data.aws_iot_endpoint.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, iot.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ @@ -50,7 +50,7 @@ func TestAccIoTEndpointDataSource_EndpointType_iotData(t *testing.T) { dataSourceName := "data.aws_iot_endpoint.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, iot.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ @@ -68,7 +68,7 @@ func TestAccIoTEndpointDataSource_EndpointType_iotDataATS(t *testing.T) { dataSourceName := "data.aws_iot_endpoint.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, iot.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ @@ -86,7 +86,7 @@ func TestAccIoTEndpointDataSource_EndpointType_iotJobs(t *testing.T) { dataSourceName := "data.aws_iot_endpoint.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, iot.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ diff --git a/internal/service/iot/indexing_configuration_test.go b/internal/service/iot/indexing_configuration_test.go index aecfb0a438eb..a929f45846db 100644 --- a/internal/service/iot/indexing_configuration_test.go +++ b/internal/service/iot/indexing_configuration_test.go @@ -23,7 +23,7 @@ func testAccIndexingConfiguration_basic(t *testing.T) { resourceName := "aws_iot_indexing_configuration.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, iot.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: acctest.CheckDestroyNoop, @@ -57,7 +57,7 @@ func testAccIndexingConfiguration_allAttributes(t *testing.T) { resourceName := "aws_iot_indexing_configuration.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, iot.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: acctest.CheckDestroyNoop, diff --git a/internal/service/iot/logging_options_test.go b/internal/service/iot/logging_options_test.go index b7e8cf4ef5fc..9d343cedac1f 100644 --- a/internal/service/iot/logging_options_test.go +++ b/internal/service/iot/logging_options_test.go @@ -26,7 +26,7 @@ func testAccLoggingOptions_basic(t *testing.T) { resourceName := "aws_iot_logging_options.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, iot.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: acctest.CheckDestroyNoop, @@ -48,7 +48,7 @@ func testAccLoggingOptions_update(t *testing.T) { resourceName := "aws_iot_logging_options.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, iot.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: acctest.CheckDestroyNoop, diff --git a/internal/service/iot/policy_attachment_test.go b/internal/service/iot/policy_attachment_test.go index 12ea003aafac..da7db859e6b0 100644 --- a/internal/service/iot/policy_attachment_test.go +++ b/internal/service/iot/policy_attachment_test.go @@ -22,7 +22,7 @@ func TestAccIoTPolicyAttachment_basic(t *testing.T) { policyName2 := sdkacctest.RandomWithPrefix("PolicyName2-") resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, iot.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckPolicyAttchmentDestroy(ctx), diff --git a/internal/service/iot/policy_test.go b/internal/service/iot/policy_test.go index 9cbfadb697a1..6677d5a59095 100644 --- a/internal/service/iot/policy_test.go +++ b/internal/service/iot/policy_test.go @@ -23,7 +23,7 @@ func TestAccIoTPolicy_basic(t *testing.T) { resourceName := "aws_iot_policy.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, iot.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckPolicyDestroy_basic(ctx), @@ -54,7 +54,7 @@ func TestAccIoTPolicy_disappears(t *testing.T) { resourceName := "aws_iot_policy.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, iot.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckPolicyDestroy_basic(ctx), diff --git a/internal/service/iot/provisioning_template_test.go b/internal/service/iot/provisioning_template_test.go index 9f53baf71c4f..6a80da9c04f0 100644 --- a/internal/service/iot/provisioning_template_test.go +++ b/internal/service/iot/provisioning_template_test.go @@ -22,7 +22,7 @@ func TestAccIoTProvisioningTemplate_basic(t *testing.T) { resourceName := "aws_iot_provisioning_template.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, iot.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckProvisioningTemplateDestroy(ctx), @@ -57,7 +57,7 @@ func TestAccIoTProvisioningTemplate_disappears(t *testing.T) { resourceName := "aws_iot_provisioning_template.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, iot.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckProvisioningTemplateDestroy(ctx), @@ -80,7 +80,7 @@ func TestAccIoTProvisioningTemplate_tags(t *testing.T) { resourceName := "aws_iot_provisioning_template.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, iot.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckProvisioningTemplateDestroy(ctx), @@ -128,7 +128,7 @@ func TestAccIoTProvisioningTemplate_update(t *testing.T) { resourceName := "aws_iot_provisioning_template.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, iot.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckProvisioningTemplateDestroy(ctx), diff --git a/internal/service/iot/role_alias_test.go b/internal/service/iot/role_alias_test.go index 2e9ed1a38d18..d1b85f5a0a0f 100644 --- a/internal/service/iot/role_alias_test.go +++ b/internal/service/iot/role_alias_test.go @@ -25,7 +25,7 @@ func TestAccIoTRoleAlias_basic(t *testing.T) { resourceName2 := "aws_iot_role_alias.ra2" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, iot.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRoleAliasDestroy(ctx), diff --git a/internal/service/iot/thing_group_membership_test.go b/internal/service/iot/thing_group_membership_test.go index f21eabb4bf31..62feaa242e04 100644 --- a/internal/service/iot/thing_group_membership_test.go +++ b/internal/service/iot/thing_group_membership_test.go @@ -22,7 +22,7 @@ func TestAccIoTThingGroupMembership_basic(t *testing.T) { resourceName := "aws_iot_thing_group_membership.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, iot.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckThingGroupMembershipDestroy(ctx), @@ -52,7 +52,7 @@ func TestAccIoTThingGroupMembership_disappears(t *testing.T) { resourceName := "aws_iot_thing_group_membership.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, iot.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckThingGroupMembershipDestroy(ctx), @@ -77,7 +77,7 @@ func TestAccIoTThingGroupMembership_disappears_Thing(t *testing.T) { thingResourceName := "aws_iot_thing.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, iot.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckThingGroupMembershipDestroy(ctx), @@ -102,7 +102,7 @@ func TestAccIoTThingGroupMembership_disappears_ThingGroup(t *testing.T) { thingGroupResourceName := "aws_iot_thing_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, iot.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckThingGroupMembershipDestroy(ctx), @@ -126,7 +126,7 @@ func TestAccIoTThingGroupMembership_overrideDynamicGroup(t *testing.T) { resourceName := "aws_iot_thing_group_membership.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, iot.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckThingGroupMembershipDestroy(ctx), diff --git a/internal/service/iot/thing_group_test.go b/internal/service/iot/thing_group_test.go index a043e0370b10..f2438da328a4 100644 --- a/internal/service/iot/thing_group_test.go +++ b/internal/service/iot/thing_group_test.go @@ -23,7 +23,7 @@ func TestAccIoTThingGroup_basic(t *testing.T) { resourceName := "aws_iot_thing_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, iot.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckThingGroupDestroy(ctx), @@ -60,7 +60,7 @@ func TestAccIoTThingGroup_disappears(t *testing.T) { resourceName := "aws_iot_thing_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, iot.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckThingGroupDestroy(ctx), @@ -84,7 +84,7 @@ func TestAccIoTThingGroup_tags(t *testing.T) { resourceName := "aws_iot_thing_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, iot.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckThingGroupDestroy(ctx), @@ -132,7 +132,7 @@ func TestAccIoTThingGroup_parentGroup(t *testing.T) { grandparentResourceName := "aws_iot_thing_group.grandparent" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, iot.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckThingGroupDestroy(ctx), @@ -167,7 +167,7 @@ func TestAccIoTThingGroup_properties(t *testing.T) { resourceName := "aws_iot_thing_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, iot.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckThingGroupDestroy(ctx), diff --git a/internal/service/iot/thing_principal_attachment_test.go b/internal/service/iot/thing_principal_attachment_test.go index 45eac6e83f7e..1d21e7754654 100644 --- a/internal/service/iot/thing_principal_attachment_test.go +++ b/internal/service/iot/thing_principal_attachment_test.go @@ -22,7 +22,7 @@ func TestAccIoTThingPrincipalAttachment_basic(t *testing.T) { thingName2 := sdkacctest.RandomWithPrefix("tf-acc2") resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, iot.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckThingPrincipalAttachmentDestroy(ctx), diff --git a/internal/service/iot/thing_test.go b/internal/service/iot/thing_test.go index ea1f6d05c075..113e731020c1 100644 --- a/internal/service/iot/thing_test.go +++ b/internal/service/iot/thing_test.go @@ -23,7 +23,7 @@ func TestAccIoTThing_basic(t *testing.T) { resourceName := "aws_iot_thing.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, iot.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckThingDestroy(ctx), @@ -58,7 +58,7 @@ func TestAccIoTThing_full(t *testing.T) { resourceName := "aws_iot_thing.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, iot.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckThingDestroy(ctx), diff --git a/internal/service/iot/thing_type_test.go b/internal/service/iot/thing_type_test.go index 624e4fb0d83a..16fe0100f6c3 100644 --- a/internal/service/iot/thing_type_test.go +++ b/internal/service/iot/thing_type_test.go @@ -19,7 +19,7 @@ func TestAccIoTThingType_basic(t *testing.T) { rInt := sdkacctest.RandInt() resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, iot.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckThingTypeDestroy(ctx), @@ -48,7 +48,7 @@ func TestAccIoTThingType_full(t *testing.T) { rInt := sdkacctest.RandInt() resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, iot.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckThingTypeDestroy(ctx), @@ -86,7 +86,7 @@ func TestAccIoTThingType_tags(t *testing.T) { resourceName := "aws_iot_thing_type.foo" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, iot.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckThingTypeDestroy(ctx), diff --git a/internal/service/iot/topic_rule_destination_test.go b/internal/service/iot/topic_rule_destination_test.go index 5da203373c42..05f5164ece1f 100644 --- a/internal/service/iot/topic_rule_destination_test.go +++ b/internal/service/iot/topic_rule_destination_test.go @@ -22,7 +22,7 @@ func TestAccIoTTopicRuleDestination_basic(t *testing.T) { resourceName := "aws_iot_topic_rule_destination.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, iot.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTopicRuleDestinationDestroy(ctx), @@ -59,7 +59,7 @@ func TestAccIoTTopicRuleDestination_disappears(t *testing.T) { resourceName := "aws_iot_topic_rule_destination.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, iot.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTopicRuleDestinationDestroy(ctx), @@ -82,7 +82,7 @@ func TestAccIoTTopicRuleDestination_enabled(t *testing.T) { resourceName := "aws_iot_topic_rule_destination.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, iot.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTopicRuleDestinationDestroy(ctx), diff --git a/internal/service/iot/topic_rule_test.go b/internal/service/iot/topic_rule_test.go index f76b1cde13c5..1b0f44b16360 100644 --- a/internal/service/iot/topic_rule_test.go +++ b/internal/service/iot/topic_rule_test.go @@ -31,7 +31,7 @@ func TestAccIoTTopicRule_basic(t *testing.T) { resourceName := "aws_iot_topic_rule.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, iot.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTopicRuleDestroy(ctx), @@ -84,7 +84,7 @@ func TestAccIoTTopicRule_disappears(t *testing.T) { resourceName := "aws_iot_topic_rule.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, iot.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTopicRuleDestroy(ctx), @@ -107,7 +107,7 @@ func TestAccIoTTopicRule_tags(t *testing.T) { resourceName := "aws_iot_topic_rule.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, iot.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTopicRuleDestroy(ctx), @@ -152,7 +152,7 @@ func TestAccIoTTopicRule_cloudWatchAlarm(t *testing.T) { resourceName := "aws_iot_topic_rule.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, iot.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTopicRuleDestroy(ctx), @@ -204,7 +204,7 @@ func TestAccIoTTopicRule_cloudWatchLogs(t *testing.T) { resourceName := "aws_iot_topic_rule.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, iot.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTopicRuleDestroy(ctx), @@ -257,7 +257,7 @@ func TestAccIoTTopicRule_cloudWatchMetric(t *testing.T) { resourceName := "aws_iot_topic_rule.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, iot.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTopicRuleDestroy(ctx), @@ -309,7 +309,7 @@ func TestAccIoTTopicRule_dynamoDB(t *testing.T) { resourceName := "aws_iot_topic_rule.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, iot.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTopicRuleDestroy(ctx), @@ -399,7 +399,7 @@ func TestAccIoTTopicRule_dynamoDBv2(t *testing.T) { resourceName := "aws_iot_topic_rule.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, iot.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTopicRuleDestroy(ctx), @@ -444,7 +444,7 @@ func TestAccIoTTopicRule_elasticSearch(t *testing.T) { resourceName := "aws_iot_topic_rule.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, iot.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTopicRuleDestroy(ctx), @@ -495,7 +495,7 @@ func TestAccIoTTopicRule_firehose(t *testing.T) { resourceName := "aws_iot_topic_rule.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, iot.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTopicRuleDestroy(ctx), @@ -550,7 +550,7 @@ func TestAccIoTTopicRule_Firehose_separator(t *testing.T) { resourceName := "aws_iot_topic_rule.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, iot.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTopicRuleDestroy(ctx), @@ -630,7 +630,7 @@ func TestAccIoTTopicRule_http(t *testing.T) { resourceName := "aws_iot_topic_rule.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, iot.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTopicRuleDestroy(ctx), @@ -798,7 +798,7 @@ func TestAccIoTTopicRule_IoT_analytics(t *testing.T) { resourceName := "aws_iot_topic_rule.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, iot.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTopicRuleDestroy(ctx), @@ -842,7 +842,7 @@ func TestAccIoTTopicRule_IoT_events(t *testing.T) { resourceName := "aws_iot_topic_rule.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, iot.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTopicRuleDestroy(ctx), @@ -891,7 +891,7 @@ func TestAccIoTTopicRule_kafka(t *testing.T) { resourceName := "aws_iot_topic_rule.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, iot.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTopicRuleDestroy(ctx), @@ -952,7 +952,7 @@ func TestAccIoTTopicRule_kinesis(t *testing.T) { resourceName := "aws_iot_topic_rule.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, iot.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTopicRuleDestroy(ctx), @@ -1001,7 +1001,7 @@ func TestAccIoTTopicRule_lambda(t *testing.T) { resourceName := "aws_iot_topic_rule.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, iot.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTopicRuleDestroy(ctx), @@ -1047,7 +1047,7 @@ func TestAccIoTTopicRule_republish(t *testing.T) { resourceName := "aws_iot_topic_rule.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, iot.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTopicRuleDestroy(ctx), @@ -1097,7 +1097,7 @@ func TestAccIoTTopicRule_republishWithQos(t *testing.T) { resourceName := "aws_iot_topic_rule.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, iot.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTopicRuleDestroy(ctx), @@ -1147,7 +1147,7 @@ func TestAccIoTTopicRule_s3(t *testing.T) { resourceName := "aws_iot_topic_rule.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, iot.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTopicRuleDestroy(ctx), @@ -1198,7 +1198,7 @@ func TestAccIoTTopicRule_sns(t *testing.T) { resourceName := "aws_iot_topic_rule.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, iot.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTopicRuleDestroy(ctx), @@ -1244,7 +1244,7 @@ func TestAccIoTTopicRule_sqs(t *testing.T) { resourceName := "aws_iot_topic_rule.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, iot.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTopicRuleDestroy(ctx), @@ -1294,7 +1294,7 @@ func TestAccIoTTopicRule_Step_functions(t *testing.T) { resourceName := "aws_iot_topic_rule.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, iot.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTopicRuleDestroy(ctx), @@ -1344,7 +1344,7 @@ func TestAccIoTTopicRule_Timestream(t *testing.T) { resourceName := "aws_iot_topic_rule.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, iot.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTopicRuleDestroy(ctx), @@ -1402,7 +1402,7 @@ func TestAccIoTTopicRule_errorAction(t *testing.T) { resourceName := "aws_iot_topic_rule.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, iot.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTopicRuleDestroy(ctx), @@ -1472,7 +1472,7 @@ func TestAccIoTTopicRule_updateKinesisErrorAction(t *testing.T) { resourceName := "aws_iot_topic_rule.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, iot.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTopicRuleDestroy(ctx), From 49002362e986691bb9f37e5e8876e23eaa19223e Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Fri, 24 Feb 2023 16:37:04 -0500 Subject: [PATCH 172/763] Add 'Context' argument to 'acctest.PreCheck' for ivs. --- internal/service/ivs/channel_test.go | 10 +++++----- internal/service/ivs/playback_key_pair_test.go | 8 ++++---- internal/service/ivs/recording_configuration_test.go | 10 +++++----- internal/service/ivs/stream_key_data_source_test.go | 2 +- 4 files changed, 15 insertions(+), 15 deletions(-) diff --git a/internal/service/ivs/channel_test.go b/internal/service/ivs/channel_test.go index c04f68001e43..a179e7ebd2dc 100644 --- a/internal/service/ivs/channel_test.go +++ b/internal/service/ivs/channel_test.go @@ -28,7 +28,7 @@ func TestAccIVSChannel_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(names.IVS, t) testAccChannelPreCheck(ctx, t) }, @@ -64,7 +64,7 @@ func TestAccIVSChannel_tags(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(names.IVS, t) testAccChannelPreCheck(ctx, t) }, @@ -118,7 +118,7 @@ func TestAccIVSChannel_update(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(names.IVS, t) testAccChannelPreCheck(ctx, t) }, @@ -160,7 +160,7 @@ func TestAccIVSChannel_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(ivs.EndpointsID, t) testAccChannelPreCheck(ctx, t) }, @@ -189,7 +189,7 @@ func TestAccIVSChannel_recordingConfiguration(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(ivs.EndpointsID, t) testAccChannelPreCheck(ctx, t) }, diff --git a/internal/service/ivs/playback_key_pair_test.go b/internal/service/ivs/playback_key_pair_test.go index 7471e4e2787f..230d2bd1a970 100644 --- a/internal/service/ivs/playback_key_pair_test.go +++ b/internal/service/ivs/playback_key_pair_test.go @@ -35,7 +35,7 @@ func testAccPlaybackKeyPair_basic(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(ivs.EndpointsID, t) testAccPlaybackKeyPairPreCheck(ctx, t) }, @@ -76,7 +76,7 @@ func testAccPlaybackKeyPair_update(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(ivs.EndpointsID, t) testAccPlaybackKeyPairPreCheck(ctx, t) }, @@ -115,7 +115,7 @@ func testAccPlaybackKeyPair_tags(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(ivs.EndpointsID, t) testAccPlaybackKeyPairPreCheck(ctx, t) }, @@ -167,7 +167,7 @@ func testAccPlaybackKeyPair_disappears(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(ivs.EndpointsID, t) testAccPlaybackKeyPairPreCheck(ctx, t) }, diff --git a/internal/service/ivs/recording_configuration_test.go b/internal/service/ivs/recording_configuration_test.go index 2f1da2e62a99..f65e2bc8374f 100644 --- a/internal/service/ivs/recording_configuration_test.go +++ b/internal/service/ivs/recording_configuration_test.go @@ -29,7 +29,7 @@ func TestAccIVSRecordingConfiguration_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(ivs.EndpointsID, t) testAccRecordingConfigurationPreCheck(ctx, t) }, @@ -71,7 +71,7 @@ func TestAccIVSRecordingConfiguration_update(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(ivs.EndpointsID, t) testAccRecordingConfigurationPreCheck(ctx, t) }, @@ -116,7 +116,7 @@ func TestAccIVSRecordingConfiguration_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(ivs.EndpointsID, t) testAccRecordingConfigurationPreCheck(ctx, t) }, @@ -145,7 +145,7 @@ func TestAccIVSRecordingConfiguration_disappears_S3Bucket(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(ivs.EndpointsID, t) testAccRecordingConfigurationPreCheck(ctx, t) }, @@ -173,7 +173,7 @@ func TestAccIVSRecordingConfiguration_tags(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(ivs.EndpointsID, t) testAccRecordingConfigurationPreCheck(ctx, t) }, diff --git a/internal/service/ivs/stream_key_data_source_test.go b/internal/service/ivs/stream_key_data_source_test.go index 17415cae7bdd..3cb5180161c4 100644 --- a/internal/service/ivs/stream_key_data_source_test.go +++ b/internal/service/ivs/stream_key_data_source_test.go @@ -16,7 +16,7 @@ func TestAccIVSStreamKeyDataSource_basic(t *testing.T) { channelResourceName := "aws_ivs_channel.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ivs.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ From 2fc67eb34229014c95088e4f451c1f0cfdc28c8b Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Fri, 24 Feb 2023 16:37:04 -0500 Subject: [PATCH 173/763] Add 'Context' argument to 'acctest.PreCheck' for ivschat. --- .../service/ivschat/logging_configuration_test.go | 14 +++++++------- internal/service/ivschat/room_test.go | 12 ++++++------ 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/internal/service/ivschat/logging_configuration_test.go b/internal/service/ivschat/logging_configuration_test.go index ddf75ee40ce1..12c7d53fce94 100644 --- a/internal/service/ivschat/logging_configuration_test.go +++ b/internal/service/ivschat/logging_configuration_test.go @@ -27,7 +27,7 @@ func TestAccIVSChatLoggingConfiguration_basic_cloudwatch(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(names.IVSChatEndpointID, t) testAccPreCheck(ctx, t) }, @@ -66,7 +66,7 @@ func TestAccIVSChatLoggingConfiguration_basic_firehose(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(names.IVSChatEndpointID, t) testAccPreCheck(ctx, t) }, @@ -101,7 +101,7 @@ func TestAccIVSChatLoggingConfiguration_basic_s3(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(names.IVSChatEndpointID, t) testAccPreCheck(ctx, t) }, @@ -136,7 +136,7 @@ func TestAccIVSChatLoggingConfiguration_update_s3(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(names.IVSChatEndpointID, t) testAccPreCheck(ctx, t) }, @@ -175,7 +175,7 @@ func TestAccIVSChatLoggingConfiguration_tags(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(names.IVSChatEndpointID, t) testAccPreCheck(ctx, t) }, @@ -223,7 +223,7 @@ func TestAccIVSChatLoggingConfiguration_failure_invalidDestination(t *testing.T) ctx := acctest.Context(t) resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(names.IVSChatEndpointID, t) testAccPreCheck(ctx, t) }, @@ -267,7 +267,7 @@ func TestAccIVSChatLoggingConfiguration_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(names.IVSChatEndpointID, t) testAccPreCheck(ctx, t) }, diff --git a/internal/service/ivschat/room_test.go b/internal/service/ivschat/room_test.go index d67f083798c5..fc9a07862f3e 100644 --- a/internal/service/ivschat/room_test.go +++ b/internal/service/ivschat/room_test.go @@ -27,7 +27,7 @@ func TestAccIVSChatRoom_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(names.IVSChatEndpointID, t) testAccPreCheckRoom(ctx, t) }, @@ -61,7 +61,7 @@ func TestAccIVSChatRoom_tags(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(names.IVSChatEndpointID, t) testAccPreCheckRoom(ctx, t) }, @@ -110,7 +110,7 @@ func TestAccIVSChatRoom_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(names.IVSChatEndpointID, t) testAccPreCheckRoom(ctx, t) }, @@ -141,7 +141,7 @@ func TestAccIVSChatRoom_update(t *testing.T) { fallbackResult := "DENY" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(names.IVSChatEndpointID, t) testAccPreCheckRoom(ctx, t) }, @@ -184,7 +184,7 @@ func TestAccIVSChatRoom_loggingConfiguration(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(names.IVSChatEndpointID, t) testAccPreCheckRoom(ctx, t) }, @@ -244,7 +244,7 @@ func TestAccIVSChatRoom_update_remove_messageReviewHandler_uri(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(names.IVSChatEndpointID, t) testAccPreCheckRoom(ctx, t) }, From 22754c3ac30ee739b6a2477733c8f86374b9225d Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Fri, 24 Feb 2023 16:37:04 -0500 Subject: [PATCH 174/763] Add 'Context' argument to 'acctest.PreCheck' for kafka. --- .../kafka/broker_nodes_data_source_test.go | 2 +- .../service/kafka/cluster_data_source_test.go | 2 +- internal/service/kafka/cluster_test.go | 48 +++++++++---------- .../kafka/configuration_data_source_test.go | 2 +- internal/service/kafka/configuration_test.go | 10 ++-- .../kafka/kafka_version_data_source_test.go | 4 +- .../kafka/scram_secret_association_test.go | 8 ++-- .../service/kafka/serverless_cluster_test.go | 8 ++-- 8 files changed, 42 insertions(+), 42 deletions(-) diff --git a/internal/service/kafka/broker_nodes_data_source_test.go b/internal/service/kafka/broker_nodes_data_source_test.go index daee4001854d..a789841be385 100644 --- a/internal/service/kafka/broker_nodes_data_source_test.go +++ b/internal/service/kafka/broker_nodes_data_source_test.go @@ -17,7 +17,7 @@ func TestAccKafkaBrokerNodesDataSource_basic(t *testing.T) { resourceName := "aws_msk_cluster.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, kafka.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClusterDestroy(ctx), diff --git a/internal/service/kafka/cluster_data_source_test.go b/internal/service/kafka/cluster_data_source_test.go index 6a0177eb530d..951f89d08100 100644 --- a/internal/service/kafka/cluster_data_source_test.go +++ b/internal/service/kafka/cluster_data_source_test.go @@ -17,7 +17,7 @@ func TestAccKafkaClusterDataSource_basic(t *testing.T) { resourceName := "aws_msk_cluster.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, kafka.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClusterDestroy(ctx), diff --git a/internal/service/kafka/cluster_test.go b/internal/service/kafka/cluster_test.go index 62f5e4b21a42..58d1b5bddf12 100644 --- a/internal/service/kafka/cluster_test.go +++ b/internal/service/kafka/cluster_test.go @@ -52,7 +52,7 @@ func TestAccKafkaCluster_basic(t *testing.T) { resourceName := "aws_msk_cluster.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, kafka.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClusterDestroy(ctx), @@ -119,7 +119,7 @@ func TestAccKafkaCluster_disappears(t *testing.T) { resourceName := "aws_msk_cluster.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, kafka.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClusterDestroy(ctx), @@ -143,7 +143,7 @@ func TestAccKafkaCluster_tags(t *testing.T) { resourceName := "aws_msk_cluster.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, kafka.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClusterDestroy(ctx), @@ -192,7 +192,7 @@ func TestAccKafkaCluster_BrokerNodeGroupInfo_ebsVolumeSize(t *testing.T) { resourceName := "aws_msk_cluster.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, kafka.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClusterDestroy(ctx), @@ -236,7 +236,7 @@ func TestAccKafkaCluster_BrokerNodeGroupInfo_storageInfo(t *testing.T) { updated_volume_size := 112 resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, kafka.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClusterDestroy(ctx), @@ -291,7 +291,7 @@ func TestAccKafkaCluster_BrokerNodeGroupInfo_modifyEBSVolumeSizeToStorageInfo(t updated_volume_size := 112 resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, kafka.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClusterDestroy(ctx), @@ -336,7 +336,7 @@ func TestAccKafkaCluster_BrokerNodeGroupInfo_instanceType(t *testing.T) { resourceName := "aws_msk_cluster.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, kafka.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClusterDestroy(ctx), @@ -379,7 +379,7 @@ func TestAccKafkaCluster_BrokerNodeGroupInfo_publicAccessSASLIAM(t *testing.T) { resourceName := "aws_msk_cluster.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, kafka.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClusterDestroy(ctx), @@ -449,7 +449,7 @@ func TestAccKafkaCluster_ClientAuthenticationSASL_scram(t *testing.T) { resourceName := "aws_msk_cluster.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, kafka.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClusterDestroy(ctx), @@ -514,7 +514,7 @@ func TestAccKafkaCluster_ClientAuthenticationSASL_iam(t *testing.T) { resourceName := "aws_msk_cluster.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, kafka.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClusterDestroy(ctx), @@ -582,7 +582,7 @@ func TestAccKafkaCluster_ClientAuthenticationTLS_certificateAuthorityARNs(t *tes commonName := acctest.RandomDomainName() resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, kafka.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClusterDestroy(ctx), @@ -643,7 +643,7 @@ func TestAccKafkaCluster_ClientAuthenticationTLS_initiallyNoAuthentication(t *te commonName := acctest.RandomDomainName() resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, kafka.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClusterDestroy(ctx), @@ -715,7 +715,7 @@ func TestAccKafkaCluster_Info_revision(t *testing.T) { resourceName := "aws_msk_cluster.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, kafka.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClusterDestroy(ctx), @@ -758,7 +758,7 @@ func TestAccKafkaCluster_EncryptionInfo_encryptionAtRestKMSKeyARN(t *testing.T) resourceName := "aws_msk_cluster.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, kafka.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClusterDestroy(ctx), @@ -789,7 +789,7 @@ func TestAccKafkaCluster_EncryptionInfoEncryptionInTransit_clientBroker(t *testi resourceName := "aws_msk_cluster.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, kafka.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClusterDestroy(ctx), @@ -826,7 +826,7 @@ func TestAccKafkaCluster_EncryptionInfoEncryptionInTransit_inCluster(t *testing. resourceName := "aws_msk_cluster.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, kafka.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClusterDestroy(ctx), @@ -859,7 +859,7 @@ func TestAccKafkaCluster_enhancedMonitoring(t *testing.T) { resourceName := "aws_msk_cluster.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, kafka.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClusterDestroy(ctx), @@ -898,7 +898,7 @@ func TestAccKafkaCluster_numberOfBrokerNodes(t *testing.T) { resourceName := "aws_msk_cluster.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, kafka.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClusterDestroy(ctx), @@ -955,7 +955,7 @@ func TestAccKafkaCluster_openMonitoring(t *testing.T) { resourceName := "aws_msk_cluster.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, kafka.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClusterDestroy(ctx), @@ -1004,7 +1004,7 @@ func TestAccKafkaCluster_storageMode(t *testing.T) { resourceName := "aws_msk_cluster.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, kafka.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClusterDestroy(ctx), @@ -1028,7 +1028,7 @@ func TestAccKafkaCluster_loggingInfo(t *testing.T) { resourceName := "aws_msk_cluster.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, kafka.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClusterDestroy(ctx), @@ -1081,7 +1081,7 @@ func TestAccKafkaCluster_kafkaVersionUpgrade(t *testing.T) { resourceName := "aws_msk_cluster.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, kafka.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClusterDestroy(ctx), @@ -1120,7 +1120,7 @@ func TestAccKafkaCluster_kafkaVersionDowngrade(t *testing.T) { resourceName := "aws_msk_cluster.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, kafka.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClusterDestroy(ctx), @@ -1171,7 +1171,7 @@ func TestAccKafkaCluster_kafkaVersionUpgradeWithInfo(t *testing.T) { resourceName := "aws_msk_cluster.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, kafka.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClusterDestroy(ctx), diff --git a/internal/service/kafka/configuration_data_source_test.go b/internal/service/kafka/configuration_data_source_test.go index af498345285f..0e3be334d355 100644 --- a/internal/service/kafka/configuration_data_source_test.go +++ b/internal/service/kafka/configuration_data_source_test.go @@ -17,7 +17,7 @@ func TestAccKafkaConfigurationDataSource_name(t *testing.T) { resourceName := "aws_msk_configuration.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, kafka.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckConfigurationDestroy(ctx), diff --git a/internal/service/kafka/configuration_test.go b/internal/service/kafka/configuration_test.go index 0054aa7832d0..d28fe3a117c5 100644 --- a/internal/service/kafka/configuration_test.go +++ b/internal/service/kafka/configuration_test.go @@ -24,7 +24,7 @@ func TestAccKafkaConfiguration_basic(t *testing.T) { resourceName := "aws_msk_configuration.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, kafka.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckConfigurationDestroy(ctx), @@ -57,7 +57,7 @@ func TestAccKafkaConfiguration_disappears(t *testing.T) { resourceName := "aws_msk_configuration.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, kafka.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckConfigurationDestroy(ctx), @@ -81,7 +81,7 @@ func TestAccKafkaConfiguration_description(t *testing.T) { resourceName := "aws_msk_configuration.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, kafka.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckConfigurationDestroy(ctx), @@ -117,7 +117,7 @@ func TestAccKafkaConfiguration_kafkaVersions(t *testing.T) { resourceName := "aws_msk_configuration.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, kafka.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckConfigurationDestroy(ctx), @@ -149,7 +149,7 @@ func TestAccKafkaConfiguration_serverProperties(t *testing.T) { serverProperty2 := "auto.create.topics.enable = true" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, kafka.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckConfigurationDestroy(ctx), diff --git a/internal/service/kafka/kafka_version_data_source_test.go b/internal/service/kafka/kafka_version_data_source_test.go index 8a2e7296302f..94d870d069ac 100644 --- a/internal/service/kafka/kafka_version_data_source_test.go +++ b/internal/service/kafka/kafka_version_data_source_test.go @@ -17,7 +17,7 @@ func TestAccKafkaKafkaVersionDataSource_basic(t *testing.T) { version := "2.4.1.1" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccVersionPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccVersionPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, kafka.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: nil, @@ -38,7 +38,7 @@ func TestAccKafkaKafkaVersionDataSource_preferred(t *testing.T) { dataSourceName := "data.aws_msk_kafka_version.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccVersionPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccVersionPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, kafka.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: nil, diff --git a/internal/service/kafka/scram_secret_association_test.go b/internal/service/kafka/scram_secret_association_test.go index 6dbc075ce423..ede182508c8d 100644 --- a/internal/service/kafka/scram_secret_association_test.go +++ b/internal/service/kafka/scram_secret_association_test.go @@ -24,7 +24,7 @@ func TestAccKafkaScramSecretAssociation_basic(t *testing.T) { secretResourceName := "aws_secretsmanager_secret.test.0" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, kafka.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckScramSecretAssociationDestroy(ctx), @@ -56,7 +56,7 @@ func TestAccKafkaScramSecretAssociation_update(t *testing.T) { secretResourceName3 := "aws_secretsmanager_secret.test.2" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, kafka.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckScramSecretAssociationDestroy(ctx), @@ -101,7 +101,7 @@ func TestAccKafkaScramSecretAssociation_disappears(t *testing.T) { resourceName := "aws_msk_scram_secret_association.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, kafka.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckScramSecretAssociationDestroy(ctx), @@ -125,7 +125,7 @@ func TestAccKafkaScramSecretAssociation_Disappears_cluster(t *testing.T) { clusterResourceName := "aws_msk_cluster.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, kafka.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckScramSecretAssociationDestroy(ctx), diff --git a/internal/service/kafka/serverless_cluster_test.go b/internal/service/kafka/serverless_cluster_test.go index da15a7537e94..b7c4425d25b1 100644 --- a/internal/service/kafka/serverless_cluster_test.go +++ b/internal/service/kafka/serverless_cluster_test.go @@ -23,7 +23,7 @@ func TestAccKafkaServerlessCluster_basic(t *testing.T) { resourceName := "aws_msk_serverless_cluster.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, kafka.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckServerlessClusterDestroy(ctx), @@ -60,7 +60,7 @@ func TestAccKafkaServerlessCluster_disappears(t *testing.T) { resourceName := "aws_msk_serverless_cluster.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, kafka.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckServerlessClusterDestroy(ctx), @@ -84,7 +84,7 @@ func TestAccKafkaServerlessCluster_tags(t *testing.T) { resourceName := "aws_msk_serverless_cluster.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, kafka.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckServerlessClusterDestroy(ctx), @@ -130,7 +130,7 @@ func TestAccKafkaServerlessCluster_securityGroup(t *testing.T) { resourceName := "aws_msk_serverless_cluster.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, kafka.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckServerlessClusterDestroy(ctx), From f7e88c2f15746f85190ac32cdff24a1048c038f5 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Fri, 24 Feb 2023 16:37:05 -0500 Subject: [PATCH 175/763] Add 'Context' argument to 'acctest.PreCheck' for kafkaconnect. --- .../service/kafkaconnect/connector_data_source_test.go | 2 +- internal/service/kafkaconnect/connector_test.go | 6 +++--- .../kafkaconnect/custom_plugin_data_source_test.go | 2 +- internal/service/kafkaconnect/custom_plugin_test.go | 8 ++++---- .../kafkaconnect/worker_configuration_data_source_test.go | 2 +- .../service/kafkaconnect/worker_configuration_test.go | 4 ++-- 6 files changed, 12 insertions(+), 12 deletions(-) diff --git a/internal/service/kafkaconnect/connector_data_source_test.go b/internal/service/kafkaconnect/connector_data_source_test.go index d7539ad4b869..68e5aa634168 100644 --- a/internal/service/kafkaconnect/connector_data_source_test.go +++ b/internal/service/kafkaconnect/connector_data_source_test.go @@ -15,7 +15,7 @@ func TestAccKafkaConnectConnectorDataSource_basic(t *testing.T) { dataSourceName := "data.aws_mskconnect_connector.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(kafkaconnect.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(kafkaconnect.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, kafkaconnect.EndpointsID), CheckDestroy: nil, ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, diff --git a/internal/service/kafkaconnect/connector_test.go b/internal/service/kafkaconnect/connector_test.go index 1a3fbc3b03bf..55c464787bf8 100644 --- a/internal/service/kafkaconnect/connector_test.go +++ b/internal/service/kafkaconnect/connector_test.go @@ -21,7 +21,7 @@ func TestAccKafkaConnectConnector_basic(t *testing.T) { resourceName := "aws_mskconnect_connector.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(kafkaconnect.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(kafkaconnect.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, kafkaconnect.EndpointsID), CheckDestroy: testAccCheckConnectorDestroy(ctx), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, @@ -83,7 +83,7 @@ func TestAccKafkaConnectConnector_disappears(t *testing.T) { resourceName := "aws_mskconnect_connector.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(kafkaconnect.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(kafkaconnect.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, kafkaconnect.EndpointsID), CheckDestroy: testAccCheckConnectorDestroy(ctx), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, @@ -106,7 +106,7 @@ func TestAccKafkaConnectConnector_update(t *testing.T) { resourceName := "aws_mskconnect_connector.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(kafkaconnect.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(kafkaconnect.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, kafkaconnect.EndpointsID), CheckDestroy: testAccCheckConnectorDestroy(ctx), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, diff --git a/internal/service/kafkaconnect/custom_plugin_data_source_test.go b/internal/service/kafkaconnect/custom_plugin_data_source_test.go index b6a8985cdf12..abb39bd02783 100644 --- a/internal/service/kafkaconnect/custom_plugin_data_source_test.go +++ b/internal/service/kafkaconnect/custom_plugin_data_source_test.go @@ -16,7 +16,7 @@ func TestAccKafkaConnectCustomPluginDataSource_basic(t *testing.T) { dataSourceName := "data.aws_mskconnect_custom_plugin.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(kafkaconnect.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(kafkaconnect.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, kafkaconnect.EndpointsID), CheckDestroy: nil, ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, diff --git a/internal/service/kafkaconnect/custom_plugin_test.go b/internal/service/kafkaconnect/custom_plugin_test.go index 84c66784047a..440708137061 100644 --- a/internal/service/kafkaconnect/custom_plugin_test.go +++ b/internal/service/kafkaconnect/custom_plugin_test.go @@ -21,7 +21,7 @@ func TestAccKafkaConnectCustomPlugin_basic(t *testing.T) { resourceName := "aws_mskconnect_custom_plugin.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(kafkaconnect.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(kafkaconnect.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, kafkaconnect.EndpointsID), CheckDestroy: testAccCheckCustomPluginDestroy(ctx), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, @@ -58,7 +58,7 @@ func TestAccKafkaConnectCustomPlugin_disappears(t *testing.T) { resourceName := "aws_mskconnect_custom_plugin.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(kafkaconnect.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(kafkaconnect.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, kafkaconnect.EndpointsID), CheckDestroy: testAccCheckCustomPluginDestroy(ctx), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, @@ -81,7 +81,7 @@ func TestAccKafkaConnectCustomPlugin_description(t *testing.T) { resourceName := "aws_mskconnect_custom_plugin.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(kafkaconnect.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(kafkaconnect.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, kafkaconnect.EndpointsID), CheckDestroy: testAccCheckCustomPluginDestroy(ctx), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, @@ -108,7 +108,7 @@ func TestAccKafkaConnectCustomPlugin_objectVersion(t *testing.T) { resourceName := "aws_mskconnect_custom_plugin.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(kafkaconnect.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(kafkaconnect.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, kafkaconnect.EndpointsID), CheckDestroy: testAccCheckCustomPluginDestroy(ctx), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, diff --git a/internal/service/kafkaconnect/worker_configuration_data_source_test.go b/internal/service/kafkaconnect/worker_configuration_data_source_test.go index 9b68ab590481..d0683cfe3f8b 100644 --- a/internal/service/kafkaconnect/worker_configuration_data_source_test.go +++ b/internal/service/kafkaconnect/worker_configuration_data_source_test.go @@ -16,7 +16,7 @@ func TestAccKafkaConnectWorkerConfigurationDataSource_basic(t *testing.T) { dataSourceName := "data.aws_mskconnect_worker_configuration.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(kafkaconnect.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(kafkaconnect.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, kafkaconnect.EndpointsID), CheckDestroy: nil, ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, diff --git a/internal/service/kafkaconnect/worker_configuration_test.go b/internal/service/kafkaconnect/worker_configuration_test.go index 0629d9a67058..8507aa0f0855 100644 --- a/internal/service/kafkaconnect/worker_configuration_test.go +++ b/internal/service/kafkaconnect/worker_configuration_test.go @@ -20,7 +20,7 @@ func TestAccKafkaConnectWorkerConfiguration_basic(t *testing.T) { resourceName := "aws_mskconnect_worker_configuration.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(kafkaconnect.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(kafkaconnect.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, kafkaconnect.EndpointsID), CheckDestroy: nil, ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, @@ -50,7 +50,7 @@ func TestAccKafkaConnectWorkerConfiguration_description(t *testing.T) { resourceName := "aws_mskconnect_worker_configuration.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(kafkaconnect.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(kafkaconnect.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, kafkaconnect.EndpointsID), CheckDestroy: nil, ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, From d032950301aa16131275b7b477d9ad0460bc33dc Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Fri, 24 Feb 2023 16:37:05 -0500 Subject: [PATCH 176/763] Add 'Context' argument to 'acctest.PreCheck' for kendra. --- internal/service/kendra/data_source_test.go | 58 +++++++++---------- .../kendra/experience_data_source_test.go | 2 +- internal/service/kendra/experience_test.go | 24 ++++---- .../service/kendra/faq_data_source_test.go | 2 +- internal/service/kendra/faq_test.go | 12 ++-- .../service/kendra/index_data_source_test.go | 2 +- internal/service/kendra/index_test.go | 22 +++---- ...suggestions_block_list_data_source_test.go | 2 +- .../query_suggestions_block_list_test.go | 14 ++--- .../kendra/thesaurus_data_source_test.go | 2 +- internal/service/kendra/thesaurus_test.go | 14 ++--- 11 files changed, 77 insertions(+), 77 deletions(-) diff --git a/internal/service/kendra/data_source_test.go b/internal/service/kendra/data_source_test.go index 257a23034da5..1beb69e9b393 100644 --- a/internal/service/kendra/data_source_test.go +++ b/internal/service/kendra/data_source_test.go @@ -31,7 +31,7 @@ func TestAccKendraDataSource_basic(t *testing.T) { resourceName := "aws_kendra_data_source.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, names.KendraEndpointID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDataSourceDestroy(ctx), @@ -72,7 +72,7 @@ func TestAccKendraDataSource_disappears(t *testing.T) { resourceName := "aws_kendra_data_source.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, names.KendraEndpointID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDataSourceDestroy(ctx), @@ -103,7 +103,7 @@ func TestAccKendraDataSource_name(t *testing.T) { resourceName := "aws_kendra_data_source.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, names.KendraEndpointID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDataSourceDestroy(ctx), @@ -146,7 +146,7 @@ func TestAccKendraDataSource_description(t *testing.T) { resourceName := "aws_kendra_data_source.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, names.KendraEndpointID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDataSourceDestroy(ctx), @@ -205,7 +205,7 @@ func TestAccKendraDataSource_languageCode(t *testing.T) { resourceName := "aws_kendra_data_source.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, names.KendraEndpointID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDataSourceDestroy(ctx), @@ -249,7 +249,7 @@ func TestAccKendraDataSource_roleARN(t *testing.T) { resourceName := "aws_kendra_data_source.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, names.KendraEndpointID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDataSourceDestroy(ctx), @@ -296,7 +296,7 @@ func TestAccKendraDataSource_schedule(t *testing.T) { resourceName := "aws_kendra_data_source.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, names.KendraEndpointID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDataSourceDestroy(ctx), @@ -339,7 +339,7 @@ func TestAccKendraDataSource_tags(t *testing.T) { resourceName := "aws_kendra_data_source.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, names.KendraEndpointID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDataSourceDestroy(ctx), @@ -391,7 +391,7 @@ func TestAccKendraDataSource_typeCustomCustomizeDiff(t *testing.T) { rName5 := sdkacctest.RandomWithPrefix("resource-test-terraform") resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, names.KendraEndpointID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDataSourceDestroy(ctx), @@ -429,7 +429,7 @@ func TestAccKendraDataSource_Configuration_S3_Bucket(t *testing.T) { resourceName := "aws_kendra_data_source.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, names.KendraEndpointID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDataSourceDestroy(ctx), @@ -480,7 +480,7 @@ func TestAccKendraDataSource_Configuration_S3_AccessControlList(t *testing.T) { resourceName := "aws_kendra_data_source.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, names.KendraEndpointID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDataSourceDestroy(ctx), @@ -537,7 +537,7 @@ func TestAccKendraDataSource_Configuration_S3_DocumentsMetadataConfiguration(t * resourceName := "aws_kendra_data_source.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, names.KendraEndpointID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDataSourceDestroy(ctx), @@ -592,7 +592,7 @@ func TestAccKendraDataSource_Configuration_S3_ExclusionInclusionPatternsPrefixes resourceName := "aws_kendra_data_source.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, names.KendraEndpointID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDataSourceDestroy(ctx), @@ -657,7 +657,7 @@ func TestAccKendraDataSource_Configuration_WebCrawler_URLsSeedURLs(t *testing.T) resourceName := "aws_kendra_data_source.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, names.KendraEndpointID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDataSourceDestroy(ctx), @@ -725,7 +725,7 @@ func TestAccKendraDataSource_Configuration_WebCrawler_URLsWebCrawlerMode(t *test updatedWebCrawlerMode := string(types.WebCrawlerModeSubdomains) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, names.KendraEndpointID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDataSourceDestroy(ctx), @@ -789,7 +789,7 @@ func TestAccKendraDataSource_Configuration_WebCrawler_AuthenticationConfiguratio port2 := 456 resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, names.KendraEndpointID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDataSourceDestroy(ctx), @@ -858,7 +858,7 @@ func TestAccKendraDataSource_Configuration_WebCrawler_AuthenticationConfiguratio resourceName := "aws_kendra_data_source.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, names.KendraEndpointID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDataSourceDestroy(ctx), @@ -914,7 +914,7 @@ func TestAccKendraDataSource_Configuration_WebCrawler_CrawlDepth(t *testing.T) { updatedCrawlDepth := 4 resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, names.KendraEndpointID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDataSourceDestroy(ctx), @@ -964,7 +964,7 @@ func TestAccKendraDataSource_Configuration_WebCrawler_MaxLinksPerPage(t *testing updatedMaxLinksPerPage := 110 resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, names.KendraEndpointID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDataSourceDestroy(ctx), @@ -1014,7 +1014,7 @@ func TestAccKendraDataSource_Configuration_WebCrawler_MaxURLsPerMinuteCrawlRate( updatedMaxUrlsPerMinuteCrawlRate := 250 resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, names.KendraEndpointID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDataSourceDestroy(ctx), @@ -1067,7 +1067,7 @@ func TestAccKendraDataSource_Configuration_WebCrawler_ProxyConfigurationCredenti originalPort1 := 123 resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, names.KendraEndpointID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDataSourceDestroy(ctx), @@ -1133,7 +1133,7 @@ func TestAccKendraDataSource_Configuration_WebCrawler_ProxyConfigurationHostPort updatedPort1 := 234 resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, names.KendraEndpointID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDataSourceDestroy(ctx), @@ -1191,7 +1191,7 @@ func TestAccKendraDataSource_Configuration_WebCrawler_URLExclusionInclusionPatte resourceName := "aws_kendra_data_source.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, names.KendraEndpointID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDataSourceDestroy(ctx), @@ -1247,7 +1247,7 @@ func TestAccKendraDataSource_Configuration_WebCrawler_URLsSiteMaps(t *testing.T) resourceName := "aws_kendra_data_source.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, names.KendraEndpointID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDataSourceDestroy(ctx), @@ -1303,7 +1303,7 @@ func TestAccKendraDataSource_CustomDocumentEnrichmentConfiguration_InlineConfigu resourceName := "aws_kendra_data_source.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, names.KendraEndpointID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDataSourceDestroy(ctx), @@ -1477,7 +1477,7 @@ func TestAccKendraDataSource_CustomDocumentEnrichmentConfiguration_ExtractionHoo resourceName := "aws_kendra_data_source.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, names.KendraEndpointID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDataSourceDestroy(ctx), @@ -1568,7 +1568,7 @@ func TestAccKendraDataSource_CustomDocumentEnrichmentConfiguration_ExtractionHoo resourceName := "aws_kendra_data_source.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, names.KendraEndpointID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDataSourceDestroy(ctx), @@ -1645,7 +1645,7 @@ func TestAccKendraDataSource_CustomDocumentEnrichmentConfiguration_ExtractionHoo resourceName := "aws_kendra_data_source.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, names.KendraEndpointID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDataSourceDestroy(ctx), @@ -1722,7 +1722,7 @@ func TestAccKendraDataSource_CustomDocumentEnrichmentConfiguration_ExtractionHoo resourceName := "aws_kendra_data_source.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, names.KendraEndpointID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDataSourceDestroy(ctx), diff --git a/internal/service/kendra/experience_data_source_test.go b/internal/service/kendra/experience_data_source_test.go index 3373dfa668f8..6116f07ef1ec 100644 --- a/internal/service/kendra/experience_data_source_test.go +++ b/internal/service/kendra/experience_data_source_test.go @@ -24,7 +24,7 @@ func TestAccKendraExperienceDataSource_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckOrganizationManagementAccount(ctx, t) testAccPreCheck(ctx, t) }, diff --git a/internal/service/kendra/experience_test.go b/internal/service/kendra/experience_test.go index d522db4a4a6c..c35ab37ba08a 100644 --- a/internal/service/kendra/experience_test.go +++ b/internal/service/kendra/experience_test.go @@ -28,7 +28,7 @@ func TestAccKendraExperience_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckOrganizationManagementAccount(ctx, t) testAccPreCheck(ctx, t) }, @@ -70,7 +70,7 @@ func TestAccKendraExperience_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckOrganizationManagementAccount(ctx, t) testAccPreCheck(ctx, t) }, @@ -101,7 +101,7 @@ func TestAccKendraExperience_Description(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckOrganizationManagementAccount(ctx, t) testAccPreCheck(ctx, t) }, @@ -159,7 +159,7 @@ func TestAccKendraExperience_Name(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckOrganizationManagementAccount(ctx, t) testAccPreCheck(ctx, t) }, @@ -206,7 +206,7 @@ func TestAccKendraExperience_roleARN(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckOrganizationManagementAccount(ctx, t) testAccPreCheck(ctx, t) }, @@ -253,7 +253,7 @@ func TestAccKendraExperience_Configuration_ContentSourceConfiguration_DirectPutC resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckOrganizationManagementAccount(ctx, t) testAccPreCheck(ctx, t) }, @@ -308,7 +308,7 @@ func TestAccKendraExperience_Configuration_ContentSourceConfiguration_FaqIDs(t * resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckOrganizationManagementAccount(ctx, t) testAccPreCheck(ctx, t) }, @@ -347,7 +347,7 @@ func TestAccKendraExperience_Configuration_ContentSourceConfiguration_updateFaqI resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckOrganizationManagementAccount(ctx, t) testAccPreCheck(ctx, t) }, @@ -401,7 +401,7 @@ func TestAccKendraExperience_Configuration_UserIdentityConfiguration(t *testing. resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckOrganizationManagementAccount(ctx, t) testAccPreCheck(ctx, t) }, @@ -443,7 +443,7 @@ func TestAccKendraExperience_Configuration_ContentSourceConfigurationAndUserIden resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckOrganizationManagementAccount(ctx, t) testAccPreCheck(ctx, t) }, @@ -487,7 +487,7 @@ func TestAccKendraExperience_Configuration_ContentSourceConfigurationWithUserIde resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckOrganizationManagementAccount(ctx, t) testAccPreCheck(ctx, t) }, @@ -541,7 +541,7 @@ func TestAccKendraExperience_Configuration_UserIdentityConfigurationWithContentS resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckOrganizationManagementAccount(ctx, t) testAccPreCheck(ctx, t) }, diff --git a/internal/service/kendra/faq_data_source_test.go b/internal/service/kendra/faq_data_source_test.go index c12d89223a88..9af8adf828cf 100644 --- a/internal/service/kendra/faq_data_source_test.go +++ b/internal/service/kendra/faq_data_source_test.go @@ -22,7 +22,7 @@ func TestAccKendraFaqDataSource_basic(t *testing.T) { rName5 := sdkacctest.RandomWithPrefix("resource-test-terraform") resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, backup.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ diff --git a/internal/service/kendra/faq_test.go b/internal/service/kendra/faq_test.go index c6455990d27a..cc192adb4ee4 100644 --- a/internal/service/kendra/faq_test.go +++ b/internal/service/kendra/faq_test.go @@ -31,7 +31,7 @@ func TestAccKendraFaq_basic(t *testing.T) { resourceName := "aws_kendra_faq.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, names.KendraEndpointID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckFaqDestroy(ctx), @@ -78,7 +78,7 @@ func TestAccKendraFaq_description(t *testing.T) { resourceName := "aws_kendra_faq.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, names.KendraEndpointID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckFaqDestroy(ctx), @@ -114,7 +114,7 @@ func TestAccKendraFaq_fileFormat(t *testing.T) { resourceName := "aws_kendra_faq.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, names.KendraEndpointID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckFaqDestroy(ctx), @@ -150,7 +150,7 @@ func TestAccKendraFaq_languageCode(t *testing.T) { resourceName := "aws_kendra_faq.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, names.KendraEndpointID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckFaqDestroy(ctx), @@ -185,7 +185,7 @@ func TestAccKendraFaq_tags(t *testing.T) { resourceName := "aws_kendra_faq.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, names.KendraEndpointID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckFaqDestroy(ctx), @@ -238,7 +238,7 @@ func TestAccKendraFaq_disappears(t *testing.T) { resourceName := "aws_kendra_faq.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, names.KendraEndpointID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckFaqDestroy(ctx), diff --git a/internal/service/kendra/index_data_source_test.go b/internal/service/kendra/index_data_source_test.go index 3f4e8fa0dffc..50cccbeb67cc 100644 --- a/internal/service/kendra/index_data_source_test.go +++ b/internal/service/kendra/index_data_source_test.go @@ -20,7 +20,7 @@ func TestAccKendraIndexDataSource_basic(t *testing.T) { rName3 := sdkacctest.RandomWithPrefix("resource-test-terraform") resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, backup.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ diff --git a/internal/service/kendra/index_test.go b/internal/service/kendra/index_test.go index 5355f48eede1..06e6eaa02047 100644 --- a/internal/service/kendra/index_test.go +++ b/internal/service/kendra/index_test.go @@ -47,7 +47,7 @@ func TestAccKendraIndex_basic(t *testing.T) { resourceName := "aws_kendra_index.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, names.KendraEndpointID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckIndexDestroy(ctx), @@ -99,7 +99,7 @@ func TestAccKendraIndex_serverSideEncryption(t *testing.T) { resourceName := "aws_kendra_index.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, names.KendraEndpointID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckIndexDestroy(ctx), @@ -135,7 +135,7 @@ func TestAccKendraIndex_updateCapacityUnits(t *testing.T) { resourceName := "aws_kendra_index.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, names.KendraEndpointID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckIndexDestroy(ctx), @@ -179,7 +179,7 @@ func TestAccKendraIndex_updateDescription(t *testing.T) { resourceName := "aws_kendra_index.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, names.KendraEndpointID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckIndexDestroy(ctx), @@ -219,7 +219,7 @@ func TestAccKendraIndex_updateName(t *testing.T) { resourceName := "aws_kendra_index.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, names.KendraEndpointID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckIndexDestroy(ctx), @@ -261,7 +261,7 @@ func TestAccKendraIndex_updateUserTokenJSON(t *testing.T) { resourceName := "aws_kendra_index.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, names.KendraEndpointID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckIndexDestroy(ctx), @@ -316,7 +316,7 @@ func TestAccKendraIndex_updateTags(t *testing.T) { resourceName := "aws_kendra_index.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, names.KendraEndpointID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckIndexDestroy(ctx), @@ -368,7 +368,7 @@ func TestAccKendraIndex_updateRoleARN(t *testing.T) { resourceName := "aws_kendra_index.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, names.KendraEndpointID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckIndexDestroy(ctx), @@ -411,7 +411,7 @@ func TestAccKendraIndex_addDocumentMetadataConfigurationUpdates(t *testing.T) { stringValImportance := 1 resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, names.KendraEndpointID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckIndexDestroy(ctx), @@ -825,7 +825,7 @@ func TestAccKendraIndex_inplaceUpdateDocumentMetadataConfigurationUpdates(t *tes updatedStringValImportance := 2 resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, names.KendraEndpointID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckIndexDestroy(ctx), @@ -1278,7 +1278,7 @@ func TestAccKendraIndex_disappears(t *testing.T) { resourceName := "aws_kendra_index.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, names.KendraEndpointID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckIndexDestroy(ctx), 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 9f809c07a34c..74fc316872a0 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 @@ -23,7 +23,7 @@ func TestAccKendraQuerySuggestionsBlockListDataSource_basic(t *testing.T) { rName2 := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, backup.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ diff --git a/internal/service/kendra/query_suggestions_block_list_test.go b/internal/service/kendra/query_suggestions_block_list_test.go index 93ce15ed8c5d..ec110487a4eb 100644 --- a/internal/service/kendra/query_suggestions_block_list_test.go +++ b/internal/service/kendra/query_suggestions_block_list_test.go @@ -27,7 +27,7 @@ func TestAccKendraQuerySuggestionsBlockList_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(names.KendraEndpointID, t) testAccPreCheck(ctx, t) }, @@ -69,7 +69,7 @@ func TestAccKendraQuerySuggestionsBlockList_Description(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(names.KendraEndpointID, t) testAccPreCheck(ctx, t) }, @@ -119,7 +119,7 @@ func TestAccKendraQuerySuggestionsBlockList_Name(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(names.KendraEndpointID, t) testAccPreCheck(ctx, t) }, @@ -161,7 +161,7 @@ func TestAccKendraQuerySuggestionsBlockList_RoleARN(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(names.KendraEndpointID, t) testAccPreCheck(ctx, t) }, @@ -203,7 +203,7 @@ func TestAccKendraQuerySuggestionsBlockList_SourceS3Path(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(names.KendraEndpointID, t) testAccPreCheck(ctx, t) }, @@ -247,7 +247,7 @@ func TestAccKendraQuerySuggestionsBlockList_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(names.KendraEndpointID, t) testAccPreCheck(ctx, t) }, @@ -278,7 +278,7 @@ func TestAccKendraQuerySuggestionsBlockList_tags(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(names.KendraEndpointID, t) testAccPreCheck(ctx, t) }, diff --git a/internal/service/kendra/thesaurus_data_source_test.go b/internal/service/kendra/thesaurus_data_source_test.go index c37ce5301bc6..b17afde71bef 100644 --- a/internal/service/kendra/thesaurus_data_source_test.go +++ b/internal/service/kendra/thesaurus_data_source_test.go @@ -23,7 +23,7 @@ func TestAccKendraThesaurusDataSource_basic(t *testing.T) { rName2 := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, backup.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ diff --git a/internal/service/kendra/thesaurus_test.go b/internal/service/kendra/thesaurus_test.go index a46ff2609e98..874629bc86a6 100644 --- a/internal/service/kendra/thesaurus_test.go +++ b/internal/service/kendra/thesaurus_test.go @@ -27,7 +27,7 @@ func TestAccKendraThesaurus_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(names.KendraEndpointID, t) testAccPreCheck(ctx, t) }, @@ -70,7 +70,7 @@ func TestAccKendraThesaurus_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(names.KendraEndpointID, t) testAccPreCheck(ctx, t) }, @@ -101,7 +101,7 @@ func TestAccKendraThesaurus_tags(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(names.KendraEndpointID, t) testAccPreCheck(ctx, t) }, @@ -154,7 +154,7 @@ func TestAccKendraThesaurus_description(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(names.KendraEndpointID, t) testAccPreCheck(ctx, t) }, @@ -204,7 +204,7 @@ func TestAccKendraThesaurus_name(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(names.KendraEndpointID, t) testAccPreCheck(ctx, t) }, @@ -246,7 +246,7 @@ func TestAccKendraThesaurus_roleARN(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(names.KendraEndpointID, t) testAccPreCheck(ctx, t) }, @@ -288,7 +288,7 @@ func TestAccKendraThesaurus_sourceS3Path(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(names.KendraEndpointID, t) testAccPreCheck(ctx, t) }, From c29ec0768e291fb69604bb580d04b0ab95ec7d98 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Fri, 24 Feb 2023 16:37:06 -0500 Subject: [PATCH 177/763] Add 'Context' argument to 'acctest.PreCheck' for keyspaces. --- internal/service/keyspaces/keyspace_test.go | 6 +++--- internal/service/keyspaces/table_test.go | 14 +++++++------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/internal/service/keyspaces/keyspace_test.go b/internal/service/keyspaces/keyspace_test.go index 8813b607a556..934294f242c2 100644 --- a/internal/service/keyspaces/keyspace_test.go +++ b/internal/service/keyspaces/keyspace_test.go @@ -26,7 +26,7 @@ func TestAccKeyspacesKeyspace_basic(t *testing.T) { resourceName := "aws_keyspaces_keyspace.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(t) }, ErrorCheck: acctest.ErrorCheck(t, keyspaces.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckKeyspaceDestroy(ctx), @@ -55,7 +55,7 @@ func TestAccKeyspacesKeyspace_disappears(t *testing.T) { resourceName := "aws_keyspaces_keyspace.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(t) }, ErrorCheck: acctest.ErrorCheck(t, keyspaces.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckKeyspaceDestroy(ctx), @@ -78,7 +78,7 @@ func TestAccKeyspacesKeyspace_tags(t *testing.T) { resourceName := "aws_keyspaces_keyspace.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(t) }, ErrorCheck: acctest.ErrorCheck(t, keyspaces.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckKeyspaceDestroy(ctx), diff --git a/internal/service/keyspaces/table_test.go b/internal/service/keyspaces/table_test.go index 99a013a73559..bf555d41fcd5 100644 --- a/internal/service/keyspaces/table_test.go +++ b/internal/service/keyspaces/table_test.go @@ -25,7 +25,7 @@ func TestAccKeyspacesTable_basic(t *testing.T) { resourceName := "aws_keyspaces_table.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(t) }, ErrorCheck: acctest.ErrorCheck(t, keyspaces.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTableDestroy(ctx), @@ -79,7 +79,7 @@ func TestAccKeyspacesTable_disappears(t *testing.T) { resourceName := "aws_keyspaces_table.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(t) }, ErrorCheck: acctest.ErrorCheck(t, keyspaces.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTableDestroy(ctx), @@ -104,7 +104,7 @@ func TestAccKeyspacesTable_tags(t *testing.T) { resourceName := "aws_keyspaces_table.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(t) }, ErrorCheck: acctest.ErrorCheck(t, keyspaces.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTableDestroy(ctx), @@ -151,7 +151,7 @@ func TestAccKeyspacesTable_multipleColumns(t *testing.T) { resourceName := "aws_keyspaces_table.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(t) }, ErrorCheck: acctest.ErrorCheck(t, keyspaces.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTableDestroy(ctx), @@ -246,7 +246,7 @@ func TestAccKeyspacesTable_update(t *testing.T) { kmsKeyResourceName := "aws_kms_key.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(t) }, ErrorCheck: acctest.ErrorCheck(t, keyspaces.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTableDestroy(ctx), @@ -319,7 +319,7 @@ func TestAccKeyspacesTable_addColumns(t *testing.T) { resourceName := "aws_keyspaces_table.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(t) }, ErrorCheck: acctest.ErrorCheck(t, keyspaces.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTableDestroy(ctx), @@ -386,7 +386,7 @@ func TestAccKeyspacesTable_delColumns(t *testing.T) { resourceName := "aws_keyspaces_table.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(t) }, ErrorCheck: acctest.ErrorCheck(t, keyspaces.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTableDestroy(ctx), From c095c3b068cfe8b1b542024d3d1d66e787fe6fd2 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Fri, 24 Feb 2023 16:37:06 -0500 Subject: [PATCH 178/763] Add 'Context' argument to 'acctest.PreCheck' for kinesis. --- .../stream_consumer_data_source_test.go | 6 ++-- .../service/kinesis/stream_consumer_test.go | 8 +++--- .../kinesis/stream_data_source_test.go | 2 +- internal/service/kinesis/stream_test.go | 28 +++++++++---------- 4 files changed, 22 insertions(+), 22 deletions(-) diff --git a/internal/service/kinesis/stream_consumer_data_source_test.go b/internal/service/kinesis/stream_consumer_data_source_test.go index 273594545f70..98b480ceb59a 100644 --- a/internal/service/kinesis/stream_consumer_data_source_test.go +++ b/internal/service/kinesis/stream_consumer_data_source_test.go @@ -17,7 +17,7 @@ func TestAccKinesisStreamConsumerDataSource_basic(t *testing.T) { streamName := "aws_kinesis_stream.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, kinesis.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: nil, @@ -43,7 +43,7 @@ func TestAccKinesisStreamConsumerDataSource_name(t *testing.T) { streamName := "aws_kinesis_stream.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, kinesis.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: nil, @@ -69,7 +69,7 @@ func TestAccKinesisStreamConsumerDataSource_arn(t *testing.T) { streamName := "aws_kinesis_stream.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, kinesis.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: nil, diff --git a/internal/service/kinesis/stream_consumer_test.go b/internal/service/kinesis/stream_consumer_test.go index d3011256d267..84891bd8a5dc 100644 --- a/internal/service/kinesis/stream_consumer_test.go +++ b/internal/service/kinesis/stream_consumer_test.go @@ -23,7 +23,7 @@ func TestAccKinesisStreamConsumer_basic(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, kinesis.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckStreamConsumerDestroy(ctx), @@ -53,7 +53,7 @@ func TestAccKinesisStreamConsumer_disappears(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, kinesis.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: nil, @@ -76,7 +76,7 @@ func TestAccKinesisStreamConsumer_maxConcurrentConsumers(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, kinesis.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckStreamConsumerDestroy(ctx), @@ -102,7 +102,7 @@ func TestAccKinesisStreamConsumer_exceedMaxConcurrentConsumers(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, kinesis.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckStreamConsumerDestroy(ctx), diff --git a/internal/service/kinesis/stream_data_source_test.go b/internal/service/kinesis/stream_data_source_test.go index 30396837ad2a..7cea8e8285b6 100644 --- a/internal/service/kinesis/stream_data_source_test.go +++ b/internal/service/kinesis/stream_data_source_test.go @@ -16,7 +16,7 @@ func TestAccKinesisStreamDataSource_basic(t *testing.T) { dataSourceName := "data.aws_kinesis_stream.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, kinesis.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckStreamDestroy(ctx), diff --git a/internal/service/kinesis/stream_test.go b/internal/service/kinesis/stream_test.go index 4894322ee77c..778b518076a6 100644 --- a/internal/service/kinesis/stream_test.go +++ b/internal/service/kinesis/stream_test.go @@ -24,7 +24,7 @@ func TestAccKinesisStream_basic(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, kinesis.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckStreamDestroy(ctx), @@ -64,7 +64,7 @@ func TestAccKinesisStream_disappears(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, kinesis.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckStreamDestroy(ctx), @@ -88,7 +88,7 @@ func TestAccKinesisStream_createMultipleConcurrentStreams(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, kinesis.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckStreamDestroy(ctx), @@ -134,7 +134,7 @@ func TestAccKinesisStream_encryptionWithoutKMSKeyThrowsError(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, kinesis.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckStreamDestroy(ctx), @@ -154,7 +154,7 @@ func TestAccKinesisStream_encryption(t *testing.T) { resourceName := "aws_kinesis_stream.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, kinesis.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckStreamDestroy(ctx), @@ -209,7 +209,7 @@ func TestAccKinesisStream_shardCount(t *testing.T) { resourceName := "aws_kinesis_stream.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, kinesis.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckStreamDestroy(ctx), @@ -247,7 +247,7 @@ func TestAccKinesisStream_retentionPeriod(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, kinesis.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckStreamDestroy(ctx), @@ -292,7 +292,7 @@ func TestAccKinesisStream_shardLevelMetrics(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, kinesis.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckStreamDestroy(ctx), @@ -345,7 +345,7 @@ func TestAccKinesisStream_enforceConsumerDeletion(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, kinesis.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckStreamDestroy(ctx), @@ -375,7 +375,7 @@ func TestAccKinesisStream_tags(t *testing.T) { resourceName := "aws_kinesis_stream.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, kinesis.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckStreamDestroy(ctx), @@ -423,7 +423,7 @@ func TestAccKinesisStream_updateKMSKeyID(t *testing.T) { resourceName := "aws_kinesis_stream.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, kinesis.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckStreamDestroy(ctx), @@ -453,7 +453,7 @@ func TestAccKinesisStream_basicOnDemand(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, kinesis.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckStreamDestroy(ctx), @@ -484,7 +484,7 @@ func TestAccKinesisStream_switchBetweenProvisionedAndOnDemand(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, kinesis.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckStreamDestroy(ctx), @@ -560,7 +560,7 @@ func TestAccKinesisStream_failOnBadStreamCountAndStreamModeCombination(t *testin rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, kinesis.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckStreamDestroy(ctx), From 2b42841ee970dafe1919c8284bfd52d0d62d5c00 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Fri, 24 Feb 2023 16:37:06 -0500 Subject: [PATCH 179/763] Add 'Context' argument to 'acctest.PreCheck' for kinesisanalytics. --- .../kinesisanalytics/application_test.go | 40 +++++++++---------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/internal/service/kinesisanalytics/application_test.go b/internal/service/kinesisanalytics/application_test.go index 989a03372aa5..7a905de1102a 100644 --- a/internal/service/kinesisanalytics/application_test.go +++ b/internal/service/kinesisanalytics/application_test.go @@ -23,7 +23,7 @@ func TestAccKinesisAnalyticsApplication_basic(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, kinesisanalytics.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckApplicationDestroy(ctx), @@ -64,7 +64,7 @@ func TestAccKinesisAnalyticsApplication_disappears(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, kinesisanalytics.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckApplicationDestroy(ctx), @@ -88,7 +88,7 @@ func TestAccKinesisAnalyticsApplication_tags(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, kinesisanalytics.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckApplicationDestroy(ctx), @@ -137,7 +137,7 @@ func TestAccKinesisAnalyticsApplication_Code_update(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, kinesisanalytics.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckApplicationDestroy(ctx), @@ -200,7 +200,7 @@ func TestAccKinesisAnalyticsApplication_CloudWatchLoggingOptions_add(t *testing. rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, kinesisanalytics.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckApplicationDestroy(ctx), @@ -265,7 +265,7 @@ func TestAccKinesisAnalyticsApplication_CloudWatchLoggingOptions_delete(t *testi rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, kinesisanalytics.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckApplicationDestroy(ctx), @@ -332,7 +332,7 @@ func TestAccKinesisAnalyticsApplication_CloudWatchLoggingOptions_update(t *testi rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, kinesisanalytics.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckApplicationDestroy(ctx), @@ -399,7 +399,7 @@ func TestAccKinesisAnalyticsApplication_Input_add(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, kinesisanalytics.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckApplicationDestroy(ctx), @@ -488,7 +488,7 @@ func TestAccKinesisAnalyticsApplication_Input_update(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, kinesisanalytics.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckApplicationDestroy(ctx), @@ -603,7 +603,7 @@ func TestAccKinesisAnalyticsApplication_InputProcessing_add(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, kinesisanalytics.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckApplicationDestroy(ctx), @@ -718,7 +718,7 @@ func TestAccKinesisAnalyticsApplication_InputProcessing_delete(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, kinesisanalytics.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckApplicationDestroy(ctx), @@ -835,7 +835,7 @@ func TestAccKinesisAnalyticsApplication_InputProcessing_update(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, kinesisanalytics.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckApplicationDestroy(ctx), @@ -957,7 +957,7 @@ func TestAccKinesisAnalyticsApplication_Multiple_update(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, kinesisanalytics.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckApplicationDestroy(ctx), @@ -1128,7 +1128,7 @@ func TestAccKinesisAnalyticsApplication_Output_update(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, kinesisanalytics.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckApplicationDestroy(ctx), @@ -1241,7 +1241,7 @@ func TestAccKinesisAnalyticsApplication_ReferenceDataSource_add(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, kinesisanalytics.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckApplicationDestroy(ctx), @@ -1322,7 +1322,7 @@ func TestAccKinesisAnalyticsApplication_ReferenceDataSource_delete(t *testing.T) rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, kinesisanalytics.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckApplicationDestroy(ctx), @@ -1404,7 +1404,7 @@ func TestAccKinesisAnalyticsApplication_ReferenceDataSource_update(t *testing.T) rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, kinesisanalytics.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckApplicationDestroy(ctx), @@ -1506,7 +1506,7 @@ func TestAccKinesisAnalyticsApplication_StartApplication_onCreate(t *testing.T) rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, kinesisanalytics.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckApplicationDestroy(ctx), @@ -1574,7 +1574,7 @@ func TestAccKinesisAnalyticsApplication_StartApplication_onUpdate(t *testing.T) rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, kinesisanalytics.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckApplicationDestroy(ctx), @@ -1735,7 +1735,7 @@ func TestAccKinesisAnalyticsApplication_StartApplication_update(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, kinesisanalytics.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckApplicationDestroy(ctx), From b6b0f5e83d72e479c2788a21ca07f5cae9886b0e Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Fri, 24 Feb 2023 16:37:07 -0500 Subject: [PATCH 180/763] Add 'Context' argument to 'acctest.PreCheck' for kinesisanalyticsv2. --- .../application_snapshot_test.go | 6 +- .../kinesisanalyticsv2/application_test.go | 66 +++++++++---------- 2 files changed, 36 insertions(+), 36 deletions(-) diff --git a/internal/service/kinesisanalyticsv2/application_snapshot_test.go b/internal/service/kinesisanalyticsv2/application_snapshot_test.go index 8179f4592f64..3d2215370a70 100644 --- a/internal/service/kinesisanalyticsv2/application_snapshot_test.go +++ b/internal/service/kinesisanalyticsv2/application_snapshot_test.go @@ -23,7 +23,7 @@ func TestAccKinesisAnalyticsV2ApplicationSnapshot_basic(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, kinesisanalyticsv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckApplicationSnapshotDestroy(ctx), @@ -54,7 +54,7 @@ func TestAccKinesisAnalyticsV2ApplicationSnapshot_disappears(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, kinesisanalyticsv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckApplicationSnapshotDestroy(ctx), @@ -79,7 +79,7 @@ func TestAccKinesisAnalyticsV2ApplicationSnapshot_Disappears_application(t *test rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, kinesisanalyticsv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckApplicationSnapshotDestroy(ctx), diff --git a/internal/service/kinesisanalyticsv2/application_test.go b/internal/service/kinesisanalyticsv2/application_test.go index 6c1e72b75cab..6d967cc6ca8d 100644 --- a/internal/service/kinesisanalyticsv2/application_test.go +++ b/internal/service/kinesisanalyticsv2/application_test.go @@ -24,7 +24,7 @@ func TestAccKinesisAnalyticsV2Application_basicFlinkApplication(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, kinesisanalyticsv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckApplicationDestroy(ctx), @@ -214,7 +214,7 @@ func TestAccKinesisAnalyticsV2Application_basicSQLApplication(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, kinesisanalyticsv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckApplicationDestroy(ctx), @@ -255,7 +255,7 @@ func TestAccKinesisAnalyticsV2Application_disappears(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, kinesisanalyticsv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckApplicationDestroy(ctx), @@ -279,7 +279,7 @@ func TestAccKinesisAnalyticsV2Application_tags(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, kinesisanalyticsv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckApplicationDestroy(ctx), @@ -329,7 +329,7 @@ func TestAccKinesisAnalyticsV2Application_ApplicationCode_update(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, kinesisanalyticsv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckApplicationDestroy(ctx), @@ -414,7 +414,7 @@ func TestAccKinesisAnalyticsV2Application_CloudWatchLoggingOptions_add(t *testin rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, kinesisanalyticsv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckApplicationDestroy(ctx), @@ -478,7 +478,7 @@ func TestAccKinesisAnalyticsV2Application_CloudWatchLoggingOptions_delete(t *tes rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, kinesisanalyticsv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckApplicationDestroy(ctx), @@ -543,7 +543,7 @@ func TestAccKinesisAnalyticsV2Application_CloudWatchLoggingOptions_update(t *tes rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, kinesisanalyticsv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckApplicationDestroy(ctx), @@ -609,7 +609,7 @@ func TestAccKinesisAnalyticsV2Application_EnvironmentProperties_update(t *testin rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, kinesisanalyticsv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckApplicationDestroy(ctx), @@ -807,7 +807,7 @@ func TestAccKinesisAnalyticsV2Application_FlinkApplication_update(t *testing.T) rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, kinesisanalyticsv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckApplicationDestroy(ctx), @@ -929,7 +929,7 @@ func TestAccKinesisAnalyticsV2Application_FlinkApplicationEnvironmentProperties_ rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, kinesisanalyticsv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckApplicationDestroy(ctx), @@ -1082,7 +1082,7 @@ func TestAccKinesisAnalyticsV2Application_FlinkApplication_restoreFromSnapshot(t rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, kinesisanalyticsv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckApplicationDestroy(ctx), @@ -1353,7 +1353,7 @@ func TestAccKinesisAnalyticsV2Application_FlinkApplicationStartApplication_onCre rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, kinesisanalyticsv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckApplicationDestroy(ctx), @@ -1430,7 +1430,7 @@ func TestAccKinesisAnalyticsV2Application_FlinkApplicationStartApplication_onUpd rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, kinesisanalyticsv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckApplicationDestroy(ctx), @@ -1604,7 +1604,7 @@ func TestAccKinesisAnalyticsV2Application_FlinkApplication_updateRunning(t *test rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, kinesisanalyticsv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckApplicationDestroy(ctx), @@ -1732,7 +1732,7 @@ func TestAccKinesisAnalyticsV2Application_ServiceExecutionRole_update(t *testing rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, kinesisanalyticsv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckApplicationDestroy(ctx), @@ -1795,7 +1795,7 @@ func TestAccKinesisAnalyticsV2Application_SQLApplicationInput_add(t *testing.T) rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, kinesisanalyticsv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckApplicationDestroy(ctx), @@ -1907,7 +1907,7 @@ func TestAccKinesisAnalyticsV2Application_SQLApplicationInput_update(t *testing. rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, kinesisanalyticsv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckApplicationDestroy(ctx), @@ -2048,7 +2048,7 @@ func TestAccKinesisAnalyticsV2Application_SQLApplicationInputProcessing_add(t *t rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, kinesisanalyticsv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckApplicationDestroy(ctx), @@ -2188,7 +2188,7 @@ func TestAccKinesisAnalyticsV2Application_SQLApplicationInputProcessing_delete(t rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, kinesisanalyticsv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckApplicationDestroy(ctx), @@ -2329,7 +2329,7 @@ func TestAccKinesisAnalyticsV2Application_SQLApplicationInputProcessing_update(t rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, kinesisanalyticsv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckApplicationDestroy(ctx), @@ -2475,7 +2475,7 @@ func TestAccKinesisAnalyticsV2Application_SQLApplicationMultiple_update(t *testi rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, kinesisanalyticsv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckApplicationDestroy(ctx), @@ -2667,7 +2667,7 @@ func TestAccKinesisAnalyticsV2Application_SQLApplicationOutput_update(t *testing rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, kinesisanalyticsv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckApplicationDestroy(ctx), @@ -2816,7 +2816,7 @@ func TestAccKinesisAnalyticsV2Application_SQLApplicationReferenceDataSource_add( rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, kinesisanalyticsv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckApplicationDestroy(ctx), @@ -2921,7 +2921,7 @@ func TestAccKinesisAnalyticsV2Application_SQLApplicationReferenceDataSource_dele rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, kinesisanalyticsv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckApplicationDestroy(ctx), @@ -3026,7 +3026,7 @@ func TestAccKinesisAnalyticsV2Application_SQLApplicationReferenceDataSource_upda rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, kinesisanalyticsv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckApplicationDestroy(ctx), @@ -3154,7 +3154,7 @@ func TestAccKinesisAnalyticsV2Application_SQLApplicationStartApplication_onCreat rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, kinesisanalyticsv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckApplicationDestroy(ctx), @@ -3235,7 +3235,7 @@ func TestAccKinesisAnalyticsV2Application_SQLApplicationStartApplication_onUpdat rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, kinesisanalyticsv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckApplicationDestroy(ctx), @@ -3435,7 +3435,7 @@ func TestAccKinesisAnalyticsV2Application_SQLApplication_updateRunning(t *testin rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, kinesisanalyticsv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckApplicationDestroy(ctx), @@ -3628,7 +3628,7 @@ func TestAccKinesisAnalyticsV2Application_SQLApplicationVPC_add(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, kinesisanalyticsv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckApplicationDestroy(ctx), @@ -3753,7 +3753,7 @@ func TestAccKinesisAnalyticsV2Application_SQLApplicationVPC_delete(t *testing.T) rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, kinesisanalyticsv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckApplicationDestroy(ctx), @@ -3878,7 +3878,7 @@ func TestAccKinesisAnalyticsV2Application_SQLApplicationVPC_update(t *testing.T) rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, kinesisanalyticsv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckApplicationDestroy(ctx), @@ -4007,7 +4007,7 @@ func TestAccKinesisAnalyticsV2Application_RunConfiguration_Update(t *testing.T) rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, kinesisanalyticsv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckApplicationDestroy(ctx), From 45c8c13647d8fe0e3f79d715ee1a73e0a8cd5d72 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Fri, 24 Feb 2023 16:37:07 -0500 Subject: [PATCH 181/763] Add 'Context' argument to 'acctest.PreCheck' for kinesisvideo. --- internal/service/kinesisvideo/stream_test.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/internal/service/kinesisvideo/stream_test.go b/internal/service/kinesisvideo/stream_test.go index db5710f72a48..b6710ec29139 100644 --- a/internal/service/kinesisvideo/stream_test.go +++ b/internal/service/kinesisvideo/stream_test.go @@ -26,7 +26,7 @@ func TestAccKinesisVideoStream_basic(t *testing.T) { rInt2 := sdkacctest.RandInt() resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(kinesisvideo.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(kinesisvideo.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, kinesisvideo.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckStreamDestroy(ctx), @@ -69,7 +69,7 @@ func TestAccKinesisVideoStream_options(t *testing.T) { rName2 := sdkacctest.RandString(8) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(kinesisvideo.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(kinesisvideo.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, kinesisvideo.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckStreamDestroy(ctx), @@ -112,7 +112,7 @@ func TestAccKinesisVideoStream_tags(t *testing.T) { rInt := sdkacctest.RandInt() resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(kinesisvideo.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(kinesisvideo.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, kinesisvideo.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckStreamDestroy(ctx), @@ -159,7 +159,7 @@ func TestAccKinesisVideoStream_disappears(t *testing.T) { rInt := sdkacctest.RandInt() resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(kinesisvideo.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(kinesisvideo.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, kinesisvideo.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckStreamDestroy(ctx), From b5ddf2b8a9014e5c81cf509031faa33d71c16cd2 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Fri, 24 Feb 2023 16:37:08 -0500 Subject: [PATCH 182/763] Add 'Context' argument to 'acctest.PreCheck' for kms. --- .../service/kms/alias_data_source_test.go | 4 +-- internal/service/kms/alias_test.go | 14 ++++----- .../kms/ciphertext_data_source_test.go | 6 ++-- internal/service/kms/ciphertext_test.go | 6 ++-- .../kms/custom_key_store_data_source_test.go | 2 +- internal/service/kms/custom_key_store_test.go | 6 ++-- internal/service/kms/external_key_test.go | 22 +++++++------- internal/service/kms/grant_test.go | 16 +++++----- internal/service/kms/key_data_source_test.go | 14 ++++----- internal/service/kms/key_test.go | 30 +++++++++---------- .../kms/public_key_data_source_test.go | 4 +-- .../service/kms/replica_external_key_test.go | 8 ++--- internal/service/kms/replica_key_test.go | 12 ++++---- .../service/kms/secret_data_source_test.go | 2 +- .../service/kms/secrets_data_source_test.go | 8 ++--- 15 files changed, 77 insertions(+), 77 deletions(-) diff --git a/internal/service/kms/alias_data_source_test.go b/internal/service/kms/alias_data_source_test.go index 930d59f0417c..ceba26b03757 100644 --- a/internal/service/kms/alias_data_source_test.go +++ b/internal/service/kms/alias_data_source_test.go @@ -16,7 +16,7 @@ func TestAccKMSAliasDataSource_service(t *testing.T) { resourceName := "data.aws_kms_alias.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, kms.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ @@ -39,7 +39,7 @@ func TestAccKMSAliasDataSource_cmk(t *testing.T) { datasourceAliasResourceName := "data.aws_kms_alias.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, kms.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ diff --git a/internal/service/kms/alias_test.go b/internal/service/kms/alias_test.go index 1db505255f9a..c38dea69d142 100644 --- a/internal/service/kms/alias_test.go +++ b/internal/service/kms/alias_test.go @@ -24,7 +24,7 @@ func TestAccKMSAlias_basic(t *testing.T) { keyResourceName := "aws_kms_key.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, kms.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckAliasDestroy(ctx), @@ -55,7 +55,7 @@ func TestAccKMSAlias_disappears(t *testing.T) { resourceName := "aws_kms_alias.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, kms.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckAliasDestroy(ctx), @@ -79,7 +79,7 @@ func TestAccKMSAlias_Name_generated(t *testing.T) { resourceName := "aws_kms_alias.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, kms.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckAliasDestroy(ctx), @@ -108,7 +108,7 @@ func TestAccKMSAlias_namePrefix(t *testing.T) { resourceName := "aws_kms_alias.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, kms.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckAliasDestroy(ctx), @@ -139,7 +139,7 @@ func TestAccKMSAlias_updateKeyID(t *testing.T) { key2ResourceName := "aws_kms_key.test2" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, kms.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckAliasDestroy(ctx), @@ -178,7 +178,7 @@ func TestAccKMSAlias_multipleAliasesForSameKey(t *testing.T) { keyResourceName := "aws_kms_key.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, kms.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckAliasDestroy(ctx), @@ -210,7 +210,7 @@ func TestAccKMSAlias_arnDiffSuppress(t *testing.T) { resourceName := "aws_kms_alias.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, kms.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckAliasDestroy(ctx), diff --git a/internal/service/kms/ciphertext_data_source_test.go b/internal/service/kms/ciphertext_data_source_test.go index 56c7dffe7a59..e7fba4908fb0 100644 --- a/internal/service/kms/ciphertext_data_source_test.go +++ b/internal/service/kms/ciphertext_data_source_test.go @@ -10,7 +10,7 @@ import ( func TestAccKMSCiphertextDataSource_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, kms.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ @@ -27,7 +27,7 @@ func TestAccKMSCiphertextDataSource_basic(t *testing.T) { func TestAccKMSCiphertextDataSource_validate(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, kms.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ @@ -44,7 +44,7 @@ func TestAccKMSCiphertextDataSource_validate(t *testing.T) { func TestAccKMSCiphertextDataSource_Validate_withContext(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, kms.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ diff --git a/internal/service/kms/ciphertext_test.go b/internal/service/kms/ciphertext_test.go index 6868d105c38e..549897d532b5 100644 --- a/internal/service/kms/ciphertext_test.go +++ b/internal/service/kms/ciphertext_test.go @@ -10,7 +10,7 @@ import ( func TestAccKMSCiphertext_Resource_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, kms.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: nil, @@ -31,7 +31,7 @@ func TestAccKMSCiphertext_Resource_validate(t *testing.T) { resourceName := "aws_kms_ciphertext.foo" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, kms.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: nil, @@ -52,7 +52,7 @@ func TestAccKMSCiphertext_ResourceValidate_withContext(t *testing.T) { resourceName := "aws_kms_ciphertext.foo" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, kms.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: nil, 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 11eb34765156..e9d69f0ad308 100644 --- a/internal/service/kms/custom_key_store_data_source_test.go +++ b/internal/service/kms/custom_key_store_data_source_test.go @@ -27,7 +27,7 @@ func TestAccKMSCustomKeyStoreDataSource_basic(t *testing.T) { trustAnchorCertificate := os.Getenv("TRUST_ANCHOR_CERTIFICATE") resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, kms.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ diff --git a/internal/service/kms/custom_key_store_test.go b/internal/service/kms/custom_key_store_test.go index f0b0a41e6676..66e89061e6ea 100644 --- a/internal/service/kms/custom_key_store_test.go +++ b/internal/service/kms/custom_key_store_test.go @@ -43,7 +43,7 @@ func testAccCustomKeyStore_basic(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(kms.EndpointsID, t) testAccCustomKeyStoresPreCheck(ctx, t) }, @@ -91,7 +91,7 @@ func testAccCustomKeyStore_update(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(kms.EndpointsID, t) testAccCustomKeyStoresPreCheck(ctx, t) }, @@ -134,7 +134,7 @@ func testAccCustomKeyStore_disappears(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(kms.EndpointsID, t) testAccCustomKeyStoresPreCheck(ctx, t) }, diff --git a/internal/service/kms/external_key_test.go b/internal/service/kms/external_key_test.go index b7e4ef79bc54..5eb3f5a9f2b4 100644 --- a/internal/service/kms/external_key_test.go +++ b/internal/service/kms/external_key_test.go @@ -25,7 +25,7 @@ func TestAccKMSExternalKey_basic(t *testing.T) { resourceName := "aws_kms_external_key.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, kms.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckExternalKeyDestroy(ctx), @@ -68,7 +68,7 @@ func TestAccKMSExternalKey_disappears(t *testing.T) { resourceName := "aws_kms_external_key.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, kms.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckExternalKeyDestroy(ctx), @@ -92,7 +92,7 @@ func TestAccKMSExternalKey_multiRegion(t *testing.T) { resourceName := "aws_kms_external_key.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, kms.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckExternalKeyDestroy(ctx), @@ -125,7 +125,7 @@ func TestAccKMSExternalKey_deletionWindowInDays(t *testing.T) { resourceName := "aws_kms_external_key.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, kms.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckExternalKeyDestroy(ctx), @@ -166,7 +166,7 @@ func TestAccKMSExternalKey_description(t *testing.T) { resourceName := "aws_kms_external_key.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, kms.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckExternalKeyDestroy(ctx), @@ -207,7 +207,7 @@ func TestAccKMSExternalKey_enabled(t *testing.T) { resourceName := "aws_kms_external_key.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, kms.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckExternalKeyDestroy(ctx), @@ -256,7 +256,7 @@ func TestAccKMSExternalKey_keyMaterialBase64(t *testing.T) { resourceName := "aws_kms_external_key.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, kms.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckExternalKeyDestroy(ctx), @@ -301,7 +301,7 @@ func TestAccKMSExternalKey_policy(t *testing.T) { resourceName := "aws_kms_external_key.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, kms.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckExternalKeyDestroy(ctx), @@ -343,7 +343,7 @@ func TestAccKMSExternalKey_policyBypass(t *testing.T) { resourceName := "aws_kms_external_key.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, kms.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckExternalKeyDestroy(ctx), @@ -377,7 +377,7 @@ func TestAccKMSExternalKey_tags(t *testing.T) { resourceName := "aws_kms_external_key.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, kms.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckExternalKeyDestroy(ctx), @@ -432,7 +432,7 @@ func TestAccKMSExternalKey_validTo(t *testing.T) { validTo2 := time.Now().UTC().Add(2 * time.Hour).Format(time.RFC3339) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, kms.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckExternalKeyDestroy(ctx), diff --git a/internal/service/kms/grant_test.go b/internal/service/kms/grant_test.go index f8319d4b6705..df26be7fabbf 100644 --- a/internal/service/kms/grant_test.go +++ b/internal/service/kms/grant_test.go @@ -21,7 +21,7 @@ func TestAccKMSGrant_basic(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, kms.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckGrantDestroy(ctx), @@ -54,7 +54,7 @@ func TestAccKMSGrant_withConstraints(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, kms.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckGrantDestroy(ctx), @@ -103,7 +103,7 @@ func TestAccKMSGrant_withRetiringPrincipal(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, kms.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckGrantDestroy(ctx), @@ -131,7 +131,7 @@ func TestAccKMSGrant_bare(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, kms.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckGrantDestroy(ctx), @@ -161,7 +161,7 @@ func TestAccKMSGrant_arn(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, kms.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckGrantDestroy(ctx), @@ -194,7 +194,7 @@ func TestAccKMSGrant_asymmetricKey(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, kms.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckGrantDestroy(ctx), @@ -221,7 +221,7 @@ func TestAccKMSGrant_disappears(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, kms.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckGrantDestroy(ctx), @@ -245,7 +245,7 @@ func TestAccKMSGrant_crossAccountARN(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckAlternateAccount(t) }, ErrorCheck: acctest.ErrorCheck(t, kms.EndpointsID), diff --git a/internal/service/kms/key_data_source_test.go b/internal/service/kms/key_data_source_test.go index d4c8302593de..50fb7fcc3538 100644 --- a/internal/service/kms/key_data_source_test.go +++ b/internal/service/kms/key_data_source_test.go @@ -16,7 +16,7 @@ func TestAccKMSKeyDataSource_byKeyARN(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, kms.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ @@ -50,7 +50,7 @@ func TestAccKMSKeyDataSource_byKeyID(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, kms.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ @@ -84,7 +84,7 @@ func TestAccKMSKeyDataSource_byAliasARN(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, kms.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ @@ -118,7 +118,7 @@ func TestAccKMSKeyDataSource_byAliasID(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, kms.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ @@ -152,7 +152,7 @@ func TestAccKMSKeyDataSource_grantToken(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, kms.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ @@ -186,7 +186,7 @@ func TestAccKMSKeyDataSource_multiRegionConfigurationByARN(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, kms.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ @@ -225,7 +225,7 @@ func TestAccKMSKeyDataSource_multiRegionConfigurationByID(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, kms.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ diff --git a/internal/service/kms/key_test.go b/internal/service/kms/key_test.go index dc956d995966..fe6fbb852652 100644 --- a/internal/service/kms/key_test.go +++ b/internal/service/kms/key_test.go @@ -24,7 +24,7 @@ func TestAccKMSKey_basic(t *testing.T) { resourceName := "aws_kms_key.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, kms.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckKeyDestroy(ctx), @@ -56,7 +56,7 @@ func TestAccKMSKey_disappears(t *testing.T) { resourceName := "aws_kms_key.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, kms.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckKeyDestroy(ctx), @@ -80,7 +80,7 @@ func TestAccKMSKey_multiRegion(t *testing.T) { resourceName := "aws_kms_key.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, kms.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckKeyDestroy(ctx), @@ -109,7 +109,7 @@ func TestAccKMSKey_asymmetricKey(t *testing.T) { resourceName := "aws_kms_key.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, kms.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckKeyDestroy(ctx), @@ -133,7 +133,7 @@ func TestAccKMSKey_hmacKey(t *testing.T) { resourceName := "aws_kms_key.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, kms.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckKeyDestroy(ctx), @@ -158,7 +158,7 @@ func TestAccKMSKey_Policy_basic(t *testing.T) { expectedPolicyText := fmt.Sprintf(`{"Version":"2012-10-17","Id":%[1]q,"Statement":[{"Sid":"Enable IAM User Permissions","Effect":"Allow","Principal":{"AWS":"*"},"Action":"kms:*","Resource":"*"}]}`, rName) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, kms.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckKeyDestroy(ctx), @@ -193,7 +193,7 @@ func TestAccKMSKey_Policy_bypass(t *testing.T) { resourceName := "aws_kms_key.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, kms.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckKeyDestroy(ctx), @@ -226,7 +226,7 @@ func TestAccKMSKey_Policy_bypassUpdate(t *testing.T) { resourceName := "aws_kms_key.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, kms.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckKeyDestroy(ctx), @@ -256,7 +256,7 @@ func TestAccKMSKey_Policy_iamRole(t *testing.T) { resourceName := "aws_kms_key.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, kms.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckKeyDestroy(ctx), @@ -284,7 +284,7 @@ func TestAccKMSKey_Policy_iamRoleUpdate(t *testing.T) { resourceName := "aws_kms_key.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, kms.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckKeyDestroy(ctx), @@ -313,7 +313,7 @@ func TestAccKMSKey_Policy_iamRoleOrder(t *testing.T) { resourceName := "aws_kms_key.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, kms.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckKeyDestroy(ctx), @@ -357,7 +357,7 @@ func TestAccKMSKey_Policy_iamServiceLinkedRole(t *testing.T) { resourceName := "aws_kms_key.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, kms.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckKeyDestroy(ctx), @@ -385,7 +385,7 @@ func TestAccKMSKey_Policy_booleanCondition(t *testing.T) { resourceName := "aws_kms_key.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, kms.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckKeyDestroy(ctx), @@ -407,7 +407,7 @@ func TestAccKMSKey_isEnabled(t *testing.T) { resourceName := "aws_kms_key.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, kms.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckKeyDestroy(ctx), @@ -453,7 +453,7 @@ func TestAccKMSKey_tags(t *testing.T) { resourceName := "aws_kms_key.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, kms.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckKeyDestroy(ctx), diff --git a/internal/service/kms/public_key_data_source_test.go b/internal/service/kms/public_key_data_source_test.go index 7dd718749fa7..2e806fbb3fce 100644 --- a/internal/service/kms/public_key_data_source_test.go +++ b/internal/service/kms/public_key_data_source_test.go @@ -17,7 +17,7 @@ func TestAccKMSPublicKeyDataSource_basic(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, kms.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ @@ -43,7 +43,7 @@ func TestAccKMSPublicKeyDataSource_encrypt(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, kms.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ diff --git a/internal/service/kms/replica_external_key_test.go b/internal/service/kms/replica_external_key_test.go index 0af10cc21132..6cca542715ec 100644 --- a/internal/service/kms/replica_external_key_test.go +++ b/internal/service/kms/replica_external_key_test.go @@ -20,7 +20,7 @@ func TestAccKMSReplicaExternalKey_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckMultipleRegion(t, 2) }, ErrorCheck: acctest.ErrorCheck(t, kms.EndpointsID), @@ -71,7 +71,7 @@ func TestAccKMSReplicaExternalKey_descriptionAndEnabled(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckMultipleRegion(t, 2) }, ErrorCheck: acctest.ErrorCheck(t, kms.EndpointsID), @@ -126,7 +126,7 @@ func TestAccKMSReplicaExternalKey_policy(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckMultipleRegion(t, 2) }, ErrorCheck: acctest.ErrorCheck(t, kms.EndpointsID), @@ -171,7 +171,7 @@ func TestAccKMSReplicaExternalKey_tags(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckMultipleRegion(t, 2) }, ErrorCheck: acctest.ErrorCheck(t, kms.EndpointsID), diff --git a/internal/service/kms/replica_key_test.go b/internal/service/kms/replica_key_test.go index 8be8ada94fc3..7ce129c7d982 100644 --- a/internal/service/kms/replica_key_test.go +++ b/internal/service/kms/replica_key_test.go @@ -21,7 +21,7 @@ func TestAccKMSReplicaKey_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckMultipleRegion(t, 2) }, ErrorCheck: acctest.ErrorCheck(t, kms.EndpointsID), @@ -62,7 +62,7 @@ func TestAccKMSReplicaKey_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckMultipleRegion(t, 2) }, ErrorCheck: acctest.ErrorCheck(t, kms.EndpointsID), @@ -92,7 +92,7 @@ func TestAccKMSReplicaKey_descriptionAndEnabled(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckMultipleRegion(t, 2) }, ErrorCheck: acctest.ErrorCheck(t, kms.EndpointsID), @@ -143,7 +143,7 @@ func TestAccKMSReplicaKey_policy(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckMultipleRegion(t, 2) }, ErrorCheck: acctest.ErrorCheck(t, kms.EndpointsID), @@ -184,7 +184,7 @@ func TestAccKMSReplicaKey_tags(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckMultipleRegion(t, 2) }, ErrorCheck: acctest.ErrorCheck(t, kms.EndpointsID), @@ -234,7 +234,7 @@ func TestAccKMSReplicaKey_twoReplicas(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckMultipleRegion(t, 3) }, ErrorCheck: acctest.ErrorCheck(t, kms.EndpointsID), diff --git a/internal/service/kms/secret_data_source_test.go b/internal/service/kms/secret_data_source_test.go index 5aa1e8da76c6..f41abb805bdf 100644 --- a/internal/service/kms/secret_data_source_test.go +++ b/internal/service/kms/secret_data_source_test.go @@ -12,7 +12,7 @@ import ( func TestAccKMSSecretDataSource_removed(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, kms.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ diff --git a/internal/service/kms/secrets_data_source_test.go b/internal/service/kms/secrets_data_source_test.go index 9ead51003f3e..f7941793d313 100644 --- a/internal/service/kms/secrets_data_source_test.go +++ b/internal/service/kms/secrets_data_source_test.go @@ -24,7 +24,7 @@ func TestAccKMSSecretsDataSource_basic(t *testing.T) { // Run a resource test to setup our KMS key resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, kms.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ @@ -51,7 +51,7 @@ func TestAccKMSSecretsDataSource_asymmetric(t *testing.T) { // Run a resource test to setup our KMS key resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, kms.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ @@ -119,7 +119,7 @@ func testAccSecretsDecryptDataSource(t *testing.T, plaintext string, encryptedPa dataSourceName := "data.aws_kms_secrets.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, kms.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ @@ -143,7 +143,7 @@ func testAccSecretsDecryptDataSourceAsym(t *testing.T, key *kms.KeyMetadata, pla keyid := key.Arn resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, kms.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ From 1ba50daa1b55171aade60b6f562a1633ec23da82 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Fri, 24 Feb 2023 16:37:08 -0500 Subject: [PATCH 183/763] Add 'Context' argument to 'acctest.PreCheck' for lakeformation. --- .../data_lake_settings_data_source_test.go | 2 +- .../lakeformation/data_lake_settings_test.go | 6 +-- internal/service/lakeformation/lf_tag_test.go | 6 +-- .../permissions_data_source_test.go | 14 +++--- .../service/lakeformation/permissions_test.go | 44 +++++++++---------- .../resource_data_source_test.go | 2 +- .../lakeformation/resource_lf_tags_test.go | 10 ++--- .../service/lakeformation/resource_test.go | 10 ++--- 8 files changed, 47 insertions(+), 47 deletions(-) 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 8ff6546f8301..d3a5cffe2187 100644 --- a/internal/service/lakeformation/data_lake_settings_data_source_test.go +++ b/internal/service/lakeformation/data_lake_settings_data_source_test.go @@ -13,7 +13,7 @@ func testAccDataLakeSettingsDataSource_basic(t *testing.T) { resourceName := "data.aws_lakeformation_data_lake_settings.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(lakeformation.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(lakeformation.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, lakeformation.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDataLakeSettingsDestroy(ctx), diff --git a/internal/service/lakeformation/data_lake_settings_test.go b/internal/service/lakeformation/data_lake_settings_test.go index c14e4c53b4c5..729a3b310a0f 100644 --- a/internal/service/lakeformation/data_lake_settings_test.go +++ b/internal/service/lakeformation/data_lake_settings_test.go @@ -20,7 +20,7 @@ func testAccDataLakeSettings_basic(t *testing.T) { resourceName := "aws_lakeformation_data_lake_settings.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(lakeformation.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(lakeformation.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, lakeformation.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDataLakeSettingsDestroy(ctx), @@ -43,7 +43,7 @@ func testAccDataLakeSettings_disappears(t *testing.T) { resourceName := "aws_lakeformation_data_lake_settings.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(lakeformation.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(lakeformation.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, lakeformation.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDataLakeSettingsDestroy(ctx), @@ -65,7 +65,7 @@ func testAccDataLakeSettings_withoutCatalogID(t *testing.T) { resourceName := "aws_lakeformation_data_lake_settings.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, lakeformation.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDataLakeSettingsDestroy(ctx), diff --git a/internal/service/lakeformation/lf_tag_test.go b/internal/service/lakeformation/lf_tag_test.go index 3e9f9e529470..8b007494bff4 100644 --- a/internal/service/lakeformation/lf_tag_test.go +++ b/internal/service/lakeformation/lf_tag_test.go @@ -24,7 +24,7 @@ func testAccLFTag_basic(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(lakeformation.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(lakeformation.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, lakeformation.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckLFTagsDestroy(ctx), @@ -53,7 +53,7 @@ func testAccLFTag_disappears(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(lakeformation.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(lakeformation.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, lakeformation.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckLFTagsDestroy(ctx), @@ -76,7 +76,7 @@ func testAccLFTag_values(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(lakeformation.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(lakeformation.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, lakeformation.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckLFTagsDestroy(ctx), diff --git a/internal/service/lakeformation/permissions_data_source_test.go b/internal/service/lakeformation/permissions_data_source_test.go index 1a1aef204530..921ebd0833a9 100644 --- a/internal/service/lakeformation/permissions_data_source_test.go +++ b/internal/service/lakeformation/permissions_data_source_test.go @@ -17,7 +17,7 @@ func testAccPermissionsDataSource_basic(t *testing.T) { dataSourceName := "data.aws_lakeformation_permissions.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(lakeformation.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(lakeformation.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, lakeformation.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckPermissionsDestroy(ctx), @@ -42,7 +42,7 @@ func testAccPermissionsDataSource_dataLocation(t *testing.T) { dataSourceName := "data.aws_lakeformation_permissions.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(lakeformation.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(lakeformation.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, lakeformation.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckPermissionsDestroy(ctx), @@ -68,7 +68,7 @@ func testAccPermissionsDataSource_database(t *testing.T) { dataSourceName := "data.aws_lakeformation_permissions.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(lakeformation.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(lakeformation.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, lakeformation.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckPermissionsDestroy(ctx), @@ -98,7 +98,7 @@ func testAccPermissionsDataSource_lfTag(t *testing.T) { dataSourceName := "data.aws_lakeformation_permissions.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(lakeformation.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(lakeformation.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, lakeformation.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckPermissionsDestroy(ctx), @@ -129,7 +129,7 @@ func testAccPermissionsDataSource_lfTagPolicy(t *testing.T) { dataSourceName := "data.aws_lakeformation_permissions.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(lakeformation.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(lakeformation.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, lakeformation.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckPermissionsDestroy(ctx), @@ -162,7 +162,7 @@ func testAccPermissionsDataSource_table(t *testing.T) { dataSourceName := "data.aws_lakeformation_permissions.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(lakeformation.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(lakeformation.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, lakeformation.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckPermissionsDestroy(ctx), @@ -189,7 +189,7 @@ func testAccPermissionsDataSource_tableWithColumns(t *testing.T) { dataSourceName := "data.aws_lakeformation_permissions.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(lakeformation.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(lakeformation.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, lakeformation.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckPermissionsDestroy(ctx), diff --git a/internal/service/lakeformation/permissions_test.go b/internal/service/lakeformation/permissions_test.go index 4400f9179e38..ba34529ad54f 100644 --- a/internal/service/lakeformation/permissions_test.go +++ b/internal/service/lakeformation/permissions_test.go @@ -27,7 +27,7 @@ func testAccPermissions_basic(t *testing.T) { roleName := "aws_iam_role.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(lakeformation.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(lakeformation.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, lakeformation.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckPermissionsDestroy(ctx), @@ -52,7 +52,7 @@ func testAccPermissions_disappears(t *testing.T) { resourceName := "aws_lakeformation_permissions.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(lakeformation.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(lakeformation.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, lakeformation.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckPermissionsDestroy(ctx), @@ -77,7 +77,7 @@ func testAccPermissions_database(t *testing.T) { dbName := "aws_glue_catalog_database.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(lakeformation.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(lakeformation.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, lakeformation.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckPermissionsDestroy(ctx), @@ -110,7 +110,7 @@ func testAccPermissions_databaseIAMAllowed(t *testing.T) { dbName := "aws_glue_catalog_database.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(lakeformation.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(lakeformation.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, lakeformation.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckPermissionsDestroy(ctx), @@ -142,7 +142,7 @@ func testAccPermissions_databaseMultiple(t *testing.T) { dbName := "aws_glue_catalog_database.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(lakeformation.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(lakeformation.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, lakeformation.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckPermissionsDestroy(ctx), @@ -186,7 +186,7 @@ func testAccPermissions_dataLocation(t *testing.T) { bucketName := "aws_s3_bucket.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(lakeformation.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(lakeformation.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, lakeformation.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckPermissionsDestroy(ctx), @@ -215,7 +215,7 @@ func testAccPermissions_lfTag(t *testing.T) { tagName := "aws_lakeformation_lf_tag.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(lakeformation.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(lakeformation.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, lakeformation.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckPermissionsDestroy(ctx), @@ -250,7 +250,7 @@ func testAccPermissions_lfTagPolicy(t *testing.T) { tagName := "aws_lakeformation_lf_tag.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(lakeformation.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(lakeformation.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, lakeformation.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckPermissionsDestroy(ctx), @@ -287,7 +287,7 @@ func testAccPermissions_tableBasic(t *testing.T) { tableName := "aws_glue_catalog_table.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(lakeformation.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(lakeformation.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, lakeformation.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckPermissionsDestroy(ctx), @@ -317,7 +317,7 @@ func testAccPermissions_tableIAMAllowed(t *testing.T) { dbName := "aws_glue_catalog_table.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(lakeformation.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(lakeformation.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, lakeformation.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckPermissionsDestroy(ctx), @@ -348,7 +348,7 @@ func testAccPermissions_tableImplicit(t *testing.T) { tableName := "aws_glue_catalog_table.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(lakeformation.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(lakeformation.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, lakeformation.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckPermissionsDestroy(ctx), @@ -379,7 +379,7 @@ func testAccPermissions_tableMultipleRoles(t *testing.T) { tableName := "aws_glue_catalog_table.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(lakeformation.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(lakeformation.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, lakeformation.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckPermissionsDestroy(ctx), @@ -417,7 +417,7 @@ func testAccPermissions_tableSelectOnly(t *testing.T) { tableName := "aws_glue_catalog_table.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(lakeformation.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(lakeformation.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, lakeformation.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckPermissionsDestroy(ctx), @@ -445,7 +445,7 @@ func testAccPermissions_tableSelectPlus(t *testing.T) { roleName := "aws_iam_role.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(lakeformation.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(lakeformation.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, lakeformation.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckPermissionsDestroy(ctx), @@ -470,7 +470,7 @@ func testAccPermissions_tableWildcardNoSelect(t *testing.T) { databaseResourceName := "aws_glue_catalog_database.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(lakeformation.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(lakeformation.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, lakeformation.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckPermissionsDestroy(ctx), @@ -495,7 +495,7 @@ func testAccPermissions_tableWildcardSelectOnly(t *testing.T) { roleName := "aws_iam_role.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(lakeformation.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(lakeformation.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, lakeformation.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckPermissionsDestroy(ctx), @@ -521,7 +521,7 @@ func testAccPermissions_tableWildcardSelectPlus(t *testing.T) { roleName := "aws_iam_role.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(lakeformation.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(lakeformation.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, lakeformation.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckPermissionsDestroy(ctx), @@ -547,7 +547,7 @@ func testAccPermissions_twcBasic(t *testing.T) { tableName := "aws_glue_catalog_table.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(lakeformation.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(lakeformation.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, lakeformation.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckPermissionsDestroy(ctx), @@ -624,7 +624,7 @@ func testAccPermissions_twcImplicit(t *testing.T) { tableName := "aws_glue_catalog_table.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(lakeformation.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(lakeformation.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, lakeformation.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckPermissionsDestroy(ctx), @@ -653,7 +653,7 @@ func testAccPermissions_twcWildcardExcludedColumns(t *testing.T) { roleName := "aws_iam_role.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(lakeformation.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(lakeformation.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, lakeformation.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckPermissionsDestroy(ctx), @@ -679,7 +679,7 @@ func testAccPermissions_twcWildcardSelectOnly(t *testing.T) { tableName := "aws_glue_catalog_table.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(lakeformation.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(lakeformation.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, lakeformation.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckPermissionsDestroy(ctx), @@ -709,7 +709,7 @@ func testAccPermissions_twcWildcardSelectPlus(t *testing.T) { roleName := "aws_iam_role.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(lakeformation.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(lakeformation.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, lakeformation.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckPermissionsDestroy(ctx), diff --git a/internal/service/lakeformation/resource_data_source_test.go b/internal/service/lakeformation/resource_data_source_test.go index 13e86fe91ad3..1691fca3c604 100644 --- a/internal/service/lakeformation/resource_data_source_test.go +++ b/internal/service/lakeformation/resource_data_source_test.go @@ -17,7 +17,7 @@ func TestAccLakeFormationResourceDataSource_basic(t *testing.T) { resourceName := "aws_lakeformation_resource.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(lakeformation.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(lakeformation.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, lakeformation.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckResourceDestroy(ctx), diff --git a/internal/service/lakeformation/resource_lf_tags_test.go b/internal/service/lakeformation/resource_lf_tags_test.go index 04620bb34793..8588cecc8ddf 100644 --- a/internal/service/lakeformation/resource_lf_tags_test.go +++ b/internal/service/lakeformation/resource_lf_tags_test.go @@ -23,7 +23,7 @@ func testAccResourceLFTags_basic(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(lakeformation.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(lakeformation.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, lakeformation.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDatabaseLFTagsDestroy(ctx), @@ -50,7 +50,7 @@ func testAccResourceLFTags_database(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(lakeformation.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(lakeformation.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, lakeformation.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDatabaseLFTagsDestroy(ctx), @@ -86,7 +86,7 @@ func testAccResourceLFTags_databaseMultiple(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(lakeformation.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(lakeformation.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, lakeformation.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDatabaseLFTagsDestroy(ctx), @@ -130,7 +130,7 @@ func testAccResourceLFTags_table(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(lakeformation.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(lakeformation.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, lakeformation.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDatabaseLFTagsDestroy(ctx), @@ -166,7 +166,7 @@ func testAccResourceLFTags_tableWithColumns(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(lakeformation.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(lakeformation.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, lakeformation.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDatabaseLFTagsDestroy(ctx), diff --git a/internal/service/lakeformation/resource_test.go b/internal/service/lakeformation/resource_test.go index 9e749229ea7e..23187362554f 100644 --- a/internal/service/lakeformation/resource_test.go +++ b/internal/service/lakeformation/resource_test.go @@ -25,7 +25,7 @@ func TestAccLakeFormationResource_basic(t *testing.T) { roleAddr := "aws_iam_role.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(lakeformation.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(lakeformation.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, lakeformation.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckResourceDestroy(ctx), @@ -48,7 +48,7 @@ func TestAccLakeFormationResource_disappears(t *testing.T) { resourceName := "aws_lakeformation_resource.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(lakeformation.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(lakeformation.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, lakeformation.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckResourceDestroy(ctx), @@ -73,7 +73,7 @@ func TestAccLakeFormationResource_serviceLinkedRole(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(lakeformation.EndpointsID, t) acctest.PreCheckIAMServiceLinkedRole(ctx, t, "/aws-service-role/lakeformation.amazonaws.com") }, @@ -103,7 +103,7 @@ func TestAccLakeFormationResource_updateRoleToRole(t *testing.T) { roleAddr := "aws_iam_role.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(lakeformation.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(lakeformation.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, lakeformation.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckResourceDestroy(ctx), @@ -138,7 +138,7 @@ func TestAccLakeFormationResource_updateSLRToRole(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(lakeformation.EndpointsID, t) acctest.PreCheckIAMServiceLinkedRole(ctx, t, "/aws-service-role/lakeformation.amazonaws.com") }, From dd0e844c46874719e845899c894e4d0f29014c7d Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Fri, 24 Feb 2023 16:37:08 -0500 Subject: [PATCH 184/763] Add 'Context' argument to 'acctest.PreCheck' for lambda. --- .../service/lambda/alias_data_source_test.go | 2 +- internal/service/lambda/alias_test.go | 8 +- .../code_signing_config_data_source_test.go | 6 +- .../lambda/code_signing_config_test.go | 6 +- .../lambda/event_source_mapping_test.go | 54 +++++------ .../lambda/function_data_source_test.go | 24 ++--- .../function_event_invoke_config_test.go | 28 +++--- internal/service/lambda/function_test.go | 94 +++++++++---------- .../lambda/function_url_data_source_test.go | 2 +- internal/service/lambda/function_url_test.go | 8 +- .../lambda/functions_data_source_test.go | 2 +- .../lambda/invocation_data_source_test.go | 6 +- internal/service/lambda/invocation_test.go | 8 +- .../lambda/layer_version_data_source_test.go | 8 +- .../lambda/layer_version_permission_test.go | 10 +- internal/service/lambda/layer_version_test.go | 16 ++-- internal/service/lambda/permission_test.go | 26 ++--- .../provisioned_concurrency_config_test.go | 10 +- 18 files changed, 159 insertions(+), 159 deletions(-) diff --git a/internal/service/lambda/alias_data_source_test.go b/internal/service/lambda/alias_data_source_test.go index d0add63c15af..2e511115aec7 100644 --- a/internal/service/lambda/alias_data_source_test.go +++ b/internal/service/lambda/alias_data_source_test.go @@ -17,7 +17,7 @@ func TestAccLambdaAliasDataSource_basic(t *testing.T) { resourceName := "aws_lambda_alias.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, lambda.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ diff --git a/internal/service/lambda/alias_test.go b/internal/service/lambda/alias_test.go index 41e357acd99b..7d72b92a2858 100644 --- a/internal/service/lambda/alias_test.go +++ b/internal/service/lambda/alias_test.go @@ -29,7 +29,7 @@ func TestAccLambdaAlias_basic(t *testing.T) { functionArnResourcePart := fmt.Sprintf("function:%s:%s", funcName, aliasName) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, lambda.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckAliasDestroy(ctx), @@ -66,7 +66,7 @@ func TestAccLambdaAlias_FunctionName_name(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, lambda.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckAliasDestroy(ctx), @@ -108,7 +108,7 @@ func TestAccLambdaAlias_nameUpdate(t *testing.T) { functionArnResourcePartUpdate := fmt.Sprintf("function:%s:%s", funcName, aliasNameUpdate) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, lambda.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckAliasDestroy(ctx), @@ -154,7 +154,7 @@ func TestAccLambdaAlias_routing(t *testing.T) { functionArnResourcePart := fmt.Sprintf("function:%s:%s", funcName, aliasName) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, lambda.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckAliasDestroy(ctx), 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 e0b9936f1cff..60581fbcdb03 100644 --- a/internal/service/lambda/code_signing_config_data_source_test.go +++ b/internal/service/lambda/code_signing_config_data_source_test.go @@ -12,7 +12,7 @@ func TestAccLambdaCodeSigningConfigDataSource_basic(t *testing.T) { dataSourceName := "data.aws_lambda_code_signing_config.test" resourceName := "aws_lambda_code_signing_config.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, lambda.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ @@ -31,7 +31,7 @@ func TestAccLambdaCodeSigningConfigDataSource_policyID(t *testing.T) { dataSourceName := "data.aws_lambda_code_signing_config.test" resourceName := "aws_lambda_code_signing_config.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, lambda.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ @@ -52,7 +52,7 @@ func TestAccLambdaCodeSigningConfigDataSource_description(t *testing.T) { dataSourceName := "data.aws_lambda_code_signing_config.test" resourceName := "aws_lambda_code_signing_config.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, lambda.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ diff --git a/internal/service/lambda/code_signing_config_test.go b/internal/service/lambda/code_signing_config_test.go index ba1280399e07..9ea2f54a28cb 100644 --- a/internal/service/lambda/code_signing_config_test.go +++ b/internal/service/lambda/code_signing_config_test.go @@ -22,7 +22,7 @@ func TestAccLambdaCodeSigningConfig_basic(t *testing.T) { var conf lambda.GetCodeSigningConfigOutput resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, lambda.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckCodeSigningConfigDestroy(ctx), @@ -53,7 +53,7 @@ func TestAccLambdaCodeSigningConfig_updatePolicy(t *testing.T) { var conf lambda.GetCodeSigningConfigOutput resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, lambda.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckCodeSigningConfigDestroy(ctx), @@ -90,7 +90,7 @@ func TestAccLambdaCodeSigningConfig_updatePublishers(t *testing.T) { var conf lambda.GetCodeSigningConfigOutput resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, lambda.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckCodeSigningConfigDestroy(ctx), diff --git a/internal/service/lambda/event_source_mapping_test.go b/internal/service/lambda/event_source_mapping_test.go index 5075cb15a5d2..9e79bb62fb23 100644 --- a/internal/service/lambda/event_source_mapping_test.go +++ b/internal/service/lambda/event_source_mapping_test.go @@ -32,7 +32,7 @@ func TestAccLambdaEventSourceMapping_Kinesis_basic(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, lambda.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckEventSourceMappingDestroy(ctx), @@ -89,7 +89,7 @@ func TestAccLambdaEventSourceMapping_SQS_basic(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, lambda.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckEventSourceMappingDestroy(ctx), @@ -146,7 +146,7 @@ func TestAccLambdaEventSourceMapping_DynamoDB_basic(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, lambda.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckEventSourceMappingDestroy(ctx), @@ -189,7 +189,7 @@ func TestAccLambdaEventSourceMapping_DynamoDB_functionResponseTypes(t *testing.T rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, lambda.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckEventSourceMappingDestroy(ctx), @@ -227,7 +227,7 @@ func TestAccLambdaEventSourceMapping_DynamoDB_streamAdded(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, lambda.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckEventSourceMappingDestroy(ctx), @@ -260,7 +260,7 @@ func TestAccLambdaEventSourceMapping_SQS_batchWindow(t *testing.T) { batchWindowUpdate := int64(100) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, lambda.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckEventSourceMappingDestroy(ctx), @@ -296,7 +296,7 @@ func TestAccLambdaEventSourceMapping_disappears(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, lambda.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckEventSourceMappingDestroy(ctx), @@ -320,7 +320,7 @@ func TestAccLambdaEventSourceMapping_SQS_changesInEnabledAreDetected(t *testing. rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, lambda.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckEventSourceMappingDestroy(ctx), @@ -345,7 +345,7 @@ func TestAccLambdaEventSourceMapping_Kinesis_startingPositionTimestamp(t *testin startingPositionTimestamp := time.Now().UTC().Format(time.RFC3339) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, lambda.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckEventSourceMappingDestroy(ctx), @@ -377,7 +377,7 @@ func TestAccLambdaEventSourceMapping_Kinesis_batchWindow(t *testing.T) { batchWindowUpdate := int64(10) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, lambda.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckEventSourceMappingDestroy(ctx), @@ -415,7 +415,7 @@ func TestAccLambdaEventSourceMapping_Kinesis_parallelizationFactor(t *testing.T) parallelizationFactorUpdate := int64(5) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, lambda.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckEventSourceMappingDestroy(ctx), @@ -453,7 +453,7 @@ func TestAccLambdaEventSourceMapping_Kinesis_tumblingWindowInSeconds(t *testing. tumblingWindowInSecondsUpdate := int64(300) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, lambda.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckEventSourceMappingDestroy(ctx), @@ -495,7 +495,7 @@ func TestAccLambdaEventSourceMapping_Kinesis_maximumRetryAttempts(t *testing.T) maximumRetryAttemptsUpdate := int64(100) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, lambda.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckEventSourceMappingDestroy(ctx), @@ -533,7 +533,7 @@ func TestAccLambdaEventSourceMapping_Kinesis_maximumRetryAttemptsZero(t *testing maximumRetryAttemptsUpdate := int64(100) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, lambda.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckEventSourceMappingDestroy(ctx), @@ -578,7 +578,7 @@ func TestAccLambdaEventSourceMapping_Kinesis_maximumRetryAttemptsNegativeOne(t * maximumRetryAttemptsUpdate := int64(100) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, lambda.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckEventSourceMappingDestroy(ctx), @@ -623,7 +623,7 @@ func TestAccLambdaEventSourceMapping_Kinesis_maximumRecordAgeInSeconds(t *testin maximumRecordAgeInSecondsUpdate := int64(3600) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, lambda.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckEventSourceMappingDestroy(ctx), @@ -661,7 +661,7 @@ func TestAccLambdaEventSourceMapping_Kinesis_maximumRecordAgeInSecondsNegativeOn maximumRecordAgeInSecondsUpdate := int64(3600) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, lambda.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckEventSourceMappingDestroy(ctx), @@ -699,7 +699,7 @@ func TestAccLambdaEventSourceMapping_Kinesis_bisectBatch(t *testing.T) { bisectBatchUpdate := true resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, lambda.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckEventSourceMappingDestroy(ctx), @@ -736,7 +736,7 @@ func TestAccLambdaEventSourceMapping_Kinesis_destination(t *testing.T) { snsResourceName := "aws_sns_topic.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, lambda.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckEventSourceMappingDestroy(ctx), @@ -781,7 +781,7 @@ func TestAccLambdaEventSourceMapping_msk(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckMSK(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckMSK(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, lambda.EndpointsID, "kafka"), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckEventSourceMappingDestroy(ctx), @@ -839,7 +839,7 @@ func TestAccLambdaEventSourceMapping_mskWithEventSourceConfig(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckMSK(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckMSK(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, lambda.EndpointsID, "kafka"), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckEventSourceMappingDestroy(ctx), @@ -874,7 +874,7 @@ func TestAccLambdaEventSourceMapping_selfManagedKafka(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, lambda.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckEventSourceMappingDestroy(ctx), @@ -919,7 +919,7 @@ func TestAccLambdaEventSourceMapping_selfManagedKafkaWithEventSourceConfig(t *te rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, lambda.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckEventSourceMappingDestroy(ctx), @@ -962,7 +962,7 @@ func TestAccLambdaEventSourceMapping_activeMQ(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) testAccPreCheckSecretsManager(ctx, t) acctest.PreCheckPartitionHasService("mq", t) testAccPreCheckMQ(ctx, t) @@ -1005,7 +1005,7 @@ func TestAccLambdaEventSourceMapping_rabbitMQ(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) testAccPreCheckSecretsManager(ctx, t) acctest.PreCheckPartitionHasService("mq", t) testAccPreCheckMQ(ctx, t) @@ -1049,7 +1049,7 @@ func TestAccLambdaEventSourceMapping_SQS_filterCriteria(t *testing.T) { pattern2 := "{\"Location\": [\"New York\"], \"Day\": [\"Monday\"]}" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, lambda.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckEventSourceMappingDestroy(ctx), @@ -1122,7 +1122,7 @@ func TestAccLambdaEventSourceMapping_SQS_scalingConfig(t *testing.T) { resourceName := "aws_lambda_event_source_mapping.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, lambda.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckEventSourceMappingDestroy(ctx), diff --git a/internal/service/lambda/function_data_source_test.go b/internal/service/lambda/function_data_source_test.go index 8ed7a974f684..634a9139d4f7 100644 --- a/internal/service/lambda/function_data_source_test.go +++ b/internal/service/lambda/function_data_source_test.go @@ -17,7 +17,7 @@ func TestAccLambdaFunctionDataSource_basic(t *testing.T) { resourceName := "aws_lambda_function.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, lambda.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ @@ -61,7 +61,7 @@ func TestAccLambdaFunctionDataSource_version(t *testing.T) { resourceName := "aws_lambda_function.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, lambda.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ @@ -86,7 +86,7 @@ func TestAccLambdaFunctionDataSource_latestVersion(t *testing.T) { resourceName := "aws_lambda_function.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, lambda.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ @@ -110,7 +110,7 @@ func TestAccLambdaFunctionDataSource_unpublishedVersion(t *testing.T) { resourceName := "aws_lambda_function.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, lambda.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ @@ -135,7 +135,7 @@ func TestAccLambdaFunctionDataSource_alias(t *testing.T) { resourceName := "aws_lambda_function.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, lambda.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ @@ -158,7 +158,7 @@ func TestAccLambdaFunctionDataSource_layers(t *testing.T) { resourceName := "aws_lambda_function.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, lambda.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ @@ -183,7 +183,7 @@ func TestAccLambdaFunctionDataSource_vpc(t *testing.T) { resourceName := "aws_lambda_function.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, lambda.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ @@ -206,7 +206,7 @@ func TestAccLambdaFunctionDataSource_environment(t *testing.T) { resourceName := "aws_lambda_function.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, lambda.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ @@ -234,7 +234,7 @@ func TestAccLambdaFunctionDataSource_fileSystem(t *testing.T) { resourceName := "aws_lambda_function.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, lambda.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ @@ -259,7 +259,7 @@ func TestAccLambdaFunctionDataSource_image(t *testing.T) { imageLatestID := os.Getenv("AWS_LAMBDA_IMAGE_LATEST_ID") resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccImageLatestPreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccImageLatestPreCheck(t) }, ErrorCheck: acctest.ErrorCheck(t, lambda.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ @@ -280,7 +280,7 @@ func TestAccLambdaFunctionDataSource_architectures(t *testing.T) { resourceName := "aws_lambda_function.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, lambda.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ @@ -300,7 +300,7 @@ func TestAccLambdaFunctionDataSource_ephemeralStorage(t *testing.T) { resourceName := "aws_lambda_function.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, lambda.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ diff --git a/internal/service/lambda/function_event_invoke_config_test.go b/internal/service/lambda/function_event_invoke_config_test.go index 93f6e4f78ffd..d70c42d94534 100644 --- a/internal/service/lambda/function_event_invoke_config_test.go +++ b/internal/service/lambda/function_event_invoke_config_test.go @@ -27,7 +27,7 @@ func TestAccLambdaFunctionEventInvokeConfig_basic(t *testing.T) { resourceName := "aws_lambda_function_event_invoke_config.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, lambda.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckFunctionEventInvokeConfigDestroy(ctx), @@ -60,7 +60,7 @@ func TestAccLambdaFunctionEventInvokeConfig_Disappears_lambdaFunction(t *testing resourceName := "aws_lambda_function_event_invoke_config.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, lambda.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckFunctionEventInvokeConfigDestroy(ctx), @@ -84,7 +84,7 @@ func TestAccLambdaFunctionEventInvokeConfig_Disappears_lambdaFunctionEventInvoke resourceName := "aws_lambda_function_event_invoke_config.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, lambda.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckFunctionEventInvokeConfigDestroy(ctx), @@ -113,7 +113,7 @@ func TestAccLambdaFunctionEventInvokeConfig_DestinationOnFailure_destination(t * snsTopicResourceName := "aws_sns_topic.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, lambda.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckFunctionEventInvokeConfigDestroy(ctx), @@ -157,7 +157,7 @@ func TestAccLambdaFunctionEventInvokeConfig_DestinationOnSuccess_destination(t * snsTopicResourceName := "aws_sns_topic.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, lambda.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckFunctionEventInvokeConfigDestroy(ctx), @@ -200,7 +200,7 @@ func TestAccLambdaFunctionEventInvokeConfig_Destination_remove(t *testing.T) { sqsQueueResourceName := "aws_sqs_queue.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, lambda.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckFunctionEventInvokeConfigDestroy(ctx), @@ -241,7 +241,7 @@ func TestAccLambdaFunctionEventInvokeConfig_Destination_swap(t *testing.T) { sqsQueueResourceName := "aws_sqs_queue.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, lambda.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckFunctionEventInvokeConfigDestroy(ctx), @@ -284,7 +284,7 @@ func TestAccLambdaFunctionEventInvokeConfig_FunctionName_arn(t *testing.T) { resourceName := "aws_lambda_function_event_invoke_config.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, lambda.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckFunctionEventInvokeConfigDestroy(ctx), @@ -317,7 +317,7 @@ func TestAccLambdaFunctionEventInvokeConfig_QualifierFunctionName_arn(t *testing resourceName := "aws_lambda_function_event_invoke_config.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, lambda.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckFunctionEventInvokeConfigDestroy(ctx), @@ -349,7 +349,7 @@ func TestAccLambdaFunctionEventInvokeConfig_maximumEventAgeInSeconds(t *testing. resourceName := "aws_lambda_function_event_invoke_config.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, lambda.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckFunctionEventInvokeConfigDestroy(ctx), @@ -387,7 +387,7 @@ func TestAccLambdaFunctionEventInvokeConfig_maximumRetryAttempts(t *testing.T) { resourceName := "aws_lambda_function_event_invoke_config.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, lambda.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckFunctionEventInvokeConfigDestroy(ctx), @@ -429,7 +429,7 @@ func TestAccLambdaFunctionEventInvokeConfig_Qualifier_aliasName(t *testing.T) { resourceName := "aws_lambda_function_event_invoke_config.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, lambda.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckFunctionEventInvokeConfigDestroy(ctx), @@ -457,7 +457,7 @@ func TestAccLambdaFunctionEventInvokeConfig_Qualifier_functionVersion(t *testing resourceName := "aws_lambda_function_event_invoke_config.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, lambda.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckFunctionEventInvokeConfigDestroy(ctx), @@ -485,7 +485,7 @@ func TestAccLambdaFunctionEventInvokeConfig_Qualifier_latest(t *testing.T) { resourceName := "aws_lambda_function_event_invoke_config.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, lambda.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckFunctionEventInvokeConfigDestroy(ctx), diff --git a/internal/service/lambda/function_test.go b/internal/service/lambda/function_test.go index 4391665f476c..14c40a7065ce 100644 --- a/internal/service/lambda/function_test.go +++ b/internal/service/lambda/function_test.go @@ -46,7 +46,7 @@ func TestAccLambdaFunction_basic(t *testing.T) { sgName := fmt.Sprintf("tf_acc_sg_lambda_func_basic_%s", rString) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, lambda.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckFunctionDestroy(ctx), @@ -86,7 +86,7 @@ func TestAccLambdaFunction_disappears(t *testing.T) { resourceName := "aws_lambda_function.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, lambda.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckFunctionDestroy(ctx), @@ -110,7 +110,7 @@ func TestAccLambdaFunction_tags(t *testing.T) { resourceName := "aws_lambda_function.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, lambda.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckFunctionDestroy(ctx), @@ -170,7 +170,7 @@ func TestAccLambdaFunction_unpublishedCodeUpdate(t *testing.T) { var timeBeforeUpdate time.Time resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, lambda.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckFunctionDestroy(ctx), @@ -223,7 +223,7 @@ func TestAccLambdaFunction_codeSigning(t *testing.T) { cscUpdateResourceName := "aws_lambda_code_signing_config.code_signing_config_2" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckSignerSigningProfile(ctx, t, "AWSLambda-SHA384-ECDSA") }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckSignerSigningProfile(ctx, t, "AWSLambda-SHA384-ECDSA") }, ErrorCheck: acctest.ErrorCheck(t, lambda.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckFunctionDestroy(ctx), @@ -276,7 +276,7 @@ func TestAccLambdaFunction_concurrency(t *testing.T) { resourceName := "aws_lambda_function.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, lambda.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckFunctionDestroy(ctx), @@ -316,7 +316,7 @@ func TestAccLambdaFunction_concurrencyCycle(t *testing.T) { resourceName := "aws_lambda_function.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, lambda.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckFunctionDestroy(ctx), @@ -357,7 +357,7 @@ func TestAccLambdaFunction_expectFilenameAndS3Attributes(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, lambda.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckFunctionDestroy(ctx), @@ -381,7 +381,7 @@ func TestAccLambdaFunction_envVariables(t *testing.T) { resourceName := "aws_lambda_function.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, lambda.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckFunctionDestroy(ctx), @@ -436,7 +436,7 @@ func TestAccLambdaFunction_EnvironmentVariables_noValue(t *testing.T) { resourceName := "aws_lambda_function.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, lambda.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckFunctionDestroy(ctx), @@ -471,7 +471,7 @@ func TestAccLambdaFunction_encryptedEnvVariables(t *testing.T) { kmsKey2ResourceName := "aws_kms_key.test2" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, lambda.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckFunctionDestroy(ctx), @@ -516,7 +516,7 @@ func TestAccLambdaFunction_nameValidation(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, lambda.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckFunctionDestroy(ctx), @@ -542,7 +542,7 @@ func TestAccLambdaFunction_versioned(t *testing.T) { version := "1" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, lambda.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckFunctionDestroy(ctx), @@ -587,7 +587,7 @@ func TestAccLambdaFunction_versionedUpdate(t *testing.T) { versionUpdated := "3" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, lambda.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckFunctionDestroy(ctx), @@ -658,7 +658,7 @@ func TestAccLambdaFunction_enablePublish(t *testing.T) { publishedVersion := "1" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, lambda.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckFunctionDestroy(ctx), @@ -716,7 +716,7 @@ func TestAccLambdaFunction_disablePublish(t *testing.T) { unpublishedVersion := publishedVersion // Should remain the last published version resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, lambda.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckFunctionDestroy(ctx), @@ -761,7 +761,7 @@ func TestAccLambdaFunction_deadLetter(t *testing.T) { resourceName := "aws_lambda_function.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, lambda.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckFunctionDestroy(ctx), @@ -804,7 +804,7 @@ func TestAccLambdaFunction_deadLetterUpdated(t *testing.T) { resourceName := "aws_lambda_function.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, lambda.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckFunctionDestroy(ctx), @@ -844,7 +844,7 @@ func TestAccLambdaFunction_nilDeadLetter(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, lambda.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckFunctionDestroy(ctx), @@ -869,7 +869,7 @@ func TestAccLambdaFunction_fileSystem(t *testing.T) { resourceName := "aws_lambda_function.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, lambda.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckFunctionDestroy(ctx), @@ -940,7 +940,7 @@ func TestAccLambdaFunction_image(t *testing.T) { resourceName := "aws_lambda_function.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, lambda.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckFunctionDestroy(ctx), @@ -998,7 +998,7 @@ func TestAccLambdaFunction_architectures(t *testing.T) { resourceName := "aws_lambda_function.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, lambda.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckFunctionDestroy(ctx), @@ -1049,7 +1049,7 @@ func TestAccLambdaFunction_architecturesUpdate(t *testing.T) { resourceName := "aws_lambda_function.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, lambda.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckFunctionDestroy(ctx), @@ -1100,7 +1100,7 @@ func TestAccLambdaFunction_architecturesWithLayer(t *testing.T) { resourceName := "aws_lambda_function.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, lambda.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckFunctionDestroy(ctx), @@ -1147,7 +1147,7 @@ func TestAccLambdaFunction_ephemeralStorage(t *testing.T) { resourceName := "aws_lambda_function.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, lambda.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckFunctionDestroy(ctx), @@ -1190,7 +1190,7 @@ func TestAccLambdaFunction_tracing(t *testing.T) { resourceName := "aws_lambda_function.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionNot(t, endpoints.AwsUsGovPartitionID) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionNot(t, endpoints.AwsUsGovPartitionID) }, ErrorCheck: acctest.ErrorCheck(t, lambda.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckFunctionDestroy(ctx), @@ -1236,7 +1236,7 @@ func TestAccLambdaFunction_KMSKeyARN_noEnvironmentVariables(t *testing.T) { resourceName := "aws_lambda_function.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, lambda.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckFunctionDestroy(ctx), @@ -1270,7 +1270,7 @@ func TestAccLambdaFunction_layers(t *testing.T) { resourceName := "aws_lambda_function.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, lambda.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckFunctionDestroy(ctx), @@ -1304,7 +1304,7 @@ func TestAccLambdaFunction_layersUpdate(t *testing.T) { resourceName := "aws_lambda_function.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, lambda.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckFunctionDestroy(ctx), @@ -1346,7 +1346,7 @@ func TestAccLambdaFunction_vpc(t *testing.T) { resourceName := "aws_lambda_function.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, lambda.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckFunctionDestroy(ctx), @@ -1382,7 +1382,7 @@ func TestAccLambdaFunction_vpcRemoval(t *testing.T) { resourceName := "aws_lambda_function.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, lambda.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckFunctionDestroy(ctx), @@ -1422,7 +1422,7 @@ func TestAccLambdaFunction_vpcUpdate(t *testing.T) { resourceName := "aws_lambda_function.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, lambda.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckFunctionDestroy(ctx), @@ -1471,7 +1471,7 @@ func TestAccLambdaFunction_VPC_withInvocation(t *testing.T) { resourceName := "aws_lambda_function.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, lambda.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckFunctionDestroy(ctx), @@ -1506,7 +1506,7 @@ func TestAccLambdaFunction_VPCPublishNo_changes(t *testing.T) { resourceName := "aws_lambda_function.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, lambda.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckFunctionDestroy(ctx), @@ -1548,7 +1548,7 @@ func TestAccLambdaFunction_VPCPublishHas_changes(t *testing.T) { resourceName := "aws_lambda_function.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, lambda.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckFunctionDestroy(ctx), @@ -1591,7 +1591,7 @@ func TestAccLambdaFunction_VPC_properIAMDependencies(t *testing.T) { vpcResourceName := "aws_vpc.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, lambda.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckFunctionDestroy(ctx), @@ -1622,7 +1622,7 @@ func TestAccLambdaFunction_VPC_replaceSGWithDefault(t *testing.T) { vpcResourceName := "aws_vpc.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, lambda.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckFunctionDestroy(ctx), @@ -1655,7 +1655,7 @@ func TestAccLambdaFunction_VPC_replaceSGWithCustom(t *testing.T) { replacementSGName := "aws_security_group.test_replacement" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, lambda.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckFunctionDestroy(ctx), @@ -1684,7 +1684,7 @@ func TestAccLambdaFunction_emptyVPC(t *testing.T) { resourceName := "aws_lambda_function.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, lambda.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckFunctionDestroy(ctx), @@ -1713,7 +1713,7 @@ func TestAccLambdaFunction_s3(t *testing.T) { resourceName := "aws_lambda_function.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, lambda.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckFunctionDestroy(ctx), @@ -1754,7 +1754,7 @@ func TestAccLambdaFunction_localUpdate(t *testing.T) { var timeBeforeUpdate time.Time resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, lambda.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckFunctionDestroy(ctx), @@ -1820,7 +1820,7 @@ func TestAccLambdaFunction_LocalUpdate_nameOnly(t *testing.T) { defer os.Remove(updatedPath) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, lambda.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckFunctionDestroy(ctx), @@ -1874,7 +1874,7 @@ func TestAccLambdaFunction_S3Update_basic(t *testing.T) { key := "lambda-func.zip" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, lambda.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckFunctionDestroy(ctx), @@ -1930,7 +1930,7 @@ func TestAccLambdaFunction_S3Update_unversioned(t *testing.T) { key2 := "lambda-func-modified.zip" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, lambda.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckFunctionDestroy(ctx), @@ -1978,7 +1978,7 @@ func TestAccLambdaFunction_snapStart(t *testing.T) { resourceName := "aws_lambda_function.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, lambda.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckFunctionDestroy(ctx), @@ -2071,7 +2071,7 @@ func TestAccLambdaFunction_runtimes(t *testing.T) { }) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, lambda.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckFunctionDestroy(ctx), @@ -2084,7 +2084,7 @@ func TestAccLambdaFunction_Zip_validation(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, lambda.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckFunctionDestroy(ctx), diff --git a/internal/service/lambda/function_url_data_source_test.go b/internal/service/lambda/function_url_data_source_test.go index 745113ca51b7..4fddb0525c59 100644 --- a/internal/service/lambda/function_url_data_source_test.go +++ b/internal/service/lambda/function_url_data_source_test.go @@ -16,7 +16,7 @@ func TestAccLambdaFunctionURLDataSource_basic(t *testing.T) { resourceName := "aws_lambda_function_url.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccFunctionURLPreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccFunctionURLPreCheck(t) }, ErrorCheck: acctest.ErrorCheck(t, lambda.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ diff --git a/internal/service/lambda/function_url_test.go b/internal/service/lambda/function_url_test.go index 71119e17c0e9..6c8006156bea 100644 --- a/internal/service/lambda/function_url_test.go +++ b/internal/service/lambda/function_url_test.go @@ -30,7 +30,7 @@ func TestAccLambdaFunctionURL_basic(t *testing.T) { roleName := fmt.Sprintf("tf_acc_role_lambda_func_basic_%s", rString) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccFunctionURLPreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccFunctionURLPreCheck(t) }, ErrorCheck: acctest.ErrorCheck(t, lambda.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckFunctionURLDestroy(ctx), @@ -68,7 +68,7 @@ func TestAccLambdaFunctionURL_Cors(t *testing.T) { roleName := fmt.Sprintf("tf_acc_role_lambda_func_basic_%s", rString) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccFunctionURLPreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccFunctionURLPreCheck(t) }, ErrorCheck: acctest.ErrorCheck(t, lambda.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckFunctionURLDestroy(ctx), @@ -142,7 +142,7 @@ func TestAccLambdaFunctionURL_Alias(t *testing.T) { roleName := fmt.Sprintf("tf_acc_role_lambda_func_basic_%s", rString) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccFunctionURLPreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccFunctionURLPreCheck(t) }, ErrorCheck: acctest.ErrorCheck(t, lambda.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckFunctionURLDestroy(ctx), @@ -176,7 +176,7 @@ func TestAccLambdaFunctionURL_TwoURLs(t *testing.T) { roleName := fmt.Sprintf("tf_acc_role_lambda_func_basic_%s", rString) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccFunctionURLPreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccFunctionURLPreCheck(t) }, ErrorCheck: acctest.ErrorCheck(t, lambda.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckFunctionURLDestroy(ctx), diff --git a/internal/service/lambda/functions_data_source_test.go b/internal/service/lambda/functions_data_source_test.go index 8074ab5f71bf..f05490f32046 100644 --- a/internal/service/lambda/functions_data_source_test.go +++ b/internal/service/lambda/functions_data_source_test.go @@ -14,7 +14,7 @@ func TestAccLambdaFunctionsDataSource_basic(t *testing.T) { dataSourceName := "data.aws_lambda_functions.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, lambda.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ diff --git a/internal/service/lambda/invocation_data_source_test.go b/internal/service/lambda/invocation_data_source_test.go index d88683884744..478643bbd53a 100644 --- a/internal/service/lambda/invocation_data_source_test.go +++ b/internal/service/lambda/invocation_data_source_test.go @@ -42,7 +42,7 @@ func TestAccLambdaInvocationDataSource_basic(t *testing.T) { testData := "value3" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, lambda.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ @@ -61,7 +61,7 @@ func TestAccLambdaInvocationDataSource_qualifier(t *testing.T) { testData := "value3" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, lambda.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ @@ -80,7 +80,7 @@ func TestAccLambdaInvocationDataSource_complex(t *testing.T) { testData := "value3" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, lambda.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ diff --git a/internal/service/lambda/invocation_test.go b/internal/service/lambda/invocation_test.go index b307f362597b..568cf379a092 100644 --- a/internal/service/lambda/invocation_test.go +++ b/internal/service/lambda/invocation_test.go @@ -17,7 +17,7 @@ func TestAccLambdaInvocation_basic(t *testing.T) { testData := "value3" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, lambda.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckInvocationDestroy, @@ -38,7 +38,7 @@ func TestAccLambdaInvocation_qualifier(t *testing.T) { testData := "value3" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, lambda.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckInvocationDestroy, @@ -59,7 +59,7 @@ func TestAccLambdaInvocation_complex(t *testing.T) { testData := "value3" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, lambda.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckInvocationDestroy, @@ -81,7 +81,7 @@ func TestAccLambdaInvocation_triggers(t *testing.T) { testData2 := "value4" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, lambda.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckInvocationDestroy, diff --git a/internal/service/lambda/layer_version_data_source_test.go b/internal/service/lambda/layer_version_data_source_test.go index 03e03f690456..8a7ff507fa2f 100644 --- a/internal/service/lambda/layer_version_data_source_test.go +++ b/internal/service/lambda/layer_version_data_source_test.go @@ -16,7 +16,7 @@ func TestAccLambdaLayerVersionDataSource_basic(t *testing.T) { resourceName := "aws_lambda_layer_version.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, lambda.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ @@ -47,7 +47,7 @@ func TestAccLambdaLayerVersionDataSource_version(t *testing.T) { resourceName := "aws_lambda_layer_version.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, lambda.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ @@ -68,7 +68,7 @@ func TestAccLambdaLayerVersionDataSource_runtime(t *testing.T) { resourceName := "aws_lambda_layer_version.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, lambda.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ @@ -89,7 +89,7 @@ func TestAccLambdaLayerVersionDataSource_architectures(t *testing.T) { resourceName := "aws_lambda_layer_version.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, lambda.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ diff --git a/internal/service/lambda/layer_version_permission_test.go b/internal/service/lambda/layer_version_permission_test.go index 9c54b131d6e8..9d618356aa0d 100644 --- a/internal/service/lambda/layer_version_permission_test.go +++ b/internal/service/lambda/layer_version_permission_test.go @@ -22,7 +22,7 @@ func TestAccLambdaLayerVersionPermission_basic_byARN(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, lambda.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckLayerVersionPermissionDestroy(ctx), @@ -52,7 +52,7 @@ func TestAccLambdaLayerVersionPermission_basic_byName(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, lambda.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckLayerVersionPermissionDestroy(ctx), @@ -82,7 +82,7 @@ func TestAccLambdaLayerVersionPermission_org(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, lambda.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckLayerVersionPermissionDestroy(ctx), @@ -113,7 +113,7 @@ func TestAccLambdaLayerVersionPermission_account(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, lambda.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckLayerVersionPermissionDestroy(ctx), @@ -143,7 +143,7 @@ func TestAccLambdaLayerVersionPermission_disappears(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, lambda.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckLayerVersionPermissionDestroy(ctx), diff --git a/internal/service/lambda/layer_version_test.go b/internal/service/lambda/layer_version_test.go index 859474cfa43e..4565ac0e0fbc 100644 --- a/internal/service/lambda/layer_version_test.go +++ b/internal/service/lambda/layer_version_test.go @@ -23,7 +23,7 @@ func TestAccLambdaLayerVersion_basic(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, lambda.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckLayerVersionDestroy(ctx), @@ -60,7 +60,7 @@ func TestAccLambdaLayerVersion_update(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, lambda.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckLayerVersionDestroy(ctx), @@ -91,7 +91,7 @@ func TestAccLambdaLayerVersion_s3(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, lambda.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckLayerVersionDestroy(ctx), @@ -117,7 +117,7 @@ func TestAccLambdaLayerVersion_compatibleRuntimes(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, lambda.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckLayerVersionDestroy(ctx), @@ -146,7 +146,7 @@ func TestAccLambdaLayerVersion_compatibleArchitectures(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, lambda.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckLayerVersionDestroy(ctx), @@ -198,7 +198,7 @@ func TestAccLambdaLayerVersion_description(t *testing.T) { testDescription := "test description" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, lambda.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckLayerVersionDestroy(ctx), @@ -228,7 +228,7 @@ func TestAccLambdaLayerVersion_licenseInfo(t *testing.T) { testLicenseInfo := "MIT" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, lambda.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckLayerVersionDestroy(ctx), @@ -257,7 +257,7 @@ func TestAccLambdaLayerVersion_skipDestroy(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, lambda.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: nil, // this purposely leaves dangling resources, since skip_destroy = true diff --git a/internal/service/lambda/permission_test.go b/internal/service/lambda/permission_test.go index 1232490167e6..ac9da011716f 100644 --- a/internal/service/lambda/permission_test.go +++ b/internal/service/lambda/permission_test.go @@ -227,7 +227,7 @@ func TestAccLambdaPermission_basic(t *testing.T) { functionResourceName := "aws_lambda_function.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, lambda.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckPermissionDestroy(ctx), @@ -264,7 +264,7 @@ func TestAccLambdaPermission_principalOrgID(t *testing.T) { functionResourceName := "aws_lambda_function.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, lambda.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckPermissionDestroy(ctx), @@ -297,7 +297,7 @@ func TestAccLambdaPermission_statementIDDuplicate(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, lambda.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckPermissionDestroy(ctx), @@ -324,7 +324,7 @@ func TestAccLambdaPermission_rawFunctionName(t *testing.T) { functionResourceName := "aws_lambda_function.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, lambda.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckPermissionDestroy(ctx), @@ -357,7 +357,7 @@ func TestAccLambdaPermission_statementIDPrefix(t *testing.T) { functionResourceName := "aws_lambda_function.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, lambda.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckPermissionDestroy(ctx), @@ -393,7 +393,7 @@ func TestAccLambdaPermission_qualifier(t *testing.T) { functionResourceName := "aws_lambda_function.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, lambda.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckPermissionDestroy(ctx), @@ -426,7 +426,7 @@ func TestAccLambdaPermission_disappears(t *testing.T) { resourceName := "aws_lambda_permission.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, lambda.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckPermissionDestroy(ctx), @@ -461,7 +461,7 @@ func TestAccLambdaPermission_multiplePerms(t *testing.T) { functionResourceName := "aws_lambda_function.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, lambda.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckPermissionDestroy(ctx), @@ -533,7 +533,7 @@ func TestAccLambdaPermission_s3(t *testing.T) { bucketResourceName := "aws_s3_bucket.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, lambda.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckPermissionDestroy(ctx), @@ -570,7 +570,7 @@ func TestAccLambdaPermission_sns(t *testing.T) { snsTopicResourceName := "aws_sns_topic.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, lambda.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckPermissionDestroy(ctx), @@ -607,7 +607,7 @@ func TestAccLambdaPermission_iamRole(t *testing.T) { functionResourceName := "aws_lambda_function.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, lambda.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckPermissionDestroy(ctx), @@ -641,7 +641,7 @@ func TestAccLambdaPermission_FunctionURLs_iam(t *testing.T) { functionResourceName := "aws_lambda_function.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, lambda.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckPermissionDestroy(ctx), @@ -677,7 +677,7 @@ func TestAccLambdaPermission_FunctionURLs_none(t *testing.T) { functionResourceName := "aws_lambda_function.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, lambda.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckPermissionDestroy(ctx), diff --git a/internal/service/lambda/provisioned_concurrency_config_test.go b/internal/service/lambda/provisioned_concurrency_config_test.go index 5fb86713b761..81dbfe0fe220 100644 --- a/internal/service/lambda/provisioned_concurrency_config_test.go +++ b/internal/service/lambda/provisioned_concurrency_config_test.go @@ -23,7 +23,7 @@ func TestAccLambdaProvisionedConcurrencyConfig_basic(t *testing.T) { resourceName := "aws_lambda_provisioned_concurrency_config.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, lambda.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckProvisionedConcurrencyConfigDestroy(ctx), @@ -54,7 +54,7 @@ func TestAccLambdaProvisionedConcurrencyConfig_Disappears_lambdaFunction(t *test resourceName := "aws_lambda_provisioned_concurrency_config.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, lambda.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckProvisionedConcurrencyConfigDestroy(ctx), @@ -78,7 +78,7 @@ func TestAccLambdaProvisionedConcurrencyConfig_Disappears_lambdaProvisionedConcu resourceName := "aws_lambda_provisioned_concurrency_config.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, lambda.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckProvisionedConcurrencyConfigDestroy(ctx), @@ -105,7 +105,7 @@ func TestAccLambdaProvisionedConcurrencyConfig_provisionedConcurrentExecutions(t resourceName := "aws_lambda_provisioned_concurrency_config.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, lambda.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckProvisionedConcurrencyConfigDestroy(ctx), @@ -144,7 +144,7 @@ func TestAccLambdaProvisionedConcurrencyConfig_Qualifier_aliasName(t *testing.T) resourceName := "aws_lambda_provisioned_concurrency_config.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, lambda.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckProvisionedConcurrencyConfigDestroy(ctx), From 7f40128e343a9004aa5cbcffa03e85e93c534c04 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Fri, 24 Feb 2023 16:37:09 -0500 Subject: [PATCH 185/763] Add 'Context' argument to 'acctest.PreCheck' for lexmodels. --- .../lexmodels/bot_alias_data_source_test.go | 2 +- internal/service/lexmodels/bot_alias_test.go | 14 +++++----- .../service/lexmodels/bot_data_source_test.go | 4 +-- internal/service/lexmodels/bot_test.go | 28 +++++++++---------- .../lexmodels/intent_data_source_test.go | 4 +-- internal/service/lexmodels/intent_test.go | 26 ++++++++--------- .../lexmodels/slot_type_data_source_test.go | 4 +-- internal/service/lexmodels/slot_type_test.go | 16 +++++------ 8 files changed, 49 insertions(+), 49 deletions(-) diff --git a/internal/service/lexmodels/bot_alias_data_source_test.go b/internal/service/lexmodels/bot_alias_data_source_test.go index 62ed0878c799..cadbcbabc6f8 100644 --- a/internal/service/lexmodels/bot_alias_data_source_test.go +++ b/internal/service/lexmodels/bot_alias_data_source_test.go @@ -17,7 +17,7 @@ func testAccBotAliasDataSource_basic(t *testing.T) { // If this test runs in parallel with other Lex Bot tests, it loses its description resource.Test(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(lexmodelbuildingservice.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, lexmodelbuildingservice.EndpointsID), diff --git a/internal/service/lexmodels/bot_alias_test.go b/internal/service/lexmodels/bot_alias_test.go index ffb661ce3ad2..430bdbc799bd 100644 --- a/internal/service/lexmodels/bot_alias_test.go +++ b/internal/service/lexmodels/bot_alias_test.go @@ -25,7 +25,7 @@ func TestAccLexModelsBotAlias_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(lexmodelbuildingservice.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, lexmodelbuildingservice.EndpointsID), @@ -70,7 +70,7 @@ func testAccBotAlias_botVersion(t *testing.T) { // If this test runs in parallel with other Lex Bot tests, it loses its description resource.Test(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(lexmodelbuildingservice.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, lexmodelbuildingservice.EndpointsID), @@ -127,7 +127,7 @@ func TestAccLexModelsBotAlias_conversationLogsText(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(lexmodelbuildingservice.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, lexmodelbuildingservice.EndpointsID), @@ -178,7 +178,7 @@ func TestAccLexModelsBotAlias_conversationLogsAudio(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(lexmodelbuildingservice.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, lexmodelbuildingservice.EndpointsID), @@ -230,7 +230,7 @@ func TestAccLexModelsBotAlias_conversationLogsBoth(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(lexmodelbuildingservice.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, lexmodelbuildingservice.EndpointsID), @@ -281,7 +281,7 @@ func TestAccLexModelsBotAlias_description(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(lexmodelbuildingservice.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, lexmodelbuildingservice.EndpointsID), @@ -331,7 +331,7 @@ func TestAccLexModelsBotAlias_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(lexmodelbuildingservice.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, lexmodelbuildingservice.EndpointsID), diff --git a/internal/service/lexmodels/bot_data_source_test.go b/internal/service/lexmodels/bot_data_source_test.go index fad9f0003c64..4e70000cce7c 100644 --- a/internal/service/lexmodels/bot_data_source_test.go +++ b/internal/service/lexmodels/bot_data_source_test.go @@ -16,7 +16,7 @@ func TestAccLexModelsBotDataSource_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(lexmodelbuildingservice.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, lexmodelbuildingservice.EndpointsID), @@ -58,7 +58,7 @@ func testAccBotDataSource_withVersion(t *testing.T) { // If this test runs in parallel with other Lex Bot tests, it loses its description resource.Test(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(lexmodelbuildingservice.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, lexmodelbuildingservice.EndpointsID), diff --git a/internal/service/lexmodels/bot_test.go b/internal/service/lexmodels/bot_test.go index 0bc9f3be038c..675d38ac115f 100644 --- a/internal/service/lexmodels/bot_test.go +++ b/internal/service/lexmodels/bot_test.go @@ -34,7 +34,7 @@ func TestAccLexModelsBot_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(lexmodelbuildingservice.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, lexmodelbuildingservice.EndpointsID), @@ -104,7 +104,7 @@ func testAccBot_createVersion(t *testing.T) { // If this test runs in parallel with other Lex Bot tests, it loses its description resource.Test(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(lexmodelbuildingservice.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, lexmodelbuildingservice.EndpointsID), @@ -151,7 +151,7 @@ func TestAccLexModelsBot_abortStatement(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(lexmodelbuildingservice.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, lexmodelbuildingservice.EndpointsID), @@ -212,7 +212,7 @@ func TestAccLexModelsBot_clarificationPrompt(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(lexmodelbuildingservice.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, lexmodelbuildingservice.EndpointsID), @@ -269,7 +269,7 @@ func TestAccLexModelsBot_childDirected(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(lexmodelbuildingservice.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, lexmodelbuildingservice.EndpointsID), @@ -317,7 +317,7 @@ func TestAccLexModelsBot_description(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(lexmodelbuildingservice.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, lexmodelbuildingservice.EndpointsID), @@ -365,7 +365,7 @@ func TestAccLexModelsBot_detectSentiment(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(lexmodelbuildingservice.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, lexmodelbuildingservice.EndpointsID), @@ -413,7 +413,7 @@ func TestAccLexModelsBot_enableModelImprovements(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(lexmodelbuildingservice.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, lexmodelbuildingservice.EndpointsID), @@ -462,7 +462,7 @@ func TestAccLexModelsBot_idleSessionTTLInSeconds(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(lexmodelbuildingservice.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, lexmodelbuildingservice.EndpointsID), @@ -510,7 +510,7 @@ func TestAccLexModelsBot_intents(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(lexmodelbuildingservice.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, lexmodelbuildingservice.EndpointsID), @@ -567,7 +567,7 @@ func TestAccLexModelsBot_computeVersion(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(lexmodelbuildingservice.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, lexmodelbuildingservice.EndpointsID), @@ -619,7 +619,7 @@ func TestAccLexModelsBot_locale(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(lexmodelbuildingservice.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, lexmodelbuildingservice.EndpointsID), @@ -667,7 +667,7 @@ func TestAccLexModelsBot_voiceID(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(lexmodelbuildingservice.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, lexmodelbuildingservice.EndpointsID), @@ -715,7 +715,7 @@ func TestAccLexModelsBot_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(lexmodelbuildingservice.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, lexmodelbuildingservice.EndpointsID), diff --git a/internal/service/lexmodels/intent_data_source_test.go b/internal/service/lexmodels/intent_data_source_test.go index 9df81514a730..e8c6aae1bece 100644 --- a/internal/service/lexmodels/intent_data_source_test.go +++ b/internal/service/lexmodels/intent_data_source_test.go @@ -16,7 +16,7 @@ func TestAccLexModelsIntentDataSource_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(lexmodelbuildingservice.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, lexmodelbuildingservice.EndpointsID), @@ -48,7 +48,7 @@ func TestAccLexModelsIntentDataSource_withVersion(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(lexmodelbuildingservice.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, lexmodelbuildingservice.EndpointsID), diff --git a/internal/service/lexmodels/intent_test.go b/internal/service/lexmodels/intent_test.go index 1c727ef8f58f..2e9c0d4cf6cf 100644 --- a/internal/service/lexmodels/intent_test.go +++ b/internal/service/lexmodels/intent_test.go @@ -26,7 +26,7 @@ func TestAccLexModelsIntent_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(lexmodelbuildingservice.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, lexmodelbuildingservice.EndpointsID), @@ -76,7 +76,7 @@ func TestAccLexModelsIntent_createVersion(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(lexmodelbuildingservice.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, lexmodelbuildingservice.EndpointsID), @@ -122,7 +122,7 @@ func TestAccLexModelsIntent_conclusionStatement(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(lexmodelbuildingservice.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, lexmodelbuildingservice.EndpointsID), @@ -179,7 +179,7 @@ func TestAccLexModelsIntent_confirmationPromptAndRejectionStatement(t *testing.T resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(lexmodelbuildingservice.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, lexmodelbuildingservice.EndpointsID), @@ -246,7 +246,7 @@ func TestAccLexModelsIntent_dialogCodeHook(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(lexmodelbuildingservice.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, lexmodelbuildingservice.EndpointsID), @@ -283,7 +283,7 @@ func TestAccLexModelsIntent_followUpPrompt(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(lexmodelbuildingservice.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, lexmodelbuildingservice.EndpointsID), @@ -356,7 +356,7 @@ func TestAccLexModelsIntent_fulfillmentActivity(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(lexmodelbuildingservice.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, lexmodelbuildingservice.EndpointsID), @@ -395,7 +395,7 @@ func TestAccLexModelsIntent_sampleUtterances(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(lexmodelbuildingservice.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, lexmodelbuildingservice.EndpointsID), @@ -441,7 +441,7 @@ func TestAccLexModelsIntent_slots(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(lexmodelbuildingservice.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, lexmodelbuildingservice.EndpointsID), @@ -498,7 +498,7 @@ func TestAccLexModelsIntent_slotsCustom(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(lexmodelbuildingservice.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, lexmodelbuildingservice.EndpointsID), @@ -546,7 +546,7 @@ func TestAccLexModelsIntent_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(lexmodelbuildingservice.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, lexmodelbuildingservice.EndpointsID), @@ -610,7 +610,7 @@ func TestAccLexModelsIntent_updateWithExternalChange(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(lexmodelbuildingservice.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, lexmodelbuildingservice.EndpointsID), @@ -649,7 +649,7 @@ func TestAccLexModelsIntent_computeVersion(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(lexmodelbuildingservice.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, lexmodelbuildingservice.EndpointsID), diff --git a/internal/service/lexmodels/slot_type_data_source_test.go b/internal/service/lexmodels/slot_type_data_source_test.go index a88610e3aff5..175b74238cba 100644 --- a/internal/service/lexmodels/slot_type_data_source_test.go +++ b/internal/service/lexmodels/slot_type_data_source_test.go @@ -16,7 +16,7 @@ func TestAccLexModelsSlotTypeDataSource_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(lexmodelbuildingservice.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, lexmodelbuildingservice.EndpointsID), @@ -49,7 +49,7 @@ func TestAccLexModelsSlotTypeDataSource_withVersion(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(lexmodelbuildingservice.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, lexmodelbuildingservice.EndpointsID), diff --git a/internal/service/lexmodels/slot_type_test.go b/internal/service/lexmodels/slot_type_test.go index fa8bc7566947..611fd56be12f 100644 --- a/internal/service/lexmodels/slot_type_test.go +++ b/internal/service/lexmodels/slot_type_test.go @@ -24,7 +24,7 @@ func TestAccLexModelsSlotType_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(lexmodelbuildingservice.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, lexmodelbuildingservice.EndpointsID), @@ -70,7 +70,7 @@ func TestAccLexModelsSlotType_createVersion(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(lexmodelbuildingservice.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, lexmodelbuildingservice.EndpointsID), @@ -117,7 +117,7 @@ func TestAccLexModelsSlotType_description(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(lexmodelbuildingservice.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, lexmodelbuildingservice.EndpointsID), @@ -162,7 +162,7 @@ func TestAccLexModelsSlotType_enumerationValues(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(lexmodelbuildingservice.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, lexmodelbuildingservice.EndpointsID), @@ -213,7 +213,7 @@ func TestAccLexModelsSlotType_name(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(lexmodelbuildingservice.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, lexmodelbuildingservice.EndpointsID), @@ -258,7 +258,7 @@ func TestAccLexModelsSlotType_valueSelectionStrategy(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(lexmodelbuildingservice.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, lexmodelbuildingservice.EndpointsID), @@ -303,7 +303,7 @@ func TestAccLexModelsSlotType_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(lexmodelbuildingservice.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, lexmodelbuildingservice.EndpointsID), @@ -336,7 +336,7 @@ func TestAccLexModelsSlotType_computeVersion(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(lexmodelbuildingservice.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, lexmodelbuildingservice.EndpointsID), From 910f75d551a884c60a2ef94afbf64af83ab66398 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Fri, 24 Feb 2023 16:37:09 -0500 Subject: [PATCH 186/763] Add 'Context' argument to 'acctest.PreCheck' for licensemanager. --- internal/service/licensemanager/association_test.go | 4 ++-- .../service/licensemanager/license_configuration_test.go | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/internal/service/licensemanager/association_test.go b/internal/service/licensemanager/association_test.go index cb44c6050dd1..314478a3c1bd 100644 --- a/internal/service/licensemanager/association_test.go +++ b/internal/service/licensemanager/association_test.go @@ -21,7 +21,7 @@ func TestAccLicenseManagerAssociation_basic(t *testing.T) { resourceName := "aws_licensemanager_association.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, licensemanager.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckAssociationDestroy(ctx), @@ -49,7 +49,7 @@ func TestAccLicenseManagerAssociation_disappears(t *testing.T) { resourceName := "aws_licensemanager_association.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, licensemanager.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckAssociationDestroy(ctx), diff --git a/internal/service/licensemanager/license_configuration_test.go b/internal/service/licensemanager/license_configuration_test.go index cba9f31d3f85..78c4524a7af4 100644 --- a/internal/service/licensemanager/license_configuration_test.go +++ b/internal/service/licensemanager/license_configuration_test.go @@ -33,7 +33,7 @@ func TestAccLicenseManagerLicenseConfiguration_basic(t *testing.T) { resourceName := "aws_licensemanager_license_configuration.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, licensemanager.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckLicenseConfigurationDestroy(ctx), @@ -69,7 +69,7 @@ func TestAccLicenseManagerLicenseConfiguration_disappears(t *testing.T) { resourceName := "aws_licensemanager_license_configuration.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, licensemanager.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckLicenseConfigurationDestroy(ctx), @@ -93,7 +93,7 @@ func TestAccLicenseManagerLicenseConfiguration_tags(t *testing.T) { resourceName := "aws_licensemanager_license_configuration.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, licensemanager.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckLicenseConfigurationDestroy(ctx), @@ -140,7 +140,7 @@ func TestAccLicenseManagerLicenseConfiguration_update(t *testing.T) { resourceName := "aws_licensemanager_license_configuration.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, licensemanager.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckLicenseConfigurationDestroy(ctx), From 0128d7f52ba1130b6f24055abd6b78e5783e536d Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Fri, 24 Feb 2023 16:37:10 -0500 Subject: [PATCH 187/763] Add 'Context' argument to 'acctest.PreCheck' for lightsail. --- .../lightsail/bucket_access_key_test.go | 4 +-- internal/service/lightsail/bucket_test.go | 8 +++--- .../service/lightsail/certificate_test.go | 10 +++---- ...ntainer_service_deployment_version_test.go | 12 ++++----- .../lightsail/container_service_test.go | 18 ++++++------- internal/service/lightsail/database_test.go | 26 +++++++++---------- .../service/lightsail/disk_attachment_test.go | 4 +-- internal/service/lightsail/disk_test.go | 6 ++--- .../service/lightsail/domain_entry_test.go | 4 +-- internal/service/lightsail/domain_test.go | 4 +-- .../lightsail/instance_public_ports_test.go | 12 ++++----- internal/service/lightsail/instance_test.go | 12 ++++----- internal/service/lightsail/key_pair_test.go | 8 +++--- .../service/lightsail/lb_attachment_test.go | 4 +-- .../lb_certificate_attachment_test.go | 2 +- .../service/lightsail/lb_certificate_test.go | 8 +++--- .../lb_https_redirection_policy_test.go | 2 +- .../lightsail/lb_stickiness_policy_test.go | 8 +++--- internal/service/lightsail/lb_test.go | 10 +++---- .../lightsail/static_ip_attachment_test.go | 4 +-- internal/service/lightsail/static_ip_test.go | 4 +-- 21 files changed, 85 insertions(+), 85 deletions(-) diff --git a/internal/service/lightsail/bucket_access_key_test.go b/internal/service/lightsail/bucket_access_key_test.go index 669a3f28c230..cd30bf95d919 100644 --- a/internal/service/lightsail/bucket_access_key_test.go +++ b/internal/service/lightsail/bucket_access_key_test.go @@ -26,7 +26,7 @@ func TestAccLightsailBucketAccessKey_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(lightsail.EndpointsID, t) testAccPreCheck(ctx, t) }, @@ -61,7 +61,7 @@ func TestAccLightsailBucketAccessKey_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(lightsail.EndpointsID, t) testAccPreCheck(ctx, t) }, diff --git a/internal/service/lightsail/bucket_test.go b/internal/service/lightsail/bucket_test.go index 730eb42d7880..c7eddadc6d35 100644 --- a/internal/service/lightsail/bucket_test.go +++ b/internal/service/lightsail/bucket_test.go @@ -26,7 +26,7 @@ func TestAccLightsailBucket_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(lightsail.EndpointsID, t) testAccPreCheck(ctx, t) }, @@ -67,7 +67,7 @@ func TestAccLightsailBucket_BundleId(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(lightsail.EndpointsID, t) testAccPreCheck(ctx, t) }, @@ -105,7 +105,7 @@ func TestAccLightsailBucket_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(lightsail.EndpointsID, t) testAccPreCheck(ctx, t) }, @@ -132,7 +132,7 @@ func TestAccLightsailBucket_tags(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(lightsail.EndpointsID, t) testAccPreCheck(ctx, t) }, diff --git a/internal/service/lightsail/certificate_test.go b/internal/service/lightsail/certificate_test.go index e5f0443f60ea..a275c85e6a72 100644 --- a/internal/service/lightsail/certificate_test.go +++ b/internal/service/lightsail/certificate_test.go @@ -30,7 +30,7 @@ func TestAccLightsailCertificate_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(lightsail.EndpointsID, t) testAccPreCheck(ctx, t) }, @@ -67,7 +67,7 @@ func TestAccLightsailCertificate_subjectAlternativeNames(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(lightsail.EndpointsID, t) testAccPreCheck(ctx, t) }, @@ -100,7 +100,7 @@ func TestAccLightsailCertificate_DomainValidationOptions(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(lightsail.EndpointsID, t) testAccPreCheck(ctx, t) }, @@ -135,7 +135,7 @@ func TestAccLightsailCertificate_tags(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(lightsail.EndpointsID, t) testAccPreCheck(ctx, t) }, @@ -203,7 +203,7 @@ func TestAccLightsailCertificate_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(lightsail.EndpointsID, t) testAccPreCheck(ctx, t) }, diff --git a/internal/service/lightsail/container_service_deployment_version_test.go b/internal/service/lightsail/container_service_deployment_version_test.go index a78d0a61eab4..287646286793 100644 --- a/internal/service/lightsail/container_service_deployment_version_test.go +++ b/internal/service/lightsail/container_service_deployment_version_test.go @@ -101,7 +101,7 @@ func TestAccLightsailContainerServiceDeploymentVersion_Container_Basic(t *testin resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(lightsail.EndpointsID, t) testAccPreCheck(ctx, t) }, @@ -143,7 +143,7 @@ func TestAccLightsailContainerServiceDeploymentVersion_Container_Multiple(t *tes resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(lightsail.EndpointsID, t) testAccPreCheck(ctx, t) }, @@ -181,7 +181,7 @@ func TestAccLightsailContainerServiceDeploymentVersion_Container_Environment(t * resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(lightsail.EndpointsID, t) testAccPreCheck(ctx, t) }, @@ -260,7 +260,7 @@ func TestAccLightsailContainerServiceDeploymentVersion_Container_Ports(t *testin resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(lightsail.EndpointsID, t) testAccPreCheck(ctx, t) }, @@ -336,7 +336,7 @@ func TestAccLightsailContainerServiceDeploymentVersion_Container_PublicEndpoint( resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(lightsail.EndpointsID, t) testAccPreCheck(ctx, t) }, @@ -447,7 +447,7 @@ func TestAccLightsailContainerServiceDeploymentVersion_Container_EnableService(t resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(lightsail.EndpointsID, t) testAccPreCheck(ctx, t) }, diff --git a/internal/service/lightsail/container_service_test.go b/internal/service/lightsail/container_service_test.go index 8e440f309e35..8e519b11bda2 100644 --- a/internal/service/lightsail/container_service_test.go +++ b/internal/service/lightsail/container_service_test.go @@ -23,7 +23,7 @@ func TestAccLightsailContainerService_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(lightsail.EndpointsID, t) testAccPreCheck(ctx, t) }, @@ -73,7 +73,7 @@ func TestAccLightsailContainerService_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(lightsail.EndpointsID, t) testAccPreCheck(ctx, t) }, @@ -101,7 +101,7 @@ func TestAccLightsailContainerService_Name(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(lightsail.EndpointsID, t) testAccPreCheck(ctx, t) }, @@ -134,7 +134,7 @@ func TestAccLightsailContainerService_IsDisabled(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(lightsail.EndpointsID, t) testAccPreCheck(ctx, t) }, @@ -167,7 +167,7 @@ func TestAccLightsailContainerService_Power(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(lightsail.EndpointsID, t) testAccPreCheck(ctx, t) }, @@ -199,7 +199,7 @@ func TestAccLightsailContainerService_PublicDomainNames(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(lightsail.EndpointsID, t) testAccPreCheck(ctx, t) }, @@ -222,7 +222,7 @@ func TestAccLightsailContainerService_PrivateRegistryAccess(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(lightsail.EndpointsID, t) testAccPreCheck(ctx, t) }, @@ -251,7 +251,7 @@ func TestAccLightsailContainerService_Scale(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(lightsail.EndpointsID, t) testAccPreCheck(ctx, t) }, @@ -284,7 +284,7 @@ func TestAccLightsailContainerService_tags(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(lightsail.EndpointsID, t) testAccPreCheck(ctx, t) }, diff --git a/internal/service/lightsail/database_test.go b/internal/service/lightsail/database_test.go index e50c9cbea849..55d37c201548 100644 --- a/internal/service/lightsail/database_test.go +++ b/internal/service/lightsail/database_test.go @@ -30,7 +30,7 @@ func TestAccLightsailDatabase_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(lightsail.EndpointsID, t) testAccPreCheck(ctx, t) }, @@ -88,7 +88,7 @@ func TestAccLightsailDatabase_relationalDatabaseName(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(lightsail.EndpointsID, t) testAccPreCheck(ctx, t) }, @@ -152,7 +152,7 @@ func TestAccLightsailDatabase_masterDatabaseName(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(lightsail.EndpointsID, t) testAccPreCheck(ctx, t) }, @@ -220,7 +220,7 @@ func TestAccLightsailDatabase_masterUsername(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(lightsail.EndpointsID, t) testAccPreCheck(ctx, t) }, @@ -290,7 +290,7 @@ func TestAccLightsailDatabase_masterPassword(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(lightsail.EndpointsID, t) testAccPreCheck(ctx, t) }, @@ -336,7 +336,7 @@ func TestAccLightsailDatabase_preferredBackupWindow(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(lightsail.EndpointsID, t) testAccPreCheck(ctx, t) }, @@ -392,7 +392,7 @@ func TestAccLightsailDatabase_preferredMaintenanceWindow(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(lightsail.EndpointsID, t) testAccPreCheck(ctx, t) }, @@ -449,7 +449,7 @@ func TestAccLightsailDatabase_publiclyAccessible(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(lightsail.EndpointsID, t) testAccPreCheck(ctx, t) }, @@ -494,7 +494,7 @@ func TestAccLightsailDatabase_backupRetentionEnabled(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(lightsail.EndpointsID, t) testAccPreCheck(ctx, t) }, @@ -544,7 +544,7 @@ func TestAccLightsailDatabase_finalSnapshotName(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(lightsail.EndpointsID, t) testAccPreCheck(ctx, t) }, @@ -597,7 +597,7 @@ func TestAccLightsailDatabase_tags(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(lightsail.EndpointsID, t) testAccPreCheck(ctx, t) }, @@ -653,7 +653,7 @@ func TestAccLightsailDatabase_ha(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(lightsail.EndpointsID, t) testAccPreCheck(ctx, t) }, @@ -712,7 +712,7 @@ func TestAccLightsailDatabase_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(lightsail.EndpointsID, t) testAccPreCheck(ctx, t) }, diff --git a/internal/service/lightsail/disk_attachment_test.go b/internal/service/lightsail/disk_attachment_test.go index 8e26efa05dbd..a49b24c65633 100644 --- a/internal/service/lightsail/disk_attachment_test.go +++ b/internal/service/lightsail/disk_attachment_test.go @@ -30,7 +30,7 @@ func TestAccLightsailDiskAttachment_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(lightsail.EndpointsID, t) testAccPreCheck(ctx, t) }, @@ -65,7 +65,7 @@ func TestAccLightsailDiskAttachment_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(lightsail.EndpointsID, t) testAccPreCheck(ctx, t) }, diff --git a/internal/service/lightsail/disk_test.go b/internal/service/lightsail/disk_test.go index dede7405eab6..54107814af7f 100644 --- a/internal/service/lightsail/disk_test.go +++ b/internal/service/lightsail/disk_test.go @@ -27,7 +27,7 @@ func TestAccLightsailDisk_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(lightsail.EndpointsID, t) testAccPreCheck(ctx, t) }, @@ -64,7 +64,7 @@ func TestAccLightsailDisk_Tags(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(lightsail.EndpointsID, t) testAccPreCheck(ctx, t) }, @@ -143,7 +143,7 @@ func TestAccLightsailDisk_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(lightsail.EndpointsID, t) testAccPreCheck(ctx, t) }, diff --git a/internal/service/lightsail/domain_entry_test.go b/internal/service/lightsail/domain_entry_test.go index b986934abe48..0102138c8691 100644 --- a/internal/service/lightsail/domain_entry_test.go +++ b/internal/service/lightsail/domain_entry_test.go @@ -28,7 +28,7 @@ func TestAccLightsailDomainEntry_basic(t *testing.T) { domainEntryName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckDomain(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckDomain(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, lightsail.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDomainEntryDestroy(ctx), @@ -81,7 +81,7 @@ func TestAccLightsailDomainEntry_disappears(t *testing.T) { } resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckDomain(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckDomain(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, lightsail.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDomainEntryDestroy(ctx), diff --git a/internal/service/lightsail/domain_test.go b/internal/service/lightsail/domain_test.go index 4b0471411775..a23db8e1438f 100644 --- a/internal/service/lightsail/domain_test.go +++ b/internal/service/lightsail/domain_test.go @@ -24,7 +24,7 @@ func TestAccLightsailDomain_basic(t *testing.T) { resourceName := "aws_lightsail_domain.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckDomain(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckDomain(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, lightsail.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDomainDestroy(ctx), @@ -46,7 +46,7 @@ func TestAccLightsailDomain_disappears(t *testing.T) { resourceName := "aws_lightsail_domain.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckDomain(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckDomain(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, lightsail.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDomainDestroy(ctx), diff --git a/internal/service/lightsail/instance_public_ports_test.go b/internal/service/lightsail/instance_public_ports_test.go index dc39f6740960..8bbf3283fe74 100644 --- a/internal/service/lightsail/instance_public_ports_test.go +++ b/internal/service/lightsail/instance_public_ports_test.go @@ -23,7 +23,7 @@ func TestAccLightsailInstancePublicPorts_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(lightsail.EndpointsID, t) testAccPreCheck(ctx, t) }, @@ -54,7 +54,7 @@ func TestAccLightsailInstancePublicPorts_multiple(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(lightsail.EndpointsID, t) testAccPreCheck(ctx, t) }, @@ -90,7 +90,7 @@ func TestAccLightsailInstancePublicPorts_cidrs(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(lightsail.EndpointsID, t) testAccPreCheck(ctx, t) }, @@ -124,7 +124,7 @@ func TestAccLightsailInstancePublicPorts_cidrListAliases(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(lightsail.EndpointsID, t) testAccPreCheck(ctx, t) }, @@ -157,7 +157,7 @@ func TestAccLightsailInstancePublicPorts_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(lightsail.EndpointsID, t) testAccPreCheck(ctx, t) }, @@ -185,7 +185,7 @@ func TestAccLightsailInstancePublicPorts_disappears_Instance(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(lightsail.EndpointsID, t) testAccPreCheck(ctx, t) }, diff --git a/internal/service/lightsail/instance_test.go b/internal/service/lightsail/instance_test.go index b2c5852a0f67..a5ec5731b247 100644 --- a/internal/service/lightsail/instance_test.go +++ b/internal/service/lightsail/instance_test.go @@ -26,7 +26,7 @@ func TestAccLightsailInstance_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(lightsail.EndpointsID, t) testAccPreCheck(ctx, t) }, @@ -62,7 +62,7 @@ func TestAccLightsailInstance_name(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(lightsail.EndpointsID, t) testAccPreCheck(ctx, t) }, @@ -109,7 +109,7 @@ func TestAccLightsailInstance_tags(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(lightsail.EndpointsID, t) testAccPreCheck(ctx, t) }, @@ -150,7 +150,7 @@ func TestAccLightsailInstance_IPAddressType(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(lightsail.EndpointsID, t) testAccPreCheck(ctx, t) }, @@ -192,7 +192,7 @@ func TestAccLightsailInstance_addOn(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(lightsail.EndpointsID, t) testAccPreCheck(ctx, t) }, @@ -259,7 +259,7 @@ func TestAccLightsailInstance_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(lightsail.EndpointsID, t) testAccPreCheck(ctx, t) }, diff --git a/internal/service/lightsail/key_pair_test.go b/internal/service/lightsail/key_pair_test.go index 8cfb0f268fbd..b4c5a1538202 100644 --- a/internal/service/lightsail/key_pair_test.go +++ b/internal/service/lightsail/key_pair_test.go @@ -24,7 +24,7 @@ func TestAccLightsailKeyPair_basic(t *testing.T) { resourceName := "aws_lightsail_key_pair.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, lightsail.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckKeyPairDestroy(ctx), @@ -56,7 +56,7 @@ func TestAccLightsailKeyPair_publicKey(t *testing.T) { } resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, lightsail.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckKeyPairDestroy(ctx), @@ -85,7 +85,7 @@ func TestAccLightsailKeyPair_encrypted(t *testing.T) { resourceName := "aws_lightsail_key_pair.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, lightsail.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckKeyPairDestroy(ctx), @@ -111,7 +111,7 @@ func TestAccLightsailKeyPair_namePrefix(t *testing.T) { var conf1, conf2 lightsail.KeyPair resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, lightsail.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckKeyPairDestroy(ctx), diff --git a/internal/service/lightsail/lb_attachment_test.go b/internal/service/lightsail/lb_attachment_test.go index 2b2c9d75aef9..401c61dd82ba 100644 --- a/internal/service/lightsail/lb_attachment_test.go +++ b/internal/service/lightsail/lb_attachment_test.go @@ -26,7 +26,7 @@ func TestAccLightsailLoadBalancerAttachment_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(lightsail.EndpointsID, t) testAccPreCheck(ctx, t) }, @@ -54,7 +54,7 @@ func TestAccLightsailLoadBalancerAttachment_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(lightsail.EndpointsID, t) testAccPreCheck(ctx, t) }, diff --git a/internal/service/lightsail/lb_certificate_attachment_test.go b/internal/service/lightsail/lb_certificate_attachment_test.go index 361eb166d7e6..ebc122ac4f05 100644 --- a/internal/service/lightsail/lb_certificate_attachment_test.go +++ b/internal/service/lightsail/lb_certificate_attachment_test.go @@ -19,7 +19,7 @@ func TestAccLightsailLoadBalancerCertificateAttachment_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(lightsail.EndpointsID, t) testAccPreCheck(ctx, t) }, diff --git a/internal/service/lightsail/lb_certificate_test.go b/internal/service/lightsail/lb_certificate_test.go index 645842d45386..f3cdba548a7c 100644 --- a/internal/service/lightsail/lb_certificate_test.go +++ b/internal/service/lightsail/lb_certificate_test.go @@ -29,7 +29,7 @@ func TestAccLightsailLoadBalancerCertificate_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(lightsail.EndpointsID, t) testAccPreCheck(ctx, t) }, @@ -67,7 +67,7 @@ func TestAccLightsailLoadBalancerCertificate_subjectAlternativeNames(t *testing. resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(lightsail.EndpointsID, t) testAccPreCheck(ctx, t) }, @@ -101,7 +101,7 @@ func TestAccLightsailLoadBalancerCertificate_domainValidationRecords(t *testing. resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(lightsail.EndpointsID, t) testAccPreCheck(ctx, t) }, @@ -137,7 +137,7 @@ func TestAccLightsailLoadBalancerCertificate_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(lightsail.EndpointsID, t) testAccPreCheck(ctx, t) }, diff --git a/internal/service/lightsail/lb_https_redirection_policy_test.go b/internal/service/lightsail/lb_https_redirection_policy_test.go index 0175516018df..1f82c86f729b 100644 --- a/internal/service/lightsail/lb_https_redirection_policy_test.go +++ b/internal/service/lightsail/lb_https_redirection_policy_test.go @@ -18,7 +18,7 @@ func TestAccLightsailLoadBalancerHTTPSRedirectionPolicy_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(lightsail.EndpointsID, t) testAccPreCheck(ctx, t) }, diff --git a/internal/service/lightsail/lb_stickiness_policy_test.go b/internal/service/lightsail/lb_stickiness_policy_test.go index 7e8545c725fa..7ea5d183a932 100644 --- a/internal/service/lightsail/lb_stickiness_policy_test.go +++ b/internal/service/lightsail/lb_stickiness_policy_test.go @@ -24,7 +24,7 @@ func TestAccLightsailLoadBalancerStickinessPolicy_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(lightsail.EndpointsID, t) testAccPreCheck(ctx, t) }, @@ -55,7 +55,7 @@ func TestAccLightsailLoadBalancerStickinessPolicy_CookieDuration(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(lightsail.EndpointsID, t) testAccPreCheck(ctx, t) }, @@ -96,7 +96,7 @@ func TestAccLightsailLoadBalancerStickinessPolicy_Enabled(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(lightsail.EndpointsID, t) testAccPreCheck(ctx, t) }, @@ -136,7 +136,7 @@ func TestAccLightsailLoadBalancerStickinessPolicy_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(lightsail.EndpointsID, t) testAccPreCheck(ctx, t) }, diff --git a/internal/service/lightsail/lb_test.go b/internal/service/lightsail/lb_test.go index 84531c5b10db..f8ee9b067cba 100644 --- a/internal/service/lightsail/lb_test.go +++ b/internal/service/lightsail/lb_test.go @@ -29,7 +29,7 @@ func TestAccLightsailLoadBalancer_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(lightsail.EndpointsID, t) testAccPreCheck(ctx, t) }, @@ -66,7 +66,7 @@ func TestAccLightsailLoadBalancer_Name(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(lightsail.EndpointsID, t) testAccPreCheck(ctx, t) }, @@ -110,7 +110,7 @@ func TestAccLightsailLoadBalancer_HealthCheckPath(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(lightsail.EndpointsID, t) testAccPreCheck(ctx, t) }, @@ -149,7 +149,7 @@ func TestAccLightsailLoadBalancer_Tags(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(lightsail.EndpointsID, t) testAccPreCheck(ctx, t) }, @@ -245,7 +245,7 @@ func TestAccLightsailLoadBalancer_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(lightsail.EndpointsID, t) testAccPreCheck(ctx, t) }, diff --git a/internal/service/lightsail/static_ip_attachment_test.go b/internal/service/lightsail/static_ip_attachment_test.go index d3139520f88a..5ba961a0aa7a 100644 --- a/internal/service/lightsail/static_ip_attachment_test.go +++ b/internal/service/lightsail/static_ip_attachment_test.go @@ -24,7 +24,7 @@ func TestAccLightsailStaticIPAttachment_basic(t *testing.T) { keypairName := fmt.Sprintf("tf-test-lightsail-%s", sdkacctest.RandString(5)) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, lightsail.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckStaticIPAttachmentDestroy(ctx), @@ -61,7 +61,7 @@ func TestAccLightsailStaticIPAttachment_disappears(t *testing.T) { } resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, lightsail.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckStaticIPAttachmentDestroy(ctx), diff --git a/internal/service/lightsail/static_ip_test.go b/internal/service/lightsail/static_ip_test.go index 345d62a4216e..8a7eea091d19 100644 --- a/internal/service/lightsail/static_ip_test.go +++ b/internal/service/lightsail/static_ip_test.go @@ -22,7 +22,7 @@ func TestAccLightsailStaticIP_basic(t *testing.T) { staticIpName := fmt.Sprintf("tf-test-lightsail-%s", sdkacctest.RandString(5)) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, lightsail.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckStaticIPDestroy(ctx), @@ -56,7 +56,7 @@ func TestAccLightsailStaticIP_disappears(t *testing.T) { } resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, lightsail.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckStaticIPDestroy(ctx), From e9f1d6bbd7dfb82c6f73419daef7539193a557f1 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Fri, 24 Feb 2023 16:37:10 -0500 Subject: [PATCH 188/763] Add 'Context' argument to 'acctest.PreCheck' for location. --- .../location/geofence_collection_data_source_test.go | 2 +- .../service/location/geofence_collection_test.go | 10 +++++----- internal/service/location/map_data_source_test.go | 2 +- internal/service/location/map_test.go | 8 ++++---- .../service/location/place_index_data_source_test.go | 2 +- internal/service/location/place_index_test.go | 10 +++++----- .../location/route_calculator_data_source_test.go | 2 +- internal/service/location/route_calculator_test.go | 8 ++++---- .../location/tracker_association_data_source_test.go | 2 +- .../service/location/tracker_association_test.go | 4 ++-- .../tracker_associations_data_source_test.go | 2 +- .../service/location/tracker_data_source_test.go | 2 +- internal/service/location/tracker_test.go | 12 ++++++------ 13 files changed, 33 insertions(+), 33 deletions(-) diff --git a/internal/service/location/geofence_collection_data_source_test.go b/internal/service/location/geofence_collection_data_source_test.go index c0feb52c7f5a..3fc7a701b3bb 100644 --- a/internal/service/location/geofence_collection_data_source_test.go +++ b/internal/service/location/geofence_collection_data_source_test.go @@ -17,7 +17,7 @@ func TestAccLocationGeofenceCollectionDataSource_basic(t *testing.T) { resourceName := "aws_location_geofence_collection.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, locationservice.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckGeofenceCollectionDestroy(ctx), diff --git a/internal/service/location/geofence_collection_test.go b/internal/service/location/geofence_collection_test.go index 7c0d2c279707..13344716d972 100644 --- a/internal/service/location/geofence_collection_test.go +++ b/internal/service/location/geofence_collection_test.go @@ -25,7 +25,7 @@ func TestAccLocationGeofenceCollection_basic(t *testing.T) { resourceName := "aws_location_geofence_collection.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, locationservice.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckGeofenceCollectionDestroy(ctx), @@ -58,7 +58,7 @@ func TestAccLocationGeofenceCollection_disappears(t *testing.T) { resourceName := "aws_location_geofence_collection.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, locationservice.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckGeofenceCollectionDestroy(ctx), @@ -81,7 +81,7 @@ func TestAccLocationGeofenceCollection_description(t *testing.T) { resourceName := "aws_location_geofence_collection.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, locationservice.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckGeofenceCollectionDestroy(ctx), @@ -115,7 +115,7 @@ func TestAccLocationGeofenceCollection_kmsKeyID(t *testing.T) { resourceName := "aws_location_geofence_collection.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, locationservice.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckGeofenceCollectionDestroy(ctx), @@ -142,7 +142,7 @@ func TestAccLocationGeofenceCollection_tags(t *testing.T) { resourceName := "aws_location_geofence_collection.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, locationservice.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckGeofenceCollectionDestroy(ctx), diff --git a/internal/service/location/map_data_source_test.go b/internal/service/location/map_data_source_test.go index 97738808e0d6..e717f8402182 100644 --- a/internal/service/location/map_data_source_test.go +++ b/internal/service/location/map_data_source_test.go @@ -17,7 +17,7 @@ func TestAccLocationMapDataSource_mapName(t *testing.T) { resourceName := "aws_location_map.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, locationservice.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckMapDestroy(ctx), diff --git a/internal/service/location/map_test.go b/internal/service/location/map_test.go index 9069ff0b5e26..8d3755bb4355 100644 --- a/internal/service/location/map_test.go +++ b/internal/service/location/map_test.go @@ -22,7 +22,7 @@ func TestAccLocationMap_basic(t *testing.T) { resourceName := "aws_location_map.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, locationservice.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckMapDestroy(ctx), @@ -56,7 +56,7 @@ func TestAccLocationMap_disappears(t *testing.T) { resourceName := "aws_location_map.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, locationservice.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckMapDestroy(ctx), @@ -79,7 +79,7 @@ func TestAccLocationMap_description(t *testing.T) { resourceName := "aws_location_map.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, locationservice.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckMapDestroy(ctx), @@ -113,7 +113,7 @@ func TestAccLocationMap_tags(t *testing.T) { resourceName := "aws_location_map.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, locationservice.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckMapDestroy(ctx), diff --git a/internal/service/location/place_index_data_source_test.go b/internal/service/location/place_index_data_source_test.go index f906cdedb541..8090e4a7c50b 100644 --- a/internal/service/location/place_index_data_source_test.go +++ b/internal/service/location/place_index_data_source_test.go @@ -17,7 +17,7 @@ func TestAccLocationPlaceIndexDataSource_indexName(t *testing.T) { resourceName := "aws_location_place_index.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, locationservice.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckPlaceIndexDestroy(ctx), diff --git a/internal/service/location/place_index_test.go b/internal/service/location/place_index_test.go index 6507388e67cf..80578a170504 100644 --- a/internal/service/location/place_index_test.go +++ b/internal/service/location/place_index_test.go @@ -22,7 +22,7 @@ func TestAccLocationPlaceIndex_basic(t *testing.T) { resourceName := "aws_location_place_index.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, locationservice.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckPlaceIndexDestroy(ctx), @@ -57,7 +57,7 @@ func TestAccLocationPlaceIndex_disappears(t *testing.T) { resourceName := "aws_location_place_index.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, locationservice.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckPlaceIndexDestroy(ctx), @@ -80,7 +80,7 @@ func TestAccLocationPlaceIndex_dataSourceConfigurationIntendedUse(t *testing.T) resourceName := "aws_location_place_index.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, locationservice.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckPlaceIndexDestroy(ctx), @@ -116,7 +116,7 @@ func TestAccLocationPlaceIndex_description(t *testing.T) { resourceName := "aws_location_place_index.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, locationservice.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckPlaceIndexDestroy(ctx), @@ -150,7 +150,7 @@ func TestAccLocationPlaceIndex_tags(t *testing.T) { resourceName := "aws_location_place_index.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, locationservice.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckPlaceIndexDestroy(ctx), diff --git a/internal/service/location/route_calculator_data_source_test.go b/internal/service/location/route_calculator_data_source_test.go index 312e69aad291..76b8dec5e9b3 100644 --- a/internal/service/location/route_calculator_data_source_test.go +++ b/internal/service/location/route_calculator_data_source_test.go @@ -17,7 +17,7 @@ func TestAccLocationRouteCalculatorDataSource_basic(t *testing.T) { resourceName := "aws_location_route_calculator.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, locationservice.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRouteCalculatorDestroy(ctx), diff --git a/internal/service/location/route_calculator_test.go b/internal/service/location/route_calculator_test.go index a4663263c681..0e823e06a306 100644 --- a/internal/service/location/route_calculator_test.go +++ b/internal/service/location/route_calculator_test.go @@ -22,7 +22,7 @@ func TestAccLocationRouteCalculator_basic(t *testing.T) { resourceName := "aws_location_route_calculator.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, locationservice.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRouteCalculatorDestroy(ctx), @@ -55,7 +55,7 @@ func TestAccLocationRouteCalculator_disappears(t *testing.T) { resourceName := "aws_location_route_calculator.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, locationservice.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRouteCalculatorDestroy(ctx), @@ -78,7 +78,7 @@ func TestAccLocationRouteCalculator_description(t *testing.T) { resourceName := "aws_location_route_calculator.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, locationservice.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRouteCalculatorDestroy(ctx), @@ -112,7 +112,7 @@ func TestAccLocationRouteCalculator_tags(t *testing.T) { resourceName := "aws_location_route_calculator.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, locationservice.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRouteCalculatorDestroy(ctx), diff --git a/internal/service/location/tracker_association_data_source_test.go b/internal/service/location/tracker_association_data_source_test.go index a79fb2162c5a..1a579e69dd5d 100644 --- a/internal/service/location/tracker_association_data_source_test.go +++ b/internal/service/location/tracker_association_data_source_test.go @@ -17,7 +17,7 @@ func TestAccLocationTrackerAssociationDataSource_basic(t *testing.T) { resourceName := "aws_location_tracker_association.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, locationservice.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTrackerAssociationDestroy(ctx), diff --git a/internal/service/location/tracker_association_test.go b/internal/service/location/tracker_association_test.go index 7a277e344cc5..18eec5a8c5de 100644 --- a/internal/service/location/tracker_association_test.go +++ b/internal/service/location/tracker_association_test.go @@ -79,7 +79,7 @@ func TestAccLocationTrackerAssociation_basic(t *testing.T) { resourceName := "aws_location_tracker_association.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, locationservice.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTrackerAssociationDestroy(ctx), @@ -107,7 +107,7 @@ func TestAccLocationTrackerAssociation_disappears(t *testing.T) { resourceName := "aws_location_tracker_association.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, locationservice.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTrackerAssociationDestroy(ctx), diff --git a/internal/service/location/tracker_associations_data_source_test.go b/internal/service/location/tracker_associations_data_source_test.go index 011f8158c64c..9aeaf3a514fa 100644 --- a/internal/service/location/tracker_associations_data_source_test.go +++ b/internal/service/location/tracker_associations_data_source_test.go @@ -16,7 +16,7 @@ func TestAccLocationTrackerAssociationsDataSource_basic(t *testing.T) { dataSourceName := "data.aws_location_tracker_associations.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, locationservice.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTrackerAssociationDestroy(ctx), diff --git a/internal/service/location/tracker_data_source_test.go b/internal/service/location/tracker_data_source_test.go index 3696e7ff1964..89fa6697d358 100644 --- a/internal/service/location/tracker_data_source_test.go +++ b/internal/service/location/tracker_data_source_test.go @@ -17,7 +17,7 @@ func TestAccLocationTrackerDataSource_indexName(t *testing.T) { resourceName := "aws_location_tracker.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, locationservice.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTrackerDestroy(ctx), diff --git a/internal/service/location/tracker_test.go b/internal/service/location/tracker_test.go index 69ef81256460..74b29be1e6f4 100644 --- a/internal/service/location/tracker_test.go +++ b/internal/service/location/tracker_test.go @@ -22,7 +22,7 @@ func TestAccLocationTracker_basic(t *testing.T) { resourceName := "aws_location_tracker.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, locationservice.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTrackerDestroy(ctx), @@ -56,7 +56,7 @@ func TestAccLocationTracker_disappears(t *testing.T) { resourceName := "aws_location_tracker.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, locationservice.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTrackerDestroy(ctx), @@ -79,7 +79,7 @@ func TestAccLocationTracker_description(t *testing.T) { resourceName := "aws_location_tracker.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, locationservice.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTrackerDestroy(ctx), @@ -113,7 +113,7 @@ func TestAccLocationTracker_kmsKeyID(t *testing.T) { resourceName := "aws_location_tracker.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, locationservice.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTrackerDestroy(ctx), @@ -140,7 +140,7 @@ func TestAccLocationTracker_positionFiltering(t *testing.T) { resourceName := "aws_location_tracker.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, locationservice.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTrackerDestroy(ctx), @@ -174,7 +174,7 @@ func TestAccLocationTracker_tags(t *testing.T) { resourceName := "aws_location_tracker.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, locationservice.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTrackerDestroy(ctx), From 48f2ec0649a8a089ba5b2942069f952e9a59696c Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Fri, 24 Feb 2023 16:37:10 -0500 Subject: [PATCH 189/763] Add 'Context' argument to 'acctest.PreCheck' for logs. --- ...tection_policy_document_data_source_test.go | 8 ++++---- .../logs/data_protection_policy_test.go | 6 +++--- .../service/logs/destination_policy_test.go | 2 +- internal/service/logs/destination_test.go | 8 ++++---- .../service/logs/group_data_source_test.go | 2 +- internal/service/logs/group_test.go | 18 +++++++++--------- .../service/logs/groups_data_source_test.go | 4 ++-- internal/service/logs/metric_filter_test.go | 10 +++++----- internal/service/logs/query_definition_test.go | 8 ++++---- internal/service/logs/resource_policy_test.go | 4 ++-- internal/service/logs/stream_test.go | 6 +++--- .../service/logs/subscription_filter_test.go | 16 ++++++++-------- 12 files changed, 46 insertions(+), 46 deletions(-) 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 367450356870..68555cbb10c5 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 @@ -17,7 +17,7 @@ func TestAccLogsDataProtectionPolicyDocumentDataSource_basic(t *testing.T) { targetName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, names.Logs), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDataProtectionPolicyDestroy(ctx), @@ -39,7 +39,7 @@ func TestAccLogsDataProtectionPolicyDocumentDataSource_empty(t *testing.T) { logGroupName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, names.Logs), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDataProtectionPolicyDestroy(ctx), @@ -59,7 +59,7 @@ func TestAccLogsDataProtectionPolicyDocumentDataSource_empty(t *testing.T) { func TestAccLogsDataProtectionPolicyDocumentDataSource_errorOnBadOrderOfStatements(t *testing.T) { ctx := acctest.Context(t) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, names.Logs), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDataProtectionPolicyDestroy(ctx), @@ -75,7 +75,7 @@ func TestAccLogsDataProtectionPolicyDocumentDataSource_errorOnBadOrderOfStatemen func TestAccLogsDataProtectionPolicyDocumentDataSource_errorOnNoOperation(t *testing.T) { ctx := acctest.Context(t) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, names.Logs), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDataProtectionPolicyDestroy(ctx), diff --git a/internal/service/logs/data_protection_policy_test.go b/internal/service/logs/data_protection_policy_test.go index 432ae79aa118..7a8781177342 100644 --- a/internal/service/logs/data_protection_policy_test.go +++ b/internal/service/logs/data_protection_policy_test.go @@ -23,7 +23,7 @@ func TestAccLogsDataProtectionPolicy_basic(t *testing.T) { name := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, names.CloudWatchLogsEndpointID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDataProtectionPolicyDestroy(ctx), @@ -86,7 +86,7 @@ func TestAccLogsDataProtectionPolicy_disappears(t *testing.T) { name := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, names.CloudWatchLogsEndpointID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDataProtectionPolicyDestroy(ctx), @@ -110,7 +110,7 @@ func TestAccLogsDataProtectionPolicy_policyDocument(t *testing.T) { name := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, names.CloudWatchLogsEndpointID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDataProtectionPolicyDestroy(ctx), diff --git a/internal/service/logs/destination_policy_test.go b/internal/service/logs/destination_policy_test.go index 9ebabc688e6a..69090296124b 100644 --- a/internal/service/logs/destination_policy_test.go +++ b/internal/service/logs/destination_policy_test.go @@ -21,7 +21,7 @@ func TestAccLogsDestinationPolicy_basic(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, cloudwatchlogs.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: acctest.CheckDestroyNoop, diff --git a/internal/service/logs/destination_test.go b/internal/service/logs/destination_test.go index ee7a6a45e1b0..2fce327517fb 100644 --- a/internal/service/logs/destination_test.go +++ b/internal/service/logs/destination_test.go @@ -25,7 +25,7 @@ func TestAccLogsDestination_basic(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, cloudwatchlogs.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDestinationDestroy(ctx), @@ -56,7 +56,7 @@ func TestAccLogsDestination_disappears(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, cloudwatchlogs.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDestinationDestroy(ctx), @@ -80,7 +80,7 @@ func TestAccLogsDestination_tags(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, cloudwatchlogs.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDestinationDestroy(ctx), @@ -130,7 +130,7 @@ func TestAccLogsDestination_update(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, cloudwatchlogs.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDestinationDestroy(ctx), diff --git a/internal/service/logs/group_data_source_test.go b/internal/service/logs/group_data_source_test.go index 7e4497346dba..6e560c82efe8 100644 --- a/internal/service/logs/group_data_source_test.go +++ b/internal/service/logs/group_data_source_test.go @@ -16,7 +16,7 @@ func TestAccLogsGroupDataSource_basic(t *testing.T) { resourceName := "aws_cloudwatch_log_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, cloudwatchlogs.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ diff --git a/internal/service/logs/group_test.go b/internal/service/logs/group_test.go index 8ce22841ed0b..232d30e7d58e 100644 --- a/internal/service/logs/group_test.go +++ b/internal/service/logs/group_test.go @@ -20,7 +20,7 @@ func TestAccLogsGroup_basic(t *testing.T) { resourceName := "aws_cloudwatch_log_group.test" acctest.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, cloudwatchlogs.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckGroupDestroy(ctx, t), @@ -54,7 +54,7 @@ func TestAccLogsGroup_nameGenerate(t *testing.T) { resourceName := "aws_cloudwatch_log_group.test" acctest.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, cloudwatchlogs.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckGroupDestroy(ctx, t), @@ -83,7 +83,7 @@ func TestAccLogsGroup_namePrefix(t *testing.T) { resourceName := "aws_cloudwatch_log_group.test" acctest.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, cloudwatchlogs.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckGroupDestroy(ctx, t), @@ -113,7 +113,7 @@ func TestAccLogsGroup_disappears(t *testing.T) { resourceName := "aws_cloudwatch_log_group.test" acctest.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, cloudwatchlogs.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckGroupDestroy(ctx, t), @@ -137,7 +137,7 @@ func TestAccLogsGroup_tags(t *testing.T) { resourceName := "aws_cloudwatch_log_group.test" acctest.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, cloudwatchlogs.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckGroupDestroy(ctx, t), @@ -186,7 +186,7 @@ func TestAccLogsGroup_kmsKey(t *testing.T) { kmsKey2ResourceName := "aws_kms_key.test.1" acctest.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, cloudwatchlogs.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckGroupDestroy(ctx, t), @@ -229,7 +229,7 @@ func TestAccLogsGroup_retentionPolicy(t *testing.T) { resourceName := "aws_cloudwatch_log_group.test" acctest.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, cloudwatchlogs.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckGroupDestroy(ctx, t), @@ -274,7 +274,7 @@ func TestAccLogsGroup_multiple(t *testing.T) { resource3Name := "aws_cloudwatch_log_group.test.2" acctest.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, cloudwatchlogs.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckGroupDestroy(ctx, t), @@ -298,7 +298,7 @@ func TestAccLogsGroup_skipDestroy(t *testing.T) { resourceName := "aws_cloudwatch_log_group.test" acctest.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, cloudwatchlogs.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckGroupNoDestroy(ctx, t), diff --git a/internal/service/logs/groups_data_source_test.go b/internal/service/logs/groups_data_source_test.go index 937f1fdf7022..772e11594978 100644 --- a/internal/service/logs/groups_data_source_test.go +++ b/internal/service/logs/groups_data_source_test.go @@ -17,7 +17,7 @@ func TestAccLogsGroupsDataSource_basic(t *testing.T) { resource2Name := "aws_cloudwatch_log_group.test.1" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, cloudwatchlogs.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ @@ -43,7 +43,7 @@ func TestAccLogsGroupsDataSource_noPrefix(t *testing.T) { resource2Name := "aws_cloudwatch_log_group.test.1" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, cloudwatchlogs.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ diff --git a/internal/service/logs/metric_filter_test.go b/internal/service/logs/metric_filter_test.go index 9d4d090b7f98..b1087c6715c9 100644 --- a/internal/service/logs/metric_filter_test.go +++ b/internal/service/logs/metric_filter_test.go @@ -23,7 +23,7 @@ func TestAccLogsMetricFilter_basic(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, cloudwatchlogs.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckMetricFilterDestroy(ctx), @@ -61,7 +61,7 @@ func TestAccLogsMetricFilter_disappears(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, cloudwatchlogs.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckMetricFilterDestroy(ctx), @@ -86,7 +86,7 @@ func TestAccLogsMetricFilter_Disappears_logGroup(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, cloudwatchlogs.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckMetricFilterDestroy(ctx), @@ -109,7 +109,7 @@ func TestAccLogsMetricFilter_many(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, cloudwatchlogs.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckMetricFilterDestroy(ctx), @@ -130,7 +130,7 @@ func TestAccLogsMetricFilter_update(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, cloudwatchlogs.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckMetricFilterDestroy(ctx), diff --git a/internal/service/logs/query_definition_test.go b/internal/service/logs/query_definition_test.go index 85089b04b38e..4bed340f9fe9 100644 --- a/internal/service/logs/query_definition_test.go +++ b/internal/service/logs/query_definition_test.go @@ -31,7 +31,7 @@ func TestAccLogsQueryDefinition_basic(t *testing.T) { ` resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, cloudwatchlogs.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckQueryDefinitionDestroy(ctx), @@ -77,7 +77,7 @@ func TestAccLogsQueryDefinition_disappears(t *testing.T) { queryName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, cloudwatchlogs.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckQueryDefinitionDestroy(ctx), @@ -102,7 +102,7 @@ func TestAccLogsQueryDefinition_rename(t *testing.T) { updatedQueryName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, cloudwatchlogs.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckQueryDefinitionDestroy(ctx), @@ -138,7 +138,7 @@ func TestAccLogsQueryDefinition_logGroups(t *testing.T) { queryName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, cloudwatchlogs.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckQueryDefinitionDestroy(ctx), diff --git a/internal/service/logs/resource_policy_test.go b/internal/service/logs/resource_policy_test.go index 07161e35d53d..e60d0b57308a 100644 --- a/internal/service/logs/resource_policy_test.go +++ b/internal/service/logs/resource_policy_test.go @@ -22,7 +22,7 @@ func TestAccLogsResourcePolicy_basic(t *testing.T) { var resourcePolicy cloudwatchlogs.ResourcePolicy resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, cloudwatchlogs.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckResourcePolicyDestroy(ctx), @@ -59,7 +59,7 @@ func TestAccLogsResourcePolicy_ignoreEquivalent(t *testing.T) { var resourcePolicy cloudwatchlogs.ResourcePolicy resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, cloudwatchlogs.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckResourcePolicyDestroy(ctx), diff --git a/internal/service/logs/stream_test.go b/internal/service/logs/stream_test.go index 8d21a84af3fe..5b23a5cae77e 100644 --- a/internal/service/logs/stream_test.go +++ b/internal/service/logs/stream_test.go @@ -22,7 +22,7 @@ func TestAccLogsStream_basic(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, cloudwatchlogs.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckStreamDestroy(ctx), @@ -50,7 +50,7 @@ func TestAccLogsStream_disappears(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, cloudwatchlogs.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckStreamDestroy(ctx), @@ -75,7 +75,7 @@ func TestAccLogsStream_Disappears_logGroup(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, cloudwatchlogs.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckStreamDestroy(ctx), diff --git a/internal/service/logs/subscription_filter_test.go b/internal/service/logs/subscription_filter_test.go index b93ee58985ac..4edceadd5515 100644 --- a/internal/service/logs/subscription_filter_test.go +++ b/internal/service/logs/subscription_filter_test.go @@ -24,7 +24,7 @@ func TestAccLogsSubscriptionFilter_basic(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, cloudwatchlogs.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSubscriptionFilterDestroy(ctx), @@ -56,7 +56,7 @@ func TestAccLogsSubscriptionFilter_many(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, cloudwatchlogs.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSubscriptionFilterDestroy(ctx), @@ -76,7 +76,7 @@ func TestAccLogsSubscriptionFilter_disappears(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, cloudwatchlogs.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSubscriptionFilterDestroy(ctx), @@ -101,7 +101,7 @@ func TestAccLogsSubscriptionFilter_Disappears_logGroup(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, cloudwatchlogs.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSubscriptionFilterDestroy(ctx), @@ -126,7 +126,7 @@ func TestAccLogsSubscriptionFilter_DestinationARN_kinesisDataFirehose(t *testing rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, cloudwatchlogs.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSubscriptionFilterDestroy(ctx), @@ -156,7 +156,7 @@ func TestAccLogsSubscriptionFilter_DestinationARN_kinesisStream(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, cloudwatchlogs.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSubscriptionFilterDestroy(ctx), @@ -185,7 +185,7 @@ func TestAccLogsSubscriptionFilter_distribution(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, cloudwatchlogs.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSubscriptionFilterDestroy(ctx), @@ -223,7 +223,7 @@ func TestAccLogsSubscriptionFilter_roleARN(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, cloudwatchlogs.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSubscriptionFilterDestroy(ctx), From f55018d88f62910ec0c64b567fe9fc144aeca766 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Fri, 24 Feb 2023 16:37:11 -0500 Subject: [PATCH 190/763] Add 'Context' argument to 'acctest.PreCheck' for macie. --- internal/service/macie/member_account_association_test.go | 4 ++-- internal/service/macie/s3_bucket_association_test.go | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/internal/service/macie/member_account_association_test.go b/internal/service/macie/member_account_association_test.go index 2415ebb2fb09..07c12f5611ea 100644 --- a/internal/service/macie/member_account_association_test.go +++ b/internal/service/macie/member_account_association_test.go @@ -23,7 +23,7 @@ func TestAccMacieMemberAccountAssociation_basic(t *testing.T) { } resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, macie.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckMemberAccountAssociationDestroy(ctx), @@ -41,7 +41,7 @@ func TestAccMacieMemberAccountAssociation_basic(t *testing.T) { func TestAccMacieMemberAccountAssociation_self(t *testing.T) { ctx := acctest.Context(t) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + 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. diff --git a/internal/service/macie/s3_bucket_association_test.go b/internal/service/macie/s3_bucket_association_test.go index 437eb4fcf1be..4b3972e56a61 100644 --- a/internal/service/macie/s3_bucket_association_test.go +++ b/internal/service/macie/s3_bucket_association_test.go @@ -20,7 +20,7 @@ func TestAccMacieS3BucketAssociation_basic(t *testing.T) { rInt := sdkacctest.RandInt() resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, macie.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckS3BucketAssociationDestroy(ctx), @@ -50,7 +50,7 @@ func TestAccMacieS3BucketAssociation_accountIdAndPrefix(t *testing.T) { rInt := sdkacctest.RandInt() resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, macie.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckS3BucketAssociationDestroy(ctx), From 8762f14fb5b9cc01f521f08c3902336403e7f730 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Fri, 24 Feb 2023 16:37:11 -0500 Subject: [PATCH 191/763] Add 'Context' argument to 'acctest.PreCheck' for macie2. --- internal/service/macie2/account_test.go | 10 +++++----- .../classification_export_configuration_test.go | 2 +- .../service/macie2/classification_job_test.go | 16 ++++++++-------- .../macie2/custom_data_identifier_test.go | 12 ++++++------ internal/service/macie2/findings_filter_test.go | 16 ++++++++-------- .../service/macie2/invitation_accepter_test.go | 2 +- internal/service/macie2/member_test.go | 14 +++++++------- .../macie2/organization_admin_account_test.go | 4 ++-- 8 files changed, 38 insertions(+), 38 deletions(-) diff --git a/internal/service/macie2/account_test.go b/internal/service/macie2/account_test.go index 7bbd9156decc..7b219664a1c9 100644 --- a/internal/service/macie2/account_test.go +++ b/internal/service/macie2/account_test.go @@ -20,7 +20,7 @@ func testAccAccount_basic(t *testing.T) { resourceName := "aws_macie2_account.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckAccountDestroy(ctx), ErrorCheck: acctest.ErrorCheck(t, macie2.EndpointsID), @@ -51,7 +51,7 @@ func testAccAccount_FindingPublishingFrequency(t *testing.T) { resourceName := "aws_macie2_account.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckAccountDestroy(ctx), ErrorCheck: acctest.ErrorCheck(t, macie2.EndpointsID), @@ -93,7 +93,7 @@ func testAccAccount_WithStatus(t *testing.T) { resourceName := "aws_macie2_account.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckAccountDestroy(ctx), ErrorCheck: acctest.ErrorCheck(t, macie2.EndpointsID), @@ -135,7 +135,7 @@ func testAccAccount_WithFindingAndStatus(t *testing.T) { resourceName := "aws_macie2_account.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckAccountDestroy(ctx), ErrorCheck: acctest.ErrorCheck(t, macie2.EndpointsID), @@ -177,7 +177,7 @@ func testAccAccount_disappears(t *testing.T) { resourceName := "aws_macie2_account.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckAccountDestroy(ctx), ErrorCheck: acctest.ErrorCheck(t, macie2.EndpointsID), diff --git a/internal/service/macie2/classification_export_configuration_test.go b/internal/service/macie2/classification_export_configuration_test.go index 2d715b949277..5eada8384a8e 100644 --- a/internal/service/macie2/classification_export_configuration_test.go +++ b/internal/service/macie2/classification_export_configuration_test.go @@ -22,7 +22,7 @@ func testAccClassificationExportConfiguration_basic(t *testing.T) { s3BucketResourceName := "aws_s3_bucket.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClassificationExportConfigurationDestroy(ctx), ErrorCheck: acctest.ErrorCheck(t, macie2.EndpointsID), diff --git a/internal/service/macie2/classification_job_test.go b/internal/service/macie2/classification_job_test.go index 8c20f7b44f25..0a31ac7e867b 100644 --- a/internal/service/macie2/classification_job_test.go +++ b/internal/service/macie2/classification_job_test.go @@ -23,7 +23,7 @@ func testAccClassificationJob_basic(t *testing.T) { bucketName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClassificationJobDestroy(ctx), ErrorCheck: acctest.ErrorCheck(t, macie2.EndpointsID), @@ -54,7 +54,7 @@ func testAccClassificationJob_Name_Generated(t *testing.T) { bucketName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClassificationJobDestroy(ctx), ErrorCheck: acctest.ErrorCheck(t, macie2.EndpointsID), @@ -84,7 +84,7 @@ func testAccClassificationJob_NamePrefix(t *testing.T) { namePrefix := "tf-acc-test-prefix-" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClassificationJobDestroy(ctx), ErrorCheck: acctest.ErrorCheck(t, macie2.EndpointsID), @@ -113,7 +113,7 @@ func testAccClassificationJob_disappears(t *testing.T) { bucketName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClassificationJobDestroy(ctx), ErrorCheck: acctest.ErrorCheck(t, macie2.EndpointsID), @@ -136,7 +136,7 @@ func testAccClassificationJob_Status(t *testing.T) { bucketName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClassificationJobDestroy(ctx), ErrorCheck: acctest.ErrorCheck(t, macie2.EndpointsID), @@ -180,7 +180,7 @@ func testAccClassificationJob_complete(t *testing.T) { descriptionUpdated := "Updated Description of a test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClassificationJobDestroy(ctx), ErrorCheck: acctest.ErrorCheck(t, macie2.EndpointsID), @@ -262,7 +262,7 @@ func testAccClassificationJob_WithTags(t *testing.T) { bucketName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClassificationJobDestroy(ctx), ErrorCheck: acctest.ErrorCheck(t, macie2.EndpointsID), @@ -311,7 +311,7 @@ func testAccClassificationJob_BucketCriteria(t *testing.T) { descriptionUpdated := "Updated Description of a test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClassificationJobDestroy(ctx), ErrorCheck: acctest.ErrorCheck(t, macie2.EndpointsID), diff --git a/internal/service/macie2/custom_data_identifier_test.go b/internal/service/macie2/custom_data_identifier_test.go index 57e839eb8dfd..111aa8384791 100644 --- a/internal/service/macie2/custom_data_identifier_test.go +++ b/internal/service/macie2/custom_data_identifier_test.go @@ -24,7 +24,7 @@ func testAccCustomDataIdentifier_basic(t *testing.T) { regex := "[0-9]{3}-[0-9]{2}-[0-9]{4}" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckCustomDataIdentifierDestroy(ctx), ErrorCheck: acctest.ErrorCheck(t, macie2.EndpointsID), @@ -56,7 +56,7 @@ func testAccCustomDataIdentifier_Name_Generated(t *testing.T) { regex := "[0-9]{3}-[0-9]{2}-[0-9]{4}" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckCustomDataIdentifierDestroy(ctx), ErrorCheck: acctest.ErrorCheck(t, macie2.EndpointsID), @@ -85,7 +85,7 @@ func testAccCustomDataIdentifier_disappears(t *testing.T) { regex := "[0-9]{3}-[0-9]{2}-[0-9]{4}" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckCustomDataIdentifierDestroy(ctx), ErrorCheck: acctest.ErrorCheck(t, macie2.EndpointsID), @@ -111,7 +111,7 @@ func testAccCustomDataIdentifier_NamePrefix(t *testing.T) { namePrefix := "tf-acc-test-prefix-" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckCustomDataIdentifierDestroy(ctx), ErrorCheck: acctest.ErrorCheck(t, macie2.EndpointsID), @@ -144,7 +144,7 @@ func testAccCustomDataIdentifier_WithClassificationJob(t *testing.T) { descriptionUpdated := "this is a updated description" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckCustomDataIdentifierDestroy(ctx), ErrorCheck: acctest.ErrorCheck(t, macie2.EndpointsID), @@ -186,7 +186,7 @@ func testAccCustomDataIdentifier_WithTags(t *testing.T) { bucketName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckCustomDataIdentifierDestroy(ctx), ErrorCheck: acctest.ErrorCheck(t, macie2.EndpointsID), diff --git a/internal/service/macie2/findings_filter_test.go b/internal/service/macie2/findings_filter_test.go index 99f59cfc2bd1..fe46fec8bc3e 100644 --- a/internal/service/macie2/findings_filter_test.go +++ b/internal/service/macie2/findings_filter_test.go @@ -22,7 +22,7 @@ func testAccFindingsFilter_basic(t *testing.T) { resourceName := "aws_macie2_findings_filter.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckFindingsFilterDestroy(ctx), ErrorCheck: acctest.ErrorCheck(t, macie2.EndpointsID), @@ -52,7 +52,7 @@ func testAccFindingsFilter_Name_Generated(t *testing.T) { resourceName := "aws_macie2_findings_filter.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckFindingsFilterDestroy(ctx), ErrorCheck: acctest.ErrorCheck(t, macie2.EndpointsID), @@ -81,7 +81,7 @@ func testAccFindingsFilter_NamePrefix(t *testing.T) { namePrefix := "tf-acc-test-prefix-" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckFindingsFilterDestroy(ctx), ErrorCheck: acctest.ErrorCheck(t, macie2.EndpointsID), @@ -109,7 +109,7 @@ func testAccFindingsFilter_disappears(t *testing.T) { resourceName := "aws_macie2_findings_filter.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckFindingsFilterDestroy(ctx), ErrorCheck: acctest.ErrorCheck(t, macie2.EndpointsID), @@ -137,7 +137,7 @@ func testAccFindingsFilter_complete(t *testing.T) { descriptionUpdated := "this is a description updated" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckFindingsFilterDestroy(ctx), ErrorCheck: acctest.ErrorCheck(t, macie2.EndpointsID), @@ -219,7 +219,7 @@ func testAccFindingsFilter_WithDate(t *testing.T) { endDate := "2020-02-01T00:00:00Z" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckFindingsFilterDestroy(ctx), ErrorCheck: acctest.ErrorCheck(t, macie2.EndpointsID), @@ -296,7 +296,7 @@ func testAccFindingsFilter_WithNumber(t *testing.T) { secondNumber := "13" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckFindingsFilterDestroy(ctx), ErrorCheck: acctest.ErrorCheck(t, macie2.EndpointsID), @@ -364,7 +364,7 @@ func testAccFindingsFilter_withTags(t *testing.T) { description := "this is a description" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckFindingsFilterDestroy(ctx), ErrorCheck: acctest.ErrorCheck(t, macie2.EndpointsID), diff --git a/internal/service/macie2/invitation_accepter_test.go b/internal/service/macie2/invitation_accepter_test.go index 5f0103e0a77e..faf0ed0e4891 100644 --- a/internal/service/macie2/invitation_accepter_test.go +++ b/internal/service/macie2/invitation_accepter_test.go @@ -22,7 +22,7 @@ func testAccInvitationAccepter_basic(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckAlternateAccount(t) }, ProtoV5ProviderFactories: acctest.ProtoV5FactoriesAlternate(ctx, t), diff --git a/internal/service/macie2/member_test.go b/internal/service/macie2/member_test.go index 1399c2c2e53e..f3cbb448c0ec 100644 --- a/internal/service/macie2/member_test.go +++ b/internal/service/macie2/member_test.go @@ -33,7 +33,7 @@ func testAccMember_basic(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckAlternateAccount(t) }, ProtoV5ProviderFactories: acctest.ProtoV5FactoriesAlternate(ctx, t), @@ -70,7 +70,7 @@ func testAccMember_disappears(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckAlternateAccount(t) }, ProtoV5ProviderFactories: acctest.ProtoV5FactoriesAlternate(ctx, t), @@ -97,7 +97,7 @@ func testAccMember_invitationDisableEmailNotification(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckAlternateAccount(t) }, ProtoV5ProviderFactories: acctest.ProtoV5FactoriesAlternate(ctx, t), @@ -139,7 +139,7 @@ func testAccMember_invite(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckAlternateAccount(t) }, ProtoV5ProviderFactories: acctest.ProtoV5FactoriesAlternate(ctx, t), @@ -194,7 +194,7 @@ func testAccMember_inviteRemoved(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckAlternateAccount(t) }, ProtoV5ProviderFactories: acctest.ProtoV5FactoriesAlternate(ctx, t), @@ -249,7 +249,7 @@ func testAccMember_status(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckAlternateAccount(t) }, ProtoV5ProviderFactories: acctest.ProtoV5FactoriesAlternate(ctx, t), @@ -303,7 +303,7 @@ func testAccMember_withTags(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckAlternateAccount(t) }, ProtoV5ProviderFactories: acctest.ProtoV5FactoriesAlternate(ctx, t), diff --git a/internal/service/macie2/organization_admin_account_test.go b/internal/service/macie2/organization_admin_account_test.go index 239a88195ca3..feba1397d191 100644 --- a/internal/service/macie2/organization_admin_account_test.go +++ b/internal/service/macie2/organization_admin_account_test.go @@ -20,7 +20,7 @@ func testAccOrganizationAdminAccount_basic(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckOrganizationsAccount(ctx, t) }, ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, @@ -49,7 +49,7 @@ func testAccOrganizationAdminAccount_disappears(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckOrganizationsAccount(ctx, t) }, ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, From d8d54be66dd2b534f4f95ef8cfec9873599543e5 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Fri, 24 Feb 2023 16:37:12 -0500 Subject: [PATCH 192/763] Add 'Context' argument to 'acctest.PreCheck' for mediaconvert. --- internal/service/mediaconvert/queue_test.go | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/internal/service/mediaconvert/queue_test.go b/internal/service/mediaconvert/queue_test.go index dcee3b0d4b43..165490c69db1 100644 --- a/internal/service/mediaconvert/queue_test.go +++ b/internal/service/mediaconvert/queue_test.go @@ -24,7 +24,7 @@ func TestAccMediaConvertQueue_basic(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(t) }, ErrorCheck: acctest.ErrorCheck(t, mediaconvert.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckQueueDestroy(ctx), @@ -58,7 +58,7 @@ func TestAccMediaConvertQueue_reservationPlanSettings(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(t) }, ErrorCheck: acctest.ErrorCheck(t, mediaconvert.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckQueueDestroy(ctx), @@ -101,7 +101,7 @@ func TestAccMediaConvertQueue_withStatus(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(t) }, ErrorCheck: acctest.ErrorCheck(t, mediaconvert.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckQueueDestroy(ctx), @@ -136,7 +136,7 @@ func TestAccMediaConvertQueue_withTags(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(t) }, ErrorCheck: acctest.ErrorCheck(t, mediaconvert.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckQueueDestroy(ctx), @@ -182,7 +182,7 @@ func TestAccMediaConvertQueue_disappears(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(t) }, ErrorCheck: acctest.ErrorCheck(t, mediaconvert.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckQueueDestroy(ctx), @@ -208,7 +208,7 @@ func TestAccMediaConvertQueue_withDescription(t *testing.T) { description2 := sdkacctest.RandomWithPrefix("Description: ") resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(t) }, ErrorCheck: acctest.ErrorCheck(t, mediaconvert.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckQueueDestroy(ctx), From 134c568e7a3aabafd36631ad2d3d06b198b52751 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Fri, 24 Feb 2023 16:37:12 -0500 Subject: [PATCH 193/763] Add 'Context' argument to 'acctest.PreCheck' for medialive. --- internal/service/medialive/channel_test.go | 16 ++++++++-------- .../medialive/input_security_group_test.go | 8 ++++---- internal/service/medialive/input_test.go | 8 ++++---- .../service/medialive/multiplex_program_test.go | 6 +++--- internal/service/medialive/multiplex_test.go | 10 +++++----- 5 files changed, 24 insertions(+), 24 deletions(-) diff --git a/internal/service/medialive/channel_test.go b/internal/service/medialive/channel_test.go index dcef2fee1145..440a916ce76a 100644 --- a/internal/service/medialive/channel_test.go +++ b/internal/service/medialive/channel_test.go @@ -31,7 +31,7 @@ func TestAccMediaLiveChannel_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(names.MediaLiveEndpointID, t) testAccChannelsPreCheck(ctx, t) }, @@ -88,7 +88,7 @@ func TestAccMediaLiveChannel_m2ts_settings(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(names.MediaLiveEndpointID, t) testAccChannelsPreCheck(ctx, t) }, @@ -154,7 +154,7 @@ func TestAccMediaLiveChannel_audioDescriptions_codecSettings(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(names.MediaLiveEndpointID, t) testAccChannelsPreCheck(ctx, t) }, @@ -206,7 +206,7 @@ func TestAccMediaLiveChannel_hls(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(names.MediaLiveEndpointID, t) testAccChannelsPreCheck(ctx, t) }, @@ -258,7 +258,7 @@ func TestAccMediaLiveChannel_status(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(names.MediaLiveEndpointID, t) testAccChannelsPreCheck(ctx, t) }, @@ -297,7 +297,7 @@ func TestAccMediaLiveChannel_update(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(names.MediaLiveEndpointID, t) testAccChannelsPreCheck(ctx, t) }, @@ -375,7 +375,7 @@ func TestAccMediaLiveChannel_updateTags(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(names.MediaLiveEndpointID, t) testAccChannelsPreCheck(ctx, t) }, @@ -424,7 +424,7 @@ func TestAccMediaLiveChannel_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(names.MediaLiveEndpointID, t) testAccChannelsPreCheck(ctx, t) }, diff --git a/internal/service/medialive/input_security_group_test.go b/internal/service/medialive/input_security_group_test.go index 12e2e353dcc6..6f06aee0ad2d 100644 --- a/internal/service/medialive/input_security_group_test.go +++ b/internal/service/medialive/input_security_group_test.go @@ -30,7 +30,7 @@ func TestAccMediaLiveInputSecurityGroup_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(names.MediaLiveEndpointID, t) testAccInputSecurityGroupsPreCheck(ctx, t) }, @@ -69,7 +69,7 @@ func TestAccMediaLiveInputSecurityGroup_updateCIDR(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(names.MediaLiveEndpointID, t) testAccInputSecurityGroupsPreCheck(ctx, t) }, @@ -112,7 +112,7 @@ func TestAccMediaLiveInputSecurityGroup_updateTags(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(names.MediaLiveEndpointID, t) testAccInputSecurityGroupsPreCheck(ctx, t) }, @@ -161,7 +161,7 @@ func TestAccMediaLiveInputSecurityGroup_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(names.MediaLiveEndpointID, t) testAccInputSecurityGroupsPreCheck(ctx, t) }, diff --git a/internal/service/medialive/input_test.go b/internal/service/medialive/input_test.go index bf0fb92ca083..ce6080545118 100644 --- a/internal/service/medialive/input_test.go +++ b/internal/service/medialive/input_test.go @@ -30,7 +30,7 @@ func TestAccMediaLiveInput_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(names.MediaLiveEndpointID, t) testAccInputsPreCheck(ctx, t) }, @@ -70,7 +70,7 @@ func TestAccMediaLiveInput_update(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(names.MediaLiveEndpointID, t) testAccInputsPreCheck(ctx, t) }, @@ -114,7 +114,7 @@ func TestAccMediaLiveInput_updateTags(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(names.MediaLiveEndpointID, t) testAccInputsPreCheck(ctx, t) }, @@ -163,7 +163,7 @@ func TestAccMediaLiveInput_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(names.MediaLiveEndpointID, t) testAccInputsPreCheck(ctx, t) }, diff --git a/internal/service/medialive/multiplex_program_test.go b/internal/service/medialive/multiplex_program_test.go index 2b498c8f52c8..9dfadc0b8549 100644 --- a/internal/service/medialive/multiplex_program_test.go +++ b/internal/service/medialive/multiplex_program_test.go @@ -82,7 +82,7 @@ func testAccMultiplexProgram_basic(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(names.MediaLiveEndpointID, t) }, ErrorCheck: acctest.ErrorCheck(t, names.MediaLiveEndpointID), @@ -121,7 +121,7 @@ func testAccMultiplexProgram_update(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(names.MediaLiveEndpointID, t) }, ErrorCheck: acctest.ErrorCheck(t, names.MediaLiveEndpointID), @@ -166,7 +166,7 @@ func testAccMultiplexProgram_disappears(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(names.MediaLiveEndpointID, t) }, ErrorCheck: acctest.ErrorCheck(t, names.MediaLiveEndpointID), diff --git a/internal/service/medialive/multiplex_test.go b/internal/service/medialive/multiplex_test.go index a0f406c779f2..87f1a624382f 100644 --- a/internal/service/medialive/multiplex_test.go +++ b/internal/service/medialive/multiplex_test.go @@ -30,7 +30,7 @@ func testAccMultiplex_basic(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(names.MediaLiveEndpointID, t) testAccMultiplexesPreCheck(ctx, t) }, @@ -72,7 +72,7 @@ func testAccMultiplex_start(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(names.MediaLiveEndpointID, t) testAccMultiplexesPreCheck(ctx, t) }, @@ -112,7 +112,7 @@ func testAccMultiplex_update(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(names.MediaLiveEndpointID, t) testAccMultiplexesPreCheck(ctx, t) }, @@ -160,7 +160,7 @@ func testAccMultiplex_updateTags(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(names.MediaLiveEndpointID, t) testAccMultiplexesPreCheck(ctx, t) }, @@ -209,7 +209,7 @@ func testAccMultiplex_disappears(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(names.MediaLiveEndpointID, t) testAccMultiplexesPreCheck(ctx, t) }, From 9735291f628becfb33b2509da7d653c7dacb876d Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Fri, 24 Feb 2023 16:37:12 -0500 Subject: [PATCH 194/763] Add 'Context' argument to 'acctest.PreCheck' for mediapackage. --- internal/service/mediapackage/channel_test.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/internal/service/mediapackage/channel_test.go b/internal/service/mediapackage/channel_test.go index ab2cb23478f2..29460fa0ef61 100644 --- a/internal/service/mediapackage/channel_test.go +++ b/internal/service/mediapackage/channel_test.go @@ -21,7 +21,7 @@ func TestAccMediaPackageChannel_basic(t *testing.T) { resourceName := "aws_media_package_channel.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, mediapackage.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckChannelDestroy(ctx), @@ -54,7 +54,7 @@ func TestAccMediaPackageChannel_description(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, mediapackage.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckChannelDestroy(ctx), @@ -88,7 +88,7 @@ func TestAccMediaPackageChannel_tags(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, mediapackage.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckChannelDestroy(ctx), From 8e0b63be4ea230b7c527413e0bc9ba75b91d4c5e Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Fri, 24 Feb 2023 16:37:13 -0500 Subject: [PATCH 195/763] Add 'Context' argument to 'acctest.PreCheck' for mediastore. --- internal/service/mediastore/container_policy_test.go | 2 +- internal/service/mediastore/container_test.go | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/internal/service/mediastore/container_policy_test.go b/internal/service/mediastore/container_policy_test.go index e9c414036ce7..813d2f2f2056 100644 --- a/internal/service/mediastore/container_policy_test.go +++ b/internal/service/mediastore/container_policy_test.go @@ -24,7 +24,7 @@ func TestAccMediaStoreContainerPolicy_basic(t *testing.T) { rName = strings.ReplaceAll(rName, "-", "_") resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, mediastore.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckContainerPolicyDestroy(ctx), diff --git a/internal/service/mediastore/container_test.go b/internal/service/mediastore/container_test.go index 769502ce9e7b..d41a75062bb7 100644 --- a/internal/service/mediastore/container_test.go +++ b/internal/service/mediastore/container_test.go @@ -20,7 +20,7 @@ func TestAccMediaStoreContainer_basic(t *testing.T) { resourceName := "aws_media_store_container.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, mediastore.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckContainerDestroy(ctx), @@ -46,7 +46,7 @@ func TestAccMediaStoreContainer_tags(t *testing.T) { resourceName := "aws_media_store_container.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, mediastore.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckContainerDestroy(ctx), From 64e337c97b1ee5f02363810abd416640da1fe364 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Fri, 24 Feb 2023 16:37:13 -0500 Subject: [PATCH 196/763] Add 'Context' argument to 'acctest.PreCheck' for memorydb. --- .../service/memorydb/acl_data_source_test.go | 2 +- internal/service/memorydb/acl_test.go | 12 ++--- .../memorydb/cluster_data_source_test.go | 2 +- internal/service/memorydb/cluster_test.go | 52 +++++++++---------- .../parameter_group_data_source_test.go | 2 +- .../service/memorydb/parameter_group_test.go | 8 +-- .../memorydb/snapshot_data_source_test.go | 2 +- internal/service/memorydb/snapshot_test.go | 12 ++--- .../memorydb/subnet_group_data_source_test.go | 2 +- .../service/memorydb/subnet_group_test.go | 14 ++--- .../service/memorydb/user_data_source_test.go | 2 +- internal/service/memorydb/user_test.go | 10 ++-- 12 files changed, 60 insertions(+), 60 deletions(-) diff --git a/internal/service/memorydb/acl_data_source_test.go b/internal/service/memorydb/acl_data_source_test.go index a068e0c51bd4..796b60565fc4 100644 --- a/internal/service/memorydb/acl_data_source_test.go +++ b/internal/service/memorydb/acl_data_source_test.go @@ -18,7 +18,7 @@ func TestAccMemoryDBACLDataSource_basic(t *testing.T) { userName2 := "tf-" + sdkacctest.RandString(8) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(t) }, ErrorCheck: acctest.ErrorCheck(t, memorydb.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ diff --git a/internal/service/memorydb/acl_test.go b/internal/service/memorydb/acl_test.go index 8c2679e9c9f2..47ebf984c0d6 100644 --- a/internal/service/memorydb/acl_test.go +++ b/internal/service/memorydb/acl_test.go @@ -22,7 +22,7 @@ func TestAccMemoryDBACL_basic(t *testing.T) { resourceName := "aws_memorydb_acl.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(t) }, ErrorCheck: acctest.ErrorCheck(t, memorydb.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckACLDestroy(ctx), @@ -55,7 +55,7 @@ func TestAccMemoryDBACL_disappears(t *testing.T) { resourceName := "aws_memorydb_acl.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(t) }, ErrorCheck: acctest.ErrorCheck(t, memorydb.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckACLDestroy(ctx), @@ -77,7 +77,7 @@ func TestAccMemoryDBACL_nameGenerated(t *testing.T) { resourceName := "aws_memorydb_acl.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(t) }, ErrorCheck: acctest.ErrorCheck(t, memorydb.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckACLDestroy(ctx), @@ -99,7 +99,7 @@ func TestAccMemoryDBACL_namePrefix(t *testing.T) { resourceName := "aws_memorydb_acl.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(t) }, ErrorCheck: acctest.ErrorCheck(t, memorydb.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckACLDestroy(ctx), @@ -122,7 +122,7 @@ func TestAccMemoryDBACL_update_tags(t *testing.T) { resourceName := "aws_memorydb_acl.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(t) }, ErrorCheck: acctest.ErrorCheck(t, memorydb.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckACLDestroy(ctx), @@ -198,7 +198,7 @@ func TestAccMemoryDBACL_update_userNames(t *testing.T) { resourceName := "aws_memorydb_acl.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(t) }, ErrorCheck: acctest.ErrorCheck(t, memorydb.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckACLDestroy(ctx), diff --git a/internal/service/memorydb/cluster_data_source_test.go b/internal/service/memorydb/cluster_data_source_test.go index 38c69b36e518..478b46306712 100644 --- a/internal/service/memorydb/cluster_data_source_test.go +++ b/internal/service/memorydb/cluster_data_source_test.go @@ -16,7 +16,7 @@ func TestAccMemoryDBClusterDataSource_basic(t *testing.T) { dataSourceName := "data.aws_memorydb_cluster.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(t) }, ErrorCheck: acctest.ErrorCheck(t, memorydb.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ diff --git a/internal/service/memorydb/cluster_test.go b/internal/service/memorydb/cluster_test.go index 6d67597245c9..3ad9739033f5 100644 --- a/internal/service/memorydb/cluster_test.go +++ b/internal/service/memorydb/cluster_test.go @@ -22,7 +22,7 @@ func TestAccMemoryDBCluster_basic(t *testing.T) { resourceName := "aws_memorydb_cluster.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(t) }, ErrorCheck: acctest.ErrorCheck(t, memorydb.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClusterDestroy(ctx), @@ -84,7 +84,7 @@ func TestAccMemoryDBCluster_defaults(t *testing.T) { resourceName := "aws_memorydb_cluster.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(t) }, ErrorCheck: acctest.ErrorCheck(t, memorydb.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClusterDestroy(ctx), @@ -134,7 +134,7 @@ func TestAccMemoryDBCluster_disappears(t *testing.T) { resourceName := "aws_memorydb_cluster.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(t) }, ErrorCheck: acctest.ErrorCheck(t, memorydb.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClusterDestroy(ctx), @@ -157,7 +157,7 @@ func TestAccMemoryDBCluster_nameGenerated(t *testing.T) { resourceName := "aws_memorydb_cluster.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(t) }, ErrorCheck: acctest.ErrorCheck(t, memorydb.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClusterDestroy(ctx), @@ -180,7 +180,7 @@ func TestAccMemoryDBCluster_namePrefix(t *testing.T) { resourceName := "aws_memorydb_cluster.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(t) }, ErrorCheck: acctest.ErrorCheck(t, memorydb.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClusterDestroy(ctx), @@ -205,7 +205,7 @@ func TestAccMemoryDBCluster_create_noTLS(t *testing.T) { resourceName := "aws_memorydb_cluster.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(t) }, ErrorCheck: acctest.ErrorCheck(t, memorydb.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClusterDestroy(ctx), @@ -232,7 +232,7 @@ func TestAccMemoryDBCluster_create_withDataTiering(t *testing.T) { resourceName := "aws_memorydb_cluster.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(t) }, ErrorCheck: acctest.ErrorCheck(t, memorydb.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClusterDestroy(ctx), @@ -259,7 +259,7 @@ func TestAccMemoryDBCluster_create_withKMS(t *testing.T) { resourceName := "aws_memorydb_cluster.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(t) }, ErrorCheck: acctest.ErrorCheck(t, memorydb.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClusterDestroy(ctx), @@ -286,7 +286,7 @@ func TestAccMemoryDBCluster_create_withPort(t *testing.T) { resourceName := "aws_memorydb_cluster.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(t) }, ErrorCheck: acctest.ErrorCheck(t, memorydb.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClusterDestroy(ctx), @@ -314,7 +314,7 @@ func TestAccMemoryDBCluster_create_fromSnapshot(t *testing.T) { rName2 := "tf-test-" + sdkacctest.RandString(8) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(t) }, ErrorCheck: acctest.ErrorCheck(t, memorydb.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClusterDestroy(ctx), @@ -336,7 +336,7 @@ func TestAccMemoryDBCluster_delete_withFinalSnapshot(t *testing.T) { resourceName := "aws_memorydb_cluster.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(t) }, ErrorCheck: acctest.ErrorCheck(t, memorydb.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClusterDestroy(ctx), @@ -383,7 +383,7 @@ func TestAccMemoryDBCluster_Update_aclName(t *testing.T) { resourceName := "aws_memorydb_cluster.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(t) }, ErrorCheck: acctest.ErrorCheck(t, memorydb.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClusterDestroy(ctx), @@ -422,7 +422,7 @@ func TestAccMemoryDBCluster_Update_description(t *testing.T) { resourceName := "aws_memorydb_cluster.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(t) }, ErrorCheck: acctest.ErrorCheck(t, memorydb.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClusterDestroy(ctx), @@ -479,7 +479,7 @@ func TestAccMemoryDBCluster_Update_engineVersion(t *testing.T) { resourceName := "aws_memorydb_cluster.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(t) }, ErrorCheck: acctest.ErrorCheck(t, memorydb.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClusterDestroy(ctx), @@ -518,7 +518,7 @@ func TestAccMemoryDBCluster_Update_maintenanceWindow(t *testing.T) { resourceName := "aws_memorydb_cluster.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(t) }, ErrorCheck: acctest.ErrorCheck(t, memorydb.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClusterDestroy(ctx), @@ -557,7 +557,7 @@ func TestAccMemoryDBCluster_Update_nodeType(t *testing.T) { resourceName := "aws_memorydb_cluster.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(t) }, ErrorCheck: acctest.ErrorCheck(t, memorydb.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClusterDestroy(ctx), @@ -599,7 +599,7 @@ func TestAccMemoryDBCluster_Update_numShards_scaleUp(t *testing.T) { resourceName := "aws_memorydb_cluster.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(t) }, ErrorCheck: acctest.ErrorCheck(t, memorydb.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClusterDestroy(ctx), @@ -636,7 +636,7 @@ func TestAccMemoryDBCluster_Update_numShards_scaleDown(t *testing.T) { resourceName := "aws_memorydb_cluster.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(t) }, ErrorCheck: acctest.ErrorCheck(t, memorydb.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClusterDestroy(ctx), @@ -673,7 +673,7 @@ func TestAccMemoryDBCluster_Update_numReplicasPerShard_scaleUp(t *testing.T) { resourceName := "aws_memorydb_cluster.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(t) }, ErrorCheck: acctest.ErrorCheck(t, memorydb.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClusterDestroy(ctx), @@ -710,7 +710,7 @@ func TestAccMemoryDBCluster_Update_numReplicasPerShard_scaleDown(t *testing.T) { resourceName := "aws_memorydb_cluster.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(t) }, ErrorCheck: acctest.ErrorCheck(t, memorydb.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClusterDestroy(ctx), @@ -744,7 +744,7 @@ func TestAccMemoryDBCluster_Update_parameterGroup(t *testing.T) { resourceName := "aws_memorydb_cluster.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(t) }, ErrorCheck: acctest.ErrorCheck(t, memorydb.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClusterDestroy(ctx), @@ -790,7 +790,7 @@ func TestAccMemoryDBCluster_Update_securityGroupIds(t *testing.T) { resourceName := "aws_memorydb_cluster.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(t) }, ErrorCheck: acctest.ErrorCheck(t, memorydb.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClusterDestroy(ctx), @@ -849,7 +849,7 @@ func TestAccMemoryDBCluster_Update_snapshotRetentionLimit(t *testing.T) { resourceName := "aws_memorydb_cluster.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(t) }, ErrorCheck: acctest.ErrorCheck(t, memorydb.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClusterDestroy(ctx), @@ -900,7 +900,7 @@ func TestAccMemoryDBCluster_Update_snapshotWindow(t *testing.T) { resourceName := "aws_memorydb_cluster.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(t) }, ErrorCheck: acctest.ErrorCheck(t, memorydb.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClusterDestroy(ctx), @@ -939,7 +939,7 @@ func TestAccMemoryDBCluster_Update_snsTopicARN(t *testing.T) { resourceName := "aws_memorydb_cluster.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(t) }, ErrorCheck: acctest.ErrorCheck(t, memorydb.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClusterDestroy(ctx), @@ -990,7 +990,7 @@ func TestAccMemoryDBCluster_Update_tags(t *testing.T) { resourceName := "aws_memorydb_cluster.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(t) }, ErrorCheck: acctest.ErrorCheck(t, memorydb.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClusterDestroy(ctx), diff --git a/internal/service/memorydb/parameter_group_data_source_test.go b/internal/service/memorydb/parameter_group_data_source_test.go index 643c2a91206b..4120d09dedd1 100644 --- a/internal/service/memorydb/parameter_group_data_source_test.go +++ b/internal/service/memorydb/parameter_group_data_source_test.go @@ -16,7 +16,7 @@ func TestAccMemoryDBParameterGroupDataSource_basic(t *testing.T) { dataSourceName := "data.aws_memorydb_parameter_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(t) }, ErrorCheck: acctest.ErrorCheck(t, memorydb.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ diff --git a/internal/service/memorydb/parameter_group_test.go b/internal/service/memorydb/parameter_group_test.go index 13ac0e88612e..84a7a1708cc4 100644 --- a/internal/service/memorydb/parameter_group_test.go +++ b/internal/service/memorydb/parameter_group_test.go @@ -24,7 +24,7 @@ func TestAccMemoryDBParameterGroup_basic(t *testing.T) { resourceName := "aws_memorydb_parameter_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(t) }, ErrorCheck: acctest.ErrorCheck(t, memorydb.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckParameterGroupDestroy(ctx), @@ -66,7 +66,7 @@ func TestAccMemoryDBParameterGroup_disappears(t *testing.T) { resourceName := "aws_memorydb_parameter_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(t) }, ErrorCheck: acctest.ErrorCheck(t, memorydb.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckParameterGroupDestroy(ctx), @@ -89,7 +89,7 @@ func TestAccMemoryDBParameterGroup_update_parameters(t *testing.T) { resourceName := "aws_memorydb_parameter_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(t) }, ErrorCheck: acctest.ErrorCheck(t, memorydb.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckParameterGroupDestroy(ctx), @@ -199,7 +199,7 @@ func TestAccMemoryDBParameterGroup_update_tags(t *testing.T) { resourceName := "aws_memorydb_parameter_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(t) }, ErrorCheck: acctest.ErrorCheck(t, memorydb.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSubnetGroupDestroy(ctx), diff --git a/internal/service/memorydb/snapshot_data_source_test.go b/internal/service/memorydb/snapshot_data_source_test.go index 29c50a92ecdc..a61e867313a9 100644 --- a/internal/service/memorydb/snapshot_data_source_test.go +++ b/internal/service/memorydb/snapshot_data_source_test.go @@ -16,7 +16,7 @@ func TestAccMemoryDBSnapshotDataSource_basic(t *testing.T) { dataSourceName := "data.aws_memorydb_snapshot.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(t) }, ErrorCheck: acctest.ErrorCheck(t, memorydb.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ diff --git a/internal/service/memorydb/snapshot_test.go b/internal/service/memorydb/snapshot_test.go index 3a3202222e3c..bf6d6bd95cbb 100644 --- a/internal/service/memorydb/snapshot_test.go +++ b/internal/service/memorydb/snapshot_test.go @@ -21,7 +21,7 @@ func TestAccMemoryDBSnapshot_basic(t *testing.T) { resourceName := "aws_memorydb_snapshot.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(t) }, ErrorCheck: acctest.ErrorCheck(t, memorydb.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSnapshotDestroy(ctx), @@ -66,7 +66,7 @@ func TestAccMemoryDBSnapshot_disappears(t *testing.T) { resourceName := "aws_memorydb_snapshot.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(t) }, ErrorCheck: acctest.ErrorCheck(t, memorydb.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSnapshotDestroy(ctx), @@ -89,7 +89,7 @@ func TestAccMemoryDBSnapshot_nameGenerated(t *testing.T) { resourceName := "aws_memorydb_snapshot.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(t) }, ErrorCheck: acctest.ErrorCheck(t, memorydb.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSnapshotDestroy(ctx), @@ -112,7 +112,7 @@ func TestAccMemoryDBSnapshot_namePrefix(t *testing.T) { resourceName := "aws_memorydb_snapshot.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(t) }, ErrorCheck: acctest.ErrorCheck(t, memorydb.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSnapshotDestroy(ctx), @@ -135,7 +135,7 @@ func TestAccMemoryDBSnapshot_create_withKMS(t *testing.T) { resourceName := "aws_memorydb_snapshot.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(t) }, ErrorCheck: acctest.ErrorCheck(t, memorydb.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSnapshotDestroy(ctx), @@ -162,7 +162,7 @@ func TestAccMemoryDBSnapshot_update_tags(t *testing.T) { resourceName := "aws_memorydb_snapshot.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(t) }, ErrorCheck: acctest.ErrorCheck(t, memorydb.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSnapshotDestroy(ctx), diff --git a/internal/service/memorydb/subnet_group_data_source_test.go b/internal/service/memorydb/subnet_group_data_source_test.go index 501c51aaf3fd..85a031e02789 100644 --- a/internal/service/memorydb/subnet_group_data_source_test.go +++ b/internal/service/memorydb/subnet_group_data_source_test.go @@ -16,7 +16,7 @@ func TestAccMemoryDBSubnetGroupDataSource_basic(t *testing.T) { dataSourceName := "data.aws_memorydb_subnet_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(t) }, ErrorCheck: acctest.ErrorCheck(t, memorydb.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ diff --git a/internal/service/memorydb/subnet_group_test.go b/internal/service/memorydb/subnet_group_test.go index a31e710493fe..cb2109c50f6a 100644 --- a/internal/service/memorydb/subnet_group_test.go +++ b/internal/service/memorydb/subnet_group_test.go @@ -31,7 +31,7 @@ func TestAccMemoryDBSubnetGroup_basic(t *testing.T) { resourceName := "aws_memorydb_subnet_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(t) }, ErrorCheck: acctest.ErrorCheck(t, memorydb.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSubnetGroupDestroy(ctx), @@ -66,7 +66,7 @@ func TestAccMemoryDBSubnetGroup_disappears(t *testing.T) { resourceName := "aws_memorydb_subnet_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(t) }, ErrorCheck: acctest.ErrorCheck(t, memorydb.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSubnetGroupDestroy(ctx), @@ -89,7 +89,7 @@ func TestAccMemoryDBSubnetGroup_nameGenerated(t *testing.T) { resourceName := "aws_memorydb_subnet_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(t) }, ErrorCheck: acctest.ErrorCheck(t, memorydb.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSubnetGroupDestroy(ctx), @@ -112,7 +112,7 @@ func TestAccMemoryDBSubnetGroup_namePrefix(t *testing.T) { resourceName := "aws_memorydb_subnet_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(t) }, ErrorCheck: acctest.ErrorCheck(t, memorydb.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSubnetGroupDestroy(ctx), @@ -135,7 +135,7 @@ func TestAccMemoryDBSubnetGroup_update_description(t *testing.T) { resourceName := "aws_memorydb_subnet_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(t) }, ErrorCheck: acctest.ErrorCheck(t, memorydb.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSubnetGroupDestroy(ctx), @@ -174,7 +174,7 @@ func TestAccMemoryDBSubnetGroup_update_subnetIds(t *testing.T) { resourceName := "aws_memorydb_subnet_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(t) }, ErrorCheck: acctest.ErrorCheck(t, memorydb.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSubnetGroupDestroy(ctx), @@ -231,7 +231,7 @@ func TestAccMemoryDBSubnetGroup_update_tags(t *testing.T) { resourceName := "aws_memorydb_subnet_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(t) }, ErrorCheck: acctest.ErrorCheck(t, memorydb.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSubnetGroupDestroy(ctx), diff --git a/internal/service/memorydb/user_data_source_test.go b/internal/service/memorydb/user_data_source_test.go index 8eac9cc05bec..6263ef8cb3eb 100644 --- a/internal/service/memorydb/user_data_source_test.go +++ b/internal/service/memorydb/user_data_source_test.go @@ -16,7 +16,7 @@ func TestAccMemoryDBUserDataSource_basic(t *testing.T) { dataSourceName := "data.aws_memorydb_user.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(t) }, ErrorCheck: acctest.ErrorCheck(t, memorydb.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ diff --git a/internal/service/memorydb/user_test.go b/internal/service/memorydb/user_test.go index 59b03b943997..34991a3d1174 100644 --- a/internal/service/memorydb/user_test.go +++ b/internal/service/memorydb/user_test.go @@ -21,7 +21,7 @@ func TestAccMemoryDBUser_basic(t *testing.T) { resourceName := "aws_memorydb_user.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(t) }, ErrorCheck: acctest.ErrorCheck(t, memorydb.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckUserDestroy(ctx), @@ -58,7 +58,7 @@ func TestAccMemoryDBUser_disappears(t *testing.T) { resourceName := "aws_memorydb_user.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(t) }, ErrorCheck: acctest.ErrorCheck(t, memorydb.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckUserDestroy(ctx), @@ -81,7 +81,7 @@ func TestAccMemoryDBUser_update_accessString(t *testing.T) { resourceName := "aws_memorydb_user.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(t) }, ErrorCheck: acctest.ErrorCheck(t, memorydb.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckUserDestroy(ctx), @@ -116,7 +116,7 @@ func TestAccMemoryDBUser_update_passwords(t *testing.T) { resourceName := "aws_memorydb_user.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(t) }, ErrorCheck: acctest.ErrorCheck(t, memorydb.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckUserDestroy(ctx), @@ -170,7 +170,7 @@ func TestAccMemoryDBUser_update_tags(t *testing.T) { resourceName := "aws_memorydb_user.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(t) }, ErrorCheck: acctest.ErrorCheck(t, memorydb.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckUserDestroy(ctx), From 16de6716763d54c115bad7af2a9559e8ff27a65e Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Fri, 24 Feb 2023 16:37:13 -0500 Subject: [PATCH 197/763] Add 'Context' argument to 'acctest.PreCheck' for meta. --- internal/service/meta/arn_data_source_test.go | 4 ++-- .../meta/billing_service_account_data_source_test.go | 2 +- internal/service/meta/default_tags_data_source_test.go | 8 ++++---- internal/service/meta/ip_ranges_data_source_test.go | 8 ++++---- internal/service/meta/partition_data_source_test.go | 2 +- internal/service/meta/region_data_source_test.go | 8 ++++---- internal/service/meta/regions_data_source_test.go | 8 ++++---- internal/service/meta/service_data_source_test.go | 10 +++++----- 8 files changed, 25 insertions(+), 25 deletions(-) diff --git a/internal/service/meta/arn_data_source_test.go b/internal/service/meta/arn_data_source_test.go index 17ca998ebaef..e08995608417 100644 --- a/internal/service/meta/arn_data_source_test.go +++ b/internal/service/meta/arn_data_source_test.go @@ -14,7 +14,7 @@ func TestAccMetaARNDataSource_basic(t *testing.T) { dataSourceName := "data.aws_arn.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, tfmeta.PseudoServiceID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ @@ -38,7 +38,7 @@ func TestAccMetaARNDataSource_s3Bucket(t *testing.T) { dataSourceName := "data.aws_arn.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, tfmeta.PseudoServiceID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ 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 290c58df5425..02055056f6c1 100644 --- a/internal/service/meta/billing_service_account_data_source_test.go +++ b/internal/service/meta/billing_service_account_data_source_test.go @@ -13,7 +13,7 @@ func TestAccMetaBillingServiceAccountDataSource_basic(t *testing.T) { billingAccountID := "386209384616" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, tfmeta.PseudoServiceID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ diff --git a/internal/service/meta/default_tags_data_source_test.go b/internal/service/meta/default_tags_data_source_test.go index 48fd98d99580..165854904b8b 100644 --- a/internal/service/meta/default_tags_data_source_test.go +++ b/internal/service/meta/default_tags_data_source_test.go @@ -12,7 +12,7 @@ func TestAccMetaDefaultTagsDataSource_basic(t *testing.T) { dataSourceName := "data.aws_default_tags.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, tfmeta.PseudoServiceID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: nil, @@ -35,7 +35,7 @@ func TestAccMetaDefaultTagsDataSource_empty(t *testing.T) { dataSourceName := "data.aws_default_tags.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, tfmeta.PseudoServiceID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: nil, @@ -54,7 +54,7 @@ func TestAccMetaDefaultTagsDataSource_multiple(t *testing.T) { dataSourceName := "data.aws_default_tags.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, tfmeta.PseudoServiceID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: nil, @@ -78,7 +78,7 @@ func TestAccMetaDefaultTagsDataSource_ignore(t *testing.T) { dataSourceName := "data.aws_default_tags.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, tfmeta.PseudoServiceID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: nil, diff --git a/internal/service/meta/ip_ranges_data_source_test.go b/internal/service/meta/ip_ranges_data_source_test.go index f5e346d600c2..8886b81be562 100644 --- a/internal/service/meta/ip_ranges_data_source_test.go +++ b/internal/service/meta/ip_ranges_data_source_test.go @@ -20,7 +20,7 @@ func TestAccMetaIPRangesDataSource_basic(t *testing.T) { dataSourceName := "data.aws_ip_ranges.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, tfmeta.PseudoServiceID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ @@ -40,7 +40,7 @@ func TestAccMetaIPRangesDataSource_none(t *testing.T) { dataSourceName := "data.aws_ip_ranges.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, tfmeta.PseudoServiceID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ @@ -59,7 +59,7 @@ func TestAccMetaIPRangesDataSource_url(t *testing.T) { dataSourceName := "data.aws_ip_ranges.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, tfmeta.PseudoServiceID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ @@ -79,7 +79,7 @@ func TestAccMetaIPRangesDataSource_uppercase(t *testing.T) { dataSourceName := "data.aws_ip_ranges.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, tfmeta.PseudoServiceID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ diff --git a/internal/service/meta/partition_data_source_test.go b/internal/service/meta/partition_data_source_test.go index 8c54b491ebc5..ea5a274c21dd 100644 --- a/internal/service/meta/partition_data_source_test.go +++ b/internal/service/meta/partition_data_source_test.go @@ -14,7 +14,7 @@ func TestAccMetaPartitionDataSource_basic(t *testing.T) { dataSourceName := "data.aws_partition.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, tfmeta.PseudoServiceID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ diff --git a/internal/service/meta/region_data_source_test.go b/internal/service/meta/region_data_source_test.go index e1419b406623..8c186fdd260a 100644 --- a/internal/service/meta/region_data_source_test.go +++ b/internal/service/meta/region_data_source_test.go @@ -83,7 +83,7 @@ func TestAccMetaRegionDataSource_basic(t *testing.T) { dataSourceName := "data.aws_region.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, tfmeta.PseudoServiceID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ @@ -103,7 +103,7 @@ func TestAccMetaRegionDataSource_endpoint(t *testing.T) { dataSourceName := "data.aws_region.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, tfmeta.PseudoServiceID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ @@ -123,7 +123,7 @@ func TestAccMetaRegionDataSource_endpointAndName(t *testing.T) { dataSourceName := "data.aws_region.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, tfmeta.PseudoServiceID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ @@ -143,7 +143,7 @@ func TestAccMetaRegionDataSource_name(t *testing.T) { dataSourceName := "data.aws_region.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, tfmeta.PseudoServiceID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ diff --git a/internal/service/meta/regions_data_source_test.go b/internal/service/meta/regions_data_source_test.go index 05f65741cbdd..82a7f53d5a18 100644 --- a/internal/service/meta/regions_data_source_test.go +++ b/internal/service/meta/regions_data_source_test.go @@ -13,7 +13,7 @@ func TestAccMetaRegionsDataSource_basic(t *testing.T) { dataSourceName := "data.aws_regions.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, tfmeta.PseudoServiceID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ @@ -31,7 +31,7 @@ func TestAccMetaRegionsDataSource_filter(t *testing.T) { dataSourceName := "data.aws_regions.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, tfmeta.PseudoServiceID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ @@ -49,7 +49,7 @@ func TestAccMetaRegionsDataSource_allRegions(t *testing.T) { dataSourceName := "data.aws_regions.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, tfmeta.PseudoServiceID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ @@ -67,7 +67,7 @@ func TestAccMetaRegionsDataSource_nonExistentRegion(t *testing.T) { dataSourceName := "data.aws_regions.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, tfmeta.PseudoServiceID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ diff --git a/internal/service/meta/service_data_source_test.go b/internal/service/meta/service_data_source_test.go index 2e3d08a35a6f..d299b60a366f 100644 --- a/internal/service/meta/service_data_source_test.go +++ b/internal/service/meta/service_data_source_test.go @@ -18,7 +18,7 @@ func TestAccMetaService_basic(t *testing.T) { dataSourceName := "data.aws_service.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, tfmeta.PseudoServiceID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ @@ -42,7 +42,7 @@ func TestAccMetaService_byReverseDNSName(t *testing.T) { dataSourceName := "data.aws_service.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, tfmeta.PseudoServiceID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ @@ -64,7 +64,7 @@ func TestAccMetaService_byDNSName(t *testing.T) { dataSourceName := "data.aws_service.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, tfmeta.PseudoServiceID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ @@ -86,7 +86,7 @@ func TestAccMetaService_byParts(t *testing.T) { dataSourceName := "data.aws_service.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, tfmeta.PseudoServiceID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ @@ -106,7 +106,7 @@ func TestAccMetaService_unsupported(t *testing.T) { dataSourceName := "data.aws_service.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, tfmeta.PseudoServiceID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ From d78f5e8e179f7f5eb9bec6b0662d88830cfa499f Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Fri, 24 Feb 2023 16:37:14 -0500 Subject: [PATCH 198/763] Add 'Context' argument to 'acctest.PreCheck' for mq. --- .../service/mq/broker_data_source_test.go | 2 +- ...nstance_type_offerings_data_source_test.go | 2 +- internal/service/mq/broker_test.go | 36 +++++++++---------- internal/service/mq/configuration_test.go | 8 ++--- 4 files changed, 24 insertions(+), 24 deletions(-) diff --git a/internal/service/mq/broker_data_source_test.go b/internal/service/mq/broker_data_source_test.go index e4921cf9547a..9f4fb6738bf0 100644 --- a/internal/service/mq/broker_data_source_test.go +++ b/internal/service/mq/broker_data_source_test.go @@ -22,7 +22,7 @@ func TestAccMQBrokerDataSource_basic(t *testing.T) { dataSourceByNameName := "data.aws_mq_broker.by_name" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(mq.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(mq.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, mq.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ 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 8a3fa5494021..36235f495eb3 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 @@ -10,7 +10,7 @@ import ( func TestAccMQBrokerInstanceTypeOfferingsDataSource_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(mq.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(mq.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, mq.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ diff --git a/internal/service/mq/broker_test.go b/internal/service/mq/broker_test.go index 84cc1e1fb103..b0fe7569af2a 100644 --- a/internal/service/mq/broker_test.go +++ b/internal/service/mq/broker_test.go @@ -244,7 +244,7 @@ func TestAccMQBroker_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(mq.EndpointsID, t) testAccPreCheck(ctx, t) }, @@ -323,7 +323,7 @@ func TestAccMQBroker_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(mq.EndpointsID, t) testAccPreCheck(ctx, t) }, @@ -355,7 +355,7 @@ func TestAccMQBroker_tags(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(mq.EndpointsID, t) testAccPreCheck(ctx, t) }, @@ -410,7 +410,7 @@ func TestAccMQBroker_throughputOptimized(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(mq.EndpointsID, t) testAccPreCheck(ctx, t) }, @@ -494,7 +494,7 @@ func TestAccMQBroker_AllFields_defaultVPC(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(mq.EndpointsID, t) testAccPreCheck(ctx, t) }, @@ -623,7 +623,7 @@ func TestAccMQBroker_AllFields_customVPC(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(mq.EndpointsID, t) testAccPreCheck(ctx, t) }, @@ -744,7 +744,7 @@ func TestAccMQBroker_EncryptionOptions_kmsKeyID(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(mq.EndpointsID, t) testAccPreCheck(ctx, t) }, @@ -783,7 +783,7 @@ func TestAccMQBroker_EncryptionOptions_managedKeyDisabled(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(mq.EndpointsID, t) testAccPreCheck(ctx, t) }, @@ -821,7 +821,7 @@ func TestAccMQBroker_EncryptionOptions_managedKeyEnabled(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(mq.EndpointsID, t) testAccPreCheck(ctx, t) }, @@ -859,7 +859,7 @@ func TestAccMQBroker_Update_users(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(mq.EndpointsID, t) testAccPreCheck(ctx, t) }, @@ -937,7 +937,7 @@ func TestAccMQBroker_Update_securityGroup(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(mq.EndpointsID, t) testAccPreCheck(ctx, t) }, @@ -995,7 +995,7 @@ func TestAccMQBroker_Update_engineVersion(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(mq.EndpointsID, t) testAccPreCheck(ctx, t) }, @@ -1039,7 +1039,7 @@ func TestAccMQBroker_Update_hostInstanceType(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(mq.EndpointsID, t) testAccPreCheck(ctx, t) }, @@ -1078,7 +1078,7 @@ func TestAccMQBroker_RabbitMQ_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(mq.EndpointsID, t) testAccPreCheck(ctx, t) }, @@ -1124,7 +1124,7 @@ func TestAccMQBroker_RabbitMQ_logs(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(mq.EndpointsID, t) testAccPreCheck(ctx, t) }, @@ -1170,7 +1170,7 @@ func TestAccMQBroker_RabbitMQ_validationAuditLog(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(mq.EndpointsID, t) testAccPreCheck(ctx, t) }, @@ -1209,7 +1209,7 @@ func TestAccMQBroker_RabbitMQ_cluster(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(mq.EndpointsID, t) testAccPreCheck(ctx, t) }, @@ -1276,7 +1276,7 @@ func TestAccMQBroker_ldap(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(mq.EndpointsID, t) testAccPreCheck(ctx, t) }, diff --git a/internal/service/mq/configuration_test.go b/internal/service/mq/configuration_test.go index 29364567d19d..37f7744be7a9 100644 --- a/internal/service/mq/configuration_test.go +++ b/internal/service/mq/configuration_test.go @@ -22,7 +22,7 @@ func TestAccMQConfiguration_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(mq.EndpointsID, t) testAccPreCheck(ctx, t) }, @@ -71,7 +71,7 @@ func TestAccMQConfiguration_withData(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(mq.EndpointsID, t) testAccPreCheck(ctx, t) }, @@ -107,7 +107,7 @@ func TestAccMQConfiguration_withLdapData(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(mq.EndpointsID, t) testAccPreCheck(ctx, t) }, @@ -144,7 +144,7 @@ func TestAccMQConfiguration_tags(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(mq.EndpointsID, t) testAccPreCheck(ctx, t) }, From ef60e009e46df29717ad378c3e6724ea1edd9e9d Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Fri, 24 Feb 2023 16:37:14 -0500 Subject: [PATCH 199/763] Add 'Context' argument to 'acctest.PreCheck' for mwaa. --- internal/service/mwaa/environment_test.go | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/internal/service/mwaa/environment_test.go b/internal/service/mwaa/environment_test.go index bce1b1b5f28f..7f8a332a4b1e 100644 --- a/internal/service/mwaa/environment_test.go +++ b/internal/service/mwaa/environment_test.go @@ -22,7 +22,7 @@ func TestAccMWAAEnvironment_basic(t *testing.T) { resourceName := "aws_mwaa_environment.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, mwaa.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckEnvironmentDestroy(ctx), @@ -85,7 +85,7 @@ func TestAccMWAAEnvironment_disappears(t *testing.T) { resourceName := "aws_mwaa_environment.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, mwaa.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckEnvironmentDestroy(ctx), @@ -109,7 +109,7 @@ func TestAccMWAAEnvironment_airflowOptions(t *testing.T) { resourceName := "aws_mwaa_environment.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, mwaa.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckEnvironmentDestroy(ctx), @@ -155,7 +155,7 @@ func TestAccMWAAEnvironment_log(t *testing.T) { resourceName := "aws_mwaa_environment.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, mwaa.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckEnvironmentDestroy(ctx), @@ -240,7 +240,7 @@ func TestAccMWAAEnvironment_full(t *testing.T) { resourceName := "aws_mwaa_environment.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, mwaa.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckEnvironmentDestroy(ctx), @@ -316,7 +316,7 @@ func TestAccMWAAEnvironment_pluginsS3ObjectVersion(t *testing.T) { s3ObjectResourceName := "aws_s3_object.plugins" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, mwaa.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckEnvironmentDestroy(ctx), From cada957776f8243788db2588263e809db9943ad5 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Fri, 24 Feb 2023 16:37:14 -0500 Subject: [PATCH 200/763] Add 'Context' argument to 'acctest.PreCheck' for neptune. --- .../service/neptune/cluster_endpoint_test.go | 8 ++--- .../service/neptune/cluster_instance_test.go | 16 ++++----- .../neptune/cluster_parameter_group_test.go | 14 ++++---- .../service/neptune/cluster_snapshot_test.go | 4 +-- internal/service/neptune/cluster_test.go | 36 +++++++++---------- .../engine_version_data_source_test.go | 6 ++-- .../neptune/event_subscription_test.go | 8 ++--- .../service/neptune/global_cluster_test.go | 18 +++++----- .../orderable_db_instance_data_source_test.go | 4 +-- .../service/neptune/parameter_group_test.go | 8 ++--- internal/service/neptune/subnet_group_test.go | 12 +++---- 11 files changed, 67 insertions(+), 67 deletions(-) diff --git a/internal/service/neptune/cluster_endpoint_test.go b/internal/service/neptune/cluster_endpoint_test.go index d12ca54bfed8..98e53ebe78d6 100644 --- a/internal/service/neptune/cluster_endpoint_test.go +++ b/internal/service/neptune/cluster_endpoint_test.go @@ -25,7 +25,7 @@ func TestAccNeptuneClusterEndpoint_basic(t *testing.T) { resourceName := "aws_neptune_cluster_endpoint.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, neptune.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClusterEndpointDestroy(ctx), @@ -63,7 +63,7 @@ func TestAccNeptuneClusterEndpoint_tags(t *testing.T) { resourceName := "aws_neptune_cluster_endpoint.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, neptune.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClusterEndpointDestroy(ctx), @@ -109,7 +109,7 @@ func TestAccNeptuneClusterEndpoint_disappears(t *testing.T) { resourceName := "aws_neptune_cluster_endpoint.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, neptune.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClusterEndpointDestroy(ctx), @@ -133,7 +133,7 @@ func TestAccNeptuneClusterEndpoint_Disappears_cluster(t *testing.T) { resourceName := "aws_neptune_cluster_endpoint.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, neptune.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClusterEndpointDestroy(ctx), diff --git a/internal/service/neptune/cluster_instance_test.go b/internal/service/neptune/cluster_instance_test.go index a21ae25aa689..df9745b070b6 100644 --- a/internal/service/neptune/cluster_instance_test.go +++ b/internal/service/neptune/cluster_instance_test.go @@ -26,7 +26,7 @@ func TestAccNeptuneClusterInstance_basic(t *testing.T) { parameterGroupResourceName := "aws_neptune_parameter_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, neptune.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClusterInstanceDestroy(ctx), @@ -82,7 +82,7 @@ func TestAccNeptuneClusterInstance_disappears(t *testing.T) { resourceName := "aws_neptune_cluster_instance.cluster_instances" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, neptune.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClusterInstanceDestroy(ctx), @@ -106,7 +106,7 @@ func TestAccNeptuneClusterInstance_nameGenerated(t *testing.T) { resourceName := "aws_neptune_cluster_instance.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, neptune.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClusterInstanceDestroy(ctx), @@ -134,7 +134,7 @@ func TestAccNeptuneClusterInstance_namePrefix(t *testing.T) { resourceName := "aws_neptune_cluster_instance.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, neptune.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClusterInstanceDestroy(ctx), @@ -166,7 +166,7 @@ func TestAccNeptuneClusterInstance_tags(t *testing.T) { resourceName := "aws_neptune_cluster_instance.cluster_instances" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, neptune.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClusterInstanceDestroy(ctx), @@ -213,7 +213,7 @@ func TestAccNeptuneClusterInstance_withAZ(t *testing.T) { availabiltyZonesDataSourceName := "data.aws_availability_zones.available" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, neptune.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClusterInstanceDestroy(ctx), @@ -242,7 +242,7 @@ func TestAccNeptuneClusterInstance_withSubnetGroup(t *testing.T) { subnetGroupResourceName := "aws_neptune_subnet_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, neptune.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClusterInstanceDestroy(ctx), @@ -271,7 +271,7 @@ func TestAccNeptuneClusterInstance_kmsKey(t *testing.T) { kmsKeyResourceName := "aws_kms_key.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, neptune.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClusterInstanceDestroy(ctx), diff --git a/internal/service/neptune/cluster_parameter_group_test.go b/internal/service/neptune/cluster_parameter_group_test.go index 89e7a63ee708..49f68d580ec5 100644 --- a/internal/service/neptune/cluster_parameter_group_test.go +++ b/internal/service/neptune/cluster_parameter_group_test.go @@ -26,7 +26,7 @@ func TestAccNeptuneClusterParameterGroup_basic(t *testing.T) { resourceName := "aws_neptune_cluster_parameter_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, neptune.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClusterParameterGroupDestroy(ctx), @@ -60,7 +60,7 @@ func TestAccNeptuneClusterParameterGroup_namePrefix(t *testing.T) { resourceName := "aws_neptune_cluster_parameter_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, neptune.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClusterParameterGroupDestroy(ctx), @@ -89,7 +89,7 @@ func TestAccNeptuneClusterParameterGroup_generatedName(t *testing.T) { resourceName := "aws_neptune_cluster_parameter_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, neptune.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClusterParameterGroupDestroy(ctx), @@ -118,7 +118,7 @@ func TestAccNeptuneClusterParameterGroup_description(t *testing.T) { parameterGroupName := sdkacctest.RandomWithPrefix("cluster-parameter-group-test-terraform") resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, neptune.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClusterParameterGroupDestroy(ctx), @@ -149,7 +149,7 @@ func TestAccNeptuneClusterParameterGroup_NamePrefix_parameter(t *testing.T) { prefix := acctest.ResourcePrefix resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, neptune.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClusterParameterGroupDestroy(ctx), @@ -197,7 +197,7 @@ func TestAccNeptuneClusterParameterGroup_parameter(t *testing.T) { parameterGroupName := sdkacctest.RandomWithPrefix("cluster-parameter-group-test-tf") resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, neptune.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClusterParameterGroupDestroy(ctx), @@ -246,7 +246,7 @@ func TestAccNeptuneClusterParameterGroup_tags(t *testing.T) { parameterGroupName := sdkacctest.RandomWithPrefix("cluster-parameter-group-test-tf") resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, neptune.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClusterParameterGroupDestroy(ctx), diff --git a/internal/service/neptune/cluster_snapshot_test.go b/internal/service/neptune/cluster_snapshot_test.go index 65bfec2a965a..f149626eba69 100644 --- a/internal/service/neptune/cluster_snapshot_test.go +++ b/internal/service/neptune/cluster_snapshot_test.go @@ -23,7 +23,7 @@ func TestAccNeptuneClusterSnapshot_basic(t *testing.T) { resourceName := "aws_neptune_cluster_snapshot.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, neptune.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClusterSnapshotDestroy(ctx), @@ -63,7 +63,7 @@ func TestAccNeptuneClusterSnapshot_disappears(t *testing.T) { resourceName := "aws_neptune_cluster_snapshot.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, neptune.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClusterSnapshotDestroy(ctx), diff --git a/internal/service/neptune/cluster_test.go b/internal/service/neptune/cluster_test.go index 26b4eeb843f0..acb9e3fbc34e 100644 --- a/internal/service/neptune/cluster_test.go +++ b/internal/service/neptune/cluster_test.go @@ -42,7 +42,7 @@ func TestAccNeptuneCluster_basic(t *testing.T) { resourceName := "aws_neptune_cluster.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, neptune.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClusterDestroy(ctx), @@ -76,7 +76,7 @@ func TestAccNeptuneCluster_copyTagsToSnapshot(t *testing.T) { resourceName := "aws_neptune_cluster.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, neptune.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClusterDestroy(ctx), @@ -114,7 +114,7 @@ func TestAccNeptuneCluster_namePrefix(t *testing.T) { resourceName := "aws_neptune_cluster.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, neptune.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClusterDestroy(ctx), @@ -138,7 +138,7 @@ func TestAccNeptuneCluster_serverlessConfiguration(t *testing.T) { resourceName := "aws_neptune_cluster.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, neptune.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClusterDestroy(ctx), @@ -164,7 +164,7 @@ func TestAccNeptuneCluster_takeFinalSnapshot(t *testing.T) { resourceName := "aws_neptune_cluster.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, neptune.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClusterDestroyWithFinalSnapshot(ctx), @@ -187,7 +187,7 @@ func TestAccNeptuneCluster_tags(t *testing.T) { resourceName := "aws_neptune_cluster.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, neptune.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClusterDestroy(ctx), @@ -229,7 +229,7 @@ func TestAccNeptuneCluster_updateIAMRoles(t *testing.T) { resourceName := "aws_neptune_cluster.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, neptune.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClusterDestroy(ctx), @@ -267,7 +267,7 @@ func TestAccNeptuneCluster_kmsKey(t *testing.T) { rName := sdkacctest.RandomWithPrefix("tf-acc") resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, neptune.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClusterDestroy(ctx), @@ -291,7 +291,7 @@ func TestAccNeptuneCluster_encrypted(t *testing.T) { rName := sdkacctest.RandomWithPrefix("tf-acc") resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, neptune.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClusterDestroy(ctx), @@ -315,7 +315,7 @@ func TestAccNeptuneCluster_backupsUpdate(t *testing.T) { rName := sdkacctest.RandomWithPrefix("tf-acc") resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, neptune.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClusterDestroy(ctx), @@ -350,7 +350,7 @@ func TestAccNeptuneCluster_iamAuth(t *testing.T) { rName := sdkacctest.RandomWithPrefix("tf-acc") resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, neptune.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClusterDestroy(ctx), @@ -374,7 +374,7 @@ func TestAccNeptuneCluster_updateCloudWatchLogsExports(t *testing.T) { resourceName := "aws_neptune_cluster.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, neptune.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClusterDestroy(ctx), @@ -413,7 +413,7 @@ func TestAccNeptuneCluster_updateEngineVersion(t *testing.T) { resourceName := "aws_neptune_cluster.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, neptune.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClusterDestroy(ctx), @@ -445,7 +445,7 @@ func TestAccNeptuneCluster_updateEngineMajorVersion(t *testing.T) { resourceName := "aws_neptune_cluster.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, neptune.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClusterDestroy(ctx), @@ -484,7 +484,7 @@ func TestAccNeptuneCluster_GlobalClusterIdentifier_PrimarySecondaryClusters(t *t resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckMultipleRegion(t, 2) testAccPreCheckGlobalCluster(ctx, t) }, @@ -510,7 +510,7 @@ func TestAccNeptuneCluster_deleteProtection(t *testing.T) { resourceName := "aws_neptune_cluster.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, neptune.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClusterDestroy(ctx), @@ -548,7 +548,7 @@ func TestAccNeptuneCluster_disappears(t *testing.T) { resourceName := "aws_neptune_cluster.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, neptune.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClusterDestroy(ctx), @@ -573,7 +573,7 @@ func TestAccNeptuneCluster_restoreFromSnapshot(t *testing.T) { parameterGroupResourceName := "aws_neptune_cluster_parameter_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, neptune.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClusterDestroy(ctx), diff --git a/internal/service/neptune/engine_version_data_source_test.go b/internal/service/neptune/engine_version_data_source_test.go index 8df18027f088..0ecc24a17ec8 100644 --- a/internal/service/neptune/engine_version_data_source_test.go +++ b/internal/service/neptune/engine_version_data_source_test.go @@ -19,7 +19,7 @@ func TestAccNeptuneEngineVersionDataSource_basic(t *testing.T) { version := "1.0.2.1" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccEngineVersionPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccEngineVersionPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, neptune.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: nil, @@ -48,7 +48,7 @@ func TestAccNeptuneEngineVersionDataSource_preferred(t *testing.T) { dataSourceName := "data.aws_neptune_engine_version.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccEngineVersionPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccEngineVersionPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, neptune.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: nil, @@ -69,7 +69,7 @@ func TestAccNeptuneEngineVersionDataSource_defaultOnly(t *testing.T) { dataSourceName := "data.aws_neptune_engine_version.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccEngineVersionPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccEngineVersionPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, neptune.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: nil, diff --git a/internal/service/neptune/event_subscription_test.go b/internal/service/neptune/event_subscription_test.go index 621a7f2d84ad..7e46059f6996 100644 --- a/internal/service/neptune/event_subscription_test.go +++ b/internal/service/neptune/event_subscription_test.go @@ -25,7 +25,7 @@ func TestAccNeptuneEventSubscription_basic(t *testing.T) { resourceName := "aws_neptune_event_subscription.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, neptune.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckEventSubscriptionDestroy(ctx), @@ -70,7 +70,7 @@ func TestAccNeptuneEventSubscription_withPrefix(t *testing.T) { resourceName := "aws_neptune_event_subscription.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, neptune.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckEventSubscriptionDestroy(ctx), @@ -100,7 +100,7 @@ func TestAccNeptuneEventSubscription_withSourceIDs(t *testing.T) { resourceName := "aws_neptune_event_subscription.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, neptune.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckEventSubscriptionDestroy(ctx), @@ -139,7 +139,7 @@ func TestAccNeptuneEventSubscription_withCategories(t *testing.T) { resourceName := "aws_neptune_event_subscription.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, neptune.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckEventSubscriptionDestroy(ctx), diff --git a/internal/service/neptune/global_cluster_test.go b/internal/service/neptune/global_cluster_test.go index 738502fe3d2f..1dc6cffd1c5d 100644 --- a/internal/service/neptune/global_cluster_test.go +++ b/internal/service/neptune/global_cluster_test.go @@ -26,7 +26,7 @@ func TestAccNeptuneGlobalCluster_basic(t *testing.T) { resourceName := "aws_neptune_global_cluster.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckGlobalCluster(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckGlobalCluster(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, neptune.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckGlobalClusterDestroy(ctx), @@ -60,7 +60,7 @@ func TestAccNeptuneGlobalCluster_completeBasic(t *testing.T) { resourceName := "aws_neptune_global_cluster.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckGlobalCluster(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckGlobalCluster(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, neptune.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckGlobalClusterDestroy(ctx), @@ -94,7 +94,7 @@ func TestAccNeptuneGlobalCluster_disappears(t *testing.T) { resourceName := "aws_neptune_global_cluster.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckGlobalCluster(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckGlobalCluster(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, neptune.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckGlobalClusterDestroy(ctx), @@ -118,7 +118,7 @@ func TestAccNeptuneGlobalCluster_DeletionProtection(t *testing.T) { resourceName := "aws_neptune_global_cluster.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckGlobalCluster(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckGlobalCluster(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, neptune.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckGlobalClusterDestroy(ctx), @@ -154,7 +154,7 @@ func TestAccNeptuneGlobalCluster_Engine(t *testing.T) { resourceName := "aws_neptune_global_cluster.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckGlobalCluster(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckGlobalCluster(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, neptune.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckGlobalClusterDestroy(ctx), @@ -184,7 +184,7 @@ func TestAccNeptuneGlobalCluster_EngineVersion(t *testing.T) { resourceName := "aws_neptune_global_cluster.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckGlobalCluster(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckGlobalCluster(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, neptune.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckGlobalClusterDestroy(ctx), @@ -220,7 +220,7 @@ func TestAccNeptuneGlobalCluster_SourceDBClusterIdentifier_basic(t *testing.T) { resourceName := "aws_neptune_global_cluster.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckGlobalCluster(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckGlobalCluster(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, neptune.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckGlobalClusterDestroy(ctx), @@ -250,7 +250,7 @@ func TestAccNeptuneGlobalCluster_SourceDBClusterIdentifier_storageEncrypted(t *t resourceName := "aws_neptune_global_cluster.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckGlobalCluster(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckGlobalCluster(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, neptune.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckGlobalClusterDestroy(ctx), @@ -279,7 +279,7 @@ func TestAccNeptuneGlobalCluster_StorageEncrypted(t *testing.T) { resourceName := "aws_neptune_global_cluster.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckGlobalCluster(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckGlobalCluster(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, neptune.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckGlobalClusterDestroy(ctx), 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 46c1b04f6313..f5971bfc0dec 100644 --- a/internal/service/neptune/orderable_db_instance_data_source_test.go +++ b/internal/service/neptune/orderable_db_instance_data_source_test.go @@ -21,7 +21,7 @@ func TestAccNeptuneOrderableDBInstanceDataSource_basic(t *testing.T) { class := "db.t3.medium" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckOrderableDBInstance(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckOrderableDBInstance(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, neptune.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: nil, @@ -48,7 +48,7 @@ func TestAccNeptuneOrderableDBInstanceDataSource_preferred(t *testing.T) { preferredOption := "db.r4.2xlarge" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckOrderableDBInstance(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckOrderableDBInstance(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, neptune.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: nil, diff --git a/internal/service/neptune/parameter_group_test.go b/internal/service/neptune/parameter_group_test.go index 835e0cbef942..d8b320b705a5 100644 --- a/internal/service/neptune/parameter_group_test.go +++ b/internal/service/neptune/parameter_group_test.go @@ -23,7 +23,7 @@ func TestAccNeptuneParameterGroup_basic(t *testing.T) { resourceName := "aws_neptune_parameter_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, neptune.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckParameterGroupDestroy(ctx), @@ -57,7 +57,7 @@ func TestAccNeptuneParameterGroup_description(t *testing.T) { resourceName := "aws_neptune_parameter_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, neptune.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckParameterGroupDestroy(ctx), @@ -86,7 +86,7 @@ func TestAccNeptuneParameterGroup_parameter(t *testing.T) { resourceName := "aws_neptune_parameter_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, neptune.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckParameterGroupDestroy(ctx), @@ -135,7 +135,7 @@ func TestAccNeptuneParameterGroup_tags(t *testing.T) { resourceName := "aws_neptune_parameter_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, neptune.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckParameterGroupDestroy(ctx), diff --git a/internal/service/neptune/subnet_group_test.go b/internal/service/neptune/subnet_group_test.go index c7243c9e5269..b956f96fde2e 100644 --- a/internal/service/neptune/subnet_group_test.go +++ b/internal/service/neptune/subnet_group_test.go @@ -23,7 +23,7 @@ func TestAccNeptuneSubnetGroup_basic(t *testing.T) { resourceName := "aws_neptune_subnet_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, neptune.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSubnetGroupDestroy(ctx), @@ -56,7 +56,7 @@ func TestAccNeptuneSubnetGroup_disappears(t *testing.T) { resourceName := "aws_neptune_subnet_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, neptune.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSubnetGroupDestroy(ctx), @@ -80,7 +80,7 @@ func TestAccNeptuneSubnetGroup_nameGenerated(t *testing.T) { resourceName := "aws_neptune_subnet_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, neptune.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSubnetGroupDestroy(ctx), @@ -109,7 +109,7 @@ func TestAccNeptuneSubnetGroup_namePrefix(t *testing.T) { resourceName := "aws_neptune_subnet_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, neptune.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSubnetGroupDestroy(ctx), @@ -138,7 +138,7 @@ func TestAccNeptuneSubnetGroup_tags(t *testing.T) { resourceName := "aws_neptune_subnet_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, neptune.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSubnetGroupDestroy(ctx), @@ -184,7 +184,7 @@ func TestAccNeptuneSubnetGroup_update(t *testing.T) { resourceName := "aws_neptune_subnet_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, neptune.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSubnetGroupDestroy(ctx), From 244688c8d993cb2a0441550767c4e00b73c116c4 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Fri, 24 Feb 2023 16:37:15 -0500 Subject: [PATCH 201/763] Add 'Context' argument to 'acctest.PreCheck' for networkfirewall. --- .../firewall_data_source_test.go | 6 +-- .../firewall_policy_data_source_test.go | 6 +-- .../networkfirewall/firewall_policy_test.go | 42 +++++++++---------- .../service/networkfirewall/firewall_test.go | 18 ++++---- .../logging_configuration_test.go | 26 ++++++------ .../networkfirewall/resource_policy_test.go | 12 +++--- .../networkfirewall/rule_group_test.go | 40 +++++++++--------- 7 files changed, 75 insertions(+), 75 deletions(-) diff --git a/internal/service/networkfirewall/firewall_data_source_test.go b/internal/service/networkfirewall/firewall_data_source_test.go index 202bf11f5666..558f01c8d02c 100644 --- a/internal/service/networkfirewall/firewall_data_source_test.go +++ b/internal/service/networkfirewall/firewall_data_source_test.go @@ -21,7 +21,7 @@ func TestAccNetworkFirewallFirewallDataSource_arn(t *testing.T) { vpcResourceName := "aws_vpc.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, networkfirewall.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ @@ -69,7 +69,7 @@ func TestAccNetworkFirewallFirewallDataSource_name(t *testing.T) { vpcResourceName := "aws_vpc.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, networkfirewall.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ @@ -117,7 +117,7 @@ func TestAccNetworkFirewallFirewallDataSource_arnandname(t *testing.T) { vpcResourceName := "aws_vpc.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, networkfirewall.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ diff --git a/internal/service/networkfirewall/firewall_policy_data_source_test.go b/internal/service/networkfirewall/firewall_policy_data_source_test.go index f2e26db070b4..7fc7bc0ca301 100644 --- a/internal/service/networkfirewall/firewall_policy_data_source_test.go +++ b/internal/service/networkfirewall/firewall_policy_data_source_test.go @@ -18,7 +18,7 @@ func TestAccNetworkFirewallFirewallPolicyDataSource_arn(t *testing.T) { datasourceName := "data.aws_networkfirewall_firewall_policy.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, networkfirewall.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ @@ -49,7 +49,7 @@ func TestAccNetworkFirewallFirewallPolicyDataSource_name(t *testing.T) { datasourceName := "data.aws_networkfirewall_firewall_policy.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, networkfirewall.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ @@ -80,7 +80,7 @@ func TestAccNetworkFirewallFirewallPolicyDataSource_nameAndARN(t *testing.T) { datasourceName := "data.aws_networkfirewall_firewall_policy.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, networkfirewall.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ diff --git a/internal/service/networkfirewall/firewall_policy_test.go b/internal/service/networkfirewall/firewall_policy_test.go index 0b8d8ff44e3b..c771a6f96205 100644 --- a/internal/service/networkfirewall/firewall_policy_test.go +++ b/internal/service/networkfirewall/firewall_policy_test.go @@ -23,7 +23,7 @@ func TestAccNetworkFirewallFirewallPolicy_basic(t *testing.T) { resourceName := "aws_networkfirewall_firewall_policy.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, networkfirewall.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckFirewallPolicyDestroy(ctx), @@ -59,7 +59,7 @@ func TestAccNetworkFirewallFirewallPolicy_encryptionConfiguration(t *testing.T) resourceName := "aws_networkfirewall_firewall_policy.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, networkfirewall.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckFirewallPolicyDestroy(ctx), @@ -103,7 +103,7 @@ func TestAccNetworkFirewallFirewallPolicy_statefulDefaultActions(t *testing.T) { resourceName := "aws_networkfirewall_firewall_policy.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, networkfirewall.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckFirewallPolicyDestroy(ctx), @@ -133,7 +133,7 @@ func TestAccNetworkFirewallFirewallPolicy_statefulEngineOption(t *testing.T) { resourceName := "aws_networkfirewall_firewall_policy.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, networkfirewall.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckFirewallPolicyDestroy(ctx), @@ -163,7 +163,7 @@ func TestAccNetworkFirewallFirewallPolicy_updateStatefulEngineOption(t *testing. resourceName := "aws_networkfirewall_firewall_policy.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, networkfirewall.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckFirewallPolicyDestroy(ctx), @@ -212,7 +212,7 @@ func TestAccNetworkFirewallFirewallPolicy_statefulRuleGroupReference(t *testing. ruleGroupResourceName := "aws_networkfirewall_rule_group.test.0" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, networkfirewall.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckFirewallPolicyDestroy(ctx), @@ -244,7 +244,7 @@ func TestAccNetworkFirewallFirewallPolicy_statefulRuleGroupReferenceManaged(t *t resourceName := "aws_networkfirewall_firewall_policy.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, networkfirewall.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckFirewallPolicyDestroy(ctx), @@ -272,7 +272,7 @@ func TestAccNetworkFirewallFirewallPolicy_updateStatefulRuleGroupReference(t *te ruleGroupResourceName := "aws_networkfirewall_rule_group.test.0" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, networkfirewall.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckFirewallPolicyDestroy(ctx), @@ -316,7 +316,7 @@ func TestAccNetworkFirewallFirewallPolicy_multipleStatefulRuleGroupReferences(t ruleGroupResourceName2 := "aws_networkfirewall_rule_group.test.1" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, networkfirewall.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckFirewallPolicyDestroy(ctx), @@ -357,7 +357,7 @@ func TestAccNetworkFirewallFirewallPolicy_statefulRuleGroupPriorityReference(t * ruleGroupResourceName := "aws_networkfirewall_rule_group.test.0" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, networkfirewall.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckFirewallPolicyDestroy(ctx), @@ -389,7 +389,7 @@ func TestAccNetworkFirewallFirewallPolicy_statefulRuleGroupOverrideActionReferen override_action := networkfirewall.OverrideActionDropToAlert resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, networkfirewall.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckFirewallPolicyDestroy(ctx), @@ -418,7 +418,7 @@ func TestAccNetworkFirewallFirewallPolicy_updateStatefulRuleGroupPriorityReferen ruleGroupResourceName := "aws_networkfirewall_rule_group.test.0" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, networkfirewall.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckFirewallPolicyDestroy(ctx), @@ -461,7 +461,7 @@ func TestAccNetworkFirewallFirewallPolicy_statelessRuleGroupReference(t *testing ruleGroupResourceName := "aws_networkfirewall_rule_group.test.0" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, networkfirewall.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckFirewallPolicyDestroy(ctx), @@ -506,7 +506,7 @@ func TestAccNetworkFirewallFirewallPolicy_updateStatelessRuleGroupReference(t *t ruleGroupResourceName := "aws_networkfirewall_rule_group.test.0" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, networkfirewall.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckFirewallPolicyDestroy(ctx), @@ -554,7 +554,7 @@ func TestAccNetworkFirewallFirewallPolicy_multipleStatelessRuleGroupReferences(t ruleGroupResourceName2 := "aws_networkfirewall_rule_group.test.1" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, networkfirewall.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckFirewallPolicyDestroy(ctx), @@ -603,7 +603,7 @@ func TestAccNetworkFirewallFirewallPolicy_statelessCustomAction(t *testing.T) { resourceName := "aws_networkfirewall_firewall_policy.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, networkfirewall.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckFirewallPolicyDestroy(ctx), @@ -638,7 +638,7 @@ func TestAccNetworkFirewallFirewallPolicy_updateStatelessCustomAction(t *testing resourceName := "aws_networkfirewall_firewall_policy.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, networkfirewall.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckFirewallPolicyDestroy(ctx), @@ -703,7 +703,7 @@ func TestAccNetworkFirewallFirewallPolicy_multipleStatelessCustomActions(t *test resourceName := "aws_networkfirewall_firewall_policy.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, networkfirewall.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckFirewallPolicyDestroy(ctx), @@ -760,7 +760,7 @@ func TestAccNetworkFirewallFirewallPolicy_statefulRuleGroupReferenceAndCustomAct ruleGroupResourceName := "aws_networkfirewall_rule_group.test.0" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, networkfirewall.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckFirewallPolicyDestroy(ctx), @@ -805,7 +805,7 @@ func TestAccNetworkFirewallFirewallPolicy_tags(t *testing.T) { resourceName := "aws_networkfirewall_firewall_policy.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, networkfirewall.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckFirewallPolicyDestroy(ctx), @@ -851,7 +851,7 @@ func TestAccNetworkFirewallFirewallPolicy_disappears(t *testing.T) { resourceName := "aws_networkfirewall_firewall_policy.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, networkfirewall.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckFirewallPolicyDestroy(ctx), diff --git a/internal/service/networkfirewall/firewall_test.go b/internal/service/networkfirewall/firewall_test.go index 621b1ba9425c..50b846bcb205 100644 --- a/internal/service/networkfirewall/firewall_test.go +++ b/internal/service/networkfirewall/firewall_test.go @@ -25,7 +25,7 @@ func TestAccNetworkFirewallFirewall_basic(t *testing.T) { vpcResourceName := "aws_vpc.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, networkfirewall.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckFirewallDestroy(ctx), @@ -74,7 +74,7 @@ func TestAccNetworkFirewallFirewall_dualstackSubnet(t *testing.T) { vpcResourceName := "aws_vpc.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, networkfirewall.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckFirewallDestroy(ctx), @@ -120,7 +120,7 @@ func TestAccNetworkFirewallFirewall_description(t *testing.T) { resourceName := "aws_networkfirewall_firewall.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, networkfirewall.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckFirewallDestroy(ctx), @@ -161,7 +161,7 @@ func TestAccNetworkFirewallFirewall_deleteProtection(t *testing.T) { resourceName := "aws_networkfirewall_firewall.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, networkfirewall.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckFirewallDestroy(ctx), @@ -203,7 +203,7 @@ func TestAccNetworkFirewallFirewall_encryptionConfiguration(t *testing.T) { resourceName := "aws_networkfirewall_firewall.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, networkfirewall.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckFirewallDestroy(ctx), @@ -248,7 +248,7 @@ func TestAccNetworkFirewallFirewall_SubnetMappings_updateSubnet(t *testing.T) { updateSubnetResourceName := "aws_subnet.example" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, networkfirewall.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckFirewallDestroy(ctx), @@ -294,7 +294,7 @@ func TestAccNetworkFirewallFirewall_SubnetMappings_updateMultipleSubnets(t *test updateSubnetResourceName := "aws_subnet.example" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, networkfirewall.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckFirewallDestroy(ctx), @@ -351,7 +351,7 @@ func TestAccNetworkFirewallFirewall_tags(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resourceName := "aws_networkfirewall_firewall.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, networkfirewall.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckFirewallDestroy(ctx), @@ -396,7 +396,7 @@ func TestAccNetworkFirewallFirewall_disappears(t *testing.T) { resourceName := "aws_networkfirewall_firewall.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, networkfirewall.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckFirewallDestroy(ctx), diff --git a/internal/service/networkfirewall/logging_configuration_test.go b/internal/service/networkfirewall/logging_configuration_test.go index e555a359504f..9ce5b48a6701 100644 --- a/internal/service/networkfirewall/logging_configuration_test.go +++ b/internal/service/networkfirewall/logging_configuration_test.go @@ -23,7 +23,7 @@ func TestAccNetworkFirewallLoggingConfiguration_CloudWatchLogDestination_logGrou resourceName := "aws_networkfirewall_logging_configuration.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, networkfirewall.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckLoggingConfigurationDestroy(ctx), @@ -68,7 +68,7 @@ func TestAccNetworkFirewallLoggingConfiguration_CloudWatchLogDestination_logType resourceName := "aws_networkfirewall_logging_configuration.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, networkfirewall.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckLoggingConfigurationDestroy(ctx), @@ -110,7 +110,7 @@ func TestAccNetworkFirewallLoggingConfiguration_KinesisLogDestination_deliverySt resourceName := "aws_networkfirewall_logging_configuration.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, networkfirewall.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckLoggingConfigurationDestroy(ctx), @@ -155,7 +155,7 @@ func TestAccNetworkFirewallLoggingConfiguration_KinesisLogDestination_logType(t resourceName := "aws_networkfirewall_logging_configuration.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, networkfirewall.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckLoggingConfigurationDestroy(ctx), @@ -197,7 +197,7 @@ func TestAccNetworkFirewallLoggingConfiguration_S3LogDestination_bucketName(t *t resourceName := "aws_networkfirewall_logging_configuration.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, networkfirewall.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckLoggingConfigurationDestroy(ctx), @@ -241,7 +241,7 @@ func TestAccNetworkFirewallLoggingConfiguration_S3LogDestination_logType(t *test resourceName := "aws_networkfirewall_logging_configuration.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, networkfirewall.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckLoggingConfigurationDestroy(ctx), @@ -283,7 +283,7 @@ func TestAccNetworkFirewallLoggingConfiguration_S3LogDestination_prefix(t *testi resourceName := "aws_networkfirewall_logging_configuration.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, networkfirewall.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckLoggingConfigurationDestroy(ctx), @@ -329,7 +329,7 @@ func TestAccNetworkFirewallLoggingConfiguration_updateFirewallARN(t *testing.T) firewallResourceName := "aws_networkfirewall_firewall.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, networkfirewall.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckLoggingConfigurationDestroy(ctx), @@ -367,7 +367,7 @@ func TestAccNetworkFirewallLoggingConfiguration_updateLogDestinationType(t *test resourceName := "aws_networkfirewall_logging_configuration.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, networkfirewall.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckLoggingConfigurationDestroy(ctx), @@ -426,7 +426,7 @@ func TestAccNetworkFirewallLoggingConfiguration_updateToMultipleLogDestinations( resourceName := "aws_networkfirewall_logging_configuration.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, networkfirewall.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckLoggingConfigurationDestroy(ctx), @@ -482,7 +482,7 @@ func TestAccNetworkFirewallLoggingConfiguration_updateToSingleAlertTypeLogDestin resourceName := "aws_networkfirewall_logging_configuration.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, networkfirewall.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckLoggingConfigurationDestroy(ctx), @@ -538,7 +538,7 @@ func TestAccNetworkFirewallLoggingConfiguration_updateToSingleFlowTypeLogDestina resourceName := "aws_networkfirewall_logging_configuration.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, networkfirewall.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckLoggingConfigurationDestroy(ctx), @@ -593,7 +593,7 @@ func TestAccNetworkFirewallLoggingConfiguration_disappears(t *testing.T) { resourceName := "aws_networkfirewall_logging_configuration.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, networkfirewall.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckLoggingConfigurationDestroy(ctx), diff --git a/internal/service/networkfirewall/resource_policy_test.go b/internal/service/networkfirewall/resource_policy_test.go index 2c7afe7227de..a364cf7b57b7 100644 --- a/internal/service/networkfirewall/resource_policy_test.go +++ b/internal/service/networkfirewall/resource_policy_test.go @@ -32,7 +32,7 @@ func TestAccNetworkFirewallResourcePolicy_basic(t *testing.T) { resourceName := "aws_networkfirewall_resource_policy.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, networkfirewall.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckResourcePolicyDestroy(ctx), @@ -60,7 +60,7 @@ func TestAccNetworkFirewallResourcePolicy_ignoreEquivalent(t *testing.T) { resourceName := "aws_networkfirewall_resource_policy.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, networkfirewall.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckResourcePolicyDestroy(ctx), @@ -90,7 +90,7 @@ func TestAccNetworkFirewallResourcePolicy_ruleGroup(t *testing.T) { resourceName := "aws_networkfirewall_resource_policy.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, networkfirewall.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckResourcePolicyDestroy(ctx), @@ -126,7 +126,7 @@ func TestAccNetworkFirewallResourcePolicy_disappears(t *testing.T) { resourceName := "aws_networkfirewall_resource_policy.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, networkfirewall.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckResourcePolicyDestroy(ctx), @@ -149,7 +149,7 @@ func TestAccNetworkFirewallResourcePolicy_Disappears_firewallPolicy(t *testing.T resourceName := "aws_networkfirewall_resource_policy.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, networkfirewall.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckResourcePolicyDestroy(ctx), @@ -172,7 +172,7 @@ func TestAccNetworkFirewallResourcePolicy_Disappears_ruleGroup(t *testing.T) { resourceName := "aws_networkfirewall_resource_policy.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, networkfirewall.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckResourcePolicyDestroy(ctx), diff --git a/internal/service/networkfirewall/rule_group_test.go b/internal/service/networkfirewall/rule_group_test.go index a1836eaad7be..45b5aedf2bf5 100644 --- a/internal/service/networkfirewall/rule_group_test.go +++ b/internal/service/networkfirewall/rule_group_test.go @@ -23,7 +23,7 @@ func TestAccNetworkFirewallRuleGroup_Basic_rulesSourceList(t *testing.T) { resourceName := "aws_networkfirewall_rule_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, networkfirewall.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRuleGroupDestroy(ctx), @@ -66,7 +66,7 @@ func TestAccNetworkFirewallRuleGroup_Basic_referenceSets(t *testing.T) { resourceName := "aws_networkfirewall_rule_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, networkfirewall.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRuleGroupDestroy(ctx), @@ -103,7 +103,7 @@ func TestAccNetworkFirewallRuleGroup_Basic_updateReferenceSets(t *testing.T) { resourceName := "aws_networkfirewall_rule_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, networkfirewall.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRuleGroupDestroy(ctx), @@ -156,7 +156,7 @@ func TestAccNetworkFirewallRuleGroup_Basic_statefulRule(t *testing.T) { resourceName := "aws_networkfirewall_rule_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, networkfirewall.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRuleGroupDestroy(ctx), @@ -206,7 +206,7 @@ func TestAccNetworkFirewallRuleGroup_Basic_statelessRule(t *testing.T) { resourceName := "aws_networkfirewall_rule_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, networkfirewall.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRuleGroupDestroy(ctx), @@ -252,7 +252,7 @@ func TestAccNetworkFirewallRuleGroup_Basic_rules(t *testing.T) { alert http any any -> any any (http_response_line; content:"403 Forbidden"; sid:1;)` resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, networkfirewall.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRuleGroupDestroy(ctx), @@ -291,7 +291,7 @@ func TestAccNetworkFirewallRuleGroup_statefulRuleOptions(t *testing.T) { rules := `alert http any any -> any any (http_response_line; content:"403 Forbidden"; sid:1;)` resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, networkfirewall.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRuleGroupDestroy(ctx), @@ -321,7 +321,7 @@ func TestAccNetworkFirewallRuleGroup_updateStatefulRuleOptions(t *testing.T) { rules := `alert http any any -> any any (http_response_line; content:"403 Forbidden"; sid:1;)` resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, networkfirewall.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRuleGroupDestroy(ctx), @@ -367,7 +367,7 @@ func TestAccNetworkFirewallRuleGroup_statelessRuleWithCustomAction(t *testing.T) resourceName := "aws_networkfirewall_rule_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, networkfirewall.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRuleGroupDestroy(ctx), @@ -421,7 +421,7 @@ func TestAccNetworkFirewallRuleGroup_updateRules(t *testing.T) { updatedRules := `pass tls $HOME_NET any -> $EXTERNAL_NET 443 (tls.sni; content:"NEW.example.com"; msg:"FQDN test"; sid:1;)` resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, networkfirewall.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRuleGroupDestroy(ctx), @@ -460,7 +460,7 @@ func TestAccNetworkFirewallRuleGroup_updateRulesSourceList(t *testing.T) { resourceName := "aws_networkfirewall_rule_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, networkfirewall.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRuleGroupDestroy(ctx), @@ -507,7 +507,7 @@ func TestAccNetworkFirewallRuleGroup_rulesSourceAndRuleVariables(t *testing.T) { resourceName := "aws_networkfirewall_rule_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, networkfirewall.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRuleGroupDestroy(ctx), @@ -588,7 +588,7 @@ func TestAccNetworkFirewallRuleGroup_updateStatefulRule(t *testing.T) { resourceName := "aws_networkfirewall_rule_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, networkfirewall.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRuleGroupDestroy(ctx), @@ -644,7 +644,7 @@ func TestAccNetworkFirewallRuleGroup_updateMultipleStatefulRules(t *testing.T) { resourceName := "aws_networkfirewall_rule_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, networkfirewall.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRuleGroupDestroy(ctx), @@ -721,7 +721,7 @@ func TestAccNetworkFirewallRuleGroup_StatefulRule_action(t *testing.T) { resourceName := "aws_networkfirewall_rule_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, networkfirewall.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRuleGroupDestroy(ctx), @@ -777,7 +777,7 @@ func TestAccNetworkFirewallRuleGroup_StatefulRule_header(t *testing.T) { resourceName := "aws_networkfirewall_rule_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, networkfirewall.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRuleGroupDestroy(ctx), @@ -835,7 +835,7 @@ func TestAccNetworkFirewallRuleGroup_updateStatelessRule(t *testing.T) { resourceName := "aws_networkfirewall_rule_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, networkfirewall.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRuleGroupDestroy(ctx), @@ -886,7 +886,7 @@ func TestAccNetworkFirewallRuleGroup_tags(t *testing.T) { resourceName := "aws_networkfirewall_rule_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, networkfirewall.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRuleGroupDestroy(ctx), @@ -931,7 +931,7 @@ func TestAccNetworkFirewallRuleGroup_encryptionConfiguration(t *testing.T) { resourceName := "aws_networkfirewall_rule_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, networkfirewall.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRuleGroupDestroy(ctx), @@ -975,7 +975,7 @@ func TestAccNetworkFirewallRuleGroup_disappears(t *testing.T) { resourceName := "aws_networkfirewall_rule_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, networkfirewall.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRuleGroupDestroy(ctx), From 4d532df902a8850d3c0f6e233e83d19932f93e5e Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Fri, 24 Feb 2023 16:37:15 -0500 Subject: [PATCH 202/763] Add 'Context' argument to 'acctest.PreCheck' for networkmanager. --- .../networkmanager/connect_attachment_test.go | 8 ++++---- .../service/networkmanager/connect_peer_test.go | 6 +++--- .../connection_data_source_test.go | 2 +- .../service/networkmanager/connection_test.go | 8 ++++---- .../connections_data_source_test.go | 2 +- .../core_network_policy_attachment_test.go | 4 ++-- ...e_network_policy_document_data_source_test.go | 2 +- .../service/networkmanager/core_network_test.go | 16 ++++++++-------- .../customer_gateway_association_test.go | 6 +++--- .../networkmanager/device_data_source_test.go | 2 +- internal/service/networkmanager/device_test.go | 10 +++++----- .../networkmanager/devices_data_source_test.go | 2 +- .../global_network_data_source_test.go | 2 +- .../networkmanager/global_network_test.go | 8 ++++---- .../global_networks_data_source_test.go | 2 +- .../networkmanager/link_association_test.go | 4 ++-- .../networkmanager/link_data_source_test.go | 2 +- internal/service/networkmanager/link_test.go | 8 ++++---- .../networkmanager/links_data_source_test.go | 2 +- .../networkmanager/site_data_source_test.go | 2 +- internal/service/networkmanager/site_test.go | 10 +++++----- .../site_to_site_vpn_attachment_test.go | 6 +++--- .../networkmanager/sites_data_source_test.go | 2 +- ...nsit_gateway_connect_peer_association_test.go | 6 +++--- .../transit_gateway_peering_test.go | 6 +++--- .../transit_gateway_registration_test.go | 8 ++++---- ...ransit_gateway_route_table_attachment_test.go | 6 +++--- .../networkmanager/vpc_attachment_test.go | 8 ++++---- 28 files changed, 75 insertions(+), 75 deletions(-) diff --git a/internal/service/networkmanager/connect_attachment_test.go b/internal/service/networkmanager/connect_attachment_test.go index 9f57836649d2..934874e7d6be 100644 --- a/internal/service/networkmanager/connect_attachment_test.go +++ b/internal/service/networkmanager/connect_attachment_test.go @@ -23,7 +23,7 @@ func TestAccNetworkManagerConnectAttachment_basic(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, networkmanager.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckConnectAttachmentDestroy(ctx), @@ -58,7 +58,7 @@ func TestAccNetworkManagerConnectAttachment_basic_NoDependsOn(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, networkmanager.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckConnectAttachmentDestroy(ctx), @@ -93,7 +93,7 @@ func TestAccNetworkManagerConnectAttachment_disappears(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, networkmanager.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckConnectAttachmentDestroy(ctx), @@ -117,7 +117,7 @@ func TestAccNetworkManagerConnectAttachment_tags(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, networkmanager.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckConnectAttachmentDestroy(ctx), diff --git a/internal/service/networkmanager/connect_peer_test.go b/internal/service/networkmanager/connect_peer_test.go index d0d8a534c767..0ee813dd1821 100644 --- a/internal/service/networkmanager/connect_peer_test.go +++ b/internal/service/networkmanager/connect_peer_test.go @@ -26,7 +26,7 @@ func TestAccNetworkManagerConnectPeer_basic(t *testing.T) { asn := "65501" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, networkmanager.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckConnectPeerDestroy(ctx), @@ -70,7 +70,7 @@ func TestAccNetworkManagerConnectPeer_noDependsOn(t *testing.T) { asn := "65501" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, networkmanager.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckConnectPeerDestroy(ctx), @@ -114,7 +114,7 @@ func TestAccNetworkManagerConnectPeer_tags(t *testing.T) { asn := "65501" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, networkmanager.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckConnectPeerDestroy(ctx), diff --git a/internal/service/networkmanager/connection_data_source_test.go b/internal/service/networkmanager/connection_data_source_test.go index fd2e7577359c..ded5645cd82c 100644 --- a/internal/service/networkmanager/connection_data_source_test.go +++ b/internal/service/networkmanager/connection_data_source_test.go @@ -15,7 +15,7 @@ func TestAccNetworkManagerConnectionDataSource_basic(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, networkmanager.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ diff --git a/internal/service/networkmanager/connection_test.go b/internal/service/networkmanager/connection_test.go index 3039533e1d2e..ce03c93f3d55 100644 --- a/internal/service/networkmanager/connection_test.go +++ b/internal/service/networkmanager/connection_test.go @@ -34,7 +34,7 @@ func testAccConnection_basic(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, networkmanager.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckConnectionDestroy(ctx), @@ -66,7 +66,7 @@ func testAccConnection_disappears(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, networkmanager.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckConnectionDestroy(ctx), @@ -89,7 +89,7 @@ func testAccConnection_tags(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, networkmanager.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckConnectionDestroy(ctx), @@ -137,7 +137,7 @@ func testAccConnection_descriptionAndLinks(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, networkmanager.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckConnectionDestroy(ctx), diff --git a/internal/service/networkmanager/connections_data_source_test.go b/internal/service/networkmanager/connections_data_source_test.go index e8f94897cdb5..4ab3dabfe87d 100644 --- a/internal/service/networkmanager/connections_data_source_test.go +++ b/internal/service/networkmanager/connections_data_source_test.go @@ -16,7 +16,7 @@ func TestAccNetworkManagerConnectionsDataSource_basic(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, networkmanager.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ diff --git a/internal/service/networkmanager/core_network_policy_attachment_test.go b/internal/service/networkmanager/core_network_policy_attachment_test.go index 725c11e2b7ee..70387de95639 100644 --- a/internal/service/networkmanager/core_network_policy_attachment_test.go +++ b/internal/service/networkmanager/core_network_policy_attachment_test.go @@ -22,7 +22,7 @@ func TestAccNetworkManagerCoreNetworkPolicyAttachment_basic(t *testing.T) { updatedSegmentValue := "segmentValue2" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, networkmanager.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckCoreNetworkPolicyAttachmentDestroy(ctx), @@ -63,7 +63,7 @@ func TestAccNetworkManagerCoreNetworkPolicyAttachment_vpcAttachment(t *testing.T segmentValue := "segmentValue" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, networkmanager.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckCoreNetworkPolicyAttachmentDestroy(ctx), 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 25a001d41603..c71480a94b99 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 @@ -13,7 +13,7 @@ func TestAccNetworkManagerCoreNetworkPolicyDocumentDataSource_basic(t *testing.T // acceptance test, but just instantiating the AWS provider requires // some AWS API calls, and so this needs valid AWS credentials to work. resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, networkmanager.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ diff --git a/internal/service/networkmanager/core_network_test.go b/internal/service/networkmanager/core_network_test.go index 20e2f6a77e89..8aa048b56bde 100644 --- a/internal/service/networkmanager/core_network_test.go +++ b/internal/service/networkmanager/core_network_test.go @@ -20,7 +20,7 @@ func TestAccNetworkManagerCoreNetwork_basic(t *testing.T) { resourceName := "aws_networkmanager_core_network.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, networkmanager.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckCoreNetworkDestroy(ctx), @@ -53,7 +53,7 @@ func TestAccNetworkManagerCoreNetwork_disappears(t *testing.T) { resourceName := "aws_networkmanager_core_network.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, networkmanager.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckCoreNetworkDestroy(ctx), @@ -75,7 +75,7 @@ func TestAccNetworkManagerCoreNetwork_tags(t *testing.T) { resourceName := "aws_networkmanager_core_network.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, networkmanager.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckCoreNetworkDestroy(ctx), @@ -122,7 +122,7 @@ func TestAccNetworkManagerCoreNetwork_description(t *testing.T) { updatedDescription := "description2" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, networkmanager.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckCoreNetworkDestroy(ctx), @@ -158,7 +158,7 @@ func TestAccNetworkManagerCoreNetwork_policyDocument(t *testing.T) { updatedSegmentValue := "segmentValue2" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, networkmanager.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckCoreNetworkDestroy(ctx), @@ -214,7 +214,7 @@ func TestAccNetworkManagerCoreNetwork_createBasePolicyDocumentWithoutRegion(t *t resourceName := "aws_networkmanager_core_network.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, networkmanager.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckCoreNetworkDestroy(ctx), @@ -254,7 +254,7 @@ func TestAccNetworkManagerCoreNetwork_createBasePolicyDocumentWithRegion(t *test resourceName := "aws_networkmanager_core_network.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, networkmanager.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckCoreNetworkDestroy(ctx), @@ -294,7 +294,7 @@ func TestAccNetworkManagerCoreNetwork_withoutPolicyDocumentUpdateToCreateBasePol resourceName := "aws_networkmanager_core_network.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, networkmanager.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckCoreNetworkDestroy(ctx), diff --git a/internal/service/networkmanager/customer_gateway_association_test.go b/internal/service/networkmanager/customer_gateway_association_test.go index 7e815a74a474..1cb04fbfc3aa 100644 --- a/internal/service/networkmanager/customer_gateway_association_test.go +++ b/internal/service/networkmanager/customer_gateway_association_test.go @@ -34,7 +34,7 @@ func testAccCustomerGatewayAssociation_basic(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, networkmanager.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckCustomerGatewayAssociationDestroy(ctx), @@ -60,7 +60,7 @@ func testAccCustomerGatewayAssociation_disappears(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, networkmanager.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckCustomerGatewayAssociationDestroy(ctx), @@ -85,7 +85,7 @@ func testAccCustomerGatewayAssociation_Disappears_customerGateway(t *testing.T) rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, networkmanager.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckCustomerGatewayAssociationDestroy(ctx), diff --git a/internal/service/networkmanager/device_data_source_test.go b/internal/service/networkmanager/device_data_source_test.go index 58759fc778b4..7d289a6ece0b 100644 --- a/internal/service/networkmanager/device_data_source_test.go +++ b/internal/service/networkmanager/device_data_source_test.go @@ -16,7 +16,7 @@ func TestAccNetworkManagerDeviceDataSource_basic(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, networkmanager.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ diff --git a/internal/service/networkmanager/device_test.go b/internal/service/networkmanager/device_test.go index b52bd112a445..8d9aa908184d 100644 --- a/internal/service/networkmanager/device_test.go +++ b/internal/service/networkmanager/device_test.go @@ -21,7 +21,7 @@ func TestAccNetworkManagerDevice_basic(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, networkmanager.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDeviceDestroy(ctx), @@ -58,7 +58,7 @@ func TestAccNetworkManagerDevice_disappears(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, networkmanager.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDeviceDestroy(ctx), @@ -81,7 +81,7 @@ func TestAccNetworkManagerDevice_tags(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, networkmanager.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDeviceDestroy(ctx), @@ -129,7 +129,7 @@ func TestAccNetworkManagerDevice_allAttributes(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, networkmanager.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDeviceDestroy(ctx), @@ -183,7 +183,7 @@ func TestAccNetworkManagerDevice_awsLocation(t *testing.T) { // nosemgrep:ci.aws rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, networkmanager.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDeviceDestroy(ctx), diff --git a/internal/service/networkmanager/devices_data_source_test.go b/internal/service/networkmanager/devices_data_source_test.go index 69afa6d2f378..58c0a7c42be9 100644 --- a/internal/service/networkmanager/devices_data_source_test.go +++ b/internal/service/networkmanager/devices_data_source_test.go @@ -16,7 +16,7 @@ func TestAccNetworkManagerDevicesDataSource_basic(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, networkmanager.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ diff --git a/internal/service/networkmanager/global_network_data_source_test.go b/internal/service/networkmanager/global_network_data_source_test.go index d91b45199d21..8731b1217aa0 100644 --- a/internal/service/networkmanager/global_network_data_source_test.go +++ b/internal/service/networkmanager/global_network_data_source_test.go @@ -16,7 +16,7 @@ func TestAccNetworkManagerGlobalNetworkDataSource_basic(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, networkmanager.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ diff --git a/internal/service/networkmanager/global_network_test.go b/internal/service/networkmanager/global_network_test.go index 0e85346f1ec8..570f27133c2f 100644 --- a/internal/service/networkmanager/global_network_test.go +++ b/internal/service/networkmanager/global_network_test.go @@ -20,7 +20,7 @@ func TestAccNetworkManagerGlobalNetwork_basic(t *testing.T) { resourceName := "aws_networkmanager_global_network.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, networkmanager.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckGlobalNetworkDestroy(ctx), @@ -48,7 +48,7 @@ func TestAccNetworkManagerGlobalNetwork_disappears(t *testing.T) { resourceName := "aws_networkmanager_global_network.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, networkmanager.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckGlobalNetworkDestroy(ctx), @@ -70,7 +70,7 @@ func TestAccNetworkManagerGlobalNetwork_tags(t *testing.T) { resourceName := "aws_networkmanager_global_network.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, networkmanager.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckGlobalNetworkDestroy(ctx), @@ -114,7 +114,7 @@ func TestAccNetworkManagerGlobalNetwork_description(t *testing.T) { resourceName := "aws_networkmanager_global_network.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, networkmanager.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckGlobalNetworkDestroy(ctx), diff --git a/internal/service/networkmanager/global_networks_data_source_test.go b/internal/service/networkmanager/global_networks_data_source_test.go index b10e664f3319..719d22ec2361 100644 --- a/internal/service/networkmanager/global_networks_data_source_test.go +++ b/internal/service/networkmanager/global_networks_data_source_test.go @@ -16,7 +16,7 @@ func TestAccNetworkManagerGlobalNetworksDataSource_basic(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, networkmanager.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ diff --git a/internal/service/networkmanager/link_association_test.go b/internal/service/networkmanager/link_association_test.go index 58bec30f5d02..39228b94e521 100644 --- a/internal/service/networkmanager/link_association_test.go +++ b/internal/service/networkmanager/link_association_test.go @@ -21,7 +21,7 @@ func TestAccNetworkManagerLinkAssociation_basic(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, networkmanager.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckLinkAssociationDestroy(ctx), @@ -47,7 +47,7 @@ func TestAccNetworkManagerLinkAssociation_disappears(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, networkmanager.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckLinkAssociationDestroy(ctx), diff --git a/internal/service/networkmanager/link_data_source_test.go b/internal/service/networkmanager/link_data_source_test.go index ac4757f1457b..7d3ea418f1db 100644 --- a/internal/service/networkmanager/link_data_source_test.go +++ b/internal/service/networkmanager/link_data_source_test.go @@ -16,7 +16,7 @@ func TestAccNetworkManagerLinkDataSource_basic(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, networkmanager.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ diff --git a/internal/service/networkmanager/link_test.go b/internal/service/networkmanager/link_test.go index 491ac46183ac..c0517f3a2aec 100644 --- a/internal/service/networkmanager/link_test.go +++ b/internal/service/networkmanager/link_test.go @@ -21,7 +21,7 @@ func TestAccNetworkManagerLink_basic(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, networkmanager.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckLinkDestroy(ctx), @@ -56,7 +56,7 @@ func TestAccNetworkManagerLink_disappears(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, networkmanager.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckLinkDestroy(ctx), @@ -79,7 +79,7 @@ func TestAccNetworkManagerLink_tags(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, networkmanager.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckLinkDestroy(ctx), @@ -125,7 +125,7 @@ func TestAccNetworkManagerLink_allAttributes(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, networkmanager.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckLinkDestroy(ctx), diff --git a/internal/service/networkmanager/links_data_source_test.go b/internal/service/networkmanager/links_data_source_test.go index d51857c65de0..8faf33600e4f 100644 --- a/internal/service/networkmanager/links_data_source_test.go +++ b/internal/service/networkmanager/links_data_source_test.go @@ -16,7 +16,7 @@ func TestAccNetworkManagerLinksDataSource_basic(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, networkmanager.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ diff --git a/internal/service/networkmanager/site_data_source_test.go b/internal/service/networkmanager/site_data_source_test.go index 3a8df2c69a2a..7a36d7f4b19c 100644 --- a/internal/service/networkmanager/site_data_source_test.go +++ b/internal/service/networkmanager/site_data_source_test.go @@ -16,7 +16,7 @@ func TestAccNetworkManagerSiteDataSource_basic(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, networkmanager.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ diff --git a/internal/service/networkmanager/site_test.go b/internal/service/networkmanager/site_test.go index 53b8b4f7cabb..d80d43c5fa8c 100644 --- a/internal/service/networkmanager/site_test.go +++ b/internal/service/networkmanager/site_test.go @@ -21,7 +21,7 @@ func TestAccNetworkManagerSite_basic(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, networkmanager.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSiteDestroy(ctx), @@ -52,7 +52,7 @@ func TestAccNetworkManagerSite_disappears(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, networkmanager.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSiteDestroy(ctx), @@ -75,7 +75,7 @@ func TestAccNetworkManagerSite_tags(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, networkmanager.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSiteDestroy(ctx), @@ -121,7 +121,7 @@ func TestAccNetworkManagerSite_description(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, networkmanager.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSiteDestroy(ctx), @@ -156,7 +156,7 @@ func TestAccNetworkManagerSite_location(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, networkmanager.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSiteDestroy(ctx), 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 870661ecab84..d9c14ecb54aa 100644 --- a/internal/service/networkmanager/site_to_site_vpn_attachment_test.go +++ b/internal/service/networkmanager/site_to_site_vpn_attachment_test.go @@ -30,7 +30,7 @@ func TestAccNetworkManagerSiteToSiteVPNAttachment_basic(t *testing.T) { } resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, networkmanager.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSiteToSiteVPNAttachmentDestroy(ctx), @@ -74,7 +74,7 @@ func TestAccNetworkManagerSiteToSiteVPNAttachment_disappears(t *testing.T) { } resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, networkmanager.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSiteToSiteVPNAttachmentDestroy(ctx), @@ -103,7 +103,7 @@ func TestAccNetworkManagerSiteToSiteVPNAttachment_tags(t *testing.T) { } resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, networkmanager.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSiteToSiteVPNAttachmentDestroy(ctx), diff --git a/internal/service/networkmanager/sites_data_source_test.go b/internal/service/networkmanager/sites_data_source_test.go index 16313f3f404a..e44176fe1abc 100644 --- a/internal/service/networkmanager/sites_data_source_test.go +++ b/internal/service/networkmanager/sites_data_source_test.go @@ -16,7 +16,7 @@ func TestAccNetworkManagerSitesDataSource_basic(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, networkmanager.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ 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 720334f89295..2c957cc26f72 100644 --- a/internal/service/networkmanager/transit_gateway_connect_peer_association_test.go +++ b/internal/service/networkmanager/transit_gateway_connect_peer_association_test.go @@ -34,7 +34,7 @@ func testAccTransitGatewayConnectPeerAssociation_basic(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, networkmanager.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTransitGatewayConnectPeerAssociationDestroy(ctx), @@ -60,7 +60,7 @@ func testAccTransitGatewayConnectPeerAssociation_disappears(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, networkmanager.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTransitGatewayConnectPeerAssociationDestroy(ctx), @@ -84,7 +84,7 @@ func testAccTransitGatewayConnectPeerAssociation_Disappears_connectPeer(t *testi rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, networkmanager.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTransitGatewayConnectPeerAssociationDestroy(ctx), diff --git a/internal/service/networkmanager/transit_gateway_peering_test.go b/internal/service/networkmanager/transit_gateway_peering_test.go index ba21cbfbb8c3..081c7d161906 100644 --- a/internal/service/networkmanager/transit_gateway_peering_test.go +++ b/internal/service/networkmanager/transit_gateway_peering_test.go @@ -24,7 +24,7 @@ func TestAccNetworkManagerTransitGatewayPeering_basic(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, networkmanager.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTransitGatewayPeeringDestroy(ctx), @@ -60,7 +60,7 @@ func TestAccNetworkManagerTransitGatewayPeering_disappears(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, networkmanager.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTransitGatewayPeeringDestroy(ctx), @@ -84,7 +84,7 @@ func TestAccNetworkManagerTransitGatewayPeering_tags(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, networkmanager.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTransitGatewayPeeringDestroy(ctx), diff --git a/internal/service/networkmanager/transit_gateway_registration_test.go b/internal/service/networkmanager/transit_gateway_registration_test.go index 495e860de96b..f8755fd68c35 100644 --- a/internal/service/networkmanager/transit_gateway_registration_test.go +++ b/internal/service/networkmanager/transit_gateway_registration_test.go @@ -35,7 +35,7 @@ func testAccTransitGatewayRegistration_basic(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, networkmanager.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTransitGatewayRegistrationDestroy(ctx), @@ -61,7 +61,7 @@ func testAccTransitGatewayRegistration_disappears(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, networkmanager.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTransitGatewayRegistrationDestroy(ctx), @@ -85,7 +85,7 @@ func testAccTransitGatewayRegistration_Disappears_transitGateway(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, networkmanager.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTransitGatewayRegistrationDestroy(ctx), @@ -108,7 +108,7 @@ func testAccTransitGatewayRegistration_crossRegion(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckMultipleRegion(t, 2) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckMultipleRegion(t, 2) }, ErrorCheck: acctest.ErrorCheck(t, networkmanager.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5FactoriesAlternate(ctx, t), CheckDestroy: testAccCheckTransitGatewayRegistrationDestroy(ctx), 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 806fbd777230..4459aa1ae7f3 100644 --- a/internal/service/networkmanager/transit_gateway_route_table_attachment_test.go +++ b/internal/service/networkmanager/transit_gateway_route_table_attachment_test.go @@ -23,7 +23,7 @@ func TestAccNetworkManagerTransitGatewayRouteTableAttachment_basic(t *testing.T) rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, networkmanager.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTransitGatewayRouteTableAttachmentDestroy(ctx), @@ -59,7 +59,7 @@ func TestAccNetworkManagerTransitGatewayRouteTableAttachment_disappears(t *testi rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, networkmanager.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTransitGatewayRouteTableAttachmentDestroy(ctx), @@ -83,7 +83,7 @@ func TestAccNetworkManagerTransitGatewayRouteTableAttachment_tags(t *testing.T) rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, networkmanager.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTransitGatewayRouteTableAttachmentDestroy(ctx), diff --git a/internal/service/networkmanager/vpc_attachment_test.go b/internal/service/networkmanager/vpc_attachment_test.go index 407b972f4437..d48adcfd50a7 100644 --- a/internal/service/networkmanager/vpc_attachment_test.go +++ b/internal/service/networkmanager/vpc_attachment_test.go @@ -25,7 +25,7 @@ func TestAccNetworkManagerVPCAttachment_basic(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, networkmanager.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckVPCAttachmentDestroy(ctx), @@ -68,7 +68,7 @@ func TestAccNetworkManagerVPCAttachment_disappears(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, networkmanager.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckVPCAttachmentDestroy(ctx), @@ -92,7 +92,7 @@ func TestAccNetworkManagerVPCAttachment_tags(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, networkmanager.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckVPCAttachmentDestroy(ctx), @@ -138,7 +138,7 @@ func TestAccNetworkManagerVPCAttachment_update(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, networkmanager.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckVPCAttachmentDestroy(ctx), From e43f6d6f0fa59e6615d21c69a62a06b480cf566b Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Fri, 24 Feb 2023 16:37:15 -0500 Subject: [PATCH 203/763] Add 'Context' argument to 'acctest.PreCheck' for opensearch. --- .../opensearch/domain_data_source_test.go | 4 +- .../service/opensearch/domain_policy_test.go | 2 +- .../opensearch/domain_saml_options_test.go | 10 +-- internal/service/opensearch/domain_test.go | 80 +++++++++---------- .../inbound_connection_accepter_test.go | 4 +- .../opensearch/outbound_connection_test.go | 4 +- 6 files changed, 52 insertions(+), 52 deletions(-) diff --git a/internal/service/opensearch/domain_data_source_test.go b/internal/service/opensearch/domain_data_source_test.go index a7d4f4900453..44d1b4012d5d 100644 --- a/internal/service/opensearch/domain_data_source_test.go +++ b/internal/service/opensearch/domain_data_source_test.go @@ -21,7 +21,7 @@ func TestAccOpenSearchDomainDataSource_Data_basic(t *testing.T) { resourceName := "aws_opensearch_domain.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckIAMServiceLinkedRole(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckIAMServiceLinkedRole(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, opensearchservice.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ @@ -66,7 +66,7 @@ func TestAccOpenSearchDomainDataSource_Data_advanced(t *testing.T) { resourceName := "aws_opensearch_domain.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckIAMServiceLinkedRole(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckIAMServiceLinkedRole(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, opensearchservice.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ diff --git a/internal/service/opensearch/domain_policy_test.go b/internal/service/opensearch/domain_policy_test.go index 8761e324e602..ba13123acbd9 100644 --- a/internal/service/opensearch/domain_policy_test.go +++ b/internal/service/opensearch/domain_policy_test.go @@ -48,7 +48,7 @@ func TestAccOpenSearchDomainPolicy_basic(t *testing.T) { name := fmt.Sprintf("tf-test-%d", ri) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, opensearchservice.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDomainDestroy(ctx), diff --git a/internal/service/opensearch/domain_saml_options_test.go b/internal/service/opensearch/domain_saml_options_test.go index 8e09efe9258e..e9534e12b39c 100644 --- a/internal/service/opensearch/domain_saml_options_test.go +++ b/internal/service/opensearch/domain_saml_options_test.go @@ -27,7 +27,7 @@ func TestAccOpenSearchDomainSAMLOptions_basic(t *testing.T) { esDomainResourceName := "aws_opensearch_domain.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, opensearchservice.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckESDomainSAMLOptionsDestroy(ctx), @@ -62,7 +62,7 @@ func TestAccOpenSearchDomainSAMLOptions_disappears(t *testing.T) { esDomainResourceName := "aws_opensearch_domain.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, opensearchservice.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckESDomainSAMLOptionsDestroy(ctx), @@ -88,7 +88,7 @@ func TestAccOpenSearchDomainSAMLOptions_disappears_Domain(t *testing.T) { esDomainResourceName := "aws_opensearch_domain.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, opensearchservice.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckESDomainSAMLOptionsDestroy(ctx), @@ -115,7 +115,7 @@ func TestAccOpenSearchDomainSAMLOptions_Update(t *testing.T) { esDomainResourceName := "aws_opensearch_domain.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, opensearchservice.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckESDomainSAMLOptionsDestroy(ctx), @@ -150,7 +150,7 @@ func TestAccOpenSearchDomainSAMLOptions_Disabled(t *testing.T) { esDomainResourceName := "aws_opensearch_domain.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, opensearchservice.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckESDomainSAMLOptionsDestroy(ctx), diff --git a/internal/service/opensearch/domain_test.go b/internal/service/opensearch/domain_test.go index 7e2d0939d0a5..e15c8b082df0 100644 --- a/internal/service/opensearch/domain_test.go +++ b/internal/service/opensearch/domain_test.go @@ -140,7 +140,7 @@ func TestAccOpenSearchDomain_basic(t *testing.T) { resourceName := "aws_opensearch_domain.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckIAMServiceLinkedRole(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckIAMServiceLinkedRole(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, opensearchservice.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDomainDestroy(ctx), @@ -171,7 +171,7 @@ func TestAccOpenSearchDomain_requireHTTPS(t *testing.T) { rName := testAccRandomDomainName() resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, opensearchservice.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDomainDestroy(ctx), @@ -215,7 +215,7 @@ func TestAccOpenSearchDomain_customEndpoint(t *testing.T) { certificate := acctest.TLSRSAX509SelfSignedCertificatePEM(t, certKey, customEndpoint) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, opensearchservice.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDomainDestroy(ctx), @@ -263,7 +263,7 @@ func TestAccOpenSearchDomain_Cluster_zoneAwareness(t *testing.T) { resourceName := "aws_opensearch_domain.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckIAMServiceLinkedRole(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckIAMServiceLinkedRole(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, opensearchservice.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDomainDestroy(ctx), @@ -327,7 +327,7 @@ func TestAccOpenSearchDomain_Cluster_coldStorage(t *testing.T) { resourceName := "aws_opensearch_domain.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckIAMServiceLinkedRole(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckIAMServiceLinkedRole(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, opensearchservice.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDomainDestroy(ctx), @@ -365,7 +365,7 @@ func TestAccOpenSearchDomain_Cluster_warm(t *testing.T) { resourceName := "aws_opensearch_domain.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckIAMServiceLinkedRole(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckIAMServiceLinkedRole(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, opensearchservice.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDomainDestroy(ctx), @@ -423,7 +423,7 @@ func TestAccOpenSearchDomain_Cluster_dedicatedMaster(t *testing.T) { resourceName := "aws_opensearch_domain.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckIAMServiceLinkedRole(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckIAMServiceLinkedRole(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, opensearchservice.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDomainDestroy(ctx), @@ -467,7 +467,7 @@ func TestAccOpenSearchDomain_Cluster_update(t *testing.T) { resourceName := "aws_opensearch_domain.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckIAMServiceLinkedRole(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckIAMServiceLinkedRole(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, opensearchservice.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDomainDestroy(ctx), @@ -508,7 +508,7 @@ func TestAccOpenSearchDomain_duplicate(t *testing.T) { resourceName := "aws_opensearch_domain.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckIAMServiceLinkedRole(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckIAMServiceLinkedRole(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, opensearchservice.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: func(s *terraform.State) error { @@ -560,7 +560,7 @@ func TestAccOpenSearchDomain_v23(t *testing.T) { resourceName := "aws_opensearch_domain.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckIAMServiceLinkedRole(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckIAMServiceLinkedRole(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, opensearchservice.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDomainDestroy(ctx), @@ -594,7 +594,7 @@ func TestAccOpenSearchDomain_complex(t *testing.T) { resourceName := "aws_opensearch_domain.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckIAMServiceLinkedRole(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckIAMServiceLinkedRole(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, opensearchservice.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDomainDestroy(ctx), @@ -626,7 +626,7 @@ func TestAccOpenSearchDomain_VPC_basic(t *testing.T) { resourceName := "aws_opensearch_domain.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckIAMServiceLinkedRole(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckIAMServiceLinkedRole(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, opensearchservice.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDomainDestroy(ctx), @@ -654,7 +654,7 @@ func TestAccOpenSearchDomain_VPC_update(t *testing.T) { resourceName := "aws_opensearch_domain.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckIAMServiceLinkedRole(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckIAMServiceLinkedRole(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, opensearchservice.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDomainDestroy(ctx), @@ -694,7 +694,7 @@ func TestAccOpenSearchDomain_VPC_internetToVPCEndpoint(t *testing.T) { resourceName := "aws_opensearch_domain.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckIAMServiceLinkedRole(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckIAMServiceLinkedRole(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, opensearchservice.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDomainDestroy(ctx), @@ -733,7 +733,7 @@ func TestAccOpenSearchDomain_autoTuneOptions(t *testing.T) { resourceName := "aws_opensearch_domain.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckIAMServiceLinkedRole(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckIAMServiceLinkedRole(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, opensearchservice.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDomainDestroy(ctx), @@ -776,7 +776,7 @@ func TestAccOpenSearchDomain_AdvancedSecurityOptions_userDB(t *testing.T) { resourceName := "aws_opensearch_domain.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckIAMServiceLinkedRole(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckIAMServiceLinkedRole(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, opensearchservice.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDomainDestroy(ctx), @@ -814,7 +814,7 @@ func TestAccOpenSearchDomain_AdvancedSecurityOptions_anonymousAuth(t *testing.T) resourceName := "aws_opensearch_domain.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckIAMServiceLinkedRole(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckIAMServiceLinkedRole(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, opensearchservice.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDomainDestroy(ctx), @@ -859,7 +859,7 @@ func TestAccOpenSearchDomain_AdvancedSecurityOptions_iam(t *testing.T) { resourceName := "aws_opensearch_domain.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckIAMServiceLinkedRole(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckIAMServiceLinkedRole(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, opensearchservice.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDomainDestroy(ctx), @@ -897,7 +897,7 @@ func TestAccOpenSearchDomain_AdvancedSecurityOptions_disabled(t *testing.T) { resourceName := "aws_opensearch_domain.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckIAMServiceLinkedRole(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckIAMServiceLinkedRole(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, opensearchservice.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDomainDestroy(ctx), @@ -934,7 +934,7 @@ func TestAccOpenSearchDomain_LogPublishingOptions_indexSlowLogs(t *testing.T) { resourceName := "aws_opensearch_domain.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckIAMServiceLinkedRole(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckIAMServiceLinkedRole(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, opensearchservice.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDomainDestroy(ctx), @@ -970,7 +970,7 @@ func TestAccOpenSearchDomain_LogPublishingOptions_searchSlowLogs(t *testing.T) { resourceName := "aws_opensearch_domain.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckIAMServiceLinkedRole(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckIAMServiceLinkedRole(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, opensearchservice.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDomainDestroy(ctx), @@ -1006,7 +1006,7 @@ func TestAccOpenSearchDomain_LogPublishingOptions_applicationLogs(t *testing.T) resourceName := "aws_opensearch_domain.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckIAMServiceLinkedRole(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckIAMServiceLinkedRole(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, opensearchservice.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDomainDestroy(ctx), @@ -1042,7 +1042,7 @@ func TestAccOpenSearchDomain_LogPublishingOptions_auditLogs(t *testing.T) { resourceName := "aws_opensearch_domain.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckIAMServiceLinkedRole(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckIAMServiceLinkedRole(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, opensearchservice.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDomainDestroy(ctx), @@ -1081,7 +1081,7 @@ func TestAccOpenSearchDomain_CognitoOptions_createAndRemove(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) testAccPreCheckCognitoIdentityProvider(ctx, t) testAccPreCheckIAMServiceLinkedRole(ctx, t) }, @@ -1125,7 +1125,7 @@ func TestAccOpenSearchDomain_CognitoOptions_update(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) testAccPreCheckCognitoIdentityProvider(ctx, t) testAccPreCheckIAMServiceLinkedRole(ctx, t) }, @@ -1168,7 +1168,7 @@ func TestAccOpenSearchDomain_Policy_basic(t *testing.T) { rName := testAccRandomDomainName() resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckIAMServiceLinkedRole(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckIAMServiceLinkedRole(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, opensearchservice.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDomainDestroy(ctx), @@ -1200,7 +1200,7 @@ func TestAccOpenSearchDomain_Policy_ignoreEquivalent(t *testing.T) { rName := testAccRandomDomainName() resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckIAMServiceLinkedRole(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckIAMServiceLinkedRole(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, opensearchservice.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDomainDestroy(ctx), @@ -1230,7 +1230,7 @@ func TestAccOpenSearchDomain_Encryption_atRestDefaultKey(t *testing.T) { rName := testAccRandomDomainName() resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckIAMServiceLinkedRole(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckIAMServiceLinkedRole(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, opensearchservice.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDomainDestroy(ctx), @@ -1263,7 +1263,7 @@ func TestAccOpenSearchDomain_Encryption_atRestSpecifyKey(t *testing.T) { rName := testAccRandomDomainName() resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckIAMServiceLinkedRole(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckIAMServiceLinkedRole(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, opensearchservice.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDomainDestroy(ctx), @@ -1296,7 +1296,7 @@ func TestAccOpenSearchDomain_Encryption_atRestEnable(t *testing.T) { resourceName := "aws_opensearch_domain.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckIAMServiceLinkedRole(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckIAMServiceLinkedRole(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, opensearchservice.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDomainDestroy(ctx), @@ -1338,7 +1338,7 @@ func TestAccOpenSearchDomain_Encryption_atRestEnableLegacy(t *testing.T) { resourceName := "aws_opensearch_domain.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckIAMServiceLinkedRole(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckIAMServiceLinkedRole(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, opensearchservice.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDomainDestroy(ctx), @@ -1372,7 +1372,7 @@ func TestAccOpenSearchDomain_Encryption_nodeToNode(t *testing.T) { rName := testAccRandomDomainName() resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckIAMServiceLinkedRole(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckIAMServiceLinkedRole(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, opensearchservice.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDomainDestroy(ctx), @@ -1405,7 +1405,7 @@ func TestAccOpenSearchDomain_Encryption_nodeToNodeEnable(t *testing.T) { rName := testAccRandomDomainName() resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckIAMServiceLinkedRole(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckIAMServiceLinkedRole(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, opensearchservice.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDomainDestroy(ctx), @@ -1447,7 +1447,7 @@ func TestAccOpenSearchDomain_Encryption_nodeToNodeEnableLegacy(t *testing.T) { rName := testAccRandomDomainName() resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckIAMServiceLinkedRole(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckIAMServiceLinkedRole(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, opensearchservice.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDomainDestroy(ctx), @@ -1488,7 +1488,7 @@ func TestAccOpenSearchDomain_tags(t *testing.T) { resourceName := "aws_opensearch_domain.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckIAMServiceLinkedRole(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckIAMServiceLinkedRole(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, opensearchservice.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDomainDestroy(ctx), @@ -1539,7 +1539,7 @@ func TestAccOpenSearchDomain_VolumeType_update(t *testing.T) { resourceName := "aws_opensearch_domain.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckIAMServiceLinkedRole(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckIAMServiceLinkedRole(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, opensearchservice.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDomainDestroy(ctx), @@ -1595,7 +1595,7 @@ func TestAccOpenSearchDomain_VolumeType_gp3ToGP2(t *testing.T) { resourceName := "aws_opensearch_domain.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckIAMServiceLinkedRole(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckIAMServiceLinkedRole(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, opensearchservice.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDomainDestroy(ctx), @@ -1641,7 +1641,7 @@ func TestAccOpenSearchDomain_VolumeType_missing(t *testing.T) { rName := testAccRandomDomainName() resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckIAMServiceLinkedRole(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckIAMServiceLinkedRole(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, opensearchservice.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDomainDestroy(ctx), @@ -1676,7 +1676,7 @@ func TestAccOpenSearchDomain_versionUpdate(t *testing.T) { resourceName := "aws_opensearch_domain.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckIAMServiceLinkedRole(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckIAMServiceLinkedRole(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, opensearchservice.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDomainDestroy(ctx), @@ -1723,7 +1723,7 @@ func TestAccOpenSearchDomain_disappears(t *testing.T) { resourceName := "aws_opensearch_domain.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckIAMServiceLinkedRole(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckIAMServiceLinkedRole(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, opensearchservice.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDomainDestroy(ctx), diff --git a/internal/service/opensearch/inbound_connection_accepter_test.go b/internal/service/opensearch/inbound_connection_accepter_test.go index 2809750b9e90..99278771bbab 100644 --- a/internal/service/opensearch/inbound_connection_accepter_test.go +++ b/internal/service/opensearch/inbound_connection_accepter_test.go @@ -19,7 +19,7 @@ func TestAccOpenSearchInboundConnectionAccepter_basic(t *testing.T) { resourceName := "aws_opensearch_inbound_connection_accepter.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, opensearchservice.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDomainDestroy(ctx), @@ -49,7 +49,7 @@ func TestAccOpenSearchInboundConnectionAccepter_disappears(t *testing.T) { resourceName := "aws_opensearch_inbound_connection_accepter.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, opensearchservice.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDomainDestroy(ctx), diff --git a/internal/service/opensearch/outbound_connection_test.go b/internal/service/opensearch/outbound_connection_test.go index 858218ecf4b7..01dcbcbaafbc 100644 --- a/internal/service/opensearch/outbound_connection_test.go +++ b/internal/service/opensearch/outbound_connection_test.go @@ -19,7 +19,7 @@ func TestAccOpenSearchOutboundConnection_basic(t *testing.T) { resourceName := "aws_opensearch_outbound_connection.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, opensearchservice.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDomainDestroy(ctx), @@ -49,7 +49,7 @@ func TestAccOpenSearchOutboundConnection_disappears(t *testing.T) { resourceName := "aws_opensearch_outbound_connection.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, opensearchservice.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDomainDestroy(ctx), From 58c9cf43db6a6041529e1ba1565ba39d4190d671 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Fri, 24 Feb 2023 16:37:16 -0500 Subject: [PATCH 204/763] Add 'Context' argument to 'acctest.PreCheck' for opsworks. --- internal/service/opsworks/application_test.go | 2 +- internal/service/opsworks/custom_layer_test.go | 8 ++++---- .../service/opsworks/ecs_cluster_layer_test.go | 2 +- internal/service/opsworks/ganglia_layer_test.go | 2 +- internal/service/opsworks/haproxy_layer_test.go | 2 +- internal/service/opsworks/instance_test.go | 4 ++-- internal/service/opsworks/java_app_layer_test.go | 2 +- .../service/opsworks/memcached_layer_test.go | 2 +- internal/service/opsworks/mysql_layer_test.go | 2 +- .../service/opsworks/nodejs_app_layer_test.go | 2 +- internal/service/opsworks/permission_test.go | 4 ++-- internal/service/opsworks/php_app_layer_test.go | 2 +- .../service/opsworks/rails_app_layer_test.go | 12 ++++++------ .../service/opsworks/rds_db_instance_test.go | 4 ++-- internal/service/opsworks/stack_test.go | 16 ++++++++-------- .../service/opsworks/static_web_layer_test.go | 2 +- internal/service/opsworks/user_profile_test.go | 4 ++-- 17 files changed, 36 insertions(+), 36 deletions(-) diff --git a/internal/service/opsworks/application_test.go b/internal/service/opsworks/application_test.go index 0e1ca2ee0603..dd06713853b7 100644 --- a/internal/service/opsworks/application_test.go +++ b/internal/service/opsworks/application_test.go @@ -24,7 +24,7 @@ func TestAccOpsWorksApplication_basic(t *testing.T) { resourceName := "aws_opsworks_application.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(opsworks.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(opsworks.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, opsworks.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckApplicationDestroy(ctx), diff --git a/internal/service/opsworks/custom_layer_test.go b/internal/service/opsworks/custom_layer_test.go index 5bc9c04737b6..1fa09d2042da 100644 --- a/internal/service/opsworks/custom_layer_test.go +++ b/internal/service/opsworks/custom_layer_test.go @@ -20,7 +20,7 @@ func TestAccOpsWorksCustomLayer_basic(t *testing.T) { resourceName := "aws_opsworks_custom_layer.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(opsworks.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(opsworks.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, opsworks.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckCustomLayerDestroy(ctx), @@ -83,7 +83,7 @@ func TestAccOpsWorksCustomLayer_update(t *testing.T) { resourceName := "aws_opsworks_custom_layer.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(opsworks.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(opsworks.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, opsworks.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckCustomLayerDestroy(ctx), @@ -157,7 +157,7 @@ func TestAccOpsWorksCustomLayer_cloudWatch(t *testing.T) { logGroupResourceName := "aws_cloudwatch_log_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(opsworks.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(opsworks.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, opsworks.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckCustomLayerDestroy(ctx), @@ -239,7 +239,7 @@ func TestAccOpsWorksCustomLayer_loadBasedAutoScaling(t *testing.T) { resourceName := "aws_opsworks_custom_layer.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(opsworks.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(opsworks.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, opsworks.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckCustomLayerDestroy(ctx), diff --git a/internal/service/opsworks/ecs_cluster_layer_test.go b/internal/service/opsworks/ecs_cluster_layer_test.go index b7b7e43ff447..70682879a724 100644 --- a/internal/service/opsworks/ecs_cluster_layer_test.go +++ b/internal/service/opsworks/ecs_cluster_layer_test.go @@ -19,7 +19,7 @@ func TestAccOpsWorksECSClusterLayer_basic(t *testing.T) { resourceName := "aws_opsworks_ecs_cluster_layer.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(opsworks.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(opsworks.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, opsworks.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckECSClusterLayerDestroy(ctx), diff --git a/internal/service/opsworks/ganglia_layer_test.go b/internal/service/opsworks/ganglia_layer_test.go index daf4e2cb02ff..caf0323b587e 100644 --- a/internal/service/opsworks/ganglia_layer_test.go +++ b/internal/service/opsworks/ganglia_layer_test.go @@ -18,7 +18,7 @@ func TestAccOpsWorksGangliaLayer_basic(t *testing.T) { resourceName := "aws_opsworks_ganglia_layer.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(opsworks.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(opsworks.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, opsworks.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckGangliaLayerDestroy(ctx), diff --git a/internal/service/opsworks/haproxy_layer_test.go b/internal/service/opsworks/haproxy_layer_test.go index 93d1440aa201..7ac9d58450a0 100644 --- a/internal/service/opsworks/haproxy_layer_test.go +++ b/internal/service/opsworks/haproxy_layer_test.go @@ -18,7 +18,7 @@ func TestAccOpsWorksHAProxyLayer_basic(t *testing.T) { resourceName := "aws_opsworks_haproxy_layer.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(opsworks.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(opsworks.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, opsworks.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckHAProxyLayerDestroy(ctx), diff --git a/internal/service/opsworks/instance_test.go b/internal/service/opsworks/instance_test.go index d98f1f54eba4..38a102767744 100644 --- a/internal/service/opsworks/instance_test.go +++ b/internal/service/opsworks/instance_test.go @@ -23,7 +23,7 @@ func TestAccOpsWorksInstance_basic(t *testing.T) { dataSourceName := "data.aws_availability_zones.available" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(opsworks.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(opsworks.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, opsworks.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckInstanceDestroy(ctx), @@ -74,7 +74,7 @@ func TestAccOpsWorksInstance_updateHostNameForceNew(t *testing.T) { var before, after opsworks.Instance resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(opsworks.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(opsworks.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, opsworks.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckInstanceDestroy(ctx), diff --git a/internal/service/opsworks/java_app_layer_test.go b/internal/service/opsworks/java_app_layer_test.go index 867d6c1b0807..9d06c20e8a3f 100644 --- a/internal/service/opsworks/java_app_layer_test.go +++ b/internal/service/opsworks/java_app_layer_test.go @@ -18,7 +18,7 @@ func TestAccOpsWorksJavaAppLayer_basic(t *testing.T) { resourceName := "aws_opsworks_java_app_layer.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(opsworks.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(opsworks.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, opsworks.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckJavaAppLayerDestroy(ctx), diff --git a/internal/service/opsworks/memcached_layer_test.go b/internal/service/opsworks/memcached_layer_test.go index 004b7f718857..f14173567183 100644 --- a/internal/service/opsworks/memcached_layer_test.go +++ b/internal/service/opsworks/memcached_layer_test.go @@ -18,7 +18,7 @@ func TestAccOpsWorksMemcachedLayer_basic(t *testing.T) { resourceName := "aws_opsworks_memcached_layer.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(opsworks.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(opsworks.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, opsworks.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckMemcachedLayerDestroy(ctx), diff --git a/internal/service/opsworks/mysql_layer_test.go b/internal/service/opsworks/mysql_layer_test.go index 5f898bab0753..ef45594b720f 100644 --- a/internal/service/opsworks/mysql_layer_test.go +++ b/internal/service/opsworks/mysql_layer_test.go @@ -18,7 +18,7 @@ func TestAccOpsWorksMySQLLayer_basic(t *testing.T) { resourceName := "aws_opsworks_mysql_layer.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(opsworks.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(opsworks.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, opsworks.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckMySQLLayerDestroy(ctx), diff --git a/internal/service/opsworks/nodejs_app_layer_test.go b/internal/service/opsworks/nodejs_app_layer_test.go index 1abbbf06f0c7..196e2282fd81 100644 --- a/internal/service/opsworks/nodejs_app_layer_test.go +++ b/internal/service/opsworks/nodejs_app_layer_test.go @@ -18,7 +18,7 @@ func TestAccOpsWorksNodejsAppLayer_basic(t *testing.T) { resourceName := "aws_opsworks_nodejs_app_layer.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(opsworks.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(opsworks.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, opsworks.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckNodejsAppLayerDestroy(ctx), diff --git a/internal/service/opsworks/permission_test.go b/internal/service/opsworks/permission_test.go index 08091f65002b..05f7cf711d0e 100644 --- a/internal/service/opsworks/permission_test.go +++ b/internal/service/opsworks/permission_test.go @@ -21,7 +21,7 @@ func TestAccOpsWorksPermission_basic(t *testing.T) { var opsperm opsworks.Permission resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(opsworks.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(opsworks.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, opsworks.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: acctest.CheckDestroyNoop, @@ -74,7 +74,7 @@ func TestAccOpsWorksPermission_self(t *testing.T) { resourceName := "aws_opsworks_permission.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(opsworks.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(opsworks.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, opsworks.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: acctest.CheckDestroyNoop, diff --git a/internal/service/opsworks/php_app_layer_test.go b/internal/service/opsworks/php_app_layer_test.go index 8e3bee8222bc..7f1eedbe47ae 100644 --- a/internal/service/opsworks/php_app_layer_test.go +++ b/internal/service/opsworks/php_app_layer_test.go @@ -18,7 +18,7 @@ func TestAccOpsWorksPHPAppLayer_basic(t *testing.T) { resourceName := "aws_opsworks_php_app_layer.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(opsworks.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(opsworks.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, opsworks.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckPHPAppLayerDestroy(ctx), diff --git a/internal/service/opsworks/rails_app_layer_test.go b/internal/service/opsworks/rails_app_layer_test.go index c17b835161a6..b2693f48bd50 100644 --- a/internal/service/opsworks/rails_app_layer_test.go +++ b/internal/service/opsworks/rails_app_layer_test.go @@ -22,7 +22,7 @@ func TestAccOpsWorksRailsAppLayer_basic(t *testing.T) { resourceName := "aws_opsworks_rails_app_layer.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(opsworks.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(opsworks.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, opsworks.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRailsAppLayerDestroy(ctx), @@ -78,7 +78,7 @@ func TestAccOpsWorksRailsAppLayer_disappears(t *testing.T) { resourceName := "aws_opsworks_rails_app_layer.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(opsworks.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(opsworks.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, opsworks.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRailsAppLayerDestroy(ctx), @@ -102,7 +102,7 @@ func TestAccOpsWorksRailsAppLayer_tags(t *testing.T) { resourceName := "aws_opsworks_rails_app_layer.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(opsworks.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(opsworks.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, opsworks.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRailsAppLayerDestroy(ctx), @@ -144,7 +144,7 @@ func TestAccOpsWorksRailsAppLayer_tagsAlternateRegion(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(opsworks.EndpointsID, t) // This test requires a very particular AWS Region configuration // in order to exercise the OpsWorks classic endpoint functionality. @@ -192,7 +192,7 @@ func TestAccOpsWorksRailsAppLayer_update(t *testing.T) { resourceName := "aws_opsworks_rails_app_layer.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(opsworks.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(opsworks.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, opsworks.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRailsAppLayerDestroy(ctx), @@ -239,7 +239,7 @@ func TestAccOpsWorksRailsAppLayer_elb(t *testing.T) { resourceName := "aws_opsworks_rails_app_layer.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(opsworks.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(opsworks.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, opsworks.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRailsAppLayerDestroy(ctx), diff --git a/internal/service/opsworks/rds_db_instance_test.go b/internal/service/opsworks/rds_db_instance_test.go index ca3da0840fb3..e08f5f5acd9d 100644 --- a/internal/service/opsworks/rds_db_instance_test.go +++ b/internal/service/opsworks/rds_db_instance_test.go @@ -26,7 +26,7 @@ func TestAccOpsWorksRDSDBInstance_basic(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(opsworks.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(opsworks.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, opsworks.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRDSDBInstanceDestroy(ctx), @@ -70,7 +70,7 @@ func TestAccOpsWorksRDSDBInstance_disappears(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(opsworks.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(opsworks.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, opsworks.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRDSDBInstanceDestroy(ctx), diff --git a/internal/service/opsworks/stack_test.go b/internal/service/opsworks/stack_test.go index 59843bc982ba..7e19870bd892 100644 --- a/internal/service/opsworks/stack_test.go +++ b/internal/service/opsworks/stack_test.go @@ -26,7 +26,7 @@ func TestAccOpsWorksStack_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(opsworks.EndpointsID, t) testAccPreCheckStacks(ctx, t) }, @@ -81,7 +81,7 @@ func TestAccOpsWorksStack_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(opsworks.EndpointsID, t) testAccPreCheckStacks(ctx, t) }, @@ -109,7 +109,7 @@ func TestAccOpsWorksStack_noVPC_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(opsworks.EndpointsID, t) testAccPreCheckStacks(ctx, t) }, @@ -151,7 +151,7 @@ func TestAccOpsWorksStack_noVPC_defaultAZ(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(opsworks.EndpointsID, t) testAccPreCheckStacks(ctx, t) }, @@ -185,7 +185,7 @@ func TestAccOpsWorksStack_tags(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(opsworks.EndpointsID, t) testAccPreCheckStacks(ctx, t) }, @@ -235,7 +235,7 @@ func TestAccOpsWorksStack_tagsAlternateRegion(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(opsworks.EndpointsID, t) testAccPreCheckStacks(ctx, t) // This test requires a very particular AWS Region configuration @@ -306,7 +306,7 @@ func TestAccOpsWorksStack_allAttributes(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(opsworks.EndpointsID, t) testAccPreCheckStacks(ctx, t) }, @@ -442,7 +442,7 @@ func TestAccOpsWorksStack_windows(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(opsworks.EndpointsID, t) testAccPreCheckStacks(ctx, t) }, diff --git a/internal/service/opsworks/static_web_layer_test.go b/internal/service/opsworks/static_web_layer_test.go index e2b665505f7c..6eee9d181a20 100644 --- a/internal/service/opsworks/static_web_layer_test.go +++ b/internal/service/opsworks/static_web_layer_test.go @@ -18,7 +18,7 @@ func TestAccOpsWorksStaticWebLayer_basic(t *testing.T) { resourceName := "aws_opsworks_static_web_layer.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(opsworks.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(opsworks.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, opsworks.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckStaticWebLayerDestroy(ctx), diff --git a/internal/service/opsworks/user_profile_test.go b/internal/service/opsworks/user_profile_test.go index 209420a2a40b..53417bcdb036 100644 --- a/internal/service/opsworks/user_profile_test.go +++ b/internal/service/opsworks/user_profile_test.go @@ -22,7 +22,7 @@ func TestAccOpsWorksUserProfile_basic(t *testing.T) { resourceName := "aws_opsworks_user_profile.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(opsworks.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(opsworks.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, opsworks.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckUserProfileDestroy(ctx), @@ -55,7 +55,7 @@ func TestAccOpsWorksUserProfile_disappears(t *testing.T) { resourceName := "aws_opsworks_user_profile.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(opsworks.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(opsworks.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, opsworks.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckUserProfileDestroy(ctx), From 04e30a37704c4c7ab5e432445febe9ff5fc8cadb Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Fri, 24 Feb 2023 16:37:16 -0500 Subject: [PATCH 205/763] Add 'Context' argument to 'acctest.PreCheck' for organizations. --- .../service/organizations/account_test.go | 10 ++++----- .../delegated_administrator_test.go | 4 ++-- ...legated_administrators_data_source_test.go | 8 +++---- .../delegated_services_data_source_test.go | 6 ++--- .../organization_data_source_test.go | 2 +- .../organizations/organization_test.go | 12 +++++----- ...al_unit_child_accounts_data_source_test.go | 2 +- ...it_descendant_accounts_data_source_test.go | 2 +- .../organizations/organizational_unit_test.go | 8 +++---- .../organizational_units_data_source_test.go | 2 +- .../organizations/policy_attachment_test.go | 10 ++++----- internal/service/organizations/policy_test.go | 22 +++++++++---------- .../resource_tags_data_source_test.go | 2 +- 13 files changed, 45 insertions(+), 45 deletions(-) diff --git a/internal/service/organizations/account_test.go b/internal/service/organizations/account_test.go index b9395a266171..f1ebba0d559e 100644 --- a/internal/service/organizations/account_test.go +++ b/internal/service/organizations/account_test.go @@ -44,7 +44,7 @@ func testAccAccount_basic(t *testing.T) { email := fmt.Sprintf("tf-acctest+%d@%s", rInt, orgsEmailDomain) resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckOrganizationsEnabled(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckOrganizationsEnabled(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, organizations.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckAccountDestroy(ctx), @@ -83,7 +83,7 @@ func testAccAccount_CloseOnDeletion(t *testing.T) { email := fmt.Sprintf("tf-acctest+%d@%s", rInt, orgsEmailDomain) resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckOrganizationsEnabled(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckOrganizationsEnabled(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, organizations.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckAccountDestroy(ctx), @@ -125,7 +125,7 @@ func testAccAccount_ParentID(t *testing.T) { parentIdResourceName2 := "aws_organizations_organizational_unit.test2" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckOrganizationsAccount(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckOrganizationsAccount(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, organizations.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckAccountDestroy(ctx), @@ -164,7 +164,7 @@ func testAccAccount_Tags(t *testing.T) { resourceName := "aws_organizations_account.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckOrganizationsAccount(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckOrganizationsAccount(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, organizations.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckAccountDestroy(ctx), @@ -214,7 +214,7 @@ func testAccAccount_govCloud(t *testing.T) { email := fmt.Sprintf("tf-acctest+%d@%s", rInt, orgsEmailDomain) resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckOrganizationsEnabled(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckOrganizationsEnabled(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, organizations.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckAccountDestroy(ctx), diff --git a/internal/service/organizations/delegated_administrator_test.go b/internal/service/organizations/delegated_administrator_test.go index 15a56cd58da0..e8c99e0a9d09 100644 --- a/internal/service/organizations/delegated_administrator_test.go +++ b/internal/service/organizations/delegated_administrator_test.go @@ -23,7 +23,7 @@ func testAccDelegatedAdministrator_basic(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckAlternateAccount(t) }, ErrorCheck: acctest.ErrorCheck(t, organizations.EndpointsID), @@ -57,7 +57,7 @@ func testAccDelegatedAdministrator_disappears(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckAlternateAccount(t) }, ProtoV5ProviderFactories: acctest.ProtoV5FactoriesAlternate(ctx, t), diff --git a/internal/service/organizations/delegated_administrators_data_source_test.go b/internal/service/organizations/delegated_administrators_data_source_test.go index 544b2a41cdf3..746ebb4dc1db 100644 --- a/internal/service/organizations/delegated_administrators_data_source_test.go +++ b/internal/service/organizations/delegated_administrators_data_source_test.go @@ -17,7 +17,7 @@ func TestAccOrganizationsDelegatedAdministratorsDataSource_basic(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckAlternateAccount(t) }, ErrorCheck: acctest.ErrorCheck(t, organizations.EndpointsID), @@ -45,7 +45,7 @@ func TestAccOrganizationsDelegatedAdministratorsDataSource_multiple(t *testing.T resource.Test(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckAlternateAccount(t) }, ErrorCheck: acctest.ErrorCheck(t, organizations.EndpointsID), @@ -72,7 +72,7 @@ func TestAccOrganizationsDelegatedAdministratorsDataSource_servicePrincipal(t *t resource.Test(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckAlternateAccount(t) }, ErrorCheck: acctest.ErrorCheck(t, organizations.EndpointsID), @@ -96,7 +96,7 @@ func TestAccOrganizationsDelegatedAdministratorsDataSource_empty(t *testing.T) { servicePrincipal := "config-multiaccountsetup.amazonaws.com" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, organizations.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ diff --git a/internal/service/organizations/delegated_services_data_source_test.go b/internal/service/organizations/delegated_services_data_source_test.go index c9fcb3d24f35..dc51a47c3cc7 100644 --- a/internal/service/organizations/delegated_services_data_source_test.go +++ b/internal/service/organizations/delegated_services_data_source_test.go @@ -17,7 +17,7 @@ func TestAccOrganizationsDelegatedServicesDataSource_basic(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckAlternateAccount(t) }, ErrorCheck: acctest.ErrorCheck(t, organizations.EndpointsID), @@ -43,7 +43,7 @@ func TestAccOrganizationsDelegatedServicesDataSource_empty(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckAlternateAccount(t) }, ErrorCheck: acctest.ErrorCheck(t, organizations.EndpointsID), @@ -69,7 +69,7 @@ func TestAccOrganizationsDelegatedServicesDataSource_multiple(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckAlternateAccount(t) }, ErrorCheck: acctest.ErrorCheck(t, organizations.EndpointsID), diff --git a/internal/service/organizations/organization_data_source_test.go b/internal/service/organizations/organization_data_source_test.go index a64601b65077..de21be26bf2c 100644 --- a/internal/service/organizations/organization_data_source_test.go +++ b/internal/service/organizations/organization_data_source_test.go @@ -15,7 +15,7 @@ func testAccOrganizationDataSource_basic(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckOrganizationsAccount(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, organizations.EndpointsID), diff --git a/internal/service/organizations/organization_test.go b/internal/service/organizations/organization_test.go index a1c29285df34..f94535ccd520 100644 --- a/internal/service/organizations/organization_test.go +++ b/internal/service/organizations/organization_test.go @@ -22,7 +22,7 @@ func testAccOrganization_basic(t *testing.T) { resourceName := "aws_organizations_organization.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckOrganizationsAccount(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckOrganizationsAccount(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, organizations.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckOrganizationDestroy(ctx), @@ -64,7 +64,7 @@ func testAccOrganization_serviceAccessPrincipals(t *testing.T) { resourceName := "aws_organizations_organization.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckOrganizationsAccount(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckOrganizationsAccount(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, organizations.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckOrganizationDestroy(ctx), @@ -109,7 +109,7 @@ func testAccOrganization_EnabledPolicyTypes(t *testing.T) { resourceName := "aws_organizations_organization.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckOrganizationsAccount(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckOrganizationsAccount(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, organizations.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckOrganizationDestroy(ctx), @@ -195,7 +195,7 @@ func testAccOrganization_FeatureSet(t *testing.T) { resourceName := "aws_organizations_organization.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckOrganizationsAccount(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckOrganizationsAccount(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, organizations.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckOrganizationDestroy(ctx), @@ -222,7 +222,7 @@ func testAccOrganization_FeatureSetForcesNew(t *testing.T) { resourceName := "aws_organizations_organization.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckOrganizationsAccount(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckOrganizationsAccount(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, organizations.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckOrganizationDestroy(ctx), @@ -257,7 +257,7 @@ func testAccOrganization_FeatureSetUpdate(t *testing.T) { resourceName := "aws_organizations_organization.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckOrganizationsAccount(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckOrganizationsAccount(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, organizations.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckOrganizationDestroy(ctx), 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 9b12fd748d17..f406ce388665 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 @@ -14,7 +14,7 @@ func testAccOrganizationalUnitChildAccountsDataSource_basic(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckOrganizationManagementAccount(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, organizations.EndpointsID), 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 fe0fb8d9ea84..ca388782d0ac 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 @@ -19,7 +19,7 @@ func testAccOrganizationalUnitDescendantAccountsDataSource_basic(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckOrganizationManagementAccount(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, organizations.EndpointsID), diff --git a/internal/service/organizations/organizational_unit_test.go b/internal/service/organizations/organizational_unit_test.go index 1b7360449ebf..936cb8d255d4 100644 --- a/internal/service/organizations/organizational_unit_test.go +++ b/internal/service/organizations/organizational_unit_test.go @@ -25,7 +25,7 @@ func testAccOrganizationalUnit_basic(t *testing.T) { resourceName := "aws_organizations_organizational_unit.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckOrganizationsAccount(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckOrganizationsAccount(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, organizations.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckOrganizationalUnitDestroy(ctx), @@ -58,7 +58,7 @@ func testAccOrganizationalUnit_disappears(t *testing.T) { resourceName := "aws_organizations_organizational_unit.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckOrganizationsAccount(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckOrganizationsAccount(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, organizations.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckOrganizationalUnitDestroy(ctx), @@ -85,7 +85,7 @@ func testAccOrganizationalUnit_Name(t *testing.T) { resourceName := "aws_organizations_organizational_unit.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckOrganizationsAccount(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckOrganizationsAccount(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, organizations.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckOrganizationalUnitDestroy(ctx), @@ -122,7 +122,7 @@ func testAccOrganizationalUnit_Tags(t *testing.T) { resourceName := "aws_organizations_organizational_unit.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckOrganizationsAccount(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckOrganizationsAccount(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, organizations.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckOrganizationalUnitDestroy(ctx), diff --git a/internal/service/organizations/organizational_units_data_source_test.go b/internal/service/organizations/organizational_units_data_source_test.go index a05b959b8c51..cdb100797a2c 100644 --- a/internal/service/organizations/organizational_units_data_source_test.go +++ b/internal/service/organizations/organizational_units_data_source_test.go @@ -15,7 +15,7 @@ func testAccOrganizationalUnitsDataSource_basic(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckOrganizationManagementAccount(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, organizations.EndpointsID), diff --git a/internal/service/organizations/policy_attachment_test.go b/internal/service/organizations/policy_attachment_test.go index 736ddabe23b4..fcf4abee3fe2 100644 --- a/internal/service/organizations/policy_attachment_test.go +++ b/internal/service/organizations/policy_attachment_test.go @@ -28,7 +28,7 @@ func testAccPolicyAttachment_Account(t *testing.T) { tagPolicyContent := `{ "tags": { "Product": { "tag_key": { "@@assign": "Product" }, "enforced_for": { "@@assign": [ "ec2:instance" ] } } } }` resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckOrganizationsAccount(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckOrganizationsAccount(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, organizations.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckPolicyAttachmentDestroy(ctx), @@ -67,7 +67,7 @@ func testAccPolicyAttachment_OrganizationalUnit(t *testing.T) { targetIdResourceName := "aws_organizations_organizational_unit.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckOrganizationsAccount(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckOrganizationsAccount(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, organizations.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckPolicyAttachmentDestroy(ctx), @@ -98,7 +98,7 @@ func testAccPolicyAttachment_Root(t *testing.T) { targetIdResourceName := "aws_organizations_organization.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckOrganizationsAccount(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckOrganizationsAccount(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, organizations.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckPolicyAttachmentDestroy(ctx), @@ -131,7 +131,7 @@ func testAccPolicyAttachment_skipDestroy(t *testing.T) { serviceControlPolicyContent := `{"Version": "2012-10-17", "Statement": { "Effect": "Allow", "Action": "*", "Resource": "*"}}` resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckOrganizationsAccount(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckOrganizationsAccount(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, organizations.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckPolicyAttachmentNoDestroy(ctx), @@ -155,7 +155,7 @@ func testAccPolicyAttachment_disappears(t *testing.T) { resourceName := "aws_organizations_policy_attachment.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckOrganizationsAccount(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckOrganizationsAccount(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, organizations.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckPolicyAttachmentDestroy(ctx), diff --git a/internal/service/organizations/policy_test.go b/internal/service/organizations/policy_test.go index 5684f67acef5..b751448b0cb3 100644 --- a/internal/service/organizations/policy_test.go +++ b/internal/service/organizations/policy_test.go @@ -26,7 +26,7 @@ func testAccPolicy_basic(t *testing.T) { resourceName := "aws_organizations_policy.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckOrganizationsAccount(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckOrganizationsAccount(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, organizations.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckPolicyDestroy(ctx), @@ -71,7 +71,7 @@ func testAccPolicy_concurrent(t *testing.T) { resourceName5 := "aws_organizations_policy.test5" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckOrganizationsAccount(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckOrganizationsAccount(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, organizations.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckPolicyDestroy(ctx), @@ -97,7 +97,7 @@ func testAccPolicy_description(t *testing.T) { resourceName := "aws_organizations_policy.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckOrganizationsAccount(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckOrganizationsAccount(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, organizations.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckPolicyDestroy(ctx), @@ -133,7 +133,7 @@ func testAccPolicy_tags(t *testing.T) { resourceName := "aws_organizations_policy.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckOrganizationsAccount(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckOrganizationsAccount(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, organizations.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckPolicyDestroy(ctx), @@ -189,7 +189,7 @@ func testAccPolicy_skipDestroy(t *testing.T) { resourceName := "aws_organizations_policy.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckOrganizationsAccount(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckOrganizationsAccount(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, organizations.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckPolicyNoDestroy(ctx), @@ -217,7 +217,7 @@ func testAccPolicy_disappears(t *testing.T) { resourceName := "aws_organizations_policy.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckOrganizationsAccount(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckOrganizationsAccount(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, organizations.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckPolicyDestroy(ctx), @@ -243,7 +243,7 @@ func testAccPolicy_type_AI_OPT_OUT(t *testing.T) { AiOptOutPolicyContent := `{ "services": { "rekognition": { "opt_out_policy": { "@@assign": "optOut" } }, "lex": { "opt_out_policy": { "@@assign": "optIn" } } } }` resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckOrganizationsAccount(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckOrganizationsAccount(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, organizations.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckPolicyDestroy(ctx), @@ -342,7 +342,7 @@ func testAccPolicy_type_Backup(t *testing.T) { }`, acctest.AlternateRegion(), acctest.Region(), acctest.Partition()) resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckOrganizationsAccount(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckOrganizationsAccount(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, organizations.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckPolicyDestroy(ctx), @@ -372,7 +372,7 @@ func testAccPolicy_type_SCP(t *testing.T) { serviceControlPolicyContent := `{"Version": "2012-10-17", "Statement": { "Effect": "Allow", "Action": "*", "Resource": "*"}}` resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckOrganizationsAccount(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckOrganizationsAccount(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, organizations.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckPolicyDestroy(ctx), @@ -409,7 +409,7 @@ func testAccPolicy_type_Tag(t *testing.T) { tagPolicyContent := `{ "tags": { "Product": { "tag_key": { "@@assign": "Product" }, "enforced_for": { "@@assign": [ "ec2:instance" ] } } } }` resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckOrganizationsAccount(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckOrganizationsAccount(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, organizations.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckPolicyDestroy(ctx), @@ -438,7 +438,7 @@ func testAccPolicy_importManagedPolicy(t *testing.T) { resourceID := "p-FullAWSAccess" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckOrganizationsAccount(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckOrganizationsAccount(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, organizations.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckPolicyDestroy(ctx), diff --git a/internal/service/organizations/resource_tags_data_source_test.go b/internal/service/organizations/resource_tags_data_source_test.go index 59055acb3ba7..dbe1173fa10b 100644 --- a/internal/service/organizations/resource_tags_data_source_test.go +++ b/internal/service/organizations/resource_tags_data_source_test.go @@ -17,7 +17,7 @@ func testAccResourceTagsDataSource_basic(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckOrganizationsAccount(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckOrganizationsAccount(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, organizations.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ From be176fa08c29b30c9eabb08e0eb8cafdb7054e9b Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Fri, 24 Feb 2023 16:37:17 -0500 Subject: [PATCH 206/763] Add 'Context' argument to 'acctest.PreCheck' for outposts. --- .../service/outposts/outpost_asset_data_source_test.go | 2 +- .../service/outposts/outpost_assets_data_source_test.go | 6 +++--- internal/service/outposts/outpost_data_source_test.go | 8 ++++---- .../outposts/outpost_instance_type_data_source_test.go | 4 ++-- .../outposts/outpost_instance_types_data_source_test.go | 2 +- internal/service/outposts/outposts_data_source_test.go | 2 +- internal/service/outposts/site_data_source_test.go | 4 ++-- internal/service/outposts/sites_data_source_test.go | 2 +- 8 files changed, 15 insertions(+), 15 deletions(-) diff --git a/internal/service/outposts/outpost_asset_data_source_test.go b/internal/service/outposts/outpost_asset_data_source_test.go index b311b7e1b32a..bb4437e42cab 100644 --- a/internal/service/outposts/outpost_asset_data_source_test.go +++ b/internal/service/outposts/outpost_asset_data_source_test.go @@ -14,7 +14,7 @@ func TestAccOutpostsAssetDataSource_basic(t *testing.T) { dataSourceName := "data.aws_outposts_asset.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckOutpostsOutposts(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckOutpostsOutposts(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, outposts.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ diff --git a/internal/service/outposts/outpost_assets_data_source_test.go b/internal/service/outposts/outpost_assets_data_source_test.go index a54cce601884..3f0b822d85c0 100644 --- a/internal/service/outposts/outpost_assets_data_source_test.go +++ b/internal/service/outposts/outpost_assets_data_source_test.go @@ -21,7 +21,7 @@ func TestAccOutpostsAssetsDataSource_id(t *testing.T) { dataSourceName := "data.aws_outposts_assets.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckOutpostsOutposts(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckOutpostsOutposts(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, outposts.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ @@ -45,7 +45,7 @@ func TestAccOutpostsAssetsDataSource_statusFilter(t *testing.T) { dataSourceName := "data.aws_outposts_assets.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckOutpostsOutposts(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckOutpostsOutposts(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, outposts.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ @@ -69,7 +69,7 @@ func TestAccOutpostsAssetsDataSource_hostFilter(t *testing.T) { dataSourceName := "data.aws_outposts_assets.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckOutpostsOutposts(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckOutpostsOutposts(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, outposts.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ diff --git a/internal/service/outposts/outpost_data_source_test.go b/internal/service/outposts/outpost_data_source_test.go index dfa3d9812392..58e52444e1fd 100644 --- a/internal/service/outposts/outpost_data_source_test.go +++ b/internal/service/outposts/outpost_data_source_test.go @@ -14,7 +14,7 @@ func TestAccOutpostsOutpostDataSource_id(t *testing.T) { dataSourceName := "data.aws_outposts_outpost.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckOutpostsOutposts(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckOutpostsOutposts(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, outposts.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: nil, @@ -41,7 +41,7 @@ func TestAccOutpostsOutpostDataSource_name(t *testing.T) { dataSourceName := "data.aws_outposts_outpost.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckOutpostsOutposts(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckOutpostsOutposts(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, outposts.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: nil, @@ -68,7 +68,7 @@ func TestAccOutpostsOutpostDataSource_arn(t *testing.T) { dataSourceName := "data.aws_outposts_outpost.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckOutpostsOutposts(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckOutpostsOutposts(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, outposts.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: nil, @@ -95,7 +95,7 @@ func TestAccOutpostsOutpostDataSource_ownerID(t *testing.T) { dataSourceName := "data.aws_outposts_outpost.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckOutpostsOutposts(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckOutpostsOutposts(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, outposts.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: nil, 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 7fb43ed058cc..88b7b58ec75a 100644 --- a/internal/service/outposts/outpost_instance_type_data_source_test.go +++ b/internal/service/outposts/outpost_instance_type_data_source_test.go @@ -14,7 +14,7 @@ func TestAccOutpostsOutpostInstanceTypeDataSource_instanceType(t *testing.T) { dataSourceName := "data.aws_outposts_outpost_instance_type.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckOutpostsOutposts(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckOutpostsOutposts(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, outposts.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: nil, @@ -34,7 +34,7 @@ func TestAccOutpostsOutpostInstanceTypeDataSource_preferredInstanceTypes(t *test dataSourceName := "data.aws_outposts_outpost_instance_type.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckOutpostsOutposts(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckOutpostsOutposts(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, outposts.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: nil, 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 b47153d82e37..15885e6097a3 100644 --- a/internal/service/outposts/outpost_instance_types_data_source_test.go +++ b/internal/service/outposts/outpost_instance_types_data_source_test.go @@ -15,7 +15,7 @@ func TestAccOutpostsOutpostInstanceTypesDataSource_basic(t *testing.T) { dataSourceName := "data.aws_outposts_outpost_instance_types.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckOutpostsOutposts(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckOutpostsOutposts(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, outposts.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: nil, diff --git a/internal/service/outposts/outposts_data_source_test.go b/internal/service/outposts/outposts_data_source_test.go index c1affd44205a..f29d812a0162 100644 --- a/internal/service/outposts/outposts_data_source_test.go +++ b/internal/service/outposts/outposts_data_source_test.go @@ -15,7 +15,7 @@ func TestAccOutpostsDataSource_basic(t *testing.T) { dataSourceName := "data.aws_outposts_outposts.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckOutpostsOutposts(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckOutpostsOutposts(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, outposts.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: nil, diff --git a/internal/service/outposts/site_data_source_test.go b/internal/service/outposts/site_data_source_test.go index fb315203c8dd..b7507384f709 100644 --- a/internal/service/outposts/site_data_source_test.go +++ b/internal/service/outposts/site_data_source_test.go @@ -14,7 +14,7 @@ func TestAccOutpostsSiteDataSource_id(t *testing.T) { dataSourceName := "data.aws_outposts_site.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckSites(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckSites(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, outposts.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: nil, @@ -38,7 +38,7 @@ func TestAccOutpostsSiteDataSource_name(t *testing.T) { dataSourceName := "data.aws_outposts_site.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckSites(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckSites(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, outposts.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: nil, diff --git a/internal/service/outposts/sites_data_source_test.go b/internal/service/outposts/sites_data_source_test.go index 4eea37d7fa3f..6cd145995c8d 100644 --- a/internal/service/outposts/sites_data_source_test.go +++ b/internal/service/outposts/sites_data_source_test.go @@ -17,7 +17,7 @@ func TestAccOutpostsSitesDataSource_basic(t *testing.T) { dataSourceName := "data.aws_outposts_sites.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckSites(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckSites(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, outposts.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: nil, From 047d8b8fe498355d88139b83ce6f3044483e30b5 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Fri, 24 Feb 2023 16:37:17 -0500 Subject: [PATCH 207/763] Add 'Context' argument to 'acctest.PreCheck' for pinpoint. --- internal/service/pinpoint/adm_channel_test.go | 2 +- internal/service/pinpoint/apns_channel_test.go | 4 ++-- internal/service/pinpoint/apns_sandbox_channel_test.go | 4 ++-- internal/service/pinpoint/apns_voip_channel_test.go | 4 ++-- .../service/pinpoint/apns_voip_sandbox_channel_test.go | 4 ++-- internal/service/pinpoint/app_test.go | 10 +++++----- internal/service/pinpoint/baidu_channel_test.go | 2 +- internal/service/pinpoint/email_channel_test.go | 8 ++++---- internal/service/pinpoint/event_stream_test.go | 4 ++-- internal/service/pinpoint/gcm_channel_test.go | 2 +- internal/service/pinpoint/sms_channel_test.go | 6 +++--- 11 files changed, 25 insertions(+), 25 deletions(-) diff --git a/internal/service/pinpoint/adm_channel_test.go b/internal/service/pinpoint/adm_channel_test.go index 13941a948c82..e4c7f7c2bb5b 100644 --- a/internal/service/pinpoint/adm_channel_test.go +++ b/internal/service/pinpoint/adm_channel_test.go @@ -52,7 +52,7 @@ func TestAccPinpointADMChannel_basic(t *testing.T) { config := testAccADMChannelConfigurationFromEnv(t) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckApp(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckApp(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, pinpoint.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckADMChannelDestroy(ctx), diff --git a/internal/service/pinpoint/apns_channel_test.go b/internal/service/pinpoint/apns_channel_test.go index 18b6d29fe3af..4c4127415d9c 100644 --- a/internal/service/pinpoint/apns_channel_test.go +++ b/internal/service/pinpoint/apns_channel_test.go @@ -99,7 +99,7 @@ func TestAccPinpointAPNSChannel_basicCertificate(t *testing.T) { configuration := testAccAPNSChannelCertConfigurationFromEnv(t) resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckApp(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckApp(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, pinpoint.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckAPNSChannelDestroy(ctx), @@ -134,7 +134,7 @@ func TestAccPinpointAPNSChannel_basicToken(t *testing.T) { configuration := testAccAPNSChannelTokenConfigurationFromEnv(t) resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckApp(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckApp(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, pinpoint.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckAPNSChannelDestroy(ctx), diff --git a/internal/service/pinpoint/apns_sandbox_channel_test.go b/internal/service/pinpoint/apns_sandbox_channel_test.go index 5dad95d9c586..8a21e92163b7 100644 --- a/internal/service/pinpoint/apns_sandbox_channel_test.go +++ b/internal/service/pinpoint/apns_sandbox_channel_test.go @@ -99,7 +99,7 @@ func TestAccPinpointAPNSSandboxChannel_basicCertificate(t *testing.T) { configuration := testAccAPNSSandboxChannelCertConfigurationFromEnv(t) resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckApp(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckApp(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, pinpoint.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckAPNSSandboxChannelDestroy(ctx), @@ -134,7 +134,7 @@ func TestAccPinpointAPNSSandboxChannel_basicToken(t *testing.T) { configuration := testAccAPNSSandboxChannelTokenConfigurationFromEnv(t) resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckApp(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckApp(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, pinpoint.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckAPNSSandboxChannelDestroy(ctx), diff --git a/internal/service/pinpoint/apns_voip_channel_test.go b/internal/service/pinpoint/apns_voip_channel_test.go index 87c011155420..291899a19e92 100644 --- a/internal/service/pinpoint/apns_voip_channel_test.go +++ b/internal/service/pinpoint/apns_voip_channel_test.go @@ -99,7 +99,7 @@ func TestAccPinpointAPNSVoIPChannel_basicCertificate(t *testing.T) { configuration := testAccAPNSVoIPChannelCertConfigurationFromEnv(t) resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckApp(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckApp(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, pinpoint.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckAPNSVoIPChannelDestroy(ctx), @@ -134,7 +134,7 @@ func TestAccPinpointAPNSVoIPChannel_basicToken(t *testing.T) { configuration := testAccAPNSVoIPChannelTokenConfigurationFromEnv(t) resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckApp(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckApp(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, pinpoint.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckAPNSVoIPChannelDestroy(ctx), diff --git a/internal/service/pinpoint/apns_voip_sandbox_channel_test.go b/internal/service/pinpoint/apns_voip_sandbox_channel_test.go index cd11340fa0ef..1352a8edcc2c 100644 --- a/internal/service/pinpoint/apns_voip_sandbox_channel_test.go +++ b/internal/service/pinpoint/apns_voip_sandbox_channel_test.go @@ -99,7 +99,7 @@ func TestAccPinpointAPNSVoIPSandboxChannel_basicCertificate(t *testing.T) { configuration := testAccAPNSVoIPSandboxChannelCertConfigurationFromEnv(t) resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckApp(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckApp(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, pinpoint.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckAPNSVoIPSandboxChannelDestroy(ctx), @@ -134,7 +134,7 @@ func TestAccPinpointAPNSVoIPSandboxChannel_basicToken(t *testing.T) { configuration := testAccAPNSVoIPSandboxChannelTokenConfigurationFromEnv(t) resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckApp(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckApp(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, pinpoint.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckAPNSVoIPSandboxChannelDestroy(ctx), diff --git a/internal/service/pinpoint/app_test.go b/internal/service/pinpoint/app_test.go index cd0ae378358d..fdae28461cf6 100644 --- a/internal/service/pinpoint/app_test.go +++ b/internal/service/pinpoint/app_test.go @@ -22,7 +22,7 @@ func TestAccPinpointApp_basic(t *testing.T) { resourceName := "aws_pinpoint_app.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckApp(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckApp(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, pinpoint.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckAppDestroy(ctx), @@ -49,7 +49,7 @@ func TestAccPinpointApp_campaignHookLambda(t *testing.T) { resourceName := "aws_pinpoint_app.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckApp(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckApp(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, pinpoint.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckAppDestroy(ctx), @@ -78,7 +78,7 @@ func TestAccPinpointApp_limits(t *testing.T) { resourceName := "aws_pinpoint_app.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckApp(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckApp(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, pinpoint.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckAppDestroy(ctx), @@ -107,7 +107,7 @@ func TestAccPinpointApp_quietTime(t *testing.T) { resourceName := "aws_pinpoint_app.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckApp(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckApp(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, pinpoint.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckAppDestroy(ctx), @@ -136,7 +136,7 @@ func TestAccPinpointApp_tags(t *testing.T) { resourceName := "aws_pinpoint_app.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckApp(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckApp(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, pinpoint.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRAMResourceShareDestroy(ctx), diff --git a/internal/service/pinpoint/baidu_channel_test.go b/internal/service/pinpoint/baidu_channel_test.go index c5796f3cd612..9e6b3fdc7520 100644 --- a/internal/service/pinpoint/baidu_channel_test.go +++ b/internal/service/pinpoint/baidu_channel_test.go @@ -24,7 +24,7 @@ func TestAccPinpointBaiduChannel_basic(t *testing.T) { secretKey := "456" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckApp(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckApp(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, pinpoint.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckBaiduChannelDestroy(ctx), diff --git a/internal/service/pinpoint/email_channel_test.go b/internal/service/pinpoint/email_channel_test.go index 99726ebee7e0..486e7986d627 100644 --- a/internal/service/pinpoint/email_channel_test.go +++ b/internal/service/pinpoint/email_channel_test.go @@ -26,7 +26,7 @@ func TestAccPinpointEmailChannel_basic(t *testing.T) { address2 := acctest.RandomEmailAddress(domain) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckApp(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckApp(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, pinpoint.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckEmailChannelDestroy(ctx), @@ -70,7 +70,7 @@ func TestAccPinpointEmailChannel_set(t *testing.T) { address := acctest.RandomEmailAddress(domain) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckApp(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckApp(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, pinpoint.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckEmailChannelDestroy(ctx), @@ -101,7 +101,7 @@ func TestAccPinpointEmailChannel_noRole(t *testing.T) { address := acctest.RandomEmailAddress(domain) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckApp(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckApp(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, pinpoint.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckEmailChannelDestroy(ctx), @@ -131,7 +131,7 @@ func TestAccPinpointEmailChannel_disappears(t *testing.T) { address := acctest.RandomEmailAddress(domain) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckApp(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckApp(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, pinpoint.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckEmailChannelDestroy(ctx), diff --git a/internal/service/pinpoint/event_stream_test.go b/internal/service/pinpoint/event_stream_test.go index a03693ea066b..d5efcbdf4cae 100644 --- a/internal/service/pinpoint/event_stream_test.go +++ b/internal/service/pinpoint/event_stream_test.go @@ -24,7 +24,7 @@ func TestAccPinpointEventStream_basic(t *testing.T) { rName2 := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckApp(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckApp(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, pinpoint.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckEventStreamDestroy(ctx), @@ -63,7 +63,7 @@ func TestAccPinpointEventStream_disappears(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckApp(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckApp(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, pinpoint.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckEventStreamDestroy(ctx), diff --git a/internal/service/pinpoint/gcm_channel_test.go b/internal/service/pinpoint/gcm_channel_test.go index 5ae278770684..6c546c240478 100644 --- a/internal/service/pinpoint/gcm_channel_test.go +++ b/internal/service/pinpoint/gcm_channel_test.go @@ -33,7 +33,7 @@ func TestAccPinpointGCMChannel_basic(t *testing.T) { apiKey := os.Getenv("GCM_API_KEY") resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckApp(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckApp(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, pinpoint.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckGCMChannelDestroy(ctx), diff --git a/internal/service/pinpoint/sms_channel_test.go b/internal/service/pinpoint/sms_channel_test.go index 9106b02abc34..f89264900bc2 100644 --- a/internal/service/pinpoint/sms_channel_test.go +++ b/internal/service/pinpoint/sms_channel_test.go @@ -21,7 +21,7 @@ func TestAccPinpointSMSChannel_basic(t *testing.T) { resourceName := "aws_pinpoint_sms_channel.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckApp(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckApp(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, pinpoint.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSMSChannelDestroy(ctx), @@ -67,7 +67,7 @@ func TestAccPinpointSMSChannel_full(t *testing.T) { newShortCode := "7890" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckApp(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckApp(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, pinpoint.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSMSChannelDestroy(ctx), @@ -118,7 +118,7 @@ func TestAccPinpointSMSChannel_disappears(t *testing.T) { resourceName := "aws_pinpoint_sms_channel.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckApp(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckApp(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, pinpoint.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSMSChannelDestroy(ctx), From b89f14dbf463fbee2688bd77e88566fd29507ade Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Fri, 24 Feb 2023 16:37:17 -0500 Subject: [PATCH 208/763] Add 'Context' argument to 'acctest.PreCheck' for pricing. --- internal/service/pricing/product_data_source_test.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/service/pricing/product_data_source_test.go b/internal/service/pricing/product_data_source_test.go index 4704892f8d39..f10de64a8c31 100644 --- a/internal/service/pricing/product_data_source_test.go +++ b/internal/service/pricing/product_data_source_test.go @@ -14,7 +14,7 @@ import ( func TestAccPricingProductDataSource_ec2(t *testing.T) { ctx := acctest.Context(t) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, pricing.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ @@ -32,7 +32,7 @@ func TestAccPricingProductDataSource_ec2(t *testing.T) { func TestAccPricingProductDataSource_redshift(t *testing.T) { ctx := acctest.Context(t) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, pricing.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ From 368cb6dd64fc9a9d9702121084486c74af2fb6b0 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Fri, 24 Feb 2023 16:37:18 -0500 Subject: [PATCH 209/763] Add 'Context' argument to 'acctest.PreCheck' for qldb. --- internal/service/qldb/ledger_data_source_test.go | 2 +- internal/service/qldb/ledger_test.go | 12 ++++++------ internal/service/qldb/stream_test.go | 8 ++++---- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/internal/service/qldb/ledger_data_source_test.go b/internal/service/qldb/ledger_data_source_test.go index 36ad9ae0bd3b..a2586eb9fe82 100644 --- a/internal/service/qldb/ledger_data_source_test.go +++ b/internal/service/qldb/ledger_data_source_test.go @@ -16,7 +16,7 @@ func TestAccQLDBLedgerDataSource_basic(t *testing.T) { datasourceName := "data.aws_qldb_ledger.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(qldb.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(qldb.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, qldb.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ diff --git a/internal/service/qldb/ledger_test.go b/internal/service/qldb/ledger_test.go index 1a6073a40eed..1336e363be15 100644 --- a/internal/service/qldb/ledger_test.go +++ b/internal/service/qldb/ledger_test.go @@ -23,7 +23,7 @@ func TestAccQLDBLedger_basic(t *testing.T) { resourceName := "aws_qldb_ledger.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(qldb.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(qldb.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, qldb.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckLedgerDestroy(ctx), @@ -56,7 +56,7 @@ func TestAccQLDBLedger_disappears(t *testing.T) { resourceName := "aws_qldb_ledger.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(qldb.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(qldb.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, qldb.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckLedgerDestroy(ctx), @@ -79,7 +79,7 @@ func TestAccQLDBLedger_nameGenerated(t *testing.T) { resourceName := "aws_qldb_ledger.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(qldb.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(qldb.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, qldb.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckLedgerDestroy(ctx), @@ -107,7 +107,7 @@ func TestAccQLDBLedger_update(t *testing.T) { resourceName := "aws_qldb_ledger.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(qldb.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(qldb.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, qldb.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckLedgerDestroy(ctx), @@ -153,7 +153,7 @@ func TestAccQLDBLedger_kmsKey(t *testing.T) { kmsKeyResourceName := "aws_kms_key.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(qldb.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(qldb.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, qldb.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckLedgerDestroy(ctx), @@ -188,7 +188,7 @@ func TestAccQLDBLedger_tags(t *testing.T) { resourceName := "aws_qldb_ledger.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(qldb.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(qldb.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, qldb.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckLedgerDestroy(ctx), diff --git a/internal/service/qldb/stream_test.go b/internal/service/qldb/stream_test.go index 356ec01cc8da..83b9ea057c8f 100644 --- a/internal/service/qldb/stream_test.go +++ b/internal/service/qldb/stream_test.go @@ -23,7 +23,7 @@ func TestAccQLDBStream_basic(t *testing.T) { resourceName := "aws_qldb_stream.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(qldb.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(qldb.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, qldb.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckStreamDestroy(ctx), @@ -55,7 +55,7 @@ func TestAccQLDBStream_disappears(t *testing.T) { resourceName := "aws_qldb_stream.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(qldb.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(qldb.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, qldb.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckStreamDestroy(ctx), @@ -79,7 +79,7 @@ func TestAccQLDBStream_tags(t *testing.T) { resourceName := "aws_qldb_stream.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(qldb.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(qldb.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, qldb.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckStreamDestroy(ctx), @@ -120,7 +120,7 @@ func TestAccQLDBStream_withEndTime(t *testing.T) { resourceName := "aws_qldb_stream.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(qldb.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(qldb.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, qldb.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckStreamDestroy(ctx), From 1a9fa3354f353c64620ca8bc74e0d329809b7518 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Fri, 24 Feb 2023 16:37:18 -0500 Subject: [PATCH 210/763] Add 'Context' argument to 'acctest.PreCheck' for quicksight. --- internal/service/quicksight/data_source_test.go | 8 ++++---- internal/service/quicksight/group_membership_test.go | 4 ++-- internal/service/quicksight/group_test.go | 6 +++--- internal/service/quicksight/user_test.go | 8 ++++---- 4 files changed, 13 insertions(+), 13 deletions(-) diff --git a/internal/service/quicksight/data_source_test.go b/internal/service/quicksight/data_source_test.go index 5dccbac35146..778b58e3f627 100644 --- a/internal/service/quicksight/data_source_test.go +++ b/internal/service/quicksight/data_source_test.go @@ -238,7 +238,7 @@ func TestAccQuickSightDataSource_basic(t *testing.T) { rId := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, ErrorCheck: acctest.ErrorCheck(t, quicksight.EndpointsID), CheckDestroy: testAccCheckDataSourceDestroy(ctx), @@ -276,7 +276,7 @@ func TestAccQuickSightDataSource_disappears(t *testing.T) { rId := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, ErrorCheck: acctest.ErrorCheck(t, quicksight.EndpointsID), CheckDestroy: testAccCheckDataSourceDestroy(ctx), @@ -301,7 +301,7 @@ func TestAccQuickSightDataSource_tags(t *testing.T) { rId := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, quicksight.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDataSourceDestroy(ctx), @@ -348,7 +348,7 @@ func TestAccQuickSightDataSource_permissions(t *testing.T) { rId := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, ErrorCheck: acctest.ErrorCheck(t, quicksight.EndpointsID), CheckDestroy: testAccCheckDataSourceDestroy(ctx), diff --git a/internal/service/quicksight/group_membership_test.go b/internal/service/quicksight/group_membership_test.go index 05d5edd48dfd..929e52cd5102 100644 --- a/internal/service/quicksight/group_membership_test.go +++ b/internal/service/quicksight/group_membership_test.go @@ -23,7 +23,7 @@ func TestAccQuickSightGroupMembership_basic(t *testing.T) { resourceName := "aws_quicksight_group_membership.default" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, quicksight.EndpointsID), CheckDestroy: testAccCheckGroupMembershipDestroy(ctx), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, @@ -50,7 +50,7 @@ func TestAccQuickSightGroupMembership_disappears(t *testing.T) { resourceName := "aws_quicksight_group_membership.default" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, quicksight.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckGroupMembershipDestroy(ctx), diff --git a/internal/service/quicksight/group_test.go b/internal/service/quicksight/group_test.go index 902bc518780d..bc73a4b4ea12 100644 --- a/internal/service/quicksight/group_test.go +++ b/internal/service/quicksight/group_test.go @@ -26,7 +26,7 @@ func TestAccQuickSightGroup_basic(t *testing.T) { rName2 := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, quicksight.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckGroupDestroy(ctx), @@ -63,7 +63,7 @@ func TestAccQuickSightGroup_withDescription(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, quicksight.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckGroupDestroy(ctx), @@ -98,7 +98,7 @@ func TestAccQuickSightGroup_disappears(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, quicksight.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckGroupDestroy(ctx), diff --git a/internal/service/quicksight/user_test.go b/internal/service/quicksight/user_test.go index 13c9e26c49a5..59f9e4eedc3a 100644 --- a/internal/service/quicksight/user_test.go +++ b/internal/service/quicksight/user_test.go @@ -28,7 +28,7 @@ func TestAccQuickSightUser_basic(t *testing.T) { resourceName2 := "aws_quicksight_user." + rName2 resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, quicksight.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckUserDestroy(ctx), @@ -60,7 +60,7 @@ func TestAccQuickSightUser_withInvalidFormattedEmailStillWorks(t *testing.T) { resourceName := "aws_quicksight_user." + rName resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, quicksight.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckUserDestroy(ctx), @@ -96,7 +96,7 @@ func TestAccQuickSightUser_withNamespace(t *testing.T) { resourceName := "aws_quicksight_user." + rName resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, quicksight.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckUserDestroy(ctx), @@ -119,7 +119,7 @@ func TestAccQuickSightUser_disappears(t *testing.T) { resourceName := "aws_quicksight_user." + rName resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, quicksight.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckUserDestroy(ctx), From cdd3ee8ba8796a69c61a107d9d9f14427e0ae1bd Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Fri, 24 Feb 2023 16:37:18 -0500 Subject: [PATCH 211/763] Add 'Context' argument to 'acctest.PreCheck' for ram. --- internal/service/ram/principal_association_test.go | 4 ++-- internal/service/ram/resource_association_test.go | 4 ++-- internal/service/ram/resource_share_accepter_test.go | 6 +++--- .../service/ram/resource_share_data_source_test.go | 6 +++--- internal/service/ram/resource_share_test.go | 12 ++++++------ 5 files changed, 16 insertions(+), 16 deletions(-) diff --git a/internal/service/ram/principal_association_test.go b/internal/service/ram/principal_association_test.go index 9fc3e2a6f33f..c25b8eb1706d 100644 --- a/internal/service/ram/principal_association_test.go +++ b/internal/service/ram/principal_association_test.go @@ -23,7 +23,7 @@ func TestAccRAMPrincipalAssociation_basic(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ram.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckPrincipalAssociationDestroy(ctx), @@ -50,7 +50,7 @@ func TestAccRAMPrincipalAssociation_disappears(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ram.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckPrincipalAssociationDestroy(ctx), diff --git a/internal/service/ram/resource_association_test.go b/internal/service/ram/resource_association_test.go index 2f21071aa18d..c78b7342d063 100644 --- a/internal/service/ram/resource_association_test.go +++ b/internal/service/ram/resource_association_test.go @@ -23,7 +23,7 @@ func TestAccRAMResourceAssociation_basic(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ram.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckResourceAssociationDestroy(ctx), @@ -50,7 +50,7 @@ func TestAccRAMResourceAssociation_disappears(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ram.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckResourceAssociationDestroy(ctx), diff --git a/internal/service/ram/resource_share_accepter_test.go b/internal/service/ram/resource_share_accepter_test.go index 42ff1ca536b0..0ef98a0a4975 100644 --- a/internal/service/ram/resource_share_accepter_test.go +++ b/internal/service/ram/resource_share_accepter_test.go @@ -26,7 +26,7 @@ func TestAccRAMResourceShareAccepter_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckAlternateAccount(t) }, ErrorCheck: acctest.ErrorCheck(t, ram.EndpointsID), @@ -64,7 +64,7 @@ func TestAccRAMResourceShareAccepter_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckAlternateAccount(t) }, ErrorCheck: acctest.ErrorCheck(t, ram.EndpointsID), @@ -91,7 +91,7 @@ func TestAccRAMResourceShareAccepter_resourceAssociation(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckAlternateAccount(t) }, ErrorCheck: acctest.ErrorCheck(t, ram.EndpointsID), diff --git a/internal/service/ram/resource_share_data_source_test.go b/internal/service/ram/resource_share_data_source_test.go index 7fc404b30af5..95fe02760046 100644 --- a/internal/service/ram/resource_share_data_source_test.go +++ b/internal/service/ram/resource_share_data_source_test.go @@ -17,7 +17,7 @@ func TestAccRAMResourceShareDataSource_basic(t *testing.T) { datasourceName := "data.aws_ram_resource_share.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ram.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ @@ -43,7 +43,7 @@ func TestAccRAMResourceShareDataSource_tags(t *testing.T) { datasourceName := "data.aws_ram_resource_share.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ram.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ @@ -65,7 +65,7 @@ func TestAccRAMResourceShareDataSource_status(t *testing.T) { datasourceName := "data.aws_ram_resource_share.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ram.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ diff --git a/internal/service/ram/resource_share_test.go b/internal/service/ram/resource_share_test.go index 01de9b1b2327..6754c5c58631 100644 --- a/internal/service/ram/resource_share_test.go +++ b/internal/service/ram/resource_share_test.go @@ -23,7 +23,7 @@ func TestAccRAMResourceShare_basic(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ram.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckResourceShareDestroy(ctx), @@ -55,7 +55,7 @@ func TestAccRAMResourceShare_permission(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ram.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckResourceShareDestroy(ctx), @@ -87,7 +87,7 @@ func TestAccRAMResourceShare_allowExternalPrincipals(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ram.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckResourceShareDestroy(ctx), @@ -123,7 +123,7 @@ func TestAccRAMResourceShare_name(t *testing.T) { rName2 := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ram.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckResourceShareDestroy(ctx), @@ -158,7 +158,7 @@ func TestAccRAMResourceShare_tags(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ram.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckResourceShareDestroy(ctx), @@ -204,7 +204,7 @@ func TestAccRAMResourceShare_disappears(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ram.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckResourceShareDestroy(ctx), From f67265ec1062c8f49e6421faf0a14800b5fa0b91 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Fri, 24 Feb 2023 16:37:19 -0500 Subject: [PATCH 212/763] Add 'Context' argument to 'acctest.PreCheck' for rds. --- .../rds/certificate_data_source_test.go | 4 +- .../rds/cluster_activity_stream_test.go | 4 +- .../service/rds/cluster_data_source_test.go | 2 +- internal/service/rds/cluster_endpoint_test.go | 4 +- internal/service/rds/cluster_instance_test.go | 50 ++-- .../rds/cluster_parameter_group_test.go | 22 +- .../rds/cluster_role_association_test.go | 8 +- .../rds/cluster_snapshot_data_source_test.go | 6 +- internal/service/rds/cluster_snapshot_test.go | 4 +- internal/service/rds/cluster_test.go | 132 ++++----- .../service/rds/clusters_data_source_test.go | 2 +- .../rds/engine_version_data_source_test.go | 14 +- .../rds/event_categories_data_source_test.go | 4 +- .../service/rds/event_subscription_test.go | 14 +- internal/service/rds/export_task_test.go | 4 +- internal/service/rds/global_cluster_test.go | 30 +- ...ance_automated_backups_replication_test.go | 6 +- .../service/rds/instance_data_source_test.go | 2 +- .../rds/instance_role_association_test.go | 4 +- internal/service/rds/instance_test.go | 264 +++++++++--------- .../service/rds/instances_data_source_test.go | 2 +- internal/service/rds/option_group_test.go | 28 +- .../orderable_instance_data_source_test.go | 22 +- internal/service/rds/parameter_group_test.go | 22 +- .../service/rds/proxy_data_source_test.go | 2 +- .../rds/proxy_default_target_group_test.go | 16 +- internal/service/rds/proxy_endpoint_test.go | 12 +- internal/service/rds/proxy_target_test.go | 6 +- internal/service/rds/proxy_test.go | 26 +- ...rved_instance_offering_data_source_test.go | 2 +- .../service/rds/reserved_instance_test.go | 2 +- internal/service/rds/snapshot_copy_test.go | 6 +- .../service/rds/snapshot_data_source_test.go | 2 +- internal/service/rds/snapshot_test.go | 6 +- .../rds/subnet_group_data_source_test.go | 2 +- internal/service/rds/subnet_group_test.go | 16 +- 36 files changed, 376 insertions(+), 376 deletions(-) diff --git a/internal/service/rds/certificate_data_source_test.go b/internal/service/rds/certificate_data_source_test.go index ff38ef1f825a..d811b5e24fa8 100644 --- a/internal/service/rds/certificate_data_source_test.go +++ b/internal/service/rds/certificate_data_source_test.go @@ -16,7 +16,7 @@ func TestAccRDSCertificateDataSource_id(t *testing.T) { dataSourceName := "data.aws_rds_certificate.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccCertificatePreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccCertificatePreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: nil, @@ -36,7 +36,7 @@ func TestAccRDSCertificateDataSource_latestValidTill(t *testing.T) { dataSourceName := "data.aws_rds_certificate.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccCertificatePreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccCertificatePreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: nil, diff --git a/internal/service/rds/cluster_activity_stream_test.go b/internal/service/rds/cluster_activity_stream_test.go index 0acb31f8060a..285f549f3787 100644 --- a/internal/service/rds/cluster_activity_stream_test.go +++ b/internal/service/rds/cluster_activity_stream_test.go @@ -30,7 +30,7 @@ func TestAccRDSClusterActivityStream_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartition(t, endpoints.AwsPartitionID) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), @@ -68,7 +68,7 @@ func TestAccRDSClusterActivityStream_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartition(t, endpoints.AwsPartitionID) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), diff --git a/internal/service/rds/cluster_data_source_test.go b/internal/service/rds/cluster_data_source_test.go index 8739ca8305a1..ab9a6dd190fd 100644 --- a/internal/service/rds/cluster_data_source_test.go +++ b/internal/service/rds/cluster_data_source_test.go @@ -16,7 +16,7 @@ func TestAccRDSClusterDataSource_basic(t *testing.T) { resourceName := "aws_rds_cluster.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ diff --git a/internal/service/rds/cluster_endpoint_test.go b/internal/service/rds/cluster_endpoint_test.go index e93f954fb59f..9447061c2b52 100644 --- a/internal/service/rds/cluster_endpoint_test.go +++ b/internal/service/rds/cluster_endpoint_test.go @@ -31,7 +31,7 @@ func TestAccRDSClusterEndpoint_basic(t *testing.T) { defaultResourceName := "aws_rds_cluster_endpoint.default" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClusterEndpointDestroy(ctx), @@ -77,7 +77,7 @@ func TestAccRDSClusterEndpoint_tags(t *testing.T) { resourceName := "aws_rds_cluster_endpoint.reader" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClusterEndpointDestroy(ctx), diff --git a/internal/service/rds/cluster_instance_test.go b/internal/service/rds/cluster_instance_test.go index 620fad298089..4783e83312b2 100644 --- a/internal/service/rds/cluster_instance_test.go +++ b/internal/service/rds/cluster_instance_test.go @@ -30,7 +30,7 @@ func TestAccRDSClusterInstance_basic(t *testing.T) { resourceName := "aws_rds_cluster_instance.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClusterInstanceDestroy(ctx), @@ -83,7 +83,7 @@ func TestAccRDSClusterInstance_disappears(t *testing.T) { resourceName := "aws_rds_cluster_instance.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClusterInstanceDestroy(ctx), @@ -111,7 +111,7 @@ func TestAccRDSClusterInstance_tags(t *testing.T) { resourceName := "aws_rds_cluster_instance.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClusterInstanceDestroy(ctx), @@ -165,7 +165,7 @@ func TestAccRDSClusterInstance_isAlreadyBeingDeleted(t *testing.T) { resourceName := "aws_rds_cluster_instance.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClusterInstanceDestroy(ctx), @@ -208,7 +208,7 @@ func TestAccRDSClusterInstance_az(t *testing.T) { availabilityZonesDataSourceName := "data.aws_availability_zones.available" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClusterInstanceDestroy(ctx), @@ -244,7 +244,7 @@ func TestAccRDSClusterInstance_identifierPrefix(t *testing.T) { resourceName := "aws_rds_cluster_instance.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClusterInstanceDestroy(ctx), @@ -282,7 +282,7 @@ func TestAccRDSClusterInstance_identifierGenerated(t *testing.T) { resourceName := "aws_rds_cluster_instance.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClusterInstanceDestroy(ctx), @@ -325,7 +325,7 @@ func TestAccRDSClusterInstance_kmsKey(t *testing.T) { resourceName := "aws_rds_cluster_instance.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClusterInstanceDestroy(ctx), @@ -361,7 +361,7 @@ func TestAccRDSClusterInstance_publiclyAccessible(t *testing.T) { resourceName := "aws_rds_cluster_instance.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClusterInstanceDestroy(ctx), @@ -404,7 +404,7 @@ func TestAccRDSClusterInstance_copyTagsToSnapshot(t *testing.T) { resourceName := "aws_rds_cluster_instance.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClusterInstanceDestroy(ctx), @@ -448,7 +448,7 @@ func TestAccRDSClusterInstance_caCertificateIdentifier(t *testing.T) { certificateDataSourceName := "data.aws_rds_certificate.latest" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClusterInstanceDestroy(ctx), @@ -484,7 +484,7 @@ func TestAccRDSClusterInstance_monitoringInterval(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckInstanceDestroy(ctx), @@ -542,7 +542,7 @@ func TestAccRDSClusterInstance_MonitoringRoleARN_enabledToDisabled(t *testing.T) rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckInstanceDestroy(ctx), @@ -586,7 +586,7 @@ func TestAccRDSClusterInstance_MonitoringRoleARN_enabledToRemoved(t *testing.T) rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckInstanceDestroy(ctx), @@ -629,7 +629,7 @@ func TestAccRDSClusterInstance_MonitoringRoleARN_removedToEnabled(t *testing.T) rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckInstanceDestroy(ctx), @@ -672,7 +672,7 @@ func TestAccRDSClusterInstance_PerformanceInsightsEnabled_auroraMySQL1(t *testin engine := "aurora" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPerformanceInsightsDefaultVersionPreCheck(ctx, t, engine) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPerformanceInsightsDefaultVersionPreCheck(ctx, t, engine) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClusterInstanceDestroy(ctx), @@ -710,7 +710,7 @@ func TestAccRDSClusterInstance_PerformanceInsightsEnabled_auroraMySQL2(t *testin engineVersion := "5.7.mysql_aurora.2.04.2" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPerformanceInsightsPreCheck(ctx, t, engine, engineVersion) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPerformanceInsightsPreCheck(ctx, t, engine, engineVersion) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClusterInstanceDestroy(ctx), @@ -747,7 +747,7 @@ func TestAccRDSClusterInstance_PerformanceInsightsEnabled_auroraPostgresql(t *te engine := "aurora-postgresql" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPerformanceInsightsDefaultVersionPreCheck(ctx, t, engine) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPerformanceInsightsDefaultVersionPreCheck(ctx, t, engine) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClusterInstanceDestroy(ctx), @@ -785,7 +785,7 @@ func TestAccRDSClusterInstance_PerformanceInsightsKMSKeyID_auroraMySQL1(t *testi engine := "aurora" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPerformanceInsightsDefaultVersionPreCheck(ctx, t, engine) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPerformanceInsightsDefaultVersionPreCheck(ctx, t, engine) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClusterInstanceDestroy(ctx), @@ -823,7 +823,7 @@ func TestAccRDSClusterInstance_PerformanceInsightsKMSKeyIDAuroraMySQL1_defaultKe engine := "aurora" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPerformanceInsightsDefaultVersionPreCheck(ctx, t, engine) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPerformanceInsightsDefaultVersionPreCheck(ctx, t, engine) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClusterInstanceDestroy(ctx), @@ -866,7 +866,7 @@ func TestAccRDSClusterInstance_PerformanceInsightsKMSKeyID_auroraMySQL2(t *testi engineVersion := "5.7.mysql_aurora.2.04.2" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPerformanceInsightsPreCheck(ctx, t, engine, engineVersion) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPerformanceInsightsPreCheck(ctx, t, engine, engineVersion) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClusterInstanceDestroy(ctx), @@ -905,7 +905,7 @@ func TestAccRDSClusterInstance_PerformanceInsightsKMSKeyIDAuroraMySQL2_defaultKe engineVersion := "5.7.mysql_aurora.2.04.2" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPerformanceInsightsPreCheck(ctx, t, engine, engineVersion) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPerformanceInsightsPreCheck(ctx, t, engine, engineVersion) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClusterInstanceDestroy(ctx), @@ -945,7 +945,7 @@ func TestAccRDSClusterInstance_performanceInsightsRetentionPeriod(t *testing.T) rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPerformanceInsightsDefaultVersionPreCheck(ctx, t, "aurora") }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPerformanceInsightsDefaultVersionPreCheck(ctx, t, "aurora") }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClusterDestroy(ctx), @@ -1000,7 +1000,7 @@ func TestAccRDSClusterInstance_PerformanceInsightsKMSKeyID_auroraPostgresql(t *t engine := "aurora-postgresql" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPerformanceInsightsDefaultVersionPreCheck(ctx, t, engine) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPerformanceInsightsDefaultVersionPreCheck(ctx, t, engine) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClusterInstanceDestroy(ctx), @@ -1038,7 +1038,7 @@ func TestAccRDSClusterInstance_PerformanceInsightsKMSKeyIDAuroraPostgresql_defau engine := "aurora-postgresql" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPerformanceInsightsDefaultVersionPreCheck(ctx, t, engine) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPerformanceInsightsDefaultVersionPreCheck(ctx, t, engine) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClusterInstanceDestroy(ctx), diff --git a/internal/service/rds/cluster_parameter_group_test.go b/internal/service/rds/cluster_parameter_group_test.go index 594a31a806cb..35f49a045046 100644 --- a/internal/service/rds/cluster_parameter_group_test.go +++ b/internal/service/rds/cluster_parameter_group_test.go @@ -24,7 +24,7 @@ func TestAccRDSClusterParameterGroup_basic(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClusterParameterGroupDestroy(ctx), @@ -123,7 +123,7 @@ func TestAccRDSClusterParameterGroup_disappears(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClusterParameterGroupDestroy(ctx), @@ -147,7 +147,7 @@ func TestAccRDSClusterParameterGroup_tags(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClusterParameterGroupDestroy(ctx), @@ -193,7 +193,7 @@ func TestAccRDSClusterParameterGroup_withApplyMethod(t *testing.T) { resourceName := "aws_rds_cluster_parameter_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClusterParameterGroupDestroy(ctx), @@ -234,7 +234,7 @@ func TestAccRDSClusterParameterGroup_namePrefix(t *testing.T) { resourceName := "aws_rds_cluster_parameter_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClusterParameterGroupDestroy(ctx), @@ -262,7 +262,7 @@ func TestAccRDSClusterParameterGroup_NamePrefix_parameter(t *testing.T) { resourceName := "aws_rds_cluster_parameter_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClusterParameterGroupDestroy(ctx), @@ -290,7 +290,7 @@ func TestAccRDSClusterParameterGroup_generatedName(t *testing.T) { resourceName := "aws_rds_cluster_parameter_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClusterParameterGroupDestroy(ctx), @@ -318,7 +318,7 @@ func TestAccRDSClusterParameterGroup_GeneratedName_parameter(t *testing.T) { resourceName := "aws_rds_cluster_parameter_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClusterParameterGroupDestroy(ctx), @@ -347,7 +347,7 @@ func TestAccRDSClusterParameterGroup_only(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClusterParameterGroupDestroy(ctx), @@ -378,7 +378,7 @@ func TestAccRDSClusterParameterGroup_updateParameters(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClusterParameterGroupDestroy(ctx), @@ -439,7 +439,7 @@ func TestAccRDSClusterParameterGroup_caseParameters(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClusterParameterGroupDestroy(ctx), diff --git a/internal/service/rds/cluster_role_association_test.go b/internal/service/rds/cluster_role_association_test.go index cca5019f80e1..bdfac984c5b3 100644 --- a/internal/service/rds/cluster_role_association_test.go +++ b/internal/service/rds/cluster_role_association_test.go @@ -25,7 +25,7 @@ func TestAccRDSClusterRoleAssociation_basic(t *testing.T) { resourceName := "aws_rds_cluster_role_association.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClusterRoleAssociationDestroy(ctx), @@ -55,7 +55,7 @@ func TestAccRDSClusterRoleAssociation_disappears(t *testing.T) { resourceName := "aws_rds_cluster_role_association.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClusterRoleAssociationDestroy(ctx), @@ -80,7 +80,7 @@ func TestAccRDSClusterRoleAssociation_Disappears_cluster(t *testing.T) { clusterResourceName := "aws_rds_cluster.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClusterRoleAssociationDestroy(ctx), @@ -105,7 +105,7 @@ func TestAccRDSClusterRoleAssociation_Disappears_role(t *testing.T) { roleResourceName := "aws_iam_role.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClusterRoleAssociationDestroy(ctx), diff --git a/internal/service/rds/cluster_snapshot_data_source_test.go b/internal/service/rds/cluster_snapshot_data_source_test.go index 7ea4b3ec8107..858a6517e89d 100644 --- a/internal/service/rds/cluster_snapshot_data_source_test.go +++ b/internal/service/rds/cluster_snapshot_data_source_test.go @@ -17,7 +17,7 @@ func TestAccRDSClusterSnapshotDataSource_dbClusterSnapshotIdentifier(t *testing. resourceName := "aws_db_cluster_snapshot.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ @@ -54,7 +54,7 @@ func TestAccRDSClusterSnapshotDataSource_dbClusterIdentifier(t *testing.T) { resourceName := "aws_db_cluster_snapshot.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ @@ -91,7 +91,7 @@ func TestAccRDSClusterSnapshotDataSource_mostRecent(t *testing.T) { resourceName := "aws_db_cluster_snapshot.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ diff --git a/internal/service/rds/cluster_snapshot_test.go b/internal/service/rds/cluster_snapshot_test.go index 1c2c3cbc4d36..8932b2f9b7c6 100644 --- a/internal/service/rds/cluster_snapshot_test.go +++ b/internal/service/rds/cluster_snapshot_test.go @@ -23,7 +23,7 @@ func TestAccRDSClusterSnapshot_basic(t *testing.T) { resourceName := "aws_db_cluster_snapshot.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClusterSnapshotDestroy(ctx), @@ -64,7 +64,7 @@ func TestAccRDSClusterSnapshot_tags(t *testing.T) { resourceName := "aws_db_cluster_snapshot.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClusterSnapshotDestroy(ctx), diff --git a/internal/service/rds/cluster_test.go b/internal/service/rds/cluster_test.go index 0ea164b16fe5..5dd63a16b458 100644 --- a/internal/service/rds/cluster_test.go +++ b/internal/service/rds/cluster_test.go @@ -41,7 +41,7 @@ func TestAccRDSCluster_basic(t *testing.T) { resourceName := "aws_rds_cluster.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClusterDestroy(ctx), @@ -92,7 +92,7 @@ func TestAccRDSCluster_disappears(t *testing.T) { resourceName := "aws_rds_cluster.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClusterDestroy(ctx), @@ -116,7 +116,7 @@ func TestAccRDSCluster_tags(t *testing.T) { resourceName := "aws_rds_cluster.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClusterDestroy(ctx), @@ -156,7 +156,7 @@ func TestAccRDSCluster_identifierGenerated(t *testing.T) { resourceName := "aws_rds_cluster.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClusterDestroy(ctx), @@ -178,7 +178,7 @@ func TestAccRDSCluster_identifierPrefix(t *testing.T) { resourceName := "aws_rds_cluster.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClusterDestroy(ctx), @@ -211,7 +211,7 @@ func TestAccRDSCluster_allowMajorVersionUpgrade(t *testing.T) { engineVersion2 := "13.5" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClusterDestroy(ctx), @@ -269,7 +269,7 @@ func TestAccRDSCluster_allowMajorVersionUpgradeWithCustomParametersApplyImm(t *t engineVersion2 := "13.5" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClusterDestroy(ctx), @@ -313,7 +313,7 @@ func TestAccRDSCluster_allowMajorVersionUpgradeWithCustomParameters(t *testing.T engineVersion2 := "13.5" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClusterDestroy(ctx), @@ -370,7 +370,7 @@ func TestAccRDSCluster_onlyMajorVersion(t *testing.T) { engineVersion1 := "11" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClusterDestroy(ctx), @@ -409,7 +409,7 @@ func TestAccRDSCluster_availabilityZones(t *testing.T) { resourceName := "aws_rds_cluster.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClusterDestroy(ctx), @@ -431,7 +431,7 @@ func TestAccRDSCluster_storageType(t *testing.T) { resourceName := "aws_rds_cluster.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClusterDestroy(ctx), @@ -454,7 +454,7 @@ func TestAccRDSCluster_allocatedStorage(t *testing.T) { resourceName := "aws_rds_cluster.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClusterDestroy(ctx), @@ -477,7 +477,7 @@ func TestAccRDSCluster_iops(t *testing.T) { resourceName := "aws_rds_cluster.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClusterDestroy(ctx), @@ -500,7 +500,7 @@ func TestAccRDSCluster_dbClusterInstanceClass(t *testing.T) { resourceName := "aws_rds_cluster.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClusterDestroy(ctx), @@ -522,7 +522,7 @@ func TestAccRDSCluster_backtrackWindow(t *testing.T) { resourceName := "aws_rds_cluster.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClusterDestroy(ctx), @@ -552,7 +552,7 @@ func TestAccRDSCluster_dbSubnetGroupName(t *testing.T) { resourceName := "aws_rds_cluster.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClusterDestroy(ctx), @@ -579,7 +579,7 @@ func TestAccRDSCluster_pointInTimeRestore(t *testing.T) { resourceName := "aws_rds_cluster.restore" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClusterDestroy(ctx), @@ -608,7 +608,7 @@ func TestAccRDSCluster_PointInTimeRestore_enabledCloudWatchLogsExports(t *testin resourceName := "aws_rds_cluster.restore" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClusterDestroy(ctx), @@ -633,7 +633,7 @@ func TestAccRDSCluster_takeFinalSnapshot(t *testing.T) { resourceName := "aws_rds_cluster.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClusterDestroyWithFinalSnapshot(ctx), @@ -654,7 +654,7 @@ func TestAccRDSCluster_takeFinalSnapshot(t *testing.T) { func TestAccRDSCluster_missingUserNameCausesError(t *testing.T) { ctx := acctest.Context(t) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClusterDestroy(ctx), @@ -674,7 +674,7 @@ func TestAccRDSCluster_EnabledCloudWatchLogsExports_mySQL(t *testing.T) { resourceName := "aws_rds_cluster.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClusterDestroy(ctx), @@ -715,7 +715,7 @@ func TestAccRDSCluster_EnabledCloudWatchLogsExports_postgresql(t *testing.T) { resourceName := "aws_rds_cluster.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClusterDestroy(ctx), @@ -748,7 +748,7 @@ func TestAccRDSCluster_updateIAMRoles(t *testing.T) { resourceName := "aws_rds_cluster.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClusterDestroy(ctx), @@ -786,7 +786,7 @@ func TestAccRDSCluster_kmsKey(t *testing.T) { resourceName := "aws_rds_cluster.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClusterDestroy(ctx), @@ -813,7 +813,7 @@ func TestAccRDSCluster_networkType(t *testing.T) { resourceName := "aws_rds_cluster.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClusterDestroy(ctx), @@ -842,7 +842,7 @@ func TestAccRDSCluster_encrypted(t *testing.T) { resourceName := "aws_rds_cluster.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClusterDestroy(ctx), @@ -868,7 +868,7 @@ func TestAccRDSCluster_copyTagsToSnapshot(t *testing.T) { resourceName := "aws_rds_cluster.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClusterDestroy(ctx), @@ -916,7 +916,7 @@ func TestAccRDSCluster_ReplicationSourceIdentifier_kmsKeyID(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckMultipleRegion(t, 2) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), @@ -941,7 +941,7 @@ func TestAccRDSCluster_backupsUpdate(t *testing.T) { ri := sdkacctest.RandInt() resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClusterDestroy(ctx), @@ -980,7 +980,7 @@ func TestAccRDSCluster_iamAuth(t *testing.T) { resourceName := "aws_rds_cluster.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClusterDestroy(ctx), @@ -1004,7 +1004,7 @@ func TestAccRDSCluster_deletionProtection(t *testing.T) { resourceName := "aws_rds_cluster.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClusterDestroy(ctx), @@ -1039,7 +1039,7 @@ func TestAccRDSCluster_engineMode(t *testing.T) { resourceName := "aws_rds_cluster.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClusterDestroy(ctx), @@ -1075,7 +1075,7 @@ func TestAccRDSCluster_EngineMode_global(t *testing.T) { resourceName := "aws_rds_cluster.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckGlobalCluster(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckGlobalCluster(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClusterDestroy(ctx), @@ -1099,7 +1099,7 @@ func TestAccRDSCluster_EngineMode_multiMaster(t *testing.T) { resourceName := "aws_rds_cluster.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClusterDestroy(ctx), @@ -1123,7 +1123,7 @@ func TestAccRDSCluster_EngineMode_parallelQuery(t *testing.T) { resourceName := "aws_rds_cluster.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClusterDestroy(ctx), @@ -1151,7 +1151,7 @@ func TestAccRDSCluster_engineVersion(t *testing.T) { dataSourceName := "data.aws_rds_engine_version.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClusterDestroy(ctx), @@ -1185,7 +1185,7 @@ func TestAccRDSCluster_engineVersionWithPrimaryInstance(t *testing.T) { dataSourceNameUpgrade := "data.aws_rds_engine_version.upgrade" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClusterDestroy(ctx), @@ -1219,7 +1219,7 @@ func TestAccRDSCluster_GlobalClusterIdentifierEngineMode_global(t *testing.T) { resourceName := "aws_rds_cluster.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckGlobalCluster(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckGlobalCluster(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClusterDestroy(ctx), @@ -1243,7 +1243,7 @@ func TestAccRDSCluster_GlobalClusterIdentifierEngineModeGlobal_add(t *testing.T) resourceName := "aws_rds_cluster.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckGlobalCluster(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckGlobalCluster(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClusterDestroy(ctx), @@ -1272,7 +1272,7 @@ func TestAccRDSCluster_GlobalClusterIdentifierEngineModeGlobal_remove(t *testing resourceName := "aws_rds_cluster.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckGlobalCluster(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckGlobalCluster(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClusterDestroy(ctx), @@ -1305,7 +1305,7 @@ func TestAccRDSCluster_GlobalClusterIdentifierEngineModeGlobal_update(t *testing resourceName := "aws_rds_cluster.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckGlobalCluster(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckGlobalCluster(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClusterDestroy(ctx), @@ -1334,7 +1334,7 @@ func TestAccRDSCluster_GlobalClusterIdentifierEngineMode_provisioned(t *testing. resourceName := "aws_rds_cluster.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckGlobalCluster(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckGlobalCluster(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClusterDestroy(ctx), @@ -1369,7 +1369,7 @@ func TestAccRDSCluster_GlobalClusterIdentifier_primarySecondaryClusters(t *testi resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckMultipleRegion(t, 2) testAccPreCheckGlobalCluster(ctx, t) }, @@ -1404,7 +1404,7 @@ func TestAccRDSCluster_GlobalClusterIdentifier_replicationSourceIdentifier(t *te resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckMultipleRegion(t, 2) testAccPreCheckGlobalCluster(ctx, t) }, @@ -1442,7 +1442,7 @@ func TestAccRDSCluster_GlobalClusterIdentifier_secondaryClustersWriteForwarding( resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckMultipleRegion(t, 2) testAccPreCheckGlobalCluster(ctx, t) }, @@ -1469,7 +1469,7 @@ func TestAccRDSCluster_port(t *testing.T) { resourceName := "aws_rds_cluster.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClusterDestroy(ctx), @@ -1504,7 +1504,7 @@ func TestAccRDSCluster_scaling(t *testing.T) { resourceName := "aws_rds_cluster.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClusterDestroy(ctx), @@ -1549,7 +1549,7 @@ func TestAccRDSCluster_serverlessV2ScalingConfiguration(t *testing.T) { resourceName := "aws_rds_cluster.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClusterDestroy(ctx), @@ -1585,7 +1585,7 @@ func TestAccRDSCluster_Scaling_defaultMinCapacity(t *testing.T) { resourceName := "aws_rds_cluster.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClusterDestroy(ctx), @@ -1621,7 +1621,7 @@ func TestAccRDSCluster_snapshotIdentifier(t *testing.T) { resourceName := "aws_rds_cluster.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckInstanceDestroy(ctx), @@ -1653,7 +1653,7 @@ func TestAccRDSCluster_SnapshotIdentifier_deletionProtection(t *testing.T) { resourceName := "aws_rds_cluster.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckInstanceDestroy(ctx), @@ -1696,7 +1696,7 @@ func TestAccRDSCluster_SnapshotIdentifierEngineMode_parallelQuery(t *testing.T) resourceName := "aws_rds_cluster.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckInstanceDestroy(ctx), @@ -1729,7 +1729,7 @@ func TestAccRDSCluster_SnapshotIdentifierEngineMode_provisioned(t *testing.T) { resourceName := "aws_rds_cluster.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckInstanceDestroy(ctx), @@ -1763,7 +1763,7 @@ func TestAccRDSCluster_SnapshotIdentifierEngineMode_serverless(t *testing.T) { resourceName := "aws_rds_cluster.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckInstanceDestroy(ctx), @@ -1798,7 +1798,7 @@ func TestAccRDSCluster_SnapshotIdentifierEngineVersion_different(t *testing.T) { dataSourceName := "data.aws_rds_engine_version.upgrade" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckInstanceDestroy(ctx), @@ -1833,7 +1833,7 @@ func TestAccRDSCluster_SnapshotIdentifierEngineVersion_equal(t *testing.T) { dataSourceName := "data.aws_rds_engine_version.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckInstanceDestroy(ctx), @@ -1867,7 +1867,7 @@ func TestAccRDSCluster_SnapshotIdentifier_kmsKeyID(t *testing.T) { resourceName := "aws_rds_cluster.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckInstanceDestroy(ctx), @@ -1900,7 +1900,7 @@ func TestAccRDSCluster_SnapshotIdentifier_masterPassword(t *testing.T) { resourceName := "aws_rds_cluster.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckInstanceDestroy(ctx), @@ -1933,7 +1933,7 @@ func TestAccRDSCluster_SnapshotIdentifier_masterUsername(t *testing.T) { resourceName := "aws_rds_cluster.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckInstanceDestroy(ctx), @@ -1968,7 +1968,7 @@ func TestAccRDSCluster_SnapshotIdentifier_preferredBackupWindow(t *testing.T) { resourceName := "aws_rds_cluster.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckInstanceDestroy(ctx), @@ -2001,7 +2001,7 @@ func TestAccRDSCluster_SnapshotIdentifier_preferredMaintenanceWindow(t *testing. resourceName := "aws_rds_cluster.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckInstanceDestroy(ctx), @@ -2034,7 +2034,7 @@ func TestAccRDSCluster_SnapshotIdentifier_tags(t *testing.T) { resourceName := "aws_rds_cluster.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckInstanceDestroy(ctx), @@ -2068,7 +2068,7 @@ func TestAccRDSCluster_SnapshotIdentifier_vpcSecurityGroupIDs(t *testing.T) { resourceName := "aws_rds_cluster.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckInstanceDestroy(ctx), @@ -2104,7 +2104,7 @@ func TestAccRDSCluster_SnapshotIdentifierVPCSecurityGroupIDs_tags(t *testing.T) resourceName := "aws_rds_cluster.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckInstanceDestroy(ctx), @@ -2139,7 +2139,7 @@ func TestAccRDSCluster_SnapshotIdentifier_encryptedRestore(t *testing.T) { resourceName := "aws_rds_cluster.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckInstanceDestroy(ctx), @@ -2170,7 +2170,7 @@ func TestAccRDSCluster_enableHTTPEndpoint(t *testing.T) { resourceName := "aws_rds_cluster.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClusterDestroy(ctx), diff --git a/internal/service/rds/clusters_data_source_test.go b/internal/service/rds/clusters_data_source_test.go index c9c66b0edb27..fd831cc4eab7 100644 --- a/internal/service/rds/clusters_data_source_test.go +++ b/internal/service/rds/clusters_data_source_test.go @@ -18,7 +18,7 @@ func TestAccRDSClustersDataSource_filter(t *testing.T) { resourceName := "aws_rds_cluster.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClusterDestroy(ctx), diff --git a/internal/service/rds/engine_version_data_source_test.go b/internal/service/rds/engine_version_data_source_test.go index 8ab4b997ed5b..a91c842dae3f 100644 --- a/internal/service/rds/engine_version_data_source_test.go +++ b/internal/service/rds/engine_version_data_source_test.go @@ -21,7 +21,7 @@ func TestAccRDSEngineVersionDataSource_basic(t *testing.T) { paramGroup := "oracle-ee-19" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccEngineVersionPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccEngineVersionPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: nil, @@ -57,7 +57,7 @@ func TestAccRDSEngineVersionDataSource_upgradeTargets(t *testing.T) { dataSourceName := "data.aws_rds_engine_version.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccEngineVersionPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccEngineVersionPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: nil, @@ -77,7 +77,7 @@ func TestAccRDSEngineVersionDataSource_preferred(t *testing.T) { dataSourceName := "data.aws_rds_engine_version.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccEngineVersionPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccEngineVersionPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: nil, @@ -97,7 +97,7 @@ func TestAccRDSEngineVersionDataSource_defaultOnlyImplicit(t *testing.T) { dataSourceName := "data.aws_rds_engine_version.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccEngineVersionPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccEngineVersionPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: nil, @@ -117,7 +117,7 @@ func TestAccRDSEngineVersionDataSource_defaultOnlyExplicit(t *testing.T) { dataSourceName := "data.aws_rds_engine_version.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccEngineVersionPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccEngineVersionPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: nil, @@ -137,7 +137,7 @@ func TestAccRDSEngineVersionDataSource_includeAll(t *testing.T) { dataSourceName := "data.aws_rds_engine_version.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccEngineVersionPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccEngineVersionPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: nil, @@ -157,7 +157,7 @@ func TestAccRDSEngineVersionDataSource_filter(t *testing.T) { dataSourceName := "data.aws_rds_engine_version.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccEngineVersionPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccEngineVersionPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: nil, diff --git a/internal/service/rds/event_categories_data_source_test.go b/internal/service/rds/event_categories_data_source_test.go index 369e679e02ac..91549213f4ec 100644 --- a/internal/service/rds/event_categories_data_source_test.go +++ b/internal/service/rds/event_categories_data_source_test.go @@ -13,7 +13,7 @@ func TestAccRDSEventCategoriesDataSource_basic(t *testing.T) { dataSourceName := "data.aws_db_event_categories.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ @@ -44,7 +44,7 @@ func TestAccRDSEventCategoriesDataSource_sourceType(t *testing.T) { dataSourceName := "data.aws_db_event_categories.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ diff --git a/internal/service/rds/event_subscription_test.go b/internal/service/rds/event_subscription_test.go index 51c82d5af34c..86591781517d 100644 --- a/internal/service/rds/event_subscription_test.go +++ b/internal/service/rds/event_subscription_test.go @@ -22,7 +22,7 @@ func TestAccRDSEventSubscription_basic(t *testing.T) { resourceName := "aws_db_event_subscription.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckEventSubscriptionDestroy(ctx), @@ -58,7 +58,7 @@ func TestAccRDSEventSubscription_disappears(t *testing.T) { resourceName := "aws_db_event_subscription.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckEventSubscriptionDestroy(ctx), @@ -82,7 +82,7 @@ func TestAccRDSEventSubscription_Name_generated(t *testing.T) { resourceName := "aws_db_event_subscription.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckEventSubscriptionDestroy(ctx), @@ -111,7 +111,7 @@ func TestAccRDSEventSubscription_namePrefix(t *testing.T) { resourceName := "aws_db_event_subscription.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckEventSubscriptionDestroy(ctx), @@ -140,7 +140,7 @@ func TestAccRDSEventSubscription_tags(t *testing.T) { resourceName := "aws_db_event_subscription.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckEventSubscriptionDestroy(ctx), @@ -187,7 +187,7 @@ func TestAccRDSEventSubscription_categories(t *testing.T) { snsTopicResourceName := "aws_sns_topic.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckEventSubscriptionDestroy(ctx), @@ -267,7 +267,7 @@ func TestAccRDSEventSubscription_sourceIDs(t *testing.T) { paramGroup3ResourceName := "aws_db_parameter_group.test3" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckEventSubscriptionDestroy(ctx), diff --git a/internal/service/rds/export_task_test.go b/internal/service/rds/export_task_test.go index 2a1ef0dc6a3c..967ee135a651 100644 --- a/internal/service/rds/export_task_test.go +++ b/internal/service/rds/export_task_test.go @@ -27,7 +27,7 @@ func TestAccRDSExportTask_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(rdsv1.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, rdsv1.EndpointsID), @@ -64,7 +64,7 @@ func TestAccRDSExportTask_optional(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(rdsv1.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, rdsv1.EndpointsID), diff --git a/internal/service/rds/global_cluster_test.go b/internal/service/rds/global_cluster_test.go index a27bffc38623..14cfc5704ed0 100644 --- a/internal/service/rds/global_cluster_test.go +++ b/internal/service/rds/global_cluster_test.go @@ -101,7 +101,7 @@ func TestAccRDSGlobalCluster_basic(t *testing.T) { resourceName := "aws_rds_global_cluster.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckGlobalCluster(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckGlobalCluster(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckGlobalClusterDestroy(ctx), @@ -136,7 +136,7 @@ func TestAccRDSGlobalCluster_disappears(t *testing.T) { resourceName := "aws_rds_global_cluster.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckGlobalCluster(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckGlobalCluster(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckGlobalClusterDestroy(ctx), @@ -160,7 +160,7 @@ func TestAccRDSGlobalCluster_databaseName(t *testing.T) { resourceName := "aws_rds_global_cluster.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckGlobalCluster(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckGlobalCluster(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckGlobalClusterDestroy(ctx), @@ -196,7 +196,7 @@ func TestAccRDSGlobalCluster_deletionProtection(t *testing.T) { resourceName := "aws_rds_global_cluster.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckGlobalCluster(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckGlobalCluster(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckGlobalClusterDestroy(ctx), @@ -232,7 +232,7 @@ func TestAccRDSGlobalCluster_Engine_aurora(t *testing.T) { resourceName := "aws_rds_global_cluster.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckGlobalCluster(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckGlobalCluster(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckGlobalClusterDestroy(ctx), @@ -260,7 +260,7 @@ func TestAccRDSGlobalCluster_EngineVersion_aurora(t *testing.T) { resourceName := "aws_rds_global_cluster.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckGlobalCluster(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckGlobalCluster(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckGlobalClusterDestroy(ctx), @@ -292,7 +292,7 @@ func TestAccRDSGlobalCluster_EngineVersion_updateMinor(t *testing.T) { resourceName := "aws_rds_global_cluster.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckGlobalCluster(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckGlobalCluster(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckGlobalClusterDestroy(ctx), @@ -333,7 +333,7 @@ func TestAccRDSGlobalCluster_EngineVersion_updateMajor(t *testing.T) { resourceName := "aws_rds_global_cluster.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckGlobalCluster(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckGlobalCluster(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckGlobalClusterDestroy(ctx), @@ -374,7 +374,7 @@ func TestAccRDSGlobalCluster_EngineVersion_updateMinorMultiRegion(t *testing.T) resourceName := "aws_rds_global_cluster.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckGlobalCluster(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckGlobalCluster(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5FactoriesAlternate(ctx, t), CheckDestroy: testAccCheckGlobalClusterDestroy(ctx), @@ -410,7 +410,7 @@ func TestAccRDSGlobalCluster_EngineVersion_updateMajorMultiRegion(t *testing.T) resourceName := "aws_rds_global_cluster.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckGlobalCluster(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckGlobalCluster(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5FactoriesAlternate(ctx, t), CheckDestroy: testAccCheckGlobalClusterDestroy(ctx), @@ -440,7 +440,7 @@ func TestAccRDSGlobalCluster_EngineVersion_auroraMySQL(t *testing.T) { resourceName := "aws_rds_global_cluster.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckGlobalCluster(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckGlobalCluster(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckGlobalClusterDestroy(ctx), @@ -468,7 +468,7 @@ func TestAccRDSGlobalCluster_EngineVersion_auroraPostgreSQL(t *testing.T) { resourceName := "aws_rds_global_cluster.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckGlobalCluster(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckGlobalCluster(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckGlobalClusterDestroy(ctx), @@ -497,7 +497,7 @@ func TestAccRDSGlobalCluster_sourceDBClusterIdentifier(t *testing.T) { resourceName := "aws_rds_global_cluster.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckGlobalCluster(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckGlobalCluster(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckGlobalClusterDestroy(ctx), @@ -527,7 +527,7 @@ func TestAccRDSGlobalCluster_SourceDBClusterIdentifier_storageEncrypted(t *testi resourceName := "aws_rds_global_cluster.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckGlobalCluster(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckGlobalCluster(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckGlobalClusterDestroy(ctx), @@ -556,7 +556,7 @@ func TestAccRDSGlobalCluster_storageEncrypted(t *testing.T) { resourceName := "aws_rds_global_cluster.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckGlobalCluster(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckGlobalCluster(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckGlobalClusterDestroy(ctx), diff --git a/internal/service/rds/instance_automated_backups_replication_test.go b/internal/service/rds/instance_automated_backups_replication_test.go index c6a061601698..d3165a54324e 100644 --- a/internal/service/rds/instance_automated_backups_replication_test.go +++ b/internal/service/rds/instance_automated_backups_replication_test.go @@ -26,7 +26,7 @@ func TestAccRDSInstanceAutomatedBackupsReplication_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckMultipleRegion(t, 2) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), @@ -60,7 +60,7 @@ func TestAccRDSInstanceAutomatedBackupsReplication_retentionPeriod(t *testing.T) resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckMultipleRegion(t, 2) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), @@ -94,7 +94,7 @@ func TestAccRDSInstanceAutomatedBackupsReplication_kmsEncrypted(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckMultipleRegion(t, 2) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), diff --git a/internal/service/rds/instance_data_source_test.go b/internal/service/rds/instance_data_source_test.go index d778450f0104..72e275005ac1 100644 --- a/internal/service/rds/instance_data_source_test.go +++ b/internal/service/rds/instance_data_source_test.go @@ -20,7 +20,7 @@ func TestAccRDSInstanceDataSource_basic(t *testing.T) { resourceName := "aws_db_instance.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ diff --git a/internal/service/rds/instance_role_association_test.go b/internal/service/rds/instance_role_association_test.go index c54343ee1e94..98325eeecb29 100644 --- a/internal/service/rds/instance_role_association_test.go +++ b/internal/service/rds/instance_role_association_test.go @@ -29,7 +29,7 @@ func TestAccRDSInstanceRoleAssociation_basic(t *testing.T) { resourceName := "aws_db_instance_role_association.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckInstanceRoleAssociationDestroy(ctx), @@ -65,7 +65,7 @@ func TestAccRDSInstanceRoleAssociation_disappears(t *testing.T) { resourceName := "aws_db_instance_role_association.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckInstanceRoleAssociationDestroy(ctx), diff --git a/internal/service/rds/instance_test.go b/internal/service/rds/instance_test.go index 202e22a64ff7..afded39cbafc 100644 --- a/internal/service/rds/instance_test.go +++ b/internal/service/rds/instance_test.go @@ -32,7 +32,7 @@ func TestAccRDSInstance_basic(t *testing.T) { resourceName := "aws_db_instance.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckInstanceDestroy(ctx), @@ -107,7 +107,7 @@ func TestAccRDSInstance_identifierPrefix(t *testing.T) { resourceName := "aws_db_instance.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckInstanceDestroy(ctx), @@ -143,7 +143,7 @@ func TestAccRDSInstance_identifierGenerated(t *testing.T) { resourceName := "aws_db_instance.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckInstanceDestroy(ctx), @@ -180,7 +180,7 @@ func TestAccRDSInstance_disappears(t *testing.T) { resourceName := "aws_db_instance.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckInstanceDestroy(ctx), @@ -208,7 +208,7 @@ func TestAccRDSInstance_tags(t *testing.T) { resourceName := "aws_db_instance.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckInstanceDestroy(ctx), @@ -265,7 +265,7 @@ func TestAccRDSInstance_nameDeprecated(t *testing.T) { resourceName := "aws_db_instance.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckInstanceDestroy(ctx), @@ -305,7 +305,7 @@ func TestAccRDSInstance_onlyMajorVersion(t *testing.T) { resourceName := "aws_db_instance.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClusterDestroy(ctx), @@ -344,7 +344,7 @@ func TestAccRDSInstance_kmsKey(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckInstanceDestroy(ctx), @@ -385,7 +385,7 @@ func TestAccRDSInstance_customIAMInstanceProfile(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionNot(t, endpoints.AwsUsGovPartitionID) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), @@ -414,7 +414,7 @@ func TestAccRDSInstance_subnetGroup(t *testing.T) { resourceName := "aws_db_instance.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckInstanceDestroy(ctx), @@ -448,7 +448,7 @@ func TestAccRDSInstance_networkType(t *testing.T) { resourceName := "aws_db_instance.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckInstanceDestroy(ctx), @@ -482,7 +482,7 @@ func TestAccRDSInstance_optionGroup(t *testing.T) { resourceName := "aws_db_instance.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckInstanceDestroy(ctx), @@ -510,7 +510,7 @@ func TestAccRDSInstance_iamAuth(t *testing.T) { resourceName := "aws_db_instance.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckInstanceDestroy(ctx), @@ -539,7 +539,7 @@ func TestAccRDSInstance_allowMajorVersionUpgrade(t *testing.T) { resourceName := "aws_db_instance.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckInstanceDestroy(ctx), @@ -588,7 +588,7 @@ func TestAccRDSInstance_dbSubnetGroupName(t *testing.T) { resourceName := "aws_db_instance.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckInstanceDestroy(ctx), @@ -616,7 +616,7 @@ func TestAccRDSInstance_DBSubnetGroupName_ramShared(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckAlternateAccount(t) acctest.PreCheckOrganizationsEnabled(ctx, t) }, @@ -650,7 +650,7 @@ func TestAccRDSInstance_DBSubnetGroupName_vpcSecurityGroupIDs(t *testing.T) { resourceName := "aws_db_instance.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckInstanceDestroy(ctx), @@ -679,7 +679,7 @@ func TestAccRDSInstance_deletionProtection(t *testing.T) { resourceName := "aws_db_instance.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckInstanceDestroy(ctx), @@ -726,7 +726,7 @@ func TestAccRDSInstance_finalSnapshotIdentifier(t *testing.T) { resourceName := "aws_db_instance.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, // testAccCheckInstanceDestroyWithFinalSnapshot verifies a database snapshot is @@ -762,7 +762,7 @@ func TestAccRDSInstance_FinalSnapshotIdentifier_skipFinalSnapshot(t *testing.T) resourceName := "aws_db_instance.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckInstanceDestroyWithoutFinalSnapshot(ctx), @@ -789,7 +789,7 @@ func TestAccRDSInstance_isAlreadyBeingDeleted(t *testing.T) { resourceName := "aws_db_instance.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckInstanceDestroy(ctx), @@ -832,7 +832,7 @@ func TestAccRDSInstance_maxAllocatedStorage(t *testing.T) { resourceName := "aws_db_instance.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckInstanceDestroy(ctx), @@ -880,7 +880,7 @@ func TestAccRDSInstance_password(t *testing.T) { resourceName := "aws_db_instance.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckInstanceDestroy(ctx), @@ -925,7 +925,7 @@ func TestAccRDSInstance_ReplicateSourceDB_basic(t *testing.T) { resourceName := "aws_db_instance.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckInstanceDestroy(ctx), @@ -988,7 +988,7 @@ func TestAccRDSInstance_ReplicateSourceDB_namePrefix(t *testing.T) { const resourceName = "aws_db_instance.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckInstanceDestroy(ctx), @@ -1026,7 +1026,7 @@ func TestAccRDSInstance_ReplicateSourceDB_nameGenerated(t *testing.T) { const resourceName = "aws_db_instance.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckInstanceDestroy(ctx), @@ -1065,7 +1065,7 @@ func TestAccRDSInstance_ReplicateSourceDB_addLater(t *testing.T) { resourceName := "aws_db_instance.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckInstanceDestroy(ctx), @@ -1101,7 +1101,7 @@ func TestAccRDSInstance_ReplicateSourceDB_allocatedStorage(t *testing.T) { resourceName := "aws_db_instance.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckInstanceDestroy(ctx), @@ -1132,7 +1132,7 @@ func TestAccRDSInstance_ReplicateSourceDB_iops(t *testing.T) { resourceName := "aws_db_instance.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckInstanceDestroy(ctx), @@ -1163,7 +1163,7 @@ func TestAccRDSInstance_ReplicateSourceDB_allocatedStorageAndIops(t *testing.T) resourceName := "aws_db_instance.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckInstanceDestroy(ctx), @@ -1195,7 +1195,7 @@ func TestAccRDSInstance_ReplicateSourceDB_allowMajorVersionUpgrade(t *testing.T) resourceName := "aws_db_instance.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckInstanceDestroy(ctx), @@ -1226,7 +1226,7 @@ func TestAccRDSInstance_ReplicateSourceDB_autoMinorVersionUpgrade(t *testing.T) resourceName := "aws_db_instance.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckInstanceDestroy(ctx), @@ -1257,7 +1257,7 @@ func TestAccRDSInstance_ReplicateSourceDB_availabilityZone(t *testing.T) { resourceName := "aws_db_instance.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckInstanceDestroy(ctx), @@ -1286,7 +1286,7 @@ func TestAccRDSInstance_ReplicateSourceDB_backupRetentionPeriod(t *testing.T) { resourceName := "aws_db_instance.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckInstanceDestroy(ctx), @@ -1317,7 +1317,7 @@ func TestAccRDSInstance_ReplicateSourceDB_backupWindow(t *testing.T) { resourceName := "aws_db_instance.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckInstanceDestroy(ctx), @@ -1350,7 +1350,7 @@ func TestAccRDSInstance_ReplicateSourceDB_dbSubnetGroupName(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckMultipleRegion(t, 2) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), @@ -1384,7 +1384,7 @@ func TestAccRDSInstance_ReplicateSourceDBDBSubnetGroupName_ramShared(t *testing. resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckMultipleRegion(t, 2) acctest.PreCheckAlternateAccount(t) acctest.PreCheckOrganizationsEnabled(ctx, t) @@ -1420,7 +1420,7 @@ func TestAccRDSInstance_ReplicateSourceDBDBSubnetGroupName_vpcSecurityGroupIDs(t resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckMultipleRegion(t, 2) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), @@ -1461,7 +1461,7 @@ func TestAccRDSInstance_ReplicateSourceDB_deletionProtection(t *testing.T) { resourceName := "aws_db_instance.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckInstanceDestroy(ctx), @@ -1502,7 +1502,7 @@ func TestAccRDSInstance_ReplicateSourceDB_iamDatabaseAuthenticationEnabled(t *te resourceName := "aws_db_instance.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckInstanceDestroy(ctx), @@ -1533,7 +1533,7 @@ func TestAccRDSInstance_ReplicateSourceDB_maintenanceWindow(t *testing.T) { resourceName := "aws_db_instance.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckInstanceDestroy(ctx), @@ -1564,7 +1564,7 @@ func TestAccRDSInstance_ReplicateSourceDB_maxAllocatedStorage(t *testing.T) { resourceName := "aws_db_instance.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckInstanceDestroy(ctx), @@ -1595,7 +1595,7 @@ func TestAccRDSInstance_ReplicateSourceDB_monitoring(t *testing.T) { resourceName := "aws_db_instance.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckInstanceDestroy(ctx), @@ -1626,7 +1626,7 @@ func TestAccRDSInstance_ReplicateSourceDB_monitoring_sourceAlreadyExists(t *test resourceName := "aws_db_instance.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckInstanceDestroy(ctx), @@ -1663,7 +1663,7 @@ func TestAccRDSInstance_ReplicateSourceDB_multiAZ(t *testing.T) { resourceName := "aws_db_instance.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckInstanceDestroy(ctx), @@ -1694,7 +1694,7 @@ func TestAccRDSInstance_ReplicateSourceDB_networkType(t *testing.T) { resourceName := "aws_db_instance.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckInstanceDestroy(ctx), @@ -1725,7 +1725,7 @@ func TestAccRDSInstance_ReplicateSourceDB_parameterGroupNameSameSetOnBoth(t *tes resourceName := "aws_db_instance.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckInstanceDestroy(ctx), @@ -1759,7 +1759,7 @@ func TestAccRDSInstance_ReplicateSourceDB_parameterGroupNameDifferentSetOnBoth(t resourceName := "aws_db_instance.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckInstanceDestroy(ctx), @@ -1793,7 +1793,7 @@ func TestAccRDSInstance_ReplicateSourceDB_parameterGroupNameReplicaCopiesValue(t resourceName := "aws_db_instance.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckInstanceDestroy(ctx), @@ -1826,7 +1826,7 @@ func TestAccRDSInstance_ReplicateSourceDB_parameterGroupNameSetOnReplica(t *test resourceName := "aws_db_instance.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckInstanceDestroy(ctx), @@ -1858,7 +1858,7 @@ func TestAccRDSInstance_ReplicateSourceDB_port(t *testing.T) { resourceName := "aws_db_instance.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckInstanceDestroy(ctx), @@ -1889,7 +1889,7 @@ func TestAccRDSInstance_ReplicateSourceDB_vpcSecurityGroupIDs(t *testing.T) { resourceName := "aws_db_instance.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckInstanceDestroy(ctx), @@ -1921,7 +1921,7 @@ func TestAccRDSInstance_ReplicateSourceDB_caCertificateIdentifier(t *testing.T) certifiateDataSourceName := "data.aws_rds_certificate.latest" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckInstanceDestroy(ctx), @@ -1953,7 +1953,7 @@ func TestAccRDSInstance_ReplicateSourceDB_replicaMode(t *testing.T) { resourceName := "aws_db_instance.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckInstanceDestroy(ctx), @@ -1992,7 +1992,7 @@ func TestAccRDSInstance_ReplicateSourceDB_parameterGroupTwoStep(t *testing.T) { parameterGroupResourceName := "aws_db_parameter_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckInstanceDestroy(ctx), @@ -2031,7 +2031,7 @@ func TestAccRDSInstance_S3Import_basic(t *testing.T) { resourceName := "aws_db_instance.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckInstanceDestroy(ctx), @@ -2072,7 +2072,7 @@ func TestAccRDSInstance_SnapshotIdentifier_basic(t *testing.T) { resourceName := "aws_db_instance.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckInstanceDestroy(ctx), @@ -2114,7 +2114,7 @@ func TestAccRDSInstance_SnapshotIdentifier_namePrefix(t *testing.T) { const resourceName = "aws_db_instance.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckInstanceDestroy(ctx), @@ -2153,7 +2153,7 @@ func TestAccRDSInstance_SnapshotIdentifier_nameGenerated(t *testing.T) { const resourceName = "aws_db_instance.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckInstanceDestroy(ctx), @@ -2193,7 +2193,7 @@ func TestAccRDSInstance_SnapshotIdentifier_AssociationRemoved(t *testing.T) { resourceName := "aws_db_instance.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckInstanceDestroy(ctx), @@ -2233,7 +2233,7 @@ func TestAccRDSInstance_SnapshotIdentifier_allocatedStorage(t *testing.T) { resourceName := "aws_db_instance.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckInstanceDestroy(ctx), @@ -2266,7 +2266,7 @@ func TestAccRDSInstance_SnapshotIdentifier_io1Storage(t *testing.T) { resourceName := "aws_db_instance.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckInstanceDestroy(ctx), @@ -2299,7 +2299,7 @@ func TestAccRDSInstance_SnapshotIdentifier_allowMajorVersionUpgrade(t *testing.T resourceName := "aws_db_instance.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckInstanceDestroy(ctx), @@ -2332,7 +2332,7 @@ func TestAccRDSInstance_SnapshotIdentifier_autoMinorVersionUpgrade(t *testing.T) resourceName := "aws_db_instance.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckInstanceDestroy(ctx), @@ -2365,7 +2365,7 @@ func TestAccRDSInstance_SnapshotIdentifier_availabilityZone(t *testing.T) { resourceName := "aws_db_instance.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckInstanceDestroy(ctx), @@ -2397,7 +2397,7 @@ func TestAccRDSInstance_SnapshotIdentifier_backupRetentionPeriodOverride(t *test resourceName := "aws_db_instance.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckInstanceDestroy(ctx), @@ -2430,7 +2430,7 @@ func TestAccRDSInstance_SnapshotIdentifier_backupRetentionPeriodUnset(t *testing resourceName := "aws_db_instance.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckInstanceDestroy(ctx), @@ -2463,7 +2463,7 @@ func TestAccRDSInstance_SnapshotIdentifier_backupWindow(t *testing.T) { resourceName := "aws_db_instance.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckInstanceDestroy(ctx), @@ -2498,7 +2498,7 @@ func TestAccRDSInstance_SnapshotIdentifier_dbSubnetGroupName(t *testing.T) { resourceName := "aws_db_instance.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckInstanceDestroy(ctx), @@ -2535,7 +2535,7 @@ func TestAccRDSInstance_SnapshotIdentifier_dbSubnetGroupNameRAMShared(t *testing resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckAlternateAccount(t) acctest.PreCheckOrganizationsEnabled(ctx, t) }, @@ -2574,7 +2574,7 @@ func TestAccRDSInstance_SnapshotIdentifier_dbSubnetGroupNameVPCSecurityGroupIDs( resourceName := "aws_db_instance.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckInstanceDestroy(ctx), @@ -2608,7 +2608,7 @@ func TestAccRDSInstance_SnapshotIdentifier_deletionProtection(t *testing.T) { resourceName := "aws_db_instance.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckInstanceDestroy(ctx), @@ -2651,7 +2651,7 @@ func TestAccRDSInstance_SnapshotIdentifier_iamDatabaseAuthenticationEnabled(t *t resourceName := "aws_db_instance.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckInstanceDestroy(ctx), @@ -2684,7 +2684,7 @@ func TestAccRDSInstance_SnapshotIdentifier_maintenanceWindow(t *testing.T) { resourceName := "aws_db_instance.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckInstanceDestroy(ctx), @@ -2717,7 +2717,7 @@ func TestAccRDSInstance_SnapshotIdentifier_maxAllocatedStorage(t *testing.T) { resourceName := "aws_db_instance.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckInstanceDestroy(ctx), @@ -2750,7 +2750,7 @@ func TestAccRDSInstance_SnapshotIdentifier_monitoring(t *testing.T) { resourceName := "aws_db_instance.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckInstanceDestroy(ctx), @@ -2783,7 +2783,7 @@ func TestAccRDSInstance_SnapshotIdentifier_multiAZ(t *testing.T) { resourceName := "aws_db_instance.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckInstanceDestroy(ctx), @@ -2816,7 +2816,7 @@ func TestAccRDSInstance_SnapshotIdentifier_multiAZSQLServer(t *testing.T) { resourceName := "aws_db_instance.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckInstanceDestroy(ctx), @@ -2849,7 +2849,7 @@ func TestAccRDSInstance_SnapshotIdentifier_parameterGroupName(t *testing.T) { resourceName := "aws_db_instance.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckInstanceDestroy(ctx), @@ -2883,7 +2883,7 @@ func TestAccRDSInstance_SnapshotIdentifier_port(t *testing.T) { resourceName := "aws_db_instance.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckInstanceDestroy(ctx), @@ -2916,7 +2916,7 @@ func TestAccRDSInstance_SnapshotIdentifier_tags(t *testing.T) { resourceName := "aws_db_instance.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckInstanceDestroy(ctx), @@ -2960,7 +2960,7 @@ func TestAccRDSInstance_SnapshotIdentifier_tagsRemove(t *testing.T) { resourceName := "aws_db_instance.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckInstanceDestroy(ctx), @@ -3002,7 +3002,7 @@ func TestAccRDSInstance_SnapshotIdentifier_vpcSecurityGroupIDs(t *testing.T) { resourceName := "aws_db_instance.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckInstanceDestroy(ctx), @@ -3038,7 +3038,7 @@ func TestAccRDSInstance_SnapshotIdentifier_vpcSecurityGroupIDsTags(t *testing.T) resourceName := "aws_db_instance.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckInstanceDestroy(ctx), @@ -3068,7 +3068,7 @@ func TestAccRDSInstance_monitoringInterval(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckInstanceDestroy(ctx), @@ -3128,7 +3128,7 @@ func TestAccRDSInstance_MonitoringRoleARN_enabledToDisabled(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckInstanceDestroy(ctx), @@ -3174,7 +3174,7 @@ func TestAccRDSInstance_MonitoringRoleARN_enabledToRemoved(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckInstanceDestroy(ctx), @@ -3219,7 +3219,7 @@ func TestAccRDSInstance_MonitoringRoleARN_removedToEnabled(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckInstanceDestroy(ctx), @@ -3266,7 +3266,7 @@ func TestAccRDSInstance_separateIopsUpdate(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckInstanceDestroy(ctx), @@ -3302,7 +3302,7 @@ func TestAccRDSInstance_portUpdate(t *testing.T) { resourceName := "aws_db_instance.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckInstanceDestroy(ctx), @@ -3337,7 +3337,7 @@ func TestAccRDSInstance_MSSQL_tz(t *testing.T) { resourceName := "aws_db_instance.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckInstanceDestroy(ctx), @@ -3380,7 +3380,7 @@ func TestAccRDSInstance_MSSQL_domain(t *testing.T) { domain2 := domain.RandomSubdomain().String() resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckInstanceDestroy(ctx), @@ -3420,7 +3420,7 @@ func TestAccRDSInstance_MSSQL_domainSnapshotRestore(t *testing.T) { domain := acctest.RandomDomainName() resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckInstanceDestroy(ctx), @@ -3451,7 +3451,7 @@ func TestAccRDSInstance_MySQL_snapshotRestoreWithEngineVersion(t *testing.T) { restoreResourceName := "aws_db_instance.restore" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckInstanceDestroy(ctx), @@ -3480,7 +3480,7 @@ func TestAccRDSInstance_minorVersion(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckInstanceDestroy(ctx), @@ -3506,7 +3506,7 @@ func TestAccRDSInstance_cloudWatchLogsExport(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckInstanceDestroy(ctx), @@ -3547,7 +3547,7 @@ func TestAccRDSInstance_EnabledCloudWatchLogsExports_mySQL(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckInstanceDestroy(ctx), @@ -3603,7 +3603,7 @@ func TestAccRDSInstance_EnabledCloudWatchLogsExports_msSQL(t *testing.T) { resourceName := "aws_db_instance.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckInstanceDestroy(ctx), @@ -3641,7 +3641,7 @@ func TestAccRDSInstance_EnabledCloudWatchLogsExports_oracle(t *testing.T) { resourceName := "aws_db_instance.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckInstanceDestroy(ctx), @@ -3680,7 +3680,7 @@ func TestAccRDSInstance_EnabledCloudWatchLogsExports_postgresql(t *testing.T) { resourceName := "aws_db_instance.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckInstanceDestroy(ctx), @@ -3720,7 +3720,7 @@ func TestAccRDSInstance_noDeleteAutomatedBackups(t *testing.T) { resourceName := "aws_db_instance.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckInstanceAutomatedBackupsDelete(ctx), @@ -3747,7 +3747,7 @@ func TestAccRDSInstance_PerformanceInsightsEnabled_disabledToEnabled(t *testing. resourceName := "aws_db_instance.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPerformanceInsightsDefaultVersionPreCheck(ctx, t, "mysql") }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPerformanceInsightsDefaultVersionPreCheck(ctx, t, "mysql") }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClusterDestroy(ctx), @@ -3792,7 +3792,7 @@ func TestAccRDSInstance_PerformanceInsightsEnabled_enabledToDisabled(t *testing. resourceName := "aws_db_instance.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPerformanceInsightsDefaultVersionPreCheck(ctx, t, "mysql") }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPerformanceInsightsDefaultVersionPreCheck(ctx, t, "mysql") }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClusterDestroy(ctx), @@ -3838,7 +3838,7 @@ func TestAccRDSInstance_performanceInsightsKMSKeyID(t *testing.T) { resourceName := "aws_db_instance.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPerformanceInsightsDefaultVersionPreCheck(ctx, t, "mysql") }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPerformanceInsightsDefaultVersionPreCheck(ctx, t, "mysql") }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClusterDestroy(ctx), @@ -3893,7 +3893,7 @@ func TestAccRDSInstance_performanceInsightsRetentionPeriod(t *testing.T) { resourceName := "aws_db_instance.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPerformanceInsightsDefaultVersionPreCheck(ctx, t, "mysql") }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPerformanceInsightsDefaultVersionPreCheck(ctx, t, "mysql") }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClusterDestroy(ctx), @@ -3951,7 +3951,7 @@ func TestAccRDSInstance_ReplicateSourceDB_performanceInsightsEnabled(t *testing. resourceName := "aws_db_instance.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPerformanceInsightsDefaultVersionPreCheck(ctx, t, "mysql") }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPerformanceInsightsDefaultVersionPreCheck(ctx, t, "mysql") }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckInstanceDestroy(ctx), @@ -3987,7 +3987,7 @@ func TestAccRDSInstance_SnapshotIdentifier_performanceInsightsEnabled(t *testing resourceName := "aws_db_instance.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPerformanceInsightsDefaultVersionPreCheck(ctx, t, "mysql") }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPerformanceInsightsDefaultVersionPreCheck(ctx, t, "mysql") }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckInstanceDestroy(ctx), @@ -4019,7 +4019,7 @@ func TestAccRDSInstance_caCertificateIdentifier(t *testing.T) { dataSourceName := "data.aws_rds_certificate.latest" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckInstanceDestroy(ctx), @@ -4047,7 +4047,7 @@ func TestAccRDSInstance_RestoreToPointInTime_sourceIdentifier(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckInstanceDestroy(ctx), @@ -4089,7 +4089,7 @@ func TestAccRDSInstance_RestoreToPointInTime_sourceResourceID(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckInstanceDestroy(ctx), @@ -4131,7 +4131,7 @@ func TestAccRDSInstance_RestoreToPointInTime_monitoring(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckInstanceDestroy(ctx), @@ -4160,7 +4160,7 @@ func TestAccRDSInstance_NationalCharacterSet_oracle(t *testing.T) { resourceName := "aws_db_instance.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckInstanceDestroy(ctx), @@ -4200,7 +4200,7 @@ func TestAccRDSInstance_NoNationalCharacterSet_oracle(t *testing.T) { resourceName := "aws_db_instance.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckInstanceDestroy(ctx), @@ -4235,7 +4235,7 @@ func TestAccRDSInstance_coIPEnabled(t *testing.T) { resourceName := "aws_db_instance.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckOutpostsOutposts(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckOutpostsOutposts(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckInstanceDestroy(ctx), @@ -4260,7 +4260,7 @@ func TestAccRDSInstance_CoIPEnabled_disabledToEnabled(t *testing.T) { resourceName := "aws_db_instance.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckOutpostsOutposts(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckOutpostsOutposts(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckInstanceDestroy(ctx), @@ -4301,7 +4301,7 @@ func TestAccRDSInstance_CoIPEnabled_enabledToDisabled(t *testing.T) { resourceName := "aws_db_instance.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckOutpostsOutposts(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckOutpostsOutposts(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckInstanceDestroy(ctx), @@ -4343,7 +4343,7 @@ func TestAccRDSInstance_CoIPEnabled_restoreToPointInTime(t *testing.T) { resourceName := "aws_db_instance.restore" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckOutpostsOutposts(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckOutpostsOutposts(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckInstanceDestroy(ctx), @@ -4385,7 +4385,7 @@ func TestAccRDSInstance_CoIPEnabled_snapshotIdentifier(t *testing.T) { resourceName := "aws_db_instance.restore" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckOutpostsOutposts(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckOutpostsOutposts(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckInstanceDestroy(ctx), @@ -4414,7 +4414,7 @@ func TestAccRDSInstance_license(t *testing.T) { resourceName := "aws_db_instance.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckInstanceDestroy(ctx), @@ -4460,7 +4460,7 @@ func TestAccRDSInstance_BlueGreenDeployment_updateEngineVersion(t *testing.T) { resourceName := "aws_db_instance.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckInstanceDestroy(ctx), @@ -4511,7 +4511,7 @@ func TestAccRDSInstance_BlueGreenDeployment_updateParameterGroup(t *testing.T) { parameterGroupResourceName := "aws_db_parameter_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckInstanceDestroy(ctx), @@ -4565,7 +4565,7 @@ func TestAccRDSInstance_BlueGreenDeployment_tags(t *testing.T) { resourceName := "aws_db_instance.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckInstanceDestroy(ctx), @@ -4615,7 +4615,7 @@ func TestAccRDSInstance_BlueGreenDeployment_updateInstanceClass(t *testing.T) { resourceName := "aws_db_instance.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckInstanceDestroy(ctx), @@ -4666,7 +4666,7 @@ func TestAccRDSInstance_BlueGreenDeployment_updateAndPromoteReplica(t *testing.T sourceResourceName := "aws_db_instance.source" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckInstanceDestroy(ctx), @@ -4717,7 +4717,7 @@ func TestAccRDSInstance_BlueGreenDeployment_updateAndEnableBackups(t *testing.T) resourceName := "aws_db_instance.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckInstanceDestroy(ctx), @@ -4769,7 +4769,7 @@ func TestAccRDSInstance_BlueGreenDeployment_deletionProtection(t *testing.T) { resourceName := "aws_db_instance.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckInstanceDestroy(ctx), @@ -4833,7 +4833,7 @@ func TestAccRDSInstance_BlueGreenDeployment_updateWithDeletionProtection(t *test resourceName := "aws_db_instance.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckInstanceDestroy(ctx), @@ -4908,7 +4908,7 @@ func TestAccRDSInstance_gp3MySQL(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckInstanceDestroy(ctx), @@ -4961,7 +4961,7 @@ func TestAccRDSInstance_gp3Postgres(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckInstanceDestroy(ctx), @@ -5014,7 +5014,7 @@ func TestAccRDSInstance_gp3SQLServer(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckInstanceDestroy(ctx), @@ -5067,7 +5067,7 @@ func TestAccRDSInstance_storageThroughput(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckInstanceDestroy(ctx), @@ -5118,7 +5118,7 @@ func TestAccRDSInstance_storageTypePostgres(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckInstanceDestroy(ctx), diff --git a/internal/service/rds/instances_data_source_test.go b/internal/service/rds/instances_data_source_test.go index 5735a7f55d4e..5ee8c53340fb 100644 --- a/internal/service/rds/instances_data_source_test.go +++ b/internal/service/rds/instances_data_source_test.go @@ -18,7 +18,7 @@ func TestAccRDSInstancesDataSource_filter(t *testing.T) { resourceName := "aws_db_instance.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckInstanceDestroy(ctx), diff --git a/internal/service/rds/option_group_test.go b/internal/service/rds/option_group_test.go index 89c6a01ddb2a..ae9a109223ac 100644 --- a/internal/service/rds/option_group_test.go +++ b/internal/service/rds/option_group_test.go @@ -24,7 +24,7 @@ func TestAccRDSOptionGroup_basic(t *testing.T) { resourceName := "aws_db_option_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckOptionGroupDestroy(ctx), @@ -59,7 +59,7 @@ func TestAccRDSOptionGroup_timeoutBlock(t *testing.T) { resourceName := "aws_db_option_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckOptionGroupDestroy(ctx), @@ -86,7 +86,7 @@ func TestAccRDSOptionGroup_namePrefix(t *testing.T) { var v rds.OptionGroup resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckOptionGroupDestroy(ctx), @@ -113,7 +113,7 @@ func TestAccRDSOptionGroup_generatedName(t *testing.T) { var v rds.OptionGroup resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckOptionGroupDestroy(ctx), @@ -141,7 +141,7 @@ func TestAccRDSOptionGroup_optionGroupDescription(t *testing.T) { resourceName := "aws_db_option_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckOptionGroupDestroy(ctx), @@ -173,7 +173,7 @@ func TestAccRDSOptionGroup_basicDestroyWithInstance(t *testing.T) { resourceName := "aws_db_option_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckOptionGroupDestroy(ctx), @@ -198,7 +198,7 @@ func TestAccRDSOptionGroup_Option_optionSettings(t *testing.T) { resourceName := "aws_db_option_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckOptionGroupDestroy(ctx), @@ -251,7 +251,7 @@ func TestAccRDSOptionGroup_OptionOptionSettings_iamRole(t *testing.T) { resourceName := "aws_db_option_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckOptionGroupDestroy(ctx), @@ -282,7 +282,7 @@ func TestAccRDSOptionGroup_sqlServerOptionsUpdate(t *testing.T) { resourceName := "aws_db_option_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckOptionGroupDestroy(ctx), @@ -319,7 +319,7 @@ func TestAccRDSOptionGroup_oracleOptionsUpdate(t *testing.T) { resourceName := "aws_db_option_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckOptionGroupDestroy(ctx), @@ -361,7 +361,7 @@ func TestAccRDSOptionGroup_OptionOptionSettings_multipleNonDefault(t *testing.T) resourceName := "aws_db_option_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckOptionGroupDestroy(ctx), @@ -397,7 +397,7 @@ func TestAccRDSOptionGroup_multipleOptions(t *testing.T) { resourceName := "aws_db_option_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckOptionGroupDestroy(ctx), @@ -427,7 +427,7 @@ func TestAccRDSOptionGroup_tags(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckOptionGroupDestroy(ctx), @@ -475,7 +475,7 @@ func TestAccRDSOptionGroup_Tags_withOptions(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckOptionGroupDestroy(ctx), diff --git a/internal/service/rds/orderable_instance_data_source_test.go b/internal/service/rds/orderable_instance_data_source_test.go index 4230d3e68a30..badc63a8ac37 100644 --- a/internal/service/rds/orderable_instance_data_source_test.go +++ b/internal/service/rds/orderable_instance_data_source_test.go @@ -20,7 +20,7 @@ func TestAccRDSOrderableInstanceDataSource_basic(t *testing.T) { storageType := "standard" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccOrderableInstancePreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccOrderableInstancePreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: nil, @@ -49,7 +49,7 @@ func TestAccRDSOrderableInstanceDataSource_preferredClass(t *testing.T) { preferredClass := "db.t3.micro" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccOrderableInstancePreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccOrderableInstancePreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: nil, @@ -73,7 +73,7 @@ func TestAccRDSOrderableInstanceDataSource_preferredVersion(t *testing.T) { dataSourceName := "data.aws_rds_orderable_db_instance.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccOrderableInstancePreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccOrderableInstancePreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: nil, @@ -97,7 +97,7 @@ func TestAccRDSOrderableInstanceDataSource_preferredClassAndVersion(t *testing.T dataSourceName := "data.aws_rds_orderable_db_instance.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccOrderableInstancePreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccOrderableInstancePreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: nil, @@ -122,7 +122,7 @@ func TestAccRDSOrderableInstanceDataSource_supportsEnhancedMonitoring(t *testing dataSourceName := "data.aws_rds_orderable_db_instance.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccOrderableInstancePreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccOrderableInstancePreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: nil, @@ -146,7 +146,7 @@ func TestAccRDSOrderableInstanceDataSource_supportsIAMDatabaseAuthentication(t * dataSourceName := "data.aws_rds_orderable_db_instance.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccOrderableInstancePreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccOrderableInstancePreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: nil, @@ -170,7 +170,7 @@ func TestAccRDSOrderableInstanceDataSource_supportsIops(t *testing.T) { dataSourceName := "data.aws_rds_orderable_db_instance.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccOrderableInstancePreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccOrderableInstancePreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: nil, @@ -194,7 +194,7 @@ func TestAccRDSOrderableInstanceDataSource_supportsKerberosAuthentication(t *tes dataSourceName := "data.aws_rds_orderable_db_instance.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccOrderableInstancePreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccOrderableInstancePreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: nil, @@ -219,7 +219,7 @@ func TestAccRDSOrderableInstanceDataSource_supportsPerformanceInsights(t *testin resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) testAccOrderableInstancePreCheck(ctx, t) testAccPerformanceInsightsDefaultVersionPreCheck(ctx, t, "mysql") }, @@ -246,7 +246,7 @@ func TestAccRDSOrderableInstanceDataSource_supportsStorageAutoScaling(t *testing dataSourceName := "data.aws_rds_orderable_db_instance.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccOrderableInstancePreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccOrderableInstancePreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: nil, @@ -270,7 +270,7 @@ func TestAccRDSOrderableInstanceDataSource_supportsStorageEncryption(t *testing. dataSourceName := "data.aws_rds_orderable_db_instance.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccOrderableInstancePreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccOrderableInstancePreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: nil, diff --git a/internal/service/rds/parameter_group_test.go b/internal/service/rds/parameter_group_test.go index 16ad1c284767..a8a669d10bde 100644 --- a/internal/service/rds/parameter_group_test.go +++ b/internal/service/rds/parameter_group_test.go @@ -25,7 +25,7 @@ func TestAccRDSParameterGroup_basic(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckParameterGroupDestroy(ctx), @@ -118,7 +118,7 @@ func TestAccRDSParameterGroup_caseWithMixedParameters(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckParameterGroupDestroy(ctx), @@ -138,7 +138,7 @@ func TestAccRDSParameterGroup_limit(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckParameterGroupDestroy(ctx), @@ -507,7 +507,7 @@ func TestAccRDSParameterGroup_disappears(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckParameterGroupDestroy(ctx), @@ -529,7 +529,7 @@ func TestAccRDSParameterGroup_namePrefix(t *testing.T) { var v rds.DBParameterGroup resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckParameterGroupDestroy(ctx), @@ -550,7 +550,7 @@ func TestAccRDSParameterGroup_generatedName(t *testing.T) { var v rds.DBParameterGroup resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckParameterGroupDestroy(ctx), @@ -572,7 +572,7 @@ func TestAccRDSParameterGroup_withApplyMethod(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckParameterGroupDestroy(ctx), @@ -613,7 +613,7 @@ func TestAccRDSParameterGroup_only(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckParameterGroupDestroy(ctx), @@ -643,7 +643,7 @@ func TestAccRDSParameterGroup_matchDefault(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckParameterGroupDestroy(ctx), @@ -673,7 +673,7 @@ func TestAccRDSParameterGroup_updateParameters(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckParameterGroupDestroy(ctx), @@ -734,7 +734,7 @@ func TestAccRDSParameterGroup_caseParameters(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckParameterGroupDestroy(ctx), diff --git a/internal/service/rds/proxy_data_source_test.go b/internal/service/rds/proxy_data_source_test.go index 67967fbed30b..791dc982c373 100644 --- a/internal/service/rds/proxy_data_source_test.go +++ b/internal/service/rds/proxy_data_source_test.go @@ -20,7 +20,7 @@ func TestAccRDSProxyDataSource_basic(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ diff --git a/internal/service/rds/proxy_default_target_group_test.go b/internal/service/rds/proxy_default_target_group_test.go index b03013e9c438..a828b687a9a2 100644 --- a/internal/service/rds/proxy_default_target_group_test.go +++ b/internal/service/rds/proxy_default_target_group_test.go @@ -28,7 +28,7 @@ func TestAccRDSProxyDefaultTargetGroup_basic(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccDBProxyPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccDBProxyPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckProxyTargetGroupDestroy(ctx), @@ -68,7 +68,7 @@ func TestAccRDSProxyDefaultTargetGroup_emptyConnectionPool(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccDBProxyPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccDBProxyPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckProxyTargetGroupDestroy(ctx), @@ -108,7 +108,7 @@ func TestAccRDSProxyDefaultTargetGroup_connectionBorrowTimeout(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccDBProxyPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccDBProxyPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckProxyTargetGroupDestroy(ctx), @@ -147,7 +147,7 @@ func TestAccRDSProxyDefaultTargetGroup_initQuery(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccDBProxyPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccDBProxyPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckProxyTargetGroupDestroy(ctx), @@ -186,7 +186,7 @@ func TestAccRDSProxyDefaultTargetGroup_maxConnectionsPercent(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccDBProxyPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccDBProxyPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckProxyTargetGroupDestroy(ctx), @@ -225,7 +225,7 @@ func TestAccRDSProxyDefaultTargetGroup_maxIdleConnectionsPercent(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccDBProxyPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccDBProxyPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckProxyTargetGroupDestroy(ctx), @@ -265,7 +265,7 @@ func TestAccRDSProxyDefaultTargetGroup_sessionPinningFilters(t *testing.T) { sessionPinningFilters := "EXCLUDE_VARIABLE_SETS" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccDBProxyPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccDBProxyPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckProxyTargetGroupDestroy(ctx), @@ -305,7 +305,7 @@ func TestAccRDSProxyDefaultTargetGroup_disappears(t *testing.T) { resourceName := "aws_db_proxy_default_target_group.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccDBProxyPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccDBProxyPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckProxyTargetGroupDestroy(ctx), diff --git a/internal/service/rds/proxy_endpoint_test.go b/internal/service/rds/proxy_endpoint_test.go index 1768ffc14dc6..cde63a8c68f3 100644 --- a/internal/service/rds/proxy_endpoint_test.go +++ b/internal/service/rds/proxy_endpoint_test.go @@ -27,7 +27,7 @@ func TestAccRDSProxyEndpoint_basic(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccDBProxyEndpointPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccDBProxyEndpointPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckProxyEndpointDestroy(ctx), @@ -70,7 +70,7 @@ func TestAccRDSProxyEndpoint_targetRole(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccDBProxyEndpointPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccDBProxyEndpointPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckProxyEndpointDestroy(ctx), @@ -102,7 +102,7 @@ func TestAccRDSProxyEndpoint_vpcSecurityGroupIDs(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccDBProxyEndpointPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccDBProxyEndpointPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckProxyEndpointDestroy(ctx), @@ -144,7 +144,7 @@ func TestAccRDSProxyEndpoint_tags(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccDBProxyEndpointPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccDBProxyEndpointPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckProxyEndpointDestroy(ctx), @@ -193,7 +193,7 @@ func TestAccRDSProxyEndpoint_disappears(t *testing.T) { resourceName := "aws_db_proxy_endpoint.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccDBProxyEndpointPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccDBProxyEndpointPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckProxyEndpointDestroy(ctx), @@ -220,7 +220,7 @@ func TestAccRDSProxyEndpoint_Disappears_proxy(t *testing.T) { resourceName := "aws_db_proxy_endpoint.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccDBProxyEndpointPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccDBProxyEndpointPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckProxyEndpointDestroy(ctx), diff --git a/internal/service/rds/proxy_target_test.go b/internal/service/rds/proxy_target_test.go index 18df3058788c..2cd9265e85a8 100644 --- a/internal/service/rds/proxy_target_test.go +++ b/internal/service/rds/proxy_target_test.go @@ -26,7 +26,7 @@ func TestAccRDSProxyTarget_instance(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccDBProxyPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccDBProxyPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckProxyTargetDestroy(ctx), @@ -63,7 +63,7 @@ func TestAccRDSProxyTarget_cluster(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccDBProxyPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccDBProxyPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckProxyTargetDestroy(ctx), @@ -100,7 +100,7 @@ func TestAccRDSProxyTarget_disappears(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccDBProxyPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccDBProxyPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckProxyTargetDestroy(ctx), diff --git a/internal/service/rds/proxy_test.go b/internal/service/rds/proxy_test.go index b41f453f6082..4b0080bca4ff 100644 --- a/internal/service/rds/proxy_test.go +++ b/internal/service/rds/proxy_test.go @@ -28,7 +28,7 @@ func TestAccRDSProxy_basic(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccDBProxyPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccDBProxyPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckProxyDestroy(ctx), @@ -75,7 +75,7 @@ func TestAccRDSProxy_name(t *testing.T) { nName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccDBProxyPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccDBProxyPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckProxyDestroy(ctx), @@ -114,7 +114,7 @@ func TestAccRDSProxy_debugLogging(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccDBProxyPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccDBProxyPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckProxyDestroy(ctx), @@ -153,7 +153,7 @@ func TestAccRDSProxy_idleClientTimeout(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccDBProxyPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccDBProxyPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckProxyDestroy(ctx), @@ -192,7 +192,7 @@ func TestAccRDSProxy_requireTLS(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccDBProxyPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccDBProxyPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckProxyDestroy(ctx), @@ -232,7 +232,7 @@ func TestAccRDSProxy_roleARN(t *testing.T) { nName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccDBProxyPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccDBProxyPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckProxyDestroy(ctx), @@ -272,7 +272,7 @@ func TestAccRDSProxy_vpcSecurityGroupIDs(t *testing.T) { nName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccDBProxyPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccDBProxyPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckProxyDestroy(ctx), @@ -314,7 +314,7 @@ func TestAccRDSProxy_authDescription(t *testing.T) { description := "foo" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccDBProxyPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccDBProxyPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckProxyDestroy(ctx), @@ -354,7 +354,7 @@ func TestAccRDSProxy_authIAMAuth(t *testing.T) { iamAuth := "REQUIRED" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccDBProxyPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccDBProxyPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckProxyDestroy(ctx), @@ -394,7 +394,7 @@ func TestAccRDSProxy_authSecretARN(t *testing.T) { nName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccDBProxyPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccDBProxyPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckProxyDestroy(ctx), @@ -433,7 +433,7 @@ func TestAccRDSProxy_authUsername(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccDBProxyPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccDBProxyPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckProxyDestroy(ctx), @@ -462,7 +462,7 @@ func TestAccRDSProxy_tags(t *testing.T) { value := "bar" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccDBProxyPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccDBProxyPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckProxyDestroy(ctx), @@ -500,7 +500,7 @@ func TestAccRDSProxy_disappears(t *testing.T) { resourceName := "aws_db_proxy.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccDBProxyPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccDBProxyPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckProxyDestroy(ctx), 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 6e70061c6805..96896c34dd3f 100644 --- a/internal/service/rds/reserved_instance_offering_data_source_test.go +++ b/internal/service/rds/reserved_instance_offering_data_source_test.go @@ -12,7 +12,7 @@ func TestAccRDSInstanceOffering_basic(t *testing.T) { dataSourceName := "data.aws_rds_reserved_instance_offering.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: nil, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), diff --git a/internal/service/rds/reserved_instance_test.go b/internal/service/rds/reserved_instance_test.go index 2ed153c6636a..9e90ba05ec0b 100644 --- a/internal/service/rds/reserved_instance_test.go +++ b/internal/service/rds/reserved_instance_test.go @@ -31,7 +31,7 @@ func TestAccRDSReservedInstance_basic(t *testing.T) { instanceCount := "1" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: nil, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), diff --git a/internal/service/rds/snapshot_copy_test.go b/internal/service/rds/snapshot_copy_test.go index 35bd49d00118..05c2d0e5f85d 100644 --- a/internal/service/rds/snapshot_copy_test.go +++ b/internal/service/rds/snapshot_copy_test.go @@ -26,7 +26,7 @@ func TestAccRDSSnapshotCopy_basic(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSnapshotCopyDestroy(ctx), @@ -57,7 +57,7 @@ func TestAccRDSSnapshotCopy_tags(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSnapshotCopyDestroy(ctx), @@ -107,7 +107,7 @@ func TestAccRDSSnapshotCopy_disappears(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSnapshotCopyDestroy(ctx), diff --git a/internal/service/rds/snapshot_data_source_test.go b/internal/service/rds/snapshot_data_source_test.go index d47803fcfb81..fe6a9355925d 100644 --- a/internal/service/rds/snapshot_data_source_test.go +++ b/internal/service/rds/snapshot_data_source_test.go @@ -18,7 +18,7 @@ func TestAccRDSSnapshotDataSource_basic(t *testing.T) { rInt := sdkacctest.RandInt() resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ diff --git a/internal/service/rds/snapshot_test.go b/internal/service/rds/snapshot_test.go index 7f355b0d917a..435a6a3f1e4c 100644 --- a/internal/service/rds/snapshot_test.go +++ b/internal/service/rds/snapshot_test.go @@ -27,7 +27,7 @@ func TestAccRDSSnapshot_basic(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDBSnapshotDestroy(ctx), @@ -60,7 +60,7 @@ func TestAccRDSSnapshot_tags(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDBSnapshotDestroy(ctx), @@ -110,7 +110,7 @@ func TestAccRDSSnapshot_disappears(t *testing.T) { resourceName := "aws_db_snapshot.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDBSnapshotDestroy(ctx), diff --git a/internal/service/rds/subnet_group_data_source_test.go b/internal/service/rds/subnet_group_data_source_test.go index ecbdbc7ffb3b..bad5e488e368 100644 --- a/internal/service/rds/subnet_group_data_source_test.go +++ b/internal/service/rds/subnet_group_data_source_test.go @@ -15,7 +15,7 @@ func TestAccRDSSubnetGroupDataSource_basic(t *testing.T) { dataSourceName := "data.aws_db_subnet_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ diff --git a/internal/service/rds/subnet_group_test.go b/internal/service/rds/subnet_group_test.go index 90d9b3b86fa8..71fa1b4d320e 100644 --- a/internal/service/rds/subnet_group_test.go +++ b/internal/service/rds/subnet_group_test.go @@ -23,7 +23,7 @@ func TestAccRDSSubnetGroup_basic(t *testing.T) { resourceName := "aws_db_subnet_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSubnetGroupDestroy(ctx), @@ -58,7 +58,7 @@ func TestAccRDSSubnetGroup_disappears(t *testing.T) { resourceName := "aws_db_subnet_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSubnetGroupDestroy(ctx), @@ -82,7 +82,7 @@ func TestAccRDSSubnetGroup_nameGenerated(t *testing.T) { resourceName := "aws_db_subnet_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSubnetGroupDestroy(ctx), @@ -110,7 +110,7 @@ func TestAccRDSSubnetGroup_namePrefix(t *testing.T) { resourceName := "aws_db_subnet_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSubnetGroupDestroy(ctx), @@ -139,7 +139,7 @@ func TestAccRDSSubnetGroup_tags(t *testing.T) { resourceName := "aws_db_subnet_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSubnetGroupDestroy(ctx), @@ -186,7 +186,7 @@ func TestAccRDSSubnetGroup_dualStack(t *testing.T) { rName := fmt.Sprintf("tf-test-%d", sdkacctest.RandInt()) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSubnetGroupDestroy(ctx), @@ -211,7 +211,7 @@ func TestAccRDSSubnetGroup_updateDescription(t *testing.T) { resourceName := "aws_db_subnet_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSubnetGroupDestroy(ctx), @@ -248,7 +248,7 @@ func TestAccRDSSubnetGroup_updateSubnets(t *testing.T) { resourceName := "aws_db_subnet_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, rds.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSubnetGroupDestroy(ctx), From e4e269cb0ace0249035b1ab3691762d2b9f37bd7 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Fri, 24 Feb 2023 16:37:19 -0500 Subject: [PATCH 213/763] Add 'Context' argument to 'acctest.PreCheck' for redshift. --- .../redshift/authentication_profile_test.go | 4 +- .../cluster_credentials_data_source_test.go | 2 +- .../redshift/cluster_data_source_test.go | 8 ++-- .../redshift/cluster_iam_roles_test.go | 4 +- internal/service/redshift/cluster_test.go | 44 +++++++++---------- .../service/redshift/endpoint_access_test.go | 8 ++-- .../redshift/endpoint_authorization_test.go | 8 ++-- .../redshift/event_subscription_test.go | 10 ++--- .../redshift/hsm_client_certificate_test.go | 6 +-- .../redshift/hsm_configuration_test.go | 6 +-- .../orderable_cluster_data_source_test.go | 8 ++-- .../service/redshift/parameter_group_test.go | 8 ++-- internal/service/redshift/partner_test.go | 6 +-- .../service/redshift/scheduled_action_test.go | 12 ++--- .../service_account_data_source_test.go | 4 +- .../redshift/snapshot_copy_grant_test.go | 6 +-- .../snapshot_schedule_association_test.go | 6 +-- .../redshift/snapshot_schedule_test.go | 12 ++--- .../redshift/subnet_group_data_source_test.go | 2 +- .../service/redshift/subnet_group_test.go | 10 ++--- internal/service/redshift/usage_limit_test.go | 6 +-- 21 files changed, 90 insertions(+), 90 deletions(-) diff --git a/internal/service/redshift/authentication_profile_test.go b/internal/service/redshift/authentication_profile_test.go index 6422d9d07df5..e72c67b8354d 100644 --- a/internal/service/redshift/authentication_profile_test.go +++ b/internal/service/redshift/authentication_profile_test.go @@ -22,7 +22,7 @@ func TestAccRedshiftAuthenticationProfile_basic(t *testing.T) { rNameUpdated := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, redshift.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckAuthenticationProfileDestroy(ctx), @@ -56,7 +56,7 @@ func TestAccRedshiftAuthenticationProfile_disappears(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, redshift.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckAuthenticationProfileDestroy(ctx), diff --git a/internal/service/redshift/cluster_credentials_data_source_test.go b/internal/service/redshift/cluster_credentials_data_source_test.go index 7a5077c741fa..63a49ebda40b 100644 --- a/internal/service/redshift/cluster_credentials_data_source_test.go +++ b/internal/service/redshift/cluster_credentials_data_source_test.go @@ -15,7 +15,7 @@ func TestAccRedshiftClusterCredentialsDataSource_basic(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, redshift.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ diff --git a/internal/service/redshift/cluster_data_source_test.go b/internal/service/redshift/cluster_data_source_test.go index 8f7b2ef9fac7..1553feda7918 100644 --- a/internal/service/redshift/cluster_data_source_test.go +++ b/internal/service/redshift/cluster_data_source_test.go @@ -16,7 +16,7 @@ func TestAccRedshiftClusterDataSource_basic(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, redshift.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ @@ -59,7 +59,7 @@ func TestAccRedshiftClusterDataSource_vpc(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, redshift.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ @@ -82,7 +82,7 @@ func TestAccRedshiftClusterDataSource_logging(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, redshift.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ @@ -104,7 +104,7 @@ func TestAccRedshiftClusterDataSource_availabilityZoneRelocationEnabled(t *testi rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, redshift.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ diff --git a/internal/service/redshift/cluster_iam_roles_test.go b/internal/service/redshift/cluster_iam_roles_test.go index cd74f349d7e6..6ee860482105 100644 --- a/internal/service/redshift/cluster_iam_roles_test.go +++ b/internal/service/redshift/cluster_iam_roles_test.go @@ -18,7 +18,7 @@ func TestAccRedshiftClusterIAMRoles_basic(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, redshift.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClusterDestroy(ctx), @@ -60,7 +60,7 @@ func TestAccRedshiftClusterIAMRoles_disappears(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, redshift.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClusterDestroy(ctx), diff --git a/internal/service/redshift/cluster_test.go b/internal/service/redshift/cluster_test.go index 55207ccd8080..fd386e91e10e 100644 --- a/internal/service/redshift/cluster_test.go +++ b/internal/service/redshift/cluster_test.go @@ -25,7 +25,7 @@ func TestAccRedshiftCluster_basic(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, redshift.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClusterDestroy(ctx), @@ -70,7 +70,7 @@ func TestAccRedshiftCluster_aqua(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, redshift.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClusterDestroy(ctx), @@ -118,7 +118,7 @@ func TestAccRedshiftCluster_disappears(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, redshift.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClusterDestroy(ctx), @@ -142,7 +142,7 @@ func TestAccRedshiftCluster_withFinalSnapshot(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, redshift.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClusterSnapshotDestroy(ctx, rName), @@ -176,7 +176,7 @@ func TestAccRedshiftCluster_kmsKey(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, redshift.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClusterDestroy(ctx), @@ -212,7 +212,7 @@ func TestAccRedshiftCluster_enhancedVPCRoutingEnabled(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, redshift.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClusterDestroy(ctx), @@ -254,7 +254,7 @@ func TestAccRedshiftCluster_loggingEnabled(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, redshift.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClusterDestroy(ctx), @@ -305,7 +305,7 @@ func TestAccRedshiftCluster_snapshotCopy(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckMultipleRegion(t, 2) }, ErrorCheck: acctest.ErrorCheck(t, redshift.EndpointsID), @@ -338,7 +338,7 @@ func TestAccRedshiftCluster_iamRoles(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, redshift.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClusterDestroy(ctx), @@ -368,7 +368,7 @@ func TestAccRedshiftCluster_publiclyAccessible(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, redshift.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClusterDestroy(ctx), @@ -399,7 +399,7 @@ func TestAccRedshiftCluster_updateNodeCount(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, redshift.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClusterDestroy(ctx), @@ -431,7 +431,7 @@ func TestAccRedshiftCluster_updateNodeType(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, redshift.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClusterDestroy(ctx), @@ -461,7 +461,7 @@ func TestAccRedshiftCluster_tags(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, redshift.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClusterDestroy(ctx), @@ -513,7 +513,7 @@ func TestAccRedshiftCluster_forceNewUsername(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, redshift.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClusterDestroy(ctx), @@ -546,7 +546,7 @@ func TestAccRedshiftCluster_changeAvailabilityZone(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, redshift.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClusterDestroy(ctx), @@ -579,7 +579,7 @@ func TestAccRedshiftCluster_changeAvailabilityZoneAndSetAvailabilityZoneRelocati rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, redshift.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClusterDestroy(ctx), @@ -613,7 +613,7 @@ func TestAccRedshiftCluster_changeAvailabilityZone_availabilityZoneRelocationNot rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, redshift.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClusterDestroy(ctx), @@ -642,7 +642,7 @@ func TestAccRedshiftCluster_changeEncryption1(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, redshift.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClusterDestroy(ctx), @@ -673,7 +673,7 @@ func TestAccRedshiftCluster_changeEncryption2(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, redshift.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClusterDestroy(ctx), @@ -704,7 +704,7 @@ func TestAccRedshiftCluster_availabilityZoneRelocation(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, redshift.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClusterDestroy(ctx), @@ -743,7 +743,7 @@ func TestAccRedshiftCluster_availabilityZoneRelocation_publiclyAccessible(t *tes rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, redshift.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClusterDestroy(ctx), @@ -763,7 +763,7 @@ func TestAccRedshiftCluster_restoreFromSnapshot(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, redshift.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClusterSnapshotDestroy(ctx, rName), diff --git a/internal/service/redshift/endpoint_access_test.go b/internal/service/redshift/endpoint_access_test.go index 4462bc9936d9..d8f4d95ff8fa 100644 --- a/internal/service/redshift/endpoint_access_test.go +++ b/internal/service/redshift/endpoint_access_test.go @@ -22,7 +22,7 @@ func TestAccRedshiftEndpointAccess_basic(t *testing.T) { resourceName := "aws_redshift_endpoint_access.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, redshift.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckEndpointAccessDestroy(ctx), @@ -57,7 +57,7 @@ func TestAccRedshiftEndpointAccess_sgs(t *testing.T) { resourceName := "aws_redshift_endpoint_access.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, redshift.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckEndpointAccessDestroy(ctx), @@ -92,7 +92,7 @@ func TestAccRedshiftEndpointAccess_disappears(t *testing.T) { resourceName := "aws_redshift_endpoint_access.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, redshift.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckEndpointAccessDestroy(ctx), @@ -116,7 +116,7 @@ func TestAccRedshiftEndpointAccess_disappears_cluster(t *testing.T) { resourceName := "aws_redshift_endpoint_access.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, redshift.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckEndpointAccessDestroy(ctx), diff --git a/internal/service/redshift/endpoint_authorization_test.go b/internal/service/redshift/endpoint_authorization_test.go index 4e510c39dc27..35939dcf40a3 100644 --- a/internal/service/redshift/endpoint_authorization_test.go +++ b/internal/service/redshift/endpoint_authorization_test.go @@ -23,7 +23,7 @@ func TestAccRedshiftEndpointAuthorization_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckAlternateAccount(t) }, ErrorCheck: acctest.ErrorCheck(t, redshift.EndpointsID), @@ -59,7 +59,7 @@ func TestAccRedshiftEndpointAuthorization_vpcs(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckAlternateAccount(t) }, ErrorCheck: acctest.ErrorCheck(t, redshift.EndpointsID), @@ -108,7 +108,7 @@ func TestAccRedshiftEndpointAuthorization_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckAlternateAccount(t) }, ErrorCheck: acctest.ErrorCheck(t, redshift.EndpointsID), @@ -135,7 +135,7 @@ func TestAccRedshiftEndpointAuthorization_disappears_cluster(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckAlternateAccount(t) }, ErrorCheck: acctest.ErrorCheck(t, redshift.EndpointsID), diff --git a/internal/service/redshift/event_subscription_test.go b/internal/service/redshift/event_subscription_test.go index 6b01cc90abb3..fe4e87ae6509 100644 --- a/internal/service/redshift/event_subscription_test.go +++ b/internal/service/redshift/event_subscription_test.go @@ -23,7 +23,7 @@ func TestAccRedshiftEventSubscription_basic(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, redshift.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckEventSubscriptionDestroy(ctx), @@ -73,7 +73,7 @@ func TestAccRedshiftEventSubscription_withSourceIDs(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, redshift.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckEventSubscriptionDestroy(ctx), @@ -114,7 +114,7 @@ func TestAccRedshiftEventSubscription_categoryUpdate(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, redshift.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckEventSubscriptionDestroy(ctx), @@ -151,7 +151,7 @@ func TestAccRedshiftEventSubscription_tags(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, redshift.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckEventSubscriptionDestroy(ctx), @@ -197,7 +197,7 @@ func TestAccRedshiftEventSubscription_disappears(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, redshift.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckEventSubscriptionDestroy(ctx), diff --git a/internal/service/redshift/hsm_client_certificate_test.go b/internal/service/redshift/hsm_client_certificate_test.go index 0298b6e7a1b6..43387fb803e9 100644 --- a/internal/service/redshift/hsm_client_certificate_test.go +++ b/internal/service/redshift/hsm_client_certificate_test.go @@ -22,7 +22,7 @@ func TestAccRedshiftHSMClientCertificate_basic(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, redshift.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckHSMClientCertificateDestroy(ctx), @@ -52,7 +52,7 @@ func TestAccRedshiftHSMClientCertificate_tags(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, redshift.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckHSMClientCertificateDestroy(ctx), @@ -96,7 +96,7 @@ func TestAccRedshiftHSMClientCertificate_disappears(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, redshift.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckHSMClientCertificateDestroy(ctx), diff --git a/internal/service/redshift/hsm_configuration_test.go b/internal/service/redshift/hsm_configuration_test.go index a88e5e24405b..71a42204a821 100644 --- a/internal/service/redshift/hsm_configuration_test.go +++ b/internal/service/redshift/hsm_configuration_test.go @@ -22,7 +22,7 @@ func TestAccRedshiftHSMConfiguration_basic(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, redshift.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckHSMConfigurationDestroy(ctx), @@ -52,7 +52,7 @@ func TestAccRedshiftHSMConfiguration_tags(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, redshift.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckHSMConfigurationDestroy(ctx), @@ -97,7 +97,7 @@ func TestAccRedshiftHSMConfiguration_disappears(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, redshift.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckHSMConfigurationDestroy(ctx), diff --git a/internal/service/redshift/orderable_cluster_data_source_test.go b/internal/service/redshift/orderable_cluster_data_source_test.go index 8268600a8325..ad9e976ade41 100644 --- a/internal/service/redshift/orderable_cluster_data_source_test.go +++ b/internal/service/redshift/orderable_cluster_data_source_test.go @@ -17,7 +17,7 @@ func TestAccRedshiftOrderableClusterDataSource_clusterType(t *testing.T) { dataSourceName := "data.aws_redshift_orderable_cluster.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccOrderableClusterPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccOrderableClusterPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, redshift.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: nil, @@ -37,7 +37,7 @@ func TestAccRedshiftOrderableClusterDataSource_clusterVersion(t *testing.T) { dataSourceName := "data.aws_redshift_orderable_cluster.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccOrderableClusterPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccOrderableClusterPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, redshift.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: nil, @@ -58,7 +58,7 @@ func TestAccRedshiftOrderableClusterDataSource_nodeType(t *testing.T) { nodeType := "dc2.8xlarge" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccOrderableClusterPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccOrderableClusterPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, redshift.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: nil, @@ -79,7 +79,7 @@ func TestAccRedshiftOrderableClusterDataSource_preferredNodeTypes(t *testing.T) preferredNodeType := "dc2.8xlarge" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccOrderableClusterPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccOrderableClusterPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, redshift.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: nil, diff --git a/internal/service/redshift/parameter_group_test.go b/internal/service/redshift/parameter_group_test.go index 28bffc19563f..3267eb637b0a 100644 --- a/internal/service/redshift/parameter_group_test.go +++ b/internal/service/redshift/parameter_group_test.go @@ -22,7 +22,7 @@ func TestAccRedshiftParameterGroup_basic(t *testing.T) { resourceName := "aws_redshift_parameter_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, redshift.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckParameterGroupDestroy(ctx), @@ -67,7 +67,7 @@ func TestAccRedshiftParameterGroup_disappears(t *testing.T) { resourceName := "aws_redshift_parameter_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, redshift.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckParameterGroupDestroy(ctx), @@ -91,7 +91,7 @@ func TestAccRedshiftParameterGroup_update(t *testing.T) { resourceName := "aws_redshift_parameter_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, redshift.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckParameterGroupDestroy(ctx), @@ -148,7 +148,7 @@ func TestAccRedshiftParameterGroup_tags(t *testing.T) { resourceName := "aws_redshift_parameter_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, redshift.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckParameterGroupDestroy(ctx), diff --git a/internal/service/redshift/partner_test.go b/internal/service/redshift/partner_test.go index 1cc3a626e0f2..82325463442f 100644 --- a/internal/service/redshift/partner_test.go +++ b/internal/service/redshift/partner_test.go @@ -21,7 +21,7 @@ func TestAccRedshiftPartner_basic(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, redshift.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckPartnerDestroy(ctx), @@ -52,7 +52,7 @@ func TestAccRedshiftPartner_disappears(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, redshift.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckPartnerDestroy(ctx), @@ -75,7 +75,7 @@ func TestAccRedshiftPartner_disappears_cluster(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, redshift.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckPartnerDestroy(ctx), diff --git a/internal/service/redshift/scheduled_action_test.go b/internal/service/redshift/scheduled_action_test.go index b0ffaace6a3f..05cb5fad036d 100644 --- a/internal/service/redshift/scheduled_action_test.go +++ b/internal/service/redshift/scheduled_action_test.go @@ -23,7 +23,7 @@ func TestAccRedshiftScheduledAction_basicPauseCluster(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, redshift.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckScheduledActionDestroy(ctx), @@ -80,7 +80,7 @@ func TestAccRedshiftScheduledAction_pauseClusterWithOptions(t *testing.T) { endTime := time.Now().UTC().Add(2 * time.Hour).Format(time.RFC3339) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, redshift.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckScheduledActionDestroy(ctx), @@ -118,7 +118,7 @@ func TestAccRedshiftScheduledAction_basicResumeCluster(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, redshift.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckScheduledActionDestroy(ctx), @@ -173,7 +173,7 @@ func TestAccRedshiftScheduledAction_basicResizeCluster(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, redshift.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckScheduledActionDestroy(ctx), @@ -228,7 +228,7 @@ func TestAccRedshiftScheduledAction_resizeClusterWithOptions(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, redshift.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckScheduledActionDestroy(ctx), @@ -270,7 +270,7 @@ func TestAccRedshiftScheduledAction_disappears(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, redshift.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckScheduledActionDestroy(ctx), diff --git a/internal/service/redshift/service_account_data_source_test.go b/internal/service/redshift/service_account_data_source_test.go index 804186a10788..35d0c141dbe0 100644 --- a/internal/service/redshift/service_account_data_source_test.go +++ b/internal/service/redshift/service_account_data_source_test.go @@ -15,7 +15,7 @@ func TestAccRedshiftServiceAccountDataSource_basic(t *testing.T) { dataSourceName := "data.aws_redshift_service_account.main" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, redshift.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ @@ -36,7 +36,7 @@ func TestAccRedshiftServiceAccountDataSource_region(t *testing.T) { dataSourceName := "data.aws_redshift_service_account.regional" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, redshift.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ diff --git a/internal/service/redshift/snapshot_copy_grant_test.go b/internal/service/redshift/snapshot_copy_grant_test.go index 74610c2e5396..6cc1ae48f2bd 100644 --- a/internal/service/redshift/snapshot_copy_grant_test.go +++ b/internal/service/redshift/snapshot_copy_grant_test.go @@ -21,7 +21,7 @@ func TestAccRedshiftSnapshotCopyGrant_basic(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, redshift.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSnapshotCopyGrantDestroy(ctx), @@ -50,7 +50,7 @@ func TestAccRedshiftSnapshotCopyGrant_update(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, redshift.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSnapshotCopyGrantDestroy(ctx), @@ -95,7 +95,7 @@ func TestAccRedshiftSnapshotCopyGrant_disappears(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, redshift.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSnapshotCopyGrantDestroy(ctx), diff --git a/internal/service/redshift/snapshot_schedule_association_test.go b/internal/service/redshift/snapshot_schedule_association_test.go index 5868060d5959..638a0784e65c 100644 --- a/internal/service/redshift/snapshot_schedule_association_test.go +++ b/internal/service/redshift/snapshot_schedule_association_test.go @@ -23,7 +23,7 @@ func TestAccRedshiftSnapshotScheduleAssociation_basic(t *testing.T) { clusterResourceName := "aws_redshift_cluster.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, redshift.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSnapshotScheduleAssociationDestroy(ctx), @@ -51,7 +51,7 @@ func TestAccRedshiftSnapshotScheduleAssociation_disappears(t *testing.T) { resourceName := "aws_redshift_snapshot_schedule_association.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, redshift.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSnapshotScheduleAssociationDestroy(ctx), @@ -75,7 +75,7 @@ func TestAccRedshiftSnapshotScheduleAssociation_disappears_cluster(t *testing.T) clusterResourceName := "aws_redshift_cluster.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, redshift.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSnapshotScheduleAssociationDestroy(ctx), diff --git a/internal/service/redshift/snapshot_schedule_test.go b/internal/service/redshift/snapshot_schedule_test.go index ef46590540e7..03b70eee3c22 100644 --- a/internal/service/redshift/snapshot_schedule_test.go +++ b/internal/service/redshift/snapshot_schedule_test.go @@ -22,7 +22,7 @@ func TestAccRedshiftSnapshotSchedule_basic(t *testing.T) { resourceName := "aws_redshift_snapshot_schedule.default" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, redshift.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSnapshotScheduleDestroy(ctx), @@ -60,7 +60,7 @@ func TestAccRedshiftSnapshotSchedule_withMultipleDefinition(t *testing.T) { resourceName := "aws_redshift_snapshot_schedule.default" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, redshift.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSnapshotScheduleDestroy(ctx), @@ -97,7 +97,7 @@ func TestAccRedshiftSnapshotSchedule_withIdentifierPrefix(t *testing.T) { resourceName := "aws_redshift_snapshot_schedule.default" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, redshift.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSnapshotScheduleDestroy(ctx), @@ -128,7 +128,7 @@ func TestAccRedshiftSnapshotSchedule_withDescription(t *testing.T) { resourceName := "aws_redshift_snapshot_schedule.default" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, redshift.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSnapshotScheduleDestroy(ctx), @@ -160,7 +160,7 @@ func TestAccRedshiftSnapshotSchedule_withTags(t *testing.T) { resourceName := "aws_redshift_snapshot_schedule.default" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, redshift.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSnapshotScheduleDestroy(ctx), @@ -204,7 +204,7 @@ func TestAccRedshiftSnapshotSchedule_withForceDestroy(t *testing.T) { clusterResourceName := "aws_redshift_cluster.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, redshift.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSnapshotScheduleDestroy(ctx), diff --git a/internal/service/redshift/subnet_group_data_source_test.go b/internal/service/redshift/subnet_group_data_source_test.go index c9f076476bbc..dd90946128bb 100644 --- a/internal/service/redshift/subnet_group_data_source_test.go +++ b/internal/service/redshift/subnet_group_data_source_test.go @@ -15,7 +15,7 @@ func TestAccRedshiftSubnetGroupDataSource_basic(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, redshift.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ diff --git a/internal/service/redshift/subnet_group_test.go b/internal/service/redshift/subnet_group_test.go index 07cdea81b258..1fc7e2ab8e3c 100644 --- a/internal/service/redshift/subnet_group_test.go +++ b/internal/service/redshift/subnet_group_test.go @@ -22,7 +22,7 @@ func TestAccRedshiftSubnetGroup_basic(t *testing.T) { resourceName := "aws_redshift_subnet_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, redshift.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSubnetGroupDestroy(ctx), @@ -51,7 +51,7 @@ func TestAccRedshiftSubnetGroup_disappears(t *testing.T) { resourceName := "aws_redshift_subnet_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, redshift.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSubnetGroupDestroy(ctx), @@ -75,7 +75,7 @@ func TestAccRedshiftSubnetGroup_updateDescription(t *testing.T) { resourceName := "aws_redshift_subnet_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, redshift.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSubnetGroupDestroy(ctx), @@ -110,7 +110,7 @@ func TestAccRedshiftSubnetGroup_updateSubnetIDs(t *testing.T) { resourceName := "aws_redshift_subnet_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, redshift.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSubnetGroupDestroy(ctx), @@ -145,7 +145,7 @@ func TestAccRedshiftSubnetGroup_tags(t *testing.T) { resourceName := "aws_redshift_subnet_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, redshift.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSubnetGroupDestroy(ctx), diff --git a/internal/service/redshift/usage_limit_test.go b/internal/service/redshift/usage_limit_test.go index 43f22861eb32..f54a315b942b 100644 --- a/internal/service/redshift/usage_limit_test.go +++ b/internal/service/redshift/usage_limit_test.go @@ -21,7 +21,7 @@ func TestAccRedshiftUsageLimit_basic(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, redshift.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckUsageLimitDestroy(ctx), @@ -67,7 +67,7 @@ func TestAccRedshiftUsageLimit_tags(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, redshift.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckUsageLimitDestroy(ctx), @@ -111,7 +111,7 @@ func TestAccRedshiftUsageLimit_disappears(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, redshift.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckUsageLimitDestroy(ctx), From 79f00dd2b20979330a0094ce166ed75764560a17 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Fri, 24 Feb 2023 16:37:19 -0500 Subject: [PATCH 214/763] Add 'Context' argument to 'acctest.PreCheck' for redshiftdata. --- internal/service/redshiftdata/statement_test.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/service/redshiftdata/statement_test.go b/internal/service/redshiftdata/statement_test.go index 0587a6a643dd..bf01fae24d87 100644 --- a/internal/service/redshiftdata/statement_test.go +++ b/internal/service/redshiftdata/statement_test.go @@ -21,7 +21,7 @@ func TestAccRedshiftDataStatement_basic(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, redshiftdataapiservice.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: acctest.CheckDestroyNoop, @@ -53,7 +53,7 @@ func TestAccRedshiftDataStatement_workgroup(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, redshiftdataapiservice.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: acctest.CheckDestroyNoop, From d7bc6b097c61d58e0870956dadfa74f8c14a7f9c Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Fri, 24 Feb 2023 16:37:20 -0500 Subject: [PATCH 215/763] Add 'Context' argument to 'acctest.PreCheck' for redshiftserverless. --- .../redshiftserverless/credentials_data_source_test.go | 2 +- .../service/redshiftserverless/endpoint_access_test.go | 6 +++--- internal/service/redshiftserverless/namespace_test.go | 8 ++++---- .../service/redshiftserverless/resource_policy_test.go | 4 ++-- internal/service/redshiftserverless/snapshot_test.go | 4 ++-- internal/service/redshiftserverless/usage_limit_test.go | 4 ++-- internal/service/redshiftserverless/workgroup_test.go | 6 +++--- 7 files changed, 17 insertions(+), 17 deletions(-) diff --git a/internal/service/redshiftserverless/credentials_data_source_test.go b/internal/service/redshiftserverless/credentials_data_source_test.go index 7aaeb6e23cf9..5dab28d18796 100644 --- a/internal/service/redshiftserverless/credentials_data_source_test.go +++ b/internal/service/redshiftserverless/credentials_data_source_test.go @@ -15,7 +15,7 @@ func TestAccRedshiftServerlessCredentialsDataSource_basic(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, redshiftserverless.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ diff --git a/internal/service/redshiftserverless/endpoint_access_test.go b/internal/service/redshiftserverless/endpoint_access_test.go index 4b68bb410477..5daca3c08743 100644 --- a/internal/service/redshiftserverless/endpoint_access_test.go +++ b/internal/service/redshiftserverless/endpoint_access_test.go @@ -22,7 +22,7 @@ func TestAccRedshiftServerlessEndpointAccess_basic(t *testing.T) { rName := sdkacctest.RandStringFromCharSet(30, sdkacctest.CharSetAlpha) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, redshiftserverless.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckEndpointAccessDestroy(ctx), @@ -65,7 +65,7 @@ func TestAccRedshiftServerlessEndpointAccess_disappears_workgroup(t *testing.T) rName := sdkacctest.RandStringFromCharSet(30, sdkacctest.CharSetAlpha) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, redshiftserverless.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckEndpointAccessDestroy(ctx), @@ -88,7 +88,7 @@ func TestAccRedshiftServerlessEndpointAccess_disappears(t *testing.T) { rName := sdkacctest.RandStringFromCharSet(30, sdkacctest.CharSetAlpha) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, redshiftserverless.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckEndpointAccessDestroy(ctx), diff --git a/internal/service/redshiftserverless/namespace_test.go b/internal/service/redshiftserverless/namespace_test.go index 5a5f20ae966c..73cd4c91fdd2 100644 --- a/internal/service/redshiftserverless/namespace_test.go +++ b/internal/service/redshiftserverless/namespace_test.go @@ -22,7 +22,7 @@ func TestAccRedshiftServerlessNamespace_basic(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, redshiftserverless.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckNamespaceDestroy(ctx), @@ -67,7 +67,7 @@ func TestAccRedshiftServerlessNamespace_user(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, redshiftserverless.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckNamespaceDestroy(ctx), @@ -100,7 +100,7 @@ func TestAccRedshiftServerlessNamespace_tags(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, redshiftserverless.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckNamespaceDestroy(ctx), @@ -144,7 +144,7 @@ func TestAccRedshiftServerlessNamespace_disappears(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, redshiftserverless.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckNamespaceDestroy(ctx), diff --git a/internal/service/redshiftserverless/resource_policy_test.go b/internal/service/redshiftserverless/resource_policy_test.go index d032aaee8f1a..ff81296858e2 100644 --- a/internal/service/redshiftserverless/resource_policy_test.go +++ b/internal/service/redshiftserverless/resource_policy_test.go @@ -22,7 +22,7 @@ func TestAccRedshiftServerlessResourcePolicy_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckAlternateAccount(t) }, ErrorCheck: acctest.ErrorCheck(t, redshiftserverless.EndpointsID), @@ -52,7 +52,7 @@ func TestAccRedshiftServerlessResourcePolicy_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckAlternateAccount(t) }, ErrorCheck: acctest.ErrorCheck(t, redshiftserverless.EndpointsID), diff --git a/internal/service/redshiftserverless/snapshot_test.go b/internal/service/redshiftserverless/snapshot_test.go index 83e000617a9c..0a4004fb576f 100644 --- a/internal/service/redshiftserverless/snapshot_test.go +++ b/internal/service/redshiftserverless/snapshot_test.go @@ -21,7 +21,7 @@ func TestAccRedshiftServerlessSnapshot_basic(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, redshiftserverless.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSnapshotDestroy(ctx), @@ -64,7 +64,7 @@ func TestAccRedshiftServerlessSnapshot_disappears(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, redshiftserverless.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSnapshotDestroy(ctx), diff --git a/internal/service/redshiftserverless/usage_limit_test.go b/internal/service/redshiftserverless/usage_limit_test.go index d12e20625103..9daa6159db6e 100644 --- a/internal/service/redshiftserverless/usage_limit_test.go +++ b/internal/service/redshiftserverless/usage_limit_test.go @@ -21,7 +21,7 @@ func TestAccRedshiftServerlessUsageLimit_basic(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, redshiftserverless.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckUsageLimitDestroy(ctx), @@ -60,7 +60,7 @@ func TestAccRedshiftServerlessUsageLimit_disappears(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, redshiftserverless.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckUsageLimitDestroy(ctx), diff --git a/internal/service/redshiftserverless/workgroup_test.go b/internal/service/redshiftserverless/workgroup_test.go index 376815ff304d..0d3c47d05d14 100644 --- a/internal/service/redshiftserverless/workgroup_test.go +++ b/internal/service/redshiftserverless/workgroup_test.go @@ -22,7 +22,7 @@ func TestAccRedshiftServerlessWorkgroup_basic(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, redshiftserverless.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckWorkgroupDestroy(ctx), @@ -53,7 +53,7 @@ func TestAccRedshiftServerlessWorkgroup_tags(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, redshiftserverless.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckWorkgroupDestroy(ctx), @@ -97,7 +97,7 @@ func TestAccRedshiftServerlessWorkgroup_disappears(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, redshiftserverless.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckWorkgroupDestroy(ctx), From b6fff47ad96f1b31089df0be71ae122e4b4797ea Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Fri, 24 Feb 2023 16:37:20 -0500 Subject: [PATCH 216/763] Add 'Context' argument to 'acctest.PreCheck' for resourceexplorer2. --- internal/service/resourceexplorer2/index_test.go | 8 ++++---- internal/service/resourceexplorer2/view_test.go | 10 +++++----- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/internal/service/resourceexplorer2/index_test.go b/internal/service/resourceexplorer2/index_test.go index 090b8731d5cd..3f0abcb1cab3 100644 --- a/internal/service/resourceexplorer2/index_test.go +++ b/internal/service/resourceexplorer2/index_test.go @@ -20,7 +20,7 @@ func testAccIndex_basic(t *testing.T) { resourceName := "aws_resourceexplorer2_index.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(names.ResourceExplorer2EndpointID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(names.ResourceExplorer2EndpointID, t) }, ErrorCheck: acctest.ErrorCheck(t, names.ResourceExplorer2EndpointID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckIndexDestroy(ctx), @@ -47,7 +47,7 @@ func testAccIndex_disappears(t *testing.T) { resourceName := "aws_resourceexplorer2_index.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(names.ResourceExplorer2EndpointID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(names.ResourceExplorer2EndpointID, t) }, ErrorCheck: acctest.ErrorCheck(t, names.ResourceExplorer2EndpointID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckIndexDestroy(ctx), @@ -69,7 +69,7 @@ func testAccIndex_tags(t *testing.T) { resourceName := "aws_resourceexplorer2_index.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(names.ResourceExplorer2EndpointID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(names.ResourceExplorer2EndpointID, t) }, ErrorCheck: acctest.ErrorCheck(t, names.ResourceExplorer2EndpointID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckIndexDestroy(ctx), @@ -113,7 +113,7 @@ func testAccIndex_type(t *testing.T) { resourceName := "aws_resourceexplorer2_index.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(names.ResourceExplorer2EndpointID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(names.ResourceExplorer2EndpointID, t) }, ErrorCheck: acctest.ErrorCheck(t, names.ResourceExplorer2EndpointID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckIndexDestroy(ctx), diff --git a/internal/service/resourceexplorer2/view_test.go b/internal/service/resourceexplorer2/view_test.go index 5adb0ebf5dc7..d033a80198ec 100644 --- a/internal/service/resourceexplorer2/view_test.go +++ b/internal/service/resourceexplorer2/view_test.go @@ -24,7 +24,7 @@ func testAccView_basic(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(names.ResourceExplorer2EndpointID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(names.ResourceExplorer2EndpointID, t) }, ErrorCheck: acctest.ErrorCheck(t, names.ResourceExplorer2EndpointID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckViewDestroy(ctx), @@ -57,7 +57,7 @@ func testAccView_defaultView(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(names.ResourceExplorer2EndpointID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(names.ResourceExplorer2EndpointID, t) }, ErrorCheck: acctest.ErrorCheck(t, names.ResourceExplorer2EndpointID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckViewDestroy(ctx), @@ -99,7 +99,7 @@ func testAccView_disappears(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(names.ResourceExplorer2EndpointID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(names.ResourceExplorer2EndpointID, t) }, ErrorCheck: acctest.ErrorCheck(t, names.ResourceExplorer2EndpointID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckViewDestroy(ctx), @@ -123,7 +123,7 @@ func testAccView_filter(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(names.ResourceExplorer2EndpointID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(names.ResourceExplorer2EndpointID, t) }, ErrorCheck: acctest.ErrorCheck(t, names.ResourceExplorer2EndpointID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckViewDestroy(ctx), @@ -172,7 +172,7 @@ func testAccView_tags(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(names.ResourceExplorer2EndpointID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(names.ResourceExplorer2EndpointID, t) }, ErrorCheck: acctest.ErrorCheck(t, names.ResourceExplorer2EndpointID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckViewDestroy(ctx), From 0eed0f2d8f0c846b2627111aabf9bc7d52b702cf Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Fri, 24 Feb 2023 16:37:20 -0500 Subject: [PATCH 217/763] Add 'Context' argument to 'acctest.PreCheck' for resourcegroups. --- internal/service/resourcegroups/group_test.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/internal/service/resourcegroups/group_test.go b/internal/service/resourcegroups/group_test.go index 7957e4d96b60..5132c9bd8b12 100644 --- a/internal/service/resourcegroups/group_test.go +++ b/internal/service/resourcegroups/group_test.go @@ -40,7 +40,7 @@ func TestAccResourceGroupsGroup_basic(t *testing.T) { }` resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, resourcegroups.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckResourceGroupDestroy(ctx), @@ -79,7 +79,7 @@ func TestAccResourceGroupsGroup_tags(t *testing.T) { desc1 := "Hello World" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, resourcegroups.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckResourceGroupDestroy(ctx), @@ -130,7 +130,7 @@ func TestAccResourceGroupsGroup_Configuration(t *testing.T) { configType2 := "AWS::ResourceGroups::Generic" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, resourcegroups.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckResourceGroupDestroy(ctx), @@ -196,7 +196,7 @@ func TestAccResourceGroupsGroup_configurationParametersOptional(t *testing.T) { configType2 := "AWS::EC2::CapacityReservationPool" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, resourcegroups.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckResourceGroupDestroy(ctx), From 33f0c7f55d679e982fbf7f61811585a744f13d75 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Fri, 24 Feb 2023 16:37:21 -0500 Subject: [PATCH 218/763] Add 'Context' argument to 'acctest.PreCheck' for resourcegroupstaggingapi. --- .../resources_data_source_test.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/internal/service/resourcegroupstaggingapi/resources_data_source_test.go b/internal/service/resourcegroupstaggingapi/resources_data_source_test.go index adce3034fdda..83ada58a7abb 100644 --- a/internal/service/resourcegroupstaggingapi/resources_data_source_test.go +++ b/internal/service/resourcegroupstaggingapi/resources_data_source_test.go @@ -16,7 +16,7 @@ func TestAccResourceGroupsTaggingAPIResourcesDataSource_tagFilter(t *testing.T) rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, resourcegroupstaggingapi.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ @@ -38,7 +38,7 @@ func TestAccResourceGroupsTaggingAPIResourcesDataSource_includeComplianceDetails rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, resourcegroupstaggingapi.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ @@ -59,7 +59,7 @@ func TestAccResourceGroupsTaggingAPIResourcesDataSource_resourceTypeFilters(t *t rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, resourcegroupstaggingapi.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ @@ -82,7 +82,7 @@ func TestAccResourceGroupsTaggingAPIResourcesDataSource_resourceARNList(t *testi rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, resourcegroupstaggingapi.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ From b48c7ebafe3426dfeaa213d16c149f7a03c369f5 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Fri, 24 Feb 2023 16:37:21 -0500 Subject: [PATCH 219/763] Add 'Context' argument to 'acctest.PreCheck' for rolesanywhere. --- internal/service/rolesanywhere/profile_test.go | 8 ++++---- internal/service/rolesanywhere/trust_anchor_test.go | 10 +++++----- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/internal/service/rolesanywhere/profile_test.go b/internal/service/rolesanywhere/profile_test.go index 1ee608b40e5f..89b2dbc8a6d6 100644 --- a/internal/service/rolesanywhere/profile_test.go +++ b/internal/service/rolesanywhere/profile_test.go @@ -22,7 +22,7 @@ func TestAccRolesAnywhereProfile_basic(t *testing.T) { resourceName := "aws_rolesanywhere_profile.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, names.RolesAnywhereEndpointID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckProfileDestroy(ctx), @@ -53,7 +53,7 @@ func TestAccRolesAnywhereProfile_tags(t *testing.T) { resourceName := "aws_rolesanywhere_profile.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, names.RolesAnywhereEndpointID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckProfileDestroy(ctx), @@ -99,7 +99,7 @@ func TestAccRolesAnywhereProfile_disappears(t *testing.T) { resourceName := "aws_rolesanywhere_profile.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, names.RolesAnywhereEndpointID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckProfileDestroy(ctx), @@ -123,7 +123,7 @@ func TestAccRolesAnywhereProfile_enabled(t *testing.T) { resourceName := "aws_rolesanywhere_profile.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, names.RolesAnywhereEndpointID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckProfileDestroy(ctx), diff --git a/internal/service/rolesanywhere/trust_anchor_test.go b/internal/service/rolesanywhere/trust_anchor_test.go index 9d04da6851a6..344a3098ac50 100644 --- a/internal/service/rolesanywhere/trust_anchor_test.go +++ b/internal/service/rolesanywhere/trust_anchor_test.go @@ -23,7 +23,7 @@ func TestAccRolesAnywhereTrustAnchor_basic(t *testing.T) { resourceName := "aws_rolesanywhere_trust_anchor.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, names.RolesAnywhereEndpointID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTrustAnchorDestroy(ctx), @@ -56,7 +56,7 @@ func TestAccRolesAnywhereTrustAnchor_tags(t *testing.T) { resourceName := "aws_rolesanywhere_trust_anchor.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, names.RolesAnywhereEndpointID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTrustAnchorDestroy(ctx), @@ -102,7 +102,7 @@ func TestAccRolesAnywhereTrustAnchor_disappears(t *testing.T) { resourceName := "aws_rolesanywhere_trust_anchor.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, names.RolesAnywhereEndpointID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTrustAnchorDestroy(ctx), @@ -125,7 +125,7 @@ func TestAccRolesAnywhereTrustAnchor_certificateBundle(t *testing.T) { resourceName := "aws_rolesanywhere_trust_anchor.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, names.RolesAnywhereEndpointID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTrustAnchorDestroy(ctx), @@ -156,7 +156,7 @@ func TestAccRolesAnywhereTrustAnchor_enabled(t *testing.T) { resourceName := "aws_rolesanywhere_trust_anchor.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, names.RolesAnywhereEndpointID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTrustAnchorDestroy(ctx), From 6de0dde8510d6297900e4c6273916e516331480e Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Fri, 24 Feb 2023 16:37:21 -0500 Subject: [PATCH 220/763] Add 'Context' argument to 'acctest.PreCheck' for route53. --- .../service/route53/cidr_collection_test.go | 4 +- .../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 | 24 +++--- .../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 | 86 +++++++++---------- ...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 | 12 +-- .../service/route53/zone_data_source_test.go | 10 +-- internal/service/route53/zone_test.go | 22 ++--- 16 files changed, 105 insertions(+), 105 deletions(-) diff --git a/internal/service/route53/cidr_collection_test.go b/internal/service/route53/cidr_collection_test.go index 9378fa809bd0..396c56046101 100644 --- a/internal/service/route53/cidr_collection_test.go +++ b/internal/service/route53/cidr_collection_test.go @@ -23,7 +23,7 @@ func TestAccRoute53CIDRCollection_basic(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, route53.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckCIDRCollectionDestroy(ctx), @@ -52,7 +52,7 @@ func TestAccRoute53CIDRCollection_disappears(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, route53.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckCIDRCollectionDestroy(ctx), diff --git a/internal/service/route53/cidr_location_test.go b/internal/service/route53/cidr_location_test.go index 3981d7551b94..fb275ba5fd5c 100644 --- a/internal/service/route53/cidr_location_test.go +++ b/internal/service/route53/cidr_location_test.go @@ -22,7 +22,7 @@ func TestAccRoute53CIDRLocation_basic(t *testing.T) { locationName := sdkacctest.RandString(16) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, route53.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckCIDRLocationDestroy(ctx), @@ -63,7 +63,7 @@ func TestAccRoute53CIDRLocation_disappears(t *testing.T) { locationName := sdkacctest.RandString(16) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, route53.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckCIDRLocationDestroy(ctx), @@ -88,7 +88,7 @@ func TestAccRoute53CIDRLocation_update(t *testing.T) { locationName := sdkacctest.RandString(16) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, route53.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckCIDRLocationDestroy(ctx), diff --git a/internal/service/route53/delegation_set_data_source_test.go b/internal/service/route53/delegation_set_data_source_test.go index 699ead3d6de0..6d45dd889710 100644 --- a/internal/service/route53/delegation_set_data_source_test.go +++ b/internal/service/route53/delegation_set_data_source_test.go @@ -17,7 +17,7 @@ func TestAccRoute53DelegationSetDataSource_basic(t *testing.T) { zoneName := acctest.RandomDomainName() resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, route53.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ diff --git a/internal/service/route53/delegation_set_test.go b/internal/service/route53/delegation_set_test.go index 57eb1690f0f0..35c8bff4503d 100644 --- a/internal/service/route53/delegation_set_test.go +++ b/internal/service/route53/delegation_set_test.go @@ -23,7 +23,7 @@ func TestAccRoute53DelegationSet_basic(t *testing.T) { resourceName := "aws_route53_delegation_set.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, route53.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDelegationSetDestroy(ctx), @@ -59,7 +59,7 @@ func TestAccRoute53DelegationSet_withZones(t *testing.T) { zoneName2 := fmt.Sprintf("secondary.%s", domain) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, route53.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDelegationSetDestroy(ctx), @@ -90,7 +90,7 @@ func TestAccRoute53DelegationSet_disappears(t *testing.T) { resourceName := "aws_route53_delegation_set.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, route53.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDelegationSetDestroy(ctx), diff --git a/internal/service/route53/health_check_test.go b/internal/service/route53/health_check_test.go index 9f6347226a0f..7da940c5c441 100644 --- a/internal/service/route53/health_check_test.go +++ b/internal/service/route53/health_check_test.go @@ -24,7 +24,7 @@ func TestAccRoute53HealthCheck_basic(t *testing.T) { var check route53.HealthCheck resourceName := "aws_route53_health_check.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, route53.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckHealthCheckDestroy(ctx), @@ -63,7 +63,7 @@ func TestAccRoute53HealthCheck_tags(t *testing.T) { var check route53.HealthCheck resourceName := "aws_route53_health_check.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, route53.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckHealthCheckDestroy(ctx), @@ -107,7 +107,7 @@ func TestAccRoute53HealthCheck_withSearchString(t *testing.T) { var check route53.HealthCheck resourceName := "aws_route53_health_check.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, route53.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckHealthCheckDestroy(ctx), @@ -142,7 +142,7 @@ func TestAccRoute53HealthCheck_withChildHealthChecks(t *testing.T) { var check route53.HealthCheck resourceName := "aws_route53_health_check.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, route53.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckHealthCheckDestroy(ctx), @@ -167,7 +167,7 @@ func TestAccRoute53HealthCheck_withHealthCheckRegions(t *testing.T) { var check route53.HealthCheck resourceName := "aws_route53_health_check.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartition(t, endpoints.AwsPartitionID) }, // GovCloud has 2 regions, test requires 3 + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartition(t, endpoints.AwsPartitionID) }, // GovCloud has 2 regions, test requires 3 ErrorCheck: acctest.ErrorCheck(t, route53.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckHealthCheckDestroy(ctx), @@ -193,7 +193,7 @@ func TestAccRoute53HealthCheck_ip(t *testing.T) { var check route53.HealthCheck resourceName := "aws_route53_health_check.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, route53.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckHealthCheckDestroy(ctx), @@ -226,7 +226,7 @@ func TestAccRoute53HealthCheck_ipv6(t *testing.T) { var check route53.HealthCheck resourceName := "aws_route53_health_check.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, route53.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckHealthCheckDestroy(ctx), @@ -256,7 +256,7 @@ func TestAccRoute53HealthCheck_cloudWatchAlarmCheck(t *testing.T) { var check route53.HealthCheck resourceName := "aws_route53_health_check.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, route53.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckHealthCheckDestroy(ctx), @@ -282,7 +282,7 @@ func TestAccRoute53HealthCheck_withSNI(t *testing.T) { var check route53.HealthCheck resourceName := "aws_route53_health_check.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, route53.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckHealthCheckDestroy(ctx), @@ -323,7 +323,7 @@ func TestAccRoute53HealthCheck_disabled(t *testing.T) { resourceName := "aws_route53_health_check.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, route53.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckHealthCheckDestroy(ctx), @@ -364,7 +364,7 @@ func TestAccRoute53HealthCheck_withRoutingControlARN(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resourceName := "aws_route53_health_check.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(r53rcc.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(r53rcc.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, route53.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckHealthCheckDestroy(ctx), @@ -390,7 +390,7 @@ func TestAccRoute53HealthCheck_disappears(t *testing.T) { var check route53.HealthCheck resourceName := "aws_route53_health_check.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, route53.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckHealthCheckDestroy(ctx), diff --git a/internal/service/route53/hosted_zone_dnssec_test.go b/internal/service/route53/hosted_zone_dnssec_test.go index c7c2a7d4b7ec..81d0375317f1 100644 --- a/internal/service/route53/hosted_zone_dnssec_test.go +++ b/internal/service/route53/hosted_zone_dnssec_test.go @@ -25,7 +25,7 @@ func TestAccRoute53HostedZoneDNSSEC_basic(t *testing.T) { domainName := acctest.RandomDomainName() resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckKeySigningKey(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckKeySigningKey(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, route53.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckHostedZoneDNSSECDestroy(ctx), @@ -55,7 +55,7 @@ func TestAccRoute53HostedZoneDNSSEC_disappears(t *testing.T) { domainName := acctest.RandomDomainName() resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckKeySigningKey(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckKeySigningKey(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, route53.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckHostedZoneDNSSECDestroy(ctx), @@ -80,7 +80,7 @@ func TestAccRoute53HostedZoneDNSSEC_signingStatus(t *testing.T) { domainName := acctest.RandomDomainName() resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckKeySigningKey(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckKeySigningKey(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, route53.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckHostedZoneDNSSECDestroy(ctx), diff --git a/internal/service/route53/key_signing_key_test.go b/internal/service/route53/key_signing_key_test.go index a204603c1f4a..626e56388666 100644 --- a/internal/service/route53/key_signing_key_test.go +++ b/internal/service/route53/key_signing_key_test.go @@ -33,7 +33,7 @@ func TestAccRoute53KeySigningKey_basic(t *testing.T) { domainName := acctest.RandomDomainName() resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckKeySigningKey(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckKeySigningKey(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, route53.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckKeySigningKeyDestroy(ctx), @@ -75,7 +75,7 @@ func TestAccRoute53KeySigningKey_disappears(t *testing.T) { domainName := acctest.RandomDomainName() resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckKeySigningKey(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckKeySigningKey(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, route53.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckKeySigningKeyDestroy(ctx), @@ -100,7 +100,7 @@ func TestAccRoute53KeySigningKey_status(t *testing.T) { domainName := acctest.RandomDomainName() resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckKeySigningKey(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckKeySigningKey(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, route53.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckKeySigningKeyDestroy(ctx), diff --git a/internal/service/route53/query_log_test.go b/internal/service/route53/query_log_test.go index c6ce7c5c378b..97be995d2fe5 100644 --- a/internal/service/route53/query_log_test.go +++ b/internal/service/route53/query_log_test.go @@ -28,7 +28,7 @@ func TestAccRoute53QueryLog_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) // AWS Commercial: https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/query-logs.html // AWS GovCloud (US) - only private DNS: https://docs.aws.amazon.com/govcloud-us/latest/UserGuide/govcloud-r53.html // AWS China - not available yet: https://docs.amazonaws.cn/en_us/aws/latest/userguide/route53.html @@ -64,7 +64,7 @@ func TestAccRoute53QueryLog_disappears(t *testing.T) { var v route53.QueryLoggingConfig resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckRegion(t, endpoints.UsEast1RegionID) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckRegion(t, endpoints.UsEast1RegionID) }, ErrorCheck: acctest.ErrorCheck(t, route53.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckQueryLogDestroy(ctx), @@ -90,7 +90,7 @@ func TestAccRoute53QueryLog_Disappears_hostedZone(t *testing.T) { var v route53.QueryLoggingConfig resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckRegion(t, endpoints.UsEast1RegionID) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckRegion(t, endpoints.UsEast1RegionID) }, ErrorCheck: acctest.ErrorCheck(t, route53.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckQueryLogDestroy(ctx), diff --git a/internal/service/route53/record_test.go b/internal/service/route53/record_test.go index 0a011e546492..dd278f890fc8 100644 --- a/internal/service/route53/record_test.go +++ b/internal/service/route53/record_test.go @@ -141,7 +141,7 @@ func TestAccRoute53Record_basic(t *testing.T) { recordName := zoneName.RandomSubdomain() resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, route53.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRecordDestroy(ctx), @@ -188,7 +188,7 @@ func TestAccRoute53Record_disappears(t *testing.T) { recordName := zoneName.RandomSubdomain() resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, route53.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRecordDestroy(ctx), @@ -211,7 +211,7 @@ func TestAccRoute53Record_Disappears_multipleRecords(t *testing.T) { zoneName := acctest.RandomDomain() resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, route53.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRecordDestroy(ctx), @@ -238,7 +238,7 @@ func TestAccRoute53Record_underscored(t *testing.T) { resourceName := "aws_route53_record.underscore" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, route53.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRecordDestroy(ctx), @@ -265,7 +265,7 @@ func TestAccRoute53Record_fqdn(t *testing.T) { resourceName := "aws_route53_record.default" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, route53.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRecordDestroy(ctx), @@ -307,7 +307,7 @@ func TestAccRoute53Record_trailingPeriodAndZoneID(t *testing.T) { resourceName := "aws_route53_record.default" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, route53.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRecordDestroy(ctx), @@ -334,7 +334,7 @@ func TestAccRoute53Record_Support_txt(t *testing.T) { resourceName := "aws_route53_record.default" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, route53.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRecordDestroy(ctx), @@ -361,7 +361,7 @@ func TestAccRoute53Record_Support_spf(t *testing.T) { resourceName := "aws_route53_record.default" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, route53.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRecordDestroy(ctx), @@ -389,7 +389,7 @@ func TestAccRoute53Record_Support_caa(t *testing.T) { resourceName := "aws_route53_record.default" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, route53.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRecordDestroy(ctx), @@ -417,7 +417,7 @@ func TestAccRoute53Record_Support_ds(t *testing.T) { resourceName := "aws_route53_record.default" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, route53.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRecordDestroy(ctx), @@ -444,7 +444,7 @@ func TestAccRoute53Record_generatesSuffix(t *testing.T) { resourceName := "aws_route53_record.default" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, route53.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRecordDestroy(ctx), @@ -471,7 +471,7 @@ func TestAccRoute53Record_wildcard(t *testing.T) { resourceName := "aws_route53_record.wildcard" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, route53.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRecordDestroy(ctx), @@ -506,7 +506,7 @@ func TestAccRoute53Record_failover(t *testing.T) { resourceName := "aws_route53_record.www-primary" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, route53.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRecordDestroy(ctx), @@ -534,7 +534,7 @@ func TestAccRoute53Record_Weighted_basic(t *testing.T) { resourceName := "aws_route53_record.www-live" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, route53.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRecordDestroy(ctx), @@ -563,7 +563,7 @@ func TestAccRoute53Record_WeightedToSimple_basic(t *testing.T) { resourceName := "aws_route53_record.www-server1" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, route53.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRecordDestroy(ctx), @@ -598,7 +598,7 @@ func TestAccRoute53Record_Alias_elb(t *testing.T) { rs := sdkacctest.RandString(10) testAccRecordConfig_config := fmt.Sprintf(testAccRecordConfig_aliasELB, rs) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, route53.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRecordDestroy(ctx), @@ -626,7 +626,7 @@ func TestAccRoute53Record_Alias_s3(t *testing.T) { resourceName := "aws_route53_record.alias" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, route53.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRecordDestroy(ctx), @@ -654,7 +654,7 @@ func TestAccRoute53Record_Alias_vpcEndpoint(t *testing.T) { resourceName := "aws_route53_record.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, route53.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRecordDestroy(ctx), @@ -687,7 +687,7 @@ func TestAccRoute53Record_Alias_uppercase(t *testing.T) { rs := sdkacctest.RandString(10) testAccRecordConfig_config := fmt.Sprintf(testAccRecordConfig_aliasELBUppercase, rs) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, route53.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRecordDestroy(ctx), @@ -714,7 +714,7 @@ func TestAccRoute53Record_Weighted_alias(t *testing.T) { resourceName := "aws_route53_record.elb_weighted_alias_live" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, route53.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRecordDestroy(ctx), @@ -756,7 +756,7 @@ func TestAccRoute53Record_cidr(t *testing.T) { recordName := zoneName.RandomSubdomain() resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, route53.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRecordDestroy(ctx), @@ -822,7 +822,7 @@ func TestAccRoute53Record_Geolocation_basic(t *testing.T) { resourceName := "aws_route53_record.default" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, route53.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRecordDestroy(ctx), @@ -852,7 +852,7 @@ func TestAccRoute53Record_HealthCheckID_setIdentifierChange(t *testing.T) { resourceName := "aws_route53_record.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, route53.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRecordDestroy(ctx), @@ -885,7 +885,7 @@ func TestAccRoute53Record_HealthCheckID_typeChange(t *testing.T) { resourceName := "aws_route53_record.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, route53.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRecordDestroy(ctx), @@ -918,7 +918,7 @@ func TestAccRoute53Record_Latency_basic(t *testing.T) { resourceName := "aws_route53_record.first_region" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, route53.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRecordDestroy(ctx), @@ -947,7 +947,7 @@ func TestAccRoute53Record_typeChange(t *testing.T) { resourceName := "aws_route53_record.sample" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, route53.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRecordDestroy(ctx), @@ -982,7 +982,7 @@ func TestAccRoute53Record_nameChange(t *testing.T) { resourceName := "aws_route53_record.sample" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, route53.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRecordDestroy(ctx), @@ -1018,7 +1018,7 @@ func TestAccRoute53Record_setIdentifierChangeBasicToWeighted(t *testing.T) { resourceName := "aws_route53_record.basic_to_weighted" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, route53.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRecordDestroy(ctx), @@ -1053,7 +1053,7 @@ func TestAccRoute53Record_SetIdentifierRename_geolocationContinent(t *testing.T) resourceName := "aws_route53_record.set_identifier_rename_geolocation" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, route53.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRecordDestroy(ctx), @@ -1086,7 +1086,7 @@ func TestAccRoute53Record_SetIdentifierRename_geolocationCountryDefault(t *testi resourceName := "aws_route53_record.set_identifier_rename_geolocation" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, route53.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRecordDestroy(ctx), @@ -1119,7 +1119,7 @@ func TestAccRoute53Record_SetIdentifierRename_geolocationCountrySpecified(t *tes resourceName := "aws_route53_record.set_identifier_rename_geolocation" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, route53.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRecordDestroy(ctx), @@ -1152,7 +1152,7 @@ func TestAccRoute53Record_SetIdentifierRename_geolocationCountrySubdivision(t *t resourceName := "aws_route53_record.set_identifier_rename_geolocation" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, route53.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRecordDestroy(ctx), @@ -1185,7 +1185,7 @@ func TestAccRoute53Record_SetIdentifierRename_failover(t *testing.T) { resourceName := "aws_route53_record.set_identifier_rename_failover" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, route53.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRecordDestroy(ctx), @@ -1218,7 +1218,7 @@ func TestAccRoute53Record_SetIdentifierRename_latency(t *testing.T) { resourceName := "aws_route53_record.set_identifier_rename_latency" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, route53.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRecordDestroy(ctx), @@ -1251,7 +1251,7 @@ func TestAccRoute53Record_SetIdentifierRename_multiValueAnswer(t *testing.T) { resourceName := "aws_route53_record.set_identifier_rename_multivalue_answer" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, route53.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRecordDestroy(ctx), @@ -1284,7 +1284,7 @@ func TestAccRoute53Record_SetIdentifierRename_weighted(t *testing.T) { resourceName := "aws_route53_record.set_identifier_rename_weighted" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, route53.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRecordDestroy(ctx), @@ -1318,7 +1318,7 @@ func TestAccRoute53Record_Alias_change(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, route53.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRecordDestroy(ctx), @@ -1354,7 +1354,7 @@ func TestAccRoute53Record_Alias_changeDualstack(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, route53.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRecordDestroy(ctx), @@ -1390,7 +1390,7 @@ func TestAccRoute53Record_empty(t *testing.T) { resourceName := "aws_route53_record.empty" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, route53.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRecordDestroy(ctx), @@ -1412,7 +1412,7 @@ func TestAccRoute53Record_longTXTrecord(t *testing.T) { resourceName := "aws_route53_record.long_txt" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, route53.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRecordDestroy(ctx), @@ -1439,7 +1439,7 @@ func TestAccRoute53Record_MultiValueAnswer_basic(t *testing.T) { resourceName := "aws_route53_record.www-server1" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, route53.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRecordDestroy(ctx), @@ -1464,7 +1464,7 @@ func TestAccRoute53Record_MultiValueAnswer_basic(t *testing.T) { func TestAccRoute53Record_Allow_doNotOverwrite(t *testing.T) { ctx := acctest.Context(t) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: testAccRecordOverwriteExpectErrorCheck(t), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRecordDestroy(ctx), @@ -1482,7 +1482,7 @@ func TestAccRoute53Record_Allow_overwrite(t *testing.T) { resourceName := "aws_route53_record.overwriting" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, route53.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRecordDestroy(ctx), 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 be5dfce448ec..e7e96c54e1da 100644 --- a/internal/service/route53/traffic_policy_document_data_source_test.go +++ b/internal/service/route53/traffic_policy_document_data_source_test.go @@ -15,7 +15,7 @@ import ( func TestAccRoute53TrafficPolicyDocumentDataSource_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, ErrorCheck: acctest.ErrorCheck(t, route53.EndpointsID), Steps: []resource.TestStep{ @@ -32,7 +32,7 @@ func TestAccRoute53TrafficPolicyDocumentDataSource_basic(t *testing.T) { func TestAccRoute53TrafficPolicyDocumentDataSource_complete(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, ErrorCheck: acctest.ErrorCheck(t, route53.EndpointsID), Steps: []resource.TestStep{ diff --git a/internal/service/route53/traffic_policy_instance_test.go b/internal/service/route53/traffic_policy_instance_test.go index 599da87a9574..686c2a3c8945 100644 --- a/internal/service/route53/traffic_policy_instance_test.go +++ b/internal/service/route53/traffic_policy_instance_test.go @@ -32,7 +32,7 @@ func TestAccRoute53TrafficPolicyInstance_basic(t *testing.T) { zoneName := acctest.RandomDomainName() resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckTrafficPolicy(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckTrafficPolicy(t) }, ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTrafficPolicyInstanceDestroy(ctx), ErrorCheck: acctest.ErrorCheck(t, route53.EndpointsID), @@ -62,7 +62,7 @@ func TestAccRoute53TrafficPolicyInstance_disappears(t *testing.T) { zoneName := acctest.RandomDomainName() resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckTrafficPolicy(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckTrafficPolicy(t) }, ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTrafficPolicyInstanceDestroy(ctx), ErrorCheck: acctest.ErrorCheck(t, route53.EndpointsID), @@ -87,7 +87,7 @@ func TestAccRoute53TrafficPolicyInstance_update(t *testing.T) { zoneName := acctest.RandomDomainName() resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckTrafficPolicy(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckTrafficPolicy(t) }, ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTrafficPolicyInstanceDestroy(ctx), ErrorCheck: acctest.ErrorCheck(t, route53.EndpointsID), diff --git a/internal/service/route53/traffic_policy_test.go b/internal/service/route53/traffic_policy_test.go index 17dd2a1e86a2..0bdcd0d718b0 100644 --- a/internal/service/route53/traffic_policy_test.go +++ b/internal/service/route53/traffic_policy_test.go @@ -22,7 +22,7 @@ func TestAccRoute53TrafficPolicy_basic(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckTrafficPolicy(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckTrafficPolicy(t) }, ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTrafficPolicyDestroy(ctx), ErrorCheck: acctest.ErrorCheck(t, route53.EndpointsID), @@ -54,7 +54,7 @@ func TestAccRoute53TrafficPolicy_disappears(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckTrafficPolicy(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckTrafficPolicy(t) }, ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTrafficPolicyDestroy(ctx), ErrorCheck: acctest.ErrorCheck(t, route53.EndpointsID), @@ -80,7 +80,7 @@ func TestAccRoute53TrafficPolicy_update(t *testing.T) { commentUpdated := `comment updated` resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckTrafficPolicy(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckTrafficPolicy(t) }, ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTrafficPolicyDestroy(ctx), ErrorCheck: acctest.ErrorCheck(t, route53.EndpointsID), diff --git a/internal/service/route53/vpc_association_authorization_test.go b/internal/service/route53/vpc_association_authorization_test.go index f32f1d3c3c2e..6a113b3dc5d1 100644 --- a/internal/service/route53/vpc_association_authorization_test.go +++ b/internal/service/route53/vpc_association_authorization_test.go @@ -21,7 +21,7 @@ func TestAccRoute53VPCAssociationAuthorization_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckAlternateAccount(t) }, ErrorCheck: acctest.ErrorCheck(t, route53.EndpointsID), @@ -50,7 +50,7 @@ func TestAccRoute53VPCAssociationAuthorization_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckAlternateAccount(t) }, ErrorCheck: acctest.ErrorCheck(t, route53.EndpointsID), diff --git a/internal/service/route53/zone_association_test.go b/internal/service/route53/zone_association_test.go index 3ae7c6dd4daa..11b247c26aa6 100644 --- a/internal/service/route53/zone_association_test.go +++ b/internal/service/route53/zone_association_test.go @@ -22,7 +22,7 @@ func TestAccRoute53ZoneAssociation_basic(t *testing.T) { domainName := acctest.RandomFQDomainName() resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, route53.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckZoneAssociationDestroy(ctx), @@ -49,7 +49,7 @@ func TestAccRoute53ZoneAssociation_disappears(t *testing.T) { domainName := acctest.RandomFQDomainName() resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, route53.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckZoneAssociationDestroy(ctx), @@ -74,7 +74,7 @@ func TestAccRoute53ZoneAssociation_Disappears_vpc(t *testing.T) { domainName := acctest.RandomFQDomainName() resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, route53.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckZoneAssociationDestroy(ctx), @@ -99,7 +99,7 @@ func TestAccRoute53ZoneAssociation_Disappears_zone(t *testing.T) { domainName := acctest.RandomFQDomainName() resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, route53.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckZoneAssociationDestroy(ctx), @@ -123,7 +123,7 @@ func TestAccRoute53ZoneAssociation_crossAccount(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckAlternateAccount(t) }, ErrorCheck: acctest.ErrorCheck(t, route53.EndpointsID), @@ -153,7 +153,7 @@ func TestAccRoute53ZoneAssociation_crossRegion(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckMultipleRegion(t, 2) }, ErrorCheck: acctest.ErrorCheck(t, route53.EndpointsID), diff --git a/internal/service/route53/zone_data_source_test.go b/internal/service/route53/zone_data_source_test.go index 7bf2737e5074..61b059bbde13 100644 --- a/internal/service/route53/zone_data_source_test.go +++ b/internal/service/route53/zone_data_source_test.go @@ -18,7 +18,7 @@ func TestAccRoute53ZoneDataSource_id(t *testing.T) { fqdn := acctest.RandomFQDomainName() resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, route53.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckZoneDestroy(ctx), @@ -46,7 +46,7 @@ func TestAccRoute53ZoneDataSource_name(t *testing.T) { fqdn := acctest.RandomFQDomainName() resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, route53.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckZoneDestroy(ctx), @@ -74,7 +74,7 @@ func TestAccRoute53ZoneDataSource_tags(t *testing.T) { fqdn := acctest.RandomFQDomainName() resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, route53.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckZoneDestroy(ctx), @@ -100,7 +100,7 @@ func TestAccRoute53ZoneDataSource_vpc(t *testing.T) { dataSourceName := "data.aws_route53_zone.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, route53.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckZoneDestroy(ctx), @@ -126,7 +126,7 @@ func TestAccRoute53ZoneDataSource_serviceDiscovery(t *testing.T) { dataSourceName := "data.aws_route53_zone.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService("servicediscovery", t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService("servicediscovery", t) }, ErrorCheck: acctest.ErrorCheck(t, route53.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckZoneDestroy(ctx), diff --git a/internal/service/route53/zone_test.go b/internal/service/route53/zone_test.go index 32d74d19357e..3dda8049104f 100644 --- a/internal/service/route53/zone_test.go +++ b/internal/service/route53/zone_test.go @@ -94,7 +94,7 @@ func TestAccRoute53Zone_basic(t *testing.T) { zoneName := acctest.RandomDomainName() resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, route53.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckZoneDestroy(ctx), @@ -129,7 +129,7 @@ func TestAccRoute53Zone_disappears(t *testing.T) { zoneName := acctest.RandomDomainName() resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, route53.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckZoneDestroy(ctx), @@ -153,7 +153,7 @@ func TestAccRoute53Zone_multiple(t *testing.T) { domainName := acctest.RandomDomainName() resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, route53.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckZoneDestroy(ctx), @@ -185,7 +185,7 @@ func TestAccRoute53Zone_comment(t *testing.T) { zoneName := acctest.RandomDomainName() resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, route53.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckZoneDestroy(ctx), @@ -223,7 +223,7 @@ func TestAccRoute53Zone_delegationSetID(t *testing.T) { zoneName := acctest.RandomDomainName() resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, route53.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckZoneDestroy(ctx), @@ -253,7 +253,7 @@ func TestAccRoute53Zone_forceDestroy(t *testing.T) { zoneName := acctest.RandomDomainName() resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, route53.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckZoneDestroy(ctx), @@ -279,7 +279,7 @@ func TestAccRoute53Zone_ForceDestroy_trailingPeriod(t *testing.T) { zoneName := acctest.RandomDomainName() resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, route53.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckZoneDestroy(ctx), @@ -305,7 +305,7 @@ func TestAccRoute53Zone_tags(t *testing.T) { zoneName := acctest.RandomDomainName() resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, route53.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckZoneDestroy(ctx), @@ -355,7 +355,7 @@ func TestAccRoute53Zone_VPC_single(t *testing.T) { zoneName := acctest.RandomDomainName() resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, route53.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckZoneDestroy(ctx), @@ -389,7 +389,7 @@ func TestAccRoute53Zone_VPC_multiple(t *testing.T) { zoneName := acctest.RandomDomainName() resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, route53.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckZoneDestroy(ctx), @@ -424,7 +424,7 @@ func TestAccRoute53Zone_VPC_updates(t *testing.T) { zoneName := acctest.RandomDomainName() resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, route53.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckZoneDestroy(ctx), From 22fb2be14d18d7c173b6f6d0737e671ea3c28ca0 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Fri, 24 Feb 2023 16:37:22 -0500 Subject: [PATCH 221/763] Add 'Context' argument to 'acctest.PreCheck' for route53domains. --- .../service/route53domains/registered_domain_test.go | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/internal/service/route53domains/registered_domain_test.go b/internal/service/route53domains/registered_domain_test.go index cfbc383eb406..edc32250fb44 100644 --- a/internal/service/route53domains/registered_domain_test.go +++ b/internal/service/route53domains/registered_domain_test.go @@ -60,7 +60,7 @@ func testAccRegisteredDomain_tags(t *testing.T) { resourceName := "aws_route53domains_registered_domain.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, names.Route53DomainsEndpointID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRegisteredDomainDestroy, @@ -102,7 +102,7 @@ func testAccRegisteredDomain_autoRenew(t *testing.T) { resourceName := "aws_route53domains_registered_domain.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, names.Route53DomainsEndpointID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRegisteredDomainDestroy, @@ -134,7 +134,7 @@ func testAccRegisteredDomain_contacts(t *testing.T) { resourceName := "aws_route53domains_registered_domain.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, names.Route53DomainsEndpointID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRegisteredDomainDestroy, @@ -238,7 +238,7 @@ func testAccRegisteredDomain_contactPrivacy(t *testing.T) { resourceName := "aws_route53domains_registered_domain.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, names.Route53DomainsEndpointID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRegisteredDomainDestroy, @@ -274,7 +274,7 @@ func testAccRegisteredDomain_nameservers(t *testing.T) { resourceName := "aws_route53domains_registered_domain.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, names.Route53DomainsEndpointID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRegisteredDomainDestroy, @@ -319,7 +319,7 @@ func testAccRegisteredDomain_transferLock(t *testing.T) { resourceName := "aws_route53domains_registered_domain.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, names.Route53DomainsEndpointID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRegisteredDomainDestroy, From bd8f361c966860759cfc74a26a0a0dd4c4f545ae Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Fri, 24 Feb 2023 16:37:22 -0500 Subject: [PATCH 222/763] Add 'Context' argument to 'acctest.PreCheck' for route53recoverycontrolconfig. --- .../service/route53recoverycontrolconfig/cluster_test.go | 4 ++-- .../route53recoverycontrolconfig/control_panel_test.go | 4 ++-- .../route53recoverycontrolconfig/routing_control_test.go | 6 +++--- .../route53recoverycontrolconfig/safety_rule_test.go | 6 +++--- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/internal/service/route53recoverycontrolconfig/cluster_test.go b/internal/service/route53recoverycontrolconfig/cluster_test.go index 25014149bb25..3a387895e42e 100644 --- a/internal/service/route53recoverycontrolconfig/cluster_test.go +++ b/internal/service/route53recoverycontrolconfig/cluster_test.go @@ -21,7 +21,7 @@ func testAccCluster_basic(t *testing.T) { resourceName := "aws_route53recoverycontrolconfig_cluster.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(r53rcc.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(r53rcc.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, r53rcc.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClusterDestroy(ctx), @@ -51,7 +51,7 @@ func testAccCluster_disappears(t *testing.T) { resourceName := "aws_route53recoverycontrolconfig_cluster.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(r53rcc.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(r53rcc.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, r53rcc.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckClusterDestroy(ctx), diff --git a/internal/service/route53recoverycontrolconfig/control_panel_test.go b/internal/service/route53recoverycontrolconfig/control_panel_test.go index dd41bc096564..6a37b34d2f66 100644 --- a/internal/service/route53recoverycontrolconfig/control_panel_test.go +++ b/internal/service/route53recoverycontrolconfig/control_panel_test.go @@ -21,7 +21,7 @@ func testAccControlPanel_basic(t *testing.T) { resourceName := "aws_route53recoverycontrolconfig_control_panel.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(r53rcc.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(r53rcc.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, r53rcc.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckControlPanelDestroy(ctx), @@ -51,7 +51,7 @@ func testAccControlPanel_disappears(t *testing.T) { resourceName := "aws_route53recoverycontrolconfig_control_panel.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(r53rcc.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(r53rcc.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, r53rcc.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckControlPanelDestroy(ctx), diff --git a/internal/service/route53recoverycontrolconfig/routing_control_test.go b/internal/service/route53recoverycontrolconfig/routing_control_test.go index ac7d33b93e62..4ec58307e41d 100644 --- a/internal/service/route53recoverycontrolconfig/routing_control_test.go +++ b/internal/service/route53recoverycontrolconfig/routing_control_test.go @@ -21,7 +21,7 @@ func testAccRoutingControl_basic(t *testing.T) { resourceName := "aws_route53recoverycontrolconfig_routing_control.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(r53rcc.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(r53rcc.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, r53rcc.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRoutingControlDestroy(ctx), @@ -52,7 +52,7 @@ func testAccRoutingControl_disappears(t *testing.T) { resourceName := "aws_route53recoverycontrolconfig_routing_control.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(r53rcc.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(r53rcc.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, r53rcc.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRoutingControlDestroy(ctx), @@ -75,7 +75,7 @@ func testAccRoutingControl_nonDefaultControlPanel(t *testing.T) { resourceName := "aws_route53recoverycontrolconfig_routing_control.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(r53rcc.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(r53rcc.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, r53rcc.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRoutingControlDestroy(ctx), diff --git a/internal/service/route53recoverycontrolconfig/safety_rule_test.go b/internal/service/route53recoverycontrolconfig/safety_rule_test.go index 6f1d59cfeab4..0a7f61f245ab 100644 --- a/internal/service/route53recoverycontrolconfig/safety_rule_test.go +++ b/internal/service/route53recoverycontrolconfig/safety_rule_test.go @@ -21,7 +21,7 @@ func testAccSafetyRule_assertionRule(t *testing.T) { resourceName := "aws_route53recoverycontrolconfig_safety_rule.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(r53rcc.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(r53rcc.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, r53rcc.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSafetyRuleDestroy(ctx), @@ -52,7 +52,7 @@ func testAccSafetyRule_disappears(t *testing.T) { resourceName := "aws_route53recoverycontrolconfig_safety_rule.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(r53rcc.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(r53rcc.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, r53rcc.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSafetyRuleDestroy(ctx), @@ -75,7 +75,7 @@ func testAccSafetyRule_gatingRule(t *testing.T) { resourceName := "aws_route53recoverycontrolconfig_safety_rule.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(r53rcc.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(r53rcc.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, r53rcc.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSafetyRuleDestroy(ctx), From abab8563ae324184db42e7ee24c12d2cfdf8149d Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Fri, 24 Feb 2023 16:37:22 -0500 Subject: [PATCH 223/763] Add 'Context' argument to 'acctest.PreCheck' for route53recoveryreadiness. --- .../route53recoveryreadiness/cell_test.go | 10 +++++----- .../readiness_check_test.go | 8 ++++---- .../recovery_group_test.go | 10 +++++----- .../resource_set_test.go | 16 ++++++++-------- 4 files changed, 22 insertions(+), 22 deletions(-) diff --git a/internal/service/route53recoveryreadiness/cell_test.go b/internal/service/route53recoveryreadiness/cell_test.go index ecf9b83adb0f..b4a40ad4e22a 100644 --- a/internal/service/route53recoveryreadiness/cell_test.go +++ b/internal/service/route53recoveryreadiness/cell_test.go @@ -22,7 +22,7 @@ func TestAccRoute53RecoveryReadinessCell_basic(t *testing.T) { resourceName := "aws_route53recoveryreadiness_cell.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, route53recoveryreadiness.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckCellDestroy(ctx), @@ -52,7 +52,7 @@ func TestAccRoute53RecoveryReadinessCell_disappears(t *testing.T) { resourceName := "aws_route53recoveryreadiness_cell.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, route53recoveryreadiness.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckCellDestroy(ctx), @@ -77,7 +77,7 @@ func TestAccRoute53RecoveryReadinessCell_nestedCell(t *testing.T) { resourceNameChild := "aws_route53recoveryreadiness_cell.test_child" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, route53recoveryreadiness.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckCellDestroy(ctx), @@ -127,7 +127,7 @@ func TestAccRoute53RecoveryReadinessCell_tags(t *testing.T) { resourceName := "aws_route53recoveryreadiness_cell.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, route53recoveryreadiness.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckCellDestroy(ctx), @@ -172,7 +172,7 @@ func TestAccRoute53RecoveryReadinessCell_timeout(t *testing.T) { resourceName := "aws_route53recoveryreadiness_cell.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, route53recoveryreadiness.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckCellDestroy(ctx), diff --git a/internal/service/route53recoveryreadiness/readiness_check_test.go b/internal/service/route53recoveryreadiness/readiness_check_test.go index e77d3b6dad0a..8bcd2190599f 100644 --- a/internal/service/route53recoveryreadiness/readiness_check_test.go +++ b/internal/service/route53recoveryreadiness/readiness_check_test.go @@ -32,7 +32,7 @@ func TestAccRoute53RecoveryReadinessReadinessCheck_basic(t *testing.T) { }.String() resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, route53recoveryreadiness.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckReadinessCheckDestroy(ctx), @@ -68,7 +68,7 @@ func TestAccRoute53RecoveryReadinessReadinessCheck_disappears(t *testing.T) { }.String() resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, route53recoveryreadiness.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckReadinessCheckDestroy(ctx), @@ -98,7 +98,7 @@ func TestAccRoute53RecoveryReadinessReadinessCheck_tags(t *testing.T) { }.String() resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, route53recoveryreadiness.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckReadinessCheckDestroy(ctx), @@ -151,7 +151,7 @@ func TestAccRoute53RecoveryReadinessReadinessCheck_timeout(t *testing.T) { }.String() resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, route53recoveryreadiness.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckReadinessCheckDestroy(ctx), diff --git a/internal/service/route53recoveryreadiness/recovery_group_test.go b/internal/service/route53recoveryreadiness/recovery_group_test.go index b1601cddf06b..943ac94d4631 100644 --- a/internal/service/route53recoveryreadiness/recovery_group_test.go +++ b/internal/service/route53recoveryreadiness/recovery_group_test.go @@ -22,7 +22,7 @@ func TestAccRoute53RecoveryReadinessRecoveryGroup_basic(t *testing.T) { resourceName := "aws_route53recoveryreadiness_recovery_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, route53recoveryreadiness.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRecoveryGroupDestroy(ctx), @@ -51,7 +51,7 @@ func TestAccRoute53RecoveryReadinessRecoveryGroup_disappears(t *testing.T) { resourceName := "aws_route53recoveryreadiness_recovery_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, route53recoveryreadiness.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRecoveryGroupDestroy(ctx), @@ -74,7 +74,7 @@ func TestAccRoute53RecoveryReadinessRecoveryGroup_nestedCell(t *testing.T) { rNameCell := sdkacctest.RandomWithPrefix("tf-acc-test-cell") resourceName := "aws_route53recoveryreadiness_recovery_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, route53recoveryreadiness.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRecoveryGroupDestroy(ctx), @@ -101,7 +101,7 @@ func TestAccRoute53RecoveryReadinessRecoveryGroup_tags(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resourceName := "aws_route53recoveryreadiness_recovery_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, route53recoveryreadiness.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRecoveryGroupDestroy(ctx), @@ -145,7 +145,7 @@ func TestAccRoute53RecoveryReadinessRecoveryGroup_timeout(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resourceName := "aws_route53recoveryreadiness_recovery_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, route53recoveryreadiness.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRecoveryGroupDestroy(ctx), diff --git a/internal/service/route53recoveryreadiness/resource_set_test.go b/internal/service/route53recoveryreadiness/resource_set_test.go index 716ce0f9c923..3ae2c192f4ff 100644 --- a/internal/service/route53recoveryreadiness/resource_set_test.go +++ b/internal/service/route53recoveryreadiness/resource_set_test.go @@ -31,7 +31,7 @@ func TestAccRoute53RecoveryReadinessResourceSet_basic(t *testing.T) { resourceName := "aws_route53recoveryreadiness_resource_set.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, route53recoveryreadiness.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckResourceSetDestroy(ctx), @@ -67,7 +67,7 @@ func TestAccRoute53RecoveryReadinessResourceSet_disappears(t *testing.T) { resourceName := "aws_route53recoveryreadiness_resource_set.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, route53recoveryreadiness.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckResourceSetDestroy(ctx), @@ -97,7 +97,7 @@ func TestAccRoute53RecoveryReadinessResourceSet_tags(t *testing.T) { }.String() resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, route53recoveryreadiness.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckResourceSetDestroy(ctx), @@ -149,7 +149,7 @@ func TestAccRoute53RecoveryReadinessResourceSet_readinessScope(t *testing.T) { }.String() resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, route53recoveryreadiness.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckResourceSetDestroy(ctx), @@ -188,7 +188,7 @@ func TestAccRoute53RecoveryReadinessResourceSet_basicDNSTargetResource(t *testin resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) testAccPreCheckResourceSet(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, route53recoveryreadiness.EndpointsID), @@ -229,7 +229,7 @@ func TestAccRoute53RecoveryReadinessResourceSet_dnsTargetResourceNLBTarget(t *te resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, route53recoveryreadiness.EndpointsID), @@ -269,7 +269,7 @@ func TestAccRoute53RecoveryReadinessResourceSet_dnsTargetResourceR53Target(t *te resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, route53recoveryreadiness.EndpointsID), @@ -307,7 +307,7 @@ func TestAccRoute53RecoveryReadinessResourceSet_timeout(t *testing.T) { resourceName := "aws_route53recoveryreadiness_resource_set.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, route53recoveryreadiness.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckResourceSetDestroy(ctx), From aa520fbefb98b163ade048e5bfc02eeb60e50d63 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Fri, 24 Feb 2023 16:37:23 -0500 Subject: [PATCH 224/763] Add 'Context' argument to 'acctest.PreCheck' for route53resolver. --- internal/service/route53resolver/config_test.go | 4 ++-- .../route53resolver/dnssec_config_test.go | 4 ++-- .../route53resolver/endpoint_data_source_test.go | 4 ++-- .../service/route53resolver/endpoint_test.go | 8 ++++---- .../firewall_config_data_source_test.go | 2 +- .../route53resolver/firewall_config_test.go | 4 ++-- .../firewall_domain_list_data_source_test.go | 2 +- .../route53resolver/firewall_domain_list_test.go | 8 ++++---- ...ll_rule_group_association_data_source_test.go | 2 +- .../firewall_rule_group_association_test.go | 12 ++++++------ .../firewall_rule_group_data_source_test.go | 2 +- .../route53resolver/firewall_rule_group_test.go | 6 +++--- .../route53resolver/firewall_rule_test.go | 8 ++++---- .../firewall_rules_data_source_test.go | 2 +- .../query_log_config_association_test.go | 4 ++-- .../route53resolver/query_log_config_test.go | 6 +++--- .../route53resolver/rule_association_test.go | 6 +++--- .../route53resolver/rule_data_source_test.go | 8 ++++---- internal/service/route53resolver/rule_test.go | 16 ++++++++-------- .../route53resolver/rules_data_source_test.go | 8 ++++---- 20 files changed, 58 insertions(+), 58 deletions(-) diff --git a/internal/service/route53resolver/config_test.go b/internal/service/route53resolver/config_test.go index 19f05ea931cf..ddba17938f02 100644 --- a/internal/service/route53resolver/config_test.go +++ b/internal/service/route53resolver/config_test.go @@ -23,7 +23,7 @@ func TestAccRoute53ResolverConfig_basic(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, route53resolver.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: acctest.CheckDestroyNoop, @@ -63,7 +63,7 @@ func TestAccRoute53ResolverConfig_Disappears_vpc(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, route53resolver.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: acctest.CheckDestroyNoop, diff --git a/internal/service/route53resolver/dnssec_config_test.go b/internal/service/route53resolver/dnssec_config_test.go index 8f0b4c82ff42..a78c07343865 100644 --- a/internal/service/route53resolver/dnssec_config_test.go +++ b/internal/service/route53resolver/dnssec_config_test.go @@ -22,7 +22,7 @@ func TestAccRoute53ResolverDNSSECConfig_basic(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, route53resolver.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDNSSECConfigDestroy(ctx), @@ -53,7 +53,7 @@ func TestAccRoute53ResolverDNSSECConfig_disappear(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, route53resolver.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDNSSECConfigDestroy(ctx), diff --git a/internal/service/route53resolver/endpoint_data_source_test.go b/internal/service/route53resolver/endpoint_data_source_test.go index 8398eca8eca8..afd99b690bd2 100644 --- a/internal/service/route53resolver/endpoint_data_source_test.go +++ b/internal/service/route53resolver/endpoint_data_source_test.go @@ -15,7 +15,7 @@ func TestAccRoute53ResolverEndpointDataSource_basic(t *testing.T) { datasourceName := "data.aws_route53_resolver_endpoint.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, route53resolver.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ @@ -41,7 +41,7 @@ func TestAccRoute53ResolverEndpointDataSource_filter(t *testing.T) { datasourceName := "data.aws_route53_resolver_endpoint.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, route53resolver.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ diff --git a/internal/service/route53resolver/endpoint_test.go b/internal/service/route53resolver/endpoint_test.go index c76dd5f04e1d..17d650adfcdf 100644 --- a/internal/service/route53resolver/endpoint_test.go +++ b/internal/service/route53resolver/endpoint_test.go @@ -23,7 +23,7 @@ func TestAccRoute53ResolverEndpoint_basic(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, route53resolver.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckEndpointDestroy(ctx), @@ -57,7 +57,7 @@ func TestAccRoute53ResolverEndpoint_disappears(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, route53resolver.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckEndpointDestroy(ctx), @@ -81,7 +81,7 @@ func TestAccRoute53ResolverEndpoint_tags(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, route53resolver.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckEndpointDestroy(ctx), @@ -129,7 +129,7 @@ func TestAccRoute53ResolverEndpoint_updateOutbound(t *testing.T) { updatedName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, route53resolver.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckEndpointDestroy(ctx), diff --git a/internal/service/route53resolver/firewall_config_data_source_test.go b/internal/service/route53resolver/firewall_config_data_source_test.go index 53ac0aa5c1e6..59ed5b1d1b3f 100644 --- a/internal/service/route53resolver/firewall_config_data_source_test.go +++ b/internal/service/route53resolver/firewall_config_data_source_test.go @@ -16,7 +16,7 @@ func TestAccRoute53ResolverFirewallConfigDataSource_basic(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, route53resolver.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ diff --git a/internal/service/route53resolver/firewall_config_test.go b/internal/service/route53resolver/firewall_config_test.go index 583a596051ae..3d6c3f6c03ac 100644 --- a/internal/service/route53resolver/firewall_config_test.go +++ b/internal/service/route53resolver/firewall_config_test.go @@ -23,7 +23,7 @@ func TestAccRoute53ResolverFirewallConfig_basic(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, route53resolver.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckFirewallConfigDestroy(ctx), @@ -52,7 +52,7 @@ func TestAccRoute53ResolverFirewallConfig_disappears(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, route53resolver.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckFirewallConfigDestroy(ctx), 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 2d3aa533aa49..7c9371366fb6 100644 --- a/internal/service/route53resolver/firewall_domain_list_data_source_test.go +++ b/internal/service/route53resolver/firewall_domain_list_data_source_test.go @@ -17,7 +17,7 @@ func TestAccRoute53ResolverFirewallDomainListDataSource_basic(t *testing.T) { domainName := acctest.RandomFQDomainName() resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, route53resolver.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ diff --git a/internal/service/route53resolver/firewall_domain_list_test.go b/internal/service/route53resolver/firewall_domain_list_test.go index a32967ba79f9..22178b9e8be9 100644 --- a/internal/service/route53resolver/firewall_domain_list_test.go +++ b/internal/service/route53resolver/firewall_domain_list_test.go @@ -22,7 +22,7 @@ func TestAccRoute53ResolverFirewallDomainList_basic(t *testing.T) { resourceName := "aws_route53_resolver_firewall_domain_list.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, route53resolver.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckFirewallDomainListDestroy(ctx), @@ -55,7 +55,7 @@ func TestAccRoute53ResolverFirewallDomainList_domains(t *testing.T) { domainName2 := acctest.RandomFQDomainName() resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, route53resolver.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckFirewallDomainListDestroy(ctx), @@ -102,7 +102,7 @@ func TestAccRoute53ResolverFirewallDomainList_disappears(t *testing.T) { resourceName := "aws_route53_resolver_firewall_domain_list.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, route53resolver.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckFirewallDomainListDestroy(ctx), @@ -126,7 +126,7 @@ func TestAccRoute53ResolverFirewallDomainList_tags(t *testing.T) { resourceName := "aws_route53_resolver_firewall_domain_list.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, route53resolver.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckFirewallDomainListDestroy(ctx), 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 0e521ee3cafc..985bfbfc4083 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 @@ -16,7 +16,7 @@ func TestAccRoute53ResolverRuleGroupAssociationDataSource_basic(t *testing.T) { resourceName := "aws_route53_resolver_firewall_rule_group_association.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, route53resolver.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ diff --git a/internal/service/route53resolver/firewall_rule_group_association_test.go b/internal/service/route53resolver/firewall_rule_group_association_test.go index e9dde00723e5..e609774ca086 100644 --- a/internal/service/route53resolver/firewall_rule_group_association_test.go +++ b/internal/service/route53resolver/firewall_rule_group_association_test.go @@ -22,7 +22,7 @@ func TestAccRoute53ResolverFirewallRuleGroupAssociation_basic(t *testing.T) { resourceName := "aws_route53_resolver_firewall_rule_group_association.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, route53resolver.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckFirewallRuleGroupAssociationDestroy(ctx), @@ -56,7 +56,7 @@ func TestAccRoute53ResolverFirewallRuleGroupAssociation_name(t *testing.T) { resourceName := "aws_route53_resolver_firewall_rule_group_association.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, route53resolver.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckFirewallRuleGroupAssociationDestroy(ctx), @@ -91,7 +91,7 @@ func TestAccRoute53ResolverFirewallRuleGroupAssociation_mutationProtection(t *te resourceName := "aws_route53_resolver_firewall_rule_group_association.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, route53resolver.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckFirewallRuleGroupAssociationDestroy(ctx), @@ -126,7 +126,7 @@ func TestAccRoute53ResolverFirewallRuleGroupAssociation_priority(t *testing.T) { resourceName := "aws_route53_resolver_firewall_rule_group_association.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, route53resolver.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckFirewallRuleGroupAssociationDestroy(ctx), @@ -161,7 +161,7 @@ func TestAccRoute53ResolverFirewallRuleGroupAssociation_disappears(t *testing.T) resourceName := "aws_route53_resolver_firewall_rule_group_association.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, route53resolver.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckFirewallRuleGroupAssociationDestroy(ctx), @@ -185,7 +185,7 @@ func TestAccRoute53ResolverFirewallRuleGroupAssociation_tags(t *testing.T) { resourceName := "aws_route53_resolver_firewall_rule_group_association.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, route53resolver.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckFirewallRuleGroupAssociationDestroy(ctx), 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 dab4f2342923..3a901c49362a 100644 --- a/internal/service/route53resolver/firewall_rule_group_data_source_test.go +++ b/internal/service/route53resolver/firewall_rule_group_data_source_test.go @@ -16,7 +16,7 @@ func TestAccRoute53ResolverFirewallRuleGroupDataSource_basic(t *testing.T) { resourceName := "aws_route53_resolver_firewall_rule_group.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, route53resolver.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ diff --git a/internal/service/route53resolver/firewall_rule_group_test.go b/internal/service/route53resolver/firewall_rule_group_test.go index b2cacb91b31c..7be8f64bd062 100644 --- a/internal/service/route53resolver/firewall_rule_group_test.go +++ b/internal/service/route53resolver/firewall_rule_group_test.go @@ -22,7 +22,7 @@ func TestAccRoute53ResolverFirewallRuleGroup_basic(t *testing.T) { resourceName := "aws_route53_resolver_firewall_rule_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, route53resolver.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckFirewallRuleGroupDestroy(ctx), @@ -54,7 +54,7 @@ func TestAccRoute53ResolverFirewallRuleGroup_disappears(t *testing.T) { resourceName := "aws_route53_resolver_firewall_rule_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, route53resolver.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckFirewallRuleGroupDestroy(ctx), @@ -78,7 +78,7 @@ func TestAccRoute53ResolverFirewallRuleGroup_tags(t *testing.T) { resourceName := "aws_route53_resolver_firewall_rule_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, route53resolver.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckFirewallRuleGroupDestroy(ctx), diff --git a/internal/service/route53resolver/firewall_rule_test.go b/internal/service/route53resolver/firewall_rule_test.go index 9a84b934822f..89af3559a09b 100644 --- a/internal/service/route53resolver/firewall_rule_test.go +++ b/internal/service/route53resolver/firewall_rule_test.go @@ -22,7 +22,7 @@ func TestAccRoute53ResolverFirewallRule_basic(t *testing.T) { resourceName := "aws_route53_resolver_firewall_rule.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, route53resolver.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckFirewallRuleDestroy(ctx), @@ -54,7 +54,7 @@ func TestAccRoute53ResolverFirewallRule_block(t *testing.T) { resourceName := "aws_route53_resolver_firewall_rule.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, route53resolver.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckFirewallRuleDestroy(ctx), @@ -84,7 +84,7 @@ func TestAccRoute53ResolverFirewallRule_blockOverride(t *testing.T) { resourceName := "aws_route53_resolver_firewall_rule.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, route53resolver.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckFirewallRuleDestroy(ctx), @@ -117,7 +117,7 @@ func TestAccRoute53ResolverFirewallRule_disappears(t *testing.T) { resourceName := "aws_route53_resolver_firewall_rule.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, route53resolver.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckFirewallRuleDestroy(ctx), diff --git a/internal/service/route53resolver/firewall_rules_data_source_test.go b/internal/service/route53resolver/firewall_rules_data_source_test.go index b5a0822c7c5e..83a90ad00db4 100644 --- a/internal/service/route53resolver/firewall_rules_data_source_test.go +++ b/internal/service/route53resolver/firewall_rules_data_source_test.go @@ -32,7 +32,7 @@ func TestAccRoute53ResolverFirewallRulesDataSource_basic(t *testing.T) { priority := "100" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, route53resolver.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ diff --git a/internal/service/route53resolver/query_log_config_association_test.go b/internal/service/route53resolver/query_log_config_association_test.go index 58f7fdfda9cd..f6d9595481ad 100644 --- a/internal/service/route53resolver/query_log_config_association_test.go +++ b/internal/service/route53resolver/query_log_config_association_test.go @@ -24,7 +24,7 @@ func TestAccRoute53ResolverQueryLogConfigAssociation_basic(t *testing.T) { vpcResourceName := "aws_vpc.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, route53resolver.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckQueryLogConfigAssociationDestroy(ctx), @@ -53,7 +53,7 @@ func TestAccRoute53ResolverQueryLogConfigAssociation_disappears(t *testing.T) { resourceName := "aws_route53_resolver_query_log_config_association.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, route53resolver.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckQueryLogConfigAssociationDestroy(ctx), diff --git a/internal/service/route53resolver/query_log_config_test.go b/internal/service/route53resolver/query_log_config_test.go index b6d3d0485ceb..8e8f2e3798bd 100644 --- a/internal/service/route53resolver/query_log_config_test.go +++ b/internal/service/route53resolver/query_log_config_test.go @@ -23,7 +23,7 @@ func TestAccRoute53ResolverQueryLogConfig_basic(t *testing.T) { s3BucketResourceName := "aws_s3_bucket.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, route53resolver.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckQueryLogConfigDestroy(ctx), @@ -55,7 +55,7 @@ func TestAccRoute53ResolverQueryLogConfig_disappears(t *testing.T) { resourceName := "aws_route53_resolver_query_log_config.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, route53resolver.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckQueryLogConfigDestroy(ctx), @@ -80,7 +80,7 @@ func TestAccRoute53ResolverQueryLogConfig_tags(t *testing.T) { cwLogGroupResourceName := "aws_cloudwatch_log_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, route53resolver.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckQueryLogConfigDestroy(ctx), diff --git a/internal/service/route53resolver/rule_association_test.go b/internal/service/route53resolver/rule_association_test.go index 90feff800e8e..8ab792a77fee 100644 --- a/internal/service/route53resolver/rule_association_test.go +++ b/internal/service/route53resolver/rule_association_test.go @@ -26,7 +26,7 @@ func TestAccRoute53ResolverRuleAssociation_basic(t *testing.T) { domainName := acctest.RandomDomainName() resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, route53resolver.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRuleAssociationDestroy(ctx), @@ -57,7 +57,7 @@ func TestAccRoute53ResolverRuleAssociation_disappears(t *testing.T) { domainName := acctest.RandomDomainName() resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, route53resolver.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRuleAssociationDestroy(ctx), @@ -83,7 +83,7 @@ func TestAccRoute53ResolverRuleAssociation_Disappears_vpc(t *testing.T) { domainName := acctest.RandomDomainName() resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, route53resolver.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRuleAssociationDestroy(ctx), diff --git a/internal/service/route53resolver/rule_data_source_test.go b/internal/service/route53resolver/rule_data_source_test.go index 050775ed86f9..0e87d0074923 100644 --- a/internal/service/route53resolver/rule_data_source_test.go +++ b/internal/service/route53resolver/rule_data_source_test.go @@ -24,7 +24,7 @@ func TestAccRoute53ResolverRuleDataSource_basic(t *testing.T) { ds3ResourceName := "data.aws_route53_resolver_rule.by_name_and_rule_type" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, route53resolver.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ @@ -77,7 +77,7 @@ func TestAccRoute53ResolverRuleDataSource_resolverEndpointIdWithTags(t *testing. ds1ResourceName := "data.aws_route53_resolver_rule.by_resolver_endpoint_id" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, route53resolver.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ @@ -112,7 +112,7 @@ func TestAccRoute53ResolverRuleDataSource_sharedByMe(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckAlternateAccount(t) testAccPreCheck(ctx, t) }, @@ -150,7 +150,7 @@ func TestAccRoute53ResolverRuleDataSource_sharedWithMe(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckAlternateAccount(t) testAccPreCheck(ctx, t) }, diff --git a/internal/service/route53resolver/rule_test.go b/internal/service/route53resolver/rule_test.go index 1337008ae48b..0102ed892bd1 100644 --- a/internal/service/route53resolver/rule_test.go +++ b/internal/service/route53resolver/rule_test.go @@ -23,7 +23,7 @@ func TestAccRoute53ResolverRule_basic(t *testing.T) { resourceName := "aws_route53_resolver_rule.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, route53resolver.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRuleDestroy(ctx), @@ -59,7 +59,7 @@ func TestAccRoute53ResolverRule_disappears(t *testing.T) { resourceName := "aws_route53_resolver_rule.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, route53resolver.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRuleDestroy(ctx), @@ -83,7 +83,7 @@ func TestAccRoute53ResolverRule_tags(t *testing.T) { resourceName := "aws_route53_resolver_rule.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, route53resolver.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRuleDestroy(ctx), @@ -128,7 +128,7 @@ func TestAccRoute53ResolverRule_justDotDomainName(t *testing.T) { resourceName := "aws_route53_resolver_rule.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, route53resolver.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRuleDestroy(ctx), @@ -159,7 +159,7 @@ func TestAccRoute53ResolverRule_trailingDotDomainName(t *testing.T) { resourceName := "aws_route53_resolver_rule.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, route53resolver.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRuleDestroy(ctx), @@ -193,7 +193,7 @@ func TestAccRoute53ResolverRule_updateName(t *testing.T) { rName2 := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, route53resolver.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRuleDestroy(ctx), @@ -232,7 +232,7 @@ func TestAccRoute53ResolverRule_forward(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, route53resolver.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRuleDestroy(ctx), @@ -310,7 +310,7 @@ func TestAccRoute53ResolverRule_forwardEndpointRecreate(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, route53resolver.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRuleDestroy(ctx), diff --git a/internal/service/route53resolver/rules_data_source_test.go b/internal/service/route53resolver/rules_data_source_test.go index 0d7a0caa9660..083e12b244d5 100644 --- a/internal/service/route53resolver/rules_data_source_test.go +++ b/internal/service/route53resolver/rules_data_source_test.go @@ -16,7 +16,7 @@ func TestAccRoute53ResolverRulesDataSource_basic(t *testing.T) { dsResourceName := "data.aws_route53_resolver_rules.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, route53resolver.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ @@ -42,7 +42,7 @@ func TestAccRoute53ResolverRulesDataSource_resolverEndpointID(t *testing.T) { ds3ResourceName := "data.aws_route53_resolver_rules.by_invalid_owner_id" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, route53resolver.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ @@ -65,7 +65,7 @@ func TestAccRoute53ResolverRulesDataSource_nameRegex(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, route53resolver.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ @@ -84,7 +84,7 @@ func TestAccRoute53ResolverRulesDataSource_nonExistentNameRegex(t *testing.T) { dsResourceName := "data.aws_route53_resolver_rules.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, route53resolver.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ From 09d24b52499ff1de8bcc8591e16f7a68346ff342 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Fri, 24 Feb 2023 16:37:23 -0500 Subject: [PATCH 225/763] Add 'Context' argument to 'acctest.PreCheck' for rum. --- internal/service/rum/app_monitor_test.go | 8 ++++---- internal/service/rum/metrics_destination_test.go | 6 +++--- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/internal/service/rum/app_monitor_test.go b/internal/service/rum/app_monitor_test.go index 3f6b3ccf03a9..5a4dd1d6878f 100644 --- a/internal/service/rum/app_monitor_test.go +++ b/internal/service/rum/app_monitor_test.go @@ -22,7 +22,7 @@ func TestAccRUMAppMonitor_basic(t *testing.T) { resourceName := "aws_rum_app_monitor.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, cloudwatchrum.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckAppMonitorDestroy(ctx), @@ -74,7 +74,7 @@ func TestAccRUMAppMonitor_customEvents(t *testing.T) { resourceName := "aws_rum_app_monitor.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, cloudwatchrum.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckAppMonitorDestroy(ctx), @@ -119,7 +119,7 @@ func TestAccRUMAppMonitor_tags(t *testing.T) { resourceName := "aws_rum_app_monitor.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, cloudwatchrum.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckAppMonitorDestroy(ctx), @@ -165,7 +165,7 @@ func TestAccRUMAppMonitor_disappears(t *testing.T) { resourceName := "aws_rum_app_monitor.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, cloudwatchrum.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckAppMonitorDestroy(ctx), diff --git a/internal/service/rum/metrics_destination_test.go b/internal/service/rum/metrics_destination_test.go index 3079f2a5177e..d6c4628dfc15 100644 --- a/internal/service/rum/metrics_destination_test.go +++ b/internal/service/rum/metrics_destination_test.go @@ -22,7 +22,7 @@ func TestAccRUMMetricsDestination_basic(t *testing.T) { resourceName := "aws_rum_metrics_destination.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, cloudwatchrum.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckMetricsDestinationDestroy(ctx), @@ -51,7 +51,7 @@ func TestAccRUMMetricsDestination_disappears(t *testing.T) { resourceName := "aws_rum_metrics_destination.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, cloudwatchrum.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckMetricsDestinationDestroy(ctx), @@ -76,7 +76,7 @@ func TestAccRUMMetricsDestination_disappears_appMonitor(t *testing.T) { resourceName := "aws_rum_metrics_destination.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, cloudwatchrum.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckMetricsDestinationDestroy(ctx), From 578b6fec5fd8f5f5cbd14baab732424d213d75fd Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Fri, 24 Feb 2023 16:37:23 -0500 Subject: [PATCH 226/763] Add 'Context' argument to 'acctest.PreCheck' for s3. --- .../bucket_accelerate_configuration_test.go | 10 +- internal/service/s3/bucket_acl_test.go | 20 +-- .../s3/bucket_analytics_configuration_test.go | 24 ++-- .../s3/bucket_cors_configuration_test.go | 14 +- .../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 | 52 ++++---- internal/service/s3/bucket_logging_test.go | 16 +-- internal/service/s3/bucket_metric_test.go | 14 +- .../service/s3/bucket_notification_test.go | 14 +- .../s3/bucket_object_data_source_test.go | 22 ++-- .../bucket_object_lock_configuration_test.go | 12 +- internal/service/s3/bucket_object_test.go | 60 ++++----- .../s3/bucket_objects_data_source_test.go | 16 +-- .../s3/bucket_ownership_controls_test.go | 8 +- .../s3/bucket_policy_data_source_test.go | 2 +- internal/service/s3/bucket_policy_test.go | 18 +-- .../s3/bucket_public_access_block_test.go | 14 +- .../bucket_replication_configuration_test.go | 46 +++---- ...cket_request_payment_configuration_test.go | 10 +- ...rver_side_encryption_configuration_test.go | 22 ++-- internal/service/s3/bucket_test.go | 120 +++++++++--------- internal/service/s3/bucket_versioning_test.go | 30 ++--- .../s3/bucket_website_configuration_test.go | 30 ++--- .../s3/canonical_user_id_data_source_test.go | 2 +- internal/service/s3/object_copy_test.go | 6 +- .../service/s3/object_data_source_test.go | 22 ++-- internal/service/s3/object_test.go | 60 ++++----- .../service/s3/objects_data_source_test.go | 16 +-- 30 files changed, 348 insertions(+), 348 deletions(-) diff --git a/internal/service/s3/bucket_accelerate_configuration_test.go b/internal/service/s3/bucket_accelerate_configuration_test.go index 9e0d4f525493..13c09b223296 100644 --- a/internal/service/s3/bucket_accelerate_configuration_test.go +++ b/internal/service/s3/bucket_accelerate_configuration_test.go @@ -24,7 +24,7 @@ func TestAccS3BucketAccelerateConfiguration_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(cloudfront.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, s3.EndpointsID), @@ -55,7 +55,7 @@ func TestAccS3BucketAccelerateConfiguration_update(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(cloudfront.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, s3.EndpointsID), @@ -94,7 +94,7 @@ func TestAccS3BucketAccelerateConfiguration_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(cloudfront.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, s3.EndpointsID), @@ -120,7 +120,7 @@ func TestAccS3BucketAccelerateConfiguration_migrate_noChange(t *testing.T) { bucketResourceName := "aws_s3_bucket.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckBucketAccelerateConfigurationDestroy(ctx), @@ -151,7 +151,7 @@ func TestAccS3BucketAccelerateConfiguration_migrate_withChange(t *testing.T) { bucketResourceName := "aws_s3_bucket.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckBucketAccelerateConfigurationDestroy(ctx), diff --git a/internal/service/s3/bucket_acl_test.go b/internal/service/s3/bucket_acl_test.go index 57871f75827a..c23c80b618dd 100644 --- a/internal/service/s3/bucket_acl_test.go +++ b/internal/service/s3/bucket_acl_test.go @@ -258,7 +258,7 @@ func TestAccS3BucketACL_basic(t *testing.T) { resourceName := "aws_s3_bucket_acl.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckBucketDestroy(ctx), @@ -292,7 +292,7 @@ func TestAccS3BucketACL_disappears(t *testing.T) { resourceName := "aws_s3_bucket_acl.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckBucketDestroy(ctx), @@ -318,7 +318,7 @@ func TestAccS3BucketACL_migrate_aclNoChange(t *testing.T) { resourceName := "aws_s3_bucket_acl.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckBucketDestroy(ctx), @@ -348,7 +348,7 @@ func TestAccS3BucketACL_migrate_aclWithChange(t *testing.T) { resourceName := "aws_s3_bucket_acl.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckBucketDestroy(ctx), @@ -378,7 +378,7 @@ func TestAccS3BucketACL_migrate_grantsNoChange(t *testing.T) { resourceName := "aws_s3_bucket_acl.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckBucketDestroy(ctx), @@ -428,7 +428,7 @@ func TestAccS3BucketACL_migrate_grantsWithChange(t *testing.T) { resourceName := "aws_s3_bucket_acl.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckBucketDestroy(ctx), @@ -474,7 +474,7 @@ func TestAccS3BucketACL_updateACL(t *testing.T) { resourceName := "aws_s3_bucket_acl.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckBucketDestroy(ctx), @@ -508,7 +508,7 @@ func TestAccS3BucketACL_updateGrant(t *testing.T) { resourceName := "aws_s3_bucket_acl.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckBucketDestroy(ctx), @@ -578,7 +578,7 @@ func TestAccS3BucketACL_ACLToGrant(t *testing.T) { resourceName := "aws_s3_bucket_acl.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckBucketDestroy(ctx), @@ -614,7 +614,7 @@ func TestAccS3BucketACL_grantToACL(t *testing.T) { resourceName := "aws_s3_bucket_acl.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckBucketDestroy(ctx), diff --git a/internal/service/s3/bucket_analytics_configuration_test.go b/internal/service/s3/bucket_analytics_configuration_test.go index 0d155e251d69..59398f6d7ad6 100644 --- a/internal/service/s3/bucket_analytics_configuration_test.go +++ b/internal/service/s3/bucket_analytics_configuration_test.go @@ -26,7 +26,7 @@ func TestAccS3BucketAnalyticsConfiguration_basic(t *testing.T) { resourceName := "aws_s3_bucket_analytics_configuration.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckBucketAnalyticsConfigurationDestroy(ctx), @@ -57,7 +57,7 @@ func TestAccS3BucketAnalyticsConfiguration_removed(t *testing.T) { resourceName := "aws_s3_bucket_analytics_configuration.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckBucketAnalyticsConfigurationDestroy(ctx), @@ -88,7 +88,7 @@ func TestAccS3BucketAnalyticsConfiguration_updateBasic(t *testing.T) { resourceName := "aws_s3_bucket_analytics_configuration.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckBucketAnalyticsConfigurationDestroy(ctx), @@ -139,7 +139,7 @@ func TestAccS3BucketAnalyticsConfiguration_WithFilter_empty(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckBucketAnalyticsConfigurationDestroy(ctx), @@ -163,7 +163,7 @@ func TestAccS3BucketAnalyticsConfiguration_WithFilter_prefix(t *testing.T) { prefixUpdate := fmt.Sprintf("prefix-update-%d/", rInt) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckBucketAnalyticsConfigurationDestroy(ctx), @@ -206,7 +206,7 @@ func TestAccS3BucketAnalyticsConfiguration_WithFilter_singleTag(t *testing.T) { tag1Update := fmt.Sprintf("tag-update-%d", rInt) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckBucketAnalyticsConfigurationDestroy(ctx), @@ -253,7 +253,7 @@ func TestAccS3BucketAnalyticsConfiguration_WithFilter_multipleTags(t *testing.T) tag2Update := fmt.Sprintf("tag2-update-%d", rInt) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckBucketAnalyticsConfigurationDestroy(ctx), @@ -304,7 +304,7 @@ func TestAccS3BucketAnalyticsConfiguration_WithFilter_prefixAndTags(t *testing.T tag2Update := fmt.Sprintf("tag2-update-%d", rInt) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckBucketAnalyticsConfigurationDestroy(ctx), @@ -350,7 +350,7 @@ func TestAccS3BucketAnalyticsConfiguration_WithFilter_remove(t *testing.T) { prefix := fmt.Sprintf("prefix-%d/", rInt) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckBucketAnalyticsConfigurationDestroy(ctx), @@ -382,7 +382,7 @@ func TestAccS3BucketAnalyticsConfiguration_WithStorageClassAnalysis_empty(t *tes rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckBucketAnalyticsConfigurationDestroy(ctx), @@ -403,7 +403,7 @@ func TestAccS3BucketAnalyticsConfiguration_WithStorageClassAnalysis_default(t *t rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckBucketAnalyticsConfigurationDestroy(ctx), @@ -440,7 +440,7 @@ func TestAccS3BucketAnalyticsConfiguration_WithStorageClassAnalysis_full(t *test prefix := fmt.Sprintf("prefix-%d/", rInt) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckBucketAnalyticsConfigurationDestroy(ctx), diff --git a/internal/service/s3/bucket_cors_configuration_test.go b/internal/service/s3/bucket_cors_configuration_test.go index 44360bfe6fb5..6c79177d7ce1 100644 --- a/internal/service/s3/bucket_cors_configuration_test.go +++ b/internal/service/s3/bucket_cors_configuration_test.go @@ -24,7 +24,7 @@ func TestAccS3BucketCorsConfiguration_basic(t *testing.T) { resourceName := "aws_s3_bucket_cors_configuration.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckBucketCorsConfigurationDestroy(ctx), @@ -58,7 +58,7 @@ func TestAccS3BucketCorsConfiguration_disappears(t *testing.T) { resourceName := "aws_s3_bucket_cors_configuration.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckBucketCorsConfigurationDestroy(ctx), @@ -81,7 +81,7 @@ func TestAccS3BucketCorsConfiguration_update(t *testing.T) { resourceName := "aws_s3_bucket_cors_configuration.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckBucketCorsConfigurationDestroy(ctx), @@ -146,7 +146,7 @@ func TestAccS3BucketCorsConfiguration_SingleRule(t *testing.T) { resourceName := "aws_s3_bucket_cors_configuration.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckBucketCorsConfigurationDestroy(ctx), @@ -188,7 +188,7 @@ func TestAccS3BucketCorsConfiguration_MultipleRules(t *testing.T) { resourceName := "aws_s3_bucket_cors_configuration.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckBucketCorsConfigurationDestroy(ctx), @@ -233,7 +233,7 @@ func TestAccS3BucketCorsConfiguration_migrate_corsRuleNoChange(t *testing.T) { resourceName := "aws_s3_bucket_cors_configuration.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckBucketDestroy(ctx), @@ -276,7 +276,7 @@ func TestAccS3BucketCorsConfiguration_migrate_corsRuleWithChange(t *testing.T) { resourceName := "aws_s3_bucket_cors_configuration.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckBucketDestroy(ctx), diff --git a/internal/service/s3/bucket_data_source_test.go b/internal/service/s3/bucket_data_source_test.go index 7eb8b4c270a7..43e133aea710 100644 --- a/internal/service/s3/bucket_data_source_test.go +++ b/internal/service/s3/bucket_data_source_test.go @@ -18,7 +18,7 @@ func TestAccS3BucketDataSource_basic(t *testing.T) { hostedZoneID, _ := tfs3.HostedZoneIDForRegion(region) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ @@ -43,7 +43,7 @@ func TestAccS3BucketDataSource_website(t *testing.T) { bucketName := sdkacctest.RandomWithPrefix("tf-test-bucket") resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ diff --git a/internal/service/s3/bucket_intelligent_tiering_configuration_test.go b/internal/service/s3/bucket_intelligent_tiering_configuration_test.go index 311f212cb9fe..e873a11044fb 100644 --- a/internal/service/s3/bucket_intelligent_tiering_configuration_test.go +++ b/internal/service/s3/bucket_intelligent_tiering_configuration_test.go @@ -23,7 +23,7 @@ func TestAccS3BucketIntelligentTieringConfiguration_basic(t *testing.T) { bucketResourceName := "aws_s3_bucket.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckBucketIntelligentTieringConfigurationDestroy(ctx), @@ -57,7 +57,7 @@ func TestAccS3BucketIntelligentTieringConfiguration_disappears(t *testing.T) { resourceName := "aws_s3_bucket_intelligent_tiering_configuration.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckBucketIntelligentTieringConfigurationDestroy(ctx), @@ -82,7 +82,7 @@ func TestAccS3BucketIntelligentTieringConfiguration_Filter(t *testing.T) { bucketResourceName := "aws_s3_bucket.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckBucketIntelligentTieringConfigurationDestroy(ctx), diff --git a/internal/service/s3/bucket_inventory_test.go b/internal/service/s3/bucket_inventory_test.go index d44243989b54..557b8b15fb3a 100644 --- a/internal/service/s3/bucket_inventory_test.go +++ b/internal/service/s3/bucket_inventory_test.go @@ -29,7 +29,7 @@ func TestAccS3BucketInventory_basic(t *testing.T) { inventoryName := t.Name() resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckBucketInventoryDestroy(ctx), @@ -76,7 +76,7 @@ func TestAccS3BucketInventory_encryptWithSSES3(t *testing.T) { inventoryName := t.Name() resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckBucketInventoryDestroy(ctx), @@ -107,7 +107,7 @@ func TestAccS3BucketInventory_encryptWithSSEKMS(t *testing.T) { inventoryName := t.Name() resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckBucketInventoryDestroy(ctx), diff --git a/internal/service/s3/bucket_lifecycle_configuration_test.go b/internal/service/s3/bucket_lifecycle_configuration_test.go index 586fca2ee45e..c32bd9f2cec2 100644 --- a/internal/service/s3/bucket_lifecycle_configuration_test.go +++ b/internal/service/s3/bucket_lifecycle_configuration_test.go @@ -24,7 +24,7 @@ func TestAccS3BucketLifecycleConfiguration_basic(t *testing.T) { resourceName := "aws_s3_bucket_lifecycle_configuration.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckBucketLifecycleConfigurationDestroy(ctx), @@ -60,7 +60,7 @@ func TestAccS3BucketLifecycleConfiguration_disappears(t *testing.T) { resourceName := "aws_s3_bucket_lifecycle_configuration.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckBucketLifecycleConfigurationDestroy(ctx), @@ -86,7 +86,7 @@ func TestAccS3BucketLifecycleConfiguration_filterWithPrefix(t *testing.T) { dateUpdated := time.Date(currTime.Year()+1, currTime.Month(), currTime.Day(), 0, 0, 0, 0, time.UTC).Format(time.RFC3339) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckBucketLifecycleConfigurationDestroy(ctx), @@ -141,7 +141,7 @@ func TestAccS3BucketLifecycleConfiguration_Filter_ObjectSizeGreaterThan(t *testi date := time.Date(currTime.Year(), currTime.Month()+1, currTime.Day(), 0, 0, 0, 0, time.UTC).Format(time.RFC3339) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckBucketLifecycleConfigurationDestroy(ctx), @@ -177,7 +177,7 @@ func TestAccS3BucketLifecycleConfiguration_Filter_ObjectSizeLessThan(t *testing. date := time.Date(currTime.Year(), currTime.Month()+1, currTime.Day(), 0, 0, 0, 0, time.UTC).Format(time.RFC3339) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckBucketLifecycleConfigurationDestroy(ctx), @@ -213,7 +213,7 @@ func TestAccS3BucketLifecycleConfiguration_Filter_ObjectSizeRange(t *testing.T) date := time.Date(currTime.Year(), currTime.Month()+1, currTime.Day(), 0, 0, 0, 0, time.UTC).Format(time.RFC3339) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckBucketLifecycleConfigurationDestroy(ctx), @@ -251,7 +251,7 @@ func TestAccS3BucketLifecycleConfiguration_Filter_ObjectSizeRangeAndPrefix(t *te date := time.Date(currTime.Year(), currTime.Month()+1, currTime.Day(), 0, 0, 0, 0, time.UTC).Format(time.RFC3339) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckBucketLifecycleConfigurationDestroy(ctx), @@ -288,7 +288,7 @@ func TestAccS3BucketLifecycleConfiguration_disableRule(t *testing.T) { resourceName := "aws_s3_bucket_lifecycle_configuration.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckBucketLifecycleConfigurationDestroy(ctx), @@ -334,7 +334,7 @@ func TestAccS3BucketLifecycleConfiguration_multipleRules(t *testing.T) { expirationDate := time.Date(date.Year(), date.Month(), date.Day()+14, 0, 0, 0, 0, time.UTC).Format(time.RFC3339) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckBucketLifecycleConfigurationDestroy(ctx), @@ -389,7 +389,7 @@ func TestAccS3BucketLifecycleConfiguration_multipleRules_noFilterOrPrefix(t *tes resourceName := "aws_s3_bucket_lifecycle_configuration.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckBucketLifecycleConfigurationDestroy(ctx), @@ -420,7 +420,7 @@ func TestAccS3BucketLifecycleConfiguration_nonCurrentVersionExpiration(t *testin resourceName := "aws_s3_bucket_lifecycle_configuration.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckBucketLifecycleConfigurationDestroy(ctx), @@ -450,7 +450,7 @@ func TestAccS3BucketLifecycleConfiguration_nonCurrentVersionTransition(t *testin resourceName := "aws_s3_bucket_lifecycle_configuration.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckBucketLifecycleConfigurationDestroy(ctx), @@ -488,7 +488,7 @@ func TestAccS3BucketLifecycleConfiguration_prefix(t *testing.T) { resourceName := "aws_s3_bucket_lifecycle_configuration.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckBucketLifecycleConfigurationDestroy(ctx), @@ -524,7 +524,7 @@ func TestAccS3BucketLifecycleConfiguration_Filter_Tag(t *testing.T) { resourceName := "aws_s3_bucket_lifecycle_configuration.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckBucketLifecycleConfigurationDestroy(ctx), @@ -561,7 +561,7 @@ func TestAccS3BucketLifecycleConfiguration_RuleExpiration_expireMarkerOnly(t *te resourceName := "aws_s3_bucket_lifecycle_configuration.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckBucketLifecycleConfigurationDestroy(ctx), @@ -607,7 +607,7 @@ func TestAccS3BucketLifecycleConfiguration_RuleExpiration_emptyBlock(t *testing. resourceName := "aws_s3_bucket_lifecycle_configuration.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckBucketLifecycleConfigurationDestroy(ctx), @@ -637,7 +637,7 @@ func TestAccS3BucketLifecycleConfiguration_ruleAbortIncompleteMultipartUpload(t resourceName := "aws_s3_bucket_lifecycle_configuration.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckBucketLifecycleConfigurationDestroy(ctx), @@ -688,7 +688,7 @@ func TestAccS3BucketLifecycleConfiguration_TransitionDate_standardIa(t *testing. date := time.Date(currTime.Year(), currTime.Month()+1, currTime.Day(), 0, 0, 0, 0, time.UTC).Format(time.RFC3339) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckBucketLifecycleConfigurationDestroy(ctx), @@ -720,7 +720,7 @@ func TestAccS3BucketLifecycleConfiguration_TransitionDate_intelligentTiering(t * date := time.Date(currTime.Year(), currTime.Month()+1, currTime.Day(), 0, 0, 0, 0, time.UTC).Format(time.RFC3339) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckBucketLifecycleConfigurationDestroy(ctx), @@ -747,7 +747,7 @@ func TestAccS3BucketLifecycleConfiguration_TransitionStorageClassOnly_intelligen resourceName := "aws_s3_bucket_lifecycle_configuration.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckBucketLifecycleConfigurationDestroy(ctx), @@ -779,7 +779,7 @@ func TestAccS3BucketLifecycleConfiguration_TransitionZeroDays_intelligentTiering resourceName := "aws_s3_bucket_lifecycle_configuration.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckBucketLifecycleConfigurationDestroy(ctx), @@ -808,7 +808,7 @@ func TestAccS3BucketLifecycleConfiguration_TransitionUpdateBetweenDaysAndDate_in date := time.Date(currTime.Year(), currTime.Month()+1, currTime.Day(), 0, 0, 0, 0, time.UTC).Format(time.RFC3339) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckBucketLifecycleConfigurationDestroy(ctx), @@ -847,7 +847,7 @@ func TestAccS3BucketLifecycleConfiguration_EmptyFilter_NonCurrentVersions(t *tes resourceName := "aws_s3_bucket_lifecycle_configuration.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckBucketLifecycleConfigurationDestroy(ctx), @@ -874,7 +874,7 @@ func TestAccS3BucketLifecycleConfiguration_migrate_noChange(t *testing.T) { bucketResourceName := "aws_s3_bucket.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckBucketLifecycleConfigurationDestroy(ctx), @@ -917,7 +917,7 @@ func TestAccS3BucketLifecycleConfiguration_migrate_withChange(t *testing.T) { bucketResourceName := "aws_s3_bucket.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckBucketLifecycleConfigurationDestroy(ctx), @@ -960,7 +960,7 @@ func TestAccS3BucketLifecycleConfiguration_Update_filterWithAndToFilterWithPrefi resourceName := "aws_s3_bucket_lifecycle_configuration.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckBucketLifecycleConfigurationDestroy(ctx), diff --git a/internal/service/s3/bucket_logging_test.go b/internal/service/s3/bucket_logging_test.go index e025ceb3d2cc..b0731c01bda9 100644 --- a/internal/service/s3/bucket_logging_test.go +++ b/internal/service/s3/bucket_logging_test.go @@ -23,7 +23,7 @@ func TestAccS3BucketLogging_basic(t *testing.T) { resourceName := "aws_s3_bucket_logging.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckBucketLoggingDestroy(ctx), @@ -53,7 +53,7 @@ func TestAccS3BucketLogging_disappears(t *testing.T) { resourceName := "aws_s3_bucket_logging.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckBucketLoggingDestroy(ctx), @@ -77,7 +77,7 @@ func TestAccS3BucketLogging_update(t *testing.T) { resourceName := "aws_s3_bucket_logging.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckBucketLoggingDestroy(ctx), @@ -130,7 +130,7 @@ func TestAccS3BucketLogging_TargetGrantByID(t *testing.T) { resourceName := "aws_s3_bucket_logging.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckBucketLoggingDestroy(ctx), @@ -195,7 +195,7 @@ func TestAccS3BucketLogging_TargetGrantByEmail(t *testing.T) { resourceName := "aws_s3_bucket_logging.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckBucketLoggingDestroy(ctx), @@ -253,7 +253,7 @@ func TestAccS3BucketLogging_TargetGrantByGroup(t *testing.T) { resourceName := "aws_s3_bucket_logging.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckBucketLoggingDestroy(ctx), @@ -312,7 +312,7 @@ func TestAccS3BucketLogging_migrate_loggingNoChange(t *testing.T) { resourceName := "aws_s3_bucket_logging.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckBucketDestroy(ctx), @@ -345,7 +345,7 @@ func TestAccS3BucketLogging_migrate_loggingWithChange(t *testing.T) { resourceName := "aws_s3_bucket_logging.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckBucketDestroy(ctx), diff --git a/internal/service/s3/bucket_metric_test.go b/internal/service/s3/bucket_metric_test.go index 023eb7110695..49012a4f01f9 100644 --- a/internal/service/s3/bucket_metric_test.go +++ b/internal/service/s3/bucket_metric_test.go @@ -284,7 +284,7 @@ func TestAccS3BucketMetric_basic(t *testing.T) { metricName := t.Name() resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckBucketMetricDestroy(ctx), @@ -319,7 +319,7 @@ func TestAccS3BucketMetric_withEmptyFilter(t *testing.T) { metricName := t.Name() resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckBucketMetricDestroy(ctx), @@ -347,7 +347,7 @@ func TestAccS3BucketMetric_withFilterPrefix(t *testing.T) { prefixUpdate := fmt.Sprintf("prefix-update-%d/", rInt) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckBucketMetricDestroy(ctx), @@ -395,7 +395,7 @@ func TestAccS3BucketMetric_withFilterPrefixAndMultipleTags(t *testing.T) { tag2Update := fmt.Sprintf("tag2-update-%d", rInt) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckBucketMetricDestroy(ctx), @@ -445,7 +445,7 @@ func TestAccS3BucketMetric_withFilterPrefixAndSingleTag(t *testing.T) { tag1Update := fmt.Sprintf("tag-update-%d", rInt) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckBucketMetricDestroy(ctx), @@ -493,7 +493,7 @@ func TestAccS3BucketMetric_withFilterMultipleTags(t *testing.T) { tag2Update := fmt.Sprintf("tag2-update-%d", rInt) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckBucketMetricDestroy(ctx), @@ -541,7 +541,7 @@ func TestAccS3BucketMetric_withFilterSingleTag(t *testing.T) { tag1Update := fmt.Sprintf("tag-update-%d", rInt) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckBucketMetricDestroy(ctx), diff --git a/internal/service/s3/bucket_notification_test.go b/internal/service/s3/bucket_notification_test.go index 87d6fadb0c8e..dfed7c20b96f 100644 --- a/internal/service/s3/bucket_notification_test.go +++ b/internal/service/s3/bucket_notification_test.go @@ -24,7 +24,7 @@ func TestAccS3BucketNotification_eventbridge(t *testing.T) { resourceName := "aws_s3_bucket_notification.notification" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckBucketNotificationDestroy(ctx), @@ -49,7 +49,7 @@ func TestAccS3BucketNotification_lambdaFunction(t *testing.T) { resourceName := "aws_s3_bucket_notification.notification" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckBucketNotificationDestroy(ctx), @@ -91,7 +91,7 @@ func TestAccS3BucketNotification_LambdaFunctionLambdaFunctionARN_alias(t *testin resourceName := "aws_s3_bucket_notification.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckBucketNotificationDestroy(ctx), @@ -122,7 +122,7 @@ func TestAccS3BucketNotification_queue(t *testing.T) { resourceName := "aws_s3_bucket_notification.notification" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckBucketNotificationDestroy(ctx), @@ -164,7 +164,7 @@ func TestAccS3BucketNotification_topic(t *testing.T) { resourceName := "aws_s3_bucket_notification.notification" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckBucketNotificationDestroy(ctx), @@ -195,7 +195,7 @@ func TestAccS3BucketNotification_Topic_multiple(t *testing.T) { resourceName := "aws_s3_bucket_notification.notification" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckBucketNotificationDestroy(ctx), @@ -249,7 +249,7 @@ func TestAccS3BucketNotification_update(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckBucketNotificationDestroy(ctx), diff --git a/internal/service/s3/bucket_object_data_source_test.go b/internal/service/s3/bucket_object_data_source_test.go index 2541261848f7..c814f0dafad6 100644 --- a/internal/service/s3/bucket_object_data_source_test.go +++ b/internal/service/s3/bucket_object_data_source_test.go @@ -27,7 +27,7 @@ func TestAccS3BucketObjectDataSource_basic(t *testing.T) { dataSourceName := "data.aws_s3_object.obj" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, PreventPostDestroyRefresh: true, @@ -61,7 +61,7 @@ func TestAccS3BucketObjectDataSource_basicViaAccessPoint(t *testing.T) { accessPointResourceName := "aws_s3_access_point.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ @@ -90,7 +90,7 @@ func TestAccS3BucketObjectDataSource_readableBody(t *testing.T) { dataSourceName := "data.aws_s3_object.obj" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, PreventPostDestroyRefresh: true, @@ -125,7 +125,7 @@ func TestAccS3BucketObjectDataSource_kmsEncrypted(t *testing.T) { dataSourceName := "data.aws_s3_object.obj" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, PreventPostDestroyRefresh: true, @@ -162,7 +162,7 @@ func TestAccS3BucketObjectDataSource_bucketKeyEnabled(t *testing.T) { dataSourceName := "data.aws_s3_object.obj" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, PreventPostDestroyRefresh: true, @@ -200,7 +200,7 @@ func TestAccS3BucketObjectDataSource_allParams(t *testing.T) { dataSourceName := "data.aws_s3_object.obj" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, PreventPostDestroyRefresh: true, @@ -252,7 +252,7 @@ func TestAccS3BucketObjectDataSource_objectLockLegalHoldOff(t *testing.T) { dataSourceName := "data.aws_s3_object.obj" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, PreventPostDestroyRefresh: true, @@ -288,7 +288,7 @@ func TestAccS3BucketObjectDataSource_objectLockLegalHoldOn(t *testing.T) { dataSourceName := "data.aws_s3_object.obj" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, PreventPostDestroyRefresh: true, @@ -326,7 +326,7 @@ func TestAccS3BucketObjectDataSource_leadingSlash(t *testing.T) { resourceOnlyConf, conf := testAccBucketObjectDataSourceConfig_leadingSlash(rInt) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, PreventPostDestroyRefresh: true, @@ -381,7 +381,7 @@ func TestAccS3BucketObjectDataSource_multipleSlashes(t *testing.T) { resourceOnlyConf, conf := testAccBucketObjectDataSourceConfig_multipleSlashes(rInt) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, PreventPostDestroyRefresh: true, @@ -424,7 +424,7 @@ func TestAccS3BucketObjectDataSource_singleSlashAsKey(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, PreventPostDestroyRefresh: true, diff --git a/internal/service/s3/bucket_object_lock_configuration_test.go b/internal/service/s3/bucket_object_lock_configuration_test.go index 26658841249d..5b6fc2985fb3 100644 --- a/internal/service/s3/bucket_object_lock_configuration_test.go +++ b/internal/service/s3/bucket_object_lock_configuration_test.go @@ -22,7 +22,7 @@ func TestAccS3BucketObjectLockConfiguration_basic(t *testing.T) { resourceName := "aws_s3_bucket_object_lock_configuration.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckBucketObjectLockConfigurationDestroy(ctx), @@ -53,7 +53,7 @@ func TestAccS3BucketObjectLockConfiguration_disappears(t *testing.T) { resourceName := "aws_s3_bucket_object_lock_configuration.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckBucketObjectLockConfigurationDestroy(ctx), @@ -76,7 +76,7 @@ func TestAccS3BucketObjectLockConfiguration_update(t *testing.T) { resourceName := "aws_s3_bucket_object_lock_configuration.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckBucketDestroy(ctx), @@ -113,7 +113,7 @@ func TestAccS3BucketObjectLockConfiguration_migrate_noChange(t *testing.T) { bucketResourceName := "aws_s3_bucket.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckBucketObjectLockConfigurationDestroy(ctx), @@ -151,7 +151,7 @@ func TestAccS3BucketObjectLockConfiguration_migrate_withChange(t *testing.T) { bucketResourceName := "aws_s3_bucket.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckBucketObjectLockConfigurationDestroy(ctx), @@ -186,7 +186,7 @@ func TestAccS3BucketObjectLockConfiguration_noRule(t *testing.T) { resourceName := "aws_s3_bucket_object_lock_configuration.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckBucketObjectLockConfigurationDestroy(ctx), diff --git a/internal/service/s3/bucket_object_test.go b/internal/service/s3/bucket_object_test.go index 8ca0bf88346c..62c0342fa46b 100644 --- a/internal/service/s3/bucket_object_test.go +++ b/internal/service/s3/bucket_object_test.go @@ -35,7 +35,7 @@ func TestAccS3BucketObject_noNameNoKey(t *testing.T) { keyError := regexp.MustCompile(`key must not be empty`) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckBucketObjectDestroy(ctx), @@ -61,7 +61,7 @@ func TestAccS3BucketObject_empty(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckBucketObjectDestroy(ctx), @@ -95,7 +95,7 @@ func TestAccS3BucketObject_source(t *testing.T) { defer os.Remove(source) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckBucketObjectDestroy(ctx), @@ -125,7 +125,7 @@ func TestAccS3BucketObject_content(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckBucketObjectDestroy(ctx), @@ -158,7 +158,7 @@ func TestAccS3BucketObject_etagEncryption(t *testing.T) { defer os.Remove(source) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckBucketObjectDestroy(ctx), @@ -190,7 +190,7 @@ func TestAccS3BucketObject_contentBase64(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckBucketObjectDestroy(ctx), @@ -228,7 +228,7 @@ func TestAccS3BucketObject_sourceHashTrigger(t *testing.T) { } resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckBucketObjectDestroy(ctx), @@ -274,7 +274,7 @@ func TestAccS3BucketObject_withContentCharacteristics(t *testing.T) { defer os.Remove(source) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckBucketObjectDestroy(ctx), @@ -301,7 +301,7 @@ func TestAccS3BucketObject_nonVersioned(t *testing.T) { resourceName := "aws_s3_bucket_object.object" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckAssumeRoleARN(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckAssumeRoleARN(t) }, ErrorCheck: acctest.ErrorCheck(t, s3.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckBucketObjectDestroy(ctx), @@ -337,7 +337,7 @@ func TestAccS3BucketObject_updates(t *testing.T) { defer os.Remove(sourceInitial) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckBucketObjectDestroy(ctx), @@ -396,7 +396,7 @@ func TestAccS3BucketObject_updateSameFile(t *testing.T) { } resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckBucketObjectDestroy(ctx), @@ -435,7 +435,7 @@ func TestAccS3BucketObject_updatesWithVersioning(t *testing.T) { defer os.Remove(sourceInitial) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckBucketObjectDestroy(ctx), @@ -481,7 +481,7 @@ func TestAccS3BucketObject_updatesWithVersioningViaAccessPoint(t *testing.T) { defer os.Remove(sourceInitial) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckBucketObjectDestroy(ctx), @@ -518,7 +518,7 @@ func TestAccS3BucketObject_kms(t *testing.T) { defer os.Remove(source) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckBucketObjectDestroy(ctx), @@ -553,7 +553,7 @@ func TestAccS3BucketObject_sse(t *testing.T) { defer os.Remove(source) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckBucketObjectDestroy(ctx), @@ -585,7 +585,7 @@ func TestAccS3BucketObject_acl(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckBucketObjectDestroy(ctx), @@ -637,7 +637,7 @@ func TestAccS3BucketObject_metadata(t *testing.T) { resourceName := "aws_s3_bucket_object.object" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckBucketObjectDestroy(ctx), @@ -685,7 +685,7 @@ func TestAccS3BucketObject_storageClass(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckBucketObjectDestroy(ctx), @@ -750,7 +750,7 @@ func TestAccS3BucketObject_tags(t *testing.T) { key := "test-key" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckBucketObjectDestroy(ctx), @@ -823,7 +823,7 @@ func TestAccS3BucketObject_tagsLeadingSingleSlash(t *testing.T) { key := "/test-key" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckBucketObjectDestroy(ctx), @@ -896,7 +896,7 @@ func TestAccS3BucketObject_tagsLeadingMultipleSlashes(t *testing.T) { key := "/////test-key" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckBucketObjectDestroy(ctx), @@ -962,7 +962,7 @@ func TestAccS3BucketObject_tagsMultipleSlashes(t *testing.T) { key := "first//second///third//" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckBucketObjectDestroy(ctx), @@ -1027,7 +1027,7 @@ func TestAccS3BucketObject_objectLockLegalHoldStartWithNone(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckBucketObjectDestroy(ctx), @@ -1076,7 +1076,7 @@ func TestAccS3BucketObject_objectLockLegalHoldStartWithOn(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckBucketObjectDestroy(ctx), @@ -1114,7 +1114,7 @@ func TestAccS3BucketObject_objectLockRetentionStartWithNone(t *testing.T) { retainUntilDate := time.Now().UTC().AddDate(0, 0, 10).Format(time.RFC3339) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckBucketObjectDestroy(ctx), @@ -1166,7 +1166,7 @@ func TestAccS3BucketObject_objectLockRetentionStartWithSet(t *testing.T) { retainUntilDate3 := time.Now().UTC().AddDate(0, 0, 10).Format(time.RFC3339) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckBucketObjectDestroy(ctx), @@ -1225,7 +1225,7 @@ func TestAccS3BucketObject_objectBucketKeyEnabled(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckBucketObjectDestroy(ctx), @@ -1249,7 +1249,7 @@ func TestAccS3BucketObject_bucketBucketKeyEnabled(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckBucketObjectDestroy(ctx), @@ -1273,7 +1273,7 @@ func TestAccS3BucketObject_defaultBucketSSE(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckBucketObjectDestroy(ctx), @@ -1297,7 +1297,7 @@ func TestAccS3BucketObject_ignoreTags(t *testing.T) { key := "test-key" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckBucketObjectDestroy(ctx), diff --git a/internal/service/s3/bucket_objects_data_source_test.go b/internal/service/s3/bucket_objects_data_source_test.go index 8d27098a5b64..fd52b3f30a81 100644 --- a/internal/service/s3/bucket_objects_data_source_test.go +++ b/internal/service/s3/bucket_objects_data_source_test.go @@ -18,7 +18,7 @@ func TestAccS3BucketObjectsDataSource_basic(t *testing.T) { rInt := sdkacctest.RandInt() resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, PreventPostDestroyRefresh: true, @@ -44,7 +44,7 @@ func TestAccS3BucketObjectsDataSource_basicViaAccessPoint(t *testing.T) { rInt := sdkacctest.RandInt() resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, PreventPostDestroyRefresh: true, @@ -70,7 +70,7 @@ func TestAccS3BucketObjectsDataSource_all(t *testing.T) { rInt := sdkacctest.RandInt() resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, PreventPostDestroyRefresh: true, @@ -101,7 +101,7 @@ func TestAccS3BucketObjectsDataSource_prefixes(t *testing.T) { rInt := sdkacctest.RandInt() resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, PreventPostDestroyRefresh: true, @@ -131,7 +131,7 @@ func TestAccS3BucketObjectsDataSource_encoded(t *testing.T) { rInt := sdkacctest.RandInt() resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, PreventPostDestroyRefresh: true, @@ -157,7 +157,7 @@ func TestAccS3BucketObjectsDataSource_maxKeys(t *testing.T) { rInt := sdkacctest.RandInt() resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, PreventPostDestroyRefresh: true, @@ -183,7 +183,7 @@ func TestAccS3BucketObjectsDataSource_startAfter(t *testing.T) { rInt := sdkacctest.RandInt() resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, PreventPostDestroyRefresh: true, @@ -208,7 +208,7 @@ func TestAccS3BucketObjectsDataSource_fetchOwner(t *testing.T) { rInt := sdkacctest.RandInt() resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, PreventPostDestroyRefresh: true, diff --git a/internal/service/s3/bucket_ownership_controls_test.go b/internal/service/s3/bucket_ownership_controls_test.go index 4d3a8003df76..5537ef66e9c7 100644 --- a/internal/service/s3/bucket_ownership_controls_test.go +++ b/internal/service/s3/bucket_ownership_controls_test.go @@ -22,7 +22,7 @@ func TestAccS3BucketOwnershipControls_basic(t *testing.T) { resourceName := "aws_s3_bucket_ownership_controls.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckBucketOwnershipControlsDestroy(ctx), @@ -51,7 +51,7 @@ func TestAccS3BucketOwnershipControls_disappears(t *testing.T) { resourceName := "aws_s3_bucket_ownership_controls.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckBucketOwnershipControlsDestroy(ctx), @@ -75,7 +75,7 @@ func TestAccS3BucketOwnershipControls_Disappears_bucket(t *testing.T) { s3BucketResourceName := "aws_s3_bucket.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckBucketOwnershipControlsDestroy(ctx), @@ -98,7 +98,7 @@ func TestAccS3BucketOwnershipControls_Rule_objectOwnership(t *testing.T) { resourceName := "aws_s3_bucket_ownership_controls.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckBucketOwnershipControlsDestroy(ctx), diff --git a/internal/service/s3/bucket_policy_data_source_test.go b/internal/service/s3/bucket_policy_data_source_test.go index dbac21ce1fa9..2f30da0634ac 100644 --- a/internal/service/s3/bucket_policy_data_source_test.go +++ b/internal/service/s3/bucket_policy_data_source_test.go @@ -22,7 +22,7 @@ func TestAccS3BucketPolicyDataSource_basic(t *testing.T) { dataSourceName := "data.aws_s3_bucket_policy.test" resourceName := "aws_s3_bucket_policy.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ diff --git a/internal/service/s3/bucket_policy_test.go b/internal/service/s3/bucket_policy_test.go index 3724f8b91407..66a5b9c07d57 100644 --- a/internal/service/s3/bucket_policy_test.go +++ b/internal/service/s3/bucket_policy_test.go @@ -41,7 +41,7 @@ func TestAccS3BucketPolicy_basic(t *testing.T) { }`, partition, name, partition, name) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckBucketDestroy(ctx), @@ -88,7 +88,7 @@ func TestAccS3BucketPolicy_disappears(t *testing.T) { }`, partition, name, partition, name) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckBucketDestroy(ctx), @@ -131,7 +131,7 @@ func TestAccS3BucketPolicy_disappears_bucket(t *testing.T) { }`, partition, name, partition, name) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckBucketDestroy(ctx), @@ -195,7 +195,7 @@ func TestAccS3BucketPolicy_policyUpdate(t *testing.T) { }`, partition, name) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckBucketDestroy(ctx), @@ -232,7 +232,7 @@ func TestAccS3BucketPolicy_IAMRoleOrder_policyDoc(t *testing.T) { resourceName := "aws_s3_bucket.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckBucketDestroy(ctx), @@ -267,7 +267,7 @@ func TestAccS3BucketPolicy_IAMRoleOrder_policyDocNotPrincipal(t *testing.T) { resourceName := "aws_s3_bucket.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckBucketDestroy(ctx), @@ -305,7 +305,7 @@ func TestAccS3BucketPolicy_IAMRoleOrder_jsonEncode(t *testing.T) { resourceName := "aws_s3_bucket.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckBucketDestroy(ctx), @@ -352,7 +352,7 @@ func TestAccS3BucketPolicy_migrate_noChange(t *testing.T) { partition := acctest.Partition() resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckBucketDestroy(ctx), @@ -383,7 +383,7 @@ func TestAccS3BucketPolicy_migrate_withChange(t *testing.T) { partition := acctest.Partition() resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckBucketDestroy(ctx), diff --git a/internal/service/s3/bucket_public_access_block_test.go b/internal/service/s3/bucket_public_access_block_test.go index 1f37f9f6797b..df168b014c5e 100644 --- a/internal/service/s3/bucket_public_access_block_test.go +++ b/internal/service/s3/bucket_public_access_block_test.go @@ -24,7 +24,7 @@ func TestAccS3BucketPublicAccessBlock_basic(t *testing.T) { resourceName := "aws_s3_bucket_public_access_block.bucket" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckBucketDestroy(ctx), @@ -57,7 +57,7 @@ func TestAccS3BucketPublicAccessBlock_disappears(t *testing.T) { resourceName := "aws_s3_bucket_public_access_block.bucket" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckBucketDestroy(ctx), @@ -82,7 +82,7 @@ func TestAccS3BucketPublicAccessBlock_Disappears_bucket(t *testing.T) { bucketResourceName := "aws_s3_bucket.bucket" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckBucketDestroy(ctx), @@ -106,7 +106,7 @@ func TestAccS3BucketPublicAccessBlock_blockPublicACLs(t *testing.T) { resourceName := "aws_s3_bucket_public_access_block.bucket" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckBucketDestroy(ctx), @@ -148,7 +148,7 @@ func TestAccS3BucketPublicAccessBlock_blockPublicPolicy(t *testing.T) { resourceName := "aws_s3_bucket_public_access_block.bucket" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckBucketDestroy(ctx), @@ -190,7 +190,7 @@ func TestAccS3BucketPublicAccessBlock_ignorePublicACLs(t *testing.T) { resourceName := "aws_s3_bucket_public_access_block.bucket" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckBucketDestroy(ctx), @@ -232,7 +232,7 @@ func TestAccS3BucketPublicAccessBlock_restrictPublicBuckets(t *testing.T) { resourceName := "aws_s3_bucket_public_access_block.bucket" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckBucketDestroy(ctx), diff --git a/internal/service/s3/bucket_replication_configuration_test.go b/internal/service/s3/bucket_replication_configuration_test.go index 1c7db32dffa2..c2492d4eacbe 100644 --- a/internal/service/s3/bucket_replication_configuration_test.go +++ b/internal/service/s3/bucket_replication_configuration_test.go @@ -31,7 +31,7 @@ func TestAccS3BucketReplicationConfiguration_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckMultipleRegion(t, 2) }, ErrorCheck: acctest.ErrorCheck(t, s3.EndpointsID), @@ -102,7 +102,7 @@ func TestAccS3BucketReplicationConfiguration_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5FactoriesAlternate(ctx, t), @@ -130,7 +130,7 @@ func TestAccS3BucketReplicationConfiguration_multipleDestinationsEmptyFilter(t * resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckMultipleRegion(t, 2) }, ErrorCheck: acctest.ErrorCheck(t, s3.EndpointsID), @@ -190,7 +190,7 @@ func TestAccS3BucketReplicationConfiguration_multipleDestinationsNonEmptyFilter( resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckMultipleRegion(t, 2) }, ErrorCheck: acctest.ErrorCheck(t, s3.EndpointsID), @@ -257,7 +257,7 @@ func TestAccS3BucketReplicationConfiguration_twoDestination(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckMultipleRegion(t, 2) }, ErrorCheck: acctest.ErrorCheck(t, s3.EndpointsID), @@ -312,7 +312,7 @@ func TestAccS3BucketReplicationConfiguration_configurationRuleDestinationAccessC resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckMultipleRegion(t, 2) }, ErrorCheck: acctest.ErrorCheck(t, s3.EndpointsID), @@ -390,7 +390,7 @@ func TestAccS3BucketReplicationConfiguration_configurationRuleDestinationAddAcce resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckMultipleRegion(t, 2) }, ErrorCheck: acctest.ErrorCheck(t, s3.EndpointsID), @@ -459,7 +459,7 @@ func TestAccS3BucketReplicationConfiguration_replicationTimeControl(t *testing.T resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckMultipleRegion(t, 2) }, ErrorCheck: acctest.ErrorCheck(t, s3.EndpointsID), @@ -513,7 +513,7 @@ func TestAccS3BucketReplicationConfiguration_replicaModifications(t *testing.T) resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckMultipleRegion(t, 2) }, ErrorCheck: acctest.ErrorCheck(t, s3.EndpointsID), @@ -564,7 +564,7 @@ func TestAccS3BucketReplicationConfiguration_withoutId(t *testing.T) { var providers []*schema.Provider resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5FactoriesPlusProvidersAlternate(ctx, t, &providers), CheckDestroy: acctest.CheckWithProviders(testAccCheckBucketReplicationConfigurationDestroyWithProvider(ctx), &providers), @@ -604,7 +604,7 @@ func TestAccS3BucketReplicationConfiguration_withoutStorageClass(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckMultipleRegion(t, 2) }, ErrorCheck: acctest.ErrorCheck(t, s3.EndpointsID), @@ -647,7 +647,7 @@ func TestAccS3BucketReplicationConfiguration_schemaV2(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckMultipleRegion(t, 2) }, ErrorCheck: acctest.ErrorCheck(t, s3.EndpointsID), @@ -694,7 +694,7 @@ func TestAccS3BucketReplicationConfiguration_schemaV2SameRegion(t *testing.T) { var providers []*schema.Provider resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5FactoriesPlusProvidersAlternate(ctx, t, &providers), CheckDestroy: acctest.CheckWithProviders(testAccCheckBucketReplicationConfigurationDestroyWithProvider(ctx), &providers), @@ -737,7 +737,7 @@ func TestAccS3BucketReplicationConfiguration_schemaV2DestinationMetrics(t *testi resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckMultipleRegion(t, 2) }, ErrorCheck: acctest.ErrorCheck(t, s3.EndpointsID), @@ -779,7 +779,7 @@ func TestAccS3BucketReplicationConfiguration_existingObjectReplication(t *testin var providers []*schema.Provider resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5FactoriesPlusProvidersAlternate(ctx, t, &providers), CheckDestroy: acctest.CheckWithProviders(testAccCheckBucketReplicationConfigurationDestroyWithProvider(ctx), &providers), @@ -826,7 +826,7 @@ func TestAccS3BucketReplicationConfiguration_filter_emptyConfigurationBlock(t *t var providers []*schema.Provider resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5FactoriesPlusProvidersAlternate(ctx, t, &providers), CheckDestroy: acctest.CheckWithProviders(testAccCheckBucketReplicationConfigurationDestroyWithProvider(ctx), &providers), @@ -869,7 +869,7 @@ func TestAccS3BucketReplicationConfiguration_filter_emptyPrefix(t *testing.T) { var providers []*schema.Provider resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5FactoriesPlusProvidersAlternate(ctx, t, &providers), CheckDestroy: acctest.CheckWithProviders(testAccCheckBucketReplicationConfigurationDestroyWithProvider(ctx), &providers), @@ -916,7 +916,7 @@ func TestAccS3BucketReplicationConfiguration_filter_tagFilter(t *testing.T) { var providers []*schema.Provider resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5FactoriesPlusProvidersAlternate(ctx, t, &providers), CheckDestroy: acctest.CheckWithProviders(testAccCheckBucketReplicationConfigurationDestroyWithProvider(ctx), &providers), @@ -961,7 +961,7 @@ func TestAccS3BucketReplicationConfiguration_filter_andOperator(t *testing.T) { var providers []*schema.Provider resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5FactoriesPlusProvidersAlternate(ctx, t, &providers), CheckDestroy: acctest.CheckWithProviders(testAccCheckBucketReplicationConfigurationDestroyWithProvider(ctx), &providers), @@ -1037,7 +1037,7 @@ func TestAccS3BucketReplicationConfiguration_filter_withoutId(t *testing.T) { var providers []*schema.Provider resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5FactoriesPlusProvidersAlternate(ctx, t, &providers), CheckDestroy: acctest.CheckWithProviders(testAccCheckBucketReplicationConfigurationDestroyWithProvider(ctx), &providers), @@ -1075,7 +1075,7 @@ func TestAccS3BucketReplicationConfiguration_withoutPrefix(t *testing.T) { var providers []*schema.Provider resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5FactoriesPlusProvidersAlternate(ctx, t, &providers), CheckDestroy: acctest.CheckWithProviders(testAccCheckBucketReplicationConfigurationDestroyWithProvider(ctx), &providers), @@ -1106,7 +1106,7 @@ func TestAccS3BucketReplicationConfiguration_migrate_noChange(t *testing.T) { var providers []*schema.Provider resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5FactoriesPlusProvidersAlternate(ctx, t, &providers), CheckDestroy: acctest.CheckWithProviders(testAccCheckBucketReplicationConfigurationDestroyWithProvider(ctx), &providers), @@ -1149,7 +1149,7 @@ func TestAccS3BucketReplicationConfiguration_migrate_withChange(t *testing.T) { var providers []*schema.Provider resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5FactoriesPlusProvidersAlternate(ctx, t, &providers), CheckDestroy: acctest.CheckWithProviders(testAccCheckBucketReplicationConfigurationDestroyWithProvider(ctx), &providers), diff --git a/internal/service/s3/bucket_request_payment_configuration_test.go b/internal/service/s3/bucket_request_payment_configuration_test.go index 0b1b2ed03d41..59bd1cd09f23 100644 --- a/internal/service/s3/bucket_request_payment_configuration_test.go +++ b/internal/service/s3/bucket_request_payment_configuration_test.go @@ -22,7 +22,7 @@ func TestAccS3BucketRequestPaymentConfiguration_Basic_BucketOwner(t *testing.T) resourceName := "aws_s3_bucket_request_payment_configuration.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckBucketRequestPaymentConfigurationDestroy(ctx), @@ -50,7 +50,7 @@ func TestAccS3BucketRequestPaymentConfiguration_Basic_Requester(t *testing.T) { resourceName := "aws_s3_bucket_request_payment_configuration.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckBucketRequestPaymentConfigurationDestroy(ctx), @@ -78,7 +78,7 @@ func TestAccS3BucketRequestPaymentConfiguration_update(t *testing.T) { resourceName := "aws_s3_bucket_request_payment_configuration.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckBucketRequestPaymentConfigurationDestroy(ctx), @@ -117,7 +117,7 @@ func TestAccS3BucketRequestPaymentConfiguration_migrate_noChange(t *testing.T) { resourceName := "aws_s3_bucket_request_payment_configuration.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckBucketRequestPaymentConfigurationDestroy(ctx), @@ -147,7 +147,7 @@ func TestAccS3BucketRequestPaymentConfiguration_migrate_withChange(t *testing.T) resourceName := "aws_s3_bucket_request_payment_configuration.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckBucketRequestPaymentConfigurationDestroy(ctx), 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 1d477f8f2ba0..ea7ff6ac1c7c 100644 --- a/internal/service/s3/bucket_server_side_encryption_configuration_test.go +++ b/internal/service/s3/bucket_server_side_encryption_configuration_test.go @@ -22,7 +22,7 @@ func TestAccS3BucketServerSideEncryptionConfiguration_basic(t *testing.T) { resourceName := "aws_s3_bucket_server_side_encryption_configuration.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckBucketServerSideEncryptionConfigurationDestroy(ctx), @@ -52,7 +52,7 @@ func TestAccS3BucketServerSideEncryptionConfiguration_disappears(t *testing.T) { resourceName := "aws_s3_bucket_server_side_encryption_configuration.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckBucketServerSideEncryptionConfigurationDestroy(ctx), @@ -75,7 +75,7 @@ func TestAccS3BucketServerSideEncryptionConfiguration_ApplySEEByDefault_AES256(t resourceName := "aws_s3_bucket_server_side_encryption_configuration.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckBucketServerSideEncryptionConfigurationDestroy(ctx), @@ -105,7 +105,7 @@ func TestAccS3BucketServerSideEncryptionConfiguration_ApplySSEByDefault_KMS(t *t resourceName := "aws_s3_bucket_server_side_encryption_configuration.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckBucketServerSideEncryptionConfigurationDestroy(ctx), @@ -135,7 +135,7 @@ func TestAccS3BucketServerSideEncryptionConfiguration_ApplySSEByDefault_UpdateSS resourceName := "aws_s3_bucket_server_side_encryption_configuration.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckBucketServerSideEncryptionConfigurationDestroy(ctx), @@ -178,7 +178,7 @@ func TestAccS3BucketServerSideEncryptionConfiguration_ApplySSEByDefault_KMSWithM resourceName := "aws_s3_bucket_server_side_encryption_configuration.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckBucketServerSideEncryptionConfigurationDestroy(ctx), @@ -208,7 +208,7 @@ func TestAccS3BucketServerSideEncryptionConfiguration_ApplySSEByDefault_KMSWithM resourceName := "aws_s3_bucket_server_side_encryption_configuration.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckBucketServerSideEncryptionConfigurationDestroy(ctx), @@ -238,7 +238,7 @@ func TestAccS3BucketServerSideEncryptionConfiguration_BucketKeyEnabled(t *testin resourceName := "aws_s3_bucket_server_side_encryption_configuration.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckBucketServerSideEncryptionConfigurationDestroy(ctx), @@ -281,7 +281,7 @@ func TestAccS3BucketServerSideEncryptionConfiguration_ApplySSEByDefault_BucketKe resourceName := "aws_s3_bucket_server_side_encryption_configuration.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckBucketServerSideEncryptionConfigurationDestroy(ctx), @@ -331,7 +331,7 @@ func TestAccS3BucketServerSideEncryptionConfiguration_migrate_noChange(t *testin bucketResourceName := "aws_s3_bucket.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckBucketServerSideEncryptionConfigurationDestroy(ctx), @@ -369,7 +369,7 @@ func TestAccS3BucketServerSideEncryptionConfiguration_migrate_withChange(t *test bucketResourceName := "aws_s3_bucket.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckBucketServerSideEncryptionConfigurationDestroy(ctx), diff --git a/internal/service/s3/bucket_test.go b/internal/service/s3/bucket_test.go index 554285317843..c7e45396eb9b 100644 --- a/internal/service/s3/bucket_test.go +++ b/internal/service/s3/bucket_test.go @@ -50,7 +50,7 @@ func TestAccS3Bucket_Basic_basic(t *testing.T) { resourceName := "aws_s3_bucket.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckBucketDestroy(ctx), @@ -90,7 +90,7 @@ func TestAccS3Bucket_Basic_emptyString(t *testing.T) { resourceName := "aws_s3_bucket.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckBucketDestroy(ctx), @@ -117,7 +117,7 @@ func TestAccS3Bucket_Basic_generatedName(t *testing.T) { resourceName := "aws_s3_bucket.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckBucketDestroy(ctx), @@ -143,7 +143,7 @@ func TestAccS3Bucket_Basic_namePrefix(t *testing.T) { resourceName := "aws_s3_bucket.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckBucketDestroy(ctx), @@ -171,7 +171,7 @@ func TestAccS3Bucket_Basic_forceDestroy(t *testing.T) { bucketName := sdkacctest.RandomWithPrefix("tf-test-bucket") resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckBucketDestroy(ctx), @@ -198,7 +198,7 @@ func TestAccS3Bucket_Basic_forceDestroyWithEmptyPrefixes(t *testing.T) { bucketName := sdkacctest.RandomWithPrefix("tf-test-bucket") resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckBucketDestroy(ctx), @@ -220,7 +220,7 @@ func TestAccS3Bucket_Basic_forceDestroyWithObjectLockEnabled(t *testing.T) { bucketName := sdkacctest.RandomWithPrefix("tf-test-bucket") resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckBucketDestroy(ctx), @@ -243,7 +243,7 @@ func TestAccS3Bucket_Basic_acceleration(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(cloudfront.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, s3.EndpointsID), @@ -280,7 +280,7 @@ func TestAccS3Bucket_Basic_keyEnabled(t *testing.T) { resourceName := "aws_s3_bucket.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckBucketDestroy(ctx), @@ -313,7 +313,7 @@ func TestAccS3Bucket_Basic_requestPayer(t *testing.T) { resourceName := "aws_s3_bucket.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckBucketDestroy(ctx), @@ -351,7 +351,7 @@ func TestAccS3Bucket_disappears(t *testing.T) { resourceName := "aws_s3_bucket.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckBucketDestroy(ctx), @@ -374,7 +374,7 @@ func TestAccS3Bucket_Duplicate_basic(t *testing.T) { region := acctest.Region() resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckRegionNot(t, endpoints.UsEast1RegionID) }, ErrorCheck: acctest.ErrorCheck(t, s3.EndpointsID), @@ -394,7 +394,7 @@ func TestAccS3Bucket_Duplicate_UsEast1(t *testing.T) { bucketName := sdkacctest.RandomWithPrefix("tf-test-bucket") resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartition(t, endpoints.AwsPartitionID) }, ErrorCheck: acctest.ErrorCheck(t, s3.EndpointsID), @@ -414,7 +414,7 @@ func TestAccS3Bucket_Duplicate_UsEast1AltAccount(t *testing.T) { bucketName := sdkacctest.RandomWithPrefix("tf-test-bucket") resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartition(t, endpoints.AwsPartitionID) acctest.PreCheckAlternateAccount(t) }, @@ -436,7 +436,7 @@ func TestAccS3Bucket_Tags_basic(t *testing.T) { resourceName := "aws_s3_bucket.bucket1" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckBucketDestroy(ctx), @@ -460,7 +460,7 @@ func TestAccS3Bucket_Tags_withNoSystemTags(t *testing.T) { bucketName := sdkacctest.RandomWithPrefix("tf-test-bucket") resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckBucketDestroy(ctx), @@ -522,7 +522,7 @@ func TestAccS3Bucket_Tags_withSystemTags(t *testing.T) { var stackID string resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: resource.ComposeAggregateTestCheckFunc( @@ -606,7 +606,7 @@ func TestAccS3Bucket_Tags_ignoreTags(t *testing.T) { bucketName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckBucketDestroy(ctx), @@ -652,7 +652,7 @@ func TestAccS3Bucket_Manage_lifecycleBasic(t *testing.T) { resourceName := "aws_s3_bucket.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckBucketDestroy(ctx), @@ -743,7 +743,7 @@ func TestAccS3Bucket_Manage_lifecycleExpireMarkerOnly(t *testing.T) { resourceName := "aws_s3_bucket.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckBucketDestroy(ctx), @@ -782,7 +782,7 @@ func TestAccS3Bucket_Manage_lifecycleRuleExpirationEmptyBlock(t *testing.T) { resourceName := "aws_s3_bucket.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckBucketDestroy(ctx), @@ -804,7 +804,7 @@ func TestAccS3Bucket_Manage_lifecycleRuleAbortIncompleteMultipartUploadDaysNoExp resourceName := "aws_s3_bucket.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckBucketDestroy(ctx), @@ -831,7 +831,7 @@ func TestAccS3Bucket_Manage_lifecycleRemove(t *testing.T) { resourceName := "aws_s3_bucket.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckBucketDestroy(ctx), @@ -862,7 +862,7 @@ func TestAccS3Bucket_Manage_objectLock(t *testing.T) { resourceName := "aws_s3_bucket.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckBucketDestroy(ctx), @@ -904,7 +904,7 @@ func TestAccS3Bucket_Manage_objectLock_deprecatedEnabled(t *testing.T) { resourceName := "aws_s3_bucket.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckBucketDestroy(ctx), @@ -935,7 +935,7 @@ func TestAccS3Bucket_Manage_objectLock_migrate(t *testing.T) { resourceName := "aws_s3_bucket.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckBucketDestroy(ctx), @@ -963,7 +963,7 @@ func TestAccS3Bucket_Manage_objectLockWithVersioning(t *testing.T) { resourceName := "aws_s3_bucket.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckBucketDestroy(ctx), @@ -993,7 +993,7 @@ func TestAccS3Bucket_Manage_objectLockWithVersioning_deprecatedEnabled(t *testin resourceName := "aws_s3_bucket.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckBucketDestroy(ctx), @@ -1023,7 +1023,7 @@ func TestAccS3Bucket_Manage_versioning(t *testing.T) { resourceName := "aws_s3_bucket.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckBucketDestroy(ctx), @@ -1068,7 +1068,7 @@ func TestAccS3Bucket_Manage_versioningDisabled(t *testing.T) { resourceName := "aws_s3_bucket.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckBucketDestroy(ctx), @@ -1098,7 +1098,7 @@ func TestAccS3Bucket_Manage_MFADeleteDisabled(t *testing.T) { resourceName := "aws_s3_bucket.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckBucketDestroy(ctx), @@ -1128,7 +1128,7 @@ func TestAccS3Bucket_Manage_versioningAndMFADeleteDisabled(t *testing.T) { resourceName := "aws_s3_bucket.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckBucketDestroy(ctx), @@ -1165,7 +1165,7 @@ func TestAccS3Bucket_Replication_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckMultipleRegion(t, 2) }, ErrorCheck: acctest.ErrorCheck(t, s3.EndpointsID), @@ -1217,7 +1217,7 @@ func TestAccS3Bucket_Replication_multipleDestinationsEmptyFilter(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckMultipleRegion(t, 2) }, ErrorCheck: acctest.ErrorCheck(t, s3.EndpointsID), @@ -1285,7 +1285,7 @@ func TestAccS3Bucket_Replication_multipleDestinationsNonEmptyFilter(t *testing.T resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckMultipleRegion(t, 2) }, ErrorCheck: acctest.ErrorCheck(t, s3.EndpointsID), @@ -1358,7 +1358,7 @@ func TestAccS3Bucket_Replication_twoDestination(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckMultipleRegion(t, 2) }, ErrorCheck: acctest.ErrorCheck(t, s3.EndpointsID), @@ -1417,7 +1417,7 @@ func TestAccS3Bucket_Replication_ruleDestinationAccessControlTranslation(t *test resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckMultipleRegion(t, 2) }, ErrorCheck: acctest.ErrorCheck(t, s3.EndpointsID), @@ -1466,7 +1466,7 @@ func TestAccS3Bucket_Replication_ruleDestinationAddAccessControlTranslation(t *t resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckMultipleRegion(t, 2) }, ErrorCheck: acctest.ErrorCheck(t, s3.EndpointsID), @@ -1515,7 +1515,7 @@ func TestAccS3Bucket_Replication_withoutStorageClass(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckMultipleRegion(t, 2) }, ErrorCheck: acctest.ErrorCheck(t, s3.EndpointsID), @@ -1549,7 +1549,7 @@ func TestAccS3Bucket_Replication_expectVersioningValidationError(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckMultipleRegion(t, 2) }, ErrorCheck: acctest.ErrorCheck(t, s3.EndpointsID), @@ -1577,7 +1577,7 @@ func TestAccS3Bucket_Replication_withoutPrefix(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckMultipleRegion(t, 2) }, ErrorCheck: acctest.ErrorCheck(t, s3.EndpointsID), @@ -1615,7 +1615,7 @@ func TestAccS3Bucket_Replication_schemaV2(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckMultipleRegion(t, 2) }, ErrorCheck: acctest.ErrorCheck(t, s3.EndpointsID), @@ -1690,7 +1690,7 @@ func TestAccS3Bucket_Replication_schemaV2SameRegion(t *testing.T) { destinationResourceName := "aws_s3_bucket.destination" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckBucketDestroy(ctx), @@ -1732,7 +1732,7 @@ func TestAccS3Bucket_Replication_RTC_valid(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckMultipleRegion(t, 2) }, ErrorCheck: acctest.ErrorCheck(t, s3.EndpointsID), @@ -1792,7 +1792,7 @@ func TestAccS3Bucket_Security_updateACL(t *testing.T) { resourceName := "aws_s3_bucket.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckBucketDestroy(ctx), @@ -1827,7 +1827,7 @@ func TestAccS3Bucket_Security_updateGrant(t *testing.T) { resourceName := "aws_s3_bucket.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckBucketDestroy(ctx), @@ -1888,7 +1888,7 @@ func TestAccS3Bucket_Security_aclToGrant(t *testing.T) { resourceName := "aws_s3_bucket.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckBucketDestroy(ctx), @@ -1919,7 +1919,7 @@ func TestAccS3Bucket_Security_grantToACL(t *testing.T) { resourceName := "aws_s3_bucket.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckBucketDestroy(ctx), @@ -1976,7 +1976,7 @@ func TestAccS3Bucket_Security_corsUpdate(t *testing.T) { } resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckBucketDestroy(ctx), @@ -2053,7 +2053,7 @@ func TestAccS3Bucket_Security_corsDelete(t *testing.T) { } resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckBucketDestroy(ctx), @@ -2076,7 +2076,7 @@ func TestAccS3Bucket_Security_corsEmptyOrigin(t *testing.T) { resourceName := "aws_s3_bucket.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckBucketDestroy(ctx), @@ -2115,7 +2115,7 @@ func TestAccS3Bucket_Security_corsSingleMethodAndEmptyOrigin(t *testing.T) { resourceName := "aws_s3_bucket.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckBucketDestroy(ctx), @@ -2142,7 +2142,7 @@ func TestAccS3Bucket_Security_logging(t *testing.T) { resourceName := "aws_s3_bucket.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckBucketDestroy(ctx), @@ -2172,7 +2172,7 @@ func TestAccS3Bucket_Security_enableDefaultEncryptionWhenTypical(t *testing.T) { resourceName := "aws_s3_bucket.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckBucketDestroy(ctx), @@ -2204,7 +2204,7 @@ func TestAccS3Bucket_Security_enableDefaultEncryptionWhenAES256IsUsed(t *testing resourceName := "aws_s3_bucket.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckBucketDestroy(ctx), @@ -2236,7 +2236,7 @@ func TestAccS3Bucket_Security_disableDefaultEncryptionWhenDefaultEncryptionIsEna resourceName := "aws_s3_bucket.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckBucketDestroy(ctx), @@ -2273,7 +2273,7 @@ func TestAccS3Bucket_Security_policy(t *testing.T) { resourceName := "aws_s3_bucket.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckBucketDestroy(ctx), @@ -2330,7 +2330,7 @@ func TestAccS3Bucket_Web_simple(t *testing.T) { resourceName := "aws_s3_bucket.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckBucketDestroy(ctx), @@ -2383,7 +2383,7 @@ func TestAccS3Bucket_Web_redirect(t *testing.T) { resourceName := "aws_s3_bucket.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckBucketDestroy(ctx), @@ -2434,7 +2434,7 @@ func TestAccS3Bucket_Web_routingRules(t *testing.T) { resourceName := "aws_s3_bucket.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckBucketDestroy(ctx), diff --git a/internal/service/s3/bucket_versioning_test.go b/internal/service/s3/bucket_versioning_test.go index 824981d3bdad..7cb0add6285f 100644 --- a/internal/service/s3/bucket_versioning_test.go +++ b/internal/service/s3/bucket_versioning_test.go @@ -23,7 +23,7 @@ func TestAccS3BucketVersioning_basic(t *testing.T) { resourceName := "aws_s3_bucket_versioning.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckBucketVersioningDestroy(ctx), @@ -52,7 +52,7 @@ func TestAccS3BucketVersioning_disappears(t *testing.T) { resourceName := "aws_s3_bucket_versioning.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckBucketVersioningDestroy(ctx), @@ -76,7 +76,7 @@ func TestAccS3BucketVersioning_disappears_bucket(t *testing.T) { bucketResourceName := "aws_s3_bucket.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckBucketVersioningDestroy(ctx), @@ -99,7 +99,7 @@ func TestAccS3BucketVersioning_update(t *testing.T) { resourceName := "aws_s3_bucket_versioning.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckBucketVersioningDestroy(ctx), @@ -141,7 +141,7 @@ func TestAccS3BucketVersioning_MFADelete(t *testing.T) { resourceName := "aws_s3_bucket_versioning.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckBucketVersioningDestroy(ctx), @@ -171,7 +171,7 @@ func TestAccS3BucketVersioning_migrate_versioningDisabledNoChange(t *testing.T) resourceName := "aws_s3_bucket_versioning.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckBucketDestroy(ctx), @@ -203,7 +203,7 @@ func TestAccS3BucketVersioning_migrate_versioningDisabledWithChange(t *testing.T resourceName := "aws_s3_bucket_versioning.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckBucketDestroy(ctx), @@ -235,7 +235,7 @@ func TestAccS3BucketVersioning_migrate_versioningEnabledNoChange(t *testing.T) { resourceName := "aws_s3_bucket_versioning.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckBucketDestroy(ctx), @@ -267,7 +267,7 @@ func TestAccS3BucketVersioning_migrate_versioningEnabledWithChange(t *testing.T) resourceName := "aws_s3_bucket_versioning.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckBucketDestroy(ctx), @@ -301,7 +301,7 @@ func TestAccS3BucketVersioning_migrate_mfaDeleteNoChange(t *testing.T) { resourceName := "aws_s3_bucket_versioning.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckBucketDestroy(ctx), @@ -332,7 +332,7 @@ func TestAccS3BucketVersioning_Status_disabled(t *testing.T) { resourceName := "aws_s3_bucket_versioning.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckBucketVersioningDestroy(ctx), @@ -360,7 +360,7 @@ func TestAccS3BucketVersioning_Status_disabledToEnabled(t *testing.T) { resourceName := "aws_s3_bucket_versioning.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckBucketVersioningDestroy(ctx), @@ -396,7 +396,7 @@ func TestAccS3BucketVersioning_Status_disabledToSuspended(t *testing.T) { resourceName := "aws_s3_bucket_versioning.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckBucketVersioningDestroy(ctx), @@ -432,7 +432,7 @@ func TestAccS3BucketVersioning_Status_enabledToDisabled(t *testing.T) { resourceName := "aws_s3_bucket_versioning.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckBucketVersioningDestroy(ctx), @@ -459,7 +459,7 @@ func TestAccS3BucketVersioning_Status_suspendedToDisabled(t *testing.T) { resourceName := "aws_s3_bucket_versioning.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckBucketVersioningDestroy(ctx), diff --git a/internal/service/s3/bucket_website_configuration_test.go b/internal/service/s3/bucket_website_configuration_test.go index 1a8c720df50c..e0de0982d2ec 100644 --- a/internal/service/s3/bucket_website_configuration_test.go +++ b/internal/service/s3/bucket_website_configuration_test.go @@ -22,7 +22,7 @@ func TestAccS3BucketWebsiteConfiguration_basic(t *testing.T) { resourceName := "aws_s3_bucket_website_configuration.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckBucketWebsiteConfigurationDestroy(ctx), @@ -53,7 +53,7 @@ func TestAccS3BucketWebsiteConfiguration_disappears(t *testing.T) { resourceName := "aws_s3_bucket_website_configuration.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckBucketWebsiteConfigurationDestroy(ctx), @@ -76,7 +76,7 @@ func TestAccS3BucketWebsiteConfiguration_update(t *testing.T) { resourceName := "aws_s3_bucket_website_configuration.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckBucketWebsiteConfigurationDestroy(ctx), @@ -113,7 +113,7 @@ func TestAccS3BucketWebsiteConfiguration_Redirect(t *testing.T) { resourceName := "aws_s3_bucket_website_configuration.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckBucketWebsiteConfigurationDestroy(ctx), @@ -142,7 +142,7 @@ func TestAccS3BucketWebsiteConfiguration_RoutingRule_ConditionAndRedirect(t *tes resourceName := "aws_s3_bucket_website_configuration.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckBucketWebsiteConfigurationDestroy(ctx), @@ -214,7 +214,7 @@ func TestAccS3BucketWebsiteConfiguration_RoutingRule_MultipleRules(t *testing.T) resourceName := "aws_s3_bucket_website_configuration.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckBucketWebsiteConfigurationDestroy(ctx), @@ -260,7 +260,7 @@ func TestAccS3BucketWebsiteConfiguration_RoutingRule_RedirectOnly(t *testing.T) resourceName := "aws_s3_bucket_website_configuration.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckBucketWebsiteConfigurationDestroy(ctx), @@ -293,7 +293,7 @@ func TestAccS3BucketWebsiteConfiguration_RoutingRules_ConditionAndRedirect(t *te resourceName := "aws_s3_bucket_website_configuration.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckBucketWebsiteConfigurationDestroy(ctx), @@ -321,7 +321,7 @@ func TestAccS3BucketWebsiteConfiguration_RoutingRules_ConditionAndRedirectWithEm resourceName := "aws_s3_bucket_website_configuration.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckBucketWebsiteConfigurationDestroy(ctx), @@ -349,7 +349,7 @@ func TestAccS3BucketWebsiteConfiguration_RoutingRules_updateConditionAndRedirect resourceName := "aws_s3_bucket_website_configuration.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckBucketWebsiteConfigurationDestroy(ctx), @@ -380,7 +380,7 @@ func TestAccS3BucketWebsiteConfiguration_RoutingRuleToRoutingRules(t *testing.T) resourceName := "aws_s3_bucket_website_configuration.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckBucketWebsiteConfigurationDestroy(ctx), @@ -412,7 +412,7 @@ func TestAccS3BucketWebsiteConfiguration_migrate_websiteWithIndexDocumentNoChang resourceName := "aws_s3_bucket_website_configuration.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckBucketDestroy(ctx), @@ -444,7 +444,7 @@ func TestAccS3BucketWebsiteConfiguration_migrate_websiteWithIndexDocumentWithCha resourceName := "aws_s3_bucket_website_configuration.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckBucketDestroy(ctx), @@ -476,7 +476,7 @@ func TestAccS3BucketWebsiteConfiguration_migrate_websiteWithRoutingRuleNoChange( resourceName := "aws_s3_bucket_website_configuration.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckBucketDestroy(ctx), @@ -507,7 +507,7 @@ func TestAccS3BucketWebsiteConfiguration_migrate_websiteWithRoutingRuleWithChang resourceName := "aws_s3_bucket_website_configuration.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckBucketDestroy(ctx), 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 064499f2cd15..6cd8825a7bd4 100644 --- a/internal/service/s3/canonical_user_id_data_source_test.go +++ b/internal/service/s3/canonical_user_id_data_source_test.go @@ -12,7 +12,7 @@ import ( func TestAccS3CanonicalUserIDDataSource_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ diff --git a/internal/service/s3/object_copy_test.go b/internal/service/s3/object_copy_test.go index bbccf5f19c06..5df7d59fda46 100644 --- a/internal/service/s3/object_copy_test.go +++ b/internal/service/s3/object_copy_test.go @@ -24,7 +24,7 @@ func TestAccS3ObjectCopy_basic(t *testing.T) { sourceKey := "WshngtnNtnls" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckObjectCopyDestroy(ctx), @@ -49,7 +49,7 @@ func TestAccS3ObjectCopy_BucketKeyEnabled_bucket(t *testing.T) { resourceName := "aws_s3_object_copy.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckObjectCopyDestroy(ctx), @@ -71,7 +71,7 @@ func TestAccS3ObjectCopy_BucketKeyEnabled_object(t *testing.T) { resourceName := "aws_s3_object_copy.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckObjectCopyDestroy(ctx), diff --git a/internal/service/s3/object_data_source_test.go b/internal/service/s3/object_data_source_test.go index 0ae74a2d916c..2315c4b67777 100644 --- a/internal/service/s3/object_data_source_test.go +++ b/internal/service/s3/object_data_source_test.go @@ -29,7 +29,7 @@ func TestAccS3ObjectDataSource_basic(t *testing.T) { dataSourceName := "data.aws_s3_object.obj" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, PreventPostDestroyRefresh: true, @@ -63,7 +63,7 @@ func TestAccS3ObjectDataSource_basicViaAccessPoint(t *testing.T) { accessPointResourceName := "aws_s3_access_point.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ @@ -92,7 +92,7 @@ func TestAccS3ObjectDataSource_readableBody(t *testing.T) { dataSourceName := "data.aws_s3_object.obj" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, PreventPostDestroyRefresh: true, @@ -127,7 +127,7 @@ func TestAccS3ObjectDataSource_kmsEncrypted(t *testing.T) { dataSourceName := "data.aws_s3_object.obj" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, PreventPostDestroyRefresh: true, @@ -164,7 +164,7 @@ func TestAccS3ObjectDataSource_bucketKeyEnabled(t *testing.T) { dataSourceName := "data.aws_s3_object.obj" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, PreventPostDestroyRefresh: true, @@ -202,7 +202,7 @@ func TestAccS3ObjectDataSource_allParams(t *testing.T) { dataSourceName := "data.aws_s3_object.obj" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, PreventPostDestroyRefresh: true, @@ -254,7 +254,7 @@ func TestAccS3ObjectDataSource_objectLockLegalHoldOff(t *testing.T) { dataSourceName := "data.aws_s3_object.obj" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, PreventPostDestroyRefresh: true, @@ -290,7 +290,7 @@ func TestAccS3ObjectDataSource_objectLockLegalHoldOn(t *testing.T) { dataSourceName := "data.aws_s3_object.obj" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, PreventPostDestroyRefresh: true, @@ -328,7 +328,7 @@ func TestAccS3ObjectDataSource_leadingSlash(t *testing.T) { resourceOnlyConf, conf := testAccObjectDataSourceConfig_leadingSlash(rInt) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, PreventPostDestroyRefresh: true, @@ -383,7 +383,7 @@ func TestAccS3ObjectDataSource_multipleSlashes(t *testing.T) { resourceOnlyConf, conf := testAccObjectDataSourceConfig_multipleSlashes(rInt) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, PreventPostDestroyRefresh: true, @@ -426,7 +426,7 @@ func TestAccS3ObjectDataSource_singleSlashAsKey(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, PreventPostDestroyRefresh: true, diff --git a/internal/service/s3/object_test.go b/internal/service/s3/object_test.go index f716cfefb536..643e48fe03d5 100644 --- a/internal/service/s3/object_test.go +++ b/internal/service/s3/object_test.go @@ -31,7 +31,7 @@ func TestAccS3Object_noNameNoKey(t *testing.T) { keyError := regexp.MustCompile(`key must not be empty`) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckObjectDestroy(ctx), @@ -57,7 +57,7 @@ func TestAccS3Object_empty(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckObjectDestroy(ctx), @@ -91,7 +91,7 @@ func TestAccS3Object_source(t *testing.T) { defer os.Remove(source) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckObjectDestroy(ctx), @@ -121,7 +121,7 @@ func TestAccS3Object_content(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckObjectDestroy(ctx), @@ -154,7 +154,7 @@ func TestAccS3Object_etagEncryption(t *testing.T) { defer os.Remove(source) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckObjectDestroy(ctx), @@ -186,7 +186,7 @@ func TestAccS3Object_contentBase64(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckObjectDestroy(ctx), @@ -224,7 +224,7 @@ func TestAccS3Object_sourceHashTrigger(t *testing.T) { } resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckObjectDestroy(ctx), @@ -270,7 +270,7 @@ func TestAccS3Object_withContentCharacteristics(t *testing.T) { defer os.Remove(source) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckObjectDestroy(ctx), @@ -297,7 +297,7 @@ func TestAccS3Object_nonVersioned(t *testing.T) { resourceName := "aws_s3_object.object" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckAssumeRoleARN(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckAssumeRoleARN(t) }, ErrorCheck: acctest.ErrorCheck(t, s3.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckObjectDestroy(ctx), @@ -333,7 +333,7 @@ func TestAccS3Object_updates(t *testing.T) { defer os.Remove(sourceInitial) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckObjectDestroy(ctx), @@ -392,7 +392,7 @@ func TestAccS3Object_updateSameFile(t *testing.T) { } resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckObjectDestroy(ctx), @@ -431,7 +431,7 @@ func TestAccS3Object_updatesWithVersioning(t *testing.T) { defer os.Remove(sourceInitial) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckObjectDestroy(ctx), @@ -477,7 +477,7 @@ func TestAccS3Object_updatesWithVersioningViaAccessPoint(t *testing.T) { defer os.Remove(sourceInitial) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckObjectDestroy(ctx), @@ -514,7 +514,7 @@ func TestAccS3Object_kms(t *testing.T) { defer os.Remove(source) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckObjectDestroy(ctx), @@ -549,7 +549,7 @@ func TestAccS3Object_sse(t *testing.T) { defer os.Remove(source) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckObjectDestroy(ctx), @@ -581,7 +581,7 @@ func TestAccS3Object_acl(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckObjectDestroy(ctx), @@ -633,7 +633,7 @@ func TestAccS3Object_metadata(t *testing.T) { resourceName := "aws_s3_object.object" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckObjectDestroy(ctx), @@ -681,7 +681,7 @@ func TestAccS3Object_storageClass(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckObjectDestroy(ctx), @@ -746,7 +746,7 @@ func TestAccS3Object_tags(t *testing.T) { key := "test-key" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckObjectDestroy(ctx), @@ -819,7 +819,7 @@ func TestAccS3Object_tagsLeadingSingleSlash(t *testing.T) { key := "/test-key" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckObjectDestroy(ctx), @@ -892,7 +892,7 @@ func TestAccS3Object_tagsLeadingMultipleSlashes(t *testing.T) { key := "/////test-key" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckObjectDestroy(ctx), @@ -958,7 +958,7 @@ func TestAccS3Object_tagsMultipleSlashes(t *testing.T) { key := "first//second///third//" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckObjectDestroy(ctx), @@ -1023,7 +1023,7 @@ func TestAccS3Object_objectLockLegalHoldStartWithNone(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckObjectDestroy(ctx), @@ -1072,7 +1072,7 @@ func TestAccS3Object_objectLockLegalHoldStartWithOn(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckObjectDestroy(ctx), @@ -1110,7 +1110,7 @@ func TestAccS3Object_objectLockRetentionStartWithNone(t *testing.T) { retainUntilDate := time.Now().UTC().AddDate(0, 0, 10).Format(time.RFC3339) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckObjectDestroy(ctx), @@ -1162,7 +1162,7 @@ func TestAccS3Object_objectLockRetentionStartWithSet(t *testing.T) { retainUntilDate3 := time.Now().UTC().AddDate(0, 0, 10).Format(time.RFC3339) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckObjectDestroy(ctx), @@ -1221,7 +1221,7 @@ func TestAccS3Object_objectBucketKeyEnabled(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckObjectDestroy(ctx), @@ -1245,7 +1245,7 @@ func TestAccS3Object_bucketBucketKeyEnabled(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckObjectDestroy(ctx), @@ -1269,7 +1269,7 @@ func TestAccS3Object_defaultBucketSSE(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckObjectDestroy(ctx), @@ -1293,7 +1293,7 @@ func TestAccS3Object_ignoreTags(t *testing.T) { key := "test-key" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckObjectDestroy(ctx), diff --git a/internal/service/s3/objects_data_source_test.go b/internal/service/s3/objects_data_source_test.go index fb61e23874cd..77ea15325e44 100644 --- a/internal/service/s3/objects_data_source_test.go +++ b/internal/service/s3/objects_data_source_test.go @@ -15,7 +15,7 @@ func TestAccS3ObjectsDataSource_basic(t *testing.T) { rInt := sdkacctest.RandInt() resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, PreventPostDestroyRefresh: true, @@ -41,7 +41,7 @@ func TestAccS3ObjectsDataSource_basicViaAccessPoint(t *testing.T) { rInt := sdkacctest.RandInt() resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, PreventPostDestroyRefresh: true, @@ -67,7 +67,7 @@ func TestAccS3ObjectsDataSource_all(t *testing.T) { rInt := sdkacctest.RandInt() resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, PreventPostDestroyRefresh: true, @@ -98,7 +98,7 @@ func TestAccS3ObjectsDataSource_prefixes(t *testing.T) { rInt := sdkacctest.RandInt() resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, PreventPostDestroyRefresh: true, @@ -128,7 +128,7 @@ func TestAccS3ObjectsDataSource_encoded(t *testing.T) { rInt := sdkacctest.RandInt() resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, PreventPostDestroyRefresh: true, @@ -154,7 +154,7 @@ func TestAccS3ObjectsDataSource_maxKeys(t *testing.T) { rInt := sdkacctest.RandInt() resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, PreventPostDestroyRefresh: true, @@ -180,7 +180,7 @@ func TestAccS3ObjectsDataSource_startAfter(t *testing.T) { rInt := sdkacctest.RandInt() resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, PreventPostDestroyRefresh: true, @@ -205,7 +205,7 @@ func TestAccS3ObjectsDataSource_fetchOwner(t *testing.T) { rInt := sdkacctest.RandInt() resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, PreventPostDestroyRefresh: true, From 6eb85d17e43ed77363a9198402b28b792e8a5aa4 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Fri, 24 Feb 2023 16:37:24 -0500 Subject: [PATCH 227/763] Add 'Context' argument to 'acctest.PreCheck' for s3control. --- .../s3control/access_point_policy_test.go | 8 ++++---- .../service/s3control/access_point_test.go | 12 +++++------ ...nt_public_access_block_data_source_test.go | 2 +- .../account_public_access_block_test.go | 14 ++++++------- .../bucket_lifecycle_configuration_test.go | 20 +++++++++---------- .../service/s3control/bucket_policy_test.go | 6 +++--- internal/service/s3control/bucket_test.go | 6 +++--- ...ti_region_access_point_data_source_test.go | 2 +- .../multi_region_access_point_policy_test.go | 8 ++++---- .../multi_region_access_point_test.go | 10 +++++----- .../object_lambda_access_point_policy_test.go | 8 ++++---- .../object_lambda_access_point_test.go | 6 +++--- .../storage_lens_configuration_test.go | 10 +++++----- 13 files changed, 56 insertions(+), 56 deletions(-) diff --git a/internal/service/s3control/access_point_policy_test.go b/internal/service/s3control/access_point_policy_test.go index fb6bed58d6b1..f3241337196a 100644 --- a/internal/service/s3control/access_point_policy_test.go +++ b/internal/service/s3control/access_point_policy_test.go @@ -22,7 +22,7 @@ func TestAccS3ControlAccessPointPolicy_basic(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3control.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckAccessPointPolicyDestroy(ctx), @@ -51,7 +51,7 @@ func TestAccS3ControlAccessPointPolicy_disappears(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3control.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckAccessPointPolicyDestroy(ctx), @@ -75,7 +75,7 @@ func TestAccS3ControlAccessPointPolicy_disappears_AccessPoint(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3control.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckAccessPointPolicyDestroy(ctx), @@ -98,7 +98,7 @@ func TestAccS3ControlAccessPointPolicy_update(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3control.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckAccessPointPolicyDestroy(ctx), diff --git a/internal/service/s3control/access_point_test.go b/internal/service/s3control/access_point_test.go index 05228c0b15d1..015705f92648 100644 --- a/internal/service/s3control/access_point_test.go +++ b/internal/service/s3control/access_point_test.go @@ -25,7 +25,7 @@ func TestAccS3ControlAccessPoint_basic(t *testing.T) { resourceName := "aws_s3_access_point.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3control.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckAccessPointDestroy(ctx), @@ -71,7 +71,7 @@ func TestAccS3ControlAccessPoint_disappears(t *testing.T) { resourceName := "aws_s3_access_point.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3control.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckAccessPointDestroy(ctx), @@ -95,7 +95,7 @@ func TestAccS3ControlAccessPoint_Bucket_arn(t *testing.T) { resourceName := "aws_s3_access_point.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckOutpostsOutposts(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckOutpostsOutposts(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3control.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckAccessPointDestroy(ctx), @@ -177,7 +177,7 @@ func TestAccS3ControlAccessPoint_policy(t *testing.T) { } resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3control.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckAccessPointDestroy(ctx), @@ -232,7 +232,7 @@ func TestAccS3ControlAccessPoint_publicAccessBlock(t *testing.T) { resourceName := "aws_s3_access_point.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3control.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckAccessPointDestroy(ctx), @@ -273,7 +273,7 @@ func TestAccS3ControlAccessPoint_vpc(t *testing.T) { vpcResourceName := "aws_vpc.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3control.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckAccessPointDestroy(ctx), 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 733da4f21ec1..0583fbfad092 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 @@ -13,7 +13,7 @@ func testAccAccountPublicAccessBlockDataSource_basic(t *testing.T) { dataSourceName := "data.aws_s3_account_public_access_block.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3control.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ diff --git a/internal/service/s3control/account_public_access_block_test.go b/internal/service/s3control/account_public_access_block_test.go index ff97f6ec7ff7..6dc2754fd7c1 100644 --- a/internal/service/s3control/account_public_access_block_test.go +++ b/internal/service/s3control/account_public_access_block_test.go @@ -42,7 +42,7 @@ func testAccAccountPublicAccessBlock_basic(t *testing.T) { resourceName := "aws_s3_account_public_access_block.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3control.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckAccountPublicAccessBlockDestroy(ctx), @@ -73,7 +73,7 @@ func testAccAccountPublicAccessBlock_disappears(t *testing.T) { resourceName := "aws_s3_account_public_access_block.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3control.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckAccountPublicAccessBlockDestroy(ctx), @@ -96,7 +96,7 @@ func testAccAccountPublicAccessBlock_AccountID(t *testing.T) { resourceName := "aws_s3_account_public_access_block.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3control.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckAccountPublicAccessBlockDestroy(ctx), @@ -123,7 +123,7 @@ func testAccAccountPublicAccessBlock_BlockPublicACLs(t *testing.T) { resourceName := "aws_s3_account_public_access_block.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3control.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckAccountPublicAccessBlockDestroy(ctx), @@ -164,7 +164,7 @@ func testAccAccountPublicAccessBlock_BlockPublicPolicy(t *testing.T) { resourceName := "aws_s3_account_public_access_block.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3control.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckAccountPublicAccessBlockDestroy(ctx), @@ -205,7 +205,7 @@ func testAccAccountPublicAccessBlock_IgnorePublicACLs(t *testing.T) { resourceName := "aws_s3_account_public_access_block.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3control.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckAccountPublicAccessBlockDestroy(ctx), @@ -246,7 +246,7 @@ func testAccAccountPublicAccessBlock_RestrictPublicBuckets(t *testing.T) { resourceName := "aws_s3_account_public_access_block.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3control.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckAccountPublicAccessBlockDestroy(ctx), diff --git a/internal/service/s3control/bucket_lifecycle_configuration_test.go b/internal/service/s3control/bucket_lifecycle_configuration_test.go index f87bc9acb316..0202785db061 100644 --- a/internal/service/s3control/bucket_lifecycle_configuration_test.go +++ b/internal/service/s3control/bucket_lifecycle_configuration_test.go @@ -23,7 +23,7 @@ func TestAccS3ControlBucketLifecycleConfiguration_basic(t *testing.T) { resourceName := "aws_s3control_bucket_lifecycle_configuration.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckOutpostsOutposts(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckOutpostsOutposts(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3control.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckBucketLifecycleConfigurationDestroy(ctx), @@ -57,7 +57,7 @@ func TestAccS3ControlBucketLifecycleConfiguration_disappears(t *testing.T) { resourceName := "aws_s3control_bucket_lifecycle_configuration.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckOutpostsOutposts(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckOutpostsOutposts(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3control.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckBucketLifecycleConfigurationDestroy(ctx), @@ -80,7 +80,7 @@ func TestAccS3ControlBucketLifecycleConfiguration_RuleAbortIncompleteMultipartUp resourceName := "aws_s3control_bucket_lifecycle_configuration.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckOutpostsOutposts(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckOutpostsOutposts(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3control.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckBucketLifecycleConfigurationDestroy(ctx), @@ -124,7 +124,7 @@ func TestAccS3ControlBucketLifecycleConfiguration_RuleExpiration_date(t *testing date2 := time.Now().AddDate(0, 0, 2).Format("2006-01-02") resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckOutpostsOutposts(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckOutpostsOutposts(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3control.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckBucketLifecycleConfigurationDestroy(ctx), @@ -166,7 +166,7 @@ func TestAccS3ControlBucketLifecycleConfiguration_RuleExpiration_days(t *testing resourceName := "aws_s3control_bucket_lifecycle_configuration.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckOutpostsOutposts(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckOutpostsOutposts(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3control.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckBucketLifecycleConfigurationDestroy(ctx), @@ -209,7 +209,7 @@ func TestAccS3ControlBucketLifecycleConfiguration_RuleExpiration_expiredObjectDe resourceName := "aws_s3control_bucket_lifecycle_configuration.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckOutpostsOutposts(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckOutpostsOutposts(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3control.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckBucketLifecycleConfigurationDestroy(ctx), @@ -251,7 +251,7 @@ func TestAccS3ControlBucketLifecycleConfiguration_RuleFilter_prefix(t *testing.T resourceName := "aws_s3control_bucket_lifecycle_configuration.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckOutpostsOutposts(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckOutpostsOutposts(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3control.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckBucketLifecycleConfigurationDestroy(ctx), @@ -293,7 +293,7 @@ func TestAccS3ControlBucketLifecycleConfiguration_RuleFilter_tags(t *testing.T) resourceName := "aws_s3control_bucket_lifecycle_configuration.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckOutpostsOutposts(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckOutpostsOutposts(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3control.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckBucketLifecycleConfigurationDestroy(ctx), @@ -353,7 +353,7 @@ func TestAccS3ControlBucketLifecycleConfiguration_Rule_id(t *testing.T) { resourceName := "aws_s3control_bucket_lifecycle_configuration.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckOutpostsOutposts(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckOutpostsOutposts(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3control.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckBucketLifecycleConfigurationDestroy(ctx), @@ -393,7 +393,7 @@ func TestAccS3ControlBucketLifecycleConfiguration_Rule_status(t *testing.T) { resourceName := "aws_s3control_bucket_lifecycle_configuration.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckOutpostsOutposts(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckOutpostsOutposts(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3control.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckBucketLifecycleConfigurationDestroy(ctx), diff --git a/internal/service/s3control/bucket_policy_test.go b/internal/service/s3control/bucket_policy_test.go index fbb218559210..d84b6e3dd1cc 100644 --- a/internal/service/s3control/bucket_policy_test.go +++ b/internal/service/s3control/bucket_policy_test.go @@ -23,7 +23,7 @@ func TestAccS3ControlBucketPolicy_basic(t *testing.T) { resourceName := "aws_s3control_bucket_policy.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckOutpostsOutposts(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckOutpostsOutposts(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3control.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckBucketPolicyDestroy(ctx), @@ -51,7 +51,7 @@ func TestAccS3ControlBucketPolicy_disappears(t *testing.T) { resourceName := "aws_s3control_bucket_policy.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckOutpostsOutposts(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckOutpostsOutposts(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3control.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckBucketPolicyDestroy(ctx), @@ -74,7 +74,7 @@ func TestAccS3ControlBucketPolicy_policy(t *testing.T) { resourceName := "aws_s3control_bucket_policy.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckOutpostsOutposts(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckOutpostsOutposts(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3control.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckBucketPolicyDestroy(ctx), diff --git a/internal/service/s3control/bucket_test.go b/internal/service/s3control/bucket_test.go index 7172b2de6030..5ed019bb1665 100644 --- a/internal/service/s3control/bucket_test.go +++ b/internal/service/s3control/bucket_test.go @@ -23,7 +23,7 @@ func TestAccS3ControlBucket_basic(t *testing.T) { resourceName := "aws_s3control_bucket.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckOutpostsOutposts(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckOutpostsOutposts(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3control.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckBucketDestroy(ctx), @@ -55,7 +55,7 @@ func TestAccS3ControlBucket_disappears(t *testing.T) { resourceName := "aws_s3control_bucket.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckOutpostsOutposts(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckOutpostsOutposts(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3control.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckBucketDestroy(ctx), @@ -80,7 +80,7 @@ func TestAccS3ControlBucket_tags(t *testing.T) { resourceName := "aws_s3control_bucket.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckOutpostsOutposts(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckOutpostsOutposts(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3control.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckBucketDestroy(ctx), 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 aa9b0ebabe6f..dc3316e2da85 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 @@ -21,7 +21,7 @@ func TestAccS3ControlMultiRegionAccessPointDataSource_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckMultipleRegion(t, 2) acctest.PreCheckPartitionNot(t, endpoints.AwsUsGovPartitionID) }, 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 ceeeaea3d915..8bf3eaa1ff40 100644 --- a/internal/service/s3control/multi_region_access_point_policy_test.go +++ b/internal/service/s3control/multi_region_access_point_policy_test.go @@ -24,7 +24,7 @@ func TestAccS3ControlMultiRegionAccessPointPolicy_basic(t *testing.T) { multiRegionAccessPointName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionNot(t, endpoints.AwsUsGovPartitionID) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionNot(t, endpoints.AwsUsGovPartitionID) }, ErrorCheck: acctest.ErrorCheck(t, s3control.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, // Multi-Region Access Point Policy cannot be deleted once applied. @@ -62,7 +62,7 @@ func TestAccS3ControlMultiRegionAccessPointPolicy_disappears_MultiRegionAccessPo rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionNot(t, endpoints.AwsUsGovPartitionID) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionNot(t, endpoints.AwsUsGovPartitionID) }, ErrorCheck: acctest.ErrorCheck(t, s3control.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, // Multi-Region Access Point Policy cannot be deleted once applied. @@ -89,7 +89,7 @@ func TestAccS3ControlMultiRegionAccessPointPolicy_details_policy(t *testing.T) { bucketName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionNot(t, endpoints.AwsUsGovPartitionID) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionNot(t, endpoints.AwsUsGovPartitionID) }, ErrorCheck: acctest.ErrorCheck(t, s3control.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, // Multi-Region Access Point Policy cannot be deleted once applied. @@ -127,7 +127,7 @@ func TestAccS3ControlMultiRegionAccessPointPolicy_details_name(t *testing.T) { bucketName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionNot(t, endpoints.AwsUsGovPartitionID) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionNot(t, endpoints.AwsUsGovPartitionID) }, ErrorCheck: acctest.ErrorCheck(t, s3control.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, // Multi-Region Access Point Policy cannot be deleted once applied. diff --git a/internal/service/s3control/multi_region_access_point_test.go b/internal/service/s3control/multi_region_access_point_test.go index d091f1beb0cc..b67a08a95555 100644 --- a/internal/service/s3control/multi_region_access_point_test.go +++ b/internal/service/s3control/multi_region_access_point_test.go @@ -26,7 +26,7 @@ func TestAccS3ControlMultiRegionAccessPoint_basic(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionNot(t, endpoints.AwsUsGovPartitionID) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionNot(t, endpoints.AwsUsGovPartitionID) }, ErrorCheck: acctest.ErrorCheck(t, s3control.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckMultiRegionAccessPointDestroy(ctx), @@ -70,7 +70,7 @@ func TestAccS3ControlMultiRegionAccessPoint_disappears(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionNot(t, endpoints.AwsUsGovPartitionID) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionNot(t, endpoints.AwsUsGovPartitionID) }, ErrorCheck: acctest.ErrorCheck(t, s3control.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckMultiRegionAccessPointDestroy(ctx), @@ -95,7 +95,7 @@ func TestAccS3ControlMultiRegionAccessPoint_PublicAccessBlock(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionNot(t, endpoints.AwsUsGovPartitionID) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionNot(t, endpoints.AwsUsGovPartitionID) }, ErrorCheck: acctest.ErrorCheck(t, s3control.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckMultiRegionAccessPointDestroy(ctx), @@ -129,7 +129,7 @@ func TestAccS3ControlMultiRegionAccessPoint_name(t *testing.T) { bucketName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionNot(t, endpoints.AwsUsGovPartitionID) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionNot(t, endpoints.AwsUsGovPartitionID) }, ErrorCheck: acctest.ErrorCheck(t, s3control.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckMultiRegionAccessPointDestroy(ctx), @@ -169,7 +169,7 @@ func TestAccS3ControlMultiRegionAccessPoint_threeRegions(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckMultipleRegion(t, 3) acctest.PreCheckPartitionNot(t, endpoints.AwsUsGovPartitionID) }, 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 111d5250aecc..5863eb1c0711 100644 --- a/internal/service/s3control/object_lambda_access_point_policy_test.go +++ b/internal/service/s3control/object_lambda_access_point_policy_test.go @@ -21,7 +21,7 @@ func TestAccS3ControlObjectLambdaAccessPointPolicy_basic(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3control.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckObjectLambdaAccessPointPolicyDestroy(ctx), @@ -51,7 +51,7 @@ func TestAccS3ControlObjectLambdaAccessPointPolicy_disappears(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3control.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckObjectLambdaAccessPointPolicyDestroy(ctx), @@ -75,7 +75,7 @@ func TestAccS3ControlObjectLambdaAccessPointPolicy_Disappears_accessPoint(t *tes rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3control.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckObjectLambdaAccessPointPolicyDestroy(ctx), @@ -98,7 +98,7 @@ func TestAccS3ControlObjectLambdaAccessPointPolicy_update(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3control.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckObjectLambdaAccessPointPolicyDestroy(ctx), diff --git a/internal/service/s3control/object_lambda_access_point_test.go b/internal/service/s3control/object_lambda_access_point_test.go index abd8e79dfe70..e317b4966ab5 100644 --- a/internal/service/s3control/object_lambda_access_point_test.go +++ b/internal/service/s3control/object_lambda_access_point_test.go @@ -24,7 +24,7 @@ func TestAccS3ControlObjectLambdaAccessPoint_basic(t *testing.T) { lambdaFunctionResourceName := "aws_lambda_function.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3control.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckObjectLambdaAccessPointDestroy(ctx), @@ -66,7 +66,7 @@ func TestAccS3ControlObjectLambdaAccessPoint_disappears(t *testing.T) { resourceName := "aws_s3control_object_lambda_access_point.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3control.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckObjectLambdaAccessPointDestroy(ctx), @@ -92,7 +92,7 @@ func TestAccS3ControlObjectLambdaAccessPoint_update(t *testing.T) { lambdaFunctionResourceName := "aws_lambda_function.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3control.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckObjectLambdaAccessPointDestroy(ctx), diff --git a/internal/service/s3control/storage_lens_configuration_test.go b/internal/service/s3control/storage_lens_configuration_test.go index b2c14c428a7b..92bbf0742932 100644 --- a/internal/service/s3control/storage_lens_configuration_test.go +++ b/internal/service/s3control/storage_lens_configuration_test.go @@ -21,7 +21,7 @@ func TestAccS3ControlStorageLensConfiguration_basic(t *testing.T) { resourceName := "aws_s3control_storage_lens_configuration.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3control.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckStorageLensConfigurationDestroy(ctx), @@ -67,7 +67,7 @@ func TestAccS3ControlStorageLensConfiguration_disappears(t *testing.T) { resourceName := "aws_s3control_storage_lens_configuration.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3control.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckStorageLensConfigurationDestroy(ctx), @@ -90,7 +90,7 @@ func TestAccS3ControlStorageLensConfiguration_tags(t *testing.T) { resourceName := "aws_s3control_storage_lens_configuration.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3control.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckStorageLensConfigurationDestroy(ctx), @@ -135,7 +135,7 @@ func TestAccS3ControlStorageLensConfiguration_update(t *testing.T) { resourceName := "aws_s3control_storage_lens_configuration.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3control.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckStorageLensConfigurationDestroy(ctx), @@ -241,7 +241,7 @@ func TestAccS3ControlStorageLensConfiguration_advancedMetrics(t *testing.T) { resourceName := "aws_s3control_storage_lens_configuration.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3control.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckStorageLensConfigurationDestroy(ctx), From 6b0461415db5a444d7c40ae9897566b211113ea0 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Fri, 24 Feb 2023 16:37:24 -0500 Subject: [PATCH 228/763] Add 'Context' argument to 'acctest.PreCheck' for s3outposts. --- internal/service/s3outposts/endpoint_test.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/service/s3outposts/endpoint_test.go b/internal/service/s3outposts/endpoint_test.go index 3d90a8a9a45c..d6e866f23adf 100644 --- a/internal/service/s3outposts/endpoint_test.go +++ b/internal/service/s3outposts/endpoint_test.go @@ -21,7 +21,7 @@ func TestAccS3OutpostsEndpoint_basic(t *testing.T) { rInt := sdkacctest.RandIntRange(0, 255) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckOutpostsOutposts(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckOutpostsOutposts(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3outposts.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckEndpointDestroy(ctx), @@ -55,7 +55,7 @@ func TestAccS3OutpostsEndpoint_disappears(t *testing.T) { rInt := sdkacctest.RandIntRange(0, 255) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckOutpostsOutposts(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckOutpostsOutposts(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3outposts.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckEndpointDestroy(ctx), From ac45eaab9610cb6a1ad1275f40a46384ac1278ef Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Fri, 24 Feb 2023 16:37:24 -0500 Subject: [PATCH 229/763] Add 'Context' argument to 'acctest.PreCheck' for sagemaker. --- .../sagemaker/app_image_config_test.go | 10 ++--- internal/service/sagemaker/app_test.go | 12 +++--- .../service/sagemaker/code_repository_test.go | 10 ++--- .../service/sagemaker/device_fleet_test.go | 8 ++-- internal/service/sagemaker/device_test.go | 8 ++-- internal/service/sagemaker/domain_test.go | 38 +++++++++---------- .../sagemaker/endpoint_configuration_test.go | 26 ++++++------- internal/service/sagemaker/endpoint_test.go | 12 +++--- .../service/sagemaker/feature_group_test.go | 18 ++++----- .../service/sagemaker/flow_definition_test.go | 10 ++--- .../service/sagemaker/human_task_ui_test.go | 6 +-- internal/service/sagemaker/image_test.go | 10 ++--- .../service/sagemaker/image_version_test.go | 6 +-- .../model_package_group_policy_test.go | 6 +-- .../sagemaker/model_package_group_test.go | 8 ++-- internal/service/sagemaker/model_test.go | 26 ++++++------- ...k_instance_lifecycle_configuration_test.go | 4 +- .../sagemaker/notebook_instance_test.go | 30 +++++++-------- .../prebuilt_ecr_image_data_source_test.go | 4 +- internal/service/sagemaker/project_test.go | 8 ++-- .../servicecatalog_portfolio_status_test.go | 2 +- internal/service/sagemaker/space_test.go | 14 +++---- .../sagemaker/studio_lifecycle_config_test.go | 6 +-- .../service/sagemaker/user_profile_test.go | 18 ++++----- internal/service/sagemaker/workforce_test.go | 10 ++--- internal/service/sagemaker/workteam_test.go | 10 ++--- 26 files changed, 160 insertions(+), 160 deletions(-) diff --git a/internal/service/sagemaker/app_image_config_test.go b/internal/service/sagemaker/app_image_config_test.go index f7239a4b4e91..12a77f434ee7 100644 --- a/internal/service/sagemaker/app_image_config_test.go +++ b/internal/service/sagemaker/app_image_config_test.go @@ -23,7 +23,7 @@ func TestAccSageMakerAppImageConfig_basic(t *testing.T) { resourceName := "aws_sagemaker_app_image_config.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, sagemaker.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckAppImageDestroyConfig(ctx), @@ -54,7 +54,7 @@ func TestAccSageMakerAppImageConfig_KernelGatewayImage_kernelSpecs(t *testing.T) resourceName := "aws_sagemaker_app_image_config.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, sagemaker.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckAppImageDestroyConfig(ctx), @@ -98,7 +98,7 @@ func TestAccSageMakerAppImageConfig_KernelGatewayImage_fileSystem(t *testing.T) resourceName := "aws_sagemaker_app_image_config.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, sagemaker.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckAppImageDestroyConfig(ctx), @@ -145,7 +145,7 @@ func TestAccSageMakerAppImageConfig_tags(t *testing.T) { resourceName := "aws_sagemaker_app_image_config.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, sagemaker.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckAppDestroy(ctx), @@ -191,7 +191,7 @@ func TestAccSageMakerAppImageConfig_disappears(t *testing.T) { resourceName := "aws_sagemaker_app_image_config.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, sagemaker.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckAppImageDestroyConfig(ctx), diff --git a/internal/service/sagemaker/app_test.go b/internal/service/sagemaker/app_test.go index 551c100d716e..ce43bcc5ec34 100644 --- a/internal/service/sagemaker/app_test.go +++ b/internal/service/sagemaker/app_test.go @@ -28,7 +28,7 @@ func testAccApp_basic(t *testing.T) { resourceName := "aws_sagemaker_app.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, sagemaker.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckAppDestroy(ctx), @@ -67,7 +67,7 @@ func testAccApp_space(t *testing.T) { resourceName := "aws_sagemaker_app.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, sagemaker.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckAppDestroy(ctx), @@ -100,7 +100,7 @@ func testAccApp_resourceSpec(t *testing.T) { resourceName := "aws_sagemaker_app.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, sagemaker.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckAppDestroy(ctx), @@ -136,7 +136,7 @@ func testAccApp_resourceSpecLifecycle(t *testing.T) { resourceName := "aws_sagemaker_app.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, sagemaker.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckAppDestroy(ctx), @@ -172,7 +172,7 @@ func testAccApp_tags(t *testing.T) { resourceName := "aws_sagemaker_app.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, sagemaker.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckAppDestroy(ctx), @@ -222,7 +222,7 @@ func testAccApp_disappears(t *testing.T) { resourceName := "aws_sagemaker_app.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, sagemaker.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckAppDestroy(ctx), diff --git a/internal/service/sagemaker/code_repository_test.go b/internal/service/sagemaker/code_repository_test.go index 729a07775ffc..6ef75b18fc89 100644 --- a/internal/service/sagemaker/code_repository_test.go +++ b/internal/service/sagemaker/code_repository_test.go @@ -23,7 +23,7 @@ func TestAccSageMakerCodeRepository_basic(t *testing.T) { resourceName := "aws_sagemaker_code_repository.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, sagemaker.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckCodeRepositoryDestroy(ctx), @@ -55,7 +55,7 @@ func TestAccSageMakerCodeRepository_Git_branch(t *testing.T) { resourceName := "aws_sagemaker_code_repository.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, sagemaker.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckCodeRepositoryDestroy(ctx), @@ -87,7 +87,7 @@ func TestAccSageMakerCodeRepository_Git_secret(t *testing.T) { resourceName := "aws_sagemaker_code_repository.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, sagemaker.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckCodeRepositoryDestroy(ctx), @@ -130,7 +130,7 @@ func TestAccSageMakerCodeRepository_tags(t *testing.T) { resourceName := "aws_sagemaker_code_repository.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, sagemaker.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDeviceFleetDestroy(ctx), @@ -176,7 +176,7 @@ func TestAccSageMakerCodeRepository_disappears(t *testing.T) { resourceName := "aws_sagemaker_code_repository.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, sagemaker.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckCodeRepositoryDestroy(ctx), diff --git a/internal/service/sagemaker/device_fleet_test.go b/internal/service/sagemaker/device_fleet_test.go index bc40ac2a7a8c..a39eb476d124 100644 --- a/internal/service/sagemaker/device_fleet_test.go +++ b/internal/service/sagemaker/device_fleet_test.go @@ -23,7 +23,7 @@ func TestAccSageMakerDeviceFleet_basic(t *testing.T) { resourceName := "aws_sagemaker_device_fleet.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, sagemaker.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDeviceFleetDestroy(ctx), @@ -58,7 +58,7 @@ func TestAccSageMakerDeviceFleet_description(t *testing.T) { resourceName := "aws_sagemaker_device_fleet.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, sagemaker.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDeviceFleetDestroy(ctx), @@ -93,7 +93,7 @@ func TestAccSageMakerDeviceFleet_tags(t *testing.T) { resourceName := "aws_sagemaker_device_fleet.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, sagemaker.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDeviceFleetDestroy(ctx), @@ -139,7 +139,7 @@ func TestAccSageMakerDeviceFleet_disappears(t *testing.T) { resourceName := "aws_sagemaker_device_fleet.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, sagemaker.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDeviceFleetDestroy(ctx), diff --git a/internal/service/sagemaker/device_test.go b/internal/service/sagemaker/device_test.go index e445fbdef5d9..cf4c8798a2e2 100644 --- a/internal/service/sagemaker/device_test.go +++ b/internal/service/sagemaker/device_test.go @@ -23,7 +23,7 @@ func TestAccSageMakerDevice_basic(t *testing.T) { resourceName := "aws_sagemaker_device.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, sagemaker.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDeviceDestroy(ctx), @@ -54,7 +54,7 @@ func TestAccSageMakerDevice_description(t *testing.T) { resourceName := "aws_sagemaker_device.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, sagemaker.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDeviceDestroy(ctx), @@ -89,7 +89,7 @@ func TestAccSageMakerDevice_disappears(t *testing.T) { resourceName := "aws_sagemaker_device.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, sagemaker.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDeviceDestroy(ctx), @@ -114,7 +114,7 @@ func TestAccSageMakerDevice_disappears_fleet(t *testing.T) { resourceName := "aws_sagemaker_device.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, sagemaker.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDeviceDestroy(ctx), diff --git a/internal/service/sagemaker/domain_test.go b/internal/service/sagemaker/domain_test.go index 44be95b46516..c91188c2b4d2 100644 --- a/internal/service/sagemaker/domain_test.go +++ b/internal/service/sagemaker/domain_test.go @@ -25,7 +25,7 @@ func testAccDomain_basic(t *testing.T) { resourceName := "aws_sagemaker_domain.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, sagemaker.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDomainDestroy(ctx), @@ -66,7 +66,7 @@ func testAccDomain_domainSettings(t *testing.T) { resourceName := "aws_sagemaker_domain.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, sagemaker.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDomainDestroy(ctx), @@ -104,7 +104,7 @@ func testAccDomain_kms(t *testing.T) { resourceName := "aws_sagemaker_domain.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, sagemaker.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDomainDestroy(ctx), @@ -133,7 +133,7 @@ func testAccDomain_tags(t *testing.T) { resourceName := "aws_sagemaker_domain.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, sagemaker.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDomainDestroy(ctx), @@ -180,7 +180,7 @@ func testAccDomain_securityGroup(t *testing.T) { resourceName := "aws_sagemaker_domain.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, sagemaker.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDomainDestroy(ctx), @@ -218,7 +218,7 @@ func testAccDomain_sharingSettings(t *testing.T) { resourceName := "aws_sagemaker_domain.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, sagemaker.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDomainDestroy(ctx), @@ -251,7 +251,7 @@ func testAccDomain_canvasAppSettings(t *testing.T) { resourceName := "aws_sagemaker_domain.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, sagemaker.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDomainDestroy(ctx), @@ -283,7 +283,7 @@ func testAccDomain_tensorboardAppSettings(t *testing.T) { resourceName := "aws_sagemaker_domain.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, sagemaker.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDomainDestroy(ctx), @@ -315,7 +315,7 @@ func testAccDomain_tensorboardAppSettingsWithImage(t *testing.T) { resourceName := "aws_sagemaker_domain.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, sagemaker.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDomainDestroy(ctx), @@ -348,7 +348,7 @@ func testAccDomain_rSessionAppSettings(t *testing.T) { resourceName := "aws_sagemaker_domain.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, sagemaker.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDomainDestroy(ctx), @@ -380,7 +380,7 @@ func testAccDomain_kernelGatewayAppSettings(t *testing.T) { resourceName := "aws_sagemaker_domain.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, sagemaker.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDomainDestroy(ctx), @@ -412,7 +412,7 @@ func testAccDomain_kernelGatewayAppSettings_lifecycleConfig(t *testing.T) { resourceName := "aws_sagemaker_domain.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, sagemaker.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDomainDestroy(ctx), @@ -451,7 +451,7 @@ func testAccDomain_kernelGatewayAppSettings_customImage(t *testing.T) { baseImage := os.Getenv("SAGEMAKER_IMAGE_VERSION_BASE_IMAGE") resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, sagemaker.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDomainDestroy(ctx), @@ -490,7 +490,7 @@ func testAccDomain_kernelGatewayAppSettings_defaultResourceSpecAndCustomImage(t baseImage := os.Getenv("SAGEMAKER_IMAGE_VERSION_BASE_IMAGE") resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, sagemaker.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDomainDestroy(ctx), @@ -525,7 +525,7 @@ func testAccDomain_jupyterServerAppSettings(t *testing.T) { resourceName := "aws_sagemaker_domain.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, sagemaker.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDomainDestroy(ctx), @@ -557,7 +557,7 @@ func testAccDomain_jupyterServerAppSettings_code(t *testing.T) { resourceName := "aws_sagemaker_domain.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, sagemaker.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDomainDestroy(ctx), @@ -593,7 +593,7 @@ func testAccDomain_disappears(t *testing.T) { resourceName := "aws_sagemaker_domain.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, sagemaker.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDomainDestroy(ctx), @@ -617,7 +617,7 @@ func testAccDomain_defaultUserSettingsUpdated(t *testing.T) { resourceName := "aws_sagemaker_domain.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, sagemaker.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDomainDestroy(ctx), @@ -673,7 +673,7 @@ func testAccDomain_spaceSettingsKernelGatewayAppSettings(t *testing.T) { resourceName := "aws_sagemaker_domain.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, sagemaker.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDomainDestroy(ctx), diff --git a/internal/service/sagemaker/endpoint_configuration_test.go b/internal/service/sagemaker/endpoint_configuration_test.go index 5511846edc73..ebd5487687be 100644 --- a/internal/service/sagemaker/endpoint_configuration_test.go +++ b/internal/service/sagemaker/endpoint_configuration_test.go @@ -21,7 +21,7 @@ func TestAccSageMakerEndpointConfiguration_basic(t *testing.T) { resourceName := "aws_sagemaker_endpoint_configuration.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, sagemaker.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckEndpointConfigurationDestroy(ctx), @@ -59,7 +59,7 @@ func TestAccSageMakerEndpointConfiguration_shadowProductionVariants(t *testing.T resourceName := "aws_sagemaker_endpoint_configuration.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, sagemaker.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckEndpointConfigurationDestroy(ctx), @@ -100,7 +100,7 @@ func TestAccSageMakerEndpointConfiguration_ProductionVariants_serverless(t *test resourceName := "aws_sagemaker_endpoint_configuration.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, sagemaker.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckEndpointConfigurationDestroy(ctx), @@ -130,7 +130,7 @@ func TestAccSageMakerEndpointConfiguration_ProductionVariants_initialVariantWeig resourceName := "aws_sagemaker_endpoint_configuration.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, sagemaker.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckEndpointConfigurationDestroy(ctx), @@ -158,7 +158,7 @@ func TestAccSageMakerEndpointConfiguration_ProductionVariants_acceleratorType(t resourceName := "aws_sagemaker_endpoint_configuration.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, sagemaker.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckEndpointConfigurationDestroy(ctx), @@ -185,7 +185,7 @@ func TestAccSageMakerEndpointConfiguration_kmsKeyID(t *testing.T) { resourceName := "aws_sagemaker_endpoint_configuration.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, sagemaker.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckEndpointConfigurationDestroy(ctx), @@ -212,7 +212,7 @@ func TestAccSageMakerEndpointConfiguration_tags(t *testing.T) { resourceName := "aws_sagemaker_endpoint_configuration.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, sagemaker.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckEndpointConfigurationDestroy(ctx), @@ -257,7 +257,7 @@ func TestAccSageMakerEndpointConfiguration_dataCapture(t *testing.T) { resourceName := "aws_sagemaker_endpoint_configuration.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, sagemaker.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckEndpointConfigurationDestroy(ctx), @@ -291,7 +291,7 @@ func TestAccSageMakerEndpointConfiguration_disappears(t *testing.T) { resourceName := "aws_sagemaker_endpoint_configuration.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, sagemaker.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckEndpointConfigurationDestroy(ctx), @@ -315,7 +315,7 @@ func TestAccSageMakerEndpointConfiguration_async(t *testing.T) { resourceName := "aws_sagemaker_endpoint_configuration.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, sagemaker.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckEndpointConfigurationDestroy(ctx), @@ -348,7 +348,7 @@ func TestAccSageMakerEndpointConfiguration_async_kms(t *testing.T) { resourceName := "aws_sagemaker_endpoint_configuration.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, sagemaker.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckEndpointConfigurationDestroy(ctx), @@ -381,7 +381,7 @@ func TestAccSageMakerEndpointConfiguration_Async_notif(t *testing.T) { resourceName := "aws_sagemaker_endpoint_configuration.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, sagemaker.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckEndpointConfigurationDestroy(ctx), @@ -415,7 +415,7 @@ func TestAccSageMakerEndpointConfiguration_Async_client(t *testing.T) { resourceName := "aws_sagemaker_endpoint_configuration.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, sagemaker.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckEndpointConfigurationDestroy(ctx), diff --git a/internal/service/sagemaker/endpoint_test.go b/internal/service/sagemaker/endpoint_test.go index a18aaba4347d..92ad013b9411 100644 --- a/internal/service/sagemaker/endpoint_test.go +++ b/internal/service/sagemaker/endpoint_test.go @@ -21,7 +21,7 @@ func TestAccSageMakerEndpoint_basic(t *testing.T) { resourceName := "aws_sagemaker_endpoint.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, sagemaker.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckEndpointDestroy(ctx), @@ -59,7 +59,7 @@ func TestAccSageMakerEndpoint_endpointName(t *testing.T) { sagemakerEndpointConfigurationResourceName2 := "aws_sagemaker_endpoint_configuration.test2" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, sagemaker.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckEndpointDestroy(ctx), @@ -97,7 +97,7 @@ func TestAccSageMakerEndpoint_tags(t *testing.T) { resourceName := "aws_sagemaker_endpoint.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, sagemaker.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckEndpointDestroy(ctx), @@ -137,7 +137,7 @@ func TestAccSageMakerEndpoint_deploymentConfig(t *testing.T) { resourceName := "aws_sagemaker_endpoint.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, sagemaker.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckEndpointDestroy(ctx), @@ -178,7 +178,7 @@ func TestAccSageMakerEndpoint_deploymentConfig_full(t *testing.T) { resourceName := "aws_sagemaker_endpoint.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, sagemaker.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckEndpointDestroy(ctx), @@ -218,7 +218,7 @@ func TestAccSageMakerEndpoint_disappears(t *testing.T) { resourceName := "aws_sagemaker_endpoint.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, sagemaker.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckEndpointDestroy(ctx), diff --git a/internal/service/sagemaker/feature_group_test.go b/internal/service/sagemaker/feature_group_test.go index 818eaadc1807..0124ed319873 100644 --- a/internal/service/sagemaker/feature_group_test.go +++ b/internal/service/sagemaker/feature_group_test.go @@ -41,7 +41,7 @@ func testAccFeatureGroup_basic(t *testing.T) { resourceName := "aws_sagemaker_feature_group.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, sagemaker.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckFeatureGroupDestroy(ctx), @@ -78,7 +78,7 @@ func testAccFeatureGroup_description(t *testing.T) { resourceName := "aws_sagemaker_feature_group.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, sagemaker.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckFeatureGroupDestroy(ctx), @@ -107,7 +107,7 @@ func testAccFeatureGroup_tags(t *testing.T) { resourceName := "aws_sagemaker_feature_group.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, sagemaker.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckFeatureGroupDestroy(ctx), @@ -156,7 +156,7 @@ func testAccFeatureGroup_multipleFeatures(t *testing.T) { resourceName := "aws_sagemaker_feature_group.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, sagemaker.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckFeatureGroupDestroy(ctx), @@ -189,7 +189,7 @@ func testAccFeatureGroup_onlineConfigSecurityConfig(t *testing.T) { resourceName := "aws_sagemaker_feature_group.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, sagemaker.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckFeatureGroupDestroy(ctx), @@ -221,7 +221,7 @@ func testAccFeatureGroup_offlineConfig_basic(t *testing.T) { resourceName := "aws_sagemaker_feature_group.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, sagemaker.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckFeatureGroupDestroy(ctx), @@ -254,7 +254,7 @@ func testAccFeatureGroup_offlineConfig_createCatalog(t *testing.T) { resourceName := "aws_sagemaker_feature_group.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, sagemaker.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckFeatureGroupDestroy(ctx), @@ -291,7 +291,7 @@ func TestAccSageMakerFeatureGroup_Offline_providedCatalog(t *testing.T) { glueTableResourceName := "aws_glue_catalog_table.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, sagemaker.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckFeatureGroupDestroy(ctx), @@ -327,7 +327,7 @@ func TestAccSageMakerFeatureGroup_disappears(t *testing.T) { resourceName := "aws_sagemaker_feature_group.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, sagemaker.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckFeatureGroupDestroy(ctx), diff --git a/internal/service/sagemaker/flow_definition_test.go b/internal/service/sagemaker/flow_definition_test.go index e57a3e7c427e..ac692fe1b915 100644 --- a/internal/service/sagemaker/flow_definition_test.go +++ b/internal/service/sagemaker/flow_definition_test.go @@ -22,7 +22,7 @@ func testAccFlowDefinition_basic(t *testing.T) { resourceName := "aws_sagemaker_flow_definition.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, sagemaker.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckFlowDefinitionDestroy(ctx), @@ -65,7 +65,7 @@ func testAccFlowDefinition_humanLoopConfig_publicWorkforce(t *testing.T) { resourceName := "aws_sagemaker_flow_definition.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, sagemaker.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckFlowDefinitionDestroy(ctx), @@ -98,7 +98,7 @@ func testAccFlowDefinition_humanLoopRequestSource(t *testing.T) { resourceName := "aws_sagemaker_flow_definition.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, sagemaker.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckFlowDefinitionDestroy(ctx), @@ -131,7 +131,7 @@ func testAccFlowDefinition_tags(t *testing.T) { resourceName := "aws_sagemaker_flow_definition.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, sagemaker.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckFlowDefinitionDestroy(ctx), @@ -177,7 +177,7 @@ func testAccFlowDefinition_disappears(t *testing.T) { resourceName := "aws_sagemaker_flow_definition.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, sagemaker.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckFlowDefinitionDestroy(ctx), diff --git a/internal/service/sagemaker/human_task_ui_test.go b/internal/service/sagemaker/human_task_ui_test.go index 383cc91ec6ae..dac7be337299 100644 --- a/internal/service/sagemaker/human_task_ui_test.go +++ b/internal/service/sagemaker/human_task_ui_test.go @@ -22,7 +22,7 @@ func TestAccSageMakerHumanTaskUI_basic(t *testing.T) { resourceName := "aws_sagemaker_human_task_ui.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, sagemaker.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckHumanTaskUIDestroy(ctx), @@ -54,7 +54,7 @@ func TestAccSageMakerHumanTaskUI_tags(t *testing.T) { resourceName := "aws_sagemaker_human_task_ui.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, sagemaker.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckHumanTaskUIDestroy(ctx), @@ -101,7 +101,7 @@ func TestAccSageMakerHumanTaskUI_disappears(t *testing.T) { resourceName := "aws_sagemaker_human_task_ui.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, sagemaker.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckHumanTaskUIDestroy(ctx), diff --git a/internal/service/sagemaker/image_test.go b/internal/service/sagemaker/image_test.go index a19c0852882c..6aeae6305256 100644 --- a/internal/service/sagemaker/image_test.go +++ b/internal/service/sagemaker/image_test.go @@ -23,7 +23,7 @@ func TestAccSageMakerImage_basic(t *testing.T) { resourceName := "aws_sagemaker_image.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, sagemaker.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckImageDestroy(ctx), @@ -54,7 +54,7 @@ func TestAccSageMakerImage_description(t *testing.T) { resourceName := "aws_sagemaker_image.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, sagemaker.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckImageDestroy(ctx), @@ -96,7 +96,7 @@ func TestAccSageMakerImage_displayName(t *testing.T) { resourceName := "aws_sagemaker_image.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, sagemaker.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckImageDestroy(ctx), @@ -138,7 +138,7 @@ func TestAccSageMakerImage_tags(t *testing.T) { resourceName := "aws_sagemaker_image.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, sagemaker.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckImageDestroy(ctx), @@ -184,7 +184,7 @@ func TestAccSageMakerImage_disappears(t *testing.T) { resourceName := "aws_sagemaker_image.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, sagemaker.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckImageDestroy(ctx), diff --git a/internal/service/sagemaker/image_version_test.go b/internal/service/sagemaker/image_version_test.go index c209a00cd6e6..1750e3e30c70 100644 --- a/internal/service/sagemaker/image_version_test.go +++ b/internal/service/sagemaker/image_version_test.go @@ -29,7 +29,7 @@ func TestAccSageMakerImageVersion_basic(t *testing.T) { baseImage := os.Getenv("SAGEMAKER_IMAGE_VERSION_BASE_IMAGE") resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, sagemaker.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckImageVersionDestroy(ctx), @@ -67,7 +67,7 @@ func TestAccSageMakerImageVersion_disappears(t *testing.T) { baseImage := os.Getenv("SAGEMAKER_IMAGE_VERSION_BASE_IMAGE") resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, sagemaker.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckImageVersionDestroy(ctx), @@ -96,7 +96,7 @@ func TestAccSageMakerImageVersion_Disappears_image(t *testing.T) { baseImage := os.Getenv("SAGEMAKER_IMAGE_VERSION_BASE_IMAGE") resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, sagemaker.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckImageVersionDestroy(ctx), diff --git a/internal/service/sagemaker/model_package_group_policy_test.go b/internal/service/sagemaker/model_package_group_policy_test.go index 0cab0e70651b..7ce0d3d6c46a 100644 --- a/internal/service/sagemaker/model_package_group_policy_test.go +++ b/internal/service/sagemaker/model_package_group_policy_test.go @@ -22,7 +22,7 @@ func TestAccSageMakerModelPackageGroupPolicy_basic(t *testing.T) { resourceName := "aws_sagemaker_model_package_group_policy.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, sagemaker.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckModelPackageGroupPolicyDestroy(ctx), @@ -50,7 +50,7 @@ func TestAccSageMakerModelPackageGroupPolicy_disappears(t *testing.T) { resourceName := "aws_sagemaker_model_package_group_policy.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, sagemaker.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckModelPackageGroupPolicyDestroy(ctx), @@ -75,7 +75,7 @@ func TestAccSageMakerModelPackageGroupPolicy_Disappears_modelPackageGroup(t *tes resourceName := "aws_sagemaker_model_package_group_policy.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, sagemaker.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckModelPackageGroupPolicyDestroy(ctx), diff --git a/internal/service/sagemaker/model_package_group_test.go b/internal/service/sagemaker/model_package_group_test.go index 6d342c1a8517..1b47aaece282 100644 --- a/internal/service/sagemaker/model_package_group_test.go +++ b/internal/service/sagemaker/model_package_group_test.go @@ -23,7 +23,7 @@ func TestAccSageMakerModelPackageGroup_basic(t *testing.T) { resourceName := "aws_sagemaker_model_package_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, sagemaker.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckModelPackageGroupDestroy(ctx), @@ -53,7 +53,7 @@ func TestAccSageMakerModelPackageGroup_description(t *testing.T) { resourceName := "aws_sagemaker_model_package_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, sagemaker.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckModelPackageGroupDestroy(ctx), @@ -81,7 +81,7 @@ func TestAccSageMakerModelPackageGroup_tags(t *testing.T) { resourceName := "aws_sagemaker_model_package_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, sagemaker.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckModelPackageGroupDestroy(ctx), @@ -127,7 +127,7 @@ func TestAccSageMakerModelPackageGroup_disappears(t *testing.T) { resourceName := "aws_sagemaker_model_package_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, sagemaker.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckModelPackageGroupDestroy(ctx), diff --git a/internal/service/sagemaker/model_test.go b/internal/service/sagemaker/model_test.go index 569cccc1ea2c..3f8492567ffc 100644 --- a/internal/service/sagemaker/model_test.go +++ b/internal/service/sagemaker/model_test.go @@ -22,7 +22,7 @@ func TestAccSageMakerModel_basic(t *testing.T) { resourceName := "aws_sagemaker_model.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, sagemaker.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckModelDestroy(ctx), @@ -58,7 +58,7 @@ func TestAccSageMakerModel_inferenceExecution(t *testing.T) { resourceName := "aws_sagemaker_model.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, sagemaker.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckModelDestroy(ctx), @@ -86,7 +86,7 @@ func TestAccSageMakerModel_tags(t *testing.T) { resourceName := "aws_sagemaker_model.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, sagemaker.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckModelDestroy(ctx), @@ -131,7 +131,7 @@ func TestAccSageMakerModel_primaryContainerModelDataURL(t *testing.T) { resourceName := "aws_sagemaker_model.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, sagemaker.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckModelDestroy(ctx), @@ -158,7 +158,7 @@ func TestAccSageMakerModel_primaryContainerHostname(t *testing.T) { resourceName := "aws_sagemaker_model.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, sagemaker.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckModelDestroy(ctx), @@ -185,7 +185,7 @@ func TestAccSageMakerModel_primaryContainerImage(t *testing.T) { resourceName := "aws_sagemaker_model.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, sagemaker.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckModelDestroy(ctx), @@ -213,7 +213,7 @@ func TestAccSageMakerModel_primaryContainerEnvironment(t *testing.T) { resourceName := "aws_sagemaker_model.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, sagemaker.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckModelDestroy(ctx), @@ -241,7 +241,7 @@ func TestAccSageMakerModel_primaryContainerModeSingle(t *testing.T) { resourceName := "aws_sagemaker_model.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, sagemaker.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckModelDestroy(ctx), @@ -268,7 +268,7 @@ func TestAccSageMakerModel_containers(t *testing.T) { resourceName := "aws_sagemaker_model.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, sagemaker.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckModelDestroy(ctx), @@ -297,7 +297,7 @@ func TestAccSageMakerModel_vpc(t *testing.T) { resourceName := "aws_sagemaker_model.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, sagemaker.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckModelDestroy(ctx), @@ -326,7 +326,7 @@ func TestAccSageMakerModel_primaryContainerPrivateDockerRegistry(t *testing.T) { resourceName := "aws_sagemaker_model.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, sagemaker.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckModelDestroy(ctx), @@ -355,7 +355,7 @@ func TestAccSageMakerModel_networkIsolation(t *testing.T) { resourceName := "aws_sagemaker_model.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, sagemaker.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckModelDestroy(ctx), @@ -382,7 +382,7 @@ func TestAccSageMakerModel_disappears(t *testing.T) { resourceName := "aws_sagemaker_model.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, sagemaker.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckModelDestroy(ctx), diff --git a/internal/service/sagemaker/notebook_instance_lifecycle_configuration_test.go b/internal/service/sagemaker/notebook_instance_lifecycle_configuration_test.go index 3406b128f77c..25e68c400290 100644 --- a/internal/service/sagemaker/notebook_instance_lifecycle_configuration_test.go +++ b/internal/service/sagemaker/notebook_instance_lifecycle_configuration_test.go @@ -23,7 +23,7 @@ func TestAccSageMakerNotebookInstanceLifecycleConfiguration_basic(t *testing.T) resourceName := "aws_sagemaker_notebook_instance_lifecycle_configuration.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, sagemaker.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckNotebookInstanceLifecycleConfigurationDestroy(ctx), @@ -55,7 +55,7 @@ func TestAccSageMakerNotebookInstanceLifecycleConfiguration_update(t *testing.T) resourceName := "aws_sagemaker_notebook_instance_lifecycle_configuration.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, sagemaker.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckNotebookInstanceLifecycleConfigurationDestroy(ctx), diff --git a/internal/service/sagemaker/notebook_instance_test.go b/internal/service/sagemaker/notebook_instance_test.go index 88aff96a5452..5dd75f383cb3 100644 --- a/internal/service/sagemaker/notebook_instance_test.go +++ b/internal/service/sagemaker/notebook_instance_test.go @@ -29,7 +29,7 @@ func TestAccSageMakerNotebookInstance_basic(t *testing.T) { resourceName := "aws_sagemaker_notebook_instance.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, sagemaker.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckNotebookInstanceDestroy(ctx), @@ -75,7 +75,7 @@ func TestAccSageMakerNotebookInstance_imds(t *testing.T) { resourceName := "aws_sagemaker_notebook_instance.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, sagemaker.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckNotebookInstanceDestroy(ctx), @@ -116,7 +116,7 @@ func TestAccSageMakerNotebookInstance_update(t *testing.T) { resourceName := "aws_sagemaker_notebook_instance.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, sagemaker.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckNotebookInstanceDestroy(ctx), @@ -155,7 +155,7 @@ func TestAccSageMakerNotebookInstance_volumeSize(t *testing.T) { var resourceName = "aws_sagemaker_notebook_instance.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, sagemaker.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckNotebookInstanceDestroy(ctx), @@ -204,7 +204,7 @@ func TestAccSageMakerNotebookInstance_lifecycleName(t *testing.T) { sagemakerLifecycleConfigResourceName := "aws_sagemaker_notebook_instance_lifecycle_configuration.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, sagemaker.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckNotebookInstanceDestroy(ctx), @@ -250,7 +250,7 @@ func TestAccSageMakerNotebookInstance_tags(t *testing.T) { resourceName := "aws_sagemaker_notebook_instance.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, sagemaker.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckNotebookInstanceDestroy(ctx), @@ -300,7 +300,7 @@ func TestAccSageMakerNotebookInstance_kms(t *testing.T) { resourceName := "aws_sagemaker_notebook_instance.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, sagemaker.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckNotebookInstanceDestroy(ctx), @@ -332,7 +332,7 @@ func TestAccSageMakerNotebookInstance_disappears(t *testing.T) { resourceName := "aws_sagemaker_notebook_instance.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, sagemaker.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckNotebookInstanceDestroy(ctx), @@ -360,7 +360,7 @@ func TestAccSageMakerNotebookInstance_Root_access(t *testing.T) { resourceName := "aws_sagemaker_notebook_instance.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, sagemaker.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckNotebookInstanceDestroy(ctx), @@ -399,7 +399,7 @@ func TestAccSageMakerNotebookInstance_Platform_identifier(t *testing.T) { resourceName := "aws_sagemaker_notebook_instance.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, sagemaker.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckNotebookInstanceDestroy(ctx), @@ -438,7 +438,7 @@ func TestAccSageMakerNotebookInstance_DirectInternet_access(t *testing.T) { resourceName := "aws_sagemaker_notebook_instance.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, sagemaker.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckNotebookInstanceDestroy(ctx), @@ -483,7 +483,7 @@ func TestAccSageMakerNotebookInstance_DefaultCode_repository(t *testing.T) { var resourceName = "aws_sagemaker_notebook_instance.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, sagemaker.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckNotebookInstanceDestroy(ctx), @@ -529,7 +529,7 @@ func TestAccSageMakerNotebookInstance_AdditionalCode_repositories(t *testing.T) var resourceName = "aws_sagemaker_notebook_instance.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, sagemaker.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckNotebookInstanceDestroy(ctx), @@ -586,7 +586,7 @@ func TestAccSageMakerNotebookInstance_DefaultCodeRepository_sageMakerRepo(t *tes var resourceName = "aws_sagemaker_notebook_instance.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, sagemaker.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckNotebookInstanceDestroy(ctx), @@ -631,7 +631,7 @@ func TestAccSageMakerNotebookInstance_acceleratorTypes(t *testing.T) { var resourceName = "aws_sagemaker_notebook_instance.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, sagemaker.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckNotebookInstanceDestroy(ctx), 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 f6fb99561efa..956aa976d48e 100644 --- a/internal/service/sagemaker/prebuilt_ecr_image_data_source_test.go +++ b/internal/service/sagemaker/prebuilt_ecr_image_data_source_test.go @@ -15,7 +15,7 @@ func TestAccSageMakerPrebuiltECRImageDataSource_basic(t *testing.T) { dataSourceName := "data.aws_sagemaker_prebuilt_ecr_image.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, sagemaker.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ @@ -37,7 +37,7 @@ func TestAccSageMakerPrebuiltECRImageDataSource_region(t *testing.T) { dataSourceName := "data.aws_sagemaker_prebuilt_ecr_image.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, sagemaker.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ diff --git a/internal/service/sagemaker/project_test.go b/internal/service/sagemaker/project_test.go index eb36724acbdd..16725e81f81d 100644 --- a/internal/service/sagemaker/project_test.go +++ b/internal/service/sagemaker/project_test.go @@ -23,7 +23,7 @@ func TestAccSageMakerProject_basic(t *testing.T) { resourceName := "aws_sagemaker_project.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, sagemaker.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckProjectDestroy(ctx), @@ -60,7 +60,7 @@ func TestAccSageMakerProject_description(t *testing.T) { resourceName := "aws_sagemaker_project.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, sagemaker.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckProjectDestroy(ctx), @@ -100,7 +100,7 @@ func TestAccSageMakerProject_tags(t *testing.T) { resourceName := "aws_sagemaker_project.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, sagemaker.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckProjectDestroy(ctx), @@ -149,7 +149,7 @@ func TestAccSageMakerProject_disappears(t *testing.T) { resourceName := "aws_sagemaker_project.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, sagemaker.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckProjectDestroy(ctx), diff --git a/internal/service/sagemaker/servicecatalog_portfolio_status_test.go b/internal/service/sagemaker/servicecatalog_portfolio_status_test.go index c08216e67856..47349d8b0f41 100644 --- a/internal/service/sagemaker/servicecatalog_portfolio_status_test.go +++ b/internal/service/sagemaker/servicecatalog_portfolio_status_test.go @@ -18,7 +18,7 @@ func testAccServicecatalogPortfolioStatus_basic(t *testing.T) { resourceName := "aws_sagemaker_servicecatalog_portfolio_status.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, sagemaker.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: nil, diff --git a/internal/service/sagemaker/space_test.go b/internal/service/sagemaker/space_test.go index 03566cdb5acd..a955c96ca595 100644 --- a/internal/service/sagemaker/space_test.go +++ b/internal/service/sagemaker/space_test.go @@ -25,7 +25,7 @@ func testAccSpace_basic(t *testing.T) { resourceName := "aws_sagemaker_space.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, sagemaker.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSpaceDestroy(ctx), @@ -58,7 +58,7 @@ func testAccSpace_tags(t *testing.T) { resourceName := "aws_sagemaker_space.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, sagemaker.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSpaceDestroy(ctx), @@ -104,7 +104,7 @@ func testAccSpace_kernelGatewayAppSettings(t *testing.T) { resourceName := "aws_sagemaker_space.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, sagemaker.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSpaceDestroy(ctx), @@ -135,7 +135,7 @@ func testAccSpace_kernelGatewayAppSettings_lifecycleconfig(t *testing.T) { resourceName := "aws_sagemaker_space.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, sagemaker.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSpaceDestroy(ctx), @@ -173,7 +173,7 @@ func testAccSpace_kernelGatewayAppSettings_imageconfig(t *testing.T) { baseImage := os.Getenv("SAGEMAKER_IMAGE_VERSION_BASE_IMAGE") resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, sagemaker.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSpaceDestroy(ctx), @@ -206,7 +206,7 @@ func testAccSpace_jupyterServerAppSettings(t *testing.T) { resourceName := "aws_sagemaker_space.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, sagemaker.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSpaceDestroy(ctx), @@ -237,7 +237,7 @@ func testAccSpace_disappears(t *testing.T) { resourceName := "aws_sagemaker_space.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, sagemaker.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSpaceDestroy(ctx), diff --git a/internal/service/sagemaker/studio_lifecycle_config_test.go b/internal/service/sagemaker/studio_lifecycle_config_test.go index bcd4c15f4c87..147c68e06113 100644 --- a/internal/service/sagemaker/studio_lifecycle_config_test.go +++ b/internal/service/sagemaker/studio_lifecycle_config_test.go @@ -22,7 +22,7 @@ func TestAccSageMakerStudioLifecycleConfig_basic(t *testing.T) { resourceName := "aws_sagemaker_studio_lifecycle_config.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, sagemaker.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckStudioLifecycleDestroyConfig(ctx), @@ -54,7 +54,7 @@ func TestAccSageMakerStudioLifecycleConfig_tags(t *testing.T) { resourceName := "aws_sagemaker_studio_lifecycle_config.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, sagemaker.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckStudioLifecycleDestroyConfig(ctx), @@ -100,7 +100,7 @@ func TestAccSageMakerStudioLifecycleConfig_disappears(t *testing.T) { resourceName := "aws_sagemaker_studio_lifecycle_config.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, sagemaker.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckStudioLifecycleDestroyConfig(ctx), diff --git a/internal/service/sagemaker/user_profile_test.go b/internal/service/sagemaker/user_profile_test.go index 6c09794259fd..264456ab3b33 100644 --- a/internal/service/sagemaker/user_profile_test.go +++ b/internal/service/sagemaker/user_profile_test.go @@ -25,7 +25,7 @@ func testAccUserProfile_basic(t *testing.T) { resourceName := "aws_sagemaker_user_profile.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, sagemaker.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckUserProfileDestroy(ctx), @@ -58,7 +58,7 @@ func testAccUserProfile_tags(t *testing.T) { resourceName := "aws_sagemaker_user_profile.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, sagemaker.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckUserProfileDestroy(ctx), @@ -104,7 +104,7 @@ func testAccUserProfile_tensorboardAppSettings(t *testing.T) { resourceName := "aws_sagemaker_user_profile.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, sagemaker.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckUserProfileDestroy(ctx), @@ -135,7 +135,7 @@ func testAccUserProfile_tensorboardAppSettingsWithImage(t *testing.T) { resourceName := "aws_sagemaker_user_profile.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, sagemaker.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckUserProfileDestroy(ctx), @@ -178,7 +178,7 @@ func testAccUserProfile_kernelGatewayAppSettings(t *testing.T) { resourceName := "aws_sagemaker_user_profile.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, sagemaker.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckUserProfileDestroy(ctx), @@ -209,7 +209,7 @@ func testAccUserProfile_kernelGatewayAppSettings_lifecycleconfig(t *testing.T) { resourceName := "aws_sagemaker_user_profile.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, sagemaker.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckUserProfileDestroy(ctx), @@ -247,7 +247,7 @@ func testAccUserProfile_kernelGatewayAppSettings_imageconfig(t *testing.T) { baseImage := os.Getenv("SAGEMAKER_IMAGE_VERSION_BASE_IMAGE") resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, sagemaker.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckUserProfileDestroy(ctx), @@ -280,7 +280,7 @@ func testAccUserProfile_jupyterServerAppSettings(t *testing.T) { resourceName := "aws_sagemaker_user_profile.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, sagemaker.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckUserProfileDestroy(ctx), @@ -311,7 +311,7 @@ func testAccUserProfile_disappears(t *testing.T) { resourceName := "aws_sagemaker_user_profile.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, sagemaker.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckUserProfileDestroy(ctx), diff --git a/internal/service/sagemaker/workforce_test.go b/internal/service/sagemaker/workforce_test.go index 114de24ba61d..9d6d07b019b7 100644 --- a/internal/service/sagemaker/workforce_test.go +++ b/internal/service/sagemaker/workforce_test.go @@ -23,7 +23,7 @@ func testAccWorkforce_cognitoConfig(t *testing.T) { resourceName := "aws_sagemaker_workforce.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, sagemaker.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckWorkforceDestroy(ctx), @@ -62,7 +62,7 @@ func testAccWorkforce_oidcConfig(t *testing.T) { endpoint2 := "https://test.example.com" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, sagemaker.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckWorkforceDestroy(ctx), @@ -126,7 +126,7 @@ func testAccWorkforce_sourceIPConfig(t *testing.T) { resourceName := "aws_sagemaker_workforce.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, sagemaker.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckWorkforceDestroy(ctx), @@ -174,7 +174,7 @@ func testAccWorkforce_vpc(t *testing.T) { resourceName := "aws_sagemaker_workforce.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, sagemaker.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckWorkforceDestroy(ctx), @@ -211,7 +211,7 @@ func testAccWorkforce_disappears(t *testing.T) { resourceName := "aws_sagemaker_workforce.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, sagemaker.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckWorkforceDestroy(ctx), diff --git a/internal/service/sagemaker/workteam_test.go b/internal/service/sagemaker/workteam_test.go index 139aa3da4127..0d62a2e4bbb9 100644 --- a/internal/service/sagemaker/workteam_test.go +++ b/internal/service/sagemaker/workteam_test.go @@ -23,7 +23,7 @@ func testAccWorkteam_cognitoConfig(t *testing.T) { resourceName := "aws_sagemaker_workteam.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, sagemaker.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckWorkteamDestroy(ctx), @@ -95,7 +95,7 @@ func testAccWorkteam_oidcConfig(t *testing.T) { resourceName := "aws_sagemaker_workteam.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, sagemaker.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckWorkteamDestroy(ctx), @@ -153,7 +153,7 @@ func testAccWorkteam_tags(t *testing.T) { resourceName := "aws_sagemaker_workteam.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, sagemaker.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckWorkteamDestroy(ctx), @@ -200,7 +200,7 @@ func testAccWorkteam_notificationConfig(t *testing.T) { resourceName := "aws_sagemaker_workteam.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, sagemaker.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckWorkteamDestroy(ctx), @@ -254,7 +254,7 @@ func testAccWorkteam_disappears(t *testing.T) { resourceName := "aws_sagemaker_workteam.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, sagemaker.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckWorkteamDestroy(ctx), From 69d8dbd004e107d6788257a2605e3d129e187036 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Fri, 24 Feb 2023 16:37:25 -0500 Subject: [PATCH 230/763] Add 'Context' argument to 'acctest.PreCheck' for scheduler. --- .../service/scheduler/schedule_group_test.go | 10 ++-- internal/service/scheduler/schedule_test.go | 46 +++++++++---------- 2 files changed, 28 insertions(+), 28 deletions(-) diff --git a/internal/service/scheduler/schedule_group_test.go b/internal/service/scheduler/schedule_group_test.go index 73b040d1ecff..2fe479713ff7 100644 --- a/internal/service/scheduler/schedule_group_test.go +++ b/internal/service/scheduler/schedule_group_test.go @@ -29,7 +29,7 @@ func TestAccSchedulerScheduleGroup_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(names.SchedulerEndpointID, t) testAccPreCheck(ctx, t) }, @@ -78,7 +78,7 @@ func TestAccSchedulerScheduleGroup_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(names.SchedulerEndpointID, t) testAccPreCheck(ctx, t) }, @@ -105,7 +105,7 @@ func TestAccSchedulerScheduleGroup_nameGenerated(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(names.SchedulerEndpointID, t) testAccPreCheck(ctx, t) }, @@ -137,7 +137,7 @@ func TestAccSchedulerScheduleGroup_namePrefix(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(names.SchedulerEndpointID, t) testAccPreCheck(ctx, t) }, @@ -170,7 +170,7 @@ func TestAccSchedulerScheduleGroup_tags(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(names.SchedulerEndpointID, t) testAccPreCheck(ctx, t) }, diff --git a/internal/service/scheduler/schedule_test.go b/internal/service/scheduler/schedule_test.go index cb14394db9d4..fecc7b50439a 100644 --- a/internal/service/scheduler/schedule_test.go +++ b/internal/service/scheduler/schedule_test.go @@ -185,7 +185,7 @@ func TestAccSchedulerSchedule_basic(t *testing.T) { acctest.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(names.SchedulerEndpointID, t) testAccPreCheck(ctx, t) }, @@ -244,7 +244,7 @@ func TestAccSchedulerSchedule_disappears(t *testing.T) { acctest.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(names.SchedulerEndpointID, t) testAccPreCheck(ctx, t) }, @@ -276,7 +276,7 @@ func TestAccSchedulerSchedule_description(t *testing.T) { acctest.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(names.SchedulerEndpointID, t) testAccPreCheck(ctx, t) }, @@ -336,7 +336,7 @@ func TestAccSchedulerSchedule_endDate(t *testing.T) { acctest.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(names.SchedulerEndpointID, t) testAccPreCheck(ctx, t) }, @@ -396,7 +396,7 @@ func TestAccSchedulerSchedule_flexibleTimeWindow(t *testing.T) { acctest.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(names.SchedulerEndpointID, t) testAccPreCheck(ctx, t) }, @@ -459,7 +459,7 @@ func TestAccSchedulerSchedule_groupName(t *testing.T) { acctest.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(names.SchedulerEndpointID, t) testAccPreCheck(ctx, t) }, @@ -495,7 +495,7 @@ func TestAccSchedulerSchedule_kmsKeyARN(t *testing.T) { acctest.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(names.SchedulerEndpointID, t) testAccPreCheck(ctx, t) }, @@ -554,7 +554,7 @@ func TestAccSchedulerSchedule_nameGenerated(t *testing.T) { acctest.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(names.SchedulerEndpointID, t) testAccPreCheck(ctx, t) }, @@ -590,7 +590,7 @@ func TestAccSchedulerSchedule_namePrefix(t *testing.T) { acctest.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(names.SchedulerEndpointID, t) testAccPreCheck(ctx, t) }, @@ -627,7 +627,7 @@ func TestAccSchedulerSchedule_scheduleExpression(t *testing.T) { acctest.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(names.SchedulerEndpointID, t) testAccPreCheck(ctx, t) }, @@ -675,7 +675,7 @@ func TestAccSchedulerSchedule_scheduleExpressionTimezone(t *testing.T) { acctest.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(names.SchedulerEndpointID, t) testAccPreCheck(ctx, t) }, @@ -735,7 +735,7 @@ func TestAccSchedulerSchedule_startDate(t *testing.T) { acctest.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(names.SchedulerEndpointID, t) testAccPreCheck(ctx, t) }, @@ -795,7 +795,7 @@ func TestAccSchedulerSchedule_state(t *testing.T) { acctest.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(names.SchedulerEndpointID, t) testAccPreCheck(ctx, t) }, @@ -855,7 +855,7 @@ func TestAccSchedulerSchedule_targetARN(t *testing.T) { acctest.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(names.SchedulerEndpointID, t) testAccPreCheck(ctx, t) }, @@ -903,7 +903,7 @@ func TestAccSchedulerSchedule_targetDeadLetterConfig(t *testing.T) { acctest.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(names.SchedulerEndpointID, t) testAccPreCheck(ctx, t) }, @@ -963,7 +963,7 @@ func TestAccSchedulerSchedule_targetECSParameters(t *testing.T) { acctest.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(names.SchedulerEndpointID, t) testAccPreCheck(ctx, t) }, @@ -1139,7 +1139,7 @@ func TestAccSchedulerSchedule_targetEventBridgeParameters(t *testing.T) { acctest.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(names.SchedulerEndpointID, t) testAccPreCheck(ctx, t) }, @@ -1202,7 +1202,7 @@ func TestAccSchedulerSchedule_targetInput(t *testing.T) { acctest.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(names.SchedulerEndpointID, t) testAccPreCheck(ctx, t) }, @@ -1267,7 +1267,7 @@ func TestAccSchedulerSchedule_targetKinesisParameters(t *testing.T) { acctest.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(names.SchedulerEndpointID, t) testAccPreCheck(ctx, t) }, @@ -1327,7 +1327,7 @@ func TestAccSchedulerSchedule_targetRetryPolicy(t *testing.T) { acctest.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(names.SchedulerEndpointID, t) testAccPreCheck(ctx, t) }, @@ -1390,7 +1390,7 @@ func TestAccSchedulerSchedule_targetRoleARN(t *testing.T) { acctest.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(names.SchedulerEndpointID, t) testAccPreCheck(ctx, t) }, @@ -1438,7 +1438,7 @@ func TestAccSchedulerSchedule_targetSageMakerPipelineParameters(t *testing.T) { acctest.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(names.SchedulerEndpointID, t) testAccPreCheck(ctx, t) }, @@ -1534,7 +1534,7 @@ func TestAccSchedulerSchedule_targetSQSParameters(t *testing.T) { acctest.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(names.SchedulerEndpointID, t) testAccPreCheck(ctx, t) }, From e9da283544a47503020ba695fda0c63185223ec3 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Fri, 24 Feb 2023 16:37:25 -0500 Subject: [PATCH 231/763] Add 'Context' argument to 'acctest.PreCheck' for schemas. --- internal/service/schemas/discoverer_test.go | 8 ++++---- internal/service/schemas/registry_policy_test.go | 8 ++++---- internal/service/schemas/registry_test.go | 8 ++++---- internal/service/schemas/schema_test.go | 8 ++++---- 4 files changed, 16 insertions(+), 16 deletions(-) diff --git a/internal/service/schemas/discoverer_test.go b/internal/service/schemas/discoverer_test.go index 6ad4293a90e3..4b8d532ab16e 100644 --- a/internal/service/schemas/discoverer_test.go +++ b/internal/service/schemas/discoverer_test.go @@ -22,7 +22,7 @@ func TestAccSchemasDiscoverer_basic(t *testing.T) { resourceName := "aws_schemas_discoverer.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(schemas.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(schemas.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, schemas.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDiscovererDestroy(ctx), @@ -52,7 +52,7 @@ func TestAccSchemasDiscoverer_disappears(t *testing.T) { resourceName := "aws_schemas_discoverer.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(schemas.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(schemas.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, schemas.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDiscovererDestroy(ctx), @@ -76,7 +76,7 @@ func TestAccSchemasDiscoverer_description(t *testing.T) { resourceName := "aws_schemas_discoverer.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(schemas.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(schemas.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, schemas.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDiscovererDestroy(ctx), @@ -118,7 +118,7 @@ func TestAccSchemasDiscoverer_tags(t *testing.T) { resourceName := "aws_schemas_discoverer.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(schemas.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(schemas.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, schemas.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDiscovererDestroy(ctx), diff --git a/internal/service/schemas/registry_policy_test.go b/internal/service/schemas/registry_policy_test.go index f7e1600cafe2..89070c4fee6f 100644 --- a/internal/service/schemas/registry_policy_test.go +++ b/internal/service/schemas/registry_policy_test.go @@ -23,7 +23,7 @@ func TestAccSchemasRegistryPolicy_basic(t *testing.T) { resourceName := "aws_schemas_registry_policy.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(schemas.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(schemas.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, schemas.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRegistryPolicyDestroy(ctx), @@ -49,7 +49,7 @@ func TestAccSchemasRegistryPolicy_disappears(t *testing.T) { resourceName := "aws_schemas_registry_policy.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(schemas.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(schemas.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, schemas.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRegistryPolicyDestroy(ctx), @@ -73,7 +73,7 @@ func TestAccSchemasRegistryPolicy_disappears_Registry(t *testing.T) { resourceName := "aws_schemas_registry_policy.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(schemas.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(schemas.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, schemas.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRegistryPolicyDestroy(ctx), @@ -96,7 +96,7 @@ func TestAccSchemasRegistryPolicy_Policy(t *testing.T) { resourceName := "aws_schemas_registry_policy.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(schemas.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(schemas.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, schemas.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRegistryPolicyDestroy(ctx), diff --git a/internal/service/schemas/registry_test.go b/internal/service/schemas/registry_test.go index 2f1cf286d9dd..9f267f62f34a 100644 --- a/internal/service/schemas/registry_test.go +++ b/internal/service/schemas/registry_test.go @@ -22,7 +22,7 @@ func TestAccSchemasRegistry_basic(t *testing.T) { resourceName := "aws_schemas_registry.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(schemas.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(schemas.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, schemas.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRegistryDestroy(ctx), @@ -53,7 +53,7 @@ func TestAccSchemasRegistry_disappears(t *testing.T) { resourceName := "aws_schemas_registry.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(schemas.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(schemas.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, schemas.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRegistryDestroy(ctx), @@ -77,7 +77,7 @@ func TestAccSchemasRegistry_description(t *testing.T) { resourceName := "aws_schemas_registry.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(schemas.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(schemas.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, schemas.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRegistryDestroy(ctx), @@ -119,7 +119,7 @@ func TestAccSchemasRegistry_tags(t *testing.T) { resourceName := "aws_schemas_registry.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(schemas.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(schemas.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, schemas.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRegistryDestroy(ctx), diff --git a/internal/service/schemas/schema_test.go b/internal/service/schemas/schema_test.go index 54ba2fedaf77..8269f8c26555 100644 --- a/internal/service/schemas/schema_test.go +++ b/internal/service/schemas/schema_test.go @@ -74,7 +74,7 @@ func TestAccSchemasSchema_basic(t *testing.T) { resourceName := "aws_schemas_schema.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(schemas.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(schemas.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, schemas.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSchemaDestroy(ctx), @@ -111,7 +111,7 @@ func TestAccSchemasSchema_disappears(t *testing.T) { resourceName := "aws_schemas_schema.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(schemas.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(schemas.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, schemas.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSchemaDestroy(ctx), @@ -135,7 +135,7 @@ func TestAccSchemasSchema_contentDescription(t *testing.T) { resourceName := "aws_schemas_schema.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(schemas.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(schemas.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, schemas.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSchemaDestroy(ctx), @@ -182,7 +182,7 @@ func TestAccSchemasSchema_tags(t *testing.T) { resourceName := "aws_schemas_schema.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(schemas.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(schemas.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, schemas.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSchemaDestroy(ctx), From d08265b3cf6c290f6f8e32864381387482c05013 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Fri, 24 Feb 2023 16:37:25 -0500 Subject: [PATCH 232/763] Add 'Context' argument to 'acctest.PreCheck' for secretsmanager. --- .../random_password_data_source_test.go | 4 ++-- .../secretsmanager/secret_data_source_test.go | 8 +++---- .../secretsmanager/secret_policy_test.go | 6 ++--- .../secret_rotation_data_source_test.go | 2 +- .../secretsmanager/secret_rotation_test.go | 2 +- .../service/secretsmanager/secret_test.go | 22 +++++++++---------- .../secret_version_data_source_test.go | 6 ++--- .../secretsmanager/secret_version_test.go | 6 ++--- .../secrets_data_source_test.go | 2 +- 9 files changed, 29 insertions(+), 29 deletions(-) diff --git a/internal/service/secretsmanager/random_password_data_source_test.go b/internal/service/secretsmanager/random_password_data_source_test.go index 6fe1ab0d3e6a..3d0b3243f36c 100644 --- a/internal/service/secretsmanager/random_password_data_source_test.go +++ b/internal/service/secretsmanager/random_password_data_source_test.go @@ -16,7 +16,7 @@ func TestAccSecretsManagerRandomPasswordDataSource_basic(t *testing.T) { datasourceName := "data.aws_secretsmanager_random_password.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, secretsmanager.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ @@ -35,7 +35,7 @@ func TestAccSecretsManagerRandomPasswordDataSource_exclude(t *testing.T) { datasourceName := "data.aws_secretsmanager_random_password.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, secretsmanager.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ diff --git a/internal/service/secretsmanager/secret_data_source_test.go b/internal/service/secretsmanager/secret_data_source_test.go index 7e02abf9b005..6b9f3e5fd45a 100644 --- a/internal/service/secretsmanager/secret_data_source_test.go +++ b/internal/service/secretsmanager/secret_data_source_test.go @@ -15,7 +15,7 @@ import ( func TestAccSecretsManagerSecretDataSource_basic(t *testing.T) { ctx := acctest.Context(t) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, secretsmanager.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ @@ -42,7 +42,7 @@ func TestAccSecretsManagerSecretDataSource_arn(t *testing.T) { datasourceName := "data.aws_secretsmanager_secret.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, secretsmanager.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ @@ -63,7 +63,7 @@ func TestAccSecretsManagerSecretDataSource_name(t *testing.T) { datasourceName := "data.aws_secretsmanager_secret.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, secretsmanager.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ @@ -84,7 +84,7 @@ func TestAccSecretsManagerSecretDataSource_policy(t *testing.T) { datasourceName := "data.aws_secretsmanager_secret.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, secretsmanager.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ diff --git a/internal/service/secretsmanager/secret_policy_test.go b/internal/service/secretsmanager/secret_policy_test.go index 1f458600f897..6442dbf77fea 100644 --- a/internal/service/secretsmanager/secret_policy_test.go +++ b/internal/service/secretsmanager/secret_policy_test.go @@ -25,7 +25,7 @@ func TestAccSecretsManagerSecretPolicy_basic(t *testing.T) { resourceName := "aws_secretsmanager_secret_policy.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, secretsmanager.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSecretPolicyDestroy(ctx), @@ -63,7 +63,7 @@ func TestAccSecretsManagerSecretPolicy_blockPublicPolicy(t *testing.T) { resourceName := "aws_secretsmanager_secret_policy.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, secretsmanager.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSecretPolicyDestroy(ctx), @@ -106,7 +106,7 @@ func TestAccSecretsManagerSecretPolicy_disappears(t *testing.T) { resourceName := "aws_secretsmanager_secret_policy.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, secretsmanager.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSecretPolicyDestroy(ctx), diff --git a/internal/service/secretsmanager/secret_rotation_data_source_test.go b/internal/service/secretsmanager/secret_rotation_data_source_test.go index 589bd81dc732..844dba8e1177 100644 --- a/internal/service/secretsmanager/secret_rotation_data_source_test.go +++ b/internal/service/secretsmanager/secret_rotation_data_source_test.go @@ -18,7 +18,7 @@ func TestAccSecretsManagerSecretRotationDataSource_basic(t *testing.T) { datasourceName := "data.aws_secretsmanager_secret_rotation.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, secretsmanager.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ diff --git a/internal/service/secretsmanager/secret_rotation_test.go b/internal/service/secretsmanager/secret_rotation_test.go index cf1979670cbf..7420743341ce 100644 --- a/internal/service/secretsmanager/secret_rotation_test.go +++ b/internal/service/secretsmanager/secret_rotation_test.go @@ -23,7 +23,7 @@ func TestAccSecretsManagerSecretRotation_basic(t *testing.T) { lambdaFunctionResourceName := "aws_lambda_function.test1" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, secretsmanager.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSecretRotationDestroy(ctx), diff --git a/internal/service/secretsmanager/secret_test.go b/internal/service/secretsmanager/secret_test.go index 3b9df31a2cfc..0a611c207e49 100644 --- a/internal/service/secretsmanager/secret_test.go +++ b/internal/service/secretsmanager/secret_test.go @@ -23,7 +23,7 @@ func TestAccSecretsManagerSecret_basic(t *testing.T) { resourceName := "aws_secretsmanager_secret.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, secretsmanager.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSecretDestroy(ctx), @@ -61,7 +61,7 @@ func TestAccSecretsManagerSecret_withNamePrefix(t *testing.T) { resourceName := "aws_secretsmanager_secret.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, secretsmanager.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSecretDestroy(ctx), @@ -91,7 +91,7 @@ func TestAccSecretsManagerSecret_description(t *testing.T) { resourceName := "aws_secretsmanager_secret.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, secretsmanager.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSecretDestroy(ctx), @@ -127,7 +127,7 @@ func TestAccSecretsManagerSecret_basicReplica(t *testing.T) { resourceName := "aws_secretsmanager_secret.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t); acctest.PreCheckMultipleRegion(t, 2) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t); acctest.PreCheckMultipleRegion(t, 2) }, ErrorCheck: acctest.ErrorCheck(t, secretsmanager.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5FactoriesMultipleRegions(ctx, t, 2), CheckDestroy: testAccCheckSecretDestroy(ctx), @@ -151,7 +151,7 @@ func TestAccSecretsManagerSecret_overwriteReplica(t *testing.T) { resourceName := "aws_secretsmanager_secret.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t); acctest.PreCheckMultipleRegion(t, 3) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t); acctest.PreCheckMultipleRegion(t, 3) }, ErrorCheck: acctest.ErrorCheck(t, secretsmanager.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5FactoriesMultipleRegions(ctx, t, 3), CheckDestroy: testAccCheckSecretDestroy(ctx), @@ -188,7 +188,7 @@ func TestAccSecretsManagerSecret_kmsKeyID(t *testing.T) { resourceName := "aws_secretsmanager_secret.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, secretsmanager.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSecretDestroy(ctx), @@ -224,7 +224,7 @@ func TestAccSecretsManagerSecret_RecoveryWindowInDays_recreate(t *testing.T) { resourceName := "aws_secretsmanager_secret.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, secretsmanager.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSecretDestroy(ctx), @@ -262,7 +262,7 @@ func TestAccSecretsManagerSecret_rotationLambdaARN(t *testing.T) { lambdaFunctionResourceName := "aws_lambda_function.test1" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, secretsmanager.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSecretDestroy(ctx), @@ -315,7 +315,7 @@ func TestAccSecretsManagerSecret_rotationRules(t *testing.T) { resourceName := "aws_secretsmanager_secret.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, secretsmanager.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSecretDestroy(ctx), @@ -370,7 +370,7 @@ func TestAccSecretsManagerSecret_tags(t *testing.T) { resourceName := "aws_secretsmanager_secret.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, secretsmanager.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSecretDestroy(ctx), @@ -425,7 +425,7 @@ func TestAccSecretsManagerSecret_policy(t *testing.T) { resourceName := "aws_secretsmanager_secret.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, secretsmanager.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSecretDestroy(ctx), diff --git a/internal/service/secretsmanager/secret_version_data_source_test.go b/internal/service/secretsmanager/secret_version_data_source_test.go index ae8aa1b6dbed..a837725aa68e 100644 --- a/internal/service/secretsmanager/secret_version_data_source_test.go +++ b/internal/service/secretsmanager/secret_version_data_source_test.go @@ -19,7 +19,7 @@ func TestAccSecretsManagerSecretVersionDataSource_basic(t *testing.T) { datasourceName := "data.aws_secretsmanager_secret_version.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, secretsmanager.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ @@ -44,7 +44,7 @@ func TestAccSecretsManagerSecretVersionDataSource_versionID(t *testing.T) { datasourceName := "data.aws_secretsmanager_secret_version.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, secretsmanager.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ @@ -65,7 +65,7 @@ func TestAccSecretsManagerSecretVersionDataSource_versionStage(t *testing.T) { datasourceName := "data.aws_secretsmanager_secret_version.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, secretsmanager.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ diff --git a/internal/service/secretsmanager/secret_version_test.go b/internal/service/secretsmanager/secret_version_test.go index 8fc96657fff5..6977b5423c8e 100644 --- a/internal/service/secretsmanager/secret_version_test.go +++ b/internal/service/secretsmanager/secret_version_test.go @@ -25,7 +25,7 @@ func TestAccSecretsManagerSecretVersion_basicString(t *testing.T) { secretResourceName := "aws_secretsmanager_secret.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, secretsmanager.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSecretVersionDestroy(ctx), @@ -58,7 +58,7 @@ func TestAccSecretsManagerSecretVersion_base64Binary(t *testing.T) { secretResourceName := "aws_secretsmanager_secret.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, secretsmanager.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSecretVersionDestroy(ctx), @@ -90,7 +90,7 @@ func TestAccSecretsManagerSecretVersion_versionStages(t *testing.T) { resourceName := "aws_secretsmanager_secret_version.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, secretsmanager.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSecretVersionDestroy(ctx), diff --git a/internal/service/secretsmanager/secrets_data_source_test.go b/internal/service/secretsmanager/secrets_data_source_test.go index 94dc7b514787..d6ad3802f095 100644 --- a/internal/service/secretsmanager/secrets_data_source_test.go +++ b/internal/service/secretsmanager/secrets_data_source_test.go @@ -28,7 +28,7 @@ func TestAccSecretsManagerSecretsDataSource_filter(t *testing.T) { } resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, secretsmanager.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSecretDestroy(ctx), From 1f4671d4af85316b20a11ca4f32d78c9e200556b Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Fri, 24 Feb 2023 16:37:26 -0500 Subject: [PATCH 233/763] Add 'Context' argument to 'acctest.PreCheck' for securityhub. --- internal/service/securityhub/account_test.go | 2 +- .../service/securityhub/action_target_test.go | 8 +++---- .../securityhub/finding_aggregator_test.go | 4 ++-- internal/service/securityhub/insight_test.go | 22 +++++++++---------- .../securityhub/invite_accepter_test.go | 2 +- internal/service/securityhub/member_test.go | 4 ++-- .../organization_admin_account_test.go | 6 ++--- .../organization_configuration_test.go | 2 +- .../securityhub/product_subscription_test.go | 2 +- .../securityhub/standards_control_test.go | 6 ++--- .../standards_subscription_test.go | 4 ++-- 11 files changed, 31 insertions(+), 31 deletions(-) diff --git a/internal/service/securityhub/account_test.go b/internal/service/securityhub/account_test.go index 8957c655e33c..467368978d30 100644 --- a/internal/service/securityhub/account_test.go +++ b/internal/service/securityhub/account_test.go @@ -16,7 +16,7 @@ import ( func testAccAccount_basic(t *testing.T) { ctx := acctest.Context(t) resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, securityhub.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckAccountDestroy(ctx), diff --git a/internal/service/securityhub/action_target_test.go b/internal/service/securityhub/action_target_test.go index 8442fe595be5..5350b9b725ac 100644 --- a/internal/service/securityhub/action_target_test.go +++ b/internal/service/securityhub/action_target_test.go @@ -19,7 +19,7 @@ func testAccActionTarget_basic(t *testing.T) { resourceName := "aws_securityhub_action_target.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, securityhub.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckActionTargetDestroy(ctx), @@ -48,7 +48,7 @@ func testAccActionTarget_disappears(t *testing.T) { resourceName := "aws_securityhub_action_target.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, securityhub.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckActionTargetDestroy(ctx), @@ -70,7 +70,7 @@ func testAccActionTarget_Description(t *testing.T) { resourceName := "aws_securityhub_action_target.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, securityhub.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckActionTargetDestroy(ctx), @@ -103,7 +103,7 @@ func testAccActionTarget_Name(t *testing.T) { resourceName := "aws_securityhub_action_target.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, securityhub.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckActionTargetDestroy(ctx), diff --git a/internal/service/securityhub/finding_aggregator_test.go b/internal/service/securityhub/finding_aggregator_test.go index 798e77e5b557..664a738d3052 100644 --- a/internal/service/securityhub/finding_aggregator_test.go +++ b/internal/service/securityhub/finding_aggregator_test.go @@ -20,7 +20,7 @@ func testAccFindingAggregator_basic(t *testing.T) { resourceName := "aws_securityhub_finding_aggregator.test_aggregator" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, securityhub.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckFindingAggregatorDestroy(ctx), @@ -63,7 +63,7 @@ func testAccFindingAggregator_disappears(t *testing.T) { resourceName := "aws_securityhub_finding_aggregator.test_aggregator" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, securityhub.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckFindingAggregatorDestroy(ctx), diff --git a/internal/service/securityhub/insight_test.go b/internal/service/securityhub/insight_test.go index d314600ab099..ef0f541f165d 100644 --- a/internal/service/securityhub/insight_test.go +++ b/internal/service/securityhub/insight_test.go @@ -23,7 +23,7 @@ func testAccInsight_basic(t *testing.T) { resourceName := "aws_securityhub_insight.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, securityhub.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckInsightDestroy(ctx), @@ -58,7 +58,7 @@ func testAccInsight_disappears(t *testing.T) { resourceName := "aws_securityhub_insight.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, securityhub.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckInsightDestroy(ctx), @@ -84,7 +84,7 @@ func testAccInsight_DateFilters(t *testing.T) { startDate := time.Now().Format(time.RFC1123) resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, securityhub.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckInsightDestroy(ctx), @@ -134,7 +134,7 @@ func testAccInsight_IPFilters(t *testing.T) { resourceName := "aws_securityhub_insight.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, securityhub.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckInsightDestroy(ctx), @@ -165,7 +165,7 @@ func testAccInsight_KeywordFilters(t *testing.T) { resourceName := "aws_securityhub_insight.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, securityhub.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckInsightDestroy(ctx), @@ -196,7 +196,7 @@ func testAccInsight_MapFilters(t *testing.T) { resourceName := "aws_securityhub_insight.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, securityhub.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckInsightDestroy(ctx), @@ -229,7 +229,7 @@ func testAccInsight_MultipleFilters(t *testing.T) { resourceName := "aws_securityhub_insight.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, securityhub.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckInsightDestroy(ctx), @@ -290,7 +290,7 @@ func testAccInsight_Name(t *testing.T) { resourceName := "aws_securityhub_insight.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, securityhub.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckInsightDestroy(ctx), @@ -326,7 +326,7 @@ func testAccInsight_NumberFilters(t *testing.T) { resourceName := "aws_securityhub_insight.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, securityhub.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckInsightDestroy(ctx), @@ -384,7 +384,7 @@ func testAccInsight_GroupByAttribute(t *testing.T) { resourceName := "aws_securityhub_insight.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, securityhub.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckInsightDestroy(ctx), @@ -420,7 +420,7 @@ func testAccInsight_WorkflowStatus(t *testing.T) { resourceName := "aws_securityhub_insight.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, securityhub.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckInsightDestroy(ctx), diff --git a/internal/service/securityhub/invite_accepter_test.go b/internal/service/securityhub/invite_accepter_test.go index 0e2d18655ad6..72079f399061 100644 --- a/internal/service/securityhub/invite_accepter_test.go +++ b/internal/service/securityhub/invite_accepter_test.go @@ -20,7 +20,7 @@ func testAccInviteAccepter_basic(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckAlternateAccount(t) }, ErrorCheck: acctest.ErrorCheck(t, securityhub.EndpointsID), diff --git a/internal/service/securityhub/member_test.go b/internal/service/securityhub/member_test.go index 6cd392f3d4f7..25ed9de056ba 100644 --- a/internal/service/securityhub/member_test.go +++ b/internal/service/securityhub/member_test.go @@ -21,7 +21,7 @@ func testAccMember_basic(t *testing.T) { resourceName := "aws_securityhub_member.example" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, securityhub.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckMemberDestroy(ctx), @@ -47,7 +47,7 @@ func testAccMember_invite(t *testing.T) { resourceName := "aws_securityhub_member.example" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, securityhub.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckMemberDestroy(ctx), diff --git a/internal/service/securityhub/organization_admin_account_test.go b/internal/service/securityhub/organization_admin_account_test.go index 71bd0b7c1ee5..910f60885d6e 100644 --- a/internal/service/securityhub/organization_admin_account_test.go +++ b/internal/service/securityhub/organization_admin_account_test.go @@ -20,7 +20,7 @@ func testAccOrganizationAdminAccount_basic(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckOrganizationsAccount(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, securityhub.EndpointsID), @@ -49,7 +49,7 @@ func testAccOrganizationAdminAccount_disappears(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckOrganizationsAccount(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, securityhub.EndpointsID), @@ -76,7 +76,7 @@ func testAccOrganizationAdminAccount_MultiRegion(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckOrganizationsAccount(ctx, t) acctest.PreCheckMultipleRegion(t, 3) }, diff --git a/internal/service/securityhub/organization_configuration_test.go b/internal/service/securityhub/organization_configuration_test.go index 39dee17236d6..766066fb618c 100644 --- a/internal/service/securityhub/organization_configuration_test.go +++ b/internal/service/securityhub/organization_configuration_test.go @@ -17,7 +17,7 @@ func testAccOrganizationConfiguration_basic(t *testing.T) { resourceName := "aws_securityhub_organization_configuration.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckOrganizationsAccount(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckOrganizationsAccount(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, securityhub.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: nil, //lintignore:AT001 diff --git a/internal/service/securityhub/product_subscription_test.go b/internal/service/securityhub/product_subscription_test.go index 0831d438ef5b..1d3bce9d63d4 100644 --- a/internal/service/securityhub/product_subscription_test.go +++ b/internal/service/securityhub/product_subscription_test.go @@ -18,7 +18,7 @@ import ( func testAccProductSubscription_basic(t *testing.T) { ctx := acctest.Context(t) resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, securityhub.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckAccountDestroy(ctx), diff --git a/internal/service/securityhub/standards_control_test.go b/internal/service/securityhub/standards_control_test.go index d12cd1279c03..159f1b2f27b1 100644 --- a/internal/service/securityhub/standards_control_test.go +++ b/internal/service/securityhub/standards_control_test.go @@ -20,7 +20,7 @@ func testAccStandardsControl_basic(t *testing.T) { resourceName := "aws_securityhub_standards_control.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, securityhub.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: nil, //lintignore:AT001 @@ -50,7 +50,7 @@ func testAccStandardsControl_disabledControlStatus(t *testing.T) { resourceName := "aws_securityhub_standards_control.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, securityhub.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: nil, //lintignore:AT001 @@ -69,7 +69,7 @@ func testAccStandardsControl_disabledControlStatus(t *testing.T) { func testAccStandardsControl_enabledControlStatusAndDisabledReason(t *testing.T) { resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, securityhub.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: nil, //lintignore:AT001 diff --git a/internal/service/securityhub/standards_subscription_test.go b/internal/service/securityhub/standards_subscription_test.go index 36083a91e0fb..bb3915f6d8f6 100644 --- a/internal/service/securityhub/standards_subscription_test.go +++ b/internal/service/securityhub/standards_subscription_test.go @@ -21,7 +21,7 @@ func testAccStandardsSubscription_basic(t *testing.T) { resourceName := "aws_securityhub_standards_subscription.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, securityhub.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckStandardsSubscriptionDestroy(ctx), @@ -47,7 +47,7 @@ func testAccStandardsSubscription_disappears(t *testing.T) { resourceName := "aws_securityhub_standards_subscription.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, securityhub.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckStandardsSubscriptionDestroy(ctx), From 4f3d0a4cd221c31d93be78f4ab765bf3bf0f7a5b Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Fri, 24 Feb 2023 16:37:26 -0500 Subject: [PATCH 234/763] Add 'Context' argument to 'acctest.PreCheck' for serverlessrepo. --- .../serverlessrepo/application_data_source_test.go | 4 ++-- .../serverlessrepo/cloudformation_stack_test.go | 12 ++++++------ 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/internal/service/serverlessrepo/application_data_source_test.go b/internal/service/serverlessrepo/application_data_source_test.go index a14f6ed7dbbe..2ed07b6172ea 100644 --- a/internal/service/serverlessrepo/application_data_source_test.go +++ b/internal/service/serverlessrepo/application_data_source_test.go @@ -16,7 +16,7 @@ func TestAccServerlessRepoApplicationDataSource_basic(t *testing.T) { appARN := testAccCloudFormationApplicationID() resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, serverlessapplicationrepository.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ @@ -49,7 +49,7 @@ func TestAccServerlessRepoApplicationDataSource_versioned(t *testing.T) { ) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, serverlessapplicationrepository.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ diff --git a/internal/service/serverlessrepo/cloudformation_stack_test.go b/internal/service/serverlessrepo/cloudformation_stack_test.go index 5899600ac467..bb826729b78f 100644 --- a/internal/service/serverlessrepo/cloudformation_stack_test.go +++ b/internal/service/serverlessrepo/cloudformation_stack_test.go @@ -32,7 +32,7 @@ func TestAccServerlessRepoCloudFormationStack_basic(t *testing.T) { resourceName := "aws_serverlessapplicationrepository_cloudformation_stack.postgres-rotator" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, serverlessrepo.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckCloudFormationDestroy(ctx), @@ -84,7 +84,7 @@ func TestAccServerlessRepoCloudFormationStack_disappears(t *testing.T) { resourceName := "aws_serverlessapplicationrepository_cloudformation_stack.postgres-rotator" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, serverlessrepo.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckAMIDestroy(ctx), @@ -114,7 +114,7 @@ func TestAccServerlessRepoCloudFormationStack_versioned(t *testing.T) { ) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, serverlessrepo.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckCloudFormationDestroy(ctx), @@ -171,7 +171,7 @@ func TestAccServerlessRepoCloudFormationStack_paired(t *testing.T) { const version = "1.1.36" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, serverlessrepo.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckCloudFormationDestroy(ctx), @@ -198,7 +198,7 @@ func TestAccServerlessRepoCloudFormationStack_tags(t *testing.T) { resourceName := "aws_serverlessapplicationrepository_cloudformation_stack.postgres-rotator" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, serverlessrepo.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckCloudFormationDestroy(ctx), @@ -246,7 +246,7 @@ func TestAccServerlessRepoCloudFormationStack_update(t *testing.T) { resourceName := "aws_serverlessapplicationrepository_cloudformation_stack.postgres-rotator" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, serverlessrepo.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckCloudFormationDestroy(ctx), From 46c55caf099183dc5d9b81fb6fc104a861d3c324 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Fri, 24 Feb 2023 16:37:26 -0500 Subject: [PATCH 235/763] Add 'Context' argument to 'acctest.PreCheck' for servicecatalog. --- .../budget_resource_association_test.go | 4 ++-- .../servicecatalog/constraint_data_source_test.go | 2 +- internal/service/servicecatalog/constraint_test.go | 6 +++--- .../servicecatalog/launch_paths_data_source_test.go | 2 +- .../servicecatalog/organizations_access_test.go | 2 +- .../portfolio_constraints_data_source_test.go | 2 +- .../servicecatalog/portfolio_data_source_test.go | 2 +- .../service/servicecatalog/portfolio_share_test.go | 8 ++++---- internal/service/servicecatalog/portfolio_test.go | 6 +++--- .../principal_portfolio_association_test.go | 4 ++-- .../servicecatalog/product_data_source_test.go | 4 ++-- .../product_portfolio_association_test.go | 4 ++-- internal/service/servicecatalog/product_test.go | 10 +++++----- .../servicecatalog/provisioned_product_test.go | 12 ++++++------ .../servicecatalog/provisioning_artifact_test.go | 8 ++++---- .../service/servicecatalog/service_action_test.go | 6 +++--- .../tag_option_resource_association_test.go | 4 ++-- internal/service/servicecatalog/tag_option_test.go | 8 ++++---- 18 files changed, 47 insertions(+), 47 deletions(-) diff --git a/internal/service/servicecatalog/budget_resource_association_test.go b/internal/service/servicecatalog/budget_resource_association_test.go index d1a4bad5b288..1e98ce3eec0e 100644 --- a/internal/service/servicecatalog/budget_resource_association_test.go +++ b/internal/service/servicecatalog/budget_resource_association_test.go @@ -23,7 +23,7 @@ func TestAccServiceCatalogBudgetResourceAssociation_basic(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService("budgets", t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService("budgets", t) }, ErrorCheck: acctest.ErrorCheck(t, servicecatalog.EndpointsID, "budgets"), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckBudgetResourceAssociationDestroy(ctx), @@ -51,7 +51,7 @@ func TestAccServiceCatalogBudgetResourceAssociation_disappears(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService("budgets", t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService("budgets", t) }, ErrorCheck: acctest.ErrorCheck(t, servicecatalog.EndpointsID, "budgets"), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckBudgetResourceAssociationDestroy(ctx), diff --git a/internal/service/servicecatalog/constraint_data_source_test.go b/internal/service/servicecatalog/constraint_data_source_test.go index 0f2c158b0149..94ca75d21646 100644 --- a/internal/service/servicecatalog/constraint_data_source_test.go +++ b/internal/service/servicecatalog/constraint_data_source_test.go @@ -16,7 +16,7 @@ func TestAccServiceCatalogConstraintDataSource_basic(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, servicecatalog.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckConstraintDestroy(ctx), diff --git a/internal/service/servicecatalog/constraint_test.go b/internal/service/servicecatalog/constraint_test.go index 7ad320d06f30..292a0c804fa1 100644 --- a/internal/service/servicecatalog/constraint_test.go +++ b/internal/service/servicecatalog/constraint_test.go @@ -24,7 +24,7 @@ func TestAccServiceCatalogConstraint_basic(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, servicecatalog.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckConstraintDestroy(ctx), @@ -58,7 +58,7 @@ func TestAccServiceCatalogConstraint_disappears(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, servicecatalog.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckConstraintDestroy(ctx), @@ -82,7 +82,7 @@ func TestAccServiceCatalogConstraint_update(t *testing.T) { rName2 := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, servicecatalog.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckConstraintDestroy(ctx), diff --git a/internal/service/servicecatalog/launch_paths_data_source_test.go b/internal/service/servicecatalog/launch_paths_data_source_test.go index 91201790c1b1..ff5ef592a676 100644 --- a/internal/service/servicecatalog/launch_paths_data_source_test.go +++ b/internal/service/servicecatalog/launch_paths_data_source_test.go @@ -19,7 +19,7 @@ func TestAccServiceCatalogLaunchPathsDataSource_basic(t *testing.T) { domain := fmt.Sprintf("http://%s", acctest.RandomDomainName()) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, servicecatalog.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ diff --git a/internal/service/servicecatalog/organizations_access_test.go b/internal/service/servicecatalog/organizations_access_test.go index b5e25c8be1b5..e07c5a736e07 100644 --- a/internal/service/servicecatalog/organizations_access_test.go +++ b/internal/service/servicecatalog/organizations_access_test.go @@ -19,7 +19,7 @@ func testAccOrganizationsAccess_basic(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckOrganizationsEnabled(ctx, t) acctest.PreCheckOrganizationManagementAccount(ctx, t) }, diff --git a/internal/service/servicecatalog/portfolio_constraints_data_source_test.go b/internal/service/servicecatalog/portfolio_constraints_data_source_test.go index 7699c6ce7d73..d08bd3583a42 100644 --- a/internal/service/servicecatalog/portfolio_constraints_data_source_test.go +++ b/internal/service/servicecatalog/portfolio_constraints_data_source_test.go @@ -15,7 +15,7 @@ func TestAccServiceCatalogPortfolioConstraintsDataSource_Constraint_basic(t *tes rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, servicecatalog.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ diff --git a/internal/service/servicecatalog/portfolio_data_source_test.go b/internal/service/servicecatalog/portfolio_data_source_test.go index 9e6319bbc49c..651b8a9dfeae 100644 --- a/internal/service/servicecatalog/portfolio_data_source_test.go +++ b/internal/service/servicecatalog/portfolio_data_source_test.go @@ -16,7 +16,7 @@ func TestAccServiceCatalogPortfolioDataSource_basic(t *testing.T) { resourceName := "aws_servicecatalog_portfolio.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, servicecatalog.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckServiceCatlaogPortfolioDestroy(ctx), diff --git a/internal/service/servicecatalog/portfolio_share_test.go b/internal/service/servicecatalog/portfolio_share_test.go index 5bc590613afb..3d3a3694624c 100644 --- a/internal/service/servicecatalog/portfolio_share_test.go +++ b/internal/service/servicecatalog/portfolio_share_test.go @@ -24,7 +24,7 @@ func testAccPortfolioShare_basic(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckAlternateAccount(t) acctest.PreCheckPartitionHasService(servicecatalog.EndpointsID, t) }, @@ -77,7 +77,7 @@ func testAccPortfolioShare_sharePrincipals(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckOrganizationsEnabled(ctx, t) acctest.PreCheckOrganizationManagementAccount(ctx, t) acctest.PreCheckPartitionHasService(servicecatalog.EndpointsID, t) @@ -120,7 +120,7 @@ func testAccPortfolioShare_organizationalUnit(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckOrganizationsEnabled(ctx, t) acctest.PreCheckOrganizationManagementAccount(ctx, t) acctest.PreCheckPartitionHasService(servicecatalog.EndpointsID, t) @@ -160,7 +160,7 @@ func testAccPortfolioShare_disappears(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckAlternateAccount(t) acctest.PreCheckPartitionHasService(servicecatalog.EndpointsID, t) }, diff --git a/internal/service/servicecatalog/portfolio_test.go b/internal/service/servicecatalog/portfolio_test.go index 3f6adec88b44..f4f6e4ff0c78 100644 --- a/internal/service/servicecatalog/portfolio_test.go +++ b/internal/service/servicecatalog/portfolio_test.go @@ -23,7 +23,7 @@ func TestAccServiceCatalogPortfolio_basic(t *testing.T) { var dpo servicecatalog.DescribePortfolioOutput resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, servicecatalog.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckServiceCatlaogPortfolioDestroy(ctx), @@ -56,7 +56,7 @@ func TestAccServiceCatalogPortfolio_disappears(t *testing.T) { var dpo servicecatalog.DescribePortfolioOutput resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, servicecatalog.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckServiceCatlaogPortfolioDestroy(ctx), @@ -80,7 +80,7 @@ func TestAccServiceCatalogPortfolio_tags(t *testing.T) { var dpo servicecatalog.DescribePortfolioOutput resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, servicecatalog.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckServiceCatlaogPortfolioDestroy(ctx), diff --git a/internal/service/servicecatalog/principal_portfolio_association_test.go b/internal/service/servicecatalog/principal_portfolio_association_test.go index b051a24ab701..82a14ff2a122 100644 --- a/internal/service/servicecatalog/principal_portfolio_association_test.go +++ b/internal/service/servicecatalog/principal_portfolio_association_test.go @@ -24,7 +24,7 @@ func TestAccServiceCatalogPrincipalPortfolioAssociation_basic(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, servicecatalog.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckPrincipalPortfolioAssociationDestroy(ctx), @@ -52,7 +52,7 @@ func TestAccServiceCatalogPrincipalPortfolioAssociation_disappears(t *testing.T) rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, servicecatalog.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckPrincipalPortfolioAssociationDestroy(ctx), diff --git a/internal/service/servicecatalog/product_data_source_test.go b/internal/service/servicecatalog/product_data_source_test.go index 99a645b5aae5..90e6d0bff28a 100644 --- a/internal/service/servicecatalog/product_data_source_test.go +++ b/internal/service/servicecatalog/product_data_source_test.go @@ -19,7 +19,7 @@ func TestAccServiceCatalogProductDataSource_basic(t *testing.T) { domain := fmt.Sprintf("http://%s", acctest.RandomDomainName()) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, servicecatalog.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckProductDestroy(ctx), @@ -56,7 +56,7 @@ func TestAccServiceCatalogProductDataSource_physicalID(t *testing.T) { domain := fmt.Sprintf("http://%s", acctest.RandomDomainName()) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, servicecatalog.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckProductDestroy(ctx), diff --git a/internal/service/servicecatalog/product_portfolio_association_test.go b/internal/service/servicecatalog/product_portfolio_association_test.go index 94ca582c13e1..6012edaa4e5e 100644 --- a/internal/service/servicecatalog/product_portfolio_association_test.go +++ b/internal/service/servicecatalog/product_portfolio_association_test.go @@ -25,7 +25,7 @@ func TestAccServiceCatalogProductPortfolioAssociation_basic(t *testing.T) { domain := fmt.Sprintf("http://%s", acctest.RandomDomainName()) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, servicecatalog.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckProductPortfolioAssociationDestroy(ctx), @@ -55,7 +55,7 @@ func TestAccServiceCatalogProductPortfolioAssociation_disappears(t *testing.T) { domain := fmt.Sprintf("http://%s", acctest.RandomDomainName()) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, servicecatalog.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckProductPortfolioAssociationDestroy(ctx), diff --git a/internal/service/servicecatalog/product_test.go b/internal/service/servicecatalog/product_test.go index b8e10188f0d1..8809ef4cb822 100644 --- a/internal/service/servicecatalog/product_test.go +++ b/internal/service/servicecatalog/product_test.go @@ -27,7 +27,7 @@ func TestAccServiceCatalogProduct_basic(t *testing.T) { domain := fmt.Sprintf("http://%s", acctest.RandomDomainName()) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, servicecatalog.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckProductDestroy(ctx), @@ -80,7 +80,7 @@ func TestAccServiceCatalogProduct_disappears(t *testing.T) { domain := fmt.Sprintf("http://%s", acctest.RandomDomainName()) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, servicecatalog.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckProductDestroy(ctx), @@ -105,7 +105,7 @@ func TestAccServiceCatalogProduct_update(t *testing.T) { domain := fmt.Sprintf("http://%s", acctest.RandomDomainName()) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, servicecatalog.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckProductDestroy(ctx), @@ -142,7 +142,7 @@ func TestAccServiceCatalogProduct_updateTags(t *testing.T) { domain := fmt.Sprintf("http://%s", acctest.RandomDomainName()) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, servicecatalog.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckProductDestroy(ctx), @@ -176,7 +176,7 @@ func TestAccServiceCatalogProduct_physicalID(t *testing.T) { domain := fmt.Sprintf("http://%s", acctest.RandomDomainName()) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, servicecatalog.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckProductDestroy(ctx), diff --git a/internal/service/servicecatalog/provisioned_product_test.go b/internal/service/servicecatalog/provisioned_product_test.go index b48dc3416f72..6e9e3617b675 100644 --- a/internal/service/servicecatalog/provisioned_product_test.go +++ b/internal/service/servicecatalog/provisioned_product_test.go @@ -26,7 +26,7 @@ func TestAccServiceCatalogProvisionedProduct_basic(t *testing.T) { domain := fmt.Sprintf("http://%s", acctest.RandomDomainName()) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, servicecatalog.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckProvisionedProductDestroy(ctx), @@ -86,7 +86,7 @@ func TestAccServiceCatalogProvisionedProduct_update(t *testing.T) { domain := fmt.Sprintf("http://%s", acctest.RandomDomainName()) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, servicecatalog.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckProvisionedProductDestroy(ctx), @@ -150,7 +150,7 @@ func TestAccServiceCatalogProvisionedProduct_computedOutputs(t *testing.T) { domain := fmt.Sprintf("http://%s", acctest.RandomDomainName()) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, servicecatalog.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckProvisionedProductDestroy(ctx), @@ -199,7 +199,7 @@ func TestAccServiceCatalogProvisionedProduct_disappears(t *testing.T) { domain := fmt.Sprintf("http://%s", acctest.RandomDomainName()) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, servicecatalog.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckProvisionedProductDestroy(ctx), @@ -224,7 +224,7 @@ func TestAccServiceCatalogProvisionedProduct_tags(t *testing.T) { domain := fmt.Sprintf("http://%s", acctest.RandomDomainName()) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, servicecatalog.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckProvisionedProductDestroy(ctx), @@ -258,7 +258,7 @@ func TestAccServiceCatalogProvisionedProduct_tainted(t *testing.T) { domain := fmt.Sprintf("http://%s", acctest.RandomDomainName()) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, servicecatalog.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckProvisionedProductDestroy(ctx), diff --git a/internal/service/servicecatalog/provisioning_artifact_test.go b/internal/service/servicecatalog/provisioning_artifact_test.go index cbe33db2d160..b0de02f1b6bb 100644 --- a/internal/service/servicecatalog/provisioning_artifact_test.go +++ b/internal/service/servicecatalog/provisioning_artifact_test.go @@ -26,7 +26,7 @@ func TestAccServiceCatalogProvisioningArtifact_basic(t *testing.T) { domain := fmt.Sprintf("http://%s", acctest.RandomDomainName()) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, servicecatalog.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckProvisioningArtifactDestroy(ctx), @@ -69,7 +69,7 @@ func TestAccServiceCatalogProvisioningArtifact_disappears(t *testing.T) { domain := fmt.Sprintf("http://%s", acctest.RandomDomainName()) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, servicecatalog.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckProvisioningArtifactDestroy(ctx), @@ -94,7 +94,7 @@ func TestAccServiceCatalogProvisioningArtifact_update(t *testing.T) { domain := fmt.Sprintf("http://%s", acctest.RandomDomainName()) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, servicecatalog.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckProvisioningArtifactDestroy(ctx), @@ -142,7 +142,7 @@ func TestAccServiceCatalogProvisioningArtifact_physicalID(t *testing.T) { domain := fmt.Sprintf("http://%s", acctest.RandomDomainName()) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, servicecatalog.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckProvisioningArtifactDestroy(ctx), diff --git a/internal/service/servicecatalog/service_action_test.go b/internal/service/servicecatalog/service_action_test.go index e2e036528c80..0f7cc3827c08 100644 --- a/internal/service/servicecatalog/service_action_test.go +++ b/internal/service/servicecatalog/service_action_test.go @@ -24,7 +24,7 @@ func TestAccServiceCatalogServiceAction_basic(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, servicecatalog.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckServiceActionDestroy(ctx), @@ -58,7 +58,7 @@ func TestAccServiceCatalogServiceAction_disappears(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, servicecatalog.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckServiceActionDestroy(ctx), @@ -82,7 +82,7 @@ func TestAccServiceCatalogServiceAction_update(t *testing.T) { rName2 := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, servicecatalog.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckServiceActionDestroy(ctx), diff --git a/internal/service/servicecatalog/tag_option_resource_association_test.go b/internal/service/servicecatalog/tag_option_resource_association_test.go index 888c059d7010..0a76e10ea310 100644 --- a/internal/service/servicecatalog/tag_option_resource_association_test.go +++ b/internal/service/servicecatalog/tag_option_resource_association_test.go @@ -23,7 +23,7 @@ func TestAccServiceCatalogTagOptionResourceAssociation_basic(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, servicecatalog.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTagOptionResourceAssociationDestroy(ctx), @@ -51,7 +51,7 @@ func TestAccServiceCatalogTagOptionResourceAssociation_disappears(t *testing.T) rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, servicecatalog.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTagOptionResourceAssociationDestroy(ctx), diff --git a/internal/service/servicecatalog/tag_option_test.go b/internal/service/servicecatalog/tag_option_test.go index 7b14c99b1c10..873bb99fe02e 100644 --- a/internal/service/servicecatalog/tag_option_test.go +++ b/internal/service/servicecatalog/tag_option_test.go @@ -24,7 +24,7 @@ func TestAccServiceCatalogTagOption_basic(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, servicecatalog.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTagOptionDestroy(ctx), @@ -54,7 +54,7 @@ func TestAccServiceCatalogTagOption_disappears(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, servicecatalog.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTagOptionDestroy(ctx), @@ -81,7 +81,7 @@ func TestAccServiceCatalogTagOption_update(t *testing.T) { // be included or it will throw servicecatalog.ErrCodeDuplicateResourceException, "already exists" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, servicecatalog.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTagOptionDestroy(ctx), @@ -141,7 +141,7 @@ func TestAccServiceCatalogTagOption_notActive(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, servicecatalog.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTagOptionDestroy(ctx), From ab576b54dccbe1a6ebed1bd9258eafdf42a6b771 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Fri, 24 Feb 2023 16:37:27 -0500 Subject: [PATCH 236/763] Add 'Context' argument to 'acctest.PreCheck' for servicediscovery. --- .../dns_namespace_data_source_test.go | 4 ++-- .../http_namespace_data_source_test.go | 2 +- .../service/servicediscovery/http_namespace_test.go | 8 ++++---- internal/service/servicediscovery/instance_test.go | 6 +++--- .../servicediscovery/private_dns_namespace_test.go | 10 +++++----- .../servicediscovery/public_dns_namespace_test.go | 8 ++++---- .../servicediscovery/service_data_source_test.go | 6 +++--- internal/service/servicediscovery/service_test.go | 12 ++++++------ 8 files changed, 28 insertions(+), 28 deletions(-) diff --git a/internal/service/servicediscovery/dns_namespace_data_source_test.go b/internal/service/servicediscovery/dns_namespace_data_source_test.go index 99a3d1b12590..09026fe91844 100644 --- a/internal/service/servicediscovery/dns_namespace_data_source_test.go +++ b/internal/service/servicediscovery/dns_namespace_data_source_test.go @@ -18,7 +18,7 @@ func TestAccServiceDiscoveryDNSNamespaceDataSource_private(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(servicediscovery.EndpointsID, t) testAccPreCheck(ctx, t) }, @@ -47,7 +47,7 @@ func TestAccServiceDiscoveryDNSNamespaceDataSource_public(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(servicediscovery.EndpointsID, t) testAccPreCheck(ctx, t) }, diff --git a/internal/service/servicediscovery/http_namespace_data_source_test.go b/internal/service/servicediscovery/http_namespace_data_source_test.go index 52dd808b339c..c190d7c584b7 100644 --- a/internal/service/servicediscovery/http_namespace_data_source_test.go +++ b/internal/service/servicediscovery/http_namespace_data_source_test.go @@ -18,7 +18,7 @@ func TestAccServiceDiscoveryHTTPNamespaceDataSource_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(servicediscovery.EndpointsID, t) testAccPreCheck(ctx, t) }, diff --git a/internal/service/servicediscovery/http_namespace_test.go b/internal/service/servicediscovery/http_namespace_test.go index 6c8f906e1563..fdfcc449eb66 100644 --- a/internal/service/servicediscovery/http_namespace_test.go +++ b/internal/service/servicediscovery/http_namespace_test.go @@ -23,7 +23,7 @@ func TestAccServiceDiscoveryHTTPNamespace_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(servicediscovery.EndpointsID, t) testAccPreCheck(ctx, t) }, @@ -59,7 +59,7 @@ func TestAccServiceDiscoveryHTTPNamespace_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(servicediscovery.EndpointsID, t) testAccPreCheck(ctx, t) }, @@ -86,7 +86,7 @@ func TestAccServiceDiscoveryHTTPNamespace_description(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(servicediscovery.EndpointsID, t) testAccPreCheck(ctx, t) }, @@ -117,7 +117,7 @@ func TestAccServiceDiscoveryHTTPNamespace_tags(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(servicediscovery.EndpointsID, t) testAccPreCheck(ctx, t) }, diff --git a/internal/service/servicediscovery/instance_test.go b/internal/service/servicediscovery/instance_test.go index 1d9e142fe5e5..326f4056efbe 100644 --- a/internal/service/servicediscovery/instance_test.go +++ b/internal/service/servicediscovery/instance_test.go @@ -23,7 +23,7 @@ func TestAccServiceDiscoveryInstance_private(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(servicediscovery.EndpointsID, t) testAccPreCheck(ctx, t) }, @@ -69,7 +69,7 @@ func TestAccServiceDiscoveryInstance_public(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(servicediscovery.EndpointsID, t) testAccPreCheck(ctx, t) }, @@ -115,7 +115,7 @@ func TestAccServiceDiscoveryInstance_http(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(servicediscovery.EndpointsID, t) testAccPreCheck(ctx, t) }, diff --git a/internal/service/servicediscovery/private_dns_namespace_test.go b/internal/service/servicediscovery/private_dns_namespace_test.go index 16af5e83889f..298dc3bfdf07 100644 --- a/internal/service/servicediscovery/private_dns_namespace_test.go +++ b/internal/service/servicediscovery/private_dns_namespace_test.go @@ -23,7 +23,7 @@ func TestAccServiceDiscoveryPrivateDNSNamespace_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(servicediscovery.EndpointsID, t) testAccPreCheck(ctx, t) }, @@ -58,7 +58,7 @@ func TestAccServiceDiscoveryPrivateDNSNamespace_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(servicediscovery.EndpointsID, t) testAccPreCheck(ctx, t) }, @@ -85,7 +85,7 @@ func TestAccServiceDiscoveryPrivateDNSNamespace_description(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(servicediscovery.EndpointsID, t) testAccPreCheck(ctx, t) }, @@ -113,7 +113,7 @@ func TestAccServiceDiscoveryPrivateDNSNamespace_Error_overlap(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(servicediscovery.EndpointsID, t) testAccPreCheck(ctx, t) }, @@ -136,7 +136,7 @@ func TestAccServiceDiscoveryPrivateDNSNamespace_tags(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(servicediscovery.EndpointsID, t) testAccPreCheck(ctx, t) }, diff --git a/internal/service/servicediscovery/public_dns_namespace_test.go b/internal/service/servicediscovery/public_dns_namespace_test.go index aea3ca57cc60..4aff84ccef73 100644 --- a/internal/service/servicediscovery/public_dns_namespace_test.go +++ b/internal/service/servicediscovery/public_dns_namespace_test.go @@ -23,7 +23,7 @@ func TestAccServiceDiscoveryPublicDNSNamespace_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(servicediscovery.EndpointsID, t) testAccPreCheck(ctx, t) }, @@ -57,7 +57,7 @@ func TestAccServiceDiscoveryPublicDNSNamespace_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(servicediscovery.EndpointsID, t) testAccPreCheck(ctx, t) }, @@ -84,7 +84,7 @@ func TestAccServiceDiscoveryPublicDNSNamespace_description(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(servicediscovery.EndpointsID, t) testAccPreCheck(ctx, t) }, @@ -110,7 +110,7 @@ func TestAccServiceDiscoveryPublicDNSNamespace_tags(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(servicediscovery.EndpointsID, t) testAccPreCheck(ctx, t) }, diff --git a/internal/service/servicediscovery/service_data_source_test.go b/internal/service/servicediscovery/service_data_source_test.go index ce4903a4bec1..5c9018be7a41 100644 --- a/internal/service/servicediscovery/service_data_source_test.go +++ b/internal/service/servicediscovery/service_data_source_test.go @@ -18,7 +18,7 @@ func TestAccServiceDiscoveryServiceDataSource_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(servicediscovery.EndpointsID, t) testAccPreCheck(ctx, t) }, @@ -50,7 +50,7 @@ func TestAccServiceDiscoveryServiceDataSource_private(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(servicediscovery.EndpointsID, t) testAccPreCheck(ctx, t) }, @@ -82,7 +82,7 @@ func TestAccServiceDiscoveryServiceDataSource_public(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(servicediscovery.EndpointsID, t) testAccPreCheck(ctx, t) }, diff --git a/internal/service/servicediscovery/service_test.go b/internal/service/servicediscovery/service_test.go index 46613f90adc8..fa227db46449 100644 --- a/internal/service/servicediscovery/service_test.go +++ b/internal/service/servicediscovery/service_test.go @@ -23,7 +23,7 @@ func TestAccServiceDiscoveryService_private(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(servicediscovery.EndpointsID, t) testAccPreCheck(ctx, t) }, @@ -87,7 +87,7 @@ func TestAccServiceDiscoveryService_public(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(servicediscovery.EndpointsID, t) testAccPreCheck(ctx, t) }, @@ -154,7 +154,7 @@ func TestAccServiceDiscoveryService_private_http(t *testing.T) { resourceName := "aws_service_discovery_service.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(servicediscovery.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(servicediscovery.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, servicediscovery.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckServiceDestroy(ctx), @@ -185,7 +185,7 @@ func TestAccServiceDiscoveryService_http(t *testing.T) { resourceName := "aws_service_discovery_service.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(servicediscovery.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(servicediscovery.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, servicediscovery.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckServiceDestroy(ctx), @@ -215,7 +215,7 @@ func TestAccServiceDiscoveryService_disappears(t *testing.T) { resourceName := "aws_service_discovery_service.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(servicediscovery.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(servicediscovery.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, servicediscovery.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckServiceDestroy(ctx), @@ -238,7 +238,7 @@ func TestAccServiceDiscoveryService_tags(t *testing.T) { resourceName := "aws_service_discovery_service.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(servicediscovery.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(servicediscovery.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, servicediscovery.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckServiceDestroy(ctx), From 7f488b5759752a078a5d7335e3a19f7ee86fe320 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Fri, 24 Feb 2023 16:37:27 -0500 Subject: [PATCH 237/763] Add 'Context' argument to 'acctest.PreCheck' for servicequotas. --- .../servicequotas/service_data_source_test.go | 2 +- .../servicequotas/service_quota_data_source_test.go | 12 ++++++------ internal/service/servicequotas/service_quota_test.go | 10 +++++----- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/internal/service/servicequotas/service_data_source_test.go b/internal/service/servicequotas/service_data_source_test.go index d581b1d33b5a..fada76451c95 100644 --- a/internal/service/servicequotas/service_data_source_test.go +++ b/internal/service/servicequotas/service_data_source_test.go @@ -13,7 +13,7 @@ func TestAccServiceQuotasServiceDataSource_serviceName(t *testing.T) { dataSourceName := "data.aws_servicequotas_service.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(servicequotas.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(servicequotas.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, servicequotas.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ diff --git a/internal/service/servicequotas/service_quota_data_source_test.go b/internal/service/servicequotas/service_quota_data_source_test.go index b86e47114f99..02a36a244342 100644 --- a/internal/service/servicequotas/service_quota_data_source_test.go +++ b/internal/service/servicequotas/service_quota_data_source_test.go @@ -16,7 +16,7 @@ func TestAccServiceQuotasServiceQuotaDataSource_quotaCode(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(servicequotas.EndpointsID, t) preCheckServiceQuotaSet(ctx, setQuotaServiceCode, setQuotaQuotaCode, t) }, @@ -47,7 +47,7 @@ func TestAccServiceQuotasServiceQuotaDataSource_quotaCode_Unset(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(servicequotas.EndpointsID, t) preCheckServiceQuotaUnset(ctx, unsetQuotaServiceCode, unsetQuotaQuotaCode, t) }, @@ -77,7 +77,7 @@ func TestAccServiceQuotasServiceQuotaDataSource_PermissionError_quotaCode(t *tes ctx := acctest.Context(t) resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) testAccPreCheck(ctx, t) acctest.PreCheckAssumeRoleARN(t) }, @@ -99,7 +99,7 @@ func TestAccServiceQuotasServiceQuotaDataSource_quotaName(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(servicequotas.EndpointsID, t) preCheckServiceQuotaSet(ctx, setQuotaServiceCode, setQuotaQuotaCode, t) }, @@ -130,7 +130,7 @@ func TestAccServiceQuotasServiceQuotaDataSource_quotaName_Unset(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(servicequotas.EndpointsID, t) preCheckServiceQuotaUnset(ctx, unsetQuotaServiceCode, unsetQuotaQuotaCode, t) }, @@ -160,7 +160,7 @@ func TestAccServiceQuotasServiceQuotaDataSource_PermissionError_quotaName(t *tes ctx := acctest.Context(t) resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) testAccPreCheck(ctx, t) acctest.PreCheckAssumeRoleARN(t) }, diff --git a/internal/service/servicequotas/service_quota_test.go b/internal/service/servicequotas/service_quota_test.go index fcddefbd2f81..eaff2f9169c7 100644 --- a/internal/service/servicequotas/service_quota_test.go +++ b/internal/service/servicequotas/service_quota_test.go @@ -22,7 +22,7 @@ func TestAccServiceQuotasServiceQuota_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) testAccPreCheck(ctx, t) preCheckServiceQuotaSet(ctx, setQuotaServiceCode, setQuotaQuotaCode, t) }, @@ -60,7 +60,7 @@ func TestAccServiceQuotasServiceQuota_basic_Unset(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) testAccPreCheck(ctx, t) preCheckServiceQuotaUnset(ctx, unsetQuotaServiceCode, unsetQuotaQuotaCode, t) }, @@ -117,7 +117,7 @@ func TestAccServiceQuotasServiceQuota_Value_increaseOnCreate(t *testing.T) { resourceName := "aws_servicequotas_service_quota.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, servicequotas.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: nil, @@ -162,7 +162,7 @@ func TestAccServiceQuotasServiceQuota_Value_increaseOnUpdate(t *testing.T) { resourceName := "aws_servicequotas_service_quota.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, servicequotas.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: nil, @@ -192,7 +192,7 @@ func TestAccServiceQuotasServiceQuota_Value_increaseOnUpdate(t *testing.T) { func TestAccServiceQuotasServiceQuota_permissionError(t *testing.T) { ctx := acctest.Context(t) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t); acctest.PreCheckAssumeRoleARN(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t); acctest.PreCheckAssumeRoleARN(t) }, ErrorCheck: acctest.ErrorCheck(t, servicequotas.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: nil, From b59bb94c77932204b33524ceddf1d012ceac0545 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Fri, 24 Feb 2023 16:37:27 -0500 Subject: [PATCH 238/763] Add 'Context' argument to 'acctest.PreCheck' for ses. --- ...active_receipt_rule_set_data_source_test.go | 4 ++-- .../ses/active_receipt_rule_set_test.go | 4 ++-- internal/service/ses/configuration_set_test.go | 18 +++++++++--------- internal/service/ses/domain_dkim_test.go | 2 +- .../ses/domain_identity_data_source_test.go | 2 +- internal/service/ses/domain_identity_test.go | 6 +++--- .../ses/domain_identity_verification_test.go | 6 +++--- internal/service/ses/domain_mail_from_test.go | 8 ++++---- .../ses/email_identity_data_dource_test.go | 4 ++-- internal/service/ses/email_identity_test.go | 4 ++-- internal/service/ses/event_destination_test.go | 4 ++-- .../ses/identity_notification_topic_test.go | 2 +- internal/service/ses/identity_policy_test.go | 8 ++++---- internal/service/ses/receipt_filter_test.go | 4 ++-- internal/service/ses/receipt_rule_set_test.go | 4 ++-- internal/service/ses/receipt_rule_test.go | 18 +++++++++--------- internal/service/ses/template_test.go | 6 +++--- 17 files changed, 52 insertions(+), 52 deletions(-) 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 5ec2eec8a573..f0c3be31cdd8 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 @@ -20,7 +20,7 @@ func testAccActiveReceiptRuleSetDataSource_basic(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) testAccPreCheck(ctx, t) testAccPreCheckReceiptRule(ctx, t) }, @@ -43,7 +43,7 @@ func testAccActiveReceiptRuleSetDataSource_noActiveRuleSet(t *testing.T) { ctx := acctest.Context(t) resource.Test(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) testAccPreCheck(ctx, t) testAccPreCheckUnsetActiveRuleSet(ctx, t) }, diff --git a/internal/service/ses/active_receipt_rule_set_test.go b/internal/service/ses/active_receipt_rule_set_test.go index ae99e82358d5..9fc6be6cf668 100644 --- a/internal/service/ses/active_receipt_rule_set_test.go +++ b/internal/service/ses/active_receipt_rule_set_test.go @@ -41,7 +41,7 @@ func testAccActiveReceiptRuleSet_basic(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) testAccPreCheck(ctx, t) testAccPreCheckReceiptRule(ctx, t) }, @@ -67,7 +67,7 @@ func testAccActiveReceiptRuleSet_disappears(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) testAccPreCheck(ctx, t) testAccPreCheckReceiptRule(ctx, t) }, diff --git a/internal/service/ses/configuration_set_test.go b/internal/service/ses/configuration_set_test.go index e7563dee6ca7..5ceb57ac18dd 100644 --- a/internal/service/ses/configuration_set_test.go +++ b/internal/service/ses/configuration_set_test.go @@ -23,7 +23,7 @@ func TestAccSESConfigurationSet_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ses.EndpointsID), @@ -59,7 +59,7 @@ func TestAccSESConfigurationSet_sendingEnabled(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ses.EndpointsID), @@ -106,7 +106,7 @@ func TestAccSESConfigurationSet_reputationMetricsEnabled(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ses.EndpointsID), @@ -150,7 +150,7 @@ func TestAccSESConfigurationSet_deliveryOptions(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ses.EndpointsID), @@ -181,7 +181,7 @@ func TestAccSESConfigurationSet_Update_deliveryOptions(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ses.EndpointsID), @@ -238,7 +238,7 @@ func TestAccSESConfigurationSet_emptyDeliveryOptions(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ses.EndpointsID), @@ -269,7 +269,7 @@ func TestAccSESConfigurationSet_Update_emptyDeliveryOptions(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ses.EndpointsID), @@ -320,7 +320,7 @@ func TestAccSESConfigurationSet_trackingOptions(t *testing.T) { resourceName := "aws_ses_configuration_set.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(t) }, ErrorCheck: acctest.ErrorCheck(t, ses.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckConfigurationSetDestroy, @@ -350,7 +350,7 @@ func TestAccSESConfigurationSet_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ses.EndpointsID), diff --git a/internal/service/ses/domain_dkim_test.go b/internal/service/ses/domain_dkim_test.go index c85e24f6d729..b3dc5a290b14 100644 --- a/internal/service/ses/domain_dkim_test.go +++ b/internal/service/ses/domain_dkim_test.go @@ -22,7 +22,7 @@ func TestAccSESDomainDKIM_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ses.EndpointsID), diff --git a/internal/service/ses/domain_identity_data_source_test.go b/internal/service/ses/domain_identity_data_source_test.go index c6605a1b1bdb..d431b762993b 100644 --- a/internal/service/ses/domain_identity_data_source_test.go +++ b/internal/service/ses/domain_identity_data_source_test.go @@ -14,7 +14,7 @@ func TestAccSESDomainIdentityDataSource_basic(t *testing.T) { domain := acctest.RandomDomainName() resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ses.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDomainIdentityDestroy(ctx), diff --git a/internal/service/ses/domain_identity_test.go b/internal/service/ses/domain_identity_test.go index 172fd9fc7cd5..ae40a6e8012a 100644 --- a/internal/service/ses/domain_identity_test.go +++ b/internal/service/ses/domain_identity_test.go @@ -21,7 +21,7 @@ func TestAccSESDomainIdentity_basic(t *testing.T) { domain := acctest.RandomDomainName() resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ses.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDomainIdentityDestroy(ctx), @@ -42,7 +42,7 @@ func TestAccSESDomainIdentity_disappears(t *testing.T) { domain := acctest.RandomDomainName() resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ses.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDomainIdentityDestroy(ctx), @@ -66,7 +66,7 @@ func TestAccSESDomainIdentity_trailingPeriod(t *testing.T) { domain := acctest.RandomFQDomainName() resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ses.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDomainIdentityDestroy(ctx), diff --git a/internal/service/ses/domain_identity_verification_test.go b/internal/service/ses/domain_identity_verification_test.go index 063026de1d4d..4719ebd2a6a0 100644 --- a/internal/service/ses/domain_identity_verification_test.go +++ b/internal/service/ses/domain_identity_verification_test.go @@ -34,7 +34,7 @@ func TestAccSESDomainIdentityVerification_basic(t *testing.T) { domain := fmt.Sprintf("tf-acc-%d.%s", sdkacctest.RandInt(), rootDomain) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ses.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDomainIdentityDestroy(ctx), @@ -52,7 +52,7 @@ func TestAccSESDomainIdentityVerification_timeout(t *testing.T) { domain := acctest.RandomDomainName() resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ses.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDomainIdentityDestroy(ctx), @@ -70,7 +70,7 @@ func TestAccSESDomainIdentityVerification_nonexistent(t *testing.T) { domain := acctest.RandomDomainName() resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ses.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDomainIdentityDestroy(ctx), diff --git a/internal/service/ses/domain_mail_from_test.go b/internal/service/ses/domain_mail_from_test.go index 467f87af9e6c..e80375f19b60 100644 --- a/internal/service/ses/domain_mail_from_test.go +++ b/internal/service/ses/domain_mail_from_test.go @@ -22,7 +22,7 @@ func TestAccSESDomainMailFrom_basic(t *testing.T) { resourceName := "aws_ses_domain_mail_from.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ses.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDomainMailFromDestroy(ctx), @@ -62,7 +62,7 @@ func TestAccSESDomainMailFrom_disappears(t *testing.T) { resourceName := "aws_ses_domain_mail_from.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ses.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDomainMailFromDestroy(ctx), @@ -87,7 +87,7 @@ func TestAccSESDomainMailFrom_Disappears_identity(t *testing.T) { resourceName := "aws_ses_domain_mail_from.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ses.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDomainMailFromDestroy(ctx), @@ -110,7 +110,7 @@ func TestAccSESDomainMailFrom_behaviorOnMxFailure(t *testing.T) { resourceName := "aws_ses_domain_mail_from.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ses.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDomainMailFromDestroy(ctx), diff --git a/internal/service/ses/email_identity_data_dource_test.go b/internal/service/ses/email_identity_data_dource_test.go index b3b0eff4201b..ca99471c5707 100644 --- a/internal/service/ses/email_identity_data_dource_test.go +++ b/internal/service/ses/email_identity_data_dource_test.go @@ -16,7 +16,7 @@ func TestAccSESEmailIdentityDataSource_basic(t *testing.T) { email := acctest.DefaultEmailAddress resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ses.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckEmailIdentityDestroy(ctx), @@ -37,7 +37,7 @@ func TestAccSESEmailIdentityDataSource_trailingPeriod(t *testing.T) { email := fmt.Sprintf("%s.", acctest.DefaultEmailAddress) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ses.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckEmailIdentityDestroy(ctx), diff --git a/internal/service/ses/email_identity_test.go b/internal/service/ses/email_identity_test.go index 90d6dcb908e7..5ebe97b1f9f3 100644 --- a/internal/service/ses/email_identity_test.go +++ b/internal/service/ses/email_identity_test.go @@ -21,7 +21,7 @@ func TestAccSESEmailIdentity_basic(t *testing.T) { resourceName := "aws_ses_email_identity.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ses.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckEmailIdentityDestroy(ctx), @@ -48,7 +48,7 @@ func TestAccSESEmailIdentity_trailingPeriod(t *testing.T) { resourceName := "aws_ses_email_identity.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ses.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckEmailIdentityDestroy(ctx), diff --git a/internal/service/ses/event_destination_test.go b/internal/service/ses/event_destination_test.go index ed71878dcebb..722debf0912c 100644 --- a/internal/service/ses/event_destination_test.go +++ b/internal/service/ses/event_destination_test.go @@ -27,7 +27,7 @@ func TestAccSESEventDestination_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ses.EndpointsID), @@ -82,7 +82,7 @@ func TestAccSESEventDestination_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ses.EndpointsID), diff --git a/internal/service/ses/identity_notification_topic_test.go b/internal/service/ses/identity_notification_topic_test.go index 3ce3b36e771b..98f67552e628 100644 --- a/internal/service/ses/identity_notification_topic_test.go +++ b/internal/service/ses/identity_notification_topic_test.go @@ -24,7 +24,7 @@ func TestAccSESIdentityNotificationTopic_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ses.EndpointsID), diff --git a/internal/service/ses/identity_policy_test.go b/internal/service/ses/identity_policy_test.go index c1e5bbf2f81d..adbf4c62052e 100644 --- a/internal/service/ses/identity_policy_test.go +++ b/internal/service/ses/identity_policy_test.go @@ -21,7 +21,7 @@ func TestAccSESIdentityPolicy_basic(t *testing.T) { resourceName := "aws_ses_identity_policy.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ses.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckIdentityPolicyDestroy(ctx), @@ -48,7 +48,7 @@ func TestAccSESIdentityPolicy_Identity_email(t *testing.T) { resourceName := "aws_ses_identity_policy.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ses.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckIdentityPolicyDestroy(ctx), @@ -74,7 +74,7 @@ func TestAccSESIdentityPolicy_policy(t *testing.T) { resourceName := "aws_ses_identity_policy.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ses.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckIdentityPolicyDestroy(ctx), @@ -107,7 +107,7 @@ func TestAccSESIdentityPolicy_ignoreEquivalent(t *testing.T) { resourceName := "aws_ses_identity_policy.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ses.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckIdentityPolicyDestroy(ctx), diff --git a/internal/service/ses/receipt_filter_test.go b/internal/service/ses/receipt_filter_test.go index 09cf54800e07..bac62c1a3d1e 100644 --- a/internal/service/ses/receipt_filter_test.go +++ b/internal/service/ses/receipt_filter_test.go @@ -21,7 +21,7 @@ func TestAccSESReceiptFilter_basic(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t); testAccPreCheckReceiptRule(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t); testAccPreCheckReceiptRule(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ses.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckReceiptFilterDestroy(ctx), @@ -51,7 +51,7 @@ func TestAccSESReceiptFilter_disappears(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t); testAccPreCheckReceiptRule(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t); testAccPreCheckReceiptRule(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ses.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckReceiptFilterDestroy(ctx), diff --git a/internal/service/ses/receipt_rule_set_test.go b/internal/service/ses/receipt_rule_set_test.go index 3981f95d733a..b736b94305ca 100644 --- a/internal/service/ses/receipt_rule_set_test.go +++ b/internal/service/ses/receipt_rule_set_test.go @@ -22,7 +22,7 @@ func TestAccSESReceiptRuleSet_basic(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t); testAccPreCheckReceiptRule(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t); testAccPreCheckReceiptRule(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ses.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckReceiptRuleSetDestroy(ctx), @@ -50,7 +50,7 @@ func TestAccSESReceiptRuleSet_disappears(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t); testAccPreCheckReceiptRule(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t); testAccPreCheckReceiptRule(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ses.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckReceiptRuleSetDestroy(ctx), diff --git a/internal/service/ses/receipt_rule_test.go b/internal/service/ses/receipt_rule_test.go index 8e538c45a55c..92cb47c7c6f7 100644 --- a/internal/service/ses/receipt_rule_test.go +++ b/internal/service/ses/receipt_rule_test.go @@ -25,7 +25,7 @@ func TestAccSESReceiptRule_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) testAccPreCheck(ctx, t) testAccPreCheckReceiptRule(ctx, t) }, @@ -71,7 +71,7 @@ func TestAccSESReceiptRule_s3Action(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) testAccPreCheck(ctx, t) testAccPreCheckReceiptRule(ctx, t) }, @@ -108,7 +108,7 @@ func TestAccSESReceiptRule_snsAction(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) testAccPreCheck(ctx, t) testAccPreCheckReceiptRule(ctx, t) }, @@ -145,7 +145,7 @@ func TestAccSESReceiptRule_snsActionEncoding(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) testAccPreCheck(ctx, t) testAccPreCheckReceiptRule(ctx, t) }, @@ -182,7 +182,7 @@ func TestAccSESReceiptRule_lambdaAction(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) testAccPreCheck(ctx, t) testAccPreCheckReceiptRule(ctx, t) }, @@ -219,7 +219,7 @@ func TestAccSESReceiptRule_stopAction(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) testAccPreCheck(ctx, t) testAccPreCheckReceiptRule(ctx, t) }, @@ -255,7 +255,7 @@ func TestAccSESReceiptRule_order(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) testAccPreCheck(ctx, t) testAccPreCheckReceiptRule(ctx, t) }, @@ -288,7 +288,7 @@ func TestAccSESReceiptRule_actions(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) testAccPreCheck(ctx, t) testAccPreCheckReceiptRule(ctx, t) }, @@ -330,7 +330,7 @@ func TestAccSESReceiptRule_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) testAccPreCheck(ctx, t) testAccPreCheckReceiptRule(ctx, t) }, diff --git a/internal/service/ses/template_test.go b/internal/service/ses/template_test.go index 045571ec46c7..843899d7eea3 100644 --- a/internal/service/ses/template_test.go +++ b/internal/service/ses/template_test.go @@ -24,7 +24,7 @@ func TestAccSESTemplate_basic(t *testing.T) { var template ses.Template resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ses.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTemplateDestroy(ctx), @@ -55,7 +55,7 @@ func TestAccSESTemplate_update(t *testing.T) { var template ses.Template resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ses.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTemplateDestroy(ctx), @@ -107,7 +107,7 @@ func TestAccSESTemplate_disappears(t *testing.T) { var template ses.Template resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ses.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTemplateDestroy(ctx), From 32e9fdba6038538c241fad4220d4bf9909484b38 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Fri, 24 Feb 2023 16:37:28 -0500 Subject: [PATCH 239/763] Add 'Context' argument to 'acctest.PreCheck' for sesv2. --- .../configuration_set_event_destination_test.go | 12 ++++++------ internal/service/sesv2/configuration_set_test.go | 14 +++++++------- .../service/sesv2/dedicated_ip_assignment_test.go | 4 ++-- .../sesv2/dedicated_ip_pool_data_source_test.go | 2 +- internal/service/sesv2/dedicated_ip_pool_test.go | 8 ++++---- .../email_identity_feedback_attributes_test.go | 8 ++++---- .../email_identity_mail_from_attributes_test.go | 10 +++++----- internal/service/sesv2/email_identity_test.go | 14 +++++++------- 8 files changed, 36 insertions(+), 36 deletions(-) diff --git a/internal/service/sesv2/configuration_set_event_destination_test.go b/internal/service/sesv2/configuration_set_event_destination_test.go index 0454ebe24714..c45620d1d765 100644 --- a/internal/service/sesv2/configuration_set_event_destination_test.go +++ b/internal/service/sesv2/configuration_set_event_destination_test.go @@ -23,7 +23,7 @@ func TestAccSESV2ConfigurationSetEventDestination_basic(t *testing.T) { resourceName := "aws_sesv2_configuration_set_event_destination.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, names.SESV2EndpointID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckConfigurationSetEventDestinationDestroy(ctx), @@ -67,7 +67,7 @@ func TestAccSESV2ConfigurationSetEventDestination_cloudWatchDestination(t *testi resourceName := "aws_sesv2_configuration_set_event_destination.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, names.SESV2EndpointID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckConfigurationSetEventDestinationDestroy(ctx), @@ -111,7 +111,7 @@ func TestAccSESV2ConfigurationSetEventDestination_kinesisFirehoseDestination(t * resourceName := "aws_sesv2_configuration_set_event_destination.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, names.SESV2EndpointID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckConfigurationSetEventDestinationDestroy(ctx), @@ -151,7 +151,7 @@ func TestAccSESV2ConfigurationSetEventDestination_pinpointDestination(t *testing resourceName := "aws_sesv2_configuration_set_event_destination.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, names.SESV2EndpointID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckConfigurationSetEventDestinationDestroy(ctx), @@ -189,7 +189,7 @@ func TestAccSESV2ConfigurationSetEventDestination_snsDestination(t *testing.T) { resourceName := "aws_sesv2_configuration_set_event_destination.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, names.SESV2EndpointID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckConfigurationSetEventDestinationDestroy(ctx), @@ -227,7 +227,7 @@ func TestAccSESV2ConfigurationSetEventDestination_disappears(t *testing.T) { resourceName := "aws_sesv2_configuration_set_event_destination.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, names.SESV2EndpointID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckConfigurationSetEventDestinationDestroy(ctx), diff --git a/internal/service/sesv2/configuration_set_test.go b/internal/service/sesv2/configuration_set_test.go index 4d50664d899c..3291e6d81200 100644 --- a/internal/service/sesv2/configuration_set_test.go +++ b/internal/service/sesv2/configuration_set_test.go @@ -24,7 +24,7 @@ func TestAccSESV2ConfigurationSet_basic(t *testing.T) { resourceName := "aws_sesv2_configuration_set.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, names.SESV2EndpointID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckConfigurationSetDestroy(ctx), @@ -52,7 +52,7 @@ func TestAccSESV2ConfigurationSet_disappears(t *testing.T) { resourceName := "aws_sesv2_configuration_set.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, names.SESV2EndpointID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckConfigurationSetDestroy(ctx), @@ -75,7 +75,7 @@ func TestAccSESV2ConfigurationSet_tlsPolicy(t *testing.T) { resourceName := "aws_sesv2_configuration_set.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, names.SESV2EndpointID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckConfigurationSetDestroy(ctx), @@ -111,7 +111,7 @@ func TestAccSESV2ConfigurationSet_reputationMetricsEnabled(t *testing.T) { resourceName := "aws_sesv2_configuration_set.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, names.SESV2EndpointID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckConfigurationSetDestroy(ctx), @@ -147,7 +147,7 @@ func TestAccSESV2ConfigurationSet_sendingEnabled(t *testing.T) { resourceName := "aws_sesv2_configuration_set.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, names.SESV2EndpointID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckConfigurationSetDestroy(ctx), @@ -183,7 +183,7 @@ func TestAccSESV2ConfigurationSet_suppressedReasons(t *testing.T) { resourceName := "aws_sesv2_configuration_set.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, names.SESV2EndpointID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckConfigurationSetDestroy(ctx), @@ -221,7 +221,7 @@ func TestAccSESV2ConfigurationSet_tags(t *testing.T) { resourceName := "aws_sesv2_configuration_set.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, names.SESV2EndpointID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckConfigurationSetDestroy(ctx), diff --git a/internal/service/sesv2/dedicated_ip_assignment_test.go b/internal/service/sesv2/dedicated_ip_assignment_test.go index b636c595be0b..bdb49ea42ca8 100644 --- a/internal/service/sesv2/dedicated_ip_assignment_test.go +++ b/internal/service/sesv2/dedicated_ip_assignment_test.go @@ -40,7 +40,7 @@ func testAccSESV2DedicatedIPAssignment_basic(t *testing.T) { // nosemgrep:ci.ses resourceName := "aws_sesv2_dedicated_ip_assignment.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, names.SESV2EndpointID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDedicatedIPAssignmentDestroy(ctx), @@ -73,7 +73,7 @@ func testAccSESV2DedicatedIPAssignment_disappears(t *testing.T) { // nosemgrep:c resourceName := "aws_sesv2_dedicated_ip_assignment.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, names.SESV2EndpointID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDedicatedIPAssignmentDestroy(ctx), 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 9d6727cfdd59..d4c3328958f7 100644 --- a/internal/service/sesv2/dedicated_ip_pool_data_source_test.go +++ b/internal/service/sesv2/dedicated_ip_pool_data_source_test.go @@ -18,7 +18,7 @@ func TestAccSESV2DedicatedIPPoolDataSource_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) testAccPreCheckDedicatedIPPool(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, names.SESV2EndpointID), diff --git a/internal/service/sesv2/dedicated_ip_pool_test.go b/internal/service/sesv2/dedicated_ip_pool_test.go index c1896e121fe2..21f6bc61ffb4 100644 --- a/internal/service/sesv2/dedicated_ip_pool_test.go +++ b/internal/service/sesv2/dedicated_ip_pool_test.go @@ -25,7 +25,7 @@ func TestAccSESV2DedicatedIPPool_basic(t *testing.T) { resourceName := "aws_sesv2_dedicated_ip_pool.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckDedicatedIPPool(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckDedicatedIPPool(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, names.SESV2EndpointID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDedicatedIPPoolDestroy(ctx), @@ -53,7 +53,7 @@ func TestAccSESV2DedicatedIPPool_disappears(t *testing.T) { resourceName := "aws_sesv2_dedicated_ip_pool.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckDedicatedIPPool(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckDedicatedIPPool(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, names.SESV2EndpointID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDedicatedIPPoolDestroy(ctx), @@ -76,7 +76,7 @@ func TestAccSESV2DedicatedIPPool_scalingMode(t *testing.T) { resourceName := "aws_sesv2_dedicated_ip_pool.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckDedicatedIPPool(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckDedicatedIPPool(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, names.SESV2EndpointID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDedicatedIPPoolDestroy(ctx), @@ -112,7 +112,7 @@ func TestAccSESV2DedicatedIPPool_tags(t *testing.T) { resourceName := "aws_sesv2_dedicated_ip_pool.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckDedicatedIPPool(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckDedicatedIPPool(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, names.SESV2EndpointID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDedicatedIPPoolDestroy(ctx), diff --git a/internal/service/sesv2/email_identity_feedback_attributes_test.go b/internal/service/sesv2/email_identity_feedback_attributes_test.go index b5588b15818b..d5844612897a 100644 --- a/internal/service/sesv2/email_identity_feedback_attributes_test.go +++ b/internal/service/sesv2/email_identity_feedback_attributes_test.go @@ -22,7 +22,7 @@ func TestAccSESV2EmailIdentityFeedbackAttributes_basic(t *testing.T) { emailIdentityName := "aws_sesv2_email_identity.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, names.SESV2EndpointID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckEmailIdentityDestroy(ctx), @@ -50,7 +50,7 @@ func TestAccSESV2EmailIdentityFeedbackAttributes_disappears(t *testing.T) { emailIdentityName := "aws_sesv2_email_identity.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, names.SESV2EndpointID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckEmailIdentityDestroy(ctx), @@ -73,7 +73,7 @@ func TestAccSESV2EmailIdentityFeedbackAttributes_disappears_emailIdentity(t *tes emailIdentityName := "aws_sesv2_email_identity.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, names.SESV2EndpointID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckEmailIdentityDestroy(ctx), @@ -97,7 +97,7 @@ func TestAccSESV2EmailIdentityFeedbackAttributes_emailForwardingEnabled(t *testi emailIdentityName := "aws_sesv2_email_identity.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, names.SESV2EndpointID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckEmailIdentityDestroy(ctx), 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 b5f9ca15e0e2..7da345a9db31 100644 --- a/internal/service/sesv2/email_identity_mail_from_attributes_test.go +++ b/internal/service/sesv2/email_identity_mail_from_attributes_test.go @@ -23,7 +23,7 @@ func TestAccSESV2EmailIdentityMailFromAttributes_basic(t *testing.T) { emailIdentityName := "aws_sesv2_email_identity.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, names.SESV2EndpointID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckEmailIdentityDestroy(ctx), @@ -53,7 +53,7 @@ func TestAccSESV2EmailIdentityMailFromAttributes_disappears(t *testing.T) { resourceName := "aws_sesv2_email_identity_mail_from_attributes.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, names.SESV2EndpointID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckEmailIdentityDestroy(ctx), @@ -77,7 +77,7 @@ func TestAccSESV2EmailIdentityMailFromAttributes_disappearsEmailIdentity(t *test emailIdentityName := "aws_sesv2_email_identity.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, names.SESV2EndpointID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckEmailIdentityDestroy(ctx), @@ -103,7 +103,7 @@ func TestAccSESV2EmailIdentityMailFromAttributes_behaviorOnMXFailure(t *testing. resourceName := "aws_sesv2_email_identity_mail_from_attributes.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, names.SESV2EndpointID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckEmailIdentityDestroy(ctx), @@ -141,7 +141,7 @@ func TestAccSESV2EmailIdentityMailFromAttributes_mailFromDomain(t *testing.T) { resourceName := "aws_sesv2_email_identity_mail_from_attributes.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, names.SESV2EndpointID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckEmailIdentityDestroy(ctx), diff --git a/internal/service/sesv2/email_identity_test.go b/internal/service/sesv2/email_identity_test.go index 5a0eb10b7c94..5470b7b18ec2 100644 --- a/internal/service/sesv2/email_identity_test.go +++ b/internal/service/sesv2/email_identity_test.go @@ -25,7 +25,7 @@ func TestAccSESV2EmailIdentity_basic_emailAddress(t *testing.T) { resourceName := "aws_sesv2_email_identity.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, names.SESV2EndpointID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckEmailIdentityDestroy(ctx), @@ -62,7 +62,7 @@ func TestAccSESV2EmailIdentity_basic_domain(t *testing.T) { resourceName := "aws_sesv2_email_identity.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, names.SESV2EndpointID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckEmailIdentityDestroy(ctx), @@ -99,7 +99,7 @@ func TestAccSESV2EmailIdentity_disappears(t *testing.T) { resourceName := "aws_sesv2_email_identity.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, names.SESV2EndpointID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckEmailIdentityDestroy(ctx), @@ -122,7 +122,7 @@ func TestAccSESV2EmailIdentity_configurationSetName(t *testing.T) { resourceName := "aws_sesv2_email_identity.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, names.SESV2EndpointID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckEmailIdentityDestroy(ctx), @@ -156,7 +156,7 @@ func TestAccSESV2EmailIdentity_nextSigningKeyLength(t *testing.T) { resourceName := "aws_sesv2_email_identity.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, names.SESV2EndpointID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckEmailIdentityDestroy(ctx), @@ -198,7 +198,7 @@ func TestAccSESV2EmailIdentity_domainSigning(t *testing.T) { selector2 := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, names.SESV2EndpointID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckEmailIdentityDestroy(ctx), @@ -237,7 +237,7 @@ func TestAccSESV2EmailIdentity_tags(t *testing.T) { resourceName := "aws_sesv2_email_identity.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, names.SESV2EndpointID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckEmailIdentityDestroy(ctx), From 3909b992ff3fd50c9758c8da8f0fc82e2d0b1fc9 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Fri, 24 Feb 2023 16:37:28 -0500 Subject: [PATCH 240/763] Add 'Context' argument to 'acctest.PreCheck' for sfn. --- .../service/sfn/activity_data_source_test.go | 2 +- internal/service/sfn/activity_test.go | 6 +++--- .../sfn/state_machine_data_source_test.go | 2 +- internal/service/sfn/state_machine_test.go | 18 +++++++++--------- 4 files changed, 14 insertions(+), 14 deletions(-) diff --git a/internal/service/sfn/activity_data_source_test.go b/internal/service/sfn/activity_data_source_test.go index ef44c2f29462..65574294404d 100644 --- a/internal/service/sfn/activity_data_source_test.go +++ b/internal/service/sfn/activity_data_source_test.go @@ -17,7 +17,7 @@ func TestAccSFNActivityDataSource_basic(t *testing.T) { dataSource2Name := "data.aws_sfn_activity.by_arn" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, sfn.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ diff --git a/internal/service/sfn/activity_test.go b/internal/service/sfn/activity_test.go index f09e60e3b688..1ed3dbb8bf77 100644 --- a/internal/service/sfn/activity_test.go +++ b/internal/service/sfn/activity_test.go @@ -22,7 +22,7 @@ func TestAccSFNActivity_basic(t *testing.T) { resourceName := "aws_sfn_activity.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, sfn.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckActivityDestroy(ctx), @@ -51,7 +51,7 @@ func TestAccSFNActivity_disappears(t *testing.T) { resourceName := "aws_sfn_activity.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, sfn.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckActivityDestroy(ctx), @@ -74,7 +74,7 @@ func TestAccSFNActivity_tags(t *testing.T) { resourceName := "aws_sfn_activity.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, sfn.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckActivityDestroy(ctx), diff --git a/internal/service/sfn/state_machine_data_source_test.go b/internal/service/sfn/state_machine_data_source_test.go index a7e003765980..d171fdd6d023 100644 --- a/internal/service/sfn/state_machine_data_source_test.go +++ b/internal/service/sfn/state_machine_data_source_test.go @@ -15,7 +15,7 @@ func TestAccSFNStateMachineDataSource_basic(t *testing.T) { resourceName := "aws_sfn_state_machine.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, sfn.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ diff --git a/internal/service/sfn/state_machine_test.go b/internal/service/sfn/state_machine_test.go index 6588e3be3fe8..4d98922448dd 100644 --- a/internal/service/sfn/state_machine_test.go +++ b/internal/service/sfn/state_machine_test.go @@ -24,7 +24,7 @@ func TestAccSFNStateMachine_createUpdate(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, sfn.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckStateMachineDestroy(ctx), @@ -87,7 +87,7 @@ func TestAccSFNStateMachine_expressUpdate(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, sfn.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckStateMachineDestroy(ctx), @@ -128,7 +128,7 @@ func TestAccSFNStateMachine_standardUpdate(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, sfn.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckStateMachineDestroy(ctx), @@ -169,7 +169,7 @@ func TestAccSFNStateMachine_nameGenerated(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, sfn.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckStateMachineDestroy(ctx), @@ -198,7 +198,7 @@ func TestAccSFNStateMachine_namePrefix(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, sfn.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckStateMachineDestroy(ctx), @@ -227,7 +227,7 @@ func TestAccSFNStateMachine_tags(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, sfn.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckStateMachineDestroy(ctx), @@ -273,7 +273,7 @@ func TestAccSFNStateMachine_tracing(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, sfn.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckStateMachineDestroy(ctx), @@ -310,7 +310,7 @@ func TestAccSFNStateMachine_disappears(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, sfn.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckStateMachineDestroy(ctx), @@ -334,7 +334,7 @@ func TestAccSFNStateMachine_expressLogging(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, sfn.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckStateMachineDestroy(ctx), From ec026694a45e45a90d29eec0f5c65e0e2366d5bd Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Fri, 24 Feb 2023 16:37:28 -0500 Subject: [PATCH 241/763] Add 'Context' argument to 'acctest.PreCheck' for shield. --- internal/service/shield/protection_group_test.go | 14 +++++++------- .../protection_health_check_association_test.go | 4 ++-- internal/service/shield/protection_test.go | 16 ++++++++-------- 3 files changed, 17 insertions(+), 17 deletions(-) diff --git a/internal/service/shield/protection_group_test.go b/internal/service/shield/protection_group_test.go index a6d31f509578..43f040b5b071 100644 --- a/internal/service/shield/protection_group_test.go +++ b/internal/service/shield/protection_group_test.go @@ -24,7 +24,7 @@ func TestAccShieldProtectionGroup_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(shield.EndpointsID, t) testAccPreCheck(ctx, t) }, @@ -60,7 +60,7 @@ func TestAccShieldProtectionGroup_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(shield.EndpointsID, t) testAccPreCheck(ctx, t) }, @@ -87,7 +87,7 @@ func TestAccShieldProtectionGroup_aggregation(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(shield.EndpointsID, t) testAccPreCheck(ctx, t) }, @@ -130,7 +130,7 @@ func TestAccShieldProtectionGroup_members(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(shield.EndpointsID, t) testAccPreCheck(ctx, t) }, @@ -164,7 +164,7 @@ func TestAccShieldProtectionGroup_protectionGroupID(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(shield.EndpointsID, t) testAccPreCheck(ctx, t) }, @@ -207,7 +207,7 @@ func TestAccShieldProtectionGroup_resourceType(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(shield.EndpointsID, t) testAccPreCheck(ctx, t) }, @@ -252,7 +252,7 @@ func TestAccShieldProtectionGroup_tags(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(shield.EndpointsID, t) testAccPreCheck(ctx, t) }, diff --git a/internal/service/shield/protection_health_check_association_test.go b/internal/service/shield/protection_health_check_association_test.go index 60f24cae659e..8598eabbbaa8 100644 --- a/internal/service/shield/protection_health_check_association_test.go +++ b/internal/service/shield/protection_health_check_association_test.go @@ -23,7 +23,7 @@ func TestAccShieldProtectionHealthCheckAssociation_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(shield.EndpointsID, t) testAccPreCheck(ctx, t) }, @@ -53,7 +53,7 @@ func TestAccShieldProtectionHealthCheckAssociation_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(shield.EndpointsID, t) testAccPreCheck(ctx, t) }, diff --git a/internal/service/shield/protection_test.go b/internal/service/shield/protection_test.go index e1a9c5c02207..d0c3164ad230 100644 --- a/internal/service/shield/protection_test.go +++ b/internal/service/shield/protection_test.go @@ -25,7 +25,7 @@ func TestAccShieldProtection_globalAccelerator(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(shield.EndpointsID, t) testAccPreCheck(ctx, t) }, @@ -57,7 +57,7 @@ func TestAccShieldProtection_elasticIPAddress(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(shield.EndpointsID, t) testAccPreCheck(ctx, t) }, @@ -89,7 +89,7 @@ func TestAccShieldProtection_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(shield.EndpointsID, t) testAccPreCheck(ctx, t) }, @@ -116,7 +116,7 @@ func TestAccShieldProtection_alb(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(shield.EndpointsID, t) testAccPreCheck(ctx, t) }, @@ -148,7 +148,7 @@ func TestAccShieldProtection_elb(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(shield.EndpointsID, t) testAccPreCheck(ctx, t) }, @@ -180,7 +180,7 @@ func TestAccShieldProtection_cloudFront(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(shield.EndpointsID, t) acctest.PreCheckPartitionHasService(cloudfront.EndpointsID, t) testAccPreCheck(ctx, t) @@ -213,7 +213,7 @@ func TestAccShieldProtection_CloudFront_tags(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(shield.EndpointsID, t) acctest.PreCheckPartitionHasService(cloudfront.EndpointsID, t) testAccPreCheck(ctx, t) @@ -266,7 +266,7 @@ func TestAccShieldProtection_route53(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(shield.EndpointsID, t) testAccPreCheck(ctx, t) }, From 7d40ca2d902e7e718b53b0e9984154d592068415 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Fri, 24 Feb 2023 16:37:29 -0500 Subject: [PATCH 242/763] Add 'Context' argument to 'acctest.PreCheck' for signer. --- .../service/signer/signing_job_data_source_test.go | 2 +- internal/service/signer/signing_job_test.go | 2 +- .../service/signer/signing_profile_data_source_test.go | 2 +- .../service/signer/signing_profile_permission_test.go | 8 ++++---- internal/service/signer/signing_profile_test.go | 10 +++++----- 5 files changed, 12 insertions(+), 12 deletions(-) diff --git a/internal/service/signer/signing_job_data_source_test.go b/internal/service/signer/signing_job_data_source_test.go index 0a1923048083..4df87fdeb0b1 100644 --- a/internal/service/signer/signing_job_data_source_test.go +++ b/internal/service/signer/signing_job_data_source_test.go @@ -17,7 +17,7 @@ func TestAccSignerSigningJobDataSource_basic(t *testing.T) { resourceName := "aws_signer_signing_job.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckSingerSigningProfile(ctx, t, "AWSLambda-SHA384-ECDSA") }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckSingerSigningProfile(ctx, t, "AWSLambda-SHA384-ECDSA") }, ErrorCheck: acctest.ErrorCheck(t, signer.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ diff --git a/internal/service/signer/signing_job_test.go b/internal/service/signer/signing_job_test.go index df66bbe67e0a..6f01dceeda5f 100644 --- a/internal/service/signer/signing_job_test.go +++ b/internal/service/signer/signing_job_test.go @@ -24,7 +24,7 @@ func TestAccSignerSigningJob_basic(t *testing.T) { var conf signer.GetSigningProfileOutput resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckSingerSigningProfile(ctx, t, "AWSLambda-SHA384-ECDSA") }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckSingerSigningProfile(ctx, t, "AWSLambda-SHA384-ECDSA") }, ErrorCheck: acctest.ErrorCheck(t, signer.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: nil, diff --git a/internal/service/signer/signing_profile_data_source_test.go b/internal/service/signer/signing_profile_data_source_test.go index 4dc5a1148bb6..83bb76f2ff01 100644 --- a/internal/service/signer/signing_profile_data_source_test.go +++ b/internal/service/signer/signing_profile_data_source_test.go @@ -18,7 +18,7 @@ func TestAccSignerSigningProfileDataSource_basic(t *testing.T) { profileName := fmt.Sprintf("tf_acc_sp_basic_%s", rString) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckSingerSigningProfile(ctx, t, "AWSLambda-SHA384-ECDSA") }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckSingerSigningProfile(ctx, t, "AWSLambda-SHA384-ECDSA") }, ErrorCheck: acctest.ErrorCheck(t, signer.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ diff --git a/internal/service/signer/signing_profile_permission_test.go b/internal/service/signer/signing_profile_permission_test.go index b81181f553c6..ee0a3184183e 100644 --- a/internal/service/signer/signing_profile_permission_test.go +++ b/internal/service/signer/signing_profile_permission_test.go @@ -25,7 +25,7 @@ func TestAccSignerSigningProfilePermission_basic(t *testing.T) { var sppconf signer.ListProfilePermissionsOutput resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckSingerSigningProfile(ctx, t, "AWSLambda-SHA384-ECDSA") }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckSingerSigningProfile(ctx, t, "AWSLambda-SHA384-ECDSA") }, ErrorCheck: acctest.ErrorCheck(t, signer.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSigningProfileDestroy(ctx), @@ -60,7 +60,7 @@ func TestAccSignerSigningProfilePermission_getSigningProfile(t *testing.T) { var sppconf signer.ListProfilePermissionsOutput resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckSingerSigningProfile(ctx, t, "AWSLambda-SHA384-ECDSA") }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckSingerSigningProfile(ctx, t, "AWSLambda-SHA384-ECDSA") }, ErrorCheck: acctest.ErrorCheck(t, signer.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSigningProfileDestroy(ctx), @@ -103,7 +103,7 @@ func TestAccSignerSigningProfilePermission_StartSigningJob_getSP(t *testing.T) { var sppconf signer.ListProfilePermissionsOutput resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckSingerSigningProfile(ctx, t, "AWSLambda-SHA384-ECDSA") }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckSingerSigningProfile(ctx, t, "AWSLambda-SHA384-ECDSA") }, ErrorCheck: acctest.ErrorCheck(t, signer.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSigningProfileDestroy(ctx), @@ -138,7 +138,7 @@ func TestAccSignerSigningProfilePermission_statementPrefix(t *testing.T) { var sppconf signer.ListProfilePermissionsOutput resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckSingerSigningProfile(ctx, t, "AWSLambda-SHA384-ECDSA") }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckSingerSigningProfile(ctx, t, "AWSLambda-SHA384-ECDSA") }, ErrorCheck: acctest.ErrorCheck(t, signer.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSigningProfileDestroy(ctx), diff --git a/internal/service/signer/signing_profile_test.go b/internal/service/signer/signing_profile_test.go index d0f99d2978cc..e5bd5ce153ca 100644 --- a/internal/service/signer/signing_profile_test.go +++ b/internal/service/signer/signing_profile_test.go @@ -25,7 +25,7 @@ func TestAccSignerSigningProfile_basic(t *testing.T) { var conf signer.GetSigningProfileOutput resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckSingerSigningProfile(ctx, t, "AWSLambda-SHA384-ECDSA") }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckSingerSigningProfile(ctx, t, "AWSLambda-SHA384-ECDSA") }, ErrorCheck: acctest.ErrorCheck(t, signer.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSigningProfileDestroy(ctx), @@ -57,7 +57,7 @@ func TestAccSignerSigningProfile_generateNameWithNamePrefix(t *testing.T) { var conf signer.GetSigningProfileOutput resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckSingerSigningProfile(ctx, t, "AWSLambda-SHA384-ECDSA") }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckSingerSigningProfile(ctx, t, "AWSLambda-SHA384-ECDSA") }, ErrorCheck: acctest.ErrorCheck(t, signer.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSigningProfileDestroy(ctx), @@ -80,7 +80,7 @@ func TestAccSignerSigningProfile_generateName(t *testing.T) { var conf signer.GetSigningProfileOutput resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckSingerSigningProfile(ctx, t, "AWSLambda-SHA384-ECDSA") }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckSingerSigningProfile(ctx, t, "AWSLambda-SHA384-ECDSA") }, ErrorCheck: acctest.ErrorCheck(t, signer.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSigningProfileDestroy(ctx), @@ -104,7 +104,7 @@ func TestAccSignerSigningProfile_tags(t *testing.T) { var conf signer.GetSigningProfileOutput resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckSingerSigningProfile(ctx, t, "AWSLambda-SHA384-ECDSA") }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckSingerSigningProfile(ctx, t, "AWSLambda-SHA384-ECDSA") }, ErrorCheck: acctest.ErrorCheck(t, signer.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSigningProfileDestroy(ctx), @@ -136,7 +136,7 @@ func TestAccSignerSigningProfile_signatureValidityPeriod(t *testing.T) { var conf signer.GetSigningProfileOutput resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckSingerSigningProfile(ctx, t, "AWSLambda-SHA384-ECDSA") }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckSingerSigningProfile(ctx, t, "AWSLambda-SHA384-ECDSA") }, ErrorCheck: acctest.ErrorCheck(t, signer.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSigningProfileDestroy(ctx), From 3c40b8dff13e49e11587b63d5d46c33fc47989bf Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Fri, 24 Feb 2023 16:37:29 -0500 Subject: [PATCH 243/763] Add 'Context' argument to 'acctest.PreCheck' for simpledb. --- internal/service/simpledb/domain_test.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/internal/service/simpledb/domain_test.go b/internal/service/simpledb/domain_test.go index 269bdf4b4e5f..61dbe0ef6318 100644 --- a/internal/service/simpledb/domain_test.go +++ b/internal/service/simpledb/domain_test.go @@ -21,7 +21,7 @@ func TestAccSimpleDBDomain_basic(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(simpledb.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(simpledb.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, simpledb.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDomainDestroy(ctx), @@ -48,7 +48,7 @@ func TestAccSimpleDBDomain_disappears(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(simpledb.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(simpledb.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, simpledb.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDomainDestroy(ctx), @@ -71,7 +71,7 @@ func TestAccSimpleDBDomain_MigrateFromPluginSDK(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(simpledb.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(simpledb.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, simpledb.EndpointsID), CheckDestroy: testAccCheckDomainDestroy(ctx), Steps: []resource.TestStep{ From 654751e843557f37ff9ad6014ea05a1c6ef2671c Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Fri, 24 Feb 2023 16:37:29 -0500 Subject: [PATCH 244/763] Add 'Context' argument to 'acctest.PreCheck' for sns. --- .../service/sns/platform_application_test.go | 12 +++---- internal/service/sns/sms_preferences_test.go | 6 ++-- .../service/sns/topic_data_source_test.go | 2 +- internal/service/sns/topic_policy_test.go | 10 +++--- .../service/sns/topic_subscription_test.go | 26 +++++++-------- internal/service/sns/topic_test.go | 32 +++++++++---------- 6 files changed, 44 insertions(+), 44 deletions(-) diff --git a/internal/service/sns/platform_application_test.go b/internal/service/sns/platform_application_test.go index 616cee257ccf..3e57f93c9daf 100644 --- a/internal/service/sns/platform_application_test.go +++ b/internal/service/sns/platform_application_test.go @@ -182,7 +182,7 @@ func TestAccSNSPlatformApplication_GCM_basic(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, sns.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckPlatformApplicationDestroy(ctx), @@ -227,7 +227,7 @@ func TestAccSNSPlatformApplication_disappears(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, sns.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckPlatformApplicationDestroy(ctx), @@ -260,7 +260,7 @@ func TestAccSNSPlatformApplication_GCM_allAttributes(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, sns.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckPlatformApplicationDestroy(ctx), @@ -325,7 +325,7 @@ func TestAccSNSPlatformApplication_basic(t *testing.T) { t.Run(platform.Name, func(*testing.T) { resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, sns.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckPlatformApplicationDestroy(ctx), @@ -379,7 +379,7 @@ func TestAccSNSPlatformApplication_basicAttributes(t *testing.T) { name := fmt.Sprintf("tf-acc-%d", sdkacctest.RandInt()) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, sns.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckPlatformApplicationDestroy(ctx), @@ -426,7 +426,7 @@ func TestAccSNSPlatformApplication_basicApnsWithTokenCredentials(t *testing.T) { t.Run(platform.Name, func(*testing.T) { resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, sns.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckPlatformApplicationDestroy(ctx), diff --git a/internal/service/sns/sms_preferences_test.go b/internal/service/sns/sms_preferences_test.go index 29360850b3f0..c76fa133e2a1 100644 --- a/internal/service/sns/sms_preferences_test.go +++ b/internal/service/sns/sms_preferences_test.go @@ -34,7 +34,7 @@ func testAccSMSPreferences_defaultSMSType(t *testing.T) { resourceName := "aws_sns_sms_preferences.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, sns.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSMSPreferencesDestroy(ctx), @@ -59,7 +59,7 @@ func testAccSMSPreferences_almostAll(t *testing.T) { resourceName := "aws_sns_sms_preferences.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, sns.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSMSPreferencesDestroy(ctx), @@ -83,7 +83,7 @@ func testAccSMSPreferences_deliveryRole(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, sns.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSMSPreferencesDestroy(ctx), diff --git a/internal/service/sns/topic_data_source_test.go b/internal/service/sns/topic_data_source_test.go index 7afd83951aae..19533700f052 100644 --- a/internal/service/sns/topic_data_source_test.go +++ b/internal/service/sns/topic_data_source_test.go @@ -16,7 +16,7 @@ func TestAccSNSTopicDataSource_basic(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, sns.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ diff --git a/internal/service/sns/topic_policy_test.go b/internal/service/sns/topic_policy_test.go index 505cee02bd1c..e4fc6d73a009 100644 --- a/internal/service/sns/topic_policy_test.go +++ b/internal/service/sns/topic_policy_test.go @@ -23,7 +23,7 @@ func TestAccSNSTopicPolicy_basic(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, sns.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTopicPolicyDestroy(ctx), @@ -53,7 +53,7 @@ func TestAccSNSTopicPolicy_updated(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, sns.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTopicPolicyDestroy(ctx), @@ -89,7 +89,7 @@ func TestAccSNSTopicPolicy_Disappears_topic(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, sns.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTopicPolicyDestroy(ctx), @@ -113,7 +113,7 @@ func TestAccSNSTopicPolicy_disappears(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, sns.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTopicPolicyDestroy(ctx), @@ -137,7 +137,7 @@ func TestAccSNSTopicPolicy_ignoreEquivalent(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, sns.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTopicPolicyDestroy(ctx), diff --git a/internal/service/sns/topic_subscription_test.go b/internal/service/sns/topic_subscription_test.go index 84e185dbf3da..df9d8c18b116 100644 --- a/internal/service/sns/topic_subscription_test.go +++ b/internal/service/sns/topic_subscription_test.go @@ -75,7 +75,7 @@ func TestAccSNSTopicSubscription_basic(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, sns.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTopicSubscriptionDestroy(ctx), @@ -118,7 +118,7 @@ func TestAccSNSTopicSubscription_filterPolicy(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, sns.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTopicSubscriptionDestroy(ctx), @@ -169,7 +169,7 @@ func TestAccSNSTopicSubscription_filterPolicyScope(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, sns.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTopicSubscriptionDestroy(ctx), @@ -338,7 +338,7 @@ func TestAccSNSTopicSubscription_filterPolicyScope_policyNotSet(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, sns.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTopicSubscriptionDestroy(ctx), @@ -358,7 +358,7 @@ func TestAccSNSTopicSubscription_deliveryPolicy(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, sns.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTopicSubscriptionDestroy(ctx), @@ -420,7 +420,7 @@ func TestAccSNSTopicSubscription_redrivePolicy(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, sns.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTopicSubscriptionDestroy(ctx), @@ -477,7 +477,7 @@ func TestAccSNSTopicSubscription_rawMessageDelivery(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, sns.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTopicSubscriptionDestroy(ctx), @@ -525,7 +525,7 @@ func TestAccSNSTopicSubscription_autoConfirmingEndpoint(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckAPIGatewayTypeEDGE(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckAPIGatewayTypeEDGE(t) }, ErrorCheck: acctest.ErrorCheck(t, sns.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTopicSubscriptionDestroy(ctx), @@ -556,7 +556,7 @@ func TestAccSNSTopicSubscription_autoConfirmingSecuredEndpoint(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckAPIGatewayTypeEDGE(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckAPIGatewayTypeEDGE(t) }, ErrorCheck: acctest.ErrorCheck(t, sns.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTopicSubscriptionDestroy(ctx), @@ -587,7 +587,7 @@ func TestAccSNSTopicSubscription_email(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, sns.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTopicSubscriptionDestroy(ctx), @@ -618,7 +618,7 @@ func TestAccSNSTopicSubscription_firehose(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, sns.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTopicSubscriptionDestroy(ctx), @@ -648,7 +648,7 @@ func TestAccSNSTopicSubscription_disappears(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, sns.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTopicSubscriptionDestroy(ctx), @@ -672,7 +672,7 @@ func TestAccSNSTopicSubscription_Disappears_topic(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, sns.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTopicSubscriptionDestroy(ctx), diff --git a/internal/service/sns/topic_test.go b/internal/service/sns/topic_test.go index 577607d3112a..ca1c7945ea0e 100644 --- a/internal/service/sns/topic_test.go +++ b/internal/service/sns/topic_test.go @@ -35,7 +35,7 @@ func TestAccSNSTopic_basic(t *testing.T) { resourceName := "aws_sns_topic.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, sns.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTopicDestroy(ctx), @@ -89,7 +89,7 @@ func TestAccSNSTopic_disappears(t *testing.T) { resourceName := "aws_sns_topic.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, sns.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTopicDestroy(ctx), @@ -113,7 +113,7 @@ func TestAccSNSTopic_name(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, sns.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTopicDestroy(ctx), @@ -142,7 +142,7 @@ func TestAccSNSTopic_namePrefix(t *testing.T) { rName := "tf-acc-test-prefix-" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, sns.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTopicDestroy(ctx), @@ -172,7 +172,7 @@ func TestAccSNSTopic_tags(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, sns.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTopicDestroy(ctx), @@ -219,7 +219,7 @@ func TestAccSNSTopic_policy(t *testing.T) { expectedPolicy := fmt.Sprintf(`{"Statement":[{"Sid":"Stmt1445931846145","Effect":"Allow","Principal":{"AWS":"*"},"Action":"sns:Publish","Resource":"arn:%s:sns:%s::example"}],"Version":"2012-10-17","Id":"Policy1445931846145"}`, acctest.Partition(), acctest.Region()) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, sns.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTopicDestroy(ctx), @@ -247,7 +247,7 @@ func TestAccSNSTopic_withIAMRole(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, sns.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTopicDestroy(ctx), @@ -273,7 +273,7 @@ func TestAccSNSTopic_withFakeIAMRole(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, sns.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTopicDestroy(ctx), @@ -294,7 +294,7 @@ func TestAccSNSTopic_withDeliveryPolicy(t *testing.T) { expectedPolicy := `{"http":{"defaultHealthyRetryPolicy": {"minDelayTarget": 20,"maxDelayTarget": 20,"numMaxDelayRetries": 0,"numRetries": 3,"numNoDelayRetries": 0,"numMinDelayRetries": 0,"backoffFunction": "linear"},"disableSubscriptionOverrides": false}}` resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, sns.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTopicDestroy(ctx), @@ -323,7 +323,7 @@ func TestAccSNSTopic_deliveryStatus(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, sns.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTopicDestroy(ctx), @@ -365,7 +365,7 @@ func TestAccSNSTopic_NameGenerated_fifoTopic(t *testing.T) { resourceName := "aws_sns_topic.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, sns.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTopicDestroy(ctx), @@ -395,7 +395,7 @@ func TestAccSNSTopic_Name_fifoTopic(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) + tfsns.FIFOTopicNameSuffix resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, sns.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTopicDestroy(ctx), @@ -424,7 +424,7 @@ func TestAccSNSTopic_NamePrefix_fifoTopic(t *testing.T) { rName := "tf-acc-test-prefix-" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, sns.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTopicDestroy(ctx), @@ -454,7 +454,7 @@ func TestAccSNSTopic_fifoWithContentBasedDeduplication(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, sns.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTopicDestroy(ctx), @@ -489,7 +489,7 @@ func TestAccSNSTopic_fifoExpectContentBasedDeduplicationError(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, sns.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTopicDestroy(ctx), @@ -509,7 +509,7 @@ func TestAccSNSTopic_encryption(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, sns.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTopicDestroy(ctx), From add49f844fabae84f087353eca49d3dbe2d714a9 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Fri, 24 Feb 2023 16:37:30 -0500 Subject: [PATCH 245/763] Add 'Context' argument to 'acctest.PreCheck' for sqs. --- .../service/sqs/queue_data_source_test.go | 4 +- internal/service/sqs/queue_policy_test.go | 8 ++-- .../sqs/queue_redrive_allow_policy_test.go | 8 ++-- .../service/sqs/queue_redrive_policy_test.go | 8 ++-- internal/service/sqs/queue_test.go | 44 +++++++++---------- .../service/sqs/queues_data_source_test.go | 2 +- 6 files changed, 37 insertions(+), 37 deletions(-) diff --git a/internal/service/sqs/queue_data_source_test.go b/internal/service/sqs/queue_data_source_test.go index 926ed7beebd3..20c5589133eb 100644 --- a/internal/service/sqs/queue_data_source_test.go +++ b/internal/service/sqs/queue_data_source_test.go @@ -17,7 +17,7 @@ func TestAccSQSQueueDataSource_basic(t *testing.T) { datasourceName := "data.aws_sqs_queue.by_name" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, sqs.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ @@ -38,7 +38,7 @@ func TestAccSQSQueueDataSource_tags(t *testing.T) { datasourceName := "data.aws_sqs_queue.by_name" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, sqs.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ diff --git a/internal/service/sqs/queue_policy_test.go b/internal/service/sqs/queue_policy_test.go index 16693a0bdec5..8397b9b86db2 100644 --- a/internal/service/sqs/queue_policy_test.go +++ b/internal/service/sqs/queue_policy_test.go @@ -19,7 +19,7 @@ func TestAccSQSQueuePolicy_basic(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, sqs.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckQueueDestroy(ctx), @@ -55,7 +55,7 @@ func TestAccSQSQueuePolicy_disappears(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, sqs.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckQueueDestroy(ctx), @@ -79,7 +79,7 @@ func TestAccSQSQueuePolicy_Disappears_queue(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, sqs.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckQueueDestroy(ctx), @@ -104,7 +104,7 @@ func TestAccSQSQueuePolicy_update(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, sqs.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckQueueDestroy(ctx), diff --git a/internal/service/sqs/queue_redrive_allow_policy_test.go b/internal/service/sqs/queue_redrive_allow_policy_test.go index f82d2d5531a8..9711b473b034 100644 --- a/internal/service/sqs/queue_redrive_allow_policy_test.go +++ b/internal/service/sqs/queue_redrive_allow_policy_test.go @@ -19,7 +19,7 @@ func TestAccSQSQueueRedriveAllowPolicy_basic(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, sqs.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckQueueDestroy(ctx), @@ -55,7 +55,7 @@ func TestAccSQSQueueRedriveAllowPolicy_disappears(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, sqs.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckQueueDestroy(ctx), @@ -79,7 +79,7 @@ func TestAccSQSQueueRedriveAllowPolicy_Disappears_queue(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, sqs.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckQueueDestroy(ctx), @@ -104,7 +104,7 @@ func TestAccSQSQueueRedriveAllowPolicy_update(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, sqs.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckQueueDestroy(ctx), diff --git a/internal/service/sqs/queue_redrive_policy_test.go b/internal/service/sqs/queue_redrive_policy_test.go index 8a5bf16cba3c..100562cdf78e 100644 --- a/internal/service/sqs/queue_redrive_policy_test.go +++ b/internal/service/sqs/queue_redrive_policy_test.go @@ -19,7 +19,7 @@ func TestAccSQSQueueRedrivePolicy_basic(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, sqs.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckQueueDestroy(ctx), @@ -56,7 +56,7 @@ func TestAccSQSQueueRedrivePolicy_disappears(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, sqs.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckQueueDestroy(ctx), @@ -81,7 +81,7 @@ func TestAccSQSQueueRedrivePolicy_Disappears_queue(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, sqs.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckQueueDestroy(ctx), @@ -106,7 +106,7 @@ func TestAccSQSQueueRedrivePolicy_update(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, sqs.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckQueueDestroy(ctx), diff --git a/internal/service/sqs/queue_test.go b/internal/service/sqs/queue_test.go index 3f831b8ff5a8..4a4ddcd4c808 100644 --- a/internal/service/sqs/queue_test.go +++ b/internal/service/sqs/queue_test.go @@ -35,7 +35,7 @@ func TestAccSQSQueue_basic(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, sqs.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckQueueDestroy(ctx), @@ -81,7 +81,7 @@ func TestAccSQSQueue_disappears(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, sqs.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckQueueDestroy(ctx), @@ -104,7 +104,7 @@ func TestAccSQSQueue_Name_generated(t *testing.T) { resourceName := "aws_sqs_queue.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, ErrorCheck: acctest.ErrorCheck(t, sqs.EndpointsID), CheckDestroy: testAccCheckQueueDestroy(ctx), @@ -133,7 +133,7 @@ func TestAccSQSQueue_NameGenerated_fifoQueue(t *testing.T) { resourceName := "aws_sqs_queue.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, ErrorCheck: acctest.ErrorCheck(t, sqs.EndpointsID), CheckDestroy: testAccCheckQueueDestroy(ctx), @@ -162,7 +162,7 @@ func TestAccSQSQueue_namePrefix(t *testing.T) { resourceName := "aws_sqs_queue.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, sqs.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckQueueDestroy(ctx), @@ -191,7 +191,7 @@ func TestAccSQSQueue_NamePrefix_fifoQueue(t *testing.T) { resourceName := "aws_sqs_queue.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, sqs.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckQueueDestroy(ctx), @@ -221,7 +221,7 @@ func TestAccSQSQueue_tags(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, sqs.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckQueueDestroy(ctx), @@ -267,7 +267,7 @@ func TestAccSQSQueue_update(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, sqs.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckQueueDestroy(ctx), @@ -351,7 +351,7 @@ func TestAccSQSQueue_Policy_basic(t *testing.T) { ` resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, sqs.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckQueueDestroy(ctx), @@ -405,7 +405,7 @@ func TestAccSQSQueue_Policy_ignoreEquivalent(t *testing.T) { ` resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, sqs.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckQueueDestroy(ctx), @@ -437,7 +437,7 @@ func TestAccSQSQueue_recentlyDeleted(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, sqs.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckQueueDestroy(ctx), @@ -467,7 +467,7 @@ func TestAccSQSQueue_redrivePolicy(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, sqs.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckQueueDestroy(ctx), @@ -497,7 +497,7 @@ func TestAccSQSQueue_redriveAllowPolicy(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, sqs.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckQueueDestroy(ctx), @@ -527,7 +527,7 @@ func TestAccSQSQueue_fifoQueue(t *testing.T) { rName := fmt.Sprintf("%s.fifo", sdkacctest.RandomWithPrefix(acctest.ResourcePrefix)) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, sqs.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckQueueDestroy(ctx), @@ -555,7 +555,7 @@ func TestAccSQSQueue_FIFOQueue_expectNameError(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, sqs.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckQueueDestroy(ctx), @@ -575,7 +575,7 @@ func TestAccSQSQueue_FIFOQueue_contentBasedDeduplication(t *testing.T) { rName := fmt.Sprintf("%s.fifo", sdkacctest.RandomWithPrefix(acctest.ResourcePrefix)) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, sqs.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckQueueDestroy(ctx), @@ -604,7 +604,7 @@ func TestAccSQSQueue_FIFOQueue_highThroughputMode(t *testing.T) { rName := fmt.Sprintf("%s.fifo", sdkacctest.RandomWithPrefix(acctest.ResourcePrefix)) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, sqs.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckQueueDestroy(ctx), @@ -641,7 +641,7 @@ func TestAccSQSQueue_StandardQueue_expectContentBasedDeduplicationError(t *testi rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, sqs.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckQueueDestroy(ctx), @@ -661,7 +661,7 @@ func TestAccSQSQueue_encryption(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, sqs.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckQueueDestroy(ctx), @@ -709,7 +709,7 @@ func TestAccSQSQueue_managedEncryption(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, sqs.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckQueueDestroy(ctx), @@ -751,7 +751,7 @@ func TestAccSQSQueue_zeroVisibilityTimeoutSeconds(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, sqs.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckQueueDestroy(ctx), @@ -780,7 +780,7 @@ func TestAccSQSQueue_defaultKMSDataKeyReusePeriodSeconds(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, sqs.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckQueueDestroy(ctx), diff --git a/internal/service/sqs/queues_data_source_test.go b/internal/service/sqs/queues_data_source_test.go index 56291a7984c3..8fb7801af42f 100644 --- a/internal/service/sqs/queues_data_source_test.go +++ b/internal/service/sqs/queues_data_source_test.go @@ -18,7 +18,7 @@ func TestAccSQSQueuesDataSource_queueNamePrefix(t *testing.T) { resourceName := "aws_sqs_queue.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, sqs.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ From 027023c14203c61b3e5195c855790176756c792b Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Fri, 24 Feb 2023 16:37:30 -0500 Subject: [PATCH 246/763] Add 'Context' argument to 'acctest.PreCheck' for ssm. --- internal/service/ssm/activation_test.go | 8 ++-- internal/service/ssm/association_test.go | 32 ++++++------- .../ssm/default_patch_baseline_test.go | 16 +++---- .../service/ssm/document_data_source_test.go | 4 +- internal/service/ssm/document_test.go | 34 ++++++------- .../service/ssm/instances_data_source_test.go | 2 +- .../ssm/maintenance_window_target_test.go | 14 +++--- .../ssm/maintenance_window_task_test.go | 26 +++++----- .../service/ssm/maintenance_window_test.go | 26 +++++----- .../maintenance_windows_data_source_test.go | 2 +- .../service/ssm/parameter_data_source_test.go | 4 +- internal/service/ssm/parameter_test.go | 48 +++++++++---------- .../parameters_by_path_data_source_test.go | 4 +- .../ssm/patch_baseline_data_source_test.go | 4 +- internal/service/ssm/patch_baseline_test.go | 18 +++---- internal/service/ssm/patch_group_test.go | 6 +-- .../service/ssm/resource_data_sync_test.go | 4 +- internal/service/ssm/service_setting_test.go | 2 +- 18 files changed, 127 insertions(+), 127 deletions(-) diff --git a/internal/service/ssm/activation_test.go b/internal/service/ssm/activation_test.go index 57461b388550..9f4549e918cb 100644 --- a/internal/service/ssm/activation_test.go +++ b/internal/service/ssm/activation_test.go @@ -23,7 +23,7 @@ func TestAccSSMActivation_basic(t *testing.T) { resourceName := "aws_ssm_activation.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ssm.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckActivationDestroy(ctx), @@ -56,7 +56,7 @@ func TestAccSSMActivation_update(t *testing.T) { resourceName := "aws_ssm_activation.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ssm.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckActivationDestroy(ctx), @@ -109,7 +109,7 @@ func TestAccSSMActivation_expirationDate(t *testing.T) { resourceName := "aws_ssm_activation.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ssm.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckActivationDestroy(ctx), @@ -141,7 +141,7 @@ func TestAccSSMActivation_disappears(t *testing.T) { resourceName := "aws_ssm_activation.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ssm.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckActivationDestroy(ctx), diff --git a/internal/service/ssm/association_test.go b/internal/service/ssm/association_test.go index 5a776894fbf8..66bb6b44aad4 100644 --- a/internal/service/ssm/association_test.go +++ b/internal/service/ssm/association_test.go @@ -23,7 +23,7 @@ func TestAccSSMAssociation_basic(t *testing.T) { resourceName := "aws_ssm_association.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ssm.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckAssociationDestroy(ctx), @@ -60,7 +60,7 @@ func TestAccSSMAssociation_disappears(t *testing.T) { resourceName := "aws_ssm_association.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ssm.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckAssociationDestroy(ctx), @@ -83,7 +83,7 @@ func TestAccSSMAssociation_disappears_document(t *testing.T) { resourceName := "aws_ssm_association.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ssm.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckAssociationDestroy(ctx), @@ -106,7 +106,7 @@ func TestAccSSMAssociation_applyOnlyAtCronInterval(t *testing.T) { resourceName := "aws_ssm_association.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ssm.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckAssociationDestroy(ctx), @@ -160,7 +160,7 @@ targets { ` resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ssm.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckAssociationDestroy(ctx), @@ -209,7 +209,7 @@ func TestAccSSMAssociation_withParameters(t *testing.T) { resourceName := "aws_ssm_association.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ssm.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckAssociationDestroy(ctx), @@ -246,7 +246,7 @@ func TestAccSSMAssociation_withAssociationName(t *testing.T) { resourceName := "aws_ssm_association.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ssm.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckAssociationDestroy(ctx), @@ -283,7 +283,7 @@ func TestAccSSMAssociation_withAssociationNameAndScheduleExpression(t *testing.T scheduleExpression2 := "cron(0 16 ? * WED *)" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ssm.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckAssociationDestroy(ctx), @@ -319,7 +319,7 @@ func TestAccSSMAssociation_withDocumentVersion(t *testing.T) { resourceName := "aws_ssm_association.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ssm.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckAssociationDestroy(ctx), @@ -346,7 +346,7 @@ func TestAccSSMAssociation_withOutputLocation(t *testing.T) { resourceName := "aws_ssm_association.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ssm.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckAssociationDestroy(ctx), @@ -390,7 +390,7 @@ func TestAccSSMAssociation_withOutputLocation_s3Region(t *testing.T) { resourceName := "aws_ssm_association.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckMultipleRegion(t, 2) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckMultipleRegion(t, 2) }, ErrorCheck: acctest.ErrorCheck(t, ssm.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckAssociationDestroy(ctx), @@ -441,7 +441,7 @@ func TestAccSSMAssociation_withOutputLocation_waitForSuccessTimeout(t *testing.T resourceName := "aws_ssm_association.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckMultipleRegion(t, 2) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckMultipleRegion(t, 2) }, ErrorCheck: acctest.ErrorCheck(t, ssm.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckAssociationDestroy(ctx), @@ -470,7 +470,7 @@ func TestAccSSMAssociation_withAutomationTargetParamName(t *testing.T) { resourceName := "aws_ssm_association.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ssm.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckAssociationDestroy(ctx), @@ -505,7 +505,7 @@ func TestAccSSMAssociation_withScheduleExpression(t *testing.T) { resourceName := "aws_ssm_association.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ssm.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckAssociationDestroy(ctx), @@ -542,7 +542,7 @@ func TestAccSSMAssociation_withComplianceSeverity(t *testing.T) { resourceName := "aws_ssm_association.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ssm.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckAssociationDestroy(ctx), @@ -578,7 +578,7 @@ func TestAccSSMAssociation_rateControl(t *testing.T) { resourceName := "aws_ssm_association.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ssm.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckAssociationDestroy(ctx), diff --git a/internal/service/ssm/default_patch_baseline_test.go b/internal/service/ssm/default_patch_baseline_test.go index 1403781c2d42..e4fa8b44b998 100644 --- a/internal/service/ssm/default_patch_baseline_test.go +++ b/internal/service/ssm/default_patch_baseline_test.go @@ -30,7 +30,7 @@ func testAccSSMDefaultPatchBaseline_basic(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(names.SSMEndpointID, t) }, ErrorCheck: acctest.ErrorCheck(t, names.SSMEndpointID), @@ -70,7 +70,7 @@ func testAccSSMDefaultPatchBaseline_disappears(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(names.SSMEndpointID, t) }, ErrorCheck: acctest.ErrorCheck(t, names.SSMEndpointID), @@ -98,7 +98,7 @@ func testAccSSMDefaultPatchBaseline_patchBaselineARN(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(names.SSMEndpointID, t) }, ErrorCheck: acctest.ErrorCheck(t, names.SSMEndpointID), @@ -139,7 +139,7 @@ func testAccSSMDefaultPatchBaseline_otherOperatingSystem(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(names.SSMEndpointID, t) }, ErrorCheck: acctest.ErrorCheck(t, names.SSMEndpointID), @@ -177,7 +177,7 @@ func testAccSSMDefaultPatchBaseline_wrongOperatingSystem(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(names.SSMEndpointID, t) }, ErrorCheck: acctest.ErrorCheck(t, names.SSMEndpointID), @@ -200,7 +200,7 @@ func testAccSSMDefaultPatchBaseline_systemDefault(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(names.SSMEndpointID, t) }, ErrorCheck: acctest.ErrorCheck(t, names.SSMEndpointID), @@ -242,7 +242,7 @@ func testAccSSMDefaultPatchBaseline_update(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(names.SSMEndpointID, t) }, ErrorCheck: acctest.ErrorCheck(t, names.SSMEndpointID), @@ -293,7 +293,7 @@ func testAccSSMDefaultPatchBaseline_multiRegion(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(names.SSMEndpointID, t) acctest.PreCheckMultipleRegion(t, 2) }, diff --git a/internal/service/ssm/document_data_source_test.go b/internal/service/ssm/document_data_source_test.go index 652fc2d686be..198c7c107d37 100644 --- a/internal/service/ssm/document_data_source_test.go +++ b/internal/service/ssm/document_data_source_test.go @@ -15,7 +15,7 @@ func TestAccSSMDocumentDataSource_basic(t *testing.T) { name := fmt.Sprintf("test_document-%d", sdkacctest.RandInt()) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ssm.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ @@ -49,7 +49,7 @@ func TestAccSSMDocumentDataSource_managed(t *testing.T) { resourceName := "data.aws_ssm_document.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ssm.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ diff --git a/internal/service/ssm/document_test.go b/internal/service/ssm/document_test.go index bee93e7ff30a..05b4f5fe821b 100644 --- a/internal/service/ssm/document_test.go +++ b/internal/service/ssm/document_test.go @@ -21,7 +21,7 @@ func TestAccSSMDocument_basic(t *testing.T) { name := sdkacctest.RandString(10) resourceName := "aws_ssm_document.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ssm.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDocumentDestroy(ctx), @@ -54,7 +54,7 @@ func TestAccSSMDocument_name(t *testing.T) { resourceName := "aws_ssm_document.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ssm.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDocumentDestroy(ctx), @@ -87,7 +87,7 @@ func TestAccSSMDocument_Target_type(t *testing.T) { name := sdkacctest.RandString(10) resourceName := "aws_ssm_document.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ssm.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDocumentDestroy(ctx), @@ -120,7 +120,7 @@ func TestAccSSMDocument_versionName(t *testing.T) { name := sdkacctest.RandString(10) resourceName := "aws_ssm_document.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ssm.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDocumentDestroy(ctx), @@ -153,7 +153,7 @@ func TestAccSSMDocument_update(t *testing.T) { name := sdkacctest.RandString(10) resourceName := "aws_ssm_document.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ssm.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDocumentDestroy(ctx), @@ -189,7 +189,7 @@ func TestAccSSMDocument_Permission_public(t *testing.T) { name := sdkacctest.RandString(10) resourceName := "aws_ssm_document.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ssm.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDocumentDestroy(ctx), @@ -217,7 +217,7 @@ func TestAccSSMDocument_Permission_private(t *testing.T) { resourceName := "aws_ssm_document.test" ids := "123456789012" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ssm.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDocumentDestroy(ctx), @@ -244,7 +244,7 @@ func TestAccSSMDocument_Permission_batching(t *testing.T) { resourceName := "aws_ssm_document.test" ids := "123456789012,123456789013,123456789014,123456789015,123456789016,123456789017,123456789018,123456789019,123456789020,123456789021,123456789022,123456789023,123456789024,123456789025,123456789026,123456789027,123456789028,123456789029,123456789030,123456789031,123456789032" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ssm.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDocumentDestroy(ctx), @@ -273,7 +273,7 @@ func TestAccSSMDocument_Permission_change(t *testing.T) { idsRemove := "123456789012" idsAdd := "123456789012,123456789014" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ssm.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDocumentDestroy(ctx), @@ -316,7 +316,7 @@ func TestAccSSMDocument_params(t *testing.T) { name := sdkacctest.RandString(10) resourceName := "aws_ssm_document.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ssm.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDocumentDestroy(ctx), @@ -347,7 +347,7 @@ func TestAccSSMDocument_automation(t *testing.T) { name := sdkacctest.RandString(10) resourceName := "aws_ssm_document.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ssm.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDocumentDestroy(ctx), @@ -376,7 +376,7 @@ func TestAccSSMDocument_package(t *testing.T) { resourceName := "aws_ssm_document.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ssm.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDocumentDestroy(ctx), @@ -411,7 +411,7 @@ func TestAccSSMDocument_SchemaVersion_1(t *testing.T) { resourceName := "aws_ssm_document.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ssm.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDocumentDestroy(ctx), @@ -444,7 +444,7 @@ func TestAccSSMDocument_session(t *testing.T) { name := sdkacctest.RandString(10) resourceName := "aws_ssm_document.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ssm.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDocumentDestroy(ctx), @@ -492,7 +492,7 @@ mainSteps: - Get-Process ` resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ssm.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDocumentDestroy(ctx), @@ -528,7 +528,7 @@ func TestAccSSMDocument_tags(t *testing.T) { resourceName := "aws_ssm_document.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ssm.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDocumentDestroy(ctx), @@ -572,7 +572,7 @@ func TestAccSSMDocument_disappears(t *testing.T) { name := sdkacctest.RandString(10) resourceName := "aws_ssm_document.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ssm.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDocumentDestroy(ctx), diff --git a/internal/service/ssm/instances_data_source_test.go b/internal/service/ssm/instances_data_source_test.go index d5f7d08a5209..5a27672d88ac 100644 --- a/internal/service/ssm/instances_data_source_test.go +++ b/internal/service/ssm/instances_data_source_test.go @@ -27,7 +27,7 @@ func TestAccSSMInstancesDataSource_filter(t *testing.T) { } resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ssm.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ diff --git a/internal/service/ssm/maintenance_window_target_test.go b/internal/service/ssm/maintenance_window_target_test.go index a4446c3ce604..f93a1ca34e2b 100644 --- a/internal/service/ssm/maintenance_window_target_test.go +++ b/internal/service/ssm/maintenance_window_target_test.go @@ -23,7 +23,7 @@ func TestAccSSMMaintenanceWindowTarget_basic(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resourceName := "aws_ssm_maintenance_window_target.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ssm.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckMaintenanceWindowTargetDestroy(ctx), @@ -60,7 +60,7 @@ func TestAccSSMMaintenanceWindowTarget_noNameOrDescription(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resourceName := "aws_ssm_maintenance_window_target.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ssm.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckMaintenanceWindowTargetDestroy(ctx), @@ -92,7 +92,7 @@ func TestAccSSMMaintenanceWindowTarget_validation(t *testing.T) { ctx := acctest.Context(t) name := sdkacctest.RandString(10) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ssm.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckMaintenanceWindowTargetDestroy(ctx), @@ -119,7 +119,7 @@ func TestAccSSMMaintenanceWindowTarget_update(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resourceName := "aws_ssm_maintenance_window_target.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ssm.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckMaintenanceWindowTargetDestroy(ctx), @@ -176,7 +176,7 @@ func TestAccSSMMaintenanceWindowTarget_resourceGroup(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resourceName := "aws_ssm_maintenance_window_target.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ssm.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckMaintenanceWindowTargetDestroy(ctx), @@ -212,7 +212,7 @@ func TestAccSSMMaintenanceWindowTarget_disappears(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resourceName := "aws_ssm_maintenance_window_target.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ssm.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckMaintenanceWindowTargetDestroy(ctx), @@ -235,7 +235,7 @@ func TestAccSSMMaintenanceWindowTarget_Disappears_window(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resourceName := "aws_ssm_maintenance_window_target.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ssm.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckMaintenanceWindowTargetDestroy(ctx), diff --git a/internal/service/ssm/maintenance_window_task_test.go b/internal/service/ssm/maintenance_window_task_test.go index 492eb84eb710..00ceaf2d1b4b 100644 --- a/internal/service/ssm/maintenance_window_task_test.go +++ b/internal/service/ssm/maintenance_window_task_test.go @@ -24,7 +24,7 @@ func TestAccSSMMaintenanceWindowTask_basic(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ssm.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckMaintenanceWindowTaskDestroy(ctx), @@ -70,7 +70,7 @@ func TestAccSSMMaintenanceWindowTask_noTarget(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ssm.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckMaintenanceWindowTaskDestroy(ctx), @@ -99,7 +99,7 @@ func TestAccSSMMaintenanceWindowTask_cutoff(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ssm.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckMaintenanceWindowTaskDestroy(ctx), @@ -135,7 +135,7 @@ func TestAccSSMMaintenanceWindowTask_noRole(t *testing.T) { resourceName := "aws_ssm_maintenance_window_task.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ssm.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckMaintenanceWindowTaskDestroy(ctx), @@ -157,7 +157,7 @@ func TestAccSSMMaintenanceWindowTask_updateForcesNewResource(t *testing.T) { resourceName := "aws_ssm_maintenance_window_task.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ssm.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckMaintenanceWindowTaskDestroy(ctx), @@ -194,7 +194,7 @@ func TestAccSSMMaintenanceWindowTask_description(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ssm.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckMaintenanceWindowTaskDestroy(ctx), @@ -231,7 +231,7 @@ func TestAccSSMMaintenanceWindowTask_taskInvocationAutomationParameters(t *testi rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ssm.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckMaintenanceWindowTaskDestroy(ctx), @@ -273,7 +273,7 @@ func TestAccSSMMaintenanceWindowTask_taskInvocationLambdaParameters(t *testing.T sgName := fmt.Sprintf("tf_acc_sg_lambda_func_tags_%s", rString) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ssm.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckMaintenanceWindowTaskDestroy(ctx), @@ -303,7 +303,7 @@ func TestAccSSMMaintenanceWindowTask_taskInvocationRunCommandParameters(t *testi rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ssm.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckMaintenanceWindowTaskDestroy(ctx), @@ -346,7 +346,7 @@ func TestAccSSMMaintenanceWindowTask_taskInvocationRunCommandParametersCloudWatc name := sdkacctest.RandString(10) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ssm.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckMaintenanceWindowTaskDestroy(ctx), @@ -397,7 +397,7 @@ func TestAccSSMMaintenanceWindowTask_taskInvocationStepFunctionParameters(t *tes rString := sdkacctest.RandString(8) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ssm.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckMaintenanceWindowTaskDestroy(ctx), @@ -425,7 +425,7 @@ func TestAccSSMMaintenanceWindowTask_emptyNotification(t *testing.T) { resourceName := "aws_ssm_maintenance_window_task.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ssm.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckMaintenanceWindowTaskDestroy(ctx), @@ -448,7 +448,7 @@ func TestAccSSMMaintenanceWindowTask_disappears(t *testing.T) { name := sdkacctest.RandString(10) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ssm.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckMaintenanceWindowTaskDestroy(ctx), diff --git a/internal/service/ssm/maintenance_window_test.go b/internal/service/ssm/maintenance_window_test.go index 4445d1f74c23..2c9b9e9714cd 100644 --- a/internal/service/ssm/maintenance_window_test.go +++ b/internal/service/ssm/maintenance_window_test.go @@ -23,7 +23,7 @@ func TestAccSSMMaintenanceWindow_basic(t *testing.T) { resourceName := "aws_ssm_maintenance_window.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ssm.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckMaintenanceWindowDestroy(ctx), @@ -60,7 +60,7 @@ func TestAccSSMMaintenanceWindow_description(t *testing.T) { resourceName := "aws_ssm_maintenance_window.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ssm.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckMaintenanceWindowDestroy(ctx), @@ -97,7 +97,7 @@ func TestAccSSMMaintenanceWindow_tags(t *testing.T) { resourceName := "aws_ssm_maintenance_window.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ssm.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckMaintenanceWindowDestroy(ctx), @@ -143,7 +143,7 @@ func TestAccSSMMaintenanceWindow_disappears(t *testing.T) { resourceName := "aws_ssm_maintenance_window.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ssm.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckMaintenanceWindowDestroy(ctx), @@ -168,7 +168,7 @@ func TestAccSSMMaintenanceWindow_multipleUpdates(t *testing.T) { resourceName := "aws_ssm_maintenance_window.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ssm.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckMaintenanceWindowDestroy(ctx), @@ -206,7 +206,7 @@ func TestAccSSMMaintenanceWindow_cutoff(t *testing.T) { resourceName := "aws_ssm_maintenance_window.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ssm.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckMaintenanceWindowDestroy(ctx), @@ -241,7 +241,7 @@ func TestAccSSMMaintenanceWindow_duration(t *testing.T) { resourceName := "aws_ssm_maintenance_window.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ssm.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckMaintenanceWindowDestroy(ctx), @@ -276,7 +276,7 @@ func TestAccSSMMaintenanceWindow_enabled(t *testing.T) { resourceName := "aws_ssm_maintenance_window.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ssm.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckMaintenanceWindowDestroy(ctx), @@ -313,7 +313,7 @@ func TestAccSSMMaintenanceWindow_endDate(t *testing.T) { resourceName := "aws_ssm_maintenance_window.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ssm.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckMaintenanceWindowDestroy(ctx), @@ -355,7 +355,7 @@ func TestAccSSMMaintenanceWindow_schedule(t *testing.T) { resourceName := "aws_ssm_maintenance_window.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ssm.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckMaintenanceWindowDestroy(ctx), @@ -390,7 +390,7 @@ func TestAccSSMMaintenanceWindow_scheduleTimezone(t *testing.T) { resourceName := "aws_ssm_maintenance_window.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ssm.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckMaintenanceWindowDestroy(ctx), @@ -432,7 +432,7 @@ func TestAccSSMMaintenanceWindow_scheduleOffset(t *testing.T) { resourceName := "aws_ssm_maintenance_window.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ssm.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckMaintenanceWindowDestroy(ctx), @@ -469,7 +469,7 @@ func TestAccSSMMaintenanceWindow_startDate(t *testing.T) { resourceName := "aws_ssm_maintenance_window.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ssm.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckMaintenanceWindowDestroy(ctx), diff --git a/internal/service/ssm/maintenance_windows_data_source_test.go b/internal/service/ssm/maintenance_windows_data_source_test.go index bd154b4d7dda..42f3a2b9eefa 100644 --- a/internal/service/ssm/maintenance_windows_data_source_test.go +++ b/internal/service/ssm/maintenance_windows_data_source_test.go @@ -18,7 +18,7 @@ func TestAccSSMMaintenanceWindowsDataSource_filter(t *testing.T) { rName3 := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ssm.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckMaintenanceWindowDestroy(ctx), diff --git a/internal/service/ssm/parameter_data_source_test.go b/internal/service/ssm/parameter_data_source_test.go index 18bf7c7f3be5..1778762cd642 100644 --- a/internal/service/ssm/parameter_data_source_test.go +++ b/internal/service/ssm/parameter_data_source_test.go @@ -15,7 +15,7 @@ func TestAccSSMParameterDataSource_basic(t *testing.T) { name := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ssm.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ @@ -49,7 +49,7 @@ func TestAccSSMParameterDataSource_fullPath(t *testing.T) { name := sdkacctest.RandomWithPrefix("/tf-acc-test/tf-acc-test") resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ssm.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ diff --git a/internal/service/ssm/parameter_test.go b/internal/service/ssm/parameter_test.go index 865693f2a47d..25559e35fd6b 100644 --- a/internal/service/ssm/parameter_test.go +++ b/internal/service/ssm/parameter_test.go @@ -24,7 +24,7 @@ func TestAccSSMParameter_basic(t *testing.T) { resourceName := "aws_ssm_parameter.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ssm.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckParameterDestroy(ctx), @@ -59,7 +59,7 @@ func TestAccSSMParameter_tier(t *testing.T) { resourceName := "aws_ssm_parameter.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ssm.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckParameterDestroy(ctx), @@ -102,7 +102,7 @@ func TestAccSSMParameter_Tier_intelligentTieringToStandard(t *testing.T) { resourceName := "aws_ssm_parameter.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ssm.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckParameterDestroy(ctx), @@ -151,7 +151,7 @@ func TestAccSSMParameter_Tier_intelligentTieringToAdvanced(t *testing.T) { resourceName := "aws_ssm_parameter.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ssm.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckParameterDestroy(ctx), @@ -203,7 +203,7 @@ func TestAccSSMParameter_Tier_intelligentTieringOnCreation(t *testing.T) { value := sdkacctest.RandString(5000) // Maximum size for Standard tier is 4 KB resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ssm.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckParameterDestroy(ctx), @@ -235,7 +235,7 @@ func TestAccSSMParameter_Tier_intelligentTieringOnUpdate(t *testing.T) { advancedSizedValue := sdkacctest.RandString(5000) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ssm.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckParameterDestroy(ctx), @@ -265,7 +265,7 @@ func TestAccSSMParameter_disappears(t *testing.T) { resourceName := "aws_ssm_parameter.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ssm.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckParameterDestroy(ctx), @@ -289,7 +289,7 @@ func TestAccSSMParameter_Overwrite_basic(t *testing.T) { resourceName := "aws_ssm_parameter.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ssm.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckParameterDestroy(ctx), @@ -346,7 +346,7 @@ func TestAccSSMParameter_Overwrite_cascade(t *testing.T) { name := fmt.Sprintf("%s_%s", t.Name(), sdkacctest.RandString(10)) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ssm.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckParameterDestroy(ctx), @@ -374,7 +374,7 @@ func TestAccSSMParameter_Overwrite_tags(t *testing.T) { resourceName := "aws_ssm_parameter.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ssm.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckParameterDestroy(ctx), @@ -405,7 +405,7 @@ func TestAccSSMParameter_Overwrite_noOverwriteTags(t *testing.T) { resourceName := "aws_ssm_parameter.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ssm.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckParameterDestroy(ctx), @@ -436,7 +436,7 @@ func TestAccSSMParameter_Overwrite_updateToTags(t *testing.T) { resourceName := "aws_ssm_parameter.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ssm.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckParameterDestroy(ctx), @@ -473,7 +473,7 @@ func TestAccSSMParameter_tags(t *testing.T) { resourceName := "aws_ssm_parameter.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ssm.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckParameterDestroy(ctx), @@ -520,7 +520,7 @@ func TestAccSSMParameter_updateType(t *testing.T) { resourceName := "aws_ssm_parameter.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ssm.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckParameterDestroy(ctx), @@ -552,7 +552,7 @@ func TestAccSSMParameter_Overwrite_updateDescription(t *testing.T) { resourceName := "aws_ssm_parameter.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ssm.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckParameterDestroy(ctx), @@ -585,7 +585,7 @@ func TestAccSSMParameter_changeNameForcesNew(t *testing.T) { resourceName := "aws_ssm_parameter.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ssm.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckParameterDestroy(ctx), @@ -620,7 +620,7 @@ func TestAccSSMParameter_fullPath(t *testing.T) { resourceName := "aws_ssm_parameter.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ssm.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckParameterDestroy(ctx), @@ -651,7 +651,7 @@ func TestAccSSMParameter_Secure_basic(t *testing.T) { resourceName := "aws_ssm_parameter.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ssm.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckParameterDestroy(ctx), @@ -682,7 +682,7 @@ func TestAccSSMParameter_Secure_insecure(t *testing.T) { resourceName := "aws_ssm_parameter.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ssm.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckParameterDestroy(ctx), @@ -723,7 +723,7 @@ func TestAccSSMParameter_Secure_insecureChangeSecure(t *testing.T) { resourceName := "aws_ssm_parameter.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ssm.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckParameterDestroy(ctx), @@ -763,7 +763,7 @@ func TestAccSSMParameter_DataType_ec2Image(t *testing.T) { resourceName := "aws_ssm_parameter.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ssm.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckParameterDestroy(ctx), @@ -794,7 +794,7 @@ func TestAccSSMParameter_DataType_ssmIntegration(t *testing.T) { resourceName := "aws_ssm_parameter.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ssm.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckParameterDestroy(ctx), @@ -824,7 +824,7 @@ func TestAccSSMParameter_Secure_key(t *testing.T) { resourceName := "aws_ssm_parameter.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ssm.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckParameterDestroy(ctx), @@ -856,7 +856,7 @@ func TestAccSSMParameter_Secure_keyUpdate(t *testing.T) { resourceName := "aws_ssm_parameter.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ssm.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckParameterDestroy(ctx), 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 c9df33fe06cd..3d066279373c 100644 --- a/internal/service/ssm/parameters_by_path_data_source_test.go +++ b/internal/service/ssm/parameters_by_path_data_source_test.go @@ -16,7 +16,7 @@ func TestAccSSMParametersByPathDataSource_basic(t *testing.T) { rName2 := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ssm.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ @@ -73,7 +73,7 @@ func TestAccSSMParametersByPathDataSource_withRecursion(t *testing.T) { pathPrefix := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ssm.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ diff --git a/internal/service/ssm/patch_baseline_data_source_test.go b/internal/service/ssm/patch_baseline_data_source_test.go index 1f09ab49459f..21aa277b934b 100644 --- a/internal/service/ssm/patch_baseline_data_source_test.go +++ b/internal/service/ssm/patch_baseline_data_source_test.go @@ -14,7 +14,7 @@ func TestAccSSMPatchBaselineDataSource_existingBaseline(t *testing.T) { dataSourceName := "data.aws_ssm_patch_baseline.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ssm.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ @@ -45,7 +45,7 @@ func TestAccSSMPatchBaselineDataSource_newBaseline(t *testing.T) { rName := sdkacctest.RandomWithPrefix("tf-bl-test") resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ssm.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckPatchBaselineDestroy(ctx), diff --git a/internal/service/ssm/patch_baseline_test.go b/internal/service/ssm/patch_baseline_test.go index 5b8be74ba983..4ddc01343901 100644 --- a/internal/service/ssm/patch_baseline_test.go +++ b/internal/service/ssm/patch_baseline_test.go @@ -22,7 +22,7 @@ func TestAccSSMPatchBaseline_basic(t *testing.T) { name := sdkacctest.RandString(10) resourceName := "aws_ssm_patch_baseline.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ssm.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckPatchBaselineDestroy(ctx), @@ -76,7 +76,7 @@ func TestAccSSMPatchBaseline_tags(t *testing.T) { name := sdkacctest.RandString(10) resourceName := "aws_ssm_patch_baseline.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ssm.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckPatchBaselineDestroy(ctx), @@ -122,7 +122,7 @@ func TestAccSSMPatchBaseline_disappears(t *testing.T) { resourceName := "aws_ssm_patch_baseline.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ssm.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckPatchBaselineDestroy(ctx), @@ -145,7 +145,7 @@ func TestAccSSMPatchBaseline_operatingSystem(t *testing.T) { name := sdkacctest.RandString(10) resourceName := "aws_ssm_patch_baseline.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ssm.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckPatchBaselineDestroy(ctx), @@ -190,7 +190,7 @@ func TestAccSSMPatchBaseline_approveUntilDateParam(t *testing.T) { resourceName := "aws_ssm_patch_baseline.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ssm.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckPatchBaselineDestroy(ctx), @@ -240,7 +240,7 @@ func TestAccSSMPatchBaseline_sources(t *testing.T) { resourceName := "aws_ssm_patch_baseline.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ssm.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckPatchBaselineDestroy(ctx), @@ -293,7 +293,7 @@ func TestAccSSMPatchBaseline_approvedPatchesNonSec(t *testing.T) { resourceName := "aws_ssm_patch_baseline.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ssm.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckPatchBaselineDestroy(ctx), @@ -321,7 +321,7 @@ func TestAccSSMPatchBaseline_rejectPatchesAction(t *testing.T) { resourceName := "aws_ssm_patch_baseline.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ssm.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckPatchBaselineDestroy(ctx), @@ -351,7 +351,7 @@ func testAccSSMPatchBaseline_deleteDefault(t *testing.T) { resourceName := "aws_ssm_patch_baseline.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ssm.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckPatchBaselineDestroy(ctx), diff --git a/internal/service/ssm/patch_group_test.go b/internal/service/ssm/patch_group_test.go index b2f809300787..49a264987f12 100644 --- a/internal/service/ssm/patch_group_test.go +++ b/internal/service/ssm/patch_group_test.go @@ -20,7 +20,7 @@ func TestAccSSMPatchGroup_basic(t *testing.T) { resourceName := "aws_ssm_patch_group.patchgroup" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ssm.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckPatchGroupDestroy(ctx), @@ -41,7 +41,7 @@ func TestAccSSMPatchGroup_disappears(t *testing.T) { resourceName := "aws_ssm_patch_group.patchgroup" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ssm.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: nil, @@ -66,7 +66,7 @@ func TestAccSSMPatchGroup_multipleBaselines(t *testing.T) { resourceName3 := "aws_ssm_patch_group.test3" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ssm.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckPatchGroupDestroy(ctx), diff --git a/internal/service/ssm/resource_data_sync_test.go b/internal/service/ssm/resource_data_sync_test.go index ccae153ccc3e..2a6046aaab66 100644 --- a/internal/service/ssm/resource_data_sync_test.go +++ b/internal/service/ssm/resource_data_sync_test.go @@ -21,7 +21,7 @@ func TestAccSSMResourceDataSync_basic(t *testing.T) { resourceName := "aws_ssm_resource_data_sync.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ssm.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckResourceDataSyncDestroy(ctx), @@ -47,7 +47,7 @@ func TestAccSSMResourceDataSync_update(t *testing.T) { resourceName := "aws_ssm_resource_data_sync.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ssm.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckResourceDataSyncDestroy(ctx), diff --git a/internal/service/ssm/service_setting_test.go b/internal/service/ssm/service_setting_test.go index a2314666a5c6..c1b241181f58 100644 --- a/internal/service/ssm/service_setting_test.go +++ b/internal/service/ssm/service_setting_test.go @@ -23,7 +23,7 @@ func TestAccSSMServiceSetting_basic(t *testing.T) { resourceName := "aws_ssm_service_setting.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ssm.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckServiceSettingDestroy(ctx), From d7905f09fdbb61f76da2f0ed7864af92c5ccecee Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Fri, 24 Feb 2023 16:37:30 -0500 Subject: [PATCH 247/763] Add 'Context' argument to 'acctest.PreCheck' for ssoadmin. --- .../service/ssoadmin/account_assignment_test.go | 6 +++--- .../customer_managed_policy_attachment_test.go | 10 +++++----- .../instance_access_control_attributes_test.go | 8 ++++---- .../service/ssoadmin/instances_data_source_test.go | 2 +- .../ssoadmin/managed_policy_attachment_test.go | 10 +++++----- .../ssoadmin/permission_set_data_source_test.go | 6 +++--- .../ssoadmin/permission_set_inline_policy_test.go | 8 ++++---- internal/service/ssoadmin/permission_set_test.go | 14 +++++++------- .../permissions_boundary_attachment_test.go | 10 +++++----- 9 files changed, 37 insertions(+), 37 deletions(-) diff --git a/internal/service/ssoadmin/account_assignment_test.go b/internal/service/ssoadmin/account_assignment_test.go index 1f3b036c7baf..ca3f807aa953 100644 --- a/internal/service/ssoadmin/account_assignment_test.go +++ b/internal/service/ssoadmin/account_assignment_test.go @@ -25,7 +25,7 @@ func TestAccSSOAdminAccountAssignment_Basic_group(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) testAccPreCheckInstances(ctx, t) testAccPreCheckIdentityStoreGroupName(t) }, @@ -59,7 +59,7 @@ func TestAccSSOAdminAccountAssignment_Basic_user(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) testAccPreCheckInstances(ctx, t) testAccPreCheckIdentityStoreUserName(t) }, @@ -93,7 +93,7 @@ func TestAccSSOAdminAccountAssignment_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) testAccPreCheckInstances(ctx, t) testAccPreCheckIdentityStoreGroupName(t) }, diff --git a/internal/service/ssoadmin/customer_managed_policy_attachment_test.go b/internal/service/ssoadmin/customer_managed_policy_attachment_test.go index a521ddde649e..16d081c73957 100644 --- a/internal/service/ssoadmin/customer_managed_policy_attachment_test.go +++ b/internal/service/ssoadmin/customer_managed_policy_attachment_test.go @@ -24,7 +24,7 @@ func TestAccSSOAdminCustomerManagedPolicyAttachment_basic(t *testing.T) { rNamePolicy2 := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckInstances(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckInstances(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ssoadmin.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckCustomerManagedPolicyAttachmentDestroy(ctx), @@ -56,7 +56,7 @@ func TestAccSSOAdminCustomerManagedPolicyAttachment_forceNew(t *testing.T) { rNamePolicy2 := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckInstances(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckInstances(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ssoadmin.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckCustomerManagedPolicyAttachmentDestroy(ctx), @@ -93,7 +93,7 @@ func TestAccSSOAdminCustomerManagedPolicyAttachment_disappears(t *testing.T) { rNamePolicy2 := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckInstances(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckInstances(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ssoadmin.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckCustomerManagedPolicyAttachmentDestroy(ctx), @@ -119,7 +119,7 @@ func TestAccSSOAdminCustomerManagedPolicyAttachment_Disappears_permissionSet(t * rNamePolicy2 := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckInstances(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckInstances(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ssoadmin.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckCustomerManagedPolicyAttachmentDestroy(ctx), @@ -147,7 +147,7 @@ func TestAccSSOAdminCustomerManagedPolicyAttachment_multipleManagedPolicies(t *t rNamePolicy3 := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckInstances(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckInstances(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ssoadmin.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckCustomerManagedPolicyAttachmentDestroy(ctx), diff --git a/internal/service/ssoadmin/instance_access_control_attributes_test.go b/internal/service/ssoadmin/instance_access_control_attributes_test.go index f0d3fd7a335d..a7b5de4d3c90 100644 --- a/internal/service/ssoadmin/instance_access_control_attributes_test.go +++ b/internal/service/ssoadmin/instance_access_control_attributes_test.go @@ -34,7 +34,7 @@ func testAccInstanceAccessControlAttributes_basic(t *testing.T) { resourceName := "aws_ssoadmin_instance_access_control_attributes.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckInstances(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckInstances(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ssoadmin.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckInstanceAccessControlAttributesDestroy(ctx), @@ -61,7 +61,7 @@ func testAccInstanceAccessControlAttributes_disappears(t *testing.T) { resourceName := "aws_ssoadmin_instance_access_control_attributes.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckInstances(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckInstances(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ssoadmin.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckPermissionSetInlinePolicyDestroy(ctx), @@ -83,7 +83,7 @@ func testAccInstanceAccessControlAttributes_multiple(t *testing.T) { resourceName := "aws_ssoadmin_instance_access_control_attributes.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckInstances(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckInstances(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ssoadmin.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckInstanceAccessControlAttributesDestroy(ctx), @@ -110,7 +110,7 @@ func testAccInstanceAccessControlAttributes_update(t *testing.T) { resourceName := "aws_ssoadmin_instance_access_control_attributes.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckInstances(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckInstances(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ssoadmin.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckInstanceAccessControlAttributesDestroy(ctx), diff --git a/internal/service/ssoadmin/instances_data_source_test.go b/internal/service/ssoadmin/instances_data_source_test.go index d58e512c1b90..c11eee8dfe9e 100644 --- a/internal/service/ssoadmin/instances_data_source_test.go +++ b/internal/service/ssoadmin/instances_data_source_test.go @@ -43,7 +43,7 @@ func TestAccSSOAdminInstancesDataSource_basic(t *testing.T) { dataSourceName := "data.aws_ssoadmin_instances.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckInstances(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckInstances(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ssoadmin.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ diff --git a/internal/service/ssoadmin/managed_policy_attachment_test.go b/internal/service/ssoadmin/managed_policy_attachment_test.go index dae76c8f16d3..3bf85535a423 100644 --- a/internal/service/ssoadmin/managed_policy_attachment_test.go +++ b/internal/service/ssoadmin/managed_policy_attachment_test.go @@ -23,7 +23,7 @@ func TestAccSSOAdminManagedPolicyAttachment_basic(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckInstances(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckInstances(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ssoadmin.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckManagedPolicyAttachmentDestroy(ctx), @@ -55,7 +55,7 @@ func TestAccSSOAdminManagedPolicyAttachment_forceNew(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckInstances(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckInstances(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ssoadmin.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckManagedPolicyAttachmentDestroy(ctx), @@ -92,7 +92,7 @@ func TestAccSSOAdminManagedPolicyAttachment_disappears(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckInstances(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckInstances(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ssoadmin.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckManagedPolicyAttachmentDestroy(ctx), @@ -116,7 +116,7 @@ func TestAccSSOAdminManagedPolicyAttachment_Disappears_permissionSet(t *testing. rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckInstances(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckInstances(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ssoadmin.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckManagedPolicyAttachmentDestroy(ctx), @@ -141,7 +141,7 @@ func TestAccSSOAdminManagedPolicyAttachment_multipleManagedPolicies(t *testing.T rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckInstances(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckInstances(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ssoadmin.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckManagedPolicyAttachmentDestroy(ctx), diff --git a/internal/service/ssoadmin/permission_set_data_source_test.go b/internal/service/ssoadmin/permission_set_data_source_test.go index a2e6ed0f65e2..3dac59f9e278 100644 --- a/internal/service/ssoadmin/permission_set_data_source_test.go +++ b/internal/service/ssoadmin/permission_set_data_source_test.go @@ -18,7 +18,7 @@ func TestAccSSOAdminPermissionSetDataSource_arn(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckInstances(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckInstances(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ssoadmin.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ @@ -44,7 +44,7 @@ func TestAccSSOAdminPermissionSetDataSource_name(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckInstances(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckInstances(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ssoadmin.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ @@ -66,7 +66,7 @@ func TestAccSSOAdminPermissionSetDataSource_name(t *testing.T) { func TestAccSSOAdminPermissionSetDataSource_nonExistent(t *testing.T) { ctx := acctest.Context(t) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckInstances(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckInstances(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ssoadmin.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ diff --git a/internal/service/ssoadmin/permission_set_inline_policy_test.go b/internal/service/ssoadmin/permission_set_inline_policy_test.go index 7a84e23034ee..0525238e1aef 100644 --- a/internal/service/ssoadmin/permission_set_inline_policy_test.go +++ b/internal/service/ssoadmin/permission_set_inline_policy_test.go @@ -24,7 +24,7 @@ func TestAccSSOAdminPermissionSetInlinePolicy_basic(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckInstances(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckInstances(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ssoadmin.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckPermissionSetInlinePolicyDestroy(ctx), @@ -54,7 +54,7 @@ func TestAccSSOAdminPermissionSetInlinePolicy_update(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckInstances(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckInstances(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ssoadmin.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckPermissionSetInlinePolicyDestroy(ctx), @@ -87,7 +87,7 @@ func TestAccSSOAdminPermissionSetInlinePolicy_disappears(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckInstances(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckInstances(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ssoadmin.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckPermissionSetInlinePolicyDestroy(ctx), @@ -111,7 +111,7 @@ func TestAccSSOAdminPermissionSetInlinePolicy_Disappears_permissionSet(t *testin rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckInstances(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckInstances(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ssoadmin.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckPermissionSetInlinePolicyDestroy(ctx), diff --git a/internal/service/ssoadmin/permission_set_test.go b/internal/service/ssoadmin/permission_set_test.go index 171e9ce95c40..3797bf0310ff 100644 --- a/internal/service/ssoadmin/permission_set_test.go +++ b/internal/service/ssoadmin/permission_set_test.go @@ -22,7 +22,7 @@ func TestAccSSOAdminPermissionSet_basic(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckInstances(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckInstances(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ssoadmin.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckPermissionSetDestroy(ctx), @@ -50,7 +50,7 @@ func TestAccSSOAdminPermissionSet_tags(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckInstances(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckInstances(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ssoadmin.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckPermissionSetDestroy(ctx), @@ -105,7 +105,7 @@ func TestAccSSOAdminPermissionSet_updateDescription(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckInstances(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckInstances(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ssoadmin.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckPermissionSetDestroy(ctx), @@ -139,7 +139,7 @@ func TestAccSSOAdminPermissionSet_updateRelayState(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckInstances(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckInstances(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ssoadmin.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckPermissionSetDestroy(ctx), @@ -173,7 +173,7 @@ func TestAccSSOAdminPermissionSet_updateSessionDuration(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckInstances(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckInstances(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ssoadmin.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckPermissionSetDestroy(ctx), @@ -209,7 +209,7 @@ func TestAccSSOAdminPermissionSet_RelayState_updateSessionDuration(t *testing.T) rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckInstances(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckInstances(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ssoadmin.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckPermissionSetDestroy(ctx), @@ -249,7 +249,7 @@ func TestAccSSOAdminPermissionSet_mixedPolicyAttachments(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckInstances(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckInstances(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ssoadmin.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckPermissionSetDestroy(ctx), diff --git a/internal/service/ssoadmin/permissions_boundary_attachment_test.go b/internal/service/ssoadmin/permissions_boundary_attachment_test.go index c69cc8541319..8d810d407e9c 100644 --- a/internal/service/ssoadmin/permissions_boundary_attachment_test.go +++ b/internal/service/ssoadmin/permissions_boundary_attachment_test.go @@ -25,7 +25,7 @@ func TestAccSSOAdminPermissionsBoundaryAttachment_basic(t *testing.T) { rNamePolicy2 := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckInstances(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckInstances(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ssoadmin.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckPermissionsBoundaryAttachmentDestroy(ctx), @@ -57,7 +57,7 @@ func TestAccSSOAdminPermissionsBoundaryAttachment_forceNew(t *testing.T) { rNamePolicy2 := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckInstances(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckInstances(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ssoadmin.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckPermissionsBoundaryAttachmentDestroy(ctx), @@ -94,7 +94,7 @@ func TestAccSSOAdminPermissionsBoundaryAttachment_disappears(t *testing.T) { rNamePolicy2 := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckInstances(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckInstances(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ssoadmin.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckPermissionsBoundaryAttachmentDestroy(ctx), @@ -120,7 +120,7 @@ func TestAccSSOAdminPermissionsBoundaryAttachment_Disappears_permissionSet(t *te rNamePolicy2 := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckInstances(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckInstances(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ssoadmin.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckPermissionsBoundaryAttachmentDestroy(ctx), @@ -144,7 +144,7 @@ func TestAccSSOAdminPermissionsBoundaryAttachment_managedPolicyAndCustomerManage rNamePolicy2 := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckInstances(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckInstances(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ssoadmin.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckPermissionsBoundaryAttachmentDestroy(ctx), From c465dd87bf2d267303926bdd71e8895c9c653dcf Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Fri, 24 Feb 2023 16:37:31 -0500 Subject: [PATCH 248/763] Add 'Context' argument to 'acctest.PreCheck' for storagegateway. --- internal/service/storagegateway/cache_test.go | 4 +- .../cached_iscsi_volume_test.go | 12 ++--- .../file_system_association_test.go | 14 +++--- .../service/storagegateway/gateway_test.go | 44 +++++++++---------- .../local_disk_data_source_test.go | 4 +- .../storagegateway/nfs_file_share_test.go | 34 +++++++------- .../storagegateway/smb_file_share_test.go | 44 +++++++++---------- .../stored_iscsi_volume_test.go | 10 ++--- .../service/storagegateway/tape_pool_test.go | 8 ++-- .../storagegateway/upload_buffer_test.go | 4 +- .../storagegateway/working_storage_test.go | 2 +- 11 files changed, 90 insertions(+), 90 deletions(-) diff --git a/internal/service/storagegateway/cache_test.go b/internal/service/storagegateway/cache_test.go index d11508ccb728..b00b197d430e 100644 --- a/internal/service/storagegateway/cache_test.go +++ b/internal/service/storagegateway/cache_test.go @@ -80,7 +80,7 @@ func TestAccStorageGatewayCache_fileGateway(t *testing.T) { gatewayResourceName := "aws_storagegateway_gateway.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, storagegateway.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, // Storage Gateway API does not support removing caches, @@ -111,7 +111,7 @@ func TestAccStorageGatewayCache_tapeAndVolumeGateway(t *testing.T) { gatewayResourceName := "aws_storagegateway_gateway.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, storagegateway.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, // Storage Gateway API does not support removing caches, diff --git a/internal/service/storagegateway/cached_iscsi_volume_test.go b/internal/service/storagegateway/cached_iscsi_volume_test.go index f2a6584f0fe3..a9c0591a6ee7 100644 --- a/internal/service/storagegateway/cached_iscsi_volume_test.go +++ b/internal/service/storagegateway/cached_iscsi_volume_test.go @@ -82,7 +82,7 @@ func TestAccStorageGatewayCachediSCSIVolume_basic(t *testing.T) { resourceName := "aws_storagegateway_cached_iscsi_volume.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, storagegateway.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckCachediSCSIVolumeDestroy(ctx), @@ -123,7 +123,7 @@ func TestAccStorageGatewayCachediSCSIVolume_kms(t *testing.T) { keyResourceName := "aws_kms_key.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, storagegateway.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckCachediSCSIVolumeDestroy(ctx), @@ -152,7 +152,7 @@ func TestAccStorageGatewayCachediSCSIVolume_tags(t *testing.T) { resourceName := "aws_storagegateway_cached_iscsi_volume.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, storagegateway.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckCachediSCSIVolumeDestroy(ctx), @@ -201,7 +201,7 @@ func TestAccStorageGatewayCachediSCSIVolume_snapshotID(t *testing.T) { resourceName := "aws_storagegateway_cached_iscsi_volume.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, storagegateway.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckCachediSCSIVolumeDestroy(ctx), @@ -241,7 +241,7 @@ func TestAccStorageGatewayCachediSCSIVolume_sourceVolumeARN(t *testing.T) { resourceName := "aws_storagegateway_cached_iscsi_volume.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, storagegateway.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckCachediSCSIVolumeDestroy(ctx), @@ -280,7 +280,7 @@ func TestAccStorageGatewayCachediSCSIVolume_disappears(t *testing.T) { resourceName := "aws_storagegateway_cached_iscsi_volume.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, storagegateway.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckCachediSCSIVolumeDestroy(ctx), diff --git a/internal/service/storagegateway/file_system_association_test.go b/internal/service/storagegateway/file_system_association_test.go index 3359814a37ff..45d9247b97c2 100644 --- a/internal/service/storagegateway/file_system_association_test.go +++ b/internal/service/storagegateway/file_system_association_test.go @@ -28,7 +28,7 @@ func TestAccStorageGatewayFileSystemAssociation_basic(t *testing.T) { username := "Admin" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(storagegateway.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(storagegateway.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, storagegateway.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckFileSystemAssociationDestroy(ctx), @@ -64,7 +64,7 @@ func TestAccStorageGatewayFileSystemAssociation_tags(t *testing.T) { username := "Admin" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(storagegateway.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(storagegateway.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, storagegateway.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckFileSystemAssociationDestroy(ctx), @@ -116,7 +116,7 @@ func TestAccStorageGatewayFileSystemAssociation_cacheAttributes(t *testing.T) { username := "Admin" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(storagegateway.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(storagegateway.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, storagegateway.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckFileSystemAssociationDestroy(ctx), @@ -156,7 +156,7 @@ func TestAccStorageGatewayFileSystemAssociation_auditDestination(t *testing.T) { username := "Admin" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(storagegateway.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(storagegateway.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, storagegateway.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckFileSystemAssociationDestroy(ctx), @@ -200,7 +200,7 @@ func TestAccStorageGatewayFileSystemAssociation_disappears(t *testing.T) { username := "Admin" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(storagegateway.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(storagegateway.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, storagegateway.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckFileSystemAssociationDestroy(ctx), @@ -226,7 +226,7 @@ func TestAccStorageGatewayFileSystemAssociation_Disappears_storageGateway(t *tes username := "Admin" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(storagegateway.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(storagegateway.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, storagegateway.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckFileSystemAssociationDestroy(ctx), @@ -254,7 +254,7 @@ func TestAccStorageGatewayFileSystemAssociation_Disappears_fsxFileSystem(t *test username := "Admin" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(storagegateway.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(storagegateway.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, storagegateway.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckFileSystemAssociationDestroy(ctx), diff --git a/internal/service/storagegateway/gateway_test.go b/internal/service/storagegateway/gateway_test.go index d1331ef1019d..02a9106e4258 100644 --- a/internal/service/storagegateway/gateway_test.go +++ b/internal/service/storagegateway/gateway_test.go @@ -24,7 +24,7 @@ func TestAccStorageGatewayGateway_GatewayType_cached(t *testing.T) { resourceName := "aws_storagegateway_gateway.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, storagegateway.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckGatewayDestroy(ctx), @@ -68,7 +68,7 @@ func TestAccStorageGatewayGateway_GatewayType_fileFSxSMB(t *testing.T) { resourceName := "aws_storagegateway_gateway.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, storagegateway.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckGatewayDestroy(ctx), @@ -111,7 +111,7 @@ func TestAccStorageGatewayGateway_GatewayType_fileS3(t *testing.T) { resourceName := "aws_storagegateway_gateway.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, storagegateway.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckGatewayDestroy(ctx), @@ -154,7 +154,7 @@ func TestAccStorageGatewayGateway_GatewayType_stored(t *testing.T) { resourceName := "aws_storagegateway_gateway.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, storagegateway.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckGatewayDestroy(ctx), @@ -197,7 +197,7 @@ func TestAccStorageGatewayGateway_GatewayType_vtl(t *testing.T) { resourceName := "aws_storagegateway_gateway.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, storagegateway.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckGatewayDestroy(ctx), @@ -238,7 +238,7 @@ func TestAccStorageGatewayGateway_tags(t *testing.T) { resourceName := "aws_storagegateway_gateway.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, storagegateway.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckGatewayDestroy(ctx), @@ -287,7 +287,7 @@ func TestAccStorageGatewayGateway_gatewayName(t *testing.T) { resourceName := "aws_storagegateway_gateway.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, storagegateway.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckGatewayDestroy(ctx), @@ -324,7 +324,7 @@ func TestAccStorageGatewayGateway_cloudWatchLogs(t *testing.T) { resourceName2 := "aws_cloudwatch_log_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, storagegateway.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckGatewayDestroy(ctx), @@ -353,7 +353,7 @@ func TestAccStorageGatewayGateway_gatewayTimezone(t *testing.T) { resourceName := "aws_storagegateway_gateway.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, storagegateway.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckGatewayDestroy(ctx), @@ -390,7 +390,7 @@ func TestAccStorageGatewayGateway_gatewayVPCEndpoint(t *testing.T) { vpcEndpointResourceName := "aws_vpc_endpoint.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, storagegateway.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckGatewayDestroy(ctx), @@ -420,7 +420,7 @@ func TestAccStorageGatewayGateway_smbActiveDirectorySettings(t *testing.T) { domainName := acctest.RandomDomainName() resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, storagegateway.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckGatewayDestroy(ctx), @@ -453,7 +453,7 @@ func TestAccStorageGatewayGateway_SMBActiveDirectorySettings_timeout(t *testing. domainName := acctest.RandomDomainName() resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, storagegateway.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckGatewayDestroy(ctx), @@ -486,7 +486,7 @@ func TestAccStorageGatewayGateway_smbMicrosoftActiveDirectorySettings(t *testing username := "Admin" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, storagegateway.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckGatewayDestroy(ctx), @@ -519,7 +519,7 @@ func TestAccStorageGatewayGateway_SMBMicrosoftActiveDirectorySettings_timeout(t domainName := acctest.RandomDomainName() resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, storagegateway.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckGatewayDestroy(ctx), @@ -550,7 +550,7 @@ func TestAccStorageGatewayGateway_smbGuestPassword(t *testing.T) { resourceName := "aws_storagegateway_gateway.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, storagegateway.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckGatewayDestroy(ctx), @@ -586,7 +586,7 @@ func TestAccStorageGatewayGateway_smbSecurityStrategy(t *testing.T) { resourceName := "aws_storagegateway_gateway.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, storagegateway.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckGatewayDestroy(ctx), @@ -623,7 +623,7 @@ func TestAccStorageGatewayGateway_smbVisibility(t *testing.T) { resourceName := "aws_storagegateway_gateway.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, storagegateway.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckGatewayDestroy(ctx), @@ -666,7 +666,7 @@ func TestAccStorageGatewayGateway_disappears(t *testing.T) { resourceName := "aws_storagegateway_gateway.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, storagegateway.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckGatewayDestroy(ctx), @@ -690,7 +690,7 @@ func TestAccStorageGatewayGateway_bandwidthUpload(t *testing.T) { resourceName := "aws_storagegateway_gateway.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, storagegateway.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckGatewayDestroy(ctx), @@ -733,7 +733,7 @@ func TestAccStorageGatewayGateway_bandwidthDownload(t *testing.T) { resourceName := "aws_storagegateway_gateway.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, storagegateway.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckGatewayDestroy(ctx), @@ -776,7 +776,7 @@ func TestAccStorageGatewayGateway_bandwidthAll(t *testing.T) { resourceName := "aws_storagegateway_gateway.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, storagegateway.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckGatewayDestroy(ctx), @@ -822,7 +822,7 @@ func TestAccStorageGatewayGateway_maintenanceStartTime(t *testing.T) { resourceName := "aws_storagegateway_gateway.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, storagegateway.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckGatewayDestroy(ctx), diff --git a/internal/service/storagegateway/local_disk_data_source_test.go b/internal/service/storagegateway/local_disk_data_source_test.go index 7e01f30948a1..0f47e308f2a9 100644 --- a/internal/service/storagegateway/local_disk_data_source_test.go +++ b/internal/service/storagegateway/local_disk_data_source_test.go @@ -18,7 +18,7 @@ func TestAccStorageGatewayLocalDiskDataSource_diskNode(t *testing.T) { dataSourceName := "data.aws_storagegateway_local_disk.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, storagegateway.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckGatewayDestroy(ctx), @@ -46,7 +46,7 @@ func TestAccStorageGatewayLocalDiskDataSource_diskPath(t *testing.T) { dataSourceName := "data.aws_storagegateway_local_disk.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, storagegateway.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckGatewayDestroy(ctx), diff --git a/internal/service/storagegateway/nfs_file_share_test.go b/internal/service/storagegateway/nfs_file_share_test.go index f35aa9ff3ef9..00d301bdcfdd 100644 --- a/internal/service/storagegateway/nfs_file_share_test.go +++ b/internal/service/storagegateway/nfs_file_share_test.go @@ -26,7 +26,7 @@ func TestAccStorageGatewayNFSFileShare_basic(t *testing.T) { iamResourceName := "aws_iam_role.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, storagegateway.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckNFSFileShareDestroy(ctx), @@ -78,7 +78,7 @@ func TestAccStorageGatewayNFSFileShare_audit(t *testing.T) { logResourceNameSecond := "aws_cloudwatch_log_group.test2" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, storagegateway.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckNFSFileShareDestroy(ctx), @@ -113,7 +113,7 @@ func TestAccStorageGatewayNFSFileShare_tags(t *testing.T) { resourceName := "aws_storagegateway_nfs_file_share.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, storagegateway.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckNFSFileShareDestroy(ctx), @@ -162,7 +162,7 @@ func TestAccStorageGatewayNFSFileShare_fileShareName(t *testing.T) { resourceName := "aws_storagegateway_nfs_file_share.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, storagegateway.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckNFSFileShareDestroy(ctx), @@ -197,7 +197,7 @@ func TestAccStorageGatewayNFSFileShare_clientList(t *testing.T) { resourceName := "aws_storagegateway_nfs_file_share.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, storagegateway.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckNFSFileShareDestroy(ctx), @@ -243,7 +243,7 @@ func TestAccStorageGatewayNFSFileShare_defaultStorageClass(t *testing.T) { resourceName := "aws_storagegateway_nfs_file_share.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, storagegateway.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckNFSFileShareDestroy(ctx), @@ -278,7 +278,7 @@ func TestAccStorageGatewayNFSFileShare_guessMIMETypeEnabled(t *testing.T) { resourceName := "aws_storagegateway_nfs_file_share.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, storagegateway.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckNFSFileShareDestroy(ctx), @@ -313,7 +313,7 @@ func TestAccStorageGatewayNFSFileShare_kmsEncrypted(t *testing.T) { resourceName := "aws_storagegateway_nfs_file_share.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, storagegateway.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckNFSFileShareDestroy(ctx), @@ -347,7 +347,7 @@ func TestAccStorageGatewayNFSFileShare_kmsKeyARN(t *testing.T) { keyUpdatedName := "aws_kms_key.test.1" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, storagegateway.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckNFSFileShareDestroy(ctx), @@ -391,7 +391,7 @@ func TestAccStorageGatewayNFSFileShare_nFSFileShareDefaults(t *testing.T) { resourceName := "aws_storagegateway_nfs_file_share.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, storagegateway.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckNFSFileShareDestroy(ctx), @@ -434,7 +434,7 @@ func TestAccStorageGatewayNFSFileShare_objectACL(t *testing.T) { resourceName := "aws_storagegateway_nfs_file_share.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, storagegateway.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckNFSFileShareDestroy(ctx), @@ -469,7 +469,7 @@ func TestAccStorageGatewayNFSFileShare_readOnly(t *testing.T) { resourceName := "aws_storagegateway_nfs_file_share.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, storagegateway.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckNFSFileShareDestroy(ctx), @@ -504,7 +504,7 @@ func TestAccStorageGatewayNFSFileShare_requesterPays(t *testing.T) { resourceName := "aws_storagegateway_nfs_file_share.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, storagegateway.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckNFSFileShareDestroy(ctx), @@ -539,7 +539,7 @@ func TestAccStorageGatewayNFSFileShare_squash(t *testing.T) { resourceName := "aws_storagegateway_nfs_file_share.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, storagegateway.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckNFSFileShareDestroy(ctx), @@ -574,7 +574,7 @@ func TestAccStorageGatewayNFSFileShare_notificationPolicy(t *testing.T) { resourceName := "aws_storagegateway_nfs_file_share.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, storagegateway.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckNFSFileShareDestroy(ctx), @@ -616,7 +616,7 @@ func TestAccStorageGatewayNFSFileShare_cacheAttributes(t *testing.T) { resourceName := "aws_storagegateway_nfs_file_share.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, storagegateway.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckNFSFileShareDestroy(ctx), @@ -661,7 +661,7 @@ func TestAccStorageGatewayNFSFileShare_disappears(t *testing.T) { resourceName := "aws_storagegateway_nfs_file_share.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, storagegateway.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckNFSFileShareDestroy(ctx), diff --git a/internal/service/storagegateway/smb_file_share_test.go b/internal/service/storagegateway/smb_file_share_test.go index 195ff82abe0a..633353426d22 100644 --- a/internal/service/storagegateway/smb_file_share_test.go +++ b/internal/service/storagegateway/smb_file_share_test.go @@ -27,7 +27,7 @@ func TestAccStorageGatewaySMBFileShare_Authentication_activeDirectory(t *testing domainName := acctest.RandomDomainName() resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, storagegateway.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSMBFileShareDestroy(ctx), @@ -77,7 +77,7 @@ func TestAccStorageGatewaySMBFileShare_Authentication_guestAccess(t *testing.T) iamResourceName := "aws_iam_role.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, storagegateway.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSMBFileShareDestroy(ctx), @@ -125,7 +125,7 @@ func TestAccStorageGatewaySMBFileShare_accessBasedEnumeration(t *testing.T) { resourceName := "aws_storagegateway_smb_file_share.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, storagegateway.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSMBFileShareDestroy(ctx), @@ -167,7 +167,7 @@ func TestAccStorageGatewaySMBFileShare_notificationPolicy(t *testing.T) { resourceName := "aws_storagegateway_smb_file_share.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, storagegateway.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSMBFileShareDestroy(ctx), @@ -209,7 +209,7 @@ func TestAccStorageGatewaySMBFileShare_defaultStorageClass(t *testing.T) { resourceName := "aws_storagegateway_smb_file_share.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, storagegateway.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSMBFileShareDestroy(ctx), @@ -244,7 +244,7 @@ func TestAccStorageGatewaySMBFileShare_fileShareName(t *testing.T) { resourceName := "aws_storagegateway_smb_file_share.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, storagegateway.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSMBFileShareDestroy(ctx), @@ -279,7 +279,7 @@ func TestAccStorageGatewaySMBFileShare_tags(t *testing.T) { resourceName := "aws_storagegateway_smb_file_share.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, storagegateway.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSMBFileShareDestroy(ctx), @@ -325,7 +325,7 @@ func TestAccStorageGatewaySMBFileShare_guessMIMETypeEnabled(t *testing.T) { resourceName := "aws_storagegateway_smb_file_share.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, storagegateway.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSMBFileShareDestroy(ctx), @@ -377,7 +377,7 @@ func TestAccStorageGatewaySMBFileShare_opLocksEnabled(t *testing.T) { resourceName := "aws_storagegateway_smb_file_share.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, storagegateway.EndpointsID), ProtoV5ProviderFactories:acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSMBFileShareDestroy, @@ -414,7 +414,7 @@ func TestAccStorageGatewaySMBFileShare_invalidUserList(t *testing.T) { domainName := acctest.RandomDomainName() resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, storagegateway.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSMBFileShareDestroy(ctx), @@ -456,7 +456,7 @@ func TestAccStorageGatewaySMBFileShare_kmsEncrypted(t *testing.T) { resourceName := "aws_storagegateway_smb_file_share.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, storagegateway.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSMBFileShareDestroy(ctx), @@ -490,7 +490,7 @@ func TestAccStorageGatewaySMBFileShare_kmsKeyARN(t *testing.T) { keyUpdatedName := "aws_kms_key.test.1" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, storagegateway.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSMBFileShareDestroy(ctx), @@ -534,7 +534,7 @@ func TestAccStorageGatewaySMBFileShare_objectACL(t *testing.T) { resourceName := "aws_storagegateway_smb_file_share.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, storagegateway.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSMBFileShareDestroy(ctx), @@ -569,7 +569,7 @@ func TestAccStorageGatewaySMBFileShare_readOnly(t *testing.T) { resourceName := "aws_storagegateway_smb_file_share.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, storagegateway.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSMBFileShareDestroy(ctx), @@ -604,7 +604,7 @@ func TestAccStorageGatewaySMBFileShare_requesterPays(t *testing.T) { resourceName := "aws_storagegateway_smb_file_share.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, storagegateway.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSMBFileShareDestroy(ctx), @@ -640,7 +640,7 @@ func TestAccStorageGatewaySMBFileShare_validUserList(t *testing.T) { domainName := acctest.RandomDomainName() resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, storagegateway.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSMBFileShareDestroy(ctx), @@ -683,7 +683,7 @@ func TestAccStorageGatewaySMBFileShare_SMB_acl(t *testing.T) { domainName := acctest.RandomDomainName() resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, storagegateway.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSMBFileShareDestroy(ctx), @@ -727,7 +727,7 @@ func TestAccStorageGatewaySMBFileShare_audit(t *testing.T) { logResourceNameSecond := "aws_cloudwatch_log_group.test2" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, storagegateway.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSMBFileShareDestroy(ctx), @@ -762,7 +762,7 @@ func TestAccStorageGatewaySMBFileShare_cacheAttributes(t *testing.T) { resourceName := "aws_storagegateway_smb_file_share.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, storagegateway.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSMBFileShareDestroy(ctx), @@ -807,7 +807,7 @@ func TestAccStorageGatewaySMBFileShare_caseSensitivity(t *testing.T) { resourceName := "aws_storagegateway_smb_file_share.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, storagegateway.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSMBFileShareDestroy(ctx), @@ -849,7 +849,7 @@ func TestAccStorageGatewaySMBFileShare_disappears(t *testing.T) { resourceName := "aws_storagegateway_smb_file_share.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, storagegateway.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSMBFileShareDestroy(ctx), @@ -874,7 +874,7 @@ func TestAccStorageGatewaySMBFileShare_adminUserList(t *testing.T) { domainName := acctest.RandomDomainName() resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, storagegateway.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSMBFileShareDestroy(ctx), diff --git a/internal/service/storagegateway/stored_iscsi_volume_test.go b/internal/service/storagegateway/stored_iscsi_volume_test.go index b1f4c0f71c2d..86122e5c2271 100644 --- a/internal/service/storagegateway/stored_iscsi_volume_test.go +++ b/internal/service/storagegateway/stored_iscsi_volume_test.go @@ -24,7 +24,7 @@ func TestAccStorageGatewayStorediSCSIVolume_basic(t *testing.T) { resourceName := "aws_storagegateway_stored_iscsi_volume.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, storagegateway.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckStorediSCSIVolumeDestroy(ctx), @@ -67,7 +67,7 @@ func TestAccStorageGatewayStorediSCSIVolume_kms(t *testing.T) { keyResourceName := "aws_kms_key.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, storagegateway.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckStorediSCSIVolumeDestroy(ctx), @@ -96,7 +96,7 @@ func TestAccStorageGatewayStorediSCSIVolume_tags(t *testing.T) { resourceName := "aws_storagegateway_stored_iscsi_volume.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, storagegateway.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckStorediSCSIVolumeDestroy(ctx), @@ -145,7 +145,7 @@ func TestAccStorageGatewayStorediSCSIVolume_snapshotID(t *testing.T) { resourceName := "aws_storagegateway_stored_iscsi_volume.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, storagegateway.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckStorediSCSIVolumeDestroy(ctx), @@ -183,7 +183,7 @@ func TestAccStorageGatewayStorediSCSIVolume_disappears(t *testing.T) { resourceName := "aws_storagegateway_stored_iscsi_volume.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, storagegateway.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckStorediSCSIVolumeDestroy(ctx), diff --git a/internal/service/storagegateway/tape_pool_test.go b/internal/service/storagegateway/tape_pool_test.go index e2cde3937530..6160a08bab05 100644 --- a/internal/service/storagegateway/tape_pool_test.go +++ b/internal/service/storagegateway/tape_pool_test.go @@ -23,7 +23,7 @@ func TestAccStorageGatewayTapePool_basic(t *testing.T) { resourceName := "aws_storagegateway_tape_pool.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, storagegateway.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTapePoolDestroy(ctx), @@ -55,7 +55,7 @@ func TestAccStorageGatewayTapePool_retention(t *testing.T) { resourceName := "aws_storagegateway_tape_pool.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, storagegateway.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTapePoolDestroy(ctx), @@ -87,7 +87,7 @@ func TestAccStorageGatewayTapePool_tags(t *testing.T) { resourceName := "aws_storagegateway_tape_pool.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, storagegateway.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTapePoolDestroy(ctx), @@ -133,7 +133,7 @@ func TestAccStorageGatewayTapePool_disappears(t *testing.T) { resourceName := "aws_storagegateway_tape_pool.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, storagegateway.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTapePoolDestroy(ctx), diff --git a/internal/service/storagegateway/upload_buffer_test.go b/internal/service/storagegateway/upload_buffer_test.go index 82fbae49ab1c..ed688049db66 100644 --- a/internal/service/storagegateway/upload_buffer_test.go +++ b/internal/service/storagegateway/upload_buffer_test.go @@ -81,7 +81,7 @@ func TestAccStorageGatewayUploadBuffer_basic(t *testing.T) { gatewayResourceName := "aws_storagegateway_gateway.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, storagegateway.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, // Storage Gateway API does not support removing upload buffers, @@ -115,7 +115,7 @@ func TestAccStorageGatewayUploadBuffer_diskPath(t *testing.T) { gatewayResourceName := "aws_storagegateway_gateway.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, storagegateway.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, // Storage Gateway API does not support removing upload buffers, diff --git a/internal/service/storagegateway/working_storage_test.go b/internal/service/storagegateway/working_storage_test.go index 6ff18e774831..d555b9a51123 100644 --- a/internal/service/storagegateway/working_storage_test.go +++ b/internal/service/storagegateway/working_storage_test.go @@ -81,7 +81,7 @@ func TestAccStorageGatewayWorkingStorage_basic(t *testing.T) { gatewayResourceName := "aws_storagegateway_gateway.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, storagegateway.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, // Storage Gateway API does not support removing working storages, From 5b41aa654c3c0503ca2d20f38a778092bb212f0f Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Fri, 24 Feb 2023 16:37:31 -0500 Subject: [PATCH 249/763] Add 'Context' argument to 'acctest.PreCheck' for sts. --- internal/service/sts/caller_identity_data_source_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/service/sts/caller_identity_data_source_test.go b/internal/service/sts/caller_identity_data_source_test.go index 5d71a5964c00..1789db424ee2 100644 --- a/internal/service/sts/caller_identity_data_source_test.go +++ b/internal/service/sts/caller_identity_data_source_test.go @@ -10,7 +10,7 @@ import ( func TestAccSTSCallerIdentityDataSource_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, sts.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ From a38104ae935af45557f2d3a85ff769871014a203 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Fri, 24 Feb 2023 16:37:31 -0500 Subject: [PATCH 250/763] Add 'Context' argument to 'acctest.PreCheck' for swf. --- internal/service/swf/domain_test.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/internal/service/swf/domain_test.go b/internal/service/swf/domain_test.go index ddb4d72bc65b..cff454274880 100644 --- a/internal/service/swf/domain_test.go +++ b/internal/service/swf/domain_test.go @@ -34,7 +34,7 @@ func TestAccSWFDomain_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) testAccPreCheckDomainTestingEnabled(t) }, ErrorCheck: acctest.ErrorCheck(t, swf.EndpointsID), @@ -68,7 +68,7 @@ func TestAccSWFDomain_nameGenerated(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) testAccPreCheckDomainTestingEnabled(t) }, ErrorCheck: acctest.ErrorCheck(t, swf.EndpointsID), @@ -98,7 +98,7 @@ func TestAccSWFDomain_namePrefix(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) testAccPreCheckDomainTestingEnabled(t) }, ErrorCheck: acctest.ErrorCheck(t, swf.EndpointsID), @@ -129,7 +129,7 @@ func TestAccSWFDomain_tags(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) testAccPreCheckDomainTestingEnabled(t) }, ErrorCheck: acctest.ErrorCheck(t, swf.EndpointsID), @@ -177,7 +177,7 @@ func TestAccSWFDomain_description(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) testAccPreCheckDomainTestingEnabled(t) }, ErrorCheck: acctest.ErrorCheck(t, swf.EndpointsID), From a5e95cc127ce48806ae2dfa058f5f221cc5b7be3 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Fri, 24 Feb 2023 16:37:32 -0500 Subject: [PATCH 251/763] Add 'Context' argument to 'acctest.PreCheck' for synthetics. --- internal/service/synthetics/canary_test.go | 24 +++++++++++----------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/internal/service/synthetics/canary_test.go b/internal/service/synthetics/canary_test.go index a5dfa103fc2f..ec3027bba588 100644 --- a/internal/service/synthetics/canary_test.go +++ b/internal/service/synthetics/canary_test.go @@ -23,7 +23,7 @@ func TestAccSyntheticsCanary_basic(t *testing.T) { resourceName := "aws_synthetics_canary.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, synthetics.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckCanaryDestroy(ctx), @@ -98,7 +98,7 @@ func TestAccSyntheticsCanary_artifactEncryption(t *testing.T) { resourceName := "aws_synthetics_canary.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, synthetics.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckCanaryDestroy(ctx), @@ -139,7 +139,7 @@ func TestAccSyntheticsCanary_runtimeVersion(t *testing.T) { resourceName := "aws_synthetics_canary.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, synthetics.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckCanaryDestroy(ctx), @@ -175,7 +175,7 @@ func TestAccSyntheticsCanary_startCanary(t *testing.T) { resourceName := "aws_synthetics_canary.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, synthetics.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckCanaryDestroy(ctx), @@ -224,7 +224,7 @@ func TestAccSyntheticsCanary_StartCanary_codeChanges(t *testing.T) { resourceName := "aws_synthetics_canary.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, synthetics.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckCanaryDestroy(ctx), @@ -266,7 +266,7 @@ func TestAccSyntheticsCanary_s3(t *testing.T) { resourceName := "aws_synthetics_canary.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, synthetics.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckCanaryDestroy(ctx), @@ -311,7 +311,7 @@ func TestAccSyntheticsCanary_run(t *testing.T) { resourceName := "aws_synthetics_canary.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, synthetics.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckCanaryDestroy(ctx), @@ -358,7 +358,7 @@ func TestAccSyntheticsCanary_runTracing(t *testing.T) { resourceName := "aws_synthetics_canary.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, synthetics.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckCanaryDestroy(ctx), @@ -401,7 +401,7 @@ func TestAccSyntheticsCanary_runEnvironmentVariables(t *testing.T) { resourceName := "aws_synthetics_canary.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, synthetics.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckCanaryDestroy(ctx), @@ -444,7 +444,7 @@ func TestAccSyntheticsCanary_vpc(t *testing.T) { resourceName := "aws_synthetics_canary.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, synthetics.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckCanaryDestroy(ctx), @@ -493,7 +493,7 @@ func TestAccSyntheticsCanary_tags(t *testing.T) { resourceName := "aws_synthetics_canary.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, synthetics.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckCanaryDestroy(ctx), @@ -540,7 +540,7 @@ func TestAccSyntheticsCanary_disappears(t *testing.T) { resourceName := "aws_synthetics_canary.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, synthetics.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckCanaryDestroy(ctx), From dd9f0702dd90dcb046f7b515fbcb25a3629cec65 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Fri, 24 Feb 2023 16:37:32 -0500 Subject: [PATCH 252/763] Add 'Context' argument to 'acctest.PreCheck' for timestreamwrite. --- internal/service/timestreamwrite/database_test.go | 10 +++++----- internal/service/timestreamwrite/table_test.go | 14 +++++++------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/internal/service/timestreamwrite/database_test.go b/internal/service/timestreamwrite/database_test.go index 54fc803ee1e3..6621d73965bd 100644 --- a/internal/service/timestreamwrite/database_test.go +++ b/internal/service/timestreamwrite/database_test.go @@ -23,7 +23,7 @@ func TestAccTimestreamWriteDatabase_basic(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, timestreamwrite.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDatabaseDestroy(ctx), @@ -53,7 +53,7 @@ func TestAccTimestreamWriteDatabase_disappears(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, timestreamwrite.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDatabaseDestroy(ctx), @@ -77,7 +77,7 @@ func TestAccTimestreamWriteDatabase_kmsKey(t *testing.T) { kmsResourceName := "aws_kms_key.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, timestreamwrite.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDatabaseDestroy(ctx), @@ -106,7 +106,7 @@ func TestAccTimestreamWriteDatabase_updateKMSKey(t *testing.T) { kmsResourceName := "aws_kms_key.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, timestreamwrite.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDatabaseDestroy(ctx), @@ -147,7 +147,7 @@ func TestAccTimestreamWriteDatabase_tags(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, timestreamwrite.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDatabaseDestroy(ctx), diff --git a/internal/service/timestreamwrite/table_test.go b/internal/service/timestreamwrite/table_test.go index d87773ee4a3a..0bce77bfb414 100644 --- a/internal/service/timestreamwrite/table_test.go +++ b/internal/service/timestreamwrite/table_test.go @@ -23,7 +23,7 @@ func TestAccTimestreamWriteTable_basic(t *testing.T) { dbResourceName := "aws_timestreamwrite_database.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, timestreamwrite.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTableDestroy(ctx), @@ -57,7 +57,7 @@ func TestAccTimestreamWriteTable_magneticStoreWriteProperties(t *testing.T) { resourceName := "aws_timestreamwrite_table.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, timestreamwrite.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTableDestroy(ctx), @@ -104,7 +104,7 @@ func TestAccTimestreamWriteTable_magneticStoreWriteProperties_s3Config(t *testin resourceName := "aws_timestreamwrite_table.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, timestreamwrite.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTableDestroy(ctx), @@ -149,7 +149,7 @@ func TestAccTimestreamWriteTable_magneticStoreWriteProperties_s3KMSConfig(t *tes resourceName := "aws_timestreamwrite_table.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, timestreamwrite.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTableDestroy(ctx), @@ -183,7 +183,7 @@ func TestAccTimestreamWriteTable_disappears(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, timestreamwrite.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTableDestroy(ctx), @@ -207,7 +207,7 @@ func TestAccTimestreamWriteTable_retentionProperties(t *testing.T) { resourceName := "aws_timestreamwrite_table.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, timestreamwrite.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTableDestroy(ctx), @@ -257,7 +257,7 @@ func TestAccTimestreamWriteTable_tags(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, timestreamwrite.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTableDestroy(ctx), From ac456e7458da1fec8fcfbcf16bc4301c3a2ee8a7 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Fri, 24 Feb 2023 16:37:32 -0500 Subject: [PATCH 253/763] Add 'Context' argument to 'acctest.PreCheck' for transcribe. --- internal/service/transcribe/language_model_test.go | 6 +++--- internal/service/transcribe/medical_vocabulary_test.go | 8 ++++---- internal/service/transcribe/vocabulary_filter_test.go | 10 +++++----- internal/service/transcribe/vocabulary_test.go | 10 +++++----- 4 files changed, 17 insertions(+), 17 deletions(-) diff --git a/internal/service/transcribe/language_model_test.go b/internal/service/transcribe/language_model_test.go index d7898aaa331d..68bdf82cdef5 100644 --- a/internal/service/transcribe/language_model_test.go +++ b/internal/service/transcribe/language_model_test.go @@ -29,7 +29,7 @@ func TestAccTranscribeLanguageModel_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(names.TranscribeEndpointID, t) testAccLanguageModelsPreCheck(ctx, t) }, @@ -67,7 +67,7 @@ func TestAccTranscribeLanguageModel_updateTags(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(names.TranscribeEndpointID, t) testAccLanguageModelsPreCheck(ctx, t) }, @@ -116,7 +116,7 @@ func TestAccTranscribeLanguageModel_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(names.TranscribeEndpointID, t) testAccLanguageModelsPreCheck(ctx, t) }, diff --git a/internal/service/transcribe/medical_vocabulary_test.go b/internal/service/transcribe/medical_vocabulary_test.go index efde11346e1b..3fe1ef93dd18 100644 --- a/internal/service/transcribe/medical_vocabulary_test.go +++ b/internal/service/transcribe/medical_vocabulary_test.go @@ -28,7 +28,7 @@ func TestAccTranscribeMedicalVocabulary_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(names.TranscribeEndpointID, t) testAccMedicalVocabularyPreCheck(ctx, t) }, @@ -69,7 +69,7 @@ func TestAccTranscribeMedicalVocabulary_updateS3URI(t *testing.T) { file2 := "test2.txt" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(names.TranscribeEndpointID, t) testAccMedicalVocabularyPreCheck(ctx, t) }, @@ -109,7 +109,7 @@ func TestAccTranscribeMedicalVocabulary_updateTags(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(names.TranscribeEndpointID, t) testAccMedicalVocabularyPreCheck(ctx, t) }, @@ -158,7 +158,7 @@ func TestAccTranscribeMedicalVocabulary_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(names.TranscribeEndpointID, t) testAccMedicalVocabularyPreCheck(ctx, t) }, diff --git a/internal/service/transcribe/vocabulary_filter_test.go b/internal/service/transcribe/vocabulary_filter_test.go index c5e13bc0eec7..efdd2d6ca08b 100644 --- a/internal/service/transcribe/vocabulary_filter_test.go +++ b/internal/service/transcribe/vocabulary_filter_test.go @@ -30,7 +30,7 @@ func TestAccTranscribeVocabularyFilter_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(names.TranscribeEndpointID, t) testAccVocabularyFiltersPreCheck(ctx, t) }, @@ -69,7 +69,7 @@ func TestAccTranscribeVocabularyFilter_basicWords(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(names.TranscribeEndpointID, t) testAccVocabularyFiltersPreCheck(ctx, t) }, @@ -102,7 +102,7 @@ func TestAccTranscribeVocabularyFilter_update(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(names.TranscribeEndpointID, t) testAccVocabularyFiltersPreCheck(ctx, t) }, @@ -144,7 +144,7 @@ func TestAccTranscribeVocabularyFilter_updateTags(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(names.TranscribeEndpointID, t) testAccVocabularyFiltersPreCheck(ctx, t) }, @@ -193,7 +193,7 @@ func TestAccTranscribeVocabularyFilter_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(names.TranscribeEndpointID, t) testAccVocabularyFiltersPreCheck(ctx, t) }, diff --git a/internal/service/transcribe/vocabulary_test.go b/internal/service/transcribe/vocabulary_test.go index 4d1b2411aa52..184a264e5653 100644 --- a/internal/service/transcribe/vocabulary_test.go +++ b/internal/service/transcribe/vocabulary_test.go @@ -30,7 +30,7 @@ func TestAccTranscribeVocabulary_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(names.TranscribeEndpointID, t) testAccVocabulariesPreCheck(ctx, t) }, @@ -69,7 +69,7 @@ func TestAccTranscribeVocabulary_basicPhrases(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(names.TranscribeEndpointID, t) testAccVocabulariesPreCheck(ctx, t) }, @@ -104,7 +104,7 @@ func TestAccTranscribeVocabulary_updateS3URI(t *testing.T) { file2 := "test2.txt" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(names.TranscribeEndpointID, t) testAccVocabulariesPreCheck(ctx, t) }, @@ -144,7 +144,7 @@ func TestAccTranscribeVocabulary_updateTags(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(names.TranscribeEndpointID, t) testAccVocabulariesPreCheck(ctx, t) }, @@ -193,7 +193,7 @@ func TestAccTranscribeVocabulary_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(names.TranscribeEndpointID, t) testAccVocabulariesPreCheck(ctx, t) }, From 696cc7d80cc9d912896dd8faced0b92cebc8afc7 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Fri, 24 Feb 2023 16:37:32 -0500 Subject: [PATCH 254/763] Add 'Context' argument to 'acctest.PreCheck' for transfer. --- internal/service/transfer/access_test.go | 8 ++-- .../transfer/server_data_source_test.go | 6 +-- internal/service/transfer/server_test.go | 48 +++++++++---------- internal/service/transfer/ssh_key_test.go | 2 +- internal/service/transfer/tag_test.go | 8 ++-- internal/service/transfer/user_test.go | 12 ++--- internal/service/transfer/workflow_test.go | 10 ++-- 7 files changed, 47 insertions(+), 47 deletions(-) diff --git a/internal/service/transfer/access_test.go b/internal/service/transfer/access_test.go index 4be68fbc5be0..035db6a3d7c5 100644 --- a/internal/service/transfer/access_test.go +++ b/internal/service/transfer/access_test.go @@ -23,7 +23,7 @@ func testAccAccess_s3_basic(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) testAccPreCheck(ctx, t) acctest.PreCheckDirectoryService(ctx, t) acctest.PreCheckDirectoryServiceSimpleDirectory(ctx, t) @@ -69,7 +69,7 @@ func testAccAccess_efs_basic(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) testAccPreCheck(ctx, t) acctest.PreCheckDirectoryService(ctx, t) acctest.PreCheckDirectoryServiceSimpleDirectory(ctx, t) @@ -116,7 +116,7 @@ func testAccAccess_disappears(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) testAccPreCheck(ctx, t) acctest.PreCheckDirectoryService(ctx, t) acctest.PreCheckDirectoryServiceSimpleDirectory(ctx, t) @@ -145,7 +145,7 @@ func testAccAccess_s3_policy(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) testAccPreCheck(ctx, t) acctest.PreCheckDirectoryService(ctx, t) acctest.PreCheckDirectoryServiceSimpleDirectory(ctx, t) diff --git a/internal/service/transfer/server_data_source_test.go b/internal/service/transfer/server_data_source_test.go index 2ed278b4b144..244a15057458 100644 --- a/internal/service/transfer/server_data_source_test.go +++ b/internal/service/transfer/server_data_source_test.go @@ -16,7 +16,7 @@ func TestAccTransferServerDataSource_basic(t *testing.T) { datasourceName := "data.aws_transfer_server.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, transfer.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ @@ -41,7 +41,7 @@ func TestAccTransferServerDataSource_Service_managed(t *testing.T) { datasourceName := "data.aws_transfer_server.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, transfer.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ @@ -71,7 +71,7 @@ func TestAccTransferServerDataSource_apigateway(t *testing.T) { datasourceName := "data.aws_transfer_server.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t); acctest.PreCheckAPIGatewayTypeEDGE(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t); acctest.PreCheckAPIGatewayTypeEDGE(t) }, ErrorCheck: acctest.ErrorCheck(t, transfer.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ diff --git a/internal/service/transfer/server_test.go b/internal/service/transfer/server_test.go index 6c8d3d75e115..3fc45529a923 100644 --- a/internal/service/transfer/server_test.go +++ b/internal/service/transfer/server_test.go @@ -37,7 +37,7 @@ func testAccServer_basic(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, transfer.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckServerDestroy(ctx), @@ -108,7 +108,7 @@ func testAccServer_domain(t *testing.T) { resourceName := "aws_transfer_server.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, transfer.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckServerDestroy(ctx), @@ -136,7 +136,7 @@ func testAccServer_disappears(t *testing.T) { resourceName := "aws_transfer_server.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, transfer.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckServerDestroy(ctx), @@ -159,7 +159,7 @@ func testAccServer_securityPolicy(t *testing.T) { resourceName := "aws_transfer_server.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, transfer.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckServerDestroy(ctx), @@ -205,7 +205,7 @@ func testAccServer_vpc(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, transfer.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckServerDestroy(ctx), @@ -275,7 +275,7 @@ func testAccServer_vpcAddressAllocationIDs(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, transfer.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckServerDestroy(ctx), @@ -346,7 +346,7 @@ func testAccServer_vpcSecurityGroupIDs(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, transfer.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckServerDestroy(ctx), @@ -402,7 +402,7 @@ func testAccServer_vpcAddressAllocationIds_securityGroupIDs(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, transfer.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckServerDestroy(ctx), @@ -456,7 +456,7 @@ func testAccServer_updateEndpointType_publicToVPC(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, transfer.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckServerDestroy(ctx), @@ -494,7 +494,7 @@ func testAccServer_updateEndpointType_publicToVPC_addressAllocationIDs(t *testin rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, transfer.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckServerDestroy(ctx), @@ -532,7 +532,7 @@ func testAccServer_updateEndpointType_vpcEndpointToVPC(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, transfer.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckServerDestroy(ctx), @@ -570,7 +570,7 @@ func testAccServer_updateEndpointType_vpcEndpointToVPC_addressAllocationIDs(t *t rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, transfer.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckServerDestroy(ctx), @@ -608,7 +608,7 @@ func testAccServer_updateEndpointType_vpcEndpointToVPC_securityGroupIDs(t *testi rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, transfer.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckServerDestroy(ctx), @@ -646,7 +646,7 @@ func testAccServer_updateEndpointType_vpcToPublic(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, transfer.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckServerDestroy(ctx), @@ -689,7 +689,7 @@ func testAccServer_protocols(t *testing.T) { domain := acctest.ACMCertificateRandomSubDomain(rootDomain) resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckAPIGatewayTypeEDGE(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckAPIGatewayTypeEDGE(t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, transfer.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckServerDestroy(ctx), @@ -750,7 +750,7 @@ func testAccServer_apiGateway(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckAPIGatewayTypeEDGE(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckAPIGatewayTypeEDGE(t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, transfer.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckServerDestroy(ctx), @@ -780,7 +780,7 @@ func testAccServer_apiGateway_forceDestroy(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckAPIGatewayTypeEDGE(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckAPIGatewayTypeEDGE(t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, transfer.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckServerDestroy(ctx), @@ -812,7 +812,7 @@ func testAccServer_directoryService(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) testAccPreCheck(ctx, t) acctest.PreCheckDirectoryService(ctx, t) acctest.PreCheckDirectoryServiceSimpleDirectory(ctx, t) @@ -854,7 +854,7 @@ func testAccServer_forceDestroy(t *testing.T) { } resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, transfer.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckServerDestroy(ctx), @@ -885,7 +885,7 @@ func testAccServer_hostKey(t *testing.T) { hostKey := "test-fixtures/transfer-ssh-rsa-key" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, transfer.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckServerDestroy(ctx), @@ -916,7 +916,7 @@ func testAccServer_vpcEndpointID(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) testAccPreCheck(ctx, t) acctest.PreCheckPartitionNot(t, endpoints.AwsUsGovPartitionID) }, @@ -954,7 +954,7 @@ func testAccServer_lambdaFunction(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckAPIGatewayTypeEDGE(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckAPIGatewayTypeEDGE(t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, transfer.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckServerDestroy(ctx), @@ -983,7 +983,7 @@ func testAccServer_authenticationLoginBanners(t *testing.T) { resourceName := "aws_transfer_server.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, transfer.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckServerDestroy(ctx), @@ -1013,7 +1013,7 @@ func testAccServer_workflowDetails(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, transfer.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckServerDestroy(ctx), diff --git a/internal/service/transfer/ssh_key_test.go b/internal/service/transfer/ssh_key_test.go index d351fb427ad1..c0117f35a4e1 100644 --- a/internal/service/transfer/ssh_key_test.go +++ b/internal/service/transfer/ssh_key_test.go @@ -29,7 +29,7 @@ func testAccSSHKey_basic(t *testing.T) { } resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, transfer.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSSHKeyDestroy(ctx), diff --git a/internal/service/transfer/tag_test.go b/internal/service/transfer/tag_test.go index 605dfbe9aa68..739933816c76 100644 --- a/internal/service/transfer/tag_test.go +++ b/internal/service/transfer/tag_test.go @@ -17,7 +17,7 @@ func TestAccTransferTag_basic(t *testing.T) { resourceName := "aws_transfer_tag.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, transfer.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTagDestroy(ctx), @@ -45,7 +45,7 @@ func TestAccTransferTag_disappears(t *testing.T) { resourceName := "aws_transfer_tag.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, transfer.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTagDestroy(ctx), @@ -68,7 +68,7 @@ func TestAccTransferTag_value(t *testing.T) { resourceName := "aws_transfer_tag.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, transfer.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTagDestroy(ctx), @@ -104,7 +104,7 @@ func TestAccTransferTag_system(t *testing.T) { resourceName := "aws_transfer_tag.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, transfer.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckTagDestroy(ctx), diff --git a/internal/service/transfer/user_test.go b/internal/service/transfer/user_test.go index 099b64686bfb..04ca87c1ef68 100644 --- a/internal/service/transfer/user_test.go +++ b/internal/service/transfer/user_test.go @@ -23,7 +23,7 @@ func testAccUser_basic(t *testing.T) { rName := sdkacctest.RandString(10) resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, transfer.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckUserDestroy(ctx), @@ -54,7 +54,7 @@ func testAccUser_posix(t *testing.T) { rName := sdkacctest.RandString(10) resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, transfer.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckUserDestroy(ctx), @@ -95,7 +95,7 @@ func testAccUser_modifyWithOptions(t *testing.T) { rName2 := sdkacctest.RandString(10) resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, transfer.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckUserDestroy(ctx), @@ -143,7 +143,7 @@ func testAccUser_disappears(t *testing.T) { resourceName := "aws_transfer_user.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, transfer.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckUserDestroy(ctx), @@ -164,7 +164,7 @@ func testAccUser_disappears(t *testing.T) { func testAccUser_UserName_Validation(t *testing.T) { ctx := acctest.Context(t) resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, transfer.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckUserDestroy(ctx), @@ -206,7 +206,7 @@ func testAccUser_homeDirectoryMappings(t *testing.T) { resourceName := "aws_transfer_user.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, transfer.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckUserDestroy(ctx), diff --git a/internal/service/transfer/workflow_test.go b/internal/service/transfer/workflow_test.go index 2ef831b66a55..126e761d88df 100644 --- a/internal/service/transfer/workflow_test.go +++ b/internal/service/transfer/workflow_test.go @@ -23,7 +23,7 @@ func TestAccTransferWorkflow_basic(t *testing.T) { rName := sdkacctest.RandString(25) resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, transfer.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckWorkflowDestroy(ctx), @@ -58,7 +58,7 @@ func TestAccTransferWorkflow_onExecution(t *testing.T) { rName := sdkacctest.RandString(25) resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, transfer.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckWorkflowDestroy(ctx), @@ -97,7 +97,7 @@ func TestAccTransferWorkflow_description(t *testing.T) { rName := sdkacctest.RandString(25) resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, transfer.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckWorkflowDestroy(ctx), @@ -125,7 +125,7 @@ func TestAccTransferWorkflow_tags(t *testing.T) { rName := sdkacctest.RandString(25) resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, transfer.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckWorkflowDestroy(ctx), @@ -171,7 +171,7 @@ func TestAccTransferWorkflow_disappears(t *testing.T) { rName := sdkacctest.RandString(25) resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, transfer.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckWorkflowDestroy(ctx), From 08035a7679c29602baf0b29ccbe99dd2530c7c00 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Fri, 24 Feb 2023 16:37:33 -0500 Subject: [PATCH 255/763] Add 'Context' argument to 'acctest.PreCheck' for waf. --- internal/service/waf/byte_match_set_test.go | 10 +++++----- internal/service/waf/geo_match_set_test.go | 10 +++++----- internal/service/waf/ipset_data_source_test.go | 2 +- internal/service/waf/ipset_test.go | 14 +++++++------- .../waf/rate_based_rule_data_source_test.go | 2 +- internal/service/waf/rate_based_rule_test.go | 14 +++++++------- internal/service/waf/regex_match_set_test.go | 8 ++++---- internal/service/waf/regex_pattern_set_test.go | 8 ++++---- internal/service/waf/rule_data_source_test.go | 2 +- internal/service/waf/rule_group_test.go | 12 ++++++------ internal/service/waf/rule_test.go | 16 ++++++++-------- internal/service/waf/size_constraint_set_test.go | 10 +++++----- .../service/waf/sql_injection_match_set_test.go | 10 +++++----- .../service/waf/subscribed_rule_group_test.go | 2 +- internal/service/waf/web_acl_data_source_test.go | 2 +- internal/service/waf/web_acl_test.go | 14 +++++++------- internal/service/waf/xss_match_set_test.go | 10 +++++----- 17 files changed, 73 insertions(+), 73 deletions(-) diff --git a/internal/service/waf/byte_match_set_test.go b/internal/service/waf/byte_match_set_test.go index a61ee86225d2..1156c8d7d1ac 100644 --- a/internal/service/waf/byte_match_set_test.go +++ b/internal/service/waf/byte_match_set_test.go @@ -23,7 +23,7 @@ func TestAccWAFByteMatchSet_basic(t *testing.T) { resourceName := "aws_waf_byte_match_set.byte_set" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, waf.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckByteMatchSetDestroy(ctx), @@ -69,7 +69,7 @@ func TestAccWAFByteMatchSet_changeNameForceNew(t *testing.T) { resourceName := "aws_waf_byte_match_set.byte_set" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, waf.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckByteMatchSetDestroy(ctx), @@ -106,7 +106,7 @@ func TestAccWAFByteMatchSet_changeTuples(t *testing.T) { resourceName := "aws_waf_byte_match_set.byte_set" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, waf.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckByteMatchSetDestroy(ctx), @@ -175,7 +175,7 @@ func TestAccWAFByteMatchSet_noTuples(t *testing.T) { resourceName := "aws_waf_byte_match_set.byte_set" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, waf.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckByteMatchSetDestroy(ctx), @@ -204,7 +204,7 @@ func TestAccWAFByteMatchSet_disappears(t *testing.T) { resourceName := "aws_waf_byte_match_set.byte_set" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, waf.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckByteMatchSetDestroy(ctx), diff --git a/internal/service/waf/geo_match_set_test.go b/internal/service/waf/geo_match_set_test.go index 97304ce9b477..a16b355b4711 100644 --- a/internal/service/waf/geo_match_set_test.go +++ b/internal/service/waf/geo_match_set_test.go @@ -24,7 +24,7 @@ func TestAccWAFGeoMatchSet_basic(t *testing.T) { resourceName := "aws_waf_geo_match_set.geo_match_set" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, waf.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckGeoMatchSetDestroy(ctx), @@ -63,7 +63,7 @@ func TestAccWAFGeoMatchSet_changeNameForceNew(t *testing.T) { resourceName := "aws_waf_geo_match_set.geo_match_set" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, waf.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckGeoMatchSetDestroy(ctx), @@ -100,7 +100,7 @@ func TestAccWAFGeoMatchSet_disappears(t *testing.T) { resourceName := "aws_waf_geo_match_set.geo_match_set" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, waf.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckGeoMatchSetDestroy(ctx), @@ -124,7 +124,7 @@ func TestAccWAFGeoMatchSet_changeConstraints(t *testing.T) { resourceName := "aws_waf_geo_match_set.geo_match_set" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, waf.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckGeoMatchSetDestroy(ctx), @@ -177,7 +177,7 @@ func TestAccWAFGeoMatchSet_noConstraints(t *testing.T) { resourceName := "aws_waf_geo_match_set.geo_match_set" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, waf.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckGeoMatchSetDestroy(ctx), diff --git a/internal/service/waf/ipset_data_source_test.go b/internal/service/waf/ipset_data_source_test.go index 95169811b673..f178d0f75486 100644 --- a/internal/service/waf/ipset_data_source_test.go +++ b/internal/service/waf/ipset_data_source_test.go @@ -17,7 +17,7 @@ func TestAccWAFIPSetDataSource_basic(t *testing.T) { datasourceName := "data.aws_waf_ipset.ipset" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(waf.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(waf.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, waf.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ diff --git a/internal/service/waf/ipset_test.go b/internal/service/waf/ipset_test.go index fb6134f9e632..05af3a39ad69 100644 --- a/internal/service/waf/ipset_test.go +++ b/internal/service/waf/ipset_test.go @@ -27,7 +27,7 @@ func TestAccWAFIPSet_basic(t *testing.T) { resourceName := "aws_waf_ipset.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, waf.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckIPSetDestroy(ctx), @@ -60,7 +60,7 @@ func TestAccWAFIPSet_disappears(t *testing.T) { resourceName := "aws_waf_ipset.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, waf.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckIPSetDestroy(ctx), @@ -85,7 +85,7 @@ func TestAccWAFIPSet_changeNameForceNew(t *testing.T) { resourceName := "aws_waf_ipset.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, waf.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckIPSetDestroy(ctx), @@ -128,7 +128,7 @@ func TestAccWAFIPSet_changeDescriptors(t *testing.T) { resourceName := "aws_waf_ipset.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, waf.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckIPSetDestroy(ctx), @@ -173,7 +173,7 @@ func TestAccWAFIPSet_noDescriptors(t *testing.T) { resourceName := "aws_waf_ipset.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, waf.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckIPSetDestroy(ctx), @@ -221,7 +221,7 @@ func TestAccWAFIPSet_IPSetDescriptors_1000UpdateLimit(t *testing.T) { } resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, waf.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckIPSetDestroy(ctx), @@ -359,7 +359,7 @@ func TestAccWAFIPSet_ipv6(t *testing.T) { resourceName := "aws_waf_ipset.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, waf.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckIPSetDestroy(ctx), 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 95204e5f6ece..f0e02b9644b6 100644 --- a/internal/service/waf/rate_based_rule_data_source_test.go +++ b/internal/service/waf/rate_based_rule_data_source_test.go @@ -17,7 +17,7 @@ func TestAccWAFRateBasedRuleDataSource_basic(t *testing.T) { datasourceName := "data.aws_waf_rate_based_rule.wafrule" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(waf.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(waf.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, waf.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ diff --git a/internal/service/waf/rate_based_rule_test.go b/internal/service/waf/rate_based_rule_test.go index 31b33033f87f..95108a01f6ee 100644 --- a/internal/service/waf/rate_based_rule_test.go +++ b/internal/service/waf/rate_based_rule_test.go @@ -23,7 +23,7 @@ func TestAccWAFRateBasedRule_basic(t *testing.T) { resourceName := "aws_waf_rate_based_rule.wafrule" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, waf.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRateBasedRuleDestroy(ctx), @@ -55,7 +55,7 @@ func TestAccWAFRateBasedRule_changeNameForceNew(t *testing.T) { resourceName := "aws_waf_rate_based_rule.wafrule" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, waf.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckIPSetDestroy(ctx), @@ -94,7 +94,7 @@ func TestAccWAFRateBasedRule_disappears(t *testing.T) { resourceName := "aws_waf_rate_based_rule.wafrule" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, waf.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRateBasedRuleDestroy(ctx), @@ -121,7 +121,7 @@ func TestAccWAFRateBasedRule_changePredicates(t *testing.T) { resourceName := "aws_waf_rate_based_rule.wafrule" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, waf.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRuleDestroy(ctx), @@ -170,7 +170,7 @@ func TestAccWAFRateBasedRule_changeRateLimit(t *testing.T) { resourceName := "aws_waf_rate_based_rule.wafrule" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, waf.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRuleDestroy(ctx), @@ -219,7 +219,7 @@ func TestAccWAFRateBasedRule_noPredicates(t *testing.T) { resourceName := "aws_waf_rate_based_rule.wafrule" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, waf.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRateBasedRuleDestroy(ctx), @@ -248,7 +248,7 @@ func TestAccWAFRateBasedRule_tags(t *testing.T) { resourceName := "aws_waf_rate_based_rule.wafrule" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, waf.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRateBasedRuleDestroy(ctx), diff --git a/internal/service/waf/regex_match_set_test.go b/internal/service/waf/regex_match_set_test.go index 5fbe470a5ac9..a882d6441ae7 100644 --- a/internal/service/waf/regex_match_set_test.go +++ b/internal/service/waf/regex_match_set_test.go @@ -48,7 +48,7 @@ func testAccRegexMatchSet_basic(t *testing.T) { } resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, waf.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRegexMatchSetDestroy(ctx), @@ -90,7 +90,7 @@ func testAccRegexMatchSet_changePatterns(t *testing.T) { resourceName := "aws_waf_regex_match_set.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, waf.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRegexMatchSetDestroy(ctx), @@ -143,7 +143,7 @@ func testAccRegexMatchSet_noPatterns(t *testing.T) { resourceName := "aws_waf_regex_match_set.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, waf.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRegexMatchSetDestroy(ctx), @@ -173,7 +173,7 @@ func testAccRegexMatchSet_disappears(t *testing.T) { resourceName := "aws_waf_regex_match_set.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, waf.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRegexMatchSetDestroy(ctx), diff --git a/internal/service/waf/regex_pattern_set_test.go b/internal/service/waf/regex_pattern_set_test.go index 56c58a286f8b..6e215fc19fa3 100644 --- a/internal/service/waf/regex_pattern_set_test.go +++ b/internal/service/waf/regex_pattern_set_test.go @@ -39,7 +39,7 @@ func testAccRegexPatternSet_basic(t *testing.T) { resourceName := "aws_waf_regex_pattern_set.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, waf.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRegexPatternSetDestroy(ctx), @@ -71,7 +71,7 @@ func testAccRegexPatternSet_changePatterns(t *testing.T) { resourceName := "aws_waf_regex_pattern_set.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, waf.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRegexPatternSetDestroy(ctx), @@ -113,7 +113,7 @@ func testAccRegexPatternSet_noPatterns(t *testing.T) { resourceName := "aws_waf_regex_pattern_set.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, waf.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRegexPatternSetDestroy(ctx), @@ -142,7 +142,7 @@ func testAccRegexPatternSet_disappears(t *testing.T) { resourceName := "aws_waf_regex_pattern_set.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, waf.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRegexPatternSetDestroy(ctx), diff --git a/internal/service/waf/rule_data_source_test.go b/internal/service/waf/rule_data_source_test.go index a76604e18ce5..86c806cbc9fd 100644 --- a/internal/service/waf/rule_data_source_test.go +++ b/internal/service/waf/rule_data_source_test.go @@ -17,7 +17,7 @@ func TestAccWAFRuleDataSource_basic(t *testing.T) { datasourceName := "data.aws_waf_rule.wafrule" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(waf.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(waf.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, waf.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ diff --git a/internal/service/waf/rule_group_test.go b/internal/service/waf/rule_group_test.go index f614887938e8..162788ed1448 100644 --- a/internal/service/waf/rule_group_test.go +++ b/internal/service/waf/rule_group_test.go @@ -29,7 +29,7 @@ func TestAccWAFRuleGroup_basic(t *testing.T) { resourceName := "aws_waf_rule_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, waf.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRuleGroupDestroy(ctx), @@ -70,7 +70,7 @@ func TestAccWAFRuleGroup_changeNameForceNew(t *testing.T) { resourceName := "aws_waf_rule_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, waf.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRuleGroupDestroy(ctx), @@ -110,7 +110,7 @@ func TestAccWAFRuleGroup_disappears(t *testing.T) { resourceName := "aws_waf_rule_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, waf.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRuleGroupDestroy(ctx), @@ -140,7 +140,7 @@ func TestAccWAFRuleGroup_changeActivatedRules(t *testing.T) { resourceName := "aws_waf_rule_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, waf.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRuleGroupDestroy(ctx), @@ -232,7 +232,7 @@ func TestAccWAFRuleGroup_tags(t *testing.T) { resourceName := "aws_waf_rule_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, waf.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckWebACLDestroy(ctx), @@ -284,7 +284,7 @@ func TestAccWAFRuleGroup_noActivatedRules(t *testing.T) { resourceName := "aws_waf_rule_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, waf.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRuleGroupDestroy(ctx), diff --git a/internal/service/waf/rule_test.go b/internal/service/waf/rule_test.go index 64378807b902..88c9f8e7df3b 100644 --- a/internal/service/waf/rule_test.go +++ b/internal/service/waf/rule_test.go @@ -23,7 +23,7 @@ func TestAccWAFRule_basic(t *testing.T) { wafRuleName := fmt.Sprintf("wafrule%s", sdkacctest.RandString(5)) resourceName := "aws_waf_rule.wafrule" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, waf.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRuleDestroy(ctx), @@ -55,7 +55,7 @@ func TestAccWAFRule_changeNameForceNew(t *testing.T) { resourceName := "aws_waf_rule.wafrule" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, waf.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckIPSetDestroy(ctx), @@ -89,7 +89,7 @@ func TestAccWAFRule_disappears(t *testing.T) { resourceName := "aws_waf_rule.wafrule" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, waf.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRuleDestroy(ctx), @@ -116,7 +116,7 @@ func TestAccWAFRule_changePredicates(t *testing.T) { resourceName := "aws_waf_rule.wafrule" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, waf.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRuleDestroy(ctx), @@ -160,7 +160,7 @@ func TestAccWAFRule_geoMatchSetPredicate(t *testing.T) { resourceName := "aws_waf_rule.wafrule" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, waf.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRuleDestroy(ctx), @@ -191,7 +191,7 @@ func TestAccWAFRule_webACL(t *testing.T) { resourceName := "aws_waf_rule.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, waf.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRuleDestroy(ctx), @@ -216,7 +216,7 @@ func TestAccWAFRule_noPredicates(t *testing.T) { resourceName := "aws_waf_rule.wafrule" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, waf.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRuleDestroy(ctx), @@ -240,7 +240,7 @@ func TestAccWAFRule_tags(t *testing.T) { resourceName := "aws_waf_rule.wafrule" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, waf.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckWebACLDestroy(ctx), diff --git a/internal/service/waf/size_constraint_set_test.go b/internal/service/waf/size_constraint_set_test.go index 12bce3c3d5af..6b7a33b16bb4 100644 --- a/internal/service/waf/size_constraint_set_test.go +++ b/internal/service/waf/size_constraint_set_test.go @@ -23,7 +23,7 @@ func TestAccWAFSizeConstraintSet_basic(t *testing.T) { resourceName := "aws_waf_size_constraint_set.size_constraint_set" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, waf.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSizeConstraintSetDestroy(ctx), @@ -64,7 +64,7 @@ func TestAccWAFSizeConstraintSet_changeNameForceNew(t *testing.T) { resourceName := "aws_waf_size_constraint_set.size_constraint_set" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, waf.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSizeConstraintSetDestroy(ctx), @@ -101,7 +101,7 @@ func TestAccWAFSizeConstraintSet_disappears(t *testing.T) { resourceName := "aws_waf_size_constraint_set.size_constraint_set" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, waf.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSizeConstraintSetDestroy(ctx), @@ -125,7 +125,7 @@ func TestAccWAFSizeConstraintSet_changeConstraints(t *testing.T) { resourceName := "aws_waf_size_constraint_set.size_constraint_set" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, waf.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSizeConstraintSetDestroy(ctx), @@ -182,7 +182,7 @@ func TestAccWAFSizeConstraintSet_noConstraints(t *testing.T) { resourceName := "aws_waf_size_constraint_set.size_constraint_set" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, waf.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSizeConstraintSetDestroy(ctx), diff --git a/internal/service/waf/sql_injection_match_set_test.go b/internal/service/waf/sql_injection_match_set_test.go index 44811cf8698f..ce5d288ebbf9 100644 --- a/internal/service/waf/sql_injection_match_set_test.go +++ b/internal/service/waf/sql_injection_match_set_test.go @@ -23,7 +23,7 @@ func TestAccWAFSQLInjectionMatchSet_basic(t *testing.T) { resourceName := "aws_waf_sql_injection_match_set.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, waf.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSQLInjectionMatchSetDestroy(ctx), @@ -59,7 +59,7 @@ func TestAccWAFSQLInjectionMatchSet_changeNameForceNew(t *testing.T) { resourceName := "aws_waf_sql_injection_match_set.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, waf.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSQLInjectionMatchSetDestroy(ctx), @@ -96,7 +96,7 @@ func TestAccWAFSQLInjectionMatchSet_disappears(t *testing.T) { resourceName := "aws_waf_sql_injection_match_set.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, waf.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSQLInjectionMatchSetDestroy(ctx), @@ -120,7 +120,7 @@ func TestAccWAFSQLInjectionMatchSet_changeTuples(t *testing.T) { resourceName := "aws_waf_sql_injection_match_set.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, waf.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSQLInjectionMatchSetDestroy(ctx), @@ -163,7 +163,7 @@ func TestAccWAFSQLInjectionMatchSet_noTuples(t *testing.T) { resourceName := "aws_waf_sql_injection_match_set.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, waf.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSQLInjectionMatchSetDestroy(ctx), diff --git a/internal/service/waf/subscribed_rule_group_test.go b/internal/service/waf/subscribed_rule_group_test.go index f638474d8c07..9c69a4f179f7 100644 --- a/internal/service/waf/subscribed_rule_group_test.go +++ b/internal/service/waf/subscribed_rule_group_test.go @@ -27,7 +27,7 @@ func TestAccWAFSubscribedRuleGroupDataSource_basic(t *testing.T) { datasourceName := "data.aws_waf_subscribed_rule_group.rulegroup" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(waf.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(waf.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, waf.EndpointsID), CheckDestroy: nil, ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, diff --git a/internal/service/waf/web_acl_data_source_test.go b/internal/service/waf/web_acl_data_source_test.go index fbb837d85639..42c2fe5ae655 100644 --- a/internal/service/waf/web_acl_data_source_test.go +++ b/internal/service/waf/web_acl_data_source_test.go @@ -17,7 +17,7 @@ func TestAccWAFWebACLDataSource_basic(t *testing.T) { datasourceName := "data.aws_waf_web_acl.web_acl" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(waf.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(waf.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, waf.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ diff --git a/internal/service/waf/web_acl_test.go b/internal/service/waf/web_acl_test.go index e9850525a1dc..938399d36835 100644 --- a/internal/service/waf/web_acl_test.go +++ b/internal/service/waf/web_acl_test.go @@ -24,7 +24,7 @@ func TestAccWAFWebACL_basic(t *testing.T) { resourceName := "aws_waf_web_acl.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, waf.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckWebACLDestroy(ctx), @@ -59,7 +59,7 @@ func TestAccWAFWebACL_changeNameForceNew(t *testing.T) { resourceName := "aws_waf_web_acl.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, waf.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckWebACLDestroy(ctx), @@ -104,7 +104,7 @@ func TestAccWAFWebACL_defaultAction(t *testing.T) { resourceName := "aws_waf_web_acl.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, waf.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckWebACLDestroy(ctx), @@ -141,7 +141,7 @@ func TestAccWAFWebACL_rules(t *testing.T) { resourceName := "aws_waf_web_acl.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, waf.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckWebACLDestroy(ctx), @@ -188,7 +188,7 @@ func TestAccWAFWebACL_logging(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) testAccPreCheck(ctx, t) testAccPreCheckLoggingConfiguration(ctx, t) }, @@ -240,7 +240,7 @@ func TestAccWAFWebACL_disappears(t *testing.T) { resourceName := "aws_waf_web_acl.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, waf.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckWebACLDestroy(ctx), @@ -264,7 +264,7 @@ func TestAccWAFWebACL_tags(t *testing.T) { resourceName := "aws_waf_web_acl.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, waf.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckWebACLDestroy(ctx), diff --git a/internal/service/waf/xss_match_set_test.go b/internal/service/waf/xss_match_set_test.go index 299985888a5c..4e7d7f3105b2 100644 --- a/internal/service/waf/xss_match_set_test.go +++ b/internal/service/waf/xss_match_set_test.go @@ -24,7 +24,7 @@ func TestAccWAFXSSMatchSet_basic(t *testing.T) { resourceName := "aws_waf_xss_match_set.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, waf.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckXSSMatchSetDestroy(ctx), @@ -67,7 +67,7 @@ func TestAccWAFXSSMatchSet_changeNameForceNew(t *testing.T) { resourceName := "aws_waf_xss_match_set.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, waf.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckXSSMatchSetDestroy(ctx), @@ -104,7 +104,7 @@ func TestAccWAFXSSMatchSet_disappears(t *testing.T) { resourceName := "aws_waf_xss_match_set.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, waf.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckXSSMatchSetDestroy(ctx), @@ -128,7 +128,7 @@ func TestAccWAFXSSMatchSet_changeTuples(t *testing.T) { resourceName := "aws_waf_xss_match_set.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, waf.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckXSSMatchSetDestroy(ctx), @@ -189,7 +189,7 @@ func TestAccWAFXSSMatchSet_noTuples(t *testing.T) { resourceName := "aws_waf_xss_match_set.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, waf.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckXSSMatchSetDestroy(ctx), From 7eaae5db75c7e85c58526f82be6c35cf5c7e6dfe Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Fri, 24 Feb 2023 16:37:33 -0500 Subject: [PATCH 256/763] Add 'Context' argument to 'acctest.PreCheck' for wafregional. --- .../wafregional/byte_match_set_test.go | 10 +++++----- .../service/wafregional/geo_match_set_test.go | 10 +++++----- .../wafregional/ipset_data_source_test.go | 2 +- internal/service/wafregional/ipset_test.go | 12 +++++------ .../rate_based_rule_data_source_test.go | 2 +- .../wafregional/rate_based_rule_test.go | 14 ++++++------- .../wafregional/regex_match_set_test.go | 8 ++++---- .../wafregional/regex_pattern_set_test.go | 8 ++++---- .../wafregional/rule_data_source_test.go | 2 +- .../service/wafregional/rule_group_test.go | 12 +++++------ internal/service/wafregional/rule_test.go | 12 +++++------ .../wafregional/size_constraint_set_test.go | 10 +++++----- .../sql_injection_match_set_test.go | 10 +++++----- .../wafregional/subscribed_rule_group_test.go | 2 +- .../wafregional/web_acl_association_test.go | 8 ++++---- .../wafregional/web_acl_data_source_test.go | 2 +- internal/service/wafregional/web_acl_test.go | 20 +++++++++---------- .../service/wafregional/xss_match_set_test.go | 10 +++++----- 18 files changed, 77 insertions(+), 77 deletions(-) diff --git a/internal/service/wafregional/byte_match_set_test.go b/internal/service/wafregional/byte_match_set_test.go index 8197ebfd18a9..fffc0862f88b 100644 --- a/internal/service/wafregional/byte_match_set_test.go +++ b/internal/service/wafregional/byte_match_set_test.go @@ -24,7 +24,7 @@ func TestAccWAFRegionalByteMatchSet_basic(t *testing.T) { resourceName := "aws_wafregional_byte_match_set.byte_set" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(wafregional.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(wafregional.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, wafregional.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckByteMatchSetDestroy(ctx), @@ -72,7 +72,7 @@ func TestAccWAFRegionalByteMatchSet_changeNameForceNew(t *testing.T) { resourceName := "aws_wafregional_byte_match_set.byte_set" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(wafregional.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(wafregional.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, wafregional.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckByteMatchSetDestroy(ctx), @@ -145,7 +145,7 @@ func TestAccWAFRegionalByteMatchSet_changeByteMatchTuples(t *testing.T) { resourceName := "aws_wafregional_byte_match_set.byte_set" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(wafregional.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(wafregional.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, wafregional.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckByteMatchSetDestroy(ctx), @@ -216,7 +216,7 @@ func TestAccWAFRegionalByteMatchSet_noByteMatchTuples(t *testing.T) { resourceName := "aws_wafregional_byte_match_set.byte_match_set" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(wafregional.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(wafregional.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, wafregional.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckByteMatchSetDestroy(ctx), @@ -245,7 +245,7 @@ func TestAccWAFRegionalByteMatchSet_disappears(t *testing.T) { resourceName := "aws_wafregional_byte_match_set.byte_set" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(wafregional.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(wafregional.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, wafregional.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckByteMatchSetDestroy(ctx), diff --git a/internal/service/wafregional/geo_match_set_test.go b/internal/service/wafregional/geo_match_set_test.go index 2bc5631adb18..610b6d488391 100644 --- a/internal/service/wafregional/geo_match_set_test.go +++ b/internal/service/wafregional/geo_match_set_test.go @@ -24,7 +24,7 @@ func TestAccWAFRegionalGeoMatchSet_basic(t *testing.T) { geoMatchSet := fmt.Sprintf("tfacc-%s", sdkacctest.RandString(5)) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(wafregional.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(wafregional.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, wafregional.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckGeoMatchSetDestroy(ctx), @@ -64,7 +64,7 @@ func TestAccWAFRegionalGeoMatchSet_changeNameForceNew(t *testing.T) { geoMatchSetNewName := fmt.Sprintf("geoMatchSetNewName-%s", sdkacctest.RandString(5)) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(wafregional.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(wafregional.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, wafregional.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckGeoMatchSetDestroy(ctx), @@ -106,7 +106,7 @@ func TestAccWAFRegionalGeoMatchSet_disappears(t *testing.T) { geoMatchSet := fmt.Sprintf("tfacc-%s", sdkacctest.RandString(5)) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(wafregional.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(wafregional.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, wafregional.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckGeoMatchSetDestroy(ctx), @@ -130,7 +130,7 @@ func TestAccWAFRegionalGeoMatchSet_changeConstraints(t *testing.T) { setName := fmt.Sprintf("tfacc-%s", sdkacctest.RandString(5)) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(wafregional.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(wafregional.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, wafregional.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckGeoMatchSetDestroy(ctx), @@ -187,7 +187,7 @@ func TestAccWAFRegionalGeoMatchSet_noConstraints(t *testing.T) { setName := fmt.Sprintf("tfacc-%s", sdkacctest.RandString(5)) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(wafregional.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(wafregional.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, wafregional.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckGeoMatchSetDestroy(ctx), diff --git a/internal/service/wafregional/ipset_data_source_test.go b/internal/service/wafregional/ipset_data_source_test.go index cb796fd18759..aebbb7e013c2 100644 --- a/internal/service/wafregional/ipset_data_source_test.go +++ b/internal/service/wafregional/ipset_data_source_test.go @@ -17,7 +17,7 @@ func TestAccWAFRegionalIPSetDataSource_basic(t *testing.T) { datasourceName := "data.aws_wafregional_ipset.ipset" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(wafregional.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(wafregional.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, wafregional.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ diff --git a/internal/service/wafregional/ipset_test.go b/internal/service/wafregional/ipset_test.go index cd8d2614ad6a..6d6cde09633e 100644 --- a/internal/service/wafregional/ipset_test.go +++ b/internal/service/wafregional/ipset_test.go @@ -28,7 +28,7 @@ func TestAccWAFRegionalIPSet_basic(t *testing.T) { ipsetName := fmt.Sprintf("ip-set-%s", sdkacctest.RandString(5)) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(wafregional.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(wafregional.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, wafregional.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckIPSetDestroy(ctx), @@ -60,7 +60,7 @@ func TestAccWAFRegionalIPSet_disappears(t *testing.T) { var v waf.IPSet ipsetName := fmt.Sprintf("ip-set-%s", sdkacctest.RandString(5)) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(wafregional.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(wafregional.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, wafregional.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckIPSetDestroy(ctx), @@ -85,7 +85,7 @@ func TestAccWAFRegionalIPSet_changeNameForceNew(t *testing.T) { ipsetNewName := fmt.Sprintf("ip-set-new-%s", sdkacctest.RandString(5)) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(wafregional.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(wafregional.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, wafregional.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckIPSetDestroy(ctx), @@ -128,7 +128,7 @@ func TestAccWAFRegionalIPSet_changeDescriptors(t *testing.T) { ipsetName := fmt.Sprintf("ip-set-%s", sdkacctest.RandString(5)) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(wafregional.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(wafregional.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, wafregional.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckIPSetDestroy(ctx), @@ -192,7 +192,7 @@ func TestAccWAFRegionalIPSet_IPSetDescriptors_1000UpdateLimit(t *testing.T) { } resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(wafregional.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(wafregional.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, wafregional.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckIPSetDestroy(ctx), @@ -220,7 +220,7 @@ func TestAccWAFRegionalIPSet_noDescriptors(t *testing.T) { ipsetName := fmt.Sprintf("ip-set-%s", sdkacctest.RandString(5)) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(wafregional.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(wafregional.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, wafregional.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckIPSetDestroy(ctx), 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 f14aecd29d9a..cf57e29cf282 100644 --- a/internal/service/wafregional/rate_based_rule_data_source_test.go +++ b/internal/service/wafregional/rate_based_rule_data_source_test.go @@ -17,7 +17,7 @@ func TestAccWAFRegionalRateBasedRuleDataSource_basic(t *testing.T) { datasourceName := "data.aws_wafregional_rate_based_rule.wafrule" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(wafregional.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(wafregional.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, wafregional.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ diff --git a/internal/service/wafregional/rate_based_rule_test.go b/internal/service/wafregional/rate_based_rule_test.go index 9acd731013bc..53a1635f6952 100644 --- a/internal/service/wafregional/rate_based_rule_test.go +++ b/internal/service/wafregional/rate_based_rule_test.go @@ -24,7 +24,7 @@ func TestAccWAFRegionalRateBasedRule_basic(t *testing.T) { resourceName := "aws_wafregional_rate_based_rule.wafrule" wafRuleName := fmt.Sprintf("wafrule%s", sdkacctest.RandString(5)) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(wafregional.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(wafregional.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, wafregional.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRateBasedRuleDestroy(ctx), @@ -54,7 +54,7 @@ func TestAccWAFRegionalRateBasedRule_tags(t *testing.T) { resourceName := "aws_wafregional_rate_based_rule.wafrule" wafRuleName := fmt.Sprintf("wafrule%s", sdkacctest.RandString(5)) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(wafregional.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(wafregional.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, wafregional.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRateBasedRuleDestroy(ctx), @@ -101,7 +101,7 @@ func TestAccWAFRegionalRateBasedRule_changeNameForceNew(t *testing.T) { wafRuleNewName := fmt.Sprintf("wafrulenew%s", sdkacctest.RandString(5)) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(wafregional.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(wafregional.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, wafregional.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRateBasedRuleDestroy(ctx), @@ -140,7 +140,7 @@ func TestAccWAFRegionalRateBasedRule_disappears(t *testing.T) { resourceName := "aws_wafregional_rate_based_rule.wafrule" wafRuleName := fmt.Sprintf("wafrule%s", sdkacctest.RandString(5)) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(wafregional.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(wafregional.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, wafregional.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRateBasedRuleDestroy(ctx), @@ -167,7 +167,7 @@ func TestAccWAFRegionalRateBasedRule_changePredicates(t *testing.T) { ruleName := fmt.Sprintf("wafrule%s", sdkacctest.RandString(5)) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(wafregional.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(wafregional.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, wafregional.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRateBasedRuleDestroy(ctx), @@ -216,7 +216,7 @@ func TestAccWAFRegionalRateBasedRule_changeRateLimit(t *testing.T) { rateLimitAfter := "2001" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(wafregional.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(wafregional.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, wafregional.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRateBasedRuleDestroy(ctx), @@ -253,7 +253,7 @@ func TestAccWAFRegionalRateBasedRule_noPredicates(t *testing.T) { ruleName := fmt.Sprintf("wafrule%s", sdkacctest.RandString(5)) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(wafregional.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(wafregional.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, wafregional.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRateBasedRuleDestroy(ctx), diff --git a/internal/service/wafregional/regex_match_set_test.go b/internal/service/wafregional/regex_match_set_test.go index d87c5a78870a..988b35c264e2 100644 --- a/internal/service/wafregional/regex_match_set_test.go +++ b/internal/service/wafregional/regex_match_set_test.go @@ -49,7 +49,7 @@ func testAccRegexMatchSet_basic(t *testing.T) { } resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(wafregional.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(wafregional.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, wafregional.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRegexMatchSetDestroy(ctx), @@ -90,7 +90,7 @@ func testAccRegexMatchSet_changePatterns(t *testing.T) { patternSetName := fmt.Sprintf("tfacc-%s", sdkacctest.RandString(5)) resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(wafregional.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(wafregional.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, wafregional.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRegexMatchSetDestroy(ctx), @@ -143,7 +143,7 @@ func testAccRegexMatchSet_noPatterns(t *testing.T) { matchSetName := fmt.Sprintf("tfacc-%s", sdkacctest.RandString(5)) resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(wafregional.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(wafregional.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, wafregional.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRegexMatchSetDestroy(ctx), @@ -173,7 +173,7 @@ func testAccRegexMatchSet_disappears(t *testing.T) { patternSetName := fmt.Sprintf("tfacc-%s", sdkacctest.RandString(5)) resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(wafregional.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(wafregional.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, wafregional.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRegexMatchSetDestroy(ctx), diff --git a/internal/service/wafregional/regex_pattern_set_test.go b/internal/service/wafregional/regex_pattern_set_test.go index 9f6327c807f4..d33ef2e4f24a 100644 --- a/internal/service/wafregional/regex_pattern_set_test.go +++ b/internal/service/wafregional/regex_pattern_set_test.go @@ -39,7 +39,7 @@ func testAccRegexPatternSet_basic(t *testing.T) { resourceName := "aws_wafregional_regex_pattern_set.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(wafregional.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(wafregional.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, wafregional.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRegexPatternSetDestroy(ctx), @@ -70,7 +70,7 @@ func testAccRegexPatternSet_changePatterns(t *testing.T) { resourceName := "aws_wafregional_regex_pattern_set.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(wafregional.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(wafregional.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, wafregional.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRegexPatternSetDestroy(ctx), @@ -112,7 +112,7 @@ func testAccRegexPatternSet_noPatterns(t *testing.T) { resourceName := "aws_wafregional_regex_pattern_set.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(wafregional.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(wafregional.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, wafregional.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRegexPatternSetDestroy(ctx), @@ -141,7 +141,7 @@ func testAccRegexPatternSet_disappears(t *testing.T) { resourceName := "aws_wafregional_regex_pattern_set.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(wafregional.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(wafregional.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, wafregional.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRegexPatternSetDestroy(ctx), diff --git a/internal/service/wafregional/rule_data_source_test.go b/internal/service/wafregional/rule_data_source_test.go index 80f65414af03..e1725601b587 100644 --- a/internal/service/wafregional/rule_data_source_test.go +++ b/internal/service/wafregional/rule_data_source_test.go @@ -17,7 +17,7 @@ func TestAccWAFRegionalRuleDataSource_basic(t *testing.T) { datasourceName := "data.aws_wafregional_rule.wafrule" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(wafregional.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(wafregional.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, wafregional.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ diff --git a/internal/service/wafregional/rule_group_test.go b/internal/service/wafregional/rule_group_test.go index f924165f740a..292bcacd11e9 100644 --- a/internal/service/wafregional/rule_group_test.go +++ b/internal/service/wafregional/rule_group_test.go @@ -30,7 +30,7 @@ func TestAccWAFRegionalRuleGroup_basic(t *testing.T) { resourceName := "aws_wafregional_rule_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(wafregional.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(wafregional.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, wafregional.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRuleGroupDestroy(ctx), @@ -71,7 +71,7 @@ func TestAccWAFRegionalRuleGroup_tags(t *testing.T) { resourceName := "aws_wafregional_rule_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(wafregional.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(wafregional.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, wafregional.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRuleGroupDestroy(ctx), @@ -123,7 +123,7 @@ func TestAccWAFRegionalRuleGroup_changeNameForceNew(t *testing.T) { resourceName := "aws_wafregional_rule_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(wafregional.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(wafregional.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, wafregional.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRuleGroupDestroy(ctx), @@ -163,7 +163,7 @@ func TestAccWAFRegionalRuleGroup_disappears(t *testing.T) { resourceName := "aws_wafregional_rule_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(wafregional.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(wafregional.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, wafregional.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRuleGroupDestroy(ctx), @@ -193,7 +193,7 @@ func TestAccWAFRegionalRuleGroup_changeActivatedRules(t *testing.T) { resourceName := "aws_wafregional_rule_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(wafregional.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(wafregional.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, wafregional.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRuleGroupDestroy(ctx), @@ -261,7 +261,7 @@ func TestAccWAFRegionalRuleGroup_noActivatedRules(t *testing.T) { resourceName := "aws_wafregional_rule_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(wafregional.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(wafregional.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, wafregional.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRuleGroupDestroy(ctx), diff --git a/internal/service/wafregional/rule_test.go b/internal/service/wafregional/rule_test.go index d351f2ce6f8d..7a9a1da11178 100644 --- a/internal/service/wafregional/rule_test.go +++ b/internal/service/wafregional/rule_test.go @@ -26,7 +26,7 @@ func TestAccWAFRegionalRule_basic(t *testing.T) { resourceName := "aws_wafregional_rule.wafrule" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(wafregional.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(wafregional.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, wafregional.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRuleDestroy(ctx), @@ -57,7 +57,7 @@ func TestAccWAFRegionalRule_tags(t *testing.T) { resourceName := "aws_wafregional_rule.wafrule" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(wafregional.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(wafregional.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, wafregional.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRuleDestroy(ctx), @@ -104,7 +104,7 @@ func TestAccWAFRegionalRule_changeNameForceNew(t *testing.T) { resourceName := "aws_wafregional_rule.wafrule" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(wafregional.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(wafregional.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, wafregional.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckIPSetDestroy(ctx), @@ -143,7 +143,7 @@ func TestAccWAFRegionalRule_disappears(t *testing.T) { resourceName := "aws_wafregional_rule.wafrule" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(wafregional.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(wafregional.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, wafregional.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRuleDestroy(ctx), @@ -167,7 +167,7 @@ func TestAccWAFRegionalRule_noPredicates(t *testing.T) { resourceName := "aws_wafregional_rule.wafrule" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(wafregional.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(wafregional.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, wafregional.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRuleDestroy(ctx), @@ -200,7 +200,7 @@ func TestAccWAFRegionalRule_changePredicates(t *testing.T) { resourceName := "aws_wafregional_rule.wafrule" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(wafregional.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(wafregional.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, wafregional.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRuleDestroy(ctx), diff --git a/internal/service/wafregional/size_constraint_set_test.go b/internal/service/wafregional/size_constraint_set_test.go index d6bf81a57ecf..732383072cab 100644 --- a/internal/service/wafregional/size_constraint_set_test.go +++ b/internal/service/wafregional/size_constraint_set_test.go @@ -24,7 +24,7 @@ func TestAccWAFRegionalSizeConstraintSet_basic(t *testing.T) { resourceName := "aws_wafregional_size_constraint_set.size_constraint_set" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(wafregional.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(wafregional.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, wafregional.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSizeConstraintSetDestroy(ctx), @@ -66,7 +66,7 @@ func TestAccWAFRegionalSizeConstraintSet_changeNameForceNew(t *testing.T) { resourceName := "aws_wafregional_size_constraint_set.size_constraint_set" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(wafregional.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(wafregional.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, wafregional.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSizeConstraintSetDestroy(ctx), @@ -107,7 +107,7 @@ func TestAccWAFRegionalSizeConstraintSet_disappears(t *testing.T) { resourceName := "aws_wafregional_size_constraint_set.size_constraint_set" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(wafregional.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(wafregional.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, wafregional.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSizeConstraintSetDestroy(ctx), @@ -131,7 +131,7 @@ func TestAccWAFRegionalSizeConstraintSet_changeConstraints(t *testing.T) { resourceName := "aws_wafregional_size_constraint_set.size_constraint_set" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(wafregional.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(wafregional.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, wafregional.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSizeConstraintSetDestroy(ctx), @@ -192,7 +192,7 @@ func TestAccWAFRegionalSizeConstraintSet_noConstraints(t *testing.T) { resourceName := "aws_wafregional_size_constraint_set.size_constraint_set" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(wafregional.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(wafregional.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, wafregional.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSizeConstraintSetDestroy(ctx), diff --git a/internal/service/wafregional/sql_injection_match_set_test.go b/internal/service/wafregional/sql_injection_match_set_test.go index 3a207cce7447..a341039e96eb 100644 --- a/internal/service/wafregional/sql_injection_match_set_test.go +++ b/internal/service/wafregional/sql_injection_match_set_test.go @@ -24,7 +24,7 @@ func TestAccWAFRegionalSQLInjectionMatchSet_basic(t *testing.T) { sqlInjectionMatchSet := fmt.Sprintf("sqlInjectionMatchSet-%s", sdkacctest.RandString(5)) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(wafregional.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(wafregional.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, wafregional.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSQLInjectionMatchSetDestroy(ctx), @@ -60,7 +60,7 @@ func TestAccWAFRegionalSQLInjectionMatchSet_changeNameForceNew(t *testing.T) { sqlInjectionMatchSetNewName := fmt.Sprintf("sqlInjectionMatchSetNewName-%s", sdkacctest.RandString(5)) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(wafregional.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(wafregional.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, wafregional.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSQLInjectionMatchSetDestroy(ctx), @@ -101,7 +101,7 @@ func TestAccWAFRegionalSQLInjectionMatchSet_disappears(t *testing.T) { sqlInjectionMatchSet := fmt.Sprintf("sqlInjectionMatchSet-%s", sdkacctest.RandString(5)) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(wafregional.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(wafregional.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, wafregional.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSQLInjectionMatchSetDestroy(ctx), @@ -125,7 +125,7 @@ func TestAccWAFRegionalSQLInjectionMatchSet_changeTuples(t *testing.T) { setName := fmt.Sprintf("sqlInjectionMatchSet-%s", sdkacctest.RandString(5)) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(wafregional.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(wafregional.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, wafregional.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSQLInjectionMatchSetDestroy(ctx), @@ -178,7 +178,7 @@ func TestAccWAFRegionalSQLInjectionMatchSet_noTuples(t *testing.T) { setName := fmt.Sprintf("sqlInjectionMatchSet-%s", sdkacctest.RandString(5)) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(wafregional.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(wafregional.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, wafregional.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSQLInjectionMatchSetDestroy(ctx), diff --git a/internal/service/wafregional/subscribed_rule_group_test.go b/internal/service/wafregional/subscribed_rule_group_test.go index b2282d59c3be..4a948c2295b4 100644 --- a/internal/service/wafregional/subscribed_rule_group_test.go +++ b/internal/service/wafregional/subscribed_rule_group_test.go @@ -27,7 +27,7 @@ func TestAccWAFRegionalSubscribedRuleGroupDataSource_basic(t *testing.T) { datasourceName := "data.aws_wafregional_subscribed_rule_group.rulegroup" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(wafregional.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(wafregional.EndpointsID, t) }, ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, ErrorCheck: acctest.ErrorCheck(t, wafregional.EndpointsID), CheckDestroy: nil, diff --git a/internal/service/wafregional/web_acl_association_test.go b/internal/service/wafregional/web_acl_association_test.go index 9a7291ad6d7b..54583446bc55 100644 --- a/internal/service/wafregional/web_acl_association_test.go +++ b/internal/service/wafregional/web_acl_association_test.go @@ -21,7 +21,7 @@ func TestAccWAFRegionalWebACLAssociation_basic(t *testing.T) { resourceName := "aws_wafregional_web_acl_association.foo" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(wafregional.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(wafregional.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, wafregional.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckWebACLAssociationDestroy(ctx), @@ -44,7 +44,7 @@ func TestAccWAFRegionalWebACLAssociation_basic(t *testing.T) { func TestAccWAFRegionalWebACLAssociation_disappears(t *testing.T) { ctx := acctest.Context(t) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(wafregional.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(wafregional.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, wafregional.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckWebACLAssociationDestroy(ctx), @@ -66,7 +66,7 @@ func TestAccWAFRegionalWebACLAssociation_multipleAssociations(t *testing.T) { resourceName := "aws_wafregional_web_acl_association.foo" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(wafregional.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(wafregional.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, wafregional.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckWebACLAssociationDestroy(ctx), @@ -94,7 +94,7 @@ func TestAccWAFRegionalWebACLAssociation_ResourceARN_apiGatewayStage(t *testing. resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(wafregional.EndpointsID, t) acctest.PreCheckAPIGatewayTypeEDGE(t) }, diff --git a/internal/service/wafregional/web_acl_data_source_test.go b/internal/service/wafregional/web_acl_data_source_test.go index 945bce818337..d5fcd4537ca3 100644 --- a/internal/service/wafregional/web_acl_data_source_test.go +++ b/internal/service/wafregional/web_acl_data_source_test.go @@ -17,7 +17,7 @@ func TestAccWAFRegionalWebACLDataSource_basic(t *testing.T) { datasourceName := "data.aws_wafregional_web_acl.web_acl" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(wafregional.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(wafregional.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, wafregional.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ diff --git a/internal/service/wafregional/web_acl_test.go b/internal/service/wafregional/web_acl_test.go index 4e62a2a88319..2df3ed984509 100644 --- a/internal/service/wafregional/web_acl_test.go +++ b/internal/service/wafregional/web_acl_test.go @@ -26,7 +26,7 @@ func TestAccWAFRegionalWebACL_basic(t *testing.T) { resourceName := "aws_wafregional_web_acl.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(wafregional.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(wafregional.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, wafregional.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckWebACLDestroy(ctx), @@ -60,7 +60,7 @@ func TestAccWAFRegionalWebACL_tags(t *testing.T) { resourceName := "aws_wafregional_web_acl.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(wafregional.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(wafregional.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, wafregional.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckWebACLDestroy(ctx), @@ -106,7 +106,7 @@ func TestAccWAFRegionalWebACL_createRateBased(t *testing.T) { resourceName := "aws_wafregional_web_acl.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(wafregional.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(wafregional.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, wafregional.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckWebACLDestroy(ctx), @@ -138,7 +138,7 @@ func TestAccWAFRegionalWebACL_createGroup(t *testing.T) { resourceName := "aws_wafregional_web_acl.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(wafregional.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(wafregional.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, wafregional.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckWebACLDestroy(ctx), @@ -171,7 +171,7 @@ func TestAccWAFRegionalWebACL_changeNameForceNew(t *testing.T) { resourceName := "aws_wafregional_web_acl.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(wafregional.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(wafregional.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, wafregional.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckWebACLDestroy(ctx), @@ -215,7 +215,7 @@ func TestAccWAFRegionalWebACL_changeDefaultAction(t *testing.T) { resourceName := "aws_wafregional_web_acl.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(wafregional.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(wafregional.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, wafregional.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckWebACLDestroy(ctx), @@ -258,7 +258,7 @@ func TestAccWAFRegionalWebACL_disappears(t *testing.T) { resourceName := "aws_wafregional_web_acl.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(wafregional.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(wafregional.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, wafregional.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckWebACLDestroy(ctx), @@ -282,7 +282,7 @@ func TestAccWAFRegionalWebACL_noRules(t *testing.T) { resourceName := "aws_wafregional_web_acl.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(wafregional.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(wafregional.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, wafregional.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckWebACLDestroy(ctx), @@ -315,7 +315,7 @@ func TestAccWAFRegionalWebACL_changeRules(t *testing.T) { resourceName := "aws_wafregional_web_acl.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(wafregional.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(wafregional.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, wafregional.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckWebACLDestroy(ctx), @@ -361,7 +361,7 @@ func TestAccWAFRegionalWebACL_logging(t *testing.T) { resourceName := "aws_wafregional_web_acl.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(wafregional.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(wafregional.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, wafregional.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckWebACLDestroy(ctx), diff --git a/internal/service/wafregional/xss_match_set_test.go b/internal/service/wafregional/xss_match_set_test.go index fc38adbc7879..46f1ba3db202 100644 --- a/internal/service/wafregional/xss_match_set_test.go +++ b/internal/service/wafregional/xss_match_set_test.go @@ -24,7 +24,7 @@ func TestAccWAFRegionalXSSMatchSet_basic(t *testing.T) { resourceName := "aws_wafregional_xss_match_set.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(wafregional.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(wafregional.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, wafregional.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckXSSMatchSetDestroy(ctx), @@ -66,7 +66,7 @@ func TestAccWAFRegionalXSSMatchSet_changeNameForceNew(t *testing.T) { resourceName := "aws_wafregional_xss_match_set.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(wafregional.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(wafregional.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, wafregional.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckXSSMatchSetDestroy(ctx), @@ -103,7 +103,7 @@ func TestAccWAFRegionalXSSMatchSet_disappears(t *testing.T) { resourceName := "aws_wafregional_xss_match_set.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(wafregional.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(wafregional.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, wafregional.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckXSSMatchSetDestroy(ctx), @@ -127,7 +127,7 @@ func TestAccWAFRegionalXSSMatchSet_changeTuples(t *testing.T) { resourceName := "aws_wafregional_xss_match_set.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(wafregional.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(wafregional.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, wafregional.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckXSSMatchSetDestroy(ctx), @@ -188,7 +188,7 @@ func TestAccWAFRegionalXSSMatchSet_noTuples(t *testing.T) { resourceName := "aws_wafregional_xss_match_set.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(wafregional.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(wafregional.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, wafregional.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckXSSMatchSetDestroy(ctx), From 811faeccbc0a9ded36f519fe2cf40676f491d9bd Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Fri, 24 Feb 2023 16:37:33 -0500 Subject: [PATCH 257/763] Add 'Context' argument to 'acctest.PreCheck' for wafv2. --- .../service/wafv2/ip_set_data_source_test.go | 2 +- internal/service/wafv2/ip_set_test.go | 14 ++--- .../regex_pattern_set_data_source_test.go | 2 +- .../service/wafv2/regex_pattern_set_test.go | 10 ++-- .../wafv2/rule_group_data_source_test.go | 2 +- internal/service/wafv2/rule_group_test.go | 58 +++++++++---------- .../service/wafv2/web_acl_association_test.go | 4 +- .../service/wafv2/web_acl_data_source_test.go | 2 +- .../web_acl_logging_configuration_test.go | 26 ++++----- internal/service/wafv2/web_acl_test.go | 58 +++++++++---------- 10 files changed, 89 insertions(+), 89 deletions(-) diff --git a/internal/service/wafv2/ip_set_data_source_test.go b/internal/service/wafv2/ip_set_data_source_test.go index 7c841be32bcf..3ba5089da83f 100644 --- a/internal/service/wafv2/ip_set_data_source_test.go +++ b/internal/service/wafv2/ip_set_data_source_test.go @@ -18,7 +18,7 @@ func TestAccWAFV2IPSetDataSource_basic(t *testing.T) { datasourceName := "data.aws_wafv2_ip_set.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckScopeRegional(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckScopeRegional(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, wafv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ diff --git a/internal/service/wafv2/ip_set_test.go b/internal/service/wafv2/ip_set_test.go index af433628b674..bc9faa5b7615 100644 --- a/internal/service/wafv2/ip_set_test.go +++ b/internal/service/wafv2/ip_set_test.go @@ -23,7 +23,7 @@ func TestAccWAFV2IPSet_basic(t *testing.T) { resourceName := "aws_wafv2_ip_set.ip_set" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckScopeRegional(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckScopeRegional(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, wafv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckIPSetDestroy(ctx), @@ -72,7 +72,7 @@ func TestAccWAFV2IPSet_disappears(t *testing.T) { resourceName := "aws_wafv2_ip_set.ip_set" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckScopeRegional(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckScopeRegional(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, wafv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckIPSetDestroy(ctx), @@ -96,7 +96,7 @@ func TestAccWAFV2IPSet_ipv6(t *testing.T) { resourceName := "aws_wafv2_ip_set.ip_set" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckScopeRegional(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckScopeRegional(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, wafv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckIPSetDestroy(ctx), @@ -133,7 +133,7 @@ func TestAccWAFV2IPSet_minimal(t *testing.T) { resourceName := "aws_wafv2_ip_set.ip_set" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckScopeRegional(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckScopeRegional(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, wafv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckIPSetDestroy(ctx), @@ -168,7 +168,7 @@ func TestAccWAFV2IPSet_changeNameForceNew(t *testing.T) { resourceName := "aws_wafv2_ip_set.ip_set" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckScopeRegional(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckScopeRegional(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, wafv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckIPSetDestroy(ctx), @@ -208,7 +208,7 @@ func TestAccWAFV2IPSet_tags(t *testing.T) { resourceName := "aws_wafv2_ip_set.ip_set" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckScopeRegional(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckScopeRegional(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, wafv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckIPSetDestroy(ctx), @@ -258,7 +258,7 @@ func TestAccWAFV2IPSet_large(t *testing.T) { resourceName := "aws_wafv2_ip_set.ip_set" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckScopeRegional(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckScopeRegional(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, wafv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckIPSetDestroy(ctx), 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 34ebbde2b9fe..2762b995f48b 100644 --- a/internal/service/wafv2/regex_pattern_set_data_source_test.go +++ b/internal/service/wafv2/regex_pattern_set_data_source_test.go @@ -18,7 +18,7 @@ func TestAccWAFV2RegexPatternSetDataSource_basic(t *testing.T) { datasourceName := "data.aws_wafv2_regex_pattern_set.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckScopeRegional(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckScopeRegional(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, wafv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ diff --git a/internal/service/wafv2/regex_pattern_set_test.go b/internal/service/wafv2/regex_pattern_set_test.go index 4e0e59749cca..b7755ce89353 100644 --- a/internal/service/wafv2/regex_pattern_set_test.go +++ b/internal/service/wafv2/regex_pattern_set_test.go @@ -23,7 +23,7 @@ func TestAccWAFV2RegexPatternSet_basic(t *testing.T) { resourceName := "aws_wafv2_regex_pattern_set.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckScopeRegional(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckScopeRegional(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, wafv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRegexPatternSetDestroy(ctx), @@ -84,7 +84,7 @@ func TestAccWAFV2RegexPatternSet_disappears(t *testing.T) { resourceName := "aws_wafv2_regex_pattern_set.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckScopeRegional(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckScopeRegional(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, wafv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRegexPatternSetDestroy(ctx), @@ -108,7 +108,7 @@ func TestAccWAFV2RegexPatternSet_minimal(t *testing.T) { resourceName := "aws_wafv2_regex_pattern_set.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckScopeRegional(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckScopeRegional(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, wafv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRegexPatternSetDestroy(ctx), @@ -136,7 +136,7 @@ func TestAccWAFV2RegexPatternSet_changeNameForceNew(t *testing.T) { resourceName := "aws_wafv2_regex_pattern_set.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckScopeRegional(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckScopeRegional(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, wafv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRegexPatternSetDestroy(ctx), @@ -174,7 +174,7 @@ func TestAccWAFV2RegexPatternSet_tags(t *testing.T) { resourceName := "aws_wafv2_regex_pattern_set.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckScopeRegional(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckScopeRegional(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, wafv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRegexPatternSetDestroy(ctx), diff --git a/internal/service/wafv2/rule_group_data_source_test.go b/internal/service/wafv2/rule_group_data_source_test.go index 40b925d02a3b..1e30eb1d91fa 100644 --- a/internal/service/wafv2/rule_group_data_source_test.go +++ b/internal/service/wafv2/rule_group_data_source_test.go @@ -18,7 +18,7 @@ func TestAccWAFV2RuleGroupDataSource_basic(t *testing.T) { datasourceName := "data.aws_wafv2_rule_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckScopeRegional(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckScopeRegional(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, wafv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ diff --git a/internal/service/wafv2/rule_group_test.go b/internal/service/wafv2/rule_group_test.go index 664c4849de02..672ff62ba2aa 100644 --- a/internal/service/wafv2/rule_group_test.go +++ b/internal/service/wafv2/rule_group_test.go @@ -24,7 +24,7 @@ func TestAccWAFV2RuleGroup_basic(t *testing.T) { resourceName := "aws_wafv2_rule_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckScopeRegional(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckScopeRegional(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, wafv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRuleGroupDestroy(ctx), @@ -63,7 +63,7 @@ func TestAccWAFV2RuleGroup_updateRule(t *testing.T) { resourceName := "aws_wafv2_rule_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckScopeRegional(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckScopeRegional(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, wafv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRuleGroupDestroy(ctx), @@ -132,7 +132,7 @@ func TestAccWAFV2RuleGroup_updateRuleProperties(t *testing.T) { ruleName2 := fmt.Sprintf("%s-2", ruleGroupName) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckScopeRegional(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckScopeRegional(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, wafv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRuleGroupDestroy(ctx), @@ -310,7 +310,7 @@ func TestAccWAFV2RuleGroup_byteMatchStatement(t *testing.T) { resourceName := "aws_wafv2_rule_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckScopeRegional(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckScopeRegional(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, wafv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRuleGroupDestroy(ctx), @@ -374,7 +374,7 @@ func TestAccWAFV2RuleGroup_ByteMatchStatement_fieldToMatch(t *testing.T) { resourceName := "aws_wafv2_rule_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckScopeRegional(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckScopeRegional(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, wafv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRuleGroupDestroy(ctx), @@ -704,7 +704,7 @@ func TestAccWAFV2RuleGroup_changeNameForceNew(t *testing.T) { resourceName := "aws_wafv2_rule_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckScopeRegional(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckScopeRegional(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, wafv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRuleGroupDestroy(ctx), @@ -752,7 +752,7 @@ func TestAccWAFV2RuleGroup_changeCapacityForceNew(t *testing.T) { resourceName := "aws_wafv2_rule_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckScopeRegional(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckScopeRegional(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, wafv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRuleGroupDestroy(ctx), @@ -800,7 +800,7 @@ func TestAccWAFV2RuleGroup_changeMetricNameForceNew(t *testing.T) { resourceName := "aws_wafv2_rule_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckScopeRegional(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckScopeRegional(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, wafv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRuleGroupDestroy(ctx), @@ -848,7 +848,7 @@ func TestAccWAFV2RuleGroup_disappears(t *testing.T) { resourceName := "aws_wafv2_rule_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckScopeRegional(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckScopeRegional(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, wafv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRuleGroupDestroy(ctx), @@ -872,7 +872,7 @@ func TestAccWAFV2RuleGroup_RuleLabels(t *testing.T) { resourceName := "aws_wafv2_rule_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckScopeRegional(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckScopeRegional(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, wafv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRuleGroupDestroy(ctx), @@ -918,7 +918,7 @@ func TestAccWAFV2RuleGroup_geoMatchStatement(t *testing.T) { resourceName := "aws_wafv2_rule_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckScopeRegional(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckScopeRegional(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, wafv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRuleGroupDestroy(ctx), @@ -973,7 +973,7 @@ func TestAccWAFV2RuleGroup_GeoMatchStatement_forwardedIP(t *testing.T) { resourceName := "aws_wafv2_rule_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckScopeRegional(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckScopeRegional(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, wafv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRuleGroupDestroy(ctx), @@ -1031,7 +1031,7 @@ func TestAccWAFV2RuleGroup_LabelMatchStatement(t *testing.T) { resourceName := "aws_wafv2_rule_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckScopeRegional(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckScopeRegional(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, wafv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRuleGroupDestroy(ctx), @@ -1081,7 +1081,7 @@ func TestAccWAFV2RuleGroup_ipSetReferenceStatement(t *testing.T) { resourceName := "aws_wafv2_rule_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckScopeRegional(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckScopeRegional(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, wafv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRuleGroupDestroy(ctx), @@ -1119,7 +1119,7 @@ func TestAccWAFV2RuleGroup_IPSetReferenceStatement_ipsetForwardedIP(t *testing.T resourceName := "aws_wafv2_rule_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckScopeRegional(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckScopeRegional(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, wafv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRuleGroupDestroy(ctx), @@ -1220,7 +1220,7 @@ func TestAccWAFV2RuleGroup_logicalRuleStatements(t *testing.T) { resourceName := "aws_wafv2_rule_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckScopeRegional(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckScopeRegional(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, wafv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRuleGroupDestroy(ctx), @@ -1294,7 +1294,7 @@ func TestAccWAFV2RuleGroup_minimal(t *testing.T) { resourceName := "aws_wafv2_rule_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckScopeRegional(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckScopeRegional(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, wafv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRuleGroupDestroy(ctx), @@ -1326,7 +1326,7 @@ func TestAccWAFV2RuleGroup_regexMatchStatement(t *testing.T) { resourceName := "aws_wafv2_rule_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckScopeRegional(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckScopeRegional(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, wafv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRuleGroupDestroy(ctx), @@ -1363,7 +1363,7 @@ func TestAccWAFV2RuleGroup_regexPatternSetReferenceStatement(t *testing.T) { resourceName := "aws_wafv2_rule_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckScopeRegional(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckScopeRegional(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, wafv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRuleGroupDestroy(ctx), @@ -1402,7 +1402,7 @@ func TestAccWAFV2RuleGroup_ruleAction(t *testing.T) { resourceName := "aws_wafv2_rule_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckScopeRegional(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckScopeRegional(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, wafv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRuleGroupDestroy(ctx), @@ -1487,7 +1487,7 @@ func TestAccWAFV2RuleGroup_RuleAction_customRequestHandling(t *testing.T) { resourceName := "aws_wafv2_rule_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckScopeRegional(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckScopeRegional(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, wafv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRuleGroupDestroy(ctx), @@ -1561,7 +1561,7 @@ func TestAccWAFV2RuleGroup_RuleAction_customResponse(t *testing.T) { resourceName := "aws_wafv2_rule_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckScopeRegional(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckScopeRegional(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, wafv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRuleGroupDestroy(ctx), @@ -1677,7 +1677,7 @@ func TestAccWAFV2RuleGroup_sizeConstraintStatement(t *testing.T) { resourceName := "aws_wafv2_rule_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckScopeRegional(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckScopeRegional(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, wafv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRuleGroupDestroy(ctx), @@ -1733,7 +1733,7 @@ func TestAccWAFV2RuleGroup_sqliMatchStatement(t *testing.T) { resourceName := "aws_wafv2_rule_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckScopeRegional(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckScopeRegional(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, wafv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRuleGroupDestroy(ctx), @@ -1805,7 +1805,7 @@ func TestAccWAFV2RuleGroup_tags(t *testing.T) { resourceName := "aws_wafv2_rule_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckScopeRegional(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckScopeRegional(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, wafv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRuleGroupDestroy(ctx), @@ -1855,7 +1855,7 @@ func TestAccWAFV2RuleGroup_xssMatchStatement(t *testing.T) { resourceName := "aws_wafv2_rule_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckScopeRegional(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckScopeRegional(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, wafv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRuleGroupDestroy(ctx), @@ -1915,7 +1915,7 @@ func TestAccWAFV2RuleGroup_rateBasedStatement(t *testing.T) { resourceName := "aws_wafv2_rule_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckScopeRegional(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckScopeRegional(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, wafv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRuleGroupDestroy(ctx), @@ -2008,7 +2008,7 @@ func TestAccWAFV2RuleGroup_RateBased_maxNested(t *testing.T) { resourceName := "aws_wafv2_rule_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckScopeRegional(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckScopeRegional(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, wafv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRuleGroupDestroy(ctx), @@ -2053,7 +2053,7 @@ func TestAccWAFV2RuleGroup_Operators_maxNested(t *testing.T) { resourceName := "aws_wafv2_rule_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckScopeRegional(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckScopeRegional(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, wafv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRuleGroupDestroy(ctx), diff --git a/internal/service/wafv2/web_acl_association_test.go b/internal/service/wafv2/web_acl_association_test.go index 888b0f03aee4..26de036c0803 100644 --- a/internal/service/wafv2/web_acl_association_test.go +++ b/internal/service/wafv2/web_acl_association_test.go @@ -24,7 +24,7 @@ func TestAccWAFV2WebACLAssociation_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckAPIGatewayTypeEDGE(t) testAccPreCheckScopeRegional(ctx, t) }, @@ -56,7 +56,7 @@ func TestAccWAFV2WebACLAssociation_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckAPIGatewayTypeEDGE(t) testAccPreCheckScopeRegional(ctx, t) }, diff --git a/internal/service/wafv2/web_acl_data_source_test.go b/internal/service/wafv2/web_acl_data_source_test.go index 739f11e88a81..d3338d6e6ab7 100644 --- a/internal/service/wafv2/web_acl_data_source_test.go +++ b/internal/service/wafv2/web_acl_data_source_test.go @@ -18,7 +18,7 @@ func TestAccWAFV2WebACLDataSource_basic(t *testing.T) { datasourceName := "data.aws_wafv2_web_acl.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckScopeRegional(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckScopeRegional(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, wafv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ diff --git a/internal/service/wafv2/web_acl_logging_configuration_test.go b/internal/service/wafv2/web_acl_logging_configuration_test.go index 3337930e50c4..55fe40e9052f 100644 --- a/internal/service/wafv2/web_acl_logging_configuration_test.go +++ b/internal/service/wafv2/web_acl_logging_configuration_test.go @@ -24,7 +24,7 @@ func TestAccWAFV2WebACLLoggingConfiguration_basic(t *testing.T) { webACLResourceName := "aws_wafv2_web_acl.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckScopeRegional(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckScopeRegional(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, wafv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckWebACLLoggingConfigurationDestroy(ctx), @@ -56,7 +56,7 @@ func TestAccWAFV2WebACLLoggingConfiguration_updateSingleHeaderRedactedField(t *t webACLResourceName := "aws_wafv2_web_acl.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckScopeRegional(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckScopeRegional(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, wafv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckWebACLLoggingConfigurationDestroy(ctx), @@ -115,7 +115,7 @@ func TestAccWAFV2WebACLLoggingConfiguration_updateMethodRedactedField(t *testing webACLResourceName := "aws_wafv2_web_acl.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, wafv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckWebACLLoggingConfigurationDestroy(ctx), @@ -159,7 +159,7 @@ func TestAccWAFV2WebACLLoggingConfiguration_updateQueryStringRedactedField(t *te webACLResourceName := "aws_wafv2_web_acl.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, wafv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckWebACLLoggingConfigurationDestroy(ctx), @@ -203,7 +203,7 @@ func TestAccWAFV2WebACLLoggingConfiguration_updateURIPathRedactedField(t *testin webACLResourceName := "aws_wafv2_web_acl.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, wafv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckWebACLLoggingConfigurationDestroy(ctx), @@ -247,7 +247,7 @@ func TestAccWAFV2WebACLLoggingConfiguration_updateMultipleRedactedFields(t *test webACLResourceName := "aws_wafv2_web_acl.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, wafv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckWebACLLoggingConfigurationDestroy(ctx), @@ -315,7 +315,7 @@ func TestAccWAFV2WebACLLoggingConfiguration_changeResourceARNForceNew(t *testing webACLResourceName := "aws_wafv2_web_acl.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckScopeRegional(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckScopeRegional(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, wafv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckWebACLLoggingConfigurationDestroy(ctx), @@ -359,7 +359,7 @@ func TestAccWAFV2WebACLLoggingConfiguration_changeLogDestinationsForceNew(t *tes kinesisResourceName := "aws_kinesis_firehose_delivery_stream.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckScopeRegional(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckScopeRegional(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, wafv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckWebACLLoggingConfigurationDestroy(ctx), @@ -400,7 +400,7 @@ func TestAccWAFV2WebACLLoggingConfiguration_disappears(t *testing.T) { resourceName := "aws_wafv2_web_acl_logging_configuration.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckScopeRegional(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckScopeRegional(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, wafv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckWebACLLoggingConfigurationDestroy(ctx), @@ -425,7 +425,7 @@ func TestAccWAFV2WebACLLoggingConfiguration_emptyRedactedFields(t *testing.T) { webACLResourceName := "aws_wafv2_web_acl.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, wafv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckWebACLLoggingConfigurationDestroy(ctx), @@ -456,7 +456,7 @@ func TestAccWAFV2WebACLLoggingConfiguration_updateEmptyRedactedFields(t *testing webACLResourceName := "aws_wafv2_web_acl.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, wafv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckWebACLLoggingConfigurationDestroy(ctx), @@ -499,7 +499,7 @@ func TestAccWAFV2WebACLLoggingConfiguration_Disappears_webACL(t *testing.T) { webACLResourceName := "aws_wafv2_web_acl.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckScopeRegional(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckScopeRegional(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, wafv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckWebACLLoggingConfigurationDestroy(ctx), @@ -523,7 +523,7 @@ func TestAccWAFV2WebACLLoggingConfiguration_loggingFilter(t *testing.T) { resourceName := "aws_wafv2_web_acl_logging_configuration.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckScopeRegional(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckScopeRegional(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, wafv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckWebACLLoggingConfigurationDestroy(ctx), diff --git a/internal/service/wafv2/web_acl_test.go b/internal/service/wafv2/web_acl_test.go index 7fe4b0a3a76b..cde0cb7e6611 100644 --- a/internal/service/wafv2/web_acl_test.go +++ b/internal/service/wafv2/web_acl_test.go @@ -25,7 +25,7 @@ func TestAccWAFV2WebACL_basic(t *testing.T) { resourceName := "aws_wafv2_web_acl.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckScopeRegional(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckScopeRegional(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, wafv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckWebACLDestroy(ctx), @@ -68,7 +68,7 @@ func TestAccWAFV2WebACL_Update_rule(t *testing.T) { ruleName2 := fmt.Sprintf("%s-2", webACLName) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckScopeRegional(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckScopeRegional(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, wafv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckWebACLDestroy(ctx), @@ -207,7 +207,7 @@ func TestAccWAFV2WebACL_Update_ruleProperties(t *testing.T) { ruleName2 := fmt.Sprintf("%s-2", webACLName) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckScopeRegional(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckScopeRegional(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, wafv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckWebACLDestroy(ctx), @@ -413,7 +413,7 @@ func TestAccWAFV2WebACL_Update_nameForceNew(t *testing.T) { resourceName := "aws_wafv2_web_acl.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckScopeRegional(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckScopeRegional(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, wafv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckWebACLDestroy(ctx), @@ -465,7 +465,7 @@ func TestAccWAFV2WebACL_disappears(t *testing.T) { resourceName := "aws_wafv2_web_acl.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckScopeRegional(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckScopeRegional(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, wafv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckWebACLDestroy(ctx), @@ -489,7 +489,7 @@ func TestAccWAFV2WebACL_ManagedRuleGroup_basic(t *testing.T) { resourceName := "aws_wafv2_web_acl.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckScopeRegional(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckScopeRegional(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, wafv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckWebACLDestroy(ctx), @@ -622,7 +622,7 @@ func TestAccWAFV2WebACL_ManagedRuleGroup_ManagedRuleGroupConfig(t *testing.T) { resourceName := "aws_wafv2_web_acl.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckScopeRegional(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckScopeRegional(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, wafv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckWebACLDestroy(ctx), @@ -696,7 +696,7 @@ func TestAccWAFV2WebACL_ManagedRuleGroup_ManagedRuleGroupConfig_BotControl(t *te resourceName := "aws_wafv2_web_acl.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckScopeRegional(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckScopeRegional(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, wafv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckWebACLDestroy(ctx), @@ -733,7 +733,7 @@ func TestAccWAFV2WebACL_ManagedRuleGroup_specifyVersion(t *testing.T) { resourceName := "aws_wafv2_web_acl.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckScopeRegional(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckScopeRegional(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, wafv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckWebACLDestroy(ctx), @@ -800,7 +800,7 @@ func TestAccWAFV2WebACL_minimal(t *testing.T) { resourceName := "aws_wafv2_web_acl.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckScopeRegional(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckScopeRegional(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, wafv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckWebACLDestroy(ctx), @@ -834,7 +834,7 @@ func TestAccWAFV2WebACL_RateBased_basic(t *testing.T) { resourceName := "aws_wafv2_web_acl.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckScopeRegional(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckScopeRegional(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, wafv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckWebACLDestroy(ctx), @@ -904,7 +904,7 @@ func TestAccWAFV2WebACL_ByteMatchStatement_basic(t *testing.T) { resourceName := "aws_wafv2_web_acl.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckScopeRegional(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckScopeRegional(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, wafv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckWebACLDestroy(ctx), @@ -966,7 +966,7 @@ func TestAccWAFV2WebACL_ByteMatchStatement_jsonBody(t *testing.T) { resourceName := "aws_wafv2_web_acl.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckScopeRegional(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckScopeRegional(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, wafv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckWebACLDestroy(ctx), @@ -1026,7 +1026,7 @@ func TestAccWAFV2WebACL_ByteMatchStatement_body(t *testing.T) { resourceName := "aws_wafv2_web_acl.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckScopeRegional(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckScopeRegional(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, wafv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckWebACLDestroy(ctx), @@ -1076,7 +1076,7 @@ func TestAccWAFV2WebACL_GeoMatch_basic(t *testing.T) { countryCodes := fmt.Sprintf("%s, %q", countryCode, "CA") resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckScopeRegional(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckScopeRegional(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, wafv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckWebACLDestroy(ctx), @@ -1167,7 +1167,7 @@ func TestAccWAFV2WebACL_GeoMatch_forwardedIP(t *testing.T) { resourceName := "aws_wafv2_web_acl.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckScopeRegional(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckScopeRegional(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, wafv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckWebACLDestroy(ctx), @@ -1233,7 +1233,7 @@ func TestAccWAFV2WebACL_LabelMatchStatement(t *testing.T) { resourceName := "aws_wafv2_web_acl.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckScopeRegional(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckScopeRegional(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, wafv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckWebACLDestroy(ctx), @@ -1285,7 +1285,7 @@ func TestAccWAFV2WebACL_RuleLabels(t *testing.T) { resourceName := "aws_wafv2_web_acl.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckScopeRegional(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckScopeRegional(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, wafv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckWebACLDestroy(ctx), @@ -1333,7 +1333,7 @@ func TestAccWAFV2WebACL_IPSetReference_basic(t *testing.T) { resourceName := "aws_wafv2_web_acl.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckScopeRegional(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckScopeRegional(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, wafv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckWebACLDestroy(ctx), @@ -1380,7 +1380,7 @@ func TestAccWAFV2WebACL_IPSetReference_forwardedIP(t *testing.T) { resourceName := "aws_wafv2_web_acl.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckScopeRegional(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckScopeRegional(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, wafv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckWebACLDestroy(ctx), @@ -1485,7 +1485,7 @@ func TestAccWAFV2WebACL_RateBased_forwardedIP(t *testing.T) { resourceName := "aws_wafv2_web_acl.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckScopeRegional(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckScopeRegional(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, wafv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckWebACLDestroy(ctx), @@ -1555,7 +1555,7 @@ func TestAccWAFV2WebACL_RuleGroupReference_basic(t *testing.T) { resourceName := "aws_wafv2_web_acl.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckScopeRegional(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckScopeRegional(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, wafv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckWebACLDestroy(ctx), @@ -1624,7 +1624,7 @@ func TestAccWAFV2WebACL_RuleGroupReference_shieldMitigation(t *testing.T) { resourceName := "aws_wafv2_web_acl.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckScopeRegional(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckScopeRegional(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, wafv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckWebACLDestroy(ctx), @@ -1809,7 +1809,7 @@ func TestAccWAFV2WebACL_RuleGroupReference_manageShieldMitigationRule(t *testing resourceName := "aws_wafv2_web_acl.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckScopeRegional(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckScopeRegional(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, wafv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckWebACLDestroy(ctx), @@ -1838,7 +1838,7 @@ func TestAccWAFV2WebACL_Custom_requestHandling(t *testing.T) { resourceName := "aws_wafv2_web_acl.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckScopeRegional(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckScopeRegional(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, wafv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckWebACLDestroy(ctx), @@ -1986,7 +1986,7 @@ func TestAccWAFV2WebACL_Custom_response(t *testing.T) { resourceName := "aws_wafv2_web_acl.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckScopeRegional(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckScopeRegional(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, wafv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckWebACLDestroy(ctx), @@ -2106,7 +2106,7 @@ func TestAccWAFV2WebACL_tags(t *testing.T) { resourceName := "aws_wafv2_web_acl.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckScopeRegional(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckScopeRegional(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, wafv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckWebACLDestroy(ctx), @@ -2157,7 +2157,7 @@ func TestAccWAFV2WebACL_RateBased_maxNested(t *testing.T) { resourceName := "aws_wafv2_web_acl.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckScopeRegional(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckScopeRegional(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, wafv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckWebACLDestroy(ctx), @@ -2202,7 +2202,7 @@ func TestAccWAFV2WebACL_Operators_maxNested(t *testing.T) { resourceName := "aws_wafv2_web_acl.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckScopeRegional(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckScopeRegional(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, wafv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckWebACLDestroy(ctx), From 3fd847b718f797755b80a247e0e2b73e7be4028e Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Fri, 24 Feb 2023 16:37:34 -0500 Subject: [PATCH 258/763] Add 'Context' argument to 'acctest.PreCheck' for worklink. --- internal/service/worklink/fleet_test.go | 16 ++++++++-------- ...ite_certificate_authority_association_test.go | 6 +++--- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/internal/service/worklink/fleet_test.go b/internal/service/worklink/fleet_test.go index 5935fcf48b78..d3308a5ca13f 100644 --- a/internal/service/worklink/fleet_test.go +++ b/internal/service/worklink/fleet_test.go @@ -24,7 +24,7 @@ func TestAccWorkLinkFleet_basic(t *testing.T) { resourceName := "aws_worklink_fleet.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, worklink.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckFleetDestroy(ctx), @@ -53,7 +53,7 @@ func TestAccWorkLinkFleet_displayName(t *testing.T) { resourceName := "aws_worklink_fleet.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, worklink.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckFleetDestroy(ctx), @@ -87,7 +87,7 @@ func TestAccWorkLinkFleet_optimizeForEndUserLocation(t *testing.T) { resourceName := "aws_worklink_fleet.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, worklink.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckFleetDestroy(ctx), @@ -121,7 +121,7 @@ func TestAccWorkLinkFleet_auditStreamARN(t *testing.T) { resourceName := "aws_worklink_fleet.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, worklink.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckFleetDestroy(ctx), @@ -148,7 +148,7 @@ func TestAccWorkLinkFleet_network(t *testing.T) { resourceName := "aws_worklink_fleet.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, worklink.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckFleetDestroy(ctx), @@ -192,7 +192,7 @@ func TestAccWorkLinkFleet_deviceCaCertificate(t *testing.T) { resourceName := "aws_worklink_fleet.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, worklink.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckFleetDestroy(ctx), @@ -227,7 +227,7 @@ func TestAccWorkLinkFleet_identityProvider(t *testing.T) { idpEntityId := fmt.Sprintf("https://%s", acctest.RandomDomainName()) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, worklink.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckFleetDestroy(ctx), @@ -259,7 +259,7 @@ func TestAccWorkLinkFleet_disappears(t *testing.T) { resourceName := "aws_worklink_fleet.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, worklink.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckFleetDestroy(ctx), diff --git a/internal/service/worklink/website_certificate_authority_association_test.go b/internal/service/worklink/website_certificate_authority_association_test.go index fed43d06f1c4..1f62a5aad252 100644 --- a/internal/service/worklink/website_certificate_authority_association_test.go +++ b/internal/service/worklink/website_certificate_authority_association_test.go @@ -24,7 +24,7 @@ func TestAccWorkLinkWebsiteCertificateAuthorityAssociation_basic(t *testing.T) { resourceName := "aws_worklink_website_certificate_authority_association.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, worklink.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckWebsiteCertificateAuthorityAssociationDestroy(ctx), @@ -55,7 +55,7 @@ func TestAccWorkLinkWebsiteCertificateAuthorityAssociation_displayName(t *testin displayName1 := fmt.Sprintf("tf-website-certificate-%s", sdkacctest.RandStringFromCharSet(5, sdkacctest.CharSetAlpha)) displayName2 := fmt.Sprintf("tf-website-certificate-%s", sdkacctest.RandStringFromCharSet(5, sdkacctest.CharSetAlpha)) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, worklink.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckWebsiteCertificateAuthorityAssociationDestroy(ctx), @@ -89,7 +89,7 @@ func TestAccWorkLinkWebsiteCertificateAuthorityAssociation_disappears(t *testing resourceName := "aws_worklink_website_certificate_authority_association.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, worklink.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckWebsiteCertificateAuthorityAssociationDestroy(ctx), From 963492cbd36bc5f096168bd65255cff411a822b5 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Fri, 24 Feb 2023 16:37:34 -0500 Subject: [PATCH 259/763] Add 'Context' argument to 'acctest.PreCheck' for workspaces. --- .../workspaces/bundle_data_source_test.go | 8 ++++---- .../workspaces/directory_data_source_test.go | 2 +- internal/service/workspaces/directory_test.go | 18 +++++++++--------- .../workspaces/image_data_source_test.go | 2 +- internal/service/workspaces/ip_group_test.go | 8 ++++---- .../workspaces/workspace_data_source_test.go | 6 +++--- internal/service/workspaces/workspace_test.go | 16 ++++++++-------- 7 files changed, 30 insertions(+), 30 deletions(-) diff --git a/internal/service/workspaces/bundle_data_source_test.go b/internal/service/workspaces/bundle_data_source_test.go index d029de0b281b..015f1075ffbc 100644 --- a/internal/service/workspaces/bundle_data_source_test.go +++ b/internal/service/workspaces/bundle_data_source_test.go @@ -15,7 +15,7 @@ func testAccWorkspaceBundleDataSource_basic(t *testing.T) { dataSourceName := "data.aws_workspaces_bundle.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, workspaces.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ @@ -42,7 +42,7 @@ func testAccWorkspaceBundleDataSource_byOwnerName(t *testing.T) { dataSourceName := "data.aws_workspaces_bundle.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, workspaces.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ @@ -67,7 +67,7 @@ func testAccWorkspaceBundleDataSource_byOwnerName(t *testing.T) { func testAccWorkspaceBundleDataSource_bundleIDAndNameConflict(t *testing.T) { resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, workspaces.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ @@ -85,7 +85,7 @@ func testAccWorkspaceBundleDataSource_privateOwner(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) testAccBundlePreCheck(t) }, ErrorCheck: acctest.ErrorCheck(t, workspaces.EndpointsID), diff --git a/internal/service/workspaces/directory_data_source_test.go b/internal/service/workspaces/directory_data_source_test.go index ff2efa588a8b..b33fa0f0d432 100644 --- a/internal/service/workspaces/directory_data_source_test.go +++ b/internal/service/workspaces/directory_data_source_test.go @@ -20,7 +20,7 @@ func testAccDirectoryDataSource_basic(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) testAccPreCheckDirectory(ctx, t) acctest.PreCheckDirectoryServiceSimpleDirectory(ctx, t) acctest.PreCheckHasIAMRole(ctx, t, "workspaces_DefaultRole") diff --git a/internal/service/workspaces/directory_test.go b/internal/service/workspaces/directory_test.go index f6e786209509..3f6aeb4cff35 100644 --- a/internal/service/workspaces/directory_test.go +++ b/internal/service/workspaces/directory_test.go @@ -30,7 +30,7 @@ func testAccDirectory_basic(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) testAccPreCheckDirectory(ctx, t) acctest.PreCheckDirectoryServiceSimpleDirectory(ctx, t) acctest.PreCheckHasIAMRole(ctx, t, "workspaces_DefaultRole") @@ -98,7 +98,7 @@ func testAccDirectory_disappears(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) testAccPreCheckDirectory(ctx, t) acctest.PreCheckDirectoryServiceSimpleDirectory(ctx, t) acctest.PreCheckHasIAMRole(ctx, t, "workspaces_DefaultRole") @@ -130,7 +130,7 @@ func testAccDirectory_subnetIDs(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) testAccPreCheckDirectory(ctx, t) acctest.PreCheckDirectoryServiceSimpleDirectory(ctx, t) acctest.PreCheckHasIAMRole(ctx, t, "workspaces_DefaultRole") @@ -166,7 +166,7 @@ func testAccDirectory_tags(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) testAccPreCheckDirectory(ctx, t) acctest.PreCheckDirectoryServiceSimpleDirectory(ctx, t) acctest.PreCheckHasIAMRole(ctx, t, "workspaces_DefaultRole") @@ -220,7 +220,7 @@ func testAccDirectory_selfServicePermissions(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) testAccPreCheckDirectory(ctx, t) acctest.PreCheckDirectoryServiceSimpleDirectory(ctx, t) acctest.PreCheckHasIAMRole(ctx, t, "workspaces_DefaultRole") @@ -256,7 +256,7 @@ func testAccDirectory_workspaceAccessProperties(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) testAccPreCheckDirectory(ctx, t) acctest.PreCheckDirectoryServiceSimpleDirectory(ctx, t) acctest.PreCheckHasIAMRole(ctx, t, "workspaces_DefaultRole") @@ -296,7 +296,7 @@ func testAccDirectory_workspaceCreationProperties(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) testAccPreCheckDirectory(ctx, t) acctest.PreCheckDirectoryServiceSimpleDirectory(ctx, t) acctest.PreCheckHasIAMRole(ctx, t, "workspaces_DefaultRole") @@ -333,7 +333,7 @@ func testAccDirectory_workspaceCreationProperties_customSecurityGroupId_defaultO resource.Test(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) testAccPreCheckDirectory(ctx, t) acctest.PreCheckDirectoryServiceSimpleDirectory(ctx, t) acctest.PreCheckHasIAMRole(ctx, t, "workspaces_DefaultRole") @@ -384,7 +384,7 @@ func testAccDirectory_ipGroupIDs(t *testing.T) { domain := acctest.RandomDomainName() resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckHasIAMRole(ctx, t, "workspaces_DefaultRole") }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckHasIAMRole(ctx, t, "workspaces_DefaultRole") }, ErrorCheck: acctest.ErrorCheck(t, workspaces.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDirectoryDestroy(ctx), diff --git a/internal/service/workspaces/image_data_source_test.go b/internal/service/workspaces/image_data_source_test.go index 907d44d8ae95..13490fb54b93 100644 --- a/internal/service/workspaces/image_data_source_test.go +++ b/internal/service/workspaces/image_data_source_test.go @@ -22,7 +22,7 @@ func testAccImageDataSource_basic(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) testAccImagePreCheck(t) }, ErrorCheck: acctest.ErrorCheck(t, workspaces.EndpointsID), diff --git a/internal/service/workspaces/ip_group_test.go b/internal/service/workspaces/ip_group_test.go index 8430c6da1c74..70fed249d167 100644 --- a/internal/service/workspaces/ip_group_test.go +++ b/internal/service/workspaces/ip_group_test.go @@ -25,7 +25,7 @@ func testAccIPGroup_basic(t *testing.T) { resourceName := "aws_workspaces_ip_group.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, workspaces.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckIPGroupDestroy(ctx), @@ -70,7 +70,7 @@ func testAccIPGroup_tags(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, workspaces.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckIPGroupDestroy(ctx), @@ -117,7 +117,7 @@ func testAccIPGroup_disappears(t *testing.T) { resourceName := "aws_workspaces_ip_group.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, workspaces.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckIPGroupDestroy(ctx), @@ -147,7 +147,7 @@ func testAccIPGroup_MultipleDirectories(t *testing.T) { directoryResourceName2 := "aws_workspaces_directory.test2" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, workspaces.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckIPGroupDestroy(ctx), diff --git a/internal/service/workspaces/workspace_data_source_test.go b/internal/service/workspaces/workspace_data_source_test.go index a01747aba077..53829c664ca4 100644 --- a/internal/service/workspaces/workspace_data_source_test.go +++ b/internal/service/workspaces/workspace_data_source_test.go @@ -18,7 +18,7 @@ func testAccWorkspaceDataSource_byWorkspaceID(t *testing.T) { resourceName := "aws_workspaces_workspace.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckHasIAMRole(ctx, t, "workspaces_DefaultRole") }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckHasIAMRole(ctx, t, "workspaces_DefaultRole") }, ErrorCheck: acctest.ErrorCheck(t, workspaces.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ @@ -53,7 +53,7 @@ func testAccWorkspaceDataSource_byDirectoryID_userName(t *testing.T) { resourceName := "aws_workspaces_workspace.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckHasIAMRole(ctx, t, "workspaces_DefaultRole") }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckHasIAMRole(ctx, t, "workspaces_DefaultRole") }, ErrorCheck: acctest.ErrorCheck(t, workspaces.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ @@ -84,7 +84,7 @@ func testAccWorkspaceDataSource_workspaceIDAndDirectoryIDConflict(t *testing.T) ctx := acctest.Context(t) resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckHasIAMRole(ctx, t, "workspaces_DefaultRole") }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckHasIAMRole(ctx, t, "workspaces_DefaultRole") }, ErrorCheck: acctest.ErrorCheck(t, workspaces.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ diff --git a/internal/service/workspaces/workspace_test.go b/internal/service/workspaces/workspace_test.go index da154401559e..2155a73001bf 100644 --- a/internal/service/workspaces/workspace_test.go +++ b/internal/service/workspaces/workspace_test.go @@ -29,7 +29,7 @@ func testAccWorkspace_basic(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) testAccPreCheckDirectory(ctx, t) acctest.PreCheckDirectoryServiceSimpleDirectory(ctx, t) acctest.PreCheckHasIAMRole(ctx, t, "workspaces_DefaultRole") @@ -79,7 +79,7 @@ func testAccWorkspace_tags(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) testAccPreCheckDirectory(ctx, t) acctest.PreCheckDirectoryServiceSimpleDirectory(ctx, t) acctest.PreCheckHasIAMRole(ctx, t, "workspaces_DefaultRole") @@ -133,7 +133,7 @@ func testAccWorkspace_workspaceProperties(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) testAccPreCheckDirectory(ctx, t) acctest.PreCheckDirectoryServiceSimpleDirectory(ctx, t) acctest.PreCheckHasIAMRole(ctx, t, "workspaces_DefaultRole") @@ -200,7 +200,7 @@ func testAccWorkspace_workspaceProperties_runningModeAlwaysOn(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) testAccPreCheckDirectory(ctx, t) acctest.PreCheckDirectoryServiceSimpleDirectory(ctx, t) acctest.PreCheckHasIAMRole(ctx, t, "workspaces_DefaultRole") @@ -236,7 +236,7 @@ func testAccWorkspace_validateRootVolumeSize(t *testing.T) { domain := acctest.RandomDomainName() resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, workspaces.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckWorkspaceDestroy(ctx), @@ -255,7 +255,7 @@ func testAccWorkspace_validateUserVolumeSize(t *testing.T) { domain := acctest.RandomDomainName() resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, workspaces.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckWorkspaceDestroy(ctx), @@ -278,7 +278,7 @@ func testAccWorkspace_recreate(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) testAccPreCheckDirectory(ctx, t) acctest.PreCheckDirectoryServiceSimpleDirectory(ctx, t) acctest.PreCheckHasIAMRole(ctx, t, "workspaces_DefaultRole") @@ -314,7 +314,7 @@ func testAccWorkspace_timeout(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) testAccPreCheckDirectory(ctx, t) acctest.PreCheckDirectoryServiceSimpleDirectory(ctx, t) acctest.PreCheckHasIAMRole(ctx, t, "workspaces_DefaultRole") From e3bd581a74e914900c42be3a4634e0a8d16a11fe Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Fri, 24 Feb 2023 16:37:34 -0500 Subject: [PATCH 260/763] Add 'Context' argument to 'acctest.PreCheck' for xray. --- internal/service/xray/encryption_config_test.go | 2 +- internal/service/xray/group_test.go | 8 ++++---- internal/service/xray/sampling_rule_test.go | 8 ++++---- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/internal/service/xray/encryption_config_test.go b/internal/service/xray/encryption_config_test.go index 77a755d9e42c..2a1704faa3b0 100644 --- a/internal/service/xray/encryption_config_test.go +++ b/internal/service/xray/encryption_config_test.go @@ -20,7 +20,7 @@ func TestAccXRayEncryptionConfig_basic(t *testing.T) { keyResourceName := "aws_kms_key.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, xray.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: nil, diff --git a/internal/service/xray/group_test.go b/internal/service/xray/group_test.go index 9045722aed76..0125758e912f 100644 --- a/internal/service/xray/group_test.go +++ b/internal/service/xray/group_test.go @@ -24,7 +24,7 @@ func TestAccXRayGroup_basic(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, xray.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckGroupDestroy(ctx), @@ -65,7 +65,7 @@ func TestAccXRayGroup_insights(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, xray.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckGroupDestroy(ctx), @@ -108,7 +108,7 @@ func TestAccXRayGroup_tags(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, xray.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckGroupDestroy(ctx), @@ -153,7 +153,7 @@ func TestAccXRayGroup_disappears(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, xray.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckGroupDestroy(ctx), diff --git a/internal/service/xray/sampling_rule_test.go b/internal/service/xray/sampling_rule_test.go index b3d20316ed3d..bbbd5265221c 100644 --- a/internal/service/xray/sampling_rule_test.go +++ b/internal/service/xray/sampling_rule_test.go @@ -21,7 +21,7 @@ func TestAccXRaySamplingRule_basic(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, xray.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSamplingRuleDestroy(ctx), @@ -63,7 +63,7 @@ func TestAccXRaySamplingRule_update(t *testing.T) { updatedReservoirSize := sdkacctest.RandIntRange(0, 2147483647) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, xray.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSamplingRuleDestroy(ctx), @@ -120,7 +120,7 @@ func TestAccXRaySamplingRule_tags(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, xray.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSamplingRuleDestroy(ctx), @@ -166,7 +166,7 @@ func TestAccXRaySamplingRule_disappears(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, xray.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSamplingRuleDestroy(ctx), From fce0fd507d0eefbf5a63ef4b85bb107552ca74de Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Fri, 24 Feb 2023 16:37:53 -0500 Subject: [PATCH 261/763] Add 'Context' argument to 'acctest.PreCheck'. --- internal/provider/provider_acc_test.go | 67 +++++++++++++++++--------- 1 file changed, 44 insertions(+), 23 deletions(-) diff --git a/internal/provider/provider_acc_test.go b/internal/provider/provider_acc_test.go index 4039b4837676..f364ada3badf 100644 --- a/internal/provider/provider_acc_test.go +++ b/internal/provider/provider_acc_test.go @@ -21,10 +21,11 @@ import ( ) func TestAccProvider_DefaultTags_emptyBlock(t *testing.T) { + ctx := acctest.Context(t) var provider *schema.Provider resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t), ProtoV5ProviderFactories: testAccProtoV5ProviderFactoriesInternal(t, &provider), CheckDestroy: nil, @@ -40,10 +41,11 @@ func TestAccProvider_DefaultTags_emptyBlock(t *testing.T) { } func TestAccProvider_DefaultTagsTags_none(t *testing.T) { + ctx := acctest.Context(t) var provider *schema.Provider resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t), ProtoV5ProviderFactories: testAccProtoV5ProviderFactoriesInternal(t, &provider), CheckDestroy: nil, @@ -59,10 +61,11 @@ func TestAccProvider_DefaultTagsTags_none(t *testing.T) { } func TestAccProvider_DefaultTagsTags_one(t *testing.T) { + ctx := acctest.Context(t) var provider *schema.Provider resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t), ProtoV5ProviderFactories: testAccProtoV5ProviderFactoriesInternal(t, &provider), CheckDestroy: nil, @@ -78,10 +81,11 @@ func TestAccProvider_DefaultTagsTags_one(t *testing.T) { } func TestAccProvider_DefaultTagsTags_multiple(t *testing.T) { + ctx := acctest.Context(t) var provider *schema.Provider resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t), ProtoV5ProviderFactories: testAccProtoV5ProviderFactoriesInternal(t, &provider), CheckDestroy: nil, @@ -100,10 +104,11 @@ func TestAccProvider_DefaultTagsTags_multiple(t *testing.T) { } func TestAccProvider_DefaultAndIgnoreTags_emptyBlocks(t *testing.T) { + ctx := acctest.Context(t) var provider *schema.Provider resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t), ProtoV5ProviderFactories: testAccProtoV5ProviderFactoriesInternal(t, &provider), CheckDestroy: nil, @@ -121,6 +126,7 @@ func TestAccProvider_DefaultAndIgnoreTags_emptyBlocks(t *testing.T) { } func TestAccProvider_endpoints(t *testing.T) { + ctx := acctest.Context(t) var provider *schema.Provider var endpoints strings.Builder @@ -130,7 +136,7 @@ func TestAccProvider_endpoints(t *testing.T) { } resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t), ProtoV5ProviderFactories: testAccProtoV5ProviderFactoriesInternal(t, &provider), CheckDestroy: nil, @@ -146,11 +152,12 @@ func TestAccProvider_endpoints(t *testing.T) { } func TestAccProvider_fipsEndpoint(t *testing.T) { + ctx := acctest.Context(t) rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resourceName := "aws_s3_bucket.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: nil, @@ -172,14 +179,14 @@ type unusualEndpoint struct { } func TestAccProvider_unusualEndpoints(t *testing.T) { + ctx := acctest.Context(t) var provider *schema.Provider - unusual1 := unusualEndpoint{"es", "elasticsearch", "http://notarealendpoint"} unusual2 := unusualEndpoint{"databasemigration", "dms", "http://alsonotarealendpoint"} unusual3 := unusualEndpoint{"lexmodelbuildingservice", "lexmodels", "http://kingofspain"} resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t), ProtoV5ProviderFactories: testAccProtoV5ProviderFactoriesInternal(t, &provider), CheckDestroy: nil, @@ -197,10 +204,11 @@ func TestAccProvider_unusualEndpoints(t *testing.T) { } func TestAccProvider_IgnoreTags_emptyBlock(t *testing.T) { + ctx := acctest.Context(t) var provider *schema.Provider resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t), ProtoV5ProviderFactories: testAccProtoV5ProviderFactoriesInternal(t, &provider), CheckDestroy: nil, @@ -217,10 +225,11 @@ func TestAccProvider_IgnoreTags_emptyBlock(t *testing.T) { } func TestAccProvider_IgnoreTagsKeyPrefixes_none(t *testing.T) { + ctx := acctest.Context(t) var provider *schema.Provider resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t), ProtoV5ProviderFactories: testAccProtoV5ProviderFactoriesInternal(t, &provider), CheckDestroy: nil, @@ -236,10 +245,11 @@ func TestAccProvider_IgnoreTagsKeyPrefixes_none(t *testing.T) { } func TestAccProvider_IgnoreTagsKeyPrefixes_one(t *testing.T) { + ctx := acctest.Context(t) var provider *schema.Provider resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t), ProtoV5ProviderFactories: testAccProtoV5ProviderFactoriesInternal(t, &provider), CheckDestroy: nil, @@ -255,10 +265,11 @@ func TestAccProvider_IgnoreTagsKeyPrefixes_one(t *testing.T) { } func TestAccProvider_IgnoreTagsKeyPrefixes_multiple(t *testing.T) { + ctx := acctest.Context(t) var provider *schema.Provider resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t), ProtoV5ProviderFactories: testAccProtoV5ProviderFactoriesInternal(t, &provider), CheckDestroy: nil, @@ -274,10 +285,11 @@ func TestAccProvider_IgnoreTagsKeyPrefixes_multiple(t *testing.T) { } func TestAccProvider_IgnoreTagsKeys_none(t *testing.T) { + ctx := acctest.Context(t) var provider *schema.Provider resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t), ProtoV5ProviderFactories: testAccProtoV5ProviderFactoriesInternal(t, &provider), CheckDestroy: nil, @@ -293,10 +305,11 @@ func TestAccProvider_IgnoreTagsKeys_none(t *testing.T) { } func TestAccProvider_IgnoreTagsKeys_one(t *testing.T) { + ctx := acctest.Context(t) var provider *schema.Provider resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t), ProtoV5ProviderFactories: testAccProtoV5ProviderFactoriesInternal(t, &provider), CheckDestroy: nil, @@ -312,10 +325,11 @@ func TestAccProvider_IgnoreTagsKeys_one(t *testing.T) { } func TestAccProvider_IgnoreTagsKeys_multiple(t *testing.T) { + ctx := acctest.Context(t) var provider *schema.Provider resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t), ProtoV5ProviderFactories: testAccProtoV5ProviderFactoriesInternal(t, &provider), CheckDestroy: nil, @@ -331,10 +345,11 @@ func TestAccProvider_IgnoreTagsKeys_multiple(t *testing.T) { } func TestAccProvider_Region_c2s(t *testing.T) { + ctx := acctest.Context(t) var provider *schema.Provider resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t), ProtoV5ProviderFactories: testAccProtoV5ProviderFactoriesInternal(t, &provider), CheckDestroy: nil, @@ -353,10 +368,11 @@ func TestAccProvider_Region_c2s(t *testing.T) { } func TestAccProvider_Region_china(t *testing.T) { + ctx := acctest.Context(t) var provider *schema.Provider resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t), ProtoV5ProviderFactories: testAccProtoV5ProviderFactoriesInternal(t, &provider), CheckDestroy: nil, @@ -375,10 +391,11 @@ func TestAccProvider_Region_china(t *testing.T) { } func TestAccProvider_Region_commercial(t *testing.T) { + ctx := acctest.Context(t) var provider *schema.Provider resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t), ProtoV5ProviderFactories: testAccProtoV5ProviderFactoriesInternal(t, &provider), CheckDestroy: nil, @@ -397,10 +414,11 @@ func TestAccProvider_Region_commercial(t *testing.T) { } func TestAccProvider_Region_govCloud(t *testing.T) { + ctx := acctest.Context(t) var provider *schema.Provider resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t), ProtoV5ProviderFactories: testAccProtoV5ProviderFactoriesInternal(t, &provider), CheckDestroy: nil, @@ -419,10 +437,11 @@ func TestAccProvider_Region_govCloud(t *testing.T) { } func TestAccProvider_Region_sc2s(t *testing.T) { + ctx := acctest.Context(t) var provider *schema.Provider resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t), ProtoV5ProviderFactories: testAccProtoV5ProviderFactoriesInternal(t, &provider), CheckDestroy: nil, @@ -441,10 +460,11 @@ func TestAccProvider_Region_sc2s(t *testing.T) { } func TestAccProvider_Region_stsRegion(t *testing.T) { + ctx := acctest.Context(t) var provider *schema.Provider resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t), ProtoV5ProviderFactories: testAccProtoV5ProviderFactoriesInternal(t, &provider), CheckDestroy: nil, @@ -462,8 +482,9 @@ func TestAccProvider_Region_stsRegion(t *testing.T) { } func TestAccProvider_AssumeRole_empty(t *testing.T) { + ctx := acctest.Context(t) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: nil, From 8300a9baa2e4d9d9f3dd12a93a9d088602a0574a Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Fri, 24 Feb 2023 17:01:41 -0500 Subject: [PATCH 262/763] Add 'ctx := acctest.Context(t)' for acm. --- internal/service/acm/certificate_data_source_test.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/internal/service/acm/certificate_data_source_test.go b/internal/service/acm/certificate_data_source_test.go index 1d56cd2bc4af..3146ab483d2b 100644 --- a/internal/service/acm/certificate_data_source_test.go +++ b/internal/service/acm/certificate_data_source_test.go @@ -15,6 +15,7 @@ import ( const certificateRE = `^arn:[^:]+:acm:[^:]+:[^:]+:certificate/.+$` func TestAccACMCertificateDataSource_singleIssued(t *testing.T) { + ctx := acctest.Context(t) if os.Getenv("ACM_CERTIFICATE_ROOT_DOMAIN") == "" { t.Skip("Environment variable ACM_CERTIFICATE_ROOT_DOMAIN is not set") } @@ -102,6 +103,7 @@ func TestAccACMCertificateDataSource_singleIssued(t *testing.T) { } func TestAccACMCertificateDataSource_multipleIssued(t *testing.T) { + ctx := acctest.Context(t) if os.Getenv("ACM_CERTIFICATE_ROOT_DOMAIN") == "" { t.Skip("Environment variable ACM_CERTIFICATE_ROOT_DOMAIN is not set") } @@ -166,6 +168,7 @@ func TestAccACMCertificateDataSource_multipleIssued(t *testing.T) { } func TestAccACMCertificateDataSource_noMatchReturnsError(t *testing.T) { + ctx := acctest.Context(t) if os.Getenv("ACM_CERTIFICATE_ROOT_DOMAIN") == "" { t.Skip("Environment variable ACM_CERTIFICATE_ROOT_DOMAIN is not set") } @@ -206,6 +209,7 @@ func TestAccACMCertificateDataSource_noMatchReturnsError(t *testing.T) { } func TestAccACMCertificateDataSource_keyTypes(t *testing.T) { + ctx := acctest.Context(t) resourceName := "aws_acm_certificate.test" dataSourceName := "data.aws_acm_certificate.test" key := acctest.TLSRSAPrivateKeyPEM(t, 4096) From 2d18eac08aa271b2633be98428253d57677b4121 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Fri, 24 Feb 2023 17:01:49 -0500 Subject: [PATCH 263/763] Add 'ctx := acctest.Context(t)' for acmpca. --- .../service/acmpca/certificate_authority_data_source_test.go | 2 ++ internal/service/acmpca/certificate_data_source_test.go | 1 + 2 files changed, 3 insertions(+) diff --git a/internal/service/acmpca/certificate_authority_data_source_test.go b/internal/service/acmpca/certificate_authority_data_source_test.go index 94d85387fb52..4aa65405611d 100644 --- a/internal/service/acmpca/certificate_authority_data_source_test.go +++ b/internal/service/acmpca/certificate_authority_data_source_test.go @@ -11,6 +11,7 @@ import ( ) func TestAccACMPCACertificateAuthorityDataSource_basic(t *testing.T) { + ctx := acctest.Context(t) resourceName := "aws_acmpca_certificate_authority.test" datasourceName := "data.aws_acmpca_certificate_authority.test" @@ -49,6 +50,7 @@ func TestAccACMPCACertificateAuthorityDataSource_basic(t *testing.T) { } func TestAccACMPCACertificateAuthorityDataSource_s3ObjectACL(t *testing.T) { + ctx := acctest.Context(t) resourceName := "aws_acmpca_certificate_authority.test" datasourceName := "data.aws_acmpca_certificate_authority.test" diff --git a/internal/service/acmpca/certificate_data_source_test.go b/internal/service/acmpca/certificate_data_source_test.go index 68e5a736a511..162fb7324d90 100644 --- a/internal/service/acmpca/certificate_data_source_test.go +++ b/internal/service/acmpca/certificate_data_source_test.go @@ -11,6 +11,7 @@ import ( ) func TestAccACMPCACertificateDataSource_basic(t *testing.T) { + ctx := acctest.Context(t) resourceName := "aws_acmpca_certificate.test" dataSourceName := "data.aws_acmpca_certificate.test" From e3d495b0b349081e744b1bc939e5314ce7eec305 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Fri, 24 Feb 2023 17:01:50 -0500 Subject: [PATCH 264/763] Add 'ctx := acctest.Context(t)' for amp. --- .../service/amp/alert_manager_definition_test.go | 10 ++++++++-- internal/service/amp/rule_group_namespace_test.go | 10 ++++++++-- .../service/amp/workspace_data_source_test.go | 6 +++++- internal/service/amp/workspace_test.go | 15 ++++++++++++--- 4 files changed, 33 insertions(+), 8 deletions(-) diff --git a/internal/service/amp/alert_manager_definition_test.go b/internal/service/amp/alert_manager_definition_test.go index 81ec296cb18e..29d79cf4f000 100644 --- a/internal/service/amp/alert_manager_definition_test.go +++ b/internal/service/amp/alert_manager_definition_test.go @@ -19,7 +19,10 @@ func TestAccAMPAlertManagerDefinition_basic(t *testing.T) { resourceName := "aws_prometheus_alert_manager_definition.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(prometheusservice.EndpointsID, t) }, + PreCheck: func() { + acctest.PreCheck(ctx, t) + acctest.PreCheckPartitionHasService(prometheusservice.EndpointsID, t) + }, ErrorCheck: acctest.ErrorCheck(t, prometheusservice.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckAlertManagerDefinitionDestroy(ctx), @@ -58,7 +61,10 @@ func TestAccAMPAlertManagerDefinition_disappears(t *testing.T) { ctx := acctest.Context(t) resourceName := "aws_prometheus_alert_manager_definition.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(prometheusservice.EndpointsID, t) }, + PreCheck: func() { + acctest.PreCheck(ctx, t) + acctest.PreCheckPartitionHasService(prometheusservice.EndpointsID, t) + }, ErrorCheck: acctest.ErrorCheck(t, prometheusservice.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckAlertManagerDefinitionDestroy(ctx), diff --git a/internal/service/amp/rule_group_namespace_test.go b/internal/service/amp/rule_group_namespace_test.go index c545352d3d0d..13fe1ac1d2ec 100644 --- a/internal/service/amp/rule_group_namespace_test.go +++ b/internal/service/amp/rule_group_namespace_test.go @@ -19,7 +19,10 @@ func TestAccAMPRuleGroupNamespace_basic(t *testing.T) { resourceName := "aws_prometheus_rule_group_namespace.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(prometheusservice.EndpointsID, t) }, + PreCheck: func() { + acctest.PreCheck(ctx, t) + acctest.PreCheckPartitionHasService(prometheusservice.EndpointsID, t) + }, ErrorCheck: acctest.ErrorCheck(t, prometheusservice.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRuleGroupNamespaceDestroy(ctx), @@ -58,7 +61,10 @@ func TestAccAMPRuleGroupNamespace_disappears(t *testing.T) { ctx := acctest.Context(t) resourceName := "aws_prometheus_rule_group_namespace.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(prometheusservice.EndpointsID, t) }, + PreCheck: func() { + acctest.PreCheck(ctx, t) + acctest.PreCheckPartitionHasService(prometheusservice.EndpointsID, t) + }, ErrorCheck: acctest.ErrorCheck(t, prometheusservice.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckRuleGroupNamespaceDestroy(ctx), diff --git a/internal/service/amp/workspace_data_source_test.go b/internal/service/amp/workspace_data_source_test.go index 8b4da8dd655b..c00c90bf5436 100644 --- a/internal/service/amp/workspace_data_source_test.go +++ b/internal/service/amp/workspace_data_source_test.go @@ -11,12 +11,16 @@ import ( ) func TestAccAMPWorkspaceDataSource_basic(t *testing.T) { + ctx := acctest.Context(t) rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resourceName := "aws_prometheus_workspace.test" dataSourceName := "data.aws_prometheus_workspace.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(prometheusservice.EndpointsID, t) }, + PreCheck: func() { + acctest.PreCheck(ctx, t) + acctest.PreCheckPartitionHasService(prometheusservice.EndpointsID, t) + }, ErrorCheck: acctest.ErrorCheck(t, prometheusservice.EndpointsID), CheckDestroy: nil, ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, diff --git a/internal/service/amp/workspace_test.go b/internal/service/amp/workspace_test.go index d837a51123ae..1b256d05a0aa 100644 --- a/internal/service/amp/workspace_test.go +++ b/internal/service/amp/workspace_test.go @@ -22,7 +22,10 @@ func TestAccAMPWorkspace_basic(t *testing.T) { resourceName := "aws_prometheus_workspace.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(prometheusservice.EndpointsID, t) }, + PreCheck: func() { + acctest.PreCheck(ctx, t) + acctest.PreCheckPartitionHasService(prometheusservice.EndpointsID, t) + }, ErrorCheck: acctest.ErrorCheck(t, prometheusservice.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckWorkspaceDestroy(ctx), @@ -53,7 +56,10 @@ func TestAccAMPWorkspace_disappears(t *testing.T) { resourceName := "aws_prometheus_workspace.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(prometheusservice.EndpointsID, t) }, + PreCheck: func() { + acctest.PreCheck(ctx, t) + acctest.PreCheckPartitionHasService(prometheusservice.EndpointsID, t) + }, ErrorCheck: acctest.ErrorCheck(t, prometheusservice.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckWorkspaceDestroy(ctx), @@ -123,7 +129,10 @@ func TestAccAMPWorkspace_alias(t *testing.T) { resourceName := "aws_prometheus_workspace.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(prometheusservice.EndpointsID, t) }, + PreCheck: func() { + acctest.PreCheck(ctx, t) + acctest.PreCheckPartitionHasService(prometheusservice.EndpointsID, t) + }, ErrorCheck: acctest.ErrorCheck(t, prometheusservice.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckWorkspaceDestroy(ctx), From 99f866ce005338f8f9c8caa2259b801cfeef08b0 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Fri, 24 Feb 2023 17:01:50 -0500 Subject: [PATCH 265/763] Add 'ctx := acctest.Context(t)' for apigateway. --- internal/service/apigateway/api_key_data_source_test.go | 1 + internal/service/apigateway/export_data_source_test.go | 1 + internal/service/apigateway/resource_data_source_test.go | 1 + internal/service/apigateway/rest_api_data_source_test.go | 2 ++ internal/service/apigateway/sdk_data_source_test.go | 1 + internal/service/apigateway/vpc_link_data_source_test.go | 1 + 6 files changed, 7 insertions(+) diff --git a/internal/service/apigateway/api_key_data_source_test.go b/internal/service/apigateway/api_key_data_source_test.go index d59bf917bff2..f09906da46f7 100644 --- a/internal/service/apigateway/api_key_data_source_test.go +++ b/internal/service/apigateway/api_key_data_source_test.go @@ -11,6 +11,7 @@ import ( ) func TestAccAPIGatewayAPIKeyDataSource_basic(t *testing.T) { + ctx := acctest.Context(t) rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resourceName := "aws_api_gateway_api_key.test" dataSourceName := "data.aws_api_gateway_api_key.test" diff --git a/internal/service/apigateway/export_data_source_test.go b/internal/service/apigateway/export_data_source_test.go index b99e386534ec..8a329a90fba6 100644 --- a/internal/service/apigateway/export_data_source_test.go +++ b/internal/service/apigateway/export_data_source_test.go @@ -10,6 +10,7 @@ import ( ) func TestAccAPIGatewayExportDataSource_basic(t *testing.T) { + ctx := acctest.Context(t) rName := sdkacctest.RandString(8) dataSourceName := "data.aws_api_gateway_export.test" diff --git a/internal/service/apigateway/resource_data_source_test.go b/internal/service/apigateway/resource_data_source_test.go index 2b6a7cf26720..f4b5d6893c22 100644 --- a/internal/service/apigateway/resource_data_source_test.go +++ b/internal/service/apigateway/resource_data_source_test.go @@ -11,6 +11,7 @@ import ( ) func TestAccAPIGatewayResourceDataSource_basic(t *testing.T) { + ctx := acctest.Context(t) rName := sdkacctest.RandString(8) resourceName1 := "aws_api_gateway_resource.example_v1" dataSourceName1 := "data.aws_api_gateway_resource.example_v1" diff --git a/internal/service/apigateway/rest_api_data_source_test.go b/internal/service/apigateway/rest_api_data_source_test.go index 8107267c6bfc..ed6f51de40c2 100644 --- a/internal/service/apigateway/rest_api_data_source_test.go +++ b/internal/service/apigateway/rest_api_data_source_test.go @@ -10,6 +10,7 @@ import ( ) func TestAccAPIGatewayRestAPIDataSource_basic(t *testing.T) { + ctx := acctest.Context(t) rName := sdkacctest.RandString(8) dataSourceName := "data.aws_api_gateway_rest_api.test" resourceName := "aws_api_gateway_rest_api.test" @@ -42,6 +43,7 @@ func TestAccAPIGatewayRestAPIDataSource_basic(t *testing.T) { } func TestAccAPIGatewayRestAPIDataSource_Endpoint_vpcEndpointIDs(t *testing.T) { + ctx := acctest.Context(t) rName := sdkacctest.RandString(8) dataSourceName := "data.aws_api_gateway_rest_api.test" resourceName := "aws_api_gateway_rest_api.test" diff --git a/internal/service/apigateway/sdk_data_source_test.go b/internal/service/apigateway/sdk_data_source_test.go index c0eb301682b5..b435ca7d8865 100644 --- a/internal/service/apigateway/sdk_data_source_test.go +++ b/internal/service/apigateway/sdk_data_source_test.go @@ -10,6 +10,7 @@ import ( ) func TestAccAPIGatewaySdkDataSource_basic(t *testing.T) { + ctx := acctest.Context(t) rName := sdkacctest.RandString(8) dataSourceName := "data.aws_api_gateway_sdk.test" diff --git a/internal/service/apigateway/vpc_link_data_source_test.go b/internal/service/apigateway/vpc_link_data_source_test.go index f28bb7b38862..0a75a57d4383 100644 --- a/internal/service/apigateway/vpc_link_data_source_test.go +++ b/internal/service/apigateway/vpc_link_data_source_test.go @@ -11,6 +11,7 @@ import ( ) func TestAccAPIGatewayVPCLinkDataSource_basic(t *testing.T) { + ctx := acctest.Context(t) rName := fmt.Sprintf("tf-acc-test-%s", sdkacctest.RandString(8)) resourceName := "aws_api_gateway_vpc_link.vpc_link" dataSourceName := "data.aws_api_gateway_vpc_link.vpc_link" From 7fc447baf2bbe530fc0973c82384499f3c7e558b Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Fri, 24 Feb 2023 17:01:50 -0500 Subject: [PATCH 266/763] Add 'ctx := acctest.Context(t)' for apigatewayv2. --- internal/service/apigatewayv2/api_data_source_test.go | 2 ++ internal/service/apigatewayv2/apis_data_source_test.go | 3 +++ internal/service/apigatewayv2/export_data_source_test.go | 2 ++ 3 files changed, 7 insertions(+) diff --git a/internal/service/apigatewayv2/api_data_source_test.go b/internal/service/apigatewayv2/api_data_source_test.go index 5d12f67c62c1..4b09b0e59a07 100644 --- a/internal/service/apigatewayv2/api_data_source_test.go +++ b/internal/service/apigatewayv2/api_data_source_test.go @@ -11,6 +11,7 @@ import ( ) func TestAccAPIGatewayV2APIDataSource_http(t *testing.T) { + ctx := acctest.Context(t) dataSourceName := "data.aws_apigatewayv2_api.test" resourceName := "aws_apigatewayv2_api.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) @@ -51,6 +52,7 @@ func TestAccAPIGatewayV2APIDataSource_http(t *testing.T) { } func TestAccAPIGatewayV2APIDataSource_webSocket(t *testing.T) { + ctx := acctest.Context(t) dataSourceName := "data.aws_apigatewayv2_api.test" resourceName := "aws_apigatewayv2_api.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) diff --git a/internal/service/apigatewayv2/apis_data_source_test.go b/internal/service/apigatewayv2/apis_data_source_test.go index e20910b631ee..c07cf1a1a02f 100644 --- a/internal/service/apigatewayv2/apis_data_source_test.go +++ b/internal/service/apigatewayv2/apis_data_source_test.go @@ -11,6 +11,7 @@ import ( ) func TestAccAPIGatewayV2APIsDataSource_name(t *testing.T) { + ctx := acctest.Context(t) dataSource1Name := "data.aws_apigatewayv2_apis.test1" dataSource2Name := "data.aws_apigatewayv2_apis.test2" rName1 := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) @@ -34,6 +35,7 @@ func TestAccAPIGatewayV2APIsDataSource_name(t *testing.T) { } func TestAccAPIGatewayV2APIsDataSource_protocolType(t *testing.T) { + ctx := acctest.Context(t) dataSource1Name := "data.aws_apigatewayv2_apis.test1" dataSource2Name := "data.aws_apigatewayv2_apis.test2" rName1 := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) @@ -57,6 +59,7 @@ func TestAccAPIGatewayV2APIsDataSource_protocolType(t *testing.T) { } func TestAccAPIGatewayV2APIsDataSource_tags(t *testing.T) { + ctx := acctest.Context(t) dataSource1Name := "data.aws_apigatewayv2_apis.test1" dataSource2Name := "data.aws_apigatewayv2_apis.test2" dataSource3Name := "data.aws_apigatewayv2_apis.test3" diff --git a/internal/service/apigatewayv2/export_data_source_test.go b/internal/service/apigatewayv2/export_data_source_test.go index 862f1e447c62..a97d0e40253d 100644 --- a/internal/service/apigatewayv2/export_data_source_test.go +++ b/internal/service/apigatewayv2/export_data_source_test.go @@ -11,6 +11,7 @@ import ( ) func TestAccAPIGatewayV2ExportDataSource_basic(t *testing.T) { + ctx := acctest.Context(t) dataSourceName := "data.aws_apigatewayv2_export.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) @@ -32,6 +33,7 @@ func TestAccAPIGatewayV2ExportDataSource_basic(t *testing.T) { } func TestAccAPIGatewayV2ExportDataSource_stage(t *testing.T) { + ctx := acctest.Context(t) dataSourceName := "data.aws_apigatewayv2_export.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) From 7b080fa4a1f52c3e4673e103fdb6f620ce0ff361 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Fri, 24 Feb 2023 17:01:51 -0500 Subject: [PATCH 267/763] Add 'ctx := acctest.Context(t)' for auditmanager. --- .../auditmanager/control_data_source_test.go | 2 + .../framework_data_source_test.go | 2 + ...ization_admin_account_registration_test.go | 44 ++++++++++--------- 3 files changed, 27 insertions(+), 21 deletions(-) diff --git a/internal/service/auditmanager/control_data_source_test.go b/internal/service/auditmanager/control_data_source_test.go index a09783474d84..c938741e1625 100644 --- a/internal/service/auditmanager/control_data_source_test.go +++ b/internal/service/auditmanager/control_data_source_test.go @@ -14,6 +14,7 @@ import ( func TestAccAuditManagerControlDataSource_standard(t *testing.T) { // Standard controls are managed by AWS and will exist in the account automatically // once AuditManager is enabled. + ctx := acctest.Context(t) name := "1. Risk Management" dataSourceName := "data.aws_auditmanager_control.test" @@ -37,6 +38,7 @@ func TestAccAuditManagerControlDataSource_standard(t *testing.T) { } func TestAccAuditManagerControlDataSource_custom(t *testing.T) { + ctx := acctest.Context(t) rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) dataSourceName := "data.aws_auditmanager_control.test" diff --git a/internal/service/auditmanager/framework_data_source_test.go b/internal/service/auditmanager/framework_data_source_test.go index 18b36e3898c8..aff5bcb31552 100644 --- a/internal/service/auditmanager/framework_data_source_test.go +++ b/internal/service/auditmanager/framework_data_source_test.go @@ -13,6 +13,7 @@ import ( func TestAccAuditManagerFrameworkDataSource_standard(t *testing.T) { // Standard frameworks are managed by AWS and will exist in the account automatically // once AuditManager is enabled. + ctx := acctest.Context(t) name := "Essential Eight" dataSourceName := "data.aws_auditmanager_framework.test" @@ -36,6 +37,7 @@ func TestAccAuditManagerFrameworkDataSource_standard(t *testing.T) { } func TestAccAuditManagerFrameworkDataSource_custom(t *testing.T) { + ctx := acctest.Context(t) rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) dataSourceName := "data.aws_auditmanager_framework.test" diff --git a/internal/service/auditmanager/organization_admin_account_registration_test.go b/internal/service/auditmanager/organization_admin_account_registration_test.go index f760fe5fe856..874765a88fe8 100644 --- a/internal/service/auditmanager/organization_admin_account_registration_test.go +++ b/internal/service/auditmanager/organization_admin_account_registration_test.go @@ -30,6 +30,7 @@ func TestAccAuditManagerOrganizationAdminAccountRegistration_serial(t *testing.T } func testAccOrganizationAdminAccountRegistration_basic(t *testing.T) { + ctx := acctest.Context(t) adminAccountID := os.Getenv("AUDITMANAGER_ORGANIZATION_ADMIN_ACCOUNT_ID") if adminAccountID == "" { t.Skip("Environment variable AUDITMANAGER_ORGANIZATION_ADMIN_ACCOUNT_ID is not set") @@ -44,12 +45,12 @@ func testAccOrganizationAdminAccountRegistration_basic(t *testing.T) { }, ErrorCheck: acctest.ErrorCheck(t, names.AuditManagerEndpointID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - CheckDestroy: testAccCheckOrganizationAdminAccountRegistrationDestroy, + CheckDestroy: testAccCheckOrganizationAdminAccountRegistrationDestroy(ctx), Steps: []resource.TestStep{ { Config: testAccOrganizationAdminAccountRegistrationConfig_basic(adminAccountID), Check: resource.ComposeTestCheckFunc( - testAccCheckOrganizationAdminAccountRegistrationExists(resourceName), + testAccCheckOrganizationAdminAccountRegistrationExists(ctx, resourceName), ), }, { @@ -62,6 +63,7 @@ func testAccOrganizationAdminAccountRegistration_basic(t *testing.T) { } func testAccOrganizationAdminAccountRegistration_disappears(t *testing.T) { + ctx := acctest.Context(t) adminAccountID := os.Getenv("AUDITMANAGER_ORGANIZATION_ADMIN_ACCOUNT_ID") if adminAccountID == "" { t.Skip("Environment variable AUDITMANAGER_ORGANIZATION_ADMIN_ACCOUNT_ID is not set") @@ -76,12 +78,12 @@ func testAccOrganizationAdminAccountRegistration_disappears(t *testing.T) { }, ErrorCheck: acctest.ErrorCheck(t, names.AuditManagerEndpointID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - CheckDestroy: testAccCheckOrganizationAdminAccountRegistrationDestroy, + CheckDestroy: testAccCheckOrganizationAdminAccountRegistrationDestroy(ctx), Steps: []resource.TestStep{ { Config: testAccOrganizationAdminAccountRegistrationConfig_basic(adminAccountID), Check: resource.ComposeTestCheckFunc( - testAccCheckOrganizationAdminAccountRegistrationExists(resourceName), + testAccCheckOrganizationAdminAccountRegistrationExists(ctx, resourceName), acctest.CheckFrameworkResourceDisappears(acctest.Provider, tfauditmanager.ResourceOrganizationAdminAccountRegistration, resourceName), ), ExpectNonEmptyPlan: true, @@ -90,28 +92,29 @@ func testAccOrganizationAdminAccountRegistration_disappears(t *testing.T) { }) } -func testAccCheckOrganizationAdminAccountRegistrationDestroy(s *terraform.State) error { - ctx := context.Background() - conn := acctest.Provider.Meta().(*conns.AWSClient).AuditManagerClient() +func testAccCheckOrganizationAdminAccountRegistrationDestroy(ctx context.Context) resource.TestCheckFunc { + return func(s *terraform.State) error { + conn := acctest.Provider.Meta().(*conns.AWSClient).AuditManagerClient() - for _, rs := range s.RootModule().Resources { - if rs.Type != "aws_auditmanager_organization_admin_account_registration" { - continue + for _, rs := range s.RootModule().Resources { + if rs.Type != "aws_auditmanager_organization_admin_account_registration" { + continue + } + + out, err := conn.GetOrganizationAdminAccount(ctx, &auditmanager.GetOrganizationAdminAccountInput{}) + if err != nil { + return err + } + if out.AdminAccountId != nil { + return create.Error(names.AuditManager, create.ErrActionCheckingDestroyed, tfauditmanager.ResNameOrganizationAdminAccountRegistration, rs.Primary.ID, errors.New("not destroyed")) + } } - out, err := conn.GetOrganizationAdminAccount(ctx, &auditmanager.GetOrganizationAdminAccountInput{}) - if err != nil { - return err - } - if out.AdminAccountId != nil { - return create.Error(names.AuditManager, create.ErrActionCheckingDestroyed, tfauditmanager.ResNameOrganizationAdminAccountRegistration, rs.Primary.ID, errors.New("not destroyed")) - } + return nil } - - return nil } -func testAccCheckOrganizationAdminAccountRegistrationExists(name string) resource.TestCheckFunc { +func testAccCheckOrganizationAdminAccountRegistrationExists(ctx context.Context, name string) resource.TestCheckFunc { return func(s *terraform.State) error { rs, ok := s.RootModule().Resources[name] if !ok { @@ -122,7 +125,6 @@ func testAccCheckOrganizationAdminAccountRegistrationExists(name string) resourc return create.Error(names.AuditManager, create.ErrActionCheckingExistence, tfauditmanager.ResNameOrganizationAdminAccountRegistration, name, errors.New("not set")) } - ctx := context.Background() conn := acctest.Provider.Meta().(*conns.AWSClient).AuditManagerClient() out, err := conn.GetOrganizationAdminAccount(ctx, &auditmanager.GetOrganizationAdminAccountInput{}) if err != nil { From 2c7d5752d9f47a387bde1de74d187c86ced15fed Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Fri, 24 Feb 2023 17:01:52 -0500 Subject: [PATCH 268/763] Add 'ctx := acctest.Context(t)' for autoscaling. --- internal/service/autoscaling/group_data_source_test.go | 2 ++ internal/service/autoscaling/groups_data_source_test.go | 1 + .../autoscaling/launch_configuration_data_source_test.go | 3 +++ 3 files changed, 6 insertions(+) diff --git a/internal/service/autoscaling/group_data_source_test.go b/internal/service/autoscaling/group_data_source_test.go index 1e132cf658d2..b4d649fd6bbb 100644 --- a/internal/service/autoscaling/group_data_source_test.go +++ b/internal/service/autoscaling/group_data_source_test.go @@ -11,6 +11,7 @@ import ( ) func TestAccAutoScalingGroupDataSource_basic(t *testing.T) { + ctx := acctest.Context(t) datasourceName := "data.aws_autoscaling_group.test" resourceName := "aws_autoscaling_group.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) @@ -51,6 +52,7 @@ func TestAccAutoScalingGroupDataSource_basic(t *testing.T) { } func TestAccAutoScalingGroupDataSource_launchTemplate(t *testing.T) { + ctx := acctest.Context(t) datasourceName := "data.aws_autoscaling_group.test" resourceName := "aws_autoscaling_group.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) diff --git a/internal/service/autoscaling/groups_data_source_test.go b/internal/service/autoscaling/groups_data_source_test.go index a8801f00f327..ceafebddefde 100644 --- a/internal/service/autoscaling/groups_data_source_test.go +++ b/internal/service/autoscaling/groups_data_source_test.go @@ -11,6 +11,7 @@ import ( ) func TestAccAutoScalingGroupsDataSource_basic(t *testing.T) { + ctx := acctest.Context(t) datasource1Name := "data.aws_autoscaling_groups.group_list" datasource2Name := "data.aws_autoscaling_groups.group_list_tag_lookup" datasource3Name := "data.aws_autoscaling_groups.group_list_by_name" diff --git a/internal/service/autoscaling/launch_configuration_data_source_test.go b/internal/service/autoscaling/launch_configuration_data_source_test.go index 5b48df664b37..7db166a5030e 100644 --- a/internal/service/autoscaling/launch_configuration_data_source_test.go +++ b/internal/service/autoscaling/launch_configuration_data_source_test.go @@ -11,6 +11,7 @@ import ( ) func TestAccAutoScalingLaunchConfigurationDataSource_basic(t *testing.T) { + ctx := acctest.Context(t) resourceName := "aws_launch_configuration.test" datasourceName := "data.aws_launch_configuration.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) @@ -49,6 +50,7 @@ func TestAccAutoScalingLaunchConfigurationDataSource_basic(t *testing.T) { } func TestAccAutoScalingLaunchConfigurationDataSource_securityGroups(t *testing.T) { + ctx := acctest.Context(t) datasourceName := "data.aws_launch_configuration.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) @@ -68,6 +70,7 @@ func TestAccAutoScalingLaunchConfigurationDataSource_securityGroups(t *testing.T } func TestAccAutoScalingLaunchConfigurationDataSource_ebsNoDevice(t *testing.T) { + ctx := acctest.Context(t) resourceName := "aws_launch_configuration.test" datasourceName := "data.aws_launch_configuration.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) From 32fe1c5046099b941b504b3a7c6650a7b42941dd Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Fri, 24 Feb 2023 17:01:52 -0500 Subject: [PATCH 269/763] Add 'ctx := acctest.Context(t)' for backup. --- internal/service/backup/plan_data_source_test.go | 1 + internal/service/backup/selection_data_source_test.go | 1 + internal/service/backup/vault_data_source_test.go | 1 + 3 files changed, 3 insertions(+) diff --git a/internal/service/backup/plan_data_source_test.go b/internal/service/backup/plan_data_source_test.go index 8ac4b68b3a62..79fa27bc47d2 100644 --- a/internal/service/backup/plan_data_source_test.go +++ b/internal/service/backup/plan_data_source_test.go @@ -12,6 +12,7 @@ import ( ) func TestAccBackupPlanDataSource_basic(t *testing.T) { + ctx := acctest.Context(t) datasourceName := "data.aws_backup_plan.test" resourceName := "aws_backup_plan.test" rInt := sdkacctest.RandInt() diff --git a/internal/service/backup/selection_data_source_test.go b/internal/service/backup/selection_data_source_test.go index d3ddc3d1ffa5..2ec08247969e 100644 --- a/internal/service/backup/selection_data_source_test.go +++ b/internal/service/backup/selection_data_source_test.go @@ -12,6 +12,7 @@ import ( ) func TestAccBackupSelectionDataSource_basic(t *testing.T) { + ctx := acctest.Context(t) datasourceName := "data.aws_backup_selection.test" resourceName := "aws_backup_selection.test" rInt := sdkacctest.RandInt() diff --git a/internal/service/backup/vault_data_source_test.go b/internal/service/backup/vault_data_source_test.go index 98461115bf01..84f41c7bef36 100644 --- a/internal/service/backup/vault_data_source_test.go +++ b/internal/service/backup/vault_data_source_test.go @@ -12,6 +12,7 @@ import ( ) func TestAccBackupVaultDataSource_basic(t *testing.T) { + ctx := acctest.Context(t) datasourceName := "data.aws_backup_vault.test" resourceName := "aws_backup_vault.test" rInt := sdkacctest.RandInt() From 44d2d2b01d39b369ec094bdeaef7c6521bd0d351 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Fri, 24 Feb 2023 17:01:52 -0500 Subject: [PATCH 270/763] Add 'ctx := acctest.Context(t)' for batch. --- internal/service/batch/scheduling_policy_data_source_test.go | 1 + 1 file changed, 1 insertion(+) diff --git a/internal/service/batch/scheduling_policy_data_source_test.go b/internal/service/batch/scheduling_policy_data_source_test.go index 150a306d7062..01f34f02e42f 100644 --- a/internal/service/batch/scheduling_policy_data_source_test.go +++ b/internal/service/batch/scheduling_policy_data_source_test.go @@ -11,6 +11,7 @@ import ( ) func TestAccBatchSchedulingPolicyDataSource_basic(t *testing.T) { + ctx := acctest.Context(t) rName := sdkacctest.RandomWithPrefix("tf_acc_test_") resourceName := "aws_batch_scheduling_policy.test" datasourceName := "data.aws_batch_scheduling_policy.test" From 5607374e4d65c4004e5a251282965b062bb4127a Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Fri, 24 Feb 2023 17:01:53 -0500 Subject: [PATCH 271/763] Add 'ctx := acctest.Context(t)' for cloudformation. --- internal/service/cloudformation/export_data_source_test.go | 2 ++ internal/service/cloudformation/stack_data_source_test.go | 2 ++ internal/service/cloudformation/type_data_source_test.go | 2 ++ 3 files changed, 6 insertions(+) diff --git a/internal/service/cloudformation/export_data_source_test.go b/internal/service/cloudformation/export_data_source_test.go index 7d4ca44e43d3..2512bb195131 100644 --- a/internal/service/cloudformation/export_data_source_test.go +++ b/internal/service/cloudformation/export_data_source_test.go @@ -11,6 +11,7 @@ import ( ) func TestAccCloudFormationExportDataSource_basic(t *testing.T) { + ctx := acctest.Context(t) rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) dataSourceName := "data.aws_cloudformation_export.test" @@ -31,6 +32,7 @@ func TestAccCloudFormationExportDataSource_basic(t *testing.T) { } func TestAccCloudFormationExportDataSource_resourceReference(t *testing.T) { + ctx := acctest.Context(t) rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) dataSourceName := "data.aws_cloudformation_export.test" resourceName := "aws_cloudformation_stack.test" diff --git a/internal/service/cloudformation/stack_data_source_test.go b/internal/service/cloudformation/stack_data_source_test.go index f7c9ad93dce2..be56c3fd252a 100644 --- a/internal/service/cloudformation/stack_data_source_test.go +++ b/internal/service/cloudformation/stack_data_source_test.go @@ -12,6 +12,7 @@ import ( ) func TestAccCloudFormationStackDataSource_DataSource_basic(t *testing.T) { + ctx := acctest.Context(t) stackName := sdkacctest.RandomWithPrefix("tf-acc-ds-basic") resourceName := "data.aws_cloudformation_stack.network" @@ -98,6 +99,7 @@ data "aws_cloudformation_stack" "network" { } func TestAccCloudFormationStackDataSource_DataSource_yaml(t *testing.T) { + ctx := acctest.Context(t) stackName := sdkacctest.RandomWithPrefix("tf-acc-ds-yaml") resourceName := "data.aws_cloudformation_stack.yaml" diff --git a/internal/service/cloudformation/type_data_source_test.go b/internal/service/cloudformation/type_data_source_test.go index c14cc0bdf9ac..0675b43c1adc 100644 --- a/internal/service/cloudformation/type_data_source_test.go +++ b/internal/service/cloudformation/type_data_source_test.go @@ -48,6 +48,7 @@ func TestAccCloudFormationTypeDataSource_ARN_private(t *testing.T) { } func TestAccCloudFormationTypeDataSource_ARN_public(t *testing.T) { + ctx := acctest.Context(t) dataSourceName := "data.aws_cloudformation_type.test" resource.ParallelTest(t, resource.TestCase{ @@ -114,6 +115,7 @@ func TestAccCloudFormationTypeDataSource_TypeName_private(t *testing.T) { } func TestAccCloudFormationTypeDataSource_TypeName_public(t *testing.T) { + ctx := acctest.Context(t) dataSourceName := "data.aws_cloudformation_type.test" resource.ParallelTest(t, resource.TestCase{ From 5a35b60310e90adfa19a1dcadbfe6c52fa5470ce Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Fri, 24 Feb 2023 17:01:53 -0500 Subject: [PATCH 272/763] Add 'ctx := acctest.Context(t)' for cloudfront. --- internal/service/cloudfront/distribution_data_source_test.go | 1 + internal/service/cloudfront/function_data_source_test.go | 1 + .../log_delivery_canonical_user_id_data_source_test.go | 3 +++ 3 files changed, 5 insertions(+) diff --git a/internal/service/cloudfront/distribution_data_source_test.go b/internal/service/cloudfront/distribution_data_source_test.go index 0d0d54377184..c8fcb4cebe93 100644 --- a/internal/service/cloudfront/distribution_data_source_test.go +++ b/internal/service/cloudfront/distribution_data_source_test.go @@ -10,6 +10,7 @@ import ( ) func TestAccCloudFrontDistributionDataSource_basic(t *testing.T) { + ctx := acctest.Context(t) dataSourceName := "data.aws_cloudfront_distribution.test" resourceName := "aws_cloudfront_distribution.s3_distribution" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) diff --git a/internal/service/cloudfront/function_data_source_test.go b/internal/service/cloudfront/function_data_source_test.go index 37514a4af7bb..cc5dcdee09f0 100644 --- a/internal/service/cloudfront/function_data_source_test.go +++ b/internal/service/cloudfront/function_data_source_test.go @@ -11,6 +11,7 @@ import ( ) func TestAccCloudFrontFunctionDataSource_basic(t *testing.T) { + ctx := acctest.Context(t) rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) dataSourceName := "data.aws_cloudfront_function.test" resourceName := "aws_cloudfront_function.test" 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 7be1f55f37e9..916f3f4363c5 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 @@ -11,6 +11,7 @@ import ( ) func TestAccCloudFrontLogDeliveryCanonicalUserIDDataSource_basic(t *testing.T) { + ctx := acctest.Context(t) dataSourceName := "data.aws_cloudfront_log_delivery_canonical_user_id.test" resource.ParallelTest(t, resource.TestCase{ @@ -29,6 +30,7 @@ func TestAccCloudFrontLogDeliveryCanonicalUserIDDataSource_basic(t *testing.T) { } func TestAccCloudFrontLogDeliveryCanonicalUserIDDataSource_default(t *testing.T) { + ctx := acctest.Context(t) dataSourceName := "data.aws_cloudfront_log_delivery_canonical_user_id.test" resource.ParallelTest(t, resource.TestCase{ @@ -47,6 +49,7 @@ func TestAccCloudFrontLogDeliveryCanonicalUserIDDataSource_default(t *testing.T) } func TestAccCloudFrontLogDeliveryCanonicalUserIDDataSource_cn(t *testing.T) { + ctx := acctest.Context(t) dataSourceName := "data.aws_cloudfront_log_delivery_canonical_user_id.test" resource.ParallelTest(t, resource.TestCase{ From 5a80529e95c7338aae6b18df3f7442c3a004c3af Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Fri, 24 Feb 2023 17:01:53 -0500 Subject: [PATCH 273/763] Add 'ctx := acctest.Context(t)' for cloudhsmv2. --- internal/service/cloudhsmv2/cluster_data_source_test.go | 1 + 1 file changed, 1 insertion(+) diff --git a/internal/service/cloudhsmv2/cluster_data_source_test.go b/internal/service/cloudhsmv2/cluster_data_source_test.go index 787db1340a1b..a4f2a2a0c9fd 100644 --- a/internal/service/cloudhsmv2/cluster_data_source_test.go +++ b/internal/service/cloudhsmv2/cluster_data_source_test.go @@ -11,6 +11,7 @@ import ( ) func testAccDataSourceCluster_basic(t *testing.T) { + ctx := acctest.Context(t) resourceName := "aws_cloudhsm_v2_cluster.cluster" dataSourceName := "data.aws_cloudhsm_v2_cluster.default" From 7ec01cc5957336a0f6504bb0705f894ca0fba843 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Fri, 24 Feb 2023 17:01:54 -0500 Subject: [PATCH 274/763] Add 'ctx := acctest.Context(t)' for cloudtrail. --- internal/service/cloudtrail/service_account_data_source_test.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/internal/service/cloudtrail/service_account_data_source_test.go b/internal/service/cloudtrail/service_account_data_source_test.go index 148eefecc031..d728a3e215b5 100644 --- a/internal/service/cloudtrail/service_account_data_source_test.go +++ b/internal/service/cloudtrail/service_account_data_source_test.go @@ -9,6 +9,7 @@ import ( ) func TestAccCloudTrailServiceAccountDataSource_basic(t *testing.T) { + ctx := acctest.Context(t) expectedAccountID := tfcloudtrail.ServiceAccountPerRegionMap[acctest.Region()] dataSourceName := "data.aws_cloudtrail_service_account.main" @@ -30,6 +31,7 @@ func TestAccCloudTrailServiceAccountDataSource_basic(t *testing.T) { } func TestAccCloudTrailServiceAccountDataSource_region(t *testing.T) { + ctx := acctest.Context(t) expectedAccountID := tfcloudtrail.ServiceAccountPerRegionMap[acctest.Region()] dataSourceName := "data.aws_cloudtrail_service_account.regional" From cd4ed655b8cae1db9e72bd508cb6e8f6b1b65078 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Fri, 24 Feb 2023 17:01:54 -0500 Subject: [PATCH 275/763] Add 'ctx := acctest.Context(t)' for codeartifact. --- .../codeartifact/authorization_token_data_source_test.go | 3 +++ .../codeartifact/repository_endpoint_data_source_test.go | 2 ++ 2 files changed, 5 insertions(+) diff --git a/internal/service/codeartifact/authorization_token_data_source_test.go b/internal/service/codeartifact/authorization_token_data_source_test.go index 2976ee2375fb..f93962b6fd35 100644 --- a/internal/service/codeartifact/authorization_token_data_source_test.go +++ b/internal/service/codeartifact/authorization_token_data_source_test.go @@ -11,6 +11,7 @@ import ( ) func testAccAuthorizationTokenDataSource_basic(t *testing.T) { + ctx := acctest.Context(t) rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) dataSourceName := "data.aws_codeartifact_authorization_token.test" @@ -32,6 +33,7 @@ func testAccAuthorizationTokenDataSource_basic(t *testing.T) { } func testAccAuthorizationTokenDataSource_owner(t *testing.T) { + ctx := acctest.Context(t) rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) dataSourceName := "data.aws_codeartifact_authorization_token.test" @@ -53,6 +55,7 @@ func testAccAuthorizationTokenDataSource_owner(t *testing.T) { } func testAccAuthorizationTokenDataSource_duration(t *testing.T) { + ctx := acctest.Context(t) rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) dataSourceName := "data.aws_codeartifact_authorization_token.test" diff --git a/internal/service/codeartifact/repository_endpoint_data_source_test.go b/internal/service/codeartifact/repository_endpoint_data_source_test.go index 466d31e73976..128519e63da7 100644 --- a/internal/service/codeartifact/repository_endpoint_data_source_test.go +++ b/internal/service/codeartifact/repository_endpoint_data_source_test.go @@ -11,6 +11,7 @@ import ( ) func testAccRepositoryEndpointDataSource_basic(t *testing.T) { + ctx := acctest.Context(t) rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) dataSourceName := "data.aws_codeartifact_repository_endpoint.test" @@ -52,6 +53,7 @@ func testAccRepositoryEndpointDataSource_basic(t *testing.T) { } func testAccRepositoryEndpointDataSource_owner(t *testing.T) { + ctx := acctest.Context(t) rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) dataSourceName := "data.aws_codeartifact_repository_endpoint.test" From a052b940d3202bb33923e6a15a6c616aac06bd9a Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Fri, 24 Feb 2023 17:01:54 -0500 Subject: [PATCH 276/763] Add 'ctx := acctest.Context(t)' for codecommit. --- .../codecommit/approval_rule_template_data_source_test.go | 1 + internal/service/codecommit/repository_data_source_test.go | 1 + 2 files changed, 2 insertions(+) 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 10236d0864e8..9891c0ed7b56 100644 --- a/internal/service/codecommit/approval_rule_template_data_source_test.go +++ b/internal/service/codecommit/approval_rule_template_data_source_test.go @@ -11,6 +11,7 @@ import ( ) func TestAccCodeCommitApprovalRuleTemplateDataSource_basic(t *testing.T) { + ctx := acctest.Context(t) rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resourceName := "aws_codecommit_approval_rule_template.test" datasourceName := "data.aws_codecommit_approval_rule_template.test" diff --git a/internal/service/codecommit/repository_data_source_test.go b/internal/service/codecommit/repository_data_source_test.go index 444d2bae22be..10e4f0cdbf82 100644 --- a/internal/service/codecommit/repository_data_source_test.go +++ b/internal/service/codecommit/repository_data_source_test.go @@ -11,6 +11,7 @@ import ( ) func TestAccCodeCommitRepositoryDataSource_basic(t *testing.T) { + ctx := acctest.Context(t) rName := fmt.Sprintf("tf-acctest-%d", sdkacctest.RandInt()) resourceName := "aws_codecommit_repository.default" datasourceName := "data.aws_codecommit_repository.default" From 8c370a352f3a1af8507f9839dc867a967c741791 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Fri, 24 Feb 2023 17:01:55 -0500 Subject: [PATCH 277/763] Add 'ctx := acctest.Context(t)' for codestarconnections. --- .../connection_data_source_test.go | 12 +++++++++-- .../codestarconnections/connection_test.go | 20 +++++++++++++++---- .../service/codestarconnections/host_test.go | 15 +++++++++++--- 3 files changed, 38 insertions(+), 9 deletions(-) diff --git a/internal/service/codestarconnections/connection_data_source_test.go b/internal/service/codestarconnections/connection_data_source_test.go index 4653f524af8b..d5b2265f2a5c 100644 --- a/internal/service/codestarconnections/connection_data_source_test.go +++ b/internal/service/codestarconnections/connection_data_source_test.go @@ -11,13 +11,17 @@ import ( ) func TestAccCodeStarConnectionsConnectionDataSource_basic(t *testing.T) { + ctx := acctest.Context(t) rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) dataSourceName := "data.aws_codestarconnections_connection.test_arn" dataSourceName2 := "data.aws_codestarconnections_connection.test_name" resourceName := "aws_codestarconnections_connection.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(codestarconnections.EndpointsID, t) }, + PreCheck: func() { + acctest.PreCheck(ctx, t) + acctest.PreCheckPartitionHasService(codestarconnections.EndpointsID, t) + }, ErrorCheck: acctest.ErrorCheck(t, codestarconnections.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ @@ -43,12 +47,16 @@ func TestAccCodeStarConnectionsConnectionDataSource_basic(t *testing.T) { } func TestAccCodeStarConnectionsConnectionDataSource_tags(t *testing.T) { + ctx := acctest.Context(t) rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) dataSourceName := "data.aws_codestarconnections_connection.test" resourceName := "aws_codestarconnections_connection.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(codestarconnections.EndpointsID, t) }, + PreCheck: func() { + acctest.PreCheck(ctx, t) + acctest.PreCheckPartitionHasService(codestarconnections.EndpointsID, t) + }, ErrorCheck: acctest.ErrorCheck(t, codestarconnections.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ diff --git a/internal/service/codestarconnections/connection_test.go b/internal/service/codestarconnections/connection_test.go index efda863ce9d2..efbd5ec1c434 100644 --- a/internal/service/codestarconnections/connection_test.go +++ b/internal/service/codestarconnections/connection_test.go @@ -24,7 +24,10 @@ func TestAccCodeStarConnectionsConnection_basic(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(codestarconnections.EndpointsID, t) }, + PreCheck: func() { + acctest.PreCheck(ctx, t) + acctest.PreCheckPartitionHasService(codestarconnections.EndpointsID, t) + }, ErrorCheck: acctest.ErrorCheck(t, codestarconnections.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckConnectionDestroy(ctx), @@ -56,7 +59,10 @@ func TestAccCodeStarConnectionsConnection_hostARN(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(codestarconnections.EndpointsID, t) }, + PreCheck: func() { + acctest.PreCheck(ctx, t) + acctest.PreCheckPartitionHasService(codestarconnections.EndpointsID, t) + }, ErrorCheck: acctest.ErrorCheck(t, codestarconnections.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckConnectionDestroy(ctx), @@ -89,7 +95,10 @@ func TestAccCodeStarConnectionsConnection_disappears(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(codestarconnections.EndpointsID, t) }, + PreCheck: func() { + acctest.PreCheck(ctx, t) + acctest.PreCheckPartitionHasService(codestarconnections.EndpointsID, t) + }, ErrorCheck: acctest.ErrorCheck(t, codestarconnections.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckConnectionDestroy(ctx), @@ -113,7 +122,10 @@ func TestAccCodeStarConnectionsConnection_tags(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(codestarconnections.EndpointsID, t) }, + PreCheck: func() { + acctest.PreCheck(ctx, t) + acctest.PreCheckPartitionHasService(codestarconnections.EndpointsID, t) + }, ErrorCheck: acctest.ErrorCheck(t, codestarconnections.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckConnectionDestroy(ctx), diff --git a/internal/service/codestarconnections/host_test.go b/internal/service/codestarconnections/host_test.go index 838a8cf5e1c6..91305c87fea5 100644 --- a/internal/service/codestarconnections/host_test.go +++ b/internal/service/codestarconnections/host_test.go @@ -24,7 +24,10 @@ func TestAccCodeStarConnectionsHost_basic(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(codestarconnections.EndpointsID, t) }, + PreCheck: func() { + acctest.PreCheck(ctx, t) + acctest.PreCheckPartitionHasService(codestarconnections.EndpointsID, t) + }, ErrorCheck: acctest.ErrorCheck(t, codestarconnections.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckHostDestroy(ctx), @@ -56,7 +59,10 @@ func TestAccCodeStarConnectionsHost_disappears(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(codestarconnections.EndpointsID, t) }, + PreCheck: func() { + acctest.PreCheck(ctx, t) + acctest.PreCheckPartitionHasService(codestarconnections.EndpointsID, t) + }, ErrorCheck: acctest.ErrorCheck(t, codestarconnections.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckHostDestroy(ctx), @@ -80,7 +86,10 @@ func TestAccCodeStarConnectionsHost_vpc(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(codestarconnections.EndpointsID, t) }, + PreCheck: func() { + acctest.PreCheck(ctx, t) + acctest.PreCheckPartitionHasService(codestarconnections.EndpointsID, t) + }, ErrorCheck: acctest.ErrorCheck(t, codestarconnections.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckHostDestroy(ctx), From 86c6490506d512a8de5e578b5a198c97b27ab840 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Fri, 24 Feb 2023 17:01:56 -0500 Subject: [PATCH 278/763] Add 'ctx := acctest.Context(t)' for connect. --- internal/service/connect/bot_association_data_source_test.go | 1 + internal/service/connect/contact_flow_data_source_test.go | 2 ++ .../service/connect/contact_flow_module_data_source_test.go | 2 ++ .../service/connect/hours_of_operation_data_source_test.go | 2 ++ internal/service/connect/instance_data_source_test.go | 1 + .../connect/instance_storage_config_data_source_test.go | 4 ++++ .../connect/lambda_function_association_data_source_test.go | 1 + internal/service/connect/prompt_data_source_test.go | 1 + internal/service/connect/queue_data_source_test.go | 2 ++ internal/service/connect/quick_connect_data_source_test.go | 2 ++ internal/service/connect/routing_profile_data_source_test.go | 2 ++ internal/service/connect/security_profile_data_source_test.go | 2 ++ .../service/connect/user_hierarchy_group_data_source_test.go | 2 ++ .../connect/user_hierarchy_structure_data_source_test.go | 1 + 14 files changed, 25 insertions(+) diff --git a/internal/service/connect/bot_association_data_source_test.go b/internal/service/connect/bot_association_data_source_test.go index 407f6621122a..9df9450f87d1 100644 --- a/internal/service/connect/bot_association_data_source_test.go +++ b/internal/service/connect/bot_association_data_source_test.go @@ -11,6 +11,7 @@ import ( ) func testAccBotAssociationDataSource_basic(t *testing.T) { + ctx := acctest.Context(t) rName := sdkacctest.RandStringFromCharSet(8, sdkacctest.CharSetAlpha) rName2 := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resourceName := "aws_connect_bot_association.test" diff --git a/internal/service/connect/contact_flow_data_source_test.go b/internal/service/connect/contact_flow_data_source_test.go index e72e4d6cc603..b9cf8e10cb05 100644 --- a/internal/service/connect/contact_flow_data_source_test.go +++ b/internal/service/connect/contact_flow_data_source_test.go @@ -11,6 +11,7 @@ import ( ) func testAccContactFlowDataSource_contactFlowID(t *testing.T) { + ctx := acctest.Context(t) rName := sdkacctest.RandomWithPrefix("resource-test-terraform") resourceName := "aws_connect_contact_flow.test" datasourceName := "data.aws_connect_contact_flow.test" @@ -39,6 +40,7 @@ func testAccContactFlowDataSource_contactFlowID(t *testing.T) { } func testAccContactFlowDataSource_name(t *testing.T) { + ctx := acctest.Context(t) rName := sdkacctest.RandomWithPrefix("resource-test-terraform") rName2 := sdkacctest.RandomWithPrefix("resource-test-terraform") resourceName := "aws_connect_contact_flow.test" 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 1cafc4a67c95..e4c4e03754d0 100644 --- a/internal/service/connect/contact_flow_module_data_source_test.go +++ b/internal/service/connect/contact_flow_module_data_source_test.go @@ -11,6 +11,7 @@ import ( ) func testAccContactFlowModuleDataSource_contactFlowModuleID(t *testing.T) { + ctx := acctest.Context(t) rName := sdkacctest.RandomWithPrefix("resource-test-terraform") resourceName := "aws_connect_contact_flow_module.test" datasourceName := "data.aws_connect_contact_flow_module.test" @@ -40,6 +41,7 @@ func testAccContactFlowModuleDataSource_contactFlowModuleID(t *testing.T) { } func testAccContactFlowModuleDataSource_name(t *testing.T) { + ctx := acctest.Context(t) rName := sdkacctest.RandomWithPrefix("resource-test-terraform") rName2 := sdkacctest.RandomWithPrefix("resource-test-terraform") resourceName := "aws_connect_contact_flow_module.test" 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 988dbdb4dc75..678d2b394047 100644 --- a/internal/service/connect/hours_of_operation_data_source_test.go +++ b/internal/service/connect/hours_of_operation_data_source_test.go @@ -11,6 +11,7 @@ import ( ) func testAccHoursOfOperationDataSource_hoursOfOperationID(t *testing.T) { + ctx := acctest.Context(t) rName := sdkacctest.RandomWithPrefix("resource-test-terraform") resourceName := "aws_connect_hours_of_operation.test" datasourceName := "data.aws_connect_hours_of_operation.test" @@ -39,6 +40,7 @@ func testAccHoursOfOperationDataSource_hoursOfOperationID(t *testing.T) { } func testAccHoursOfOperationDataSource_name(t *testing.T) { + ctx := acctest.Context(t) rName := sdkacctest.RandomWithPrefix("resource-test-terraform") rName2 := sdkacctest.RandomWithPrefix("resource-test-terraform") resourceName := "aws_connect_hours_of_operation.test" diff --git a/internal/service/connect/instance_data_source_test.go b/internal/service/connect/instance_data_source_test.go index ec4f80d5d6f3..698305ae1eea 100644 --- a/internal/service/connect/instance_data_source_test.go +++ b/internal/service/connect/instance_data_source_test.go @@ -12,6 +12,7 @@ import ( ) func testAccInstanceDataSource_basic(t *testing.T) { + ctx := acctest.Context(t) rName := sdkacctest.RandomWithPrefix("datasource-test-terraform") dataSourceName := "data.aws_connect_instance.test" resourceName := "aws_connect_instance.test" 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 f18262e37dd9..87bd4fb0cff6 100644 --- a/internal/service/connect/instance_storage_config_data_source_test.go +++ b/internal/service/connect/instance_storage_config_data_source_test.go @@ -11,6 +11,7 @@ import ( ) func testAccInstanceStorageConfigDataSource_KinesisFirehoseConfig(t *testing.T) { + ctx := acctest.Context(t) rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resourceName := "aws_connect_instance_storage_config.test" datasourceName := "data.aws_connect_instance_storage_config.test" @@ -37,6 +38,7 @@ func testAccInstanceStorageConfigDataSource_KinesisFirehoseConfig(t *testing.T) } func testAccInstanceStorageConfigDataSource_KinesisStreamConfig(t *testing.T) { + ctx := acctest.Context(t) rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) rName2 := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resourceName := "aws_connect_instance_storage_config.test" @@ -64,6 +66,7 @@ func testAccInstanceStorageConfigDataSource_KinesisStreamConfig(t *testing.T) { } func testAccInstanceStorageConfigDataSource_KinesisVideoStreamConfig(t *testing.T) { + ctx := acctest.Context(t) rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resourceName := "aws_connect_instance_storage_config.test" datasourceName := "data.aws_connect_instance_storage_config.test" @@ -94,6 +97,7 @@ func testAccInstanceStorageConfigDataSource_KinesisVideoStreamConfig(t *testing. } func testAccInstanceStorageConfigDataSource_S3Config(t *testing.T) { + ctx := acctest.Context(t) rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) rName2 := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resourceName := "aws_connect_instance_storage_config.test" 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 e8a0789635f6..418fbc8e8274 100644 --- a/internal/service/connect/lambda_function_association_data_source_test.go +++ b/internal/service/connect/lambda_function_association_data_source_test.go @@ -11,6 +11,7 @@ import ( ) func testAccLambdaFunctionAssociationDataSource_basic(t *testing.T) { + ctx := acctest.Context(t) rName := sdkacctest.RandStringFromCharSet(8, sdkacctest.CharSetAlpha) rName2 := sdkacctest.RandomWithPrefix("resource-test-terraform") resourceName := "aws_connect_lambda_function_association.test" diff --git a/internal/service/connect/prompt_data_source_test.go b/internal/service/connect/prompt_data_source_test.go index ca345c36a169..0da58c36b21a 100644 --- a/internal/service/connect/prompt_data_source_test.go +++ b/internal/service/connect/prompt_data_source_test.go @@ -11,6 +11,7 @@ import ( ) func testAccPromptDataSource_name(t *testing.T) { + ctx := acctest.Context(t) rName := sdkacctest.RandomWithPrefix("resource-test-terraform") datasourceName := "data.aws_connect_prompt.test" diff --git a/internal/service/connect/queue_data_source_test.go b/internal/service/connect/queue_data_source_test.go index effc9f66089f..318bdda5ef84 100644 --- a/internal/service/connect/queue_data_source_test.go +++ b/internal/service/connect/queue_data_source_test.go @@ -11,6 +11,7 @@ import ( ) func testAccQueueDataSource_queueID(t *testing.T) { + ctx := acctest.Context(t) rName := sdkacctest.RandomWithPrefix("resource-test-terraform") rName2 := sdkacctest.RandomWithPrefix("resource-test-terraform") resourceName := "aws_connect_queue.test" @@ -43,6 +44,7 @@ func testAccQueueDataSource_queueID(t *testing.T) { } func testAccQueueDataSource_name(t *testing.T) { + ctx := acctest.Context(t) rName := sdkacctest.RandomWithPrefix("resource-test-terraform") rName2 := sdkacctest.RandomWithPrefix("resource-test-terraform") resourceName := "aws_connect_queue.test" diff --git a/internal/service/connect/quick_connect_data_source_test.go b/internal/service/connect/quick_connect_data_source_test.go index 9c29f2ed8892..0fe0c585f3bc 100644 --- a/internal/service/connect/quick_connect_data_source_test.go +++ b/internal/service/connect/quick_connect_data_source_test.go @@ -11,6 +11,7 @@ import ( ) func testAccQuickConnectDataSource_id(t *testing.T) { + ctx := acctest.Context(t) rName := sdkacctest.RandomWithPrefix("resource-test-terraform") rName2 := sdkacctest.RandomWithPrefix("resource-test-terraform") resourceName := "aws_connect_quick_connect.test" @@ -42,6 +43,7 @@ func testAccQuickConnectDataSource_id(t *testing.T) { } func testAccQuickConnectDataSource_name(t *testing.T) { + ctx := acctest.Context(t) rName := sdkacctest.RandomWithPrefix("resource-test-terraform") rName2 := sdkacctest.RandomWithPrefix("resource-test-terraform") resourceName := "aws_connect_quick_connect.test" diff --git a/internal/service/connect/routing_profile_data_source_test.go b/internal/service/connect/routing_profile_data_source_test.go index a19f5178f252..acab8cc4fbd2 100644 --- a/internal/service/connect/routing_profile_data_source_test.go +++ b/internal/service/connect/routing_profile_data_source_test.go @@ -11,6 +11,7 @@ import ( ) func testAccRoutingProfileDataSource_routingProfileID(t *testing.T) { + ctx := acctest.Context(t) rName := sdkacctest.RandomWithPrefix("resource-test-terraform") rName2 := sdkacctest.RandomWithPrefix("resource-test-terraform") rName3 := sdkacctest.RandomWithPrefix("resource-test-terraform") @@ -63,6 +64,7 @@ func testAccRoutingProfileDataSource_routingProfileID(t *testing.T) { } func testAccRoutingProfileDataSource_name(t *testing.T) { + ctx := acctest.Context(t) rName := sdkacctest.RandomWithPrefix("resource-test-terraform") rName2 := sdkacctest.RandomWithPrefix("resource-test-terraform") rName3 := sdkacctest.RandomWithPrefix("resource-test-terraform") diff --git a/internal/service/connect/security_profile_data_source_test.go b/internal/service/connect/security_profile_data_source_test.go index 4ebfcb61e6e2..320d62aa9c44 100644 --- a/internal/service/connect/security_profile_data_source_test.go +++ b/internal/service/connect/security_profile_data_source_test.go @@ -11,6 +11,7 @@ import ( ) func testAccSecurityProfileDataSource_securityProfileID(t *testing.T) { + ctx := acctest.Context(t) rName := sdkacctest.RandomWithPrefix("resource-test-terraform") rName2 := sdkacctest.RandomWithPrefix("resource-test-terraform") resourceName := "aws_connect_security_profile.test" @@ -39,6 +40,7 @@ func testAccSecurityProfileDataSource_securityProfileID(t *testing.T) { } func testAccSecurityProfileDataSource_name(t *testing.T) { + ctx := acctest.Context(t) rName := sdkacctest.RandomWithPrefix("resource-test-terraform") rName2 := sdkacctest.RandomWithPrefix("resource-test-terraform") resourceName := "aws_connect_security_profile.test" 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 2c0371511120..c46c37209409 100644 --- a/internal/service/connect/user_hierarchy_group_data_source_test.go +++ b/internal/service/connect/user_hierarchy_group_data_source_test.go @@ -11,6 +11,7 @@ import ( ) func testAccUserHierarchyGroupDataSource_hierarchyGroupID(t *testing.T) { + ctx := acctest.Context(t) rName := sdkacctest.RandomWithPrefix("resource-test-terraform") rName2 := sdkacctest.RandomWithPrefix("resource-test-terraform") rName3 := sdkacctest.RandomWithPrefix("resource-test-terraform") @@ -47,6 +48,7 @@ func testAccUserHierarchyGroupDataSource_hierarchyGroupID(t *testing.T) { } func testAccUserHierarchyGroupDataSource_name(t *testing.T) { + ctx := acctest.Context(t) rName := sdkacctest.RandomWithPrefix("resource-test-terraform") rName2 := sdkacctest.RandomWithPrefix("resource-test-terraform") rName3 := sdkacctest.RandomWithPrefix("resource-test-terraform") 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 eb74b7b1863c..b14d43500245 100644 --- a/internal/service/connect/user_hierarchy_structure_data_source_test.go +++ b/internal/service/connect/user_hierarchy_structure_data_source_test.go @@ -11,6 +11,7 @@ import ( ) func testAccUserHierarchyStructureDataSource_instanceID(t *testing.T) { + ctx := acctest.Context(t) rName := sdkacctest.RandomWithPrefix("resource-test-terraform") resourceName := "aws_connect_user_hierarchy_structure.test" datasourceName := "data.aws_connect_user_hierarchy_structure.test" From 91b550ee01cc60001a90d49a9c4441e84fda8764 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Fri, 24 Feb 2023 17:01:57 -0500 Subject: [PATCH 279/763] Add 'ctx := acctest.Context(t)' for directconnect. --- internal/service/directconnect/connection_data_source_test.go | 1 + internal/service/directconnect/gateway_data_source_test.go | 1 + internal/service/directconnect/location_data_source_test.go | 1 + internal/service/directconnect/macsec_key_test.go | 2 ++ .../directconnect/router_configuration_data_source_test.go | 1 + 5 files changed, 6 insertions(+) diff --git a/internal/service/directconnect/connection_data_source_test.go b/internal/service/directconnect/connection_data_source_test.go index c20f35dfd647..1ae6572cad2b 100644 --- a/internal/service/directconnect/connection_data_source_test.go +++ b/internal/service/directconnect/connection_data_source_test.go @@ -11,6 +11,7 @@ import ( ) func TestAccDirectConnectConnectionDataSource_basic(t *testing.T) { + ctx := acctest.Context(t) rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resourceName := "aws_dx_connection.test" datasourceName := "data.aws_dx_connection.test" diff --git a/internal/service/directconnect/gateway_data_source_test.go b/internal/service/directconnect/gateway_data_source_test.go index bb4c51b93deb..888fa15f1e0e 100644 --- a/internal/service/directconnect/gateway_data_source_test.go +++ b/internal/service/directconnect/gateway_data_source_test.go @@ -12,6 +12,7 @@ import ( ) func TestAccDirectConnectGatewayDataSource_basic(t *testing.T) { + ctx := acctest.Context(t) rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resourceName := "aws_dx_gateway.test" datasourceName := "data.aws_dx_gateway.test" diff --git a/internal/service/directconnect/location_data_source_test.go b/internal/service/directconnect/location_data_source_test.go index e7f6f1cdb870..52fc8926ee6b 100644 --- a/internal/service/directconnect/location_data_source_test.go +++ b/internal/service/directconnect/location_data_source_test.go @@ -9,6 +9,7 @@ import ( ) func TestAccDirectConnectLocationDataSource_basic(t *testing.T) { + ctx := acctest.Context(t) dsResourceName := "data.aws_dx_location.test" resource.ParallelTest(t, resource.TestCase{ diff --git a/internal/service/directconnect/macsec_key_test.go b/internal/service/directconnect/macsec_key_test.go index f2af8b36ef93..332f771183ce 100644 --- a/internal/service/directconnect/macsec_key_test.go +++ b/internal/service/directconnect/macsec_key_test.go @@ -14,6 +14,7 @@ import ( ) func TestAccDirectConnectMacSecKey_withCkn(t *testing.T) { + ctx := acctest.Context(t) // Requires an existing MACsec-capable DX connection set as environmental variable key := "DX_CONNECTION_ID" connectionId := os.Getenv(key) @@ -49,6 +50,7 @@ func TestAccDirectConnectMacSecKey_withCkn(t *testing.T) { } func TestAccDirectConnectMacSecKey_withSecret(t *testing.T) { + ctx := acctest.Context(t) // Requires an existing MACsec-capable DX connection set as environmental variable dxKey := "DX_CONNECTION_ID" connectionId := os.Getenv(dxKey) diff --git a/internal/service/directconnect/router_configuration_data_source_test.go b/internal/service/directconnect/router_configuration_data_source_test.go index ab88b9a4a2dc..81465a52dc66 100644 --- a/internal/service/directconnect/router_configuration_data_source_test.go +++ b/internal/service/directconnect/router_configuration_data_source_test.go @@ -11,6 +11,7 @@ import ( ) func TestAccDirectConnectRouterConfigurationDataSource_basic(t *testing.T) { + ctx := acctest.Context(t) key := "VIRTUAL_INTERFACE_ID" virtualInterfaceId := os.Getenv(key) if virtualInterfaceId == "" { From a8eddb3ff4a5c76b4570833a67bd74cc6fdc628d Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Fri, 24 Feb 2023 17:01:58 -0500 Subject: [PATCH 280/763] Add 'ctx := acctest.Context(t)' for ds. --- internal/service/ds/directory_data_source_test.go | 1 + 1 file changed, 1 insertion(+) diff --git a/internal/service/ds/directory_data_source_test.go b/internal/service/ds/directory_data_source_test.go index 9bf5eca4ace1..2f3101acc17c 100644 --- a/internal/service/ds/directory_data_source_test.go +++ b/internal/service/ds/directory_data_source_test.go @@ -52,6 +52,7 @@ func TestAccDSDirectoryDataSource_simpleAD(t *testing.T) { } func TestAccDSDirectoryDataSource_microsoftAD(t *testing.T) { + ctx := acctest.Context(t) alias := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resourceName := "aws_directory_service_directory.test" dataSourceName := "data.aws_directory_service_directory.test" From 04ff1879cfd8ec05eef6b109b795b64b47a05c58 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Fri, 24 Feb 2023 17:01:58 -0500 Subject: [PATCH 281/763] Add 'ctx := acctest.Context(t)' for dynamodb. --- internal/service/dynamodb/table_data_source_test.go | 1 + internal/service/dynamodb/table_item_data_source_test.go | 3 +++ 2 files changed, 4 insertions(+) diff --git a/internal/service/dynamodb/table_data_source_test.go b/internal/service/dynamodb/table_data_source_test.go index ce9adf059557..a73a6e6d281c 100644 --- a/internal/service/dynamodb/table_data_source_test.go +++ b/internal/service/dynamodb/table_data_source_test.go @@ -12,6 +12,7 @@ import ( ) func TestAccDynamoDBTableDataSource_basic(t *testing.T) { + ctx := acctest.Context(t) datasourceName := "data.aws_dynamodb_table.test" resourceName := "aws_dynamodb_table.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) diff --git a/internal/service/dynamodb/table_item_data_source_test.go b/internal/service/dynamodb/table_item_data_source_test.go index e20754d784ef..4669e3e57646 100644 --- a/internal/service/dynamodb/table_item_data_source_test.go +++ b/internal/service/dynamodb/table_item_data_source_test.go @@ -11,6 +11,7 @@ import ( ) func TestAccDynamoDBTableItemDataSource_basic(t *testing.T) { + ctx := acctest.Context(t) rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) dataSourceName := "data.aws_dynamodb_table_item.test" hashKey := "hashKey" @@ -44,6 +45,7 @@ func TestAccDynamoDBTableItemDataSource_basic(t *testing.T) { } func TestAccDynamoDBTableItemDataSource_projectionExpression(t *testing.T) { + ctx := acctest.Context(t) rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) dataSourceName := "data.aws_dynamodb_table_item.test" hashKey := "hashKey" @@ -85,6 +87,7 @@ func TestAccDynamoDBTableItemDataSource_projectionExpression(t *testing.T) { } func TestAccDynamoDBTableItemDataSource_expressionAttributeNames(t *testing.T) { + ctx := acctest.Context(t) rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) dataSourceName := "data.aws_dynamodb_table_item.test" hashKey := "hashKey" From 550da78b2b6867050686b8509684d5ebad09c569 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Fri, 24 Feb 2023 17:01:58 -0500 Subject: [PATCH 282/763] Add 'ctx := acctest.Context(t)' for ec2. --- .../ec2/ebs_snapshot_data_source_test.go | 3 ++ .../ec2/ebs_snapshot_ids_data_source_test.go | 3 ++ .../ec2/ebs_volume_data_source_test.go | 2 ++ .../service/ec2/ec2_ami_data_source_test.go | 5 ++++ .../ec2/ec2_ami_ids_data_source_test.go | 2 ++ .../ec2_availability_zone_data_source_test.go | 4 +++ .../ec2/ec2_availability_zone_group_test.go | 1 + ...ec2_availability_zones_data_source_test.go | 6 ++++ .../service/ec2/ec2_eip_data_source_test.go | 6 ++++ .../service/ec2/ec2_eips_data_source_test.go | 1 + .../service/ec2/ec2_host_data_source_test.go | 2 ++ .../ec2/ec2_instance_data_source_test.go | 28 +++++++++++++++++++ .../ec2/ec2_instance_type_data_source_test.go | 4 +++ .../ec2/ec2_instances_data_source_test.go | 5 ++++ .../ec2/ec2_key_pair_data_source_test.go | 2 ++ .../ec2/ipam_pool_cidrs_data_source_test.go | 1 + .../service/ec2/ipam_pool_data_source_test.go | 1 + .../ec2/ipam_pools_data_source_test.go | 2 ++ ...ipam_preview_next_cidr_data_source_test.go | 3 ++ .../ec2/ipam_preview_next_cidr_test.go | 3 ++ internal/service/ec2/vpc_data_source_test.go | 1 + .../ec2/vpc_dhcp_options_data_source_test.go | 2 ++ .../ec2/vpc_endpoint_data_source_test.go | 6 ++++ .../vpc_endpoint_service_data_source_test.go | 7 +++++ .../vpc_internet_gateway_data_source_test.go | 1 + ...c_managed_prefix_lists_data_source_test.go | 3 ++ .../ec2/vpc_nat_gateway_data_source_test.go | 1 + .../ec2/vpc_nat_gateways_data_source_test.go | 1 + ...work_insights_analysis_data_source_test.go | 1 + ..._network_insights_path_data_source_test.go | 1 + .../vpc_network_interface_data_source_test.go | 4 +++ ...vpc_peering_connection_data_source_test.go | 5 ++++ ...pc_peering_connections_data_source_test.go | 2 ++ .../ec2/vpc_prefix_list_data_source_test.go | 3 ++ .../service/ec2/vpc_route_data_source_test.go | 1 + .../ec2/vpc_route_table_data_source_test.go | 2 ++ .../vpc_security_group_data_source_test.go | 1 + ...pc_security_group_rule_data_source_test.go | 2 ++ ...c_security_group_rules_data_source_test.go | 2 ++ .../vpc_security_groups_data_source_test.go | 3 ++ .../ec2/vpc_subnet_data_source_test.go | 2 ++ internal/service/ec2/vpc_subnet_test.go | 1 + .../ec2/vpc_subnets_data_source_test.go | 2 ++ internal/service/ec2/vpc_test.go | 2 ++ .../service/ec2/vpc_vpcs_data_source_test.go | 4 +++ .../ec2/vpnsite_gateway_data_source_test.go | 2 ++ 46 files changed, 146 insertions(+) diff --git a/internal/service/ec2/ebs_snapshot_data_source_test.go b/internal/service/ec2/ebs_snapshot_data_source_test.go index a3929a600d0e..a0899e0a199e 100644 --- a/internal/service/ec2/ebs_snapshot_data_source_test.go +++ b/internal/service/ec2/ebs_snapshot_data_source_test.go @@ -11,6 +11,7 @@ import ( ) func TestAccEC2EBSSnapshotDataSource_basic(t *testing.T) { + ctx := acctest.Context(t) dataSourceName := "data.aws_ebs_snapshot.test" resourceName := "aws_ebs_snapshot.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) @@ -41,6 +42,7 @@ func TestAccEC2EBSSnapshotDataSource_basic(t *testing.T) { } func TestAccEC2EBSSnapshotDataSource_filter(t *testing.T) { + ctx := acctest.Context(t) dataSourceName := "data.aws_ebs_snapshot.test" resourceName := "aws_ebs_snapshot.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) @@ -61,6 +63,7 @@ func TestAccEC2EBSSnapshotDataSource_filter(t *testing.T) { } func TestAccEC2EBSSnapshotDataSource_mostRecent(t *testing.T) { + ctx := acctest.Context(t) dataSourceName := "data.aws_ebs_snapshot.test" resourceName := "aws_ebs_snapshot.b" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) 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 8dd3eb2c9bca..3c78ccd611f2 100644 --- a/internal/service/ec2/ebs_snapshot_ids_data_source_test.go +++ b/internal/service/ec2/ebs_snapshot_ids_data_source_test.go @@ -11,6 +11,7 @@ import ( ) func TestAccEC2EBSSnapshotIDsDataSource_basic(t *testing.T) { + ctx := acctest.Context(t) dataSourceName := "data.aws_ebs_snapshot_ids.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) @@ -31,6 +32,7 @@ func TestAccEC2EBSSnapshotIDsDataSource_basic(t *testing.T) { } func TestAccEC2EBSSnapshotIDsDataSource_sorted(t *testing.T) { + ctx := acctest.Context(t) dataSourceName := "data.aws_ebs_snapshot_ids.test" resource1Name := "aws_ebs_snapshot.a" resource2Name := "aws_ebs_snapshot.b" @@ -54,6 +56,7 @@ func TestAccEC2EBSSnapshotIDsDataSource_sorted(t *testing.T) { } func TestAccEC2EBSSnapshotIDsDataSource_empty(t *testing.T) { + ctx := acctest.Context(t) resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), diff --git a/internal/service/ec2/ebs_volume_data_source_test.go b/internal/service/ec2/ebs_volume_data_source_test.go index ba9376d83cbd..551fafe714c9 100644 --- a/internal/service/ec2/ebs_volume_data_source_test.go +++ b/internal/service/ec2/ebs_volume_data_source_test.go @@ -12,6 +12,7 @@ import ( ) func TestAccEC2EBSVolumeDataSource_basic(t *testing.T) { + ctx := acctest.Context(t) resourceName := "aws_ebs_volume.test" dataSourceName := "data.aws_ebs_volume.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) @@ -38,6 +39,7 @@ func TestAccEC2EBSVolumeDataSource_basic(t *testing.T) { } func TestAccEC2EBSVolumeDataSource_multipleFilters(t *testing.T) { + ctx := acctest.Context(t) resourceName := "aws_ebs_volume.test" dataSourceName := "data.aws_ebs_volume.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) diff --git a/internal/service/ec2/ec2_ami_data_source_test.go b/internal/service/ec2/ec2_ami_data_source_test.go index 2722da4aa489..b43b27039642 100644 --- a/internal/service/ec2/ec2_ami_data_source_test.go +++ b/internal/service/ec2/ec2_ami_data_source_test.go @@ -11,6 +11,7 @@ import ( ) func TestAccEC2AMIDataSource_natInstance(t *testing.T) { + ctx := acctest.Context(t) datasourceName := "data.aws_ami.test" resource.ParallelTest(t, resource.TestCase{ @@ -64,6 +65,7 @@ func TestAccEC2AMIDataSource_natInstance(t *testing.T) { } func TestAccEC2AMIDataSource_windowsInstance(t *testing.T) { + ctx := acctest.Context(t) datasourceName := "data.aws_ami.test" resource.ParallelTest(t, resource.TestCase{ @@ -110,6 +112,7 @@ func TestAccEC2AMIDataSource_windowsInstance(t *testing.T) { } func TestAccEC2AMIDataSource_instanceStore(t *testing.T) { + ctx := acctest.Context(t) datasourceName := "data.aws_ami.test" resource.ParallelTest(t, resource.TestCase{ @@ -152,6 +155,7 @@ func TestAccEC2AMIDataSource_instanceStore(t *testing.T) { } func TestAccEC2AMIDataSource_localNameFilter(t *testing.T) { + ctx := acctest.Context(t) datasourceName := "data.aws_ami.test" resource.ParallelTest(t, resource.TestCase{ @@ -170,6 +174,7 @@ func TestAccEC2AMIDataSource_localNameFilter(t *testing.T) { } func TestAccEC2AMIDataSource_gp3BlockDevice(t *testing.T) { + ctx := acctest.Context(t) resourceName := "aws_ami.test" datasourceName := "data.aws_ami.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) 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 bf99cfd07ae5..936599aec7fb 100644 --- a/internal/service/ec2/ec2_ami_ids_data_source_test.go +++ b/internal/service/ec2/ec2_ami_ids_data_source_test.go @@ -10,6 +10,7 @@ import ( ) func TestAccEC2AMIIDsDataSource_basic(t *testing.T) { + ctx := acctest.Context(t) datasourceName := "data.aws_ami_ids.test" resource.ParallelTest(t, resource.TestCase{ @@ -28,6 +29,7 @@ func TestAccEC2AMIIDsDataSource_basic(t *testing.T) { } func TestAccEC2AMIIDsDataSource_sorted(t *testing.T) { + ctx := acctest.Context(t) datasourceName := "data.aws_ami_ids.test" resource.ParallelTest(t, resource.TestCase{ 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 854faefc91bd..63c59956bea7 100644 --- a/internal/service/ec2/ec2_availability_zone_data_source_test.go +++ b/internal/service/ec2/ec2_availability_zone_data_source_test.go @@ -14,6 +14,7 @@ import ( ) func TestAccEC2AvailabilityZoneDataSource_allAvailabilityZones(t *testing.T) { + ctx := acctest.Context(t) availabilityZonesDataSourceName := "data.aws_availability_zones.available" dataSourceName := "data.aws_availability_zone.test" @@ -42,6 +43,7 @@ func TestAccEC2AvailabilityZoneDataSource_allAvailabilityZones(t *testing.T) { } func TestAccEC2AvailabilityZoneDataSource_filter(t *testing.T) { + ctx := acctest.Context(t) availabilityZonesDataSourceName := "data.aws_availability_zones.available" dataSourceName := "data.aws_availability_zone.test" @@ -99,6 +101,7 @@ func TestAccEC2AvailabilityZoneDataSource_localZone(t *testing.T) { } func TestAccEC2AvailabilityZoneDataSource_name(t *testing.T) { + ctx := acctest.Context(t) availabilityZonesDataSourceName := "data.aws_availability_zones.available" dataSourceName := "data.aws_availability_zone.test" @@ -156,6 +159,7 @@ func TestAccEC2AvailabilityZoneDataSource_wavelengthZone(t *testing.T) { } func TestAccEC2AvailabilityZoneDataSource_zoneID(t *testing.T) { + ctx := acctest.Context(t) availabilityZonesDataSourceName := "data.aws_availability_zones.available" dataSourceName := "data.aws_availability_zone.test" diff --git a/internal/service/ec2/ec2_availability_zone_group_test.go b/internal/service/ec2/ec2_availability_zone_group_test.go index 0034982e6eec..b440433cd9ca 100644 --- a/internal/service/ec2/ec2_availability_zone_group_test.go +++ b/internal/service/ec2/ec2_availability_zone_group_test.go @@ -11,6 +11,7 @@ import ( ) func TestAccEC2AvailabilityZoneGroup_optInStatus(t *testing.T) { + ctx := acctest.Context(t) resourceName := "aws_ec2_availability_zone_group.test" // Filter to one Availability Zone Group per Region as Local Zones become available 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 2b98d9d43ec9..42efc3354ab9 100644 --- a/internal/service/ec2/ec2_availability_zones_data_source_test.go +++ b/internal/service/ec2/ec2_availability_zones_data_source_test.go @@ -77,6 +77,7 @@ func TestAvailabilityZonesSort(t *testing.T) { } func TestAccEC2AvailabilityZonesDataSource_basic(t *testing.T) { + ctx := acctest.Context(t) resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), @@ -93,6 +94,7 @@ func TestAccEC2AvailabilityZonesDataSource_basic(t *testing.T) { } func TestAccEC2AvailabilityZonesDataSource_allAvailabilityZones(t *testing.T) { + ctx := acctest.Context(t) dataSourceName := "data.aws_availability_zones.test" resource.ParallelTest(t, resource.TestCase{ @@ -111,6 +113,7 @@ func TestAccEC2AvailabilityZonesDataSource_allAvailabilityZones(t *testing.T) { } func TestAccEC2AvailabilityZonesDataSource_filter(t *testing.T) { + ctx := acctest.Context(t) dataSourceName := "data.aws_availability_zones.test" resource.ParallelTest(t, resource.TestCase{ @@ -129,6 +132,7 @@ func TestAccEC2AvailabilityZonesDataSource_filter(t *testing.T) { } func TestAccEC2AvailabilityZonesDataSource_excludeNames(t *testing.T) { + ctx := acctest.Context(t) allDataSourceName := "data.aws_availability_zones.all" excludeDataSourceName := "data.aws_availability_zones.test" @@ -148,6 +152,7 @@ func TestAccEC2AvailabilityZonesDataSource_excludeNames(t *testing.T) { } func TestAccEC2AvailabilityZonesDataSource_excludeZoneIDs(t *testing.T) { + ctx := acctest.Context(t) allDataSourceName := "data.aws_availability_zones.all" excludeDataSourceName := "data.aws_availability_zones.test" @@ -167,6 +172,7 @@ func TestAccEC2AvailabilityZonesDataSource_excludeZoneIDs(t *testing.T) { } func TestAccEC2AvailabilityZonesDataSource_stateFilter(t *testing.T) { + ctx := acctest.Context(t) resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), diff --git a/internal/service/ec2/ec2_eip_data_source_test.go b/internal/service/ec2/ec2_eip_data_source_test.go index fcbef36fb6a3..1bc0cde18b91 100644 --- a/internal/service/ec2/ec2_eip_data_source_test.go +++ b/internal/service/ec2/ec2_eip_data_source_test.go @@ -11,6 +11,7 @@ import ( ) func TestAccEC2EIPDataSource_filter(t *testing.T) { + ctx := acctest.Context(t) dataSourceName := "data.aws_eip.test" resourceName := "aws_eip.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) @@ -33,6 +34,7 @@ func TestAccEC2EIPDataSource_filter(t *testing.T) { } func TestAccEC2EIPDataSource_id(t *testing.T) { + ctx := acctest.Context(t) dataSourceName := "data.aws_eip.test" resourceName := "aws_eip.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) @@ -55,6 +57,7 @@ func TestAccEC2EIPDataSource_id(t *testing.T) { } func TestAccEC2EIPDataSource_publicIP(t *testing.T) { + ctx := acctest.Context(t) dataSourceName := "data.aws_eip.test" resourceName := "aws_eip.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) @@ -78,6 +81,7 @@ func TestAccEC2EIPDataSource_publicIP(t *testing.T) { } func TestAccEC2EIPDataSource_tags(t *testing.T) { + ctx := acctest.Context(t) dataSourceName := "data.aws_eip.test" resourceName := "aws_eip.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) @@ -100,6 +104,7 @@ func TestAccEC2EIPDataSource_tags(t *testing.T) { } func TestAccEC2EIPDataSource_networkInterface(t *testing.T) { + ctx := acctest.Context(t) dataSourceName := "data.aws_eip.test" resourceName := "aws_eip.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) @@ -124,6 +129,7 @@ func TestAccEC2EIPDataSource_networkInterface(t *testing.T) { } func TestAccEC2EIPDataSource_instance(t *testing.T) { + ctx := acctest.Context(t) dataSourceName := "data.aws_eip.test" resourceName := "aws_eip.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) diff --git a/internal/service/ec2/ec2_eips_data_source_test.go b/internal/service/ec2/ec2_eips_data_source_test.go index 4434296301e4..7afd1e756e25 100644 --- a/internal/service/ec2/ec2_eips_data_source_test.go +++ b/internal/service/ec2/ec2_eips_data_source_test.go @@ -11,6 +11,7 @@ import ( ) func TestAccEC2EIPsDataSource_basic(t *testing.T) { + ctx := acctest.Context(t) rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ diff --git a/internal/service/ec2/ec2_host_data_source_test.go b/internal/service/ec2/ec2_host_data_source_test.go index cfc703b3faa6..a7fc56a4fb01 100644 --- a/internal/service/ec2/ec2_host_data_source_test.go +++ b/internal/service/ec2/ec2_host_data_source_test.go @@ -11,6 +11,7 @@ import ( ) func TestAccEC2HostDataSource_basic(t *testing.T) { + ctx := acctest.Context(t) dataSourceName := "data.aws_ec2_host.test" resourceName := "aws_ec2_host.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) @@ -43,6 +44,7 @@ func TestAccEC2HostDataSource_basic(t *testing.T) { } func TestAccEC2HostDataSource_filter(t *testing.T) { + ctx := acctest.Context(t) dataSourceName := "data.aws_ec2_host.test" resourceName := "aws_ec2_host.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) diff --git a/internal/service/ec2/ec2_instance_data_source_test.go b/internal/service/ec2/ec2_instance_data_source_test.go index 5a1bbfe42488..970b89478bf3 100644 --- a/internal/service/ec2/ec2_instance_data_source_test.go +++ b/internal/service/ec2/ec2_instance_data_source_test.go @@ -11,6 +11,7 @@ import ( ) func TestAccEC2InstanceDataSource_basic(t *testing.T) { + ctx := acctest.Context(t) resourceName := "aws_instance.test" datasourceName := "data.aws_instance.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) @@ -36,6 +37,7 @@ func TestAccEC2InstanceDataSource_basic(t *testing.T) { } func TestAccEC2InstanceDataSource_tags(t *testing.T) { + ctx := acctest.Context(t) resourceName := "aws_instance.test" datasourceName := "data.aws_instance.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) @@ -58,6 +60,7 @@ func TestAccEC2InstanceDataSource_tags(t *testing.T) { } func TestAccEC2InstanceDataSource_azUserData(t *testing.T) { + ctx := acctest.Context(t) resourceName := "aws_instance.test" datasourceName := "data.aws_instance.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) @@ -82,6 +85,7 @@ func TestAccEC2InstanceDataSource_azUserData(t *testing.T) { } func TestAccEC2InstanceDataSource_gp2IopsDevice(t *testing.T) { + ctx := acctest.Context(t) resourceName := "aws_instance.test" datasourceName := "data.aws_instance.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) @@ -108,6 +112,7 @@ func TestAccEC2InstanceDataSource_gp2IopsDevice(t *testing.T) { } func TestAccEC2InstanceDataSource_gp3ThroughputDevice(t *testing.T) { + ctx := acctest.Context(t) resourceName := "aws_instance.test" datasourceName := "data.aws_instance.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) @@ -134,6 +139,7 @@ func TestAccEC2InstanceDataSource_gp3ThroughputDevice(t *testing.T) { } func TestAccEC2InstanceDataSource_blockDevices(t *testing.T) { + ctx := acctest.Context(t) resourceName := "aws_instance.test" datasourceName := "data.aws_instance.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) @@ -163,6 +169,7 @@ func TestAccEC2InstanceDataSource_blockDevices(t *testing.T) { // Test to verify that ebs_block_device kms_key_id does not elicit a panic func TestAccEC2InstanceDataSource_EBSBlockDevice_kmsKeyID(t *testing.T) { + ctx := acctest.Context(t) rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ @@ -179,6 +186,7 @@ func TestAccEC2InstanceDataSource_EBSBlockDevice_kmsKeyID(t *testing.T) { // Test to verify that root_block_device kms_key_id does not elicit a panic func TestAccEC2InstanceDataSource_RootBlockDevice_kmsKeyID(t *testing.T) { + ctx := acctest.Context(t) rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ @@ -194,6 +202,7 @@ func TestAccEC2InstanceDataSource_RootBlockDevice_kmsKeyID(t *testing.T) { } func TestAccEC2InstanceDataSource_rootInstanceStore(t *testing.T) { + ctx := acctest.Context(t) resourceName := "aws_instance.test" datasourceName := "data.aws_instance.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) @@ -218,6 +227,7 @@ func TestAccEC2InstanceDataSource_rootInstanceStore(t *testing.T) { } func TestAccEC2InstanceDataSource_privateIP(t *testing.T) { + ctx := acctest.Context(t) resourceName := "aws_instance.test" datasourceName := "data.aws_instance.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) @@ -244,6 +254,7 @@ func TestAccEC2InstanceDataSource_privateIP(t *testing.T) { } func TestAccEC2InstanceDataSource_secondaryPrivateIPs(t *testing.T) { + ctx := acctest.Context(t) resourceName := "aws_instance.test" datasourceName := "data.aws_instance.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) @@ -266,6 +277,7 @@ func TestAccEC2InstanceDataSource_secondaryPrivateIPs(t *testing.T) { } func TestAccEC2InstanceDataSource_ipv6Addresses(t *testing.T) { + ctx := acctest.Context(t) resourceName := "aws_instance.test" datasourceName := "data.aws_instance.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) @@ -288,6 +300,7 @@ func TestAccEC2InstanceDataSource_ipv6Addresses(t *testing.T) { } func TestAccEC2InstanceDataSource_keyPair(t *testing.T) { + ctx := acctest.Context(t) resourceName := "aws_instance.test" datasourceName := "data.aws_instance.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) @@ -316,6 +329,7 @@ func TestAccEC2InstanceDataSource_keyPair(t *testing.T) { } func TestAccEC2InstanceDataSource_vpc(t *testing.T) { + ctx := acctest.Context(t) resourceName := "aws_instance.test" datasourceName := "data.aws_instance.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) @@ -340,6 +354,7 @@ func TestAccEC2InstanceDataSource_vpc(t *testing.T) { } func TestAccEC2InstanceDataSource_placementGroup(t *testing.T) { + ctx := acctest.Context(t) resourceName := "aws_instance.test" datasourceName := "data.aws_instance.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) @@ -360,6 +375,7 @@ func TestAccEC2InstanceDataSource_placementGroup(t *testing.T) { } func TestAccEC2InstanceDataSource_securityGroups(t *testing.T) { + ctx := acctest.Context(t) resourceName := "aws_instance.test" datasourceName := "data.aws_instance.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) @@ -384,6 +400,7 @@ func TestAccEC2InstanceDataSource_securityGroups(t *testing.T) { } func TestAccEC2InstanceDataSource_vpcSecurityGroups(t *testing.T) { + ctx := acctest.Context(t) resourceName := "aws_instance.test" datasourceName := "data.aws_instance.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) @@ -407,6 +424,7 @@ func TestAccEC2InstanceDataSource_vpcSecurityGroups(t *testing.T) { } func TestAccEC2InstanceDataSource_GetPasswordData_trueToFalse(t *testing.T) { + ctx := acctest.Context(t) datasourceName := "data.aws_instance.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) @@ -439,6 +457,7 @@ func TestAccEC2InstanceDataSource_GetPasswordData_trueToFalse(t *testing.T) { } func TestAccEC2InstanceDataSource_GetPasswordData_falseToTrue(t *testing.T) { + ctx := acctest.Context(t) datasourceName := "data.aws_instance.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) @@ -471,6 +490,7 @@ func TestAccEC2InstanceDataSource_GetPasswordData_falseToTrue(t *testing.T) { } func TestAccEC2InstanceDataSource_getUserData(t *testing.T) { + ctx := acctest.Context(t) datasourceName := "data.aws_instance.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) @@ -505,6 +525,7 @@ func TestAccEC2InstanceDataSource_getUserData(t *testing.T) { } func TestAccEC2InstanceDataSource_GetUserData_noUserData(t *testing.T) { + ctx := acctest.Context(t) resourceName := "aws_instance.test" datasourceName := "data.aws_instance.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) @@ -543,6 +564,7 @@ func TestAccEC2InstanceDataSource_GetUserData_noUserData(t *testing.T) { } func TestAccEC2InstanceDataSource_autoRecovery(t *testing.T) { + ctx := acctest.Context(t) datasourceName := "data.aws_instance.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) @@ -570,6 +592,7 @@ func TestAccEC2InstanceDataSource_autoRecovery(t *testing.T) { } func TestAccEC2InstanceDataSource_creditSpecification(t *testing.T) { + ctx := acctest.Context(t) resourceName := "aws_instance.test" datasourceName := "data.aws_instance.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) @@ -593,6 +616,7 @@ func TestAccEC2InstanceDataSource_creditSpecification(t *testing.T) { } func TestAccEC2InstanceDataSource_metadataOptions(t *testing.T) { + ctx := acctest.Context(t) resourceName := "aws_instance.test" datasourceName := "data.aws_instance.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) @@ -617,6 +641,7 @@ func TestAccEC2InstanceDataSource_metadataOptions(t *testing.T) { } func TestAccEC2InstanceDataSource_enclaveOptions(t *testing.T) { + ctx := acctest.Context(t) resourceName := "aws_instance.test" datasourceName := "data.aws_instance.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) @@ -638,6 +663,7 @@ func TestAccEC2InstanceDataSource_enclaveOptions(t *testing.T) { } func TestAccEC2InstanceDataSource_blockDeviceTags(t *testing.T) { + ctx := acctest.Context(t) resourceName := "aws_instance.test" datasourceName := "data.aws_instance.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) @@ -658,6 +684,7 @@ func TestAccEC2InstanceDataSource_blockDeviceTags(t *testing.T) { } func TestAccEC2InstanceDataSource_disableAPIStopTermination(t *testing.T) { + ctx := acctest.Context(t) datasourceName := "data.aws_instance.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) @@ -685,6 +712,7 @@ func TestAccEC2InstanceDataSource_disableAPIStopTermination(t *testing.T) { } func TestAccEC2InstanceDataSource_timeout(t *testing.T) { + ctx := acctest.Context(t) resourceName := "aws_instance.test" datasourceName := "data.aws_instance.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) 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 7db0a363bdf2..ed6ba0f48a27 100644 --- a/internal/service/ec2/ec2_instance_type_data_source_test.go +++ b/internal/service/ec2/ec2_instance_type_data_source_test.go @@ -9,6 +9,7 @@ import ( ) func TestAccEC2InstanceTypeDataSource_basic(t *testing.T) { + ctx := acctest.Context(t) dataSourceName := "data.aws_ec2_instance_type.test" resource.ParallelTest(t, resource.TestCase{ @@ -70,6 +71,7 @@ func TestAccEC2InstanceTypeDataSource_basic(t *testing.T) { } func TestAccEC2InstanceTypeDataSource_metal(t *testing.T) { + ctx := acctest.Context(t) dataSourceName := "data.aws_ec2_instance_type.test" resource.ParallelTest(t, resource.TestCase{ @@ -98,6 +100,7 @@ func TestAccEC2InstanceTypeDataSource_metal(t *testing.T) { } func TestAccEC2InstanceTypeDataSource_gpu(t *testing.T) { + ctx := acctest.Context(t) dataSourceName := "data.aws_ec2_instance_type.test" resource.ParallelTest(t, resource.TestCase{ @@ -120,6 +123,7 @@ func TestAccEC2InstanceTypeDataSource_gpu(t *testing.T) { } func TestAccEC2InstanceTypeDataSource_fpga(t *testing.T) { + ctx := acctest.Context(t) dataSourceName := "data.aws_ec2_instance_type.test" resource.ParallelTest(t, resource.TestCase{ diff --git a/internal/service/ec2/ec2_instances_data_source_test.go b/internal/service/ec2/ec2_instances_data_source_test.go index 7827c499a709..ab98b433a1e2 100644 --- a/internal/service/ec2/ec2_instances_data_source_test.go +++ b/internal/service/ec2/ec2_instances_data_source_test.go @@ -11,6 +11,7 @@ import ( ) func TestAccEC2InstancesDataSource_basic(t *testing.T) { + ctx := acctest.Context(t) rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ @@ -32,6 +33,7 @@ func TestAccEC2InstancesDataSource_basic(t *testing.T) { } func TestAccEC2InstancesDataSource_tags(t *testing.T) { + ctx := acctest.Context(t) rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ @@ -50,6 +52,7 @@ func TestAccEC2InstancesDataSource_tags(t *testing.T) { } func TestAccEC2InstancesDataSource_instanceStateNames(t *testing.T) { + ctx := acctest.Context(t) rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ @@ -68,6 +71,7 @@ func TestAccEC2InstancesDataSource_instanceStateNames(t *testing.T) { } func TestAccEC2InstancesDataSource_empty(t *testing.T) { + ctx := acctest.Context(t) rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ @@ -88,6 +92,7 @@ func TestAccEC2InstancesDataSource_empty(t *testing.T) { } func TestAccEC2InstancesDataSource_timeout(t *testing.T) { + ctx := acctest.Context(t) rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ 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 7d7f775c1950..a5064f007e26 100644 --- a/internal/service/ec2/ec2_key_pair_data_source_test.go +++ b/internal/service/ec2/ec2_key_pair_data_source_test.go @@ -12,6 +12,7 @@ import ( ) func TestAccEC2KeyPairDataSource_basic(t *testing.T) { + ctx := acctest.Context(t) rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) dataSource1Name := "data.aws_key_pair.by_id" dataSource2Name := "data.aws_key_pair.by_name" @@ -55,6 +56,7 @@ func TestAccEC2KeyPairDataSource_basic(t *testing.T) { } func TestAccEC2KeyPairDataSource_includePublicKey(t *testing.T) { + ctx := acctest.Context(t) rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) dataSource1Name := "data.aws_key_pair.by_name" resourceName := "aws_key_pair.test" 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 7115d0ffaaf3..a4a9b10003d5 100644 --- a/internal/service/ec2/ipam_pool_cidrs_data_source_test.go +++ b/internal/service/ec2/ipam_pool_cidrs_data_source_test.go @@ -9,6 +9,7 @@ import ( ) func TestAccIPAMPoolCIDRsDataSource_basic(t *testing.T) { + ctx := acctest.Context(t) dataSourceName := "data.aws_vpc_ipam_pool_cidrs.test" resource.ParallelTest(t, resource.TestCase{ diff --git a/internal/service/ec2/ipam_pool_data_source_test.go b/internal/service/ec2/ipam_pool_data_source_test.go index f1728099a9c5..c89cffe210b9 100644 --- a/internal/service/ec2/ipam_pool_data_source_test.go +++ b/internal/service/ec2/ipam_pool_data_source_test.go @@ -9,6 +9,7 @@ import ( ) func TestAccIPAMPoolDataSource_basic(t *testing.T) { + ctx := acctest.Context(t) resourceName := "aws_vpc_ipam_pool.test" dataSourceName := "data.aws_vpc_ipam_pool.test" diff --git a/internal/service/ec2/ipam_pools_data_source_test.go b/internal/service/ec2/ipam_pools_data_source_test.go index b654e9d9034b..dae331374cf5 100644 --- a/internal/service/ec2/ipam_pools_data_source_test.go +++ b/internal/service/ec2/ipam_pools_data_source_test.go @@ -9,6 +9,7 @@ import ( ) func TestAccIPAMPoolsDataSource_basic(t *testing.T) { + ctx := acctest.Context(t) dataSourceName := "data.aws_vpc_ipam_pools.test" dataSourceNameTwo := "data.aws_vpc_ipam_pools.testtwo" resourceName := "aws_vpc_ipam_pool.testthree" @@ -55,6 +56,7 @@ func TestAccIPAMPoolsDataSource_basic(t *testing.T) { } func TestAccIPAMPoolsDataSource_empty(t *testing.T) { + ctx := acctest.Context(t) dataSourceName := "data.aws_vpc_ipam_pools.test" resource.ParallelTest(t, resource.TestCase{ 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 933967512ea0..b33d00423bc9 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 @@ -10,6 +10,7 @@ import ( ) func TestAccIPAMPreviewNextCIDRDataSource_ipv4Basic(t *testing.T) { + ctx := acctest.Context(t) datasourceName := "data.aws_vpc_ipam_preview_next_cidr.test" netmaskLength := "28" @@ -32,6 +33,7 @@ func TestAccIPAMPreviewNextCIDRDataSource_ipv4Basic(t *testing.T) { } func TestAccIPAMPreviewNextCIDRDataSource_ipv4Allocated(t *testing.T) { + ctx := acctest.Context(t) datasourceName := "data.aws_vpc_ipam_preview_next_cidr.test" netmaskLength := "28" allocatedCidr := "172.2.0.0/28" @@ -64,6 +66,7 @@ func TestAccIPAMPreviewNextCIDRDataSource_ipv4Allocated(t *testing.T) { } func TestAccIPAMPreviewNextCIDRDataSource_ipv4DisallowedCIDR(t *testing.T) { + ctx := acctest.Context(t) datasourceName := "data.aws_vpc_ipam_preview_next_cidr.test" disallowedCidr := "172.2.0.0/28" netmaskLength := "28" diff --git a/internal/service/ec2/ipam_preview_next_cidr_test.go b/internal/service/ec2/ipam_preview_next_cidr_test.go index 86ad571dfb95..3cd45ce79304 100644 --- a/internal/service/ec2/ipam_preview_next_cidr_test.go +++ b/internal/service/ec2/ipam_preview_next_cidr_test.go @@ -10,6 +10,7 @@ import ( ) func TestAccIPAMPreviewNextCIDR_ipv4Basic(t *testing.T) { + ctx := acctest.Context(t) resourceName := "aws_vpc_ipam_preview_next_cidr.test" netmaskLength := "28" @@ -33,6 +34,7 @@ func TestAccIPAMPreviewNextCIDR_ipv4Basic(t *testing.T) { } func TestAccIPAMPreviewNextCIDR_ipv4Allocated(t *testing.T) { + ctx := acctest.Context(t) resourceName := "aws_vpc_ipam_preview_next_cidr.test" netmaskLength := "28" allocatedCidr := "172.2.0.0/28" @@ -67,6 +69,7 @@ func TestAccIPAMPreviewNextCIDR_ipv4Allocated(t *testing.T) { } func TestAccIPAMPreviewNextCIDR_ipv4DisallowedCIDR(t *testing.T) { + ctx := acctest.Context(t) resourceName := "aws_vpc_ipam_preview_next_cidr.test" disallowedCidr := "172.2.0.0/28" netmaskLength := "28" diff --git a/internal/service/ec2/vpc_data_source_test.go b/internal/service/ec2/vpc_data_source_test.go index e67ce80b4a5c..6ec25e036f5c 100644 --- a/internal/service/ec2/vpc_data_source_test.go +++ b/internal/service/ec2/vpc_data_source_test.go @@ -11,6 +11,7 @@ import ( ) func TestAccVPCDataSource_basic(t *testing.T) { + ctx := acctest.Context(t) rInt1 := sdkacctest.RandIntRange(1, 128) rInt2 := sdkacctest.RandIntRange(128, 254) cidr := fmt.Sprintf("10.%d.%d.0/28", rInt1, rInt2) 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 53039461f96d..7f221e3aa3be 100644 --- a/internal/service/ec2/vpc_dhcp_options_data_source_test.go +++ b/internal/service/ec2/vpc_dhcp_options_data_source_test.go @@ -12,6 +12,7 @@ import ( ) func TestAccVPCDHCPOptionsDataSource_basic(t *testing.T) { + ctx := acctest.Context(t) resourceName := "aws_vpc_dhcp_options.test" datasourceName := "data.aws_vpc_dhcp_options.test" @@ -48,6 +49,7 @@ func TestAccVPCDHCPOptionsDataSource_basic(t *testing.T) { } func TestAccVPCDHCPOptionsDataSource_filter(t *testing.T) { + ctx := acctest.Context(t) rInt := sdkacctest.RandInt() resourceName := "aws_vpc_dhcp_options.test.0" datasourceName := "data.aws_vpc_dhcp_options.test" diff --git a/internal/service/ec2/vpc_endpoint_data_source_test.go b/internal/service/ec2/vpc_endpoint_data_source_test.go index 77438b3f0113..a6d4592d69c3 100644 --- a/internal/service/ec2/vpc_endpoint_data_source_test.go +++ b/internal/service/ec2/vpc_endpoint_data_source_test.go @@ -11,6 +11,7 @@ import ( ) func TestAccVPCEndpointDataSource_gatewayBasic(t *testing.T) { + ctx := acctest.Context(t) resourceName := "aws_vpc_endpoint.test" datasourceName := "data.aws_vpc_endpoint.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) @@ -50,6 +51,7 @@ func TestAccVPCEndpointDataSource_gatewayBasic(t *testing.T) { } func TestAccVPCEndpointDataSource_byID(t *testing.T) { + ctx := acctest.Context(t) resourceName := "aws_vpc_endpoint.test" datasourceName := "data.aws_vpc_endpoint.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) @@ -89,6 +91,7 @@ func TestAccVPCEndpointDataSource_byID(t *testing.T) { } func TestAccVPCEndpointDataSource_byFilter(t *testing.T) { + ctx := acctest.Context(t) resourceName := "aws_vpc_endpoint.test" datasourceName := "data.aws_vpc_endpoint.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) @@ -128,6 +131,7 @@ func TestAccVPCEndpointDataSource_byFilter(t *testing.T) { } func TestAccVPCEndpointDataSource_byTags(t *testing.T) { + ctx := acctest.Context(t) resourceName := "aws_vpc_endpoint.test" datasourceName := "data.aws_vpc_endpoint.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) @@ -167,6 +171,7 @@ func TestAccVPCEndpointDataSource_byTags(t *testing.T) { } func TestAccVPCEndpointDataSource_gatewayWithRouteTableAndTags(t *testing.T) { + ctx := acctest.Context(t) resourceName := "aws_vpc_endpoint.test" datasourceName := "data.aws_vpc_endpoint.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) @@ -206,6 +211,7 @@ func TestAccVPCEndpointDataSource_gatewayWithRouteTableAndTags(t *testing.T) { } func TestAccVPCEndpointDataSource_interface(t *testing.T) { + ctx := acctest.Context(t) resourceName := "aws_vpc_endpoint.test" datasourceName := "data.aws_vpc_endpoint.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) 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 08f59c598bca..c36170dcbe80 100644 --- a/internal/service/ec2/vpc_endpoint_service_data_source_test.go +++ b/internal/service/ec2/vpc_endpoint_service_data_source_test.go @@ -13,6 +13,7 @@ import ( ) func TestAccVPCEndpointServiceDataSource_gateway(t *testing.T) { + ctx := acctest.Context(t) datasourceName := "data.aws_vpc_endpoint_service.test" resource.ParallelTest(t, resource.TestCase{ @@ -42,6 +43,7 @@ func TestAccVPCEndpointServiceDataSource_gateway(t *testing.T) { } func TestAccVPCEndpointServiceDataSource_interface(t *testing.T) { + ctx := acctest.Context(t) datasourceName := "data.aws_vpc_endpoint_service.test" resource.ParallelTest(t, resource.TestCase{ @@ -71,6 +73,7 @@ func TestAccVPCEndpointServiceDataSource_interface(t *testing.T) { } func TestAccVPCEndpointServiceDataSource_custom(t *testing.T) { + ctx := acctest.Context(t) resourceName := "aws_vpc_endpoint_service.test" datasourceName := "data.aws_vpc_endpoint_service.test" rName := sdkacctest.RandomWithPrefix("tfacctest") // 32 character limit @@ -101,6 +104,7 @@ func TestAccVPCEndpointServiceDataSource_custom(t *testing.T) { } func TestAccVPCEndpointServiceDataSource_Custom_filter(t *testing.T) { + ctx := acctest.Context(t) resourceName := "aws_vpc_endpoint_service.test" datasourceName := "data.aws_vpc_endpoint_service.test" rName := sdkacctest.RandomWithPrefix("tfacctest") // 32 character limit @@ -131,6 +135,7 @@ func TestAccVPCEndpointServiceDataSource_Custom_filter(t *testing.T) { } func TestAccVPCEndpointServiceDataSource_CustomFilter_tags(t *testing.T) { + ctx := acctest.Context(t) resourceName := "aws_vpc_endpoint_service.test" datasourceName := "data.aws_vpc_endpoint_service.test" rName := sdkacctest.RandomWithPrefix("tfacctest") // 32 character limit @@ -161,6 +166,7 @@ func TestAccVPCEndpointServiceDataSource_CustomFilter_tags(t *testing.T) { } func TestAccVPCEndpointServiceDataSource_ServiceType_gateway(t *testing.T) { + ctx := acctest.Context(t) datasourceName := "data.aws_vpc_endpoint_service.test" resource.ParallelTest(t, resource.TestCase{ @@ -180,6 +186,7 @@ func TestAccVPCEndpointServiceDataSource_ServiceType_gateway(t *testing.T) { } func TestAccVPCEndpointServiceDataSource_ServiceType_interface(t *testing.T) { + ctx := acctest.Context(t) datasourceName := "data.aws_vpc_endpoint_service.test" resource.ParallelTest(t, resource.TestCase{ 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 437682b556ea..432a267243ca 100644 --- a/internal/service/ec2/vpc_internet_gateway_data_source_test.go +++ b/internal/service/ec2/vpc_internet_gateway_data_source_test.go @@ -11,6 +11,7 @@ import ( ) func TestAccVPCInternetGatewayDataSource_basic(t *testing.T) { + ctx := acctest.Context(t) igwResourceName := "aws_internet_gateway.test" vpcResourceName := "aws_vpc.test" ds1ResourceName := "data.aws_internet_gateway.by_id" 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 c1f4707a5e7e..d4b0a8001bc5 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 @@ -11,6 +11,7 @@ import ( ) func TestAccVPCManagedPrefixListsDataSource_basic(t *testing.T) { + ctx := acctest.Context(t) resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), @@ -27,6 +28,7 @@ func TestAccVPCManagedPrefixListsDataSource_basic(t *testing.T) { } func TestAccVPCManagedPrefixListsDataSource_tags(t *testing.T) { + ctx := acctest.Context(t) rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ @@ -45,6 +47,7 @@ func TestAccVPCManagedPrefixListsDataSource_tags(t *testing.T) { } func TestAccVPCManagedPrefixListsDataSource_noMatches(t *testing.T) { + ctx := acctest.Context(t) resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), 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 66861d4deebb..e6b8c2944a45 100644 --- a/internal/service/ec2/vpc_nat_gateway_data_source_test.go +++ b/internal/service/ec2/vpc_nat_gateway_data_source_test.go @@ -11,6 +11,7 @@ import ( ) func TestAccVPCNATGatewayDataSource_basic(t *testing.T) { + ctx := acctest.Context(t) rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) dataSourceNameById := "data.aws_nat_gateway.test_by_id" dataSourceNameBySubnetId := "data.aws_nat_gateway.test_by_subnet_id" 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 3d50a24282c8..c91b4886ddba 100644 --- a/internal/service/ec2/vpc_nat_gateways_data_source_test.go +++ b/internal/service/ec2/vpc_nat_gateways_data_source_test.go @@ -11,6 +11,7 @@ import ( ) func TestAccVPCNATGatewaysDataSource_basic(t *testing.T) { + ctx := acctest.Context(t) rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ 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 a6575a410715..3ae5baf3745b 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 @@ -11,6 +11,7 @@ import ( ) func TestAccVPCNetworkInsightsAnalysisDataSource_basic(t *testing.T) { + ctx := acctest.Context(t) resourceName := "aws_ec2_network_insights_analysis.test" datasourceName := "data.aws_ec2_network_insights_analysis.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) 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 378addbf4bd7..606caba0ec88 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 @@ -11,6 +11,7 @@ import ( ) func TestAccVPCNetworkInsightsPathDataSource_basic(t *testing.T) { + ctx := acctest.Context(t) resourceName := "aws_ec2_network_insights_path.test" datasourceName := "data.aws_ec2_network_insights_path.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) 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 afbae2715ac3..1ead4dd8342c 100644 --- a/internal/service/ec2/vpc_network_interface_data_source_test.go +++ b/internal/service/ec2/vpc_network_interface_data_source_test.go @@ -11,6 +11,7 @@ import ( ) func TestAccVPCNetworkInterfaceDataSource_basic(t *testing.T) { + ctx := acctest.Context(t) datasourceName := "data.aws_network_interface.test" resourceName := "aws_network_interface.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) @@ -42,6 +43,7 @@ func TestAccVPCNetworkInterfaceDataSource_basic(t *testing.T) { } func TestAccVPCNetworkInterfaceDataSource_filters(t *testing.T) { + ctx := acctest.Context(t) datasourceName := "data.aws_network_interface.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) @@ -111,6 +113,7 @@ func TestAccVPCNetworkInterfaceDataSource_carrierIPAssociation(t *testing.T) { } func TestAccVPCNetworkInterfaceDataSource_publicIPAssociation(t *testing.T) { + ctx := acctest.Context(t) datasourceName := "data.aws_network_interface.test" resourceName := "aws_network_interface.test" eipResourceName := "aws_eip.test" @@ -160,6 +163,7 @@ func TestAccVPCNetworkInterfaceDataSource_publicIPAssociation(t *testing.T) { } func TestAccVPCNetworkInterfaceDataSource_attachment(t *testing.T) { + ctx := acctest.Context(t) datasourceName := "data.aws_network_interface.test" resourceName := "aws_network_interface.test" instanceResourceName := "aws_instance.test" 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 4d144e5b6a1e..ea5d204049e2 100644 --- a/internal/service/ec2/vpc_peering_connection_data_source_test.go +++ b/internal/service/ec2/vpc_peering_connection_data_source_test.go @@ -11,6 +11,7 @@ import ( ) func TestAccVPCPeeringConnectionDataSource_cidrBlock(t *testing.T) { + ctx := acctest.Context(t) rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) dataSourceName := "data.aws_vpc_peering_connection.test" resourceName := "aws_vpc_peering_connection.test" @@ -33,6 +34,7 @@ func TestAccVPCPeeringConnectionDataSource_cidrBlock(t *testing.T) { } func TestAccVPCPeeringConnectionDataSource_id(t *testing.T) { + ctx := acctest.Context(t) rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) dataSourceName := "data.aws_vpc_peering_connection.test" resourceName := "aws_vpc_peering_connection.test" @@ -73,6 +75,7 @@ func TestAccVPCPeeringConnectionDataSource_id(t *testing.T) { } func TestAccVPCPeeringConnectionDataSource_peerCIDRBlock(t *testing.T) { + ctx := acctest.Context(t) rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) dataSourceName := "data.aws_vpc_peering_connection.test" resourceName := "aws_vpc_peering_connection.test" @@ -95,6 +98,7 @@ func TestAccVPCPeeringConnectionDataSource_peerCIDRBlock(t *testing.T) { } func TestAccVPCPeeringConnectionDataSource_peerVPCID(t *testing.T) { + ctx := acctest.Context(t) rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) dataSourceName := "data.aws_vpc_peering_connection.test" resourceName := "aws_vpc_peering_connection.test" @@ -116,6 +120,7 @@ func TestAccVPCPeeringConnectionDataSource_peerVPCID(t *testing.T) { } func TestAccVPCPeeringConnectionDataSource_vpcID(t *testing.T) { + ctx := acctest.Context(t) rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) dataSourceName := "data.aws_vpc_peering_connection.test" resourceName := "aws_vpc_peering_connection.test" 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 18533ef19b41..f3314bbbf56c 100644 --- a/internal/service/ec2/vpc_peering_connections_data_source_test.go +++ b/internal/service/ec2/vpc_peering_connections_data_source_test.go @@ -11,6 +11,7 @@ import ( ) func TestAccVPCPeeringConnectionsDataSource_basic(t *testing.T) { + ctx := acctest.Context(t) rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ @@ -29,6 +30,7 @@ func TestAccVPCPeeringConnectionsDataSource_basic(t *testing.T) { } func TestAccVPCPeeringConnectionsDataSource_NoMatches(t *testing.T) { + ctx := acctest.Context(t) rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ 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 ebf3f50c0d4f..fd2dea7f1197 100644 --- a/internal/service/ec2/vpc_prefix_list_data_source_test.go +++ b/internal/service/ec2/vpc_prefix_list_data_source_test.go @@ -10,6 +10,7 @@ import ( ) func TestAccVPCPrefixListDataSource_basic(t *testing.T) { + ctx := acctest.Context(t) ds1Name := "data.aws_prefix_list.s3_by_id" ds2Name := "data.aws_prefix_list.s3_by_name" @@ -32,6 +33,7 @@ func TestAccVPCPrefixListDataSource_basic(t *testing.T) { } func TestAccVPCPrefixListDataSource_filter(t *testing.T) { + ctx := acctest.Context(t) ds1Name := "data.aws_prefix_list.s3_by_id" ds2Name := "data.aws_prefix_list.s3_by_name" @@ -54,6 +56,7 @@ func TestAccVPCPrefixListDataSource_filter(t *testing.T) { } func TestAccVPCPrefixListDataSource_nameDoesNotOverrideFilter(t *testing.T) { + ctx := acctest.Context(t) resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), diff --git a/internal/service/ec2/vpc_route_data_source_test.go b/internal/service/ec2/vpc_route_data_source_test.go index 9f867dd7c92d..f1cf3dd9c2a5 100644 --- a/internal/service/ec2/vpc_route_data_source_test.go +++ b/internal/service/ec2/vpc_route_data_source_test.go @@ -12,6 +12,7 @@ import ( ) func TestAccVPCRouteDataSource_basic(t *testing.T) { + ctx := acctest.Context(t) instanceRouteResourceName := "aws_route.instance" pcxRouteResourceName := "aws_route.vpc_peering_connection" rtResourceName := "aws_route_table.test" 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 16032e97487d..099c441182ac 100644 --- a/internal/service/ec2/vpc_route_table_data_source_test.go +++ b/internal/service/ec2/vpc_route_table_data_source_test.go @@ -13,6 +13,7 @@ import ( ) func TestAccVPCRouteTableDataSource_basic(t *testing.T) { + ctx := acctest.Context(t) rtResourceName := "aws_route_table.test" snResourceName := "aws_subnet.test" vpcResourceName := "aws_vpc.test" @@ -99,6 +100,7 @@ func TestAccVPCRouteTableDataSource_basic(t *testing.T) { } func TestAccVPCRouteTableDataSource_main(t *testing.T) { + ctx := acctest.Context(t) datasourceName := "data.aws_route_table.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) 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 940a12ebe183..9c4c2c5201f9 100644 --- a/internal/service/ec2/vpc_security_group_data_source_test.go +++ b/internal/service/ec2/vpc_security_group_data_source_test.go @@ -11,6 +11,7 @@ import ( ) func TestAccVPCSecurityGroupDataSource_basic(t *testing.T) { + ctx := acctest.Context(t) rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ 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 4e1b76228d3a..c879e9cf3fd7 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 @@ -11,6 +11,7 @@ import ( ) func TestAccVPCSecurityGroupRuleDataSource_basic(t *testing.T) { + ctx := acctest.Context(t) rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) dataSourceName := "data.aws_vpc_security_group_rule.test" resourceName := "aws_vpc_security_group_ingress_rule.test" @@ -43,6 +44,7 @@ func TestAccVPCSecurityGroupRuleDataSource_basic(t *testing.T) { } func TestAccVPCSecurityGroupRuleDataSource_filter(t *testing.T) { + ctx := acctest.Context(t) rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) dataSourceName := "data.aws_vpc_security_group_rule.test" resourceName := "aws_vpc_security_group_egress_rule.test" 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 85ec91a34e46..f83bb9034541 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 @@ -11,6 +11,7 @@ import ( ) func TestAccVPCSecurityGroupRulesDataSource_basic(t *testing.T) { + ctx := acctest.Context(t) rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ @@ -29,6 +30,7 @@ func TestAccVPCSecurityGroupRulesDataSource_basic(t *testing.T) { } func TestAccVPCSecurityGroupRulesDataSource_tags(t *testing.T) { + ctx := acctest.Context(t) rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ 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 3ab46dc70d8c..d3fdaf3f3620 100644 --- a/internal/service/ec2/vpc_security_groups_data_source_test.go +++ b/internal/service/ec2/vpc_security_groups_data_source_test.go @@ -11,6 +11,7 @@ import ( ) func TestAccVPCSecurityGroupsDataSource_tag(t *testing.T) { + ctx := acctest.Context(t) rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) dataSourceName := "data.aws_security_groups.test" @@ -32,6 +33,7 @@ func TestAccVPCSecurityGroupsDataSource_tag(t *testing.T) { } func TestAccVPCSecurityGroupsDataSource_filter(t *testing.T) { + ctx := acctest.Context(t) rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) dataSourceName := "data.aws_security_groups.test" @@ -53,6 +55,7 @@ func TestAccVPCSecurityGroupsDataSource_filter(t *testing.T) { } func TestAccVPCSecurityGroupsDataSource_empty(t *testing.T) { + ctx := acctest.Context(t) rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) dataSourceName := "data.aws_security_groups.test" diff --git a/internal/service/ec2/vpc_subnet_data_source_test.go b/internal/service/ec2/vpc_subnet_data_source_test.go index 14e8a6c172ca..6c37b29e758a 100644 --- a/internal/service/ec2/vpc_subnet_data_source_test.go +++ b/internal/service/ec2/vpc_subnet_data_source_test.go @@ -139,6 +139,7 @@ func TestAccVPCSubnetDataSource_basic(t *testing.T) { } func TestAccVPCSubnetDataSource_ipv6ByIPv6Filter(t *testing.T) { + ctx := acctest.Context(t) rInt := sdkacctest.RandIntRange(0, 256) rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) @@ -162,6 +163,7 @@ func TestAccVPCSubnetDataSource_ipv6ByIPv6Filter(t *testing.T) { } func TestAccVPCSubnetDataSource_ipv6ByIPv6CIDRBlock(t *testing.T) { + ctx := acctest.Context(t) rInt := sdkacctest.RandIntRange(0, 256) rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) diff --git a/internal/service/ec2/vpc_subnet_test.go b/internal/service/ec2/vpc_subnet_test.go index 9253faba1f61..ec43f386c488 100644 --- a/internal/service/ec2/vpc_subnet_test.go +++ b/internal/service/ec2/vpc_subnet_test.go @@ -376,6 +376,7 @@ 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{ diff --git a/internal/service/ec2/vpc_subnets_data_source_test.go b/internal/service/ec2/vpc_subnets_data_source_test.go index 2dc879e98a7f..1181498d64ff 100644 --- a/internal/service/ec2/vpc_subnets_data_source_test.go +++ b/internal/service/ec2/vpc_subnets_data_source_test.go @@ -11,6 +11,7 @@ import ( ) func TestAccVPCSubnetsDataSource_basic(t *testing.T) { + ctx := acctest.Context(t) rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ @@ -35,6 +36,7 @@ func TestAccVPCSubnetsDataSource_basic(t *testing.T) { } func TestAccVPCSubnetsDataSource_filter(t *testing.T) { + ctx := acctest.Context(t) rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ diff --git a/internal/service/ec2/vpc_test.go b/internal/service/ec2/vpc_test.go index 0b23cca5342b..f9078aa37a27 100644 --- a/internal/service/ec2/vpc_test.go +++ b/internal/service/ec2/vpc_test.go @@ -402,6 +402,8 @@ func TestAccVPC_DefaultTagsProviderAndResource_overlappingTag(t *testing.T) { } func TestAccVPC_DefaultTagsProviderAndResource_duplicateTag(t *testing.T) { + ctx := acctest.Context(t) + resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), diff --git a/internal/service/ec2/vpc_vpcs_data_source_test.go b/internal/service/ec2/vpc_vpcs_data_source_test.go index 527ba27d144a..967ac41856cd 100644 --- a/internal/service/ec2/vpc_vpcs_data_source_test.go +++ b/internal/service/ec2/vpc_vpcs_data_source_test.go @@ -11,6 +11,7 @@ import ( ) func TestAccVPCsDataSource_basic(t *testing.T) { + ctx := acctest.Context(t) rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ @@ -29,6 +30,7 @@ func TestAccVPCsDataSource_basic(t *testing.T) { } func TestAccVPCsDataSource_tags(t *testing.T) { + ctx := acctest.Context(t) rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ @@ -47,6 +49,7 @@ func TestAccVPCsDataSource_tags(t *testing.T) { } func TestAccVPCsDataSource_filters(t *testing.T) { + ctx := acctest.Context(t) rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ @@ -65,6 +68,7 @@ func TestAccVPCsDataSource_filters(t *testing.T) { } func TestAccVPCsDataSource_empty(t *testing.T) { + ctx := acctest.Context(t) rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ diff --git a/internal/service/ec2/vpnsite_gateway_data_source_test.go b/internal/service/ec2/vpnsite_gateway_data_source_test.go index 722f5ceb123b..c3ca8c14c131 100644 --- a/internal/service/ec2/vpnsite_gateway_data_source_test.go +++ b/internal/service/ec2/vpnsite_gateway_data_source_test.go @@ -12,6 +12,7 @@ import ( ) func TestAccSiteVPNGatewayDataSource_unattached(t *testing.T) { + ctx := acctest.Context(t) rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) dataSourceNameById := "data.aws_vpn_gateway.test_by_id" dataSourceNameByTags := "data.aws_vpn_gateway.test_by_tags" @@ -41,6 +42,7 @@ func TestAccSiteVPNGatewayDataSource_unattached(t *testing.T) { } func TestAccSiteVPNGatewayDataSource_attached(t *testing.T) { + ctx := acctest.Context(t) rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) dataSourceName := "data.aws_vpn_gateway.test" From 589bb28f68ce24a58178ee47b75057455bea2b31 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Fri, 24 Feb 2023 17:01:58 -0500 Subject: [PATCH 283/763] Add 'ctx := acctest.Context(t)' for ecr. --- internal/service/ecr/authorization_token_data_source_test.go | 1 + internal/service/ecr/image_data_source_test.go | 1 + internal/service/ecr/repository_data_source_test.go | 3 +++ 3 files changed, 5 insertions(+) diff --git a/internal/service/ecr/authorization_token_data_source_test.go b/internal/service/ecr/authorization_token_data_source_test.go index a454f5c14a2f..ad3768261920 100644 --- a/internal/service/ecr/authorization_token_data_source_test.go +++ b/internal/service/ecr/authorization_token_data_source_test.go @@ -12,6 +12,7 @@ import ( ) func TestAccECRAuthorizationTokenDataSource_basic(t *testing.T) { + ctx := acctest.Context(t) rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) dataSourceName := "data.aws_ecr_authorization_token.repo" diff --git a/internal/service/ecr/image_data_source_test.go b/internal/service/ecr/image_data_source_test.go index c5555a9701ae..db64fcd543dd 100644 --- a/internal/service/ecr/image_data_source_test.go +++ b/internal/service/ecr/image_data_source_test.go @@ -10,6 +10,7 @@ import ( ) func TestAccECRImageDataSource_basic(t *testing.T) { + ctx := acctest.Context(t) registry, repo, tag := "137112412989", "amazonlinux", "latest" resourceByTag := "data.aws_ecr_image.by_tag" resourceByDigest := "data.aws_ecr_image.by_digest" diff --git a/internal/service/ecr/repository_data_source_test.go b/internal/service/ecr/repository_data_source_test.go index 2df141dab229..dc73b460b66b 100644 --- a/internal/service/ecr/repository_data_source_test.go +++ b/internal/service/ecr/repository_data_source_test.go @@ -12,6 +12,7 @@ import ( ) func TestAccECRRepositoryDataSource_basic(t *testing.T) { + ctx := acctest.Context(t) rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resourceName := "aws_ecr_repository.test" dataSourceName := "data.aws_ecr_repository.test" @@ -39,6 +40,7 @@ func TestAccECRRepositoryDataSource_basic(t *testing.T) { } func TestAccECRRepositoryDataSource_encryption(t *testing.T) { + ctx := acctest.Context(t) rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resourceName := "aws_ecr_repository.test" dataSourceName := "data.aws_ecr_repository.test" @@ -67,6 +69,7 @@ func TestAccECRRepositoryDataSource_encryption(t *testing.T) { } func TestAccECRRepositoryDataSource_nonExistent(t *testing.T) { + ctx := acctest.Context(t) resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ecr.EndpointsID), From eb16636fbdd23539ac9e7258937177b133ba973a Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Fri, 24 Feb 2023 17:01:59 -0500 Subject: [PATCH 284/763] Add 'ctx := acctest.Context(t)' for ecs. --- internal/service/ecs/cluster_data_source_test.go | 2 ++ internal/service/ecs/container_definition_data_source_test.go | 1 + internal/service/ecs/service_data_source_test.go | 1 + internal/service/ecs/task_definition_data_source_test.go | 1 + 4 files changed, 5 insertions(+) diff --git a/internal/service/ecs/cluster_data_source_test.go b/internal/service/ecs/cluster_data_source_test.go index dd971ca2b88e..064535e406f2 100644 --- a/internal/service/ecs/cluster_data_source_test.go +++ b/internal/service/ecs/cluster_data_source_test.go @@ -11,6 +11,7 @@ import ( ) func TestAccECSClusterDataSource_ecsCluster(t *testing.T) { + ctx := acctest.Context(t) dataSourceName := "data.aws_ecs_cluster.test" resourceName := "aws_ecs_cluster.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) @@ -36,6 +37,7 @@ func TestAccECSClusterDataSource_ecsCluster(t *testing.T) { } func TestAccECSClusterDataSource_ecsClusterContainerInsights(t *testing.T) { + ctx := acctest.Context(t) dataSourceName := "data.aws_ecs_cluster.test" resourceName := "aws_ecs_cluster.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) diff --git a/internal/service/ecs/container_definition_data_source_test.go b/internal/service/ecs/container_definition_data_source_test.go index 9febf99207d8..e18fdb079d31 100644 --- a/internal/service/ecs/container_definition_data_source_test.go +++ b/internal/service/ecs/container_definition_data_source_test.go @@ -11,6 +11,7 @@ import ( ) func TestAccECSContainerDefinitionDataSource_ecsContainerDefinition(t *testing.T) { + ctx := acctest.Context(t) rString := sdkacctest.RandString(8) clusterName := fmt.Sprintf("tf_acc_td_ds_cluster_ecs_containter_definition_%s", rString) svcName := fmt.Sprintf("tf_acc_svc_td_ds_ecs_containter_definition_%s", rString) diff --git a/internal/service/ecs/service_data_source_test.go b/internal/service/ecs/service_data_source_test.go index 7fc49a26b24e..b2da89f7e43d 100644 --- a/internal/service/ecs/service_data_source_test.go +++ b/internal/service/ecs/service_data_source_test.go @@ -11,6 +11,7 @@ import ( ) func TestAccECSServiceDataSource_basic(t *testing.T) { + ctx := acctest.Context(t) dataSourceName := "data.aws_ecs_service.test" resourceName := "aws_ecs_service.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) diff --git a/internal/service/ecs/task_definition_data_source_test.go b/internal/service/ecs/task_definition_data_source_test.go index d41ae79afaf8..1c0bae506009 100644 --- a/internal/service/ecs/task_definition_data_source_test.go +++ b/internal/service/ecs/task_definition_data_source_test.go @@ -12,6 +12,7 @@ import ( ) func TestAccECSTaskDefinitionDataSource_ecsTaskDefinition(t *testing.T) { + ctx := acctest.Context(t) resourceName := "data.aws_ecs_task_definition.mongo" rName := fmt.Sprintf("tf-acc-test-%s", sdkacctest.RandString(5)) From ea166b4afc3b83ec6f169f5da9404f32d1946f76 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Fri, 24 Feb 2023 17:01:59 -0500 Subject: [PATCH 285/763] Add 'ctx := acctest.Context(t)' for efs. --- internal/service/efs/file_system_data_source_test.go | 5 +++++ internal/service/efs/mount_target_data_source_test.go | 3 +++ 2 files changed, 8 insertions(+) diff --git a/internal/service/efs/file_system_data_source_test.go b/internal/service/efs/file_system_data_source_test.go index 4ab9b342d4d6..2d6a5362f1d5 100644 --- a/internal/service/efs/file_system_data_source_test.go +++ b/internal/service/efs/file_system_data_source_test.go @@ -13,6 +13,7 @@ import ( ) func TestAccEFSFileSystemDataSource_id(t *testing.T) { + ctx := acctest.Context(t) dataSourceName := "data.aws_efs_file_system.test" resourceName := "aws_efs_file_system.test" @@ -43,6 +44,7 @@ func TestAccEFSFileSystemDataSource_id(t *testing.T) { } func TestAccEFSFileSystemDataSource_tags(t *testing.T) { + ctx := acctest.Context(t) dataSourceName := "data.aws_efs_file_system.test" resourceName := "aws_efs_file_system.test" @@ -73,6 +75,7 @@ func TestAccEFSFileSystemDataSource_tags(t *testing.T) { } func TestAccEFSFileSystemDataSource_name(t *testing.T) { + ctx := acctest.Context(t) dataSourceName := "data.aws_efs_file_system.test" resourceName := "aws_efs_file_system.test" @@ -103,6 +106,7 @@ func TestAccEFSFileSystemDataSource_name(t *testing.T) { } func TestAccEFSFileSystemDataSource_availabilityZone(t *testing.T) { + ctx := acctest.Context(t) dataSourceName := "data.aws_efs_file_system.test" resourceName := "aws_efs_file_system.test" @@ -124,6 +128,7 @@ func TestAccEFSFileSystemDataSource_availabilityZone(t *testing.T) { } func TestAccEFSFileSystemDataSource_nonExistent_fileSystemID(t *testing.T) { + ctx := acctest.Context(t) resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, efs.EndpointsID), diff --git a/internal/service/efs/mount_target_data_source_test.go b/internal/service/efs/mount_target_data_source_test.go index 6d03963e3f27..59d5a71a6795 100644 --- a/internal/service/efs/mount_target_data_source_test.go +++ b/internal/service/efs/mount_target_data_source_test.go @@ -11,6 +11,7 @@ import ( ) func TestAccEFSMountTargetDataSource_basic(t *testing.T) { + ctx := acctest.Context(t) rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) dataSourceName := "data.aws_efs_mount_target.test" resourceName := "aws_efs_mount_target.test" @@ -41,6 +42,7 @@ func TestAccEFSMountTargetDataSource_basic(t *testing.T) { } func TestAccEFSMountTargetDataSource_byAccessPointID(t *testing.T) { + ctx := acctest.Context(t) rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) dataSourceName := "data.aws_efs_mount_target.test" resourceName := "aws_efs_mount_target.test" @@ -71,6 +73,7 @@ func TestAccEFSMountTargetDataSource_byAccessPointID(t *testing.T) { } func TestAccEFSMountTargetDataSource_byFileSystemID(t *testing.T) { + ctx := acctest.Context(t) rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) dataSourceName := "data.aws_efs_mount_target.test" resourceName := "aws_efs_mount_target.test" From 30fdfb24b4cd771b2e948cf481b66921eab36ab5 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Fri, 24 Feb 2023 17:01:59 -0500 Subject: [PATCH 286/763] Add 'ctx := acctest.Context(t)' for eks. --- internal/service/eks/addon_test.go | 1 + internal/service/eks/cluster_auth_data_source_test.go | 1 + 2 files changed, 2 insertions(+) diff --git a/internal/service/eks/addon_test.go b/internal/service/eks/addon_test.go index 7e46f7feb291..1471387d50ec 100644 --- a/internal/service/eks/addon_test.go +++ b/internal/service/eks/addon_test.go @@ -623,6 +623,7 @@ 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" diff --git a/internal/service/eks/cluster_auth_data_source_test.go b/internal/service/eks/cluster_auth_data_source_test.go index 12bf6b96296c..226497ee4f79 100644 --- a/internal/service/eks/cluster_auth_data_source_test.go +++ b/internal/service/eks/cluster_auth_data_source_test.go @@ -12,6 +12,7 @@ import ( ) func TestAccEKSClusterAuthDataSource_basic(t *testing.T) { + ctx := acctest.Context(t) dataSourceResourceName := "data.aws_eks_cluster_auth.test" resource.ParallelTest(t, resource.TestCase{ From 319fda693d83316558ceccbfdcf9356fa6dff2d4 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Fri, 24 Feb 2023 17:01:59 -0500 Subject: [PATCH 287/763] Add 'ctx := acctest.Context(t)' for elasticache. --- internal/service/elasticache/cluster_data_source_test.go | 2 ++ .../elasticache/replication_group_data_source_test.go | 5 +++++ .../service/elasticache/subnet_group_data_source_test.go | 1 + internal/service/elasticache/user_data_source_test.go | 1 + 4 files changed, 9 insertions(+) diff --git a/internal/service/elasticache/cluster_data_source_test.go b/internal/service/elasticache/cluster_data_source_test.go index a1228b405cbc..9fb26eeecafa 100644 --- a/internal/service/elasticache/cluster_data_source_test.go +++ b/internal/service/elasticache/cluster_data_source_test.go @@ -11,6 +11,7 @@ import ( ) func TestAccElastiCacheClusterDataSource_Data_basic(t *testing.T) { + ctx := acctest.Context(t) if testing.Short() { t.Skip("skipping long-running test in short mode") } @@ -44,6 +45,7 @@ func TestAccElastiCacheClusterDataSource_Data_basic(t *testing.T) { } func TestAccElastiCacheClusterDataSource_Engine_Redis_LogDeliveryConfigurations(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/replication_group_data_source_test.go b/internal/service/elasticache/replication_group_data_source_test.go index c2c536a0ce18..6942749851c1 100644 --- a/internal/service/elasticache/replication_group_data_source_test.go +++ b/internal/service/elasticache/replication_group_data_source_test.go @@ -12,6 +12,7 @@ import ( ) func TestAccElastiCacheReplicationGroupDataSource_basic(t *testing.T) { + ctx := acctest.Context(t) if testing.Short() { t.Skip("skipping long-running test in short mode") } @@ -50,6 +51,7 @@ func TestAccElastiCacheReplicationGroupDataSource_basic(t *testing.T) { } func TestAccElastiCacheReplicationGroupDataSource_clusterMode(t *testing.T) { + ctx := acctest.Context(t) if testing.Short() { t.Skip("skipping long-running test in short mode") } @@ -83,6 +85,7 @@ func TestAccElastiCacheReplicationGroupDataSource_clusterMode(t *testing.T) { } func TestAccElastiCacheReplicationGroupDataSource_multiAZ(t *testing.T) { + ctx := acctest.Context(t) if testing.Short() { t.Skip("skipping long-running test in short mode") } @@ -108,6 +111,7 @@ func TestAccElastiCacheReplicationGroupDataSource_multiAZ(t *testing.T) { } func TestAccElastiCacheReplicationGroupDataSource_nonExistent(t *testing.T) { + ctx := acctest.Context(t) resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elasticache.EndpointsID), @@ -122,6 +126,7 @@ func TestAccElastiCacheReplicationGroupDataSource_nonExistent(t *testing.T) { } func TestAccElastiCacheReplicationGroupDataSource_Engine_Redis_LogDeliveryConfigurations(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/subnet_group_data_source_test.go b/internal/service/elasticache/subnet_group_data_source_test.go index c32233527ec1..c5e17a84ed55 100644 --- a/internal/service/elasticache/subnet_group_data_source_test.go +++ b/internal/service/elasticache/subnet_group_data_source_test.go @@ -18,6 +18,7 @@ func testAccPreCheck(t *testing.T) { } func TestAccElastiCacheSubnetGroupDataSource_basic(t *testing.T) { + ctx := acctest.Context(t) rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resourceName := "aws_elasticache_subnet_group.test" dataSourceName := "data.aws_elasticache_subnet_group.test" diff --git a/internal/service/elasticache/user_data_source_test.go b/internal/service/elasticache/user_data_source_test.go index 56463a7288e3..df3334371b27 100644 --- a/internal/service/elasticache/user_data_source_test.go +++ b/internal/service/elasticache/user_data_source_test.go @@ -11,6 +11,7 @@ import ( ) func TestAccElastiCacheUserDataSource_basic(t *testing.T) { + ctx := acctest.Context(t) resourceName := "aws_elasticache_user.test-basic" dataSourceName := "data.aws_elasticache_user.test-basic" rName := sdkacctest.RandomWithPrefix("tf-acc") From ec294166bfb13866727a8f762538fd6466d8516f Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Fri, 24 Feb 2023 17:02:00 -0500 Subject: [PATCH 288/763] Add 'ctx := acctest.Context(t)' for elasticbeanstalk. --- .../service/elasticbeanstalk/application_data_source_test.go | 1 + .../service/elasticbeanstalk/hosted_zone_data_source_test.go | 2 ++ .../service/elasticbeanstalk/solution_stack_data_source_test.go | 1 + 3 files changed, 4 insertions(+) diff --git a/internal/service/elasticbeanstalk/application_data_source_test.go b/internal/service/elasticbeanstalk/application_data_source_test.go index bf4fa4ded1d0..e00a1cdadfb6 100644 --- a/internal/service/elasticbeanstalk/application_data_source_test.go +++ b/internal/service/elasticbeanstalk/application_data_source_test.go @@ -11,6 +11,7 @@ import ( ) func TestAccElasticBeanstalkApplicationDataSource_basic(t *testing.T) { + ctx := acctest.Context(t) rName := fmt.Sprintf("tf-acc-test-%s", sdkacctest.RandString(5)) dataSourceResourceName := "data.aws_elastic_beanstalk_application.test" resourceName := "aws_elastic_beanstalk_application.tftest" diff --git a/internal/service/elasticbeanstalk/hosted_zone_data_source_test.go b/internal/service/elasticbeanstalk/hosted_zone_data_source_test.go index 6f74b0a269d4..5155a3ee1949 100644 --- a/internal/service/elasticbeanstalk/hosted_zone_data_source_test.go +++ b/internal/service/elasticbeanstalk/hosted_zone_data_source_test.go @@ -13,6 +13,7 @@ import ( ) func TestAccElasticBeanstalkHostedZoneDataSource_basic(t *testing.T) { + ctx := acctest.Context(t) dataSourceName := "data.aws_elastic_beanstalk_hosted_zone.test" resource.ParallelTest(t, resource.TestCase{ @@ -31,6 +32,7 @@ func TestAccElasticBeanstalkHostedZoneDataSource_basic(t *testing.T) { } func TestAccElasticBeanstalkHostedZoneDataSource_region(t *testing.T) { + ctx := acctest.Context(t) dataSourceName := "data.aws_elastic_beanstalk_hosted_zone.test" resource.ParallelTest(t, resource.TestCase{ diff --git a/internal/service/elasticbeanstalk/solution_stack_data_source_test.go b/internal/service/elasticbeanstalk/solution_stack_data_source_test.go index 6ae51ef65273..bb8ab384bc5d 100644 --- a/internal/service/elasticbeanstalk/solution_stack_data_source_test.go +++ b/internal/service/elasticbeanstalk/solution_stack_data_source_test.go @@ -12,6 +12,7 @@ import ( ) func TestAccElasticBeanstalkSolutionStackDataSource_basic(t *testing.T) { + ctx := acctest.Context(t) resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elasticbeanstalk.EndpointsID), From 06ca3b1249f341a6fa9c84ce95f3ee1eaf276447 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Fri, 24 Feb 2023 17:02:00 -0500 Subject: [PATCH 289/763] Add 'ctx := acctest.Context(t)' for elb. --- internal/service/elb/hosted_zone_id_data_source_test.go | 1 + internal/service/elb/load_balancer_data_source_test.go | 1 + internal/service/elb/service_account_data_source_test.go | 2 ++ 3 files changed, 4 insertions(+) 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 a9ce0d615dfb..de4da6d678b0 100644 --- a/internal/service/elb/hosted_zone_id_data_source_test.go +++ b/internal/service/elb/hosted_zone_id_data_source_test.go @@ -10,6 +10,7 @@ import ( ) func TestAccELBHostedZoneIDDataSource_basic(t *testing.T) { + ctx := acctest.Context(t) resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elb.EndpointsID), diff --git a/internal/service/elb/load_balancer_data_source_test.go b/internal/service/elb/load_balancer_data_source_test.go index 4816ee0e220c..ef99e53d349e 100644 --- a/internal/service/elb/load_balancer_data_source_test.go +++ b/internal/service/elb/load_balancer_data_source_test.go @@ -12,6 +12,7 @@ import ( func TestAccELBLoadBalancerDataSource_basic(t *testing.T) { // Must be less than 32 characters for ELB name + ctx := acctest.Context(t) rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) dataSourceName := "data.aws_elb.test" diff --git a/internal/service/elb/service_account_data_source_test.go b/internal/service/elb/service_account_data_source_test.go index aac9eb843feb..0af6650f88be 100644 --- a/internal/service/elb/service_account_data_source_test.go +++ b/internal/service/elb/service_account_data_source_test.go @@ -10,6 +10,7 @@ import ( ) func TestAccELBServiceAccountDataSource_basic(t *testing.T) { + ctx := acctest.Context(t) expectedAccountID := tfelb.AccountIdPerRegionMap[acctest.Region()] dataSourceName := "data.aws_elb_service_account.main" @@ -31,6 +32,7 @@ func TestAccELBServiceAccountDataSource_basic(t *testing.T) { } func TestAccELBServiceAccountDataSource_region(t *testing.T) { + ctx := acctest.Context(t) expectedAccountID := tfelb.AccountIdPerRegionMap[acctest.Region()] dataSourceName := "data.aws_elb_service_account.regional" From 9a1beb5df76a460074a7c8acd18d885fbfe1f9ee Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Fri, 24 Feb 2023 17:02:00 -0500 Subject: [PATCH 290/763] Add 'ctx := acctest.Context(t)' for elbv2. --- internal/service/elbv2/hosted_zone_id_data_source_test.go | 1 + internal/service/elbv2/listener_data_source_test.go | 4 ++++ internal/service/elbv2/load_balancer_data_source_test.go | 2 ++ internal/service/elbv2/target_group_data_source_test.go | 4 ++++ 4 files changed, 11 insertions(+) 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 465d2400340b..8d0a1e448095 100644 --- a/internal/service/elbv2/hosted_zone_id_data_source_test.go +++ b/internal/service/elbv2/hosted_zone_id_data_source_test.go @@ -10,6 +10,7 @@ import ( ) func TestAccELBV2HostedZoneIDDataSource_basic(t *testing.T) { + ctx := acctest.Context(t) resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elbv2.EndpointsID), diff --git a/internal/service/elbv2/listener_data_source_test.go b/internal/service/elbv2/listener_data_source_test.go index a77e7619b6d7..8fcb5f25a065 100644 --- a/internal/service/elbv2/listener_data_source_test.go +++ b/internal/service/elbv2/listener_data_source_test.go @@ -11,6 +11,7 @@ import ( ) func TestAccELBV2ListenerDataSource_basic(t *testing.T) { + ctx := acctest.Context(t) rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) dataSourceName := "data.aws_lb_listener.test" dataSourceName2 := "data.aws_lb_listener.from_lb_and_port" @@ -46,6 +47,7 @@ func TestAccELBV2ListenerDataSource_basic(t *testing.T) { } func TestAccELBV2ListenerDataSource_backwardsCompatibility(t *testing.T) { + ctx := acctest.Context(t) rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) dataSourceName := "data.aws_alb_listener.test" dataSourceName2 := "data.aws_alb_listener.from_lb_and_port" @@ -79,6 +81,7 @@ func TestAccELBV2ListenerDataSource_backwardsCompatibility(t *testing.T) { } func TestAccELBV2ListenerDataSource_https(t *testing.T) { + ctx := acctest.Context(t) rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) key := acctest.TLSRSAPrivateKeyPEM(t, 2048) certificate := acctest.TLSRSAX509SelfSignedCertificatePEM(t, key, "example.com") @@ -118,6 +121,7 @@ func TestAccELBV2ListenerDataSource_https(t *testing.T) { } func TestAccELBV2ListenerDataSource_DefaultAction_forward(t *testing.T) { + ctx := acctest.Context(t) rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) dataSourceName := "data.aws_lb_listener.test" resourceName := "aws_lb_listener.test" diff --git a/internal/service/elbv2/load_balancer_data_source_test.go b/internal/service/elbv2/load_balancer_data_source_test.go index b08af1cd09d1..432cc9bae596 100644 --- a/internal/service/elbv2/load_balancer_data_source_test.go +++ b/internal/service/elbv2/load_balancer_data_source_test.go @@ -11,6 +11,7 @@ import ( ) func TestAccELBV2LoadBalancerDataSource_basic(t *testing.T) { + ctx := acctest.Context(t) rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) dataSourceName := "data.aws_lb.alb_test_with_arn" dataSourceName2 := "data.aws_lb.alb_test_with_name" @@ -116,6 +117,7 @@ func TestAccELBV2LoadBalancerDataSource_outpost(t *testing.T) { } func TestAccELBV2LoadBalancerDataSource_backwardsCompatibility(t *testing.T) { + ctx := acctest.Context(t) rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) dataSourceName1 := "data.aws_alb.alb_test_with_arn" dataSourceName2 := "data.aws_alb.alb_test_with_name" diff --git a/internal/service/elbv2/target_group_data_source_test.go b/internal/service/elbv2/target_group_data_source_test.go index c54292ca8ac2..fa933c19094b 100644 --- a/internal/service/elbv2/target_group_data_source_test.go +++ b/internal/service/elbv2/target_group_data_source_test.go @@ -11,6 +11,7 @@ import ( ) func TestAccELBV2TargetGroupDataSource_basic(t *testing.T) { + ctx := acctest.Context(t) rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) datasourceNameByARN := "data.aws_lb_target_group.alb_tg_test_with_arn" datasourceNameByName := "data.aws_lb_target_group.alb_tg_test_with_name" @@ -72,6 +73,7 @@ func TestAccELBV2TargetGroupDataSource_basic(t *testing.T) { } func TestAccELBV2TargetGroupDataSource_appCookie(t *testing.T) { + ctx := acctest.Context(t) rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resourceNameArn := "data.aws_lb_target_group.alb_tg_test_with_arn" @@ -113,6 +115,7 @@ func TestAccELBV2TargetGroupDataSource_appCookie(t *testing.T) { } func TestAccELBV2TargetGroupDataSource_backwardsCompatibility(t *testing.T) { + ctx := acctest.Context(t) rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resourceNameArn := "data.aws_alb_target_group.alb_tg_test_with_arn" resourceName := "data.aws_alb_target_group.alb_tg_test_with_name" @@ -172,6 +175,7 @@ func TestAccELBV2TargetGroupDataSource_backwardsCompatibility(t *testing.T) { } func TestAccELBV2TargetGroupDataSource_tags(t *testing.T) { + ctx := acctest.Context(t) rName1 := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) rName2 := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) From 4027c6a3962efbec59cbc656a731e21bab222ac6 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Fri, 24 Feb 2023 17:02:01 -0500 Subject: [PATCH 291/763] Add 'ctx := acctest.Context(t)' for emr. --- internal/service/emr/release_labels_data_source_test.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/internal/service/emr/release_labels_data_source_test.go b/internal/service/emr/release_labels_data_source_test.go index 83f761760a1a..2f09b45eddab 100644 --- a/internal/service/emr/release_labels_data_source_test.go +++ b/internal/service/emr/release_labels_data_source_test.go @@ -9,6 +9,7 @@ import ( ) func TestAccEMRReleaseLabels_basic(t *testing.T) { + ctx := acctest.Context(t) dataSourceResourceName := "data.aws_emr_release_labels.test" resource.ParallelTest(t, resource.TestCase{ @@ -28,6 +29,7 @@ func TestAccEMRReleaseLabels_basic(t *testing.T) { } func TestAccEMRReleaseLabels_prefix(t *testing.T) { + ctx := acctest.Context(t) dataSourceResourceName := "data.aws_emr_release_labels.test" resource.ParallelTest(t, resource.TestCase{ @@ -47,6 +49,7 @@ func TestAccEMRReleaseLabels_prefix(t *testing.T) { } func TestAccEMRReleaseLabels_application(t *testing.T) { + ctx := acctest.Context(t) dataSourceResourceName := "data.aws_emr_release_labels.test" resource.ParallelTest(t, resource.TestCase{ @@ -66,6 +69,7 @@ func TestAccEMRReleaseLabels_application(t *testing.T) { } func TestAccEMRReleaseLabels_full(t *testing.T) { + ctx := acctest.Context(t) dataSourceResourceName := "data.aws_emr_release_labels.test" resource.ParallelTest(t, resource.TestCase{ @@ -85,6 +89,7 @@ func TestAccEMRReleaseLabels_full(t *testing.T) { } func TestAccEMRReleaseLabels_empty(t *testing.T) { + ctx := acctest.Context(t) dataSourceResourceName := "data.aws_emr_release_labels.test" resource.ParallelTest(t, resource.TestCase{ From 6978f392a5f94ea5c8a39e4dac37273793e1d1b5 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Fri, 24 Feb 2023 17:02:01 -0500 Subject: [PATCH 292/763] Add 'ctx := acctest.Context(t)' for events. --- internal/service/events/bus_data_source_test.go | 1 + internal/service/events/connection_data_source_test.go | 1 + internal/service/events/source_data_source_test.go | 1 + 3 files changed, 3 insertions(+) diff --git a/internal/service/events/bus_data_source_test.go b/internal/service/events/bus_data_source_test.go index e7a5eb160856..31c7bfc6fad2 100644 --- a/internal/service/events/bus_data_source_test.go +++ b/internal/service/events/bus_data_source_test.go @@ -11,6 +11,7 @@ import ( ) func TestAccEventsBusDataSource_basic(t *testing.T) { + ctx := acctest.Context(t) busName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) dataSourceName := "data.aws_cloudwatch_event_bus.test" resourceName := "aws_cloudwatch_event_bus.test" diff --git a/internal/service/events/connection_data_source_test.go b/internal/service/events/connection_data_source_test.go index 86e16e560b7c..d4be2f8027db 100644 --- a/internal/service/events/connection_data_source_test.go +++ b/internal/service/events/connection_data_source_test.go @@ -9,6 +9,7 @@ import ( ) func TestAccEventsConnectionDataSource_Connection_basic(t *testing.T) { + ctx := acctest.Context(t) dataSourceName := "data.aws_cloudwatch_event_connection.test" resourceName := "aws_cloudwatch_event_connection.api_key" diff --git a/internal/service/events/source_data_source_test.go b/internal/service/events/source_data_source_test.go index 16c554cfc4a6..cc2ffba70e0e 100644 --- a/internal/service/events/source_data_source_test.go +++ b/internal/service/events/source_data_source_test.go @@ -12,6 +12,7 @@ import ( ) func TestAccEventsSourceDataSource_basic(t *testing.T) { + ctx := acctest.Context(t) key := "EVENT_BRIDGE_PARTNER_EVENT_SOURCE_NAME" busName := os.Getenv(key) if busName == "" { From 79998cf312c4f1daca6b0f8daeb0dc103ac7b1ca Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Fri, 24 Feb 2023 17:02:02 -0500 Subject: [PATCH 293/763] Add 'ctx := acctest.Context(t)' for glue. --- internal/service/glue/catalog_table_data_source_test.go | 1 + internal/service/glue/connection_data_source_test.go | 1 + .../glue/data_catalog_encryption_settings_data_source_test.go | 1 + internal/service/glue/script_data_source_test.go | 2 ++ 4 files changed, 5 insertions(+) diff --git a/internal/service/glue/catalog_table_data_source_test.go b/internal/service/glue/catalog_table_data_source_test.go index c8210807fe22..ca2c7fec3e32 100644 --- a/internal/service/glue/catalog_table_data_source_test.go +++ b/internal/service/glue/catalog_table_data_source_test.go @@ -11,6 +11,7 @@ import ( ) func TestAccGlueCatalogTableDataSource_basic(t *testing.T) { + ctx := acctest.Context(t) resourceName := "aws_glue_catalog_table.test" datasourceName := "data.aws_glue_catalog_table.test" diff --git a/internal/service/glue/connection_data_source_test.go b/internal/service/glue/connection_data_source_test.go index 9e5083274fd3..d6bac7c0c3d2 100644 --- a/internal/service/glue/connection_data_source_test.go +++ b/internal/service/glue/connection_data_source_test.go @@ -12,6 +12,7 @@ import ( ) func TestAccGlueConnectionDataSource_basic(t *testing.T) { + ctx := acctest.Context(t) resourceName := "aws_glue_connection.test" datasourceName := "data.aws_glue_connection.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) 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 558b8d0a317a..897e5d394447 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 @@ -9,6 +9,7 @@ import ( ) func testAccDataCatalogEncryptionSettingsDataSource_basic(t *testing.T) { + ctx := acctest.Context(t) t.Skipf("Skipping aws_glue_data_catalog_encryption_settings tests due to potential KMS key corruption") resourceName := "aws_glue_data_catalog_encryption_settings.test" diff --git a/internal/service/glue/script_data_source_test.go b/internal/service/glue/script_data_source_test.go index 2fb6b93774d9..2a5eca15c794 100644 --- a/internal/service/glue/script_data_source_test.go +++ b/internal/service/glue/script_data_source_test.go @@ -10,6 +10,7 @@ import ( ) func TestAccGlueScriptDataSource_Language_python(t *testing.T) { + ctx := acctest.Context(t) dataSourceName := "data.aws_glue_script.test" resource.ParallelTest(t, resource.TestCase{ @@ -28,6 +29,7 @@ func TestAccGlueScriptDataSource_Language_python(t *testing.T) { } func TestAccGlueScriptDataSource_Language_scala(t *testing.T) { + ctx := acctest.Context(t) dataSourceName := "data.aws_glue_script.test" resource.ParallelTest(t, resource.TestCase{ From 83e6c8787fbca222b11fab668b0dca5243476215 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Fri, 24 Feb 2023 17:02:02 -0500 Subject: [PATCH 294/763] Add 'ctx := acctest.Context(t)' for grafana. --- internal/service/grafana/workspace_api_key_test.go | 1 + 1 file changed, 1 insertion(+) diff --git a/internal/service/grafana/workspace_api_key_test.go b/internal/service/grafana/workspace_api_key_test.go index dde0665e74c1..5419f813a592 100644 --- a/internal/service/grafana/workspace_api_key_test.go +++ b/internal/service/grafana/workspace_api_key_test.go @@ -11,6 +11,7 @@ import ( ) func testAccWorkspaceAPIKey_basic(t *testing.T) { + ctx := acctest.Context(t) rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resourceName := "aws_grafana_workspace_api_key.test" workspaceResourceName := "aws_grafana_workspace.test" From 86bf42c4c089c277ff24390a21319b2b460932b8 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Fri, 24 Feb 2023 17:02:03 -0500 Subject: [PATCH 295/763] Add 'ctx := acctest.Context(t)' for guardduty. --- internal/service/guardduty/detector_data_source_test.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/internal/service/guardduty/detector_data_source_test.go b/internal/service/guardduty/detector_data_source_test.go index fc37b90a76c5..d209515f94ef 100644 --- a/internal/service/guardduty/detector_data_source_test.go +++ b/internal/service/guardduty/detector_data_source_test.go @@ -9,6 +9,7 @@ import ( ) func testAccDetectorDataSource_basic(t *testing.T) { + ctx := acctest.Context(t) resource.Test(t, resource.TestCase{ PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, guardduty.EndpointsID), @@ -33,6 +34,7 @@ func testAccDetectorDataSource_basic(t *testing.T) { } func testAccDetectorDataSource_ID(t *testing.T) { + ctx := acctest.Context(t) resource.Test(t, resource.TestCase{ PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, guardduty.EndpointsID), From 7fd6545221f6c73cb089b9d3a3c584a9ef6146f5 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Fri, 24 Feb 2023 17:02:03 -0500 Subject: [PATCH 296/763] Add 'ctx := acctest.Context(t)' for iam. --- .../service/iam/group_data_source_test.go | 2 ++ .../iam/instance_profile_data_source_test.go | 1 + .../iam/instance_profiles_data_source_test.go | 1 + .../service/iam/policy_data_source_test.go | 7 +++++++ .../iam/policy_document_data_source_test.go | 20 +++++++++++++++++++ internal/service/iam/role_data_source_test.go | 2 ++ .../service/iam/roles_data_source_test.go | 5 +++++ .../iam/saml_provider_data_source_test.go | 1 + .../iam/session_context_data_source_test.go | 5 +++++ internal/service/iam/user_data_source_test.go | 2 ++ .../iam/user_ssh_key_data_source_test.go | 1 + .../service/iam/users_data_source_test.go | 4 ++++ 12 files changed, 51 insertions(+) diff --git a/internal/service/iam/group_data_source_test.go b/internal/service/iam/group_data_source_test.go index b7ba69fe1d2b..a1929c18ee17 100644 --- a/internal/service/iam/group_data_source_test.go +++ b/internal/service/iam/group_data_source_test.go @@ -11,6 +11,7 @@ import ( ) func TestAccIAMGroupDataSource_basic(t *testing.T) { + ctx := acctest.Context(t) groupName := fmt.Sprintf("test-datasource-user-%d", sdkacctest.RandInt()) resource.ParallelTest(t, resource.TestCase{ @@ -32,6 +33,7 @@ func TestAccIAMGroupDataSource_basic(t *testing.T) { } func TestAccIAMGroupDataSource_users(t *testing.T) { + ctx := acctest.Context(t) groupName := fmt.Sprintf("test-datasource-group-%d", sdkacctest.RandInt()) userName := fmt.Sprintf("test-datasource-user-%d", sdkacctest.RandInt()) groupMemberShipName := fmt.Sprintf("test-datasource-group-membership-%d", sdkacctest.RandInt()) diff --git a/internal/service/iam/instance_profile_data_source_test.go b/internal/service/iam/instance_profile_data_source_test.go index 7602ec750744..bd36c4bd2a39 100644 --- a/internal/service/iam/instance_profile_data_source_test.go +++ b/internal/service/iam/instance_profile_data_source_test.go @@ -11,6 +11,7 @@ import ( ) func TestAccIAMInstanceProfileDataSource_basic(t *testing.T) { + ctx := acctest.Context(t) resourceName := "data.aws_iam_instance_profile.test" roleName := fmt.Sprintf("tf-acc-ds-instance-profile-role-%d", sdkacctest.RandInt()) diff --git a/internal/service/iam/instance_profiles_data_source_test.go b/internal/service/iam/instance_profiles_data_source_test.go index 9859cec0885e..6752ccdcdc5e 100644 --- a/internal/service/iam/instance_profiles_data_source_test.go +++ b/internal/service/iam/instance_profiles_data_source_test.go @@ -11,6 +11,7 @@ import ( ) func TestAccIAMInstanceProfilesDataSource_basic(t *testing.T) { + ctx := acctest.Context(t) datasourceName := "data.aws_iam_instance_profiles.test" resourceName := "aws_iam_instance_profile.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) diff --git a/internal/service/iam/policy_data_source_test.go b/internal/service/iam/policy_data_source_test.go index d189f4a280b4..c62bc76cb71b 100644 --- a/internal/service/iam/policy_data_source_test.go +++ b/internal/service/iam/policy_data_source_test.go @@ -57,6 +57,7 @@ func TestPolicySearchDetails(t *testing.T) { } func TestAccIAMPolicyDataSource_arn(t *testing.T) { + ctx := acctest.Context(t) datasourceName := "data.aws_iam_policy.test" resourceName := "aws_iam_policy.test" policyName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) @@ -83,6 +84,7 @@ func TestAccIAMPolicyDataSource_arn(t *testing.T) { } func TestAccIAMPolicyDataSource_arnTags(t *testing.T) { + ctx := acctest.Context(t) datasourceName := "data.aws_iam_policy.test" resourceName := "aws_iam_policy.test" policyName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) @@ -110,6 +112,7 @@ func TestAccIAMPolicyDataSource_arnTags(t *testing.T) { } func TestAccIAMPolicyDataSource_name(t *testing.T) { + ctx := acctest.Context(t) datasourceName := "data.aws_iam_policy.test" resourceName := "aws_iam_policy.test" policyName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) @@ -136,6 +139,7 @@ func TestAccIAMPolicyDataSource_name(t *testing.T) { } func TestAccIAMPolicyDataSource_nameTags(t *testing.T) { + ctx := acctest.Context(t) datasourceName := "data.aws_iam_policy.test" resourceName := "aws_iam_policy.test" policyName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) @@ -163,6 +167,7 @@ func TestAccIAMPolicyDataSource_nameTags(t *testing.T) { } func TestAccIAMPolicyDataSource_nameAndPathPrefix(t *testing.T) { + ctx := acctest.Context(t) datasourceName := "data.aws_iam_policy.test" resourceName := "aws_iam_policy.test" @@ -191,6 +196,7 @@ func TestAccIAMPolicyDataSource_nameAndPathPrefix(t *testing.T) { } func TestAccIAMPolicyDataSource_nameAndPathPrefixTags(t *testing.T) { + ctx := acctest.Context(t) datasourceName := "data.aws_iam_policy.test" resourceName := "aws_iam_policy.test" @@ -220,6 +226,7 @@ func TestAccIAMPolicyDataSource_nameAndPathPrefixTags(t *testing.T) { } func TestAccIAMPolicyDataSource_nonExistent(t *testing.T) { + ctx := acctest.Context(t) policyName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) policyPath := "/test-path/" diff --git a/internal/service/iam/policy_document_data_source_test.go b/internal/service/iam/policy_document_data_source_test.go index ab5acca5163b..73883c1d387d 100644 --- a/internal/service/iam/policy_document_data_source_test.go +++ b/internal/service/iam/policy_document_data_source_test.go @@ -15,6 +15,7 @@ func TestAccIAMPolicyDocumentDataSource_basic(t *testing.T) { // This really ought to be able to be a unit test rather than an // acceptance test, but just instantiating the AWS provider requires // some AWS API calls, and so this needs valid AWS credentials to work. + ctx := acctest.Context(t) resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, iam.EndpointsID), @@ -33,6 +34,7 @@ func TestAccIAMPolicyDocumentDataSource_basic(t *testing.T) { } func TestAccIAMPolicyDocumentDataSource_singleConditionValue(t *testing.T) { + ctx := acctest.Context(t) dataSourceName := "data.aws_iam_policy_document.test" resource.ParallelTest(t, resource.TestCase{ @@ -51,6 +53,7 @@ func TestAccIAMPolicyDocumentDataSource_singleConditionValue(t *testing.T) { } func TestAccIAMPolicyDocumentDataSource_conditionWithBoolValue(t *testing.T) { + ctx := acctest.Context(t) resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, iam.EndpointsID), @@ -72,6 +75,7 @@ func TestAccIAMPolicyDocumentDataSource_source(t *testing.T) { // This really ought to be able to be a unit test rather than an // acceptance test, but just instantiating the AWS provider requires // some AWS API calls, and so this needs valid AWS credentials to work. + ctx := acctest.Context(t) resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, iam.EndpointsID), @@ -98,6 +102,7 @@ func TestAccIAMPolicyDocumentDataSource_source(t *testing.T) { } func TestAccIAMPolicyDocumentDataSource_sourceList(t *testing.T) { + ctx := acctest.Context(t) resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, iam.EndpointsID), @@ -116,6 +121,7 @@ func TestAccIAMPolicyDocumentDataSource_sourceList(t *testing.T) { } func TestAccIAMPolicyDocumentDataSource_sourceConflicting(t *testing.T) { + ctx := acctest.Context(t) resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, iam.EndpointsID), @@ -134,6 +140,7 @@ func TestAccIAMPolicyDocumentDataSource_sourceConflicting(t *testing.T) { } func TestAccIAMPolicyDocumentDataSource_sourceListConflicting(t *testing.T) { + ctx := acctest.Context(t) resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, iam.EndpointsID), @@ -148,6 +155,7 @@ func TestAccIAMPolicyDocumentDataSource_sourceListConflicting(t *testing.T) { } func TestAccIAMPolicyDocumentDataSource_override(t *testing.T) { + ctx := acctest.Context(t) resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, iam.EndpointsID), @@ -166,6 +174,7 @@ func TestAccIAMPolicyDocumentDataSource_override(t *testing.T) { } func TestAccIAMPolicyDocumentDataSource_overrideList(t *testing.T) { + ctx := acctest.Context(t) resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, iam.EndpointsID), @@ -184,6 +193,7 @@ func TestAccIAMPolicyDocumentDataSource_overrideList(t *testing.T) { } func TestAccIAMPolicyDocumentDataSource_noStatementMerge(t *testing.T) { + ctx := acctest.Context(t) resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, iam.EndpointsID), @@ -202,6 +212,7 @@ func TestAccIAMPolicyDocumentDataSource_noStatementMerge(t *testing.T) { } func TestAccIAMPolicyDocumentDataSource_noStatementOverride(t *testing.T) { + ctx := acctest.Context(t) resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, iam.EndpointsID), @@ -220,6 +231,7 @@ func TestAccIAMPolicyDocumentDataSource_noStatementOverride(t *testing.T) { } func TestAccIAMPolicyDocumentDataSource_duplicateSid(t *testing.T) { + ctx := acctest.Context(t) resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, iam.EndpointsID), @@ -242,6 +254,7 @@ func TestAccIAMPolicyDocumentDataSource_duplicateSid(t *testing.T) { } func TestAccIAMPolicyDocumentDataSource_sourcePolicyValidJSON(t *testing.T) { + ctx := acctest.Context(t) resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, iam.EndpointsID), @@ -264,6 +277,7 @@ func TestAccIAMPolicyDocumentDataSource_sourcePolicyValidJSON(t *testing.T) { } func TestAccIAMPolicyDocumentDataSource_overridePolicyDocumentValidJSON(t *testing.T) { + ctx := acctest.Context(t) resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, iam.EndpointsID), @@ -286,6 +300,7 @@ 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), @@ -308,6 +323,7 @@ func TestAccIAMPolicyDocumentDataSource_overrideJSONValidJSON(t *testing.T) { } 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), @@ -331,6 +347,7 @@ func TestAccIAMPolicyDocumentDataSource_sourceJSONValidJSON(t *testing.T) { // Reference: https://github.com/hashicorp/terraform-provider-aws/issues/10777 func TestAccIAMPolicyDocumentDataSource_StatementPrincipalIdentifiers_stringAndSlice(t *testing.T) { + ctx := acctest.Context(t) dataSourceName := "data.aws_iam_policy_document.test" resource.ParallelTest(t, resource.TestCase{ @@ -350,6 +367,7 @@ func TestAccIAMPolicyDocumentDataSource_StatementPrincipalIdentifiers_stringAndS // Reference: https://github.com/hashicorp/terraform-provider-aws/issues/10777 func TestAccIAMPolicyDocumentDataSource_StatementPrincipalIdentifiers_multiplePrincipals(t *testing.T) { + ctx := acctest.Context(t) dataSourceName := "data.aws_iam_policy_document.test" resource.ParallelTest(t, resource.TestCase{ @@ -368,6 +386,7 @@ func TestAccIAMPolicyDocumentDataSource_StatementPrincipalIdentifiers_multiplePr } func TestAccIAMPolicyDocumentDataSource_StatementPrincipalIdentifiers_multiplePrincipalsGov(t *testing.T) { + ctx := acctest.Context(t) dataSourceName := "data.aws_iam_policy_document.test" resource.ParallelTest(t, resource.TestCase{ @@ -386,6 +405,7 @@ func TestAccIAMPolicyDocumentDataSource_StatementPrincipalIdentifiers_multiplePr } func TestAccIAMPolicyDocumentDataSource_version20081017(t *testing.T) { + ctx := acctest.Context(t) resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, iam.EndpointsID), diff --git a/internal/service/iam/role_data_source_test.go b/internal/service/iam/role_data_source_test.go index 9efccfc548ce..d0022184776c 100644 --- a/internal/service/iam/role_data_source_test.go +++ b/internal/service/iam/role_data_source_test.go @@ -11,6 +11,7 @@ import ( ) func TestAccIAMRoleDataSource_basic(t *testing.T) { + ctx := acctest.Context(t) roleName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) dataSourceName := "data.aws_iam_role.test" resourceName := "aws_iam_role.test" @@ -39,6 +40,7 @@ func TestAccIAMRoleDataSource_basic(t *testing.T) { } func TestAccIAMRoleDataSource_tags(t *testing.T) { + ctx := acctest.Context(t) roleName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) dataSourceName := "data.aws_iam_role.test" resourceName := "aws_iam_role.test" diff --git a/internal/service/iam/roles_data_source_test.go b/internal/service/iam/roles_data_source_test.go index 950afe605c4e..a3c0e8309e3d 100644 --- a/internal/service/iam/roles_data_source_test.go +++ b/internal/service/iam/roles_data_source_test.go @@ -13,6 +13,7 @@ import ( ) func TestAccIAMRolesDataSource_basic(t *testing.T) { + ctx := acctest.Context(t) dataSourceName := "data.aws_iam_roles.test" resource.ParallelTest(t, resource.TestCase{ @@ -31,6 +32,7 @@ func TestAccIAMRolesDataSource_basic(t *testing.T) { } func TestAccIAMRolesDataSource_nameRegex(t *testing.T) { + ctx := acctest.Context(t) rCount := strconv.Itoa(sdkacctest.RandIntRange(1, 4)) rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) dataSourceName := "data.aws_iam_roles.test" @@ -52,6 +54,7 @@ func TestAccIAMRolesDataSource_nameRegex(t *testing.T) { } func TestAccIAMRolesDataSource_pathPrefix(t *testing.T) { + ctx := acctest.Context(t) rCount := strconv.Itoa(sdkacctest.RandIntRange(1, 4)) rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) rPathPrefix := sdkacctest.RandomWithPrefix("tf-acc-path") @@ -74,6 +77,7 @@ func TestAccIAMRolesDataSource_pathPrefix(t *testing.T) { } func TestAccIAMRolesDataSource_nonExistentPathPrefix(t *testing.T) { + ctx := acctest.Context(t) dataSourceName := "data.aws_iam_roles.test" resource.ParallelTest(t, resource.TestCase{ @@ -93,6 +97,7 @@ func TestAccIAMRolesDataSource_nonExistentPathPrefix(t *testing.T) { } func TestAccIAMRolesDataSource_nameRegexAndPathPrefix(t *testing.T) { + ctx := acctest.Context(t) rCount := strconv.Itoa(sdkacctest.RandIntRange(1, 4)) rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) rPathPrefix := sdkacctest.RandomWithPrefix("tf-acc-path") diff --git a/internal/service/iam/saml_provider_data_source_test.go b/internal/service/iam/saml_provider_data_source_test.go index 29e5a01ca3a9..59ec9e6c7602 100644 --- a/internal/service/iam/saml_provider_data_source_test.go +++ b/internal/service/iam/saml_provider_data_source_test.go @@ -11,6 +11,7 @@ import ( ) func TestAccIAMSAMLProviderDataSource_basic(t *testing.T) { + ctx := acctest.Context(t) rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) idpEntityID := fmt.Sprintf("https://%s", acctest.RandomDomainName()) dataSourceName := "data.aws_iam_saml_provider.test" diff --git a/internal/service/iam/session_context_data_source_test.go b/internal/service/iam/session_context_data_source_test.go index 1bdce4dbf993..5f003817acdb 100644 --- a/internal/service/iam/session_context_data_source_test.go +++ b/internal/service/iam/session_context_data_source_test.go @@ -98,6 +98,7 @@ func TestAssumedRoleRoleSessionName(t *testing.T) { } func TestAccIAMSessionContextDataSource_basic(t *testing.T) { + ctx := acctest.Context(t) rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) dataSourceName := "data.aws_iam_session_context.test" resourceName := "aws_iam_role.test" @@ -121,6 +122,7 @@ func TestAccIAMSessionContextDataSource_basic(t *testing.T) { } func TestAccIAMSessionContextDataSource_withPath(t *testing.T) { + ctx := acctest.Context(t) rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) dataSourceName := "data.aws_iam_session_context.test" resourceName := "aws_iam_role.test" @@ -143,6 +145,7 @@ func TestAccIAMSessionContextDataSource_withPath(t *testing.T) { } func TestAccIAMSessionContextDataSource_notAssumedRole(t *testing.T) { + ctx := acctest.Context(t) rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) dataSourceName := "data.aws_iam_session_context.test" resourceName := "aws_iam_role.test" @@ -165,6 +168,7 @@ func TestAccIAMSessionContextDataSource_notAssumedRole(t *testing.T) { } func TestAccIAMSessionContextDataSource_notAssumedRoleWithPath(t *testing.T) { + ctx := acctest.Context(t) rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) dataSourceName := "data.aws_iam_session_context.test" resourceName := "aws_iam_role.test" @@ -187,6 +191,7 @@ func TestAccIAMSessionContextDataSource_notAssumedRoleWithPath(t *testing.T) { } func TestAccIAMSessionContextDataSource_notAssumedRoleUser(t *testing.T) { + ctx := acctest.Context(t) rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) dataSourceName := "data.aws_iam_session_context.test" diff --git a/internal/service/iam/user_data_source_test.go b/internal/service/iam/user_data_source_test.go index 988260aa88cf..f8c996db4d5f 100644 --- a/internal/service/iam/user_data_source_test.go +++ b/internal/service/iam/user_data_source_test.go @@ -11,6 +11,7 @@ import ( ) func TestAccIAMUserDataSource_basic(t *testing.T) { + ctx := acctest.Context(t) resourceName := "aws_iam_user.test" dataSourceName := "data.aws_iam_user.test" @@ -37,6 +38,7 @@ func TestAccIAMUserDataSource_basic(t *testing.T) { } func TestAccIAMUserDataSource_tags(t *testing.T) { + ctx := acctest.Context(t) resourceName := "aws_iam_user.test" dataSourceName := "data.aws_iam_user.test" 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 474230f6e940..ece0b06a0ed3 100644 --- a/internal/service/iam/user_ssh_key_data_source_test.go +++ b/internal/service/iam/user_ssh_key_data_source_test.go @@ -11,6 +11,7 @@ import ( ) func TestAccIAMUserSSHKeyDataSource_basic(t *testing.T) { + ctx := acctest.Context(t) resourceName := "aws_iam_user_ssh_key.test" dataSourceName := "data.aws_iam_user_ssh_key.test" diff --git a/internal/service/iam/users_data_source_test.go b/internal/service/iam/users_data_source_test.go index 26ba93043b3f..d6a19e1216a8 100644 --- a/internal/service/iam/users_data_source_test.go +++ b/internal/service/iam/users_data_source_test.go @@ -12,6 +12,7 @@ import ( ) func TestAccIAMUsersDataSource_nameRegex(t *testing.T) { + ctx := acctest.Context(t) dataSourceName := "data.aws_iam_users.test" rCount := strconv.Itoa(sdkacctest.RandIntRange(1, 4)) rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) @@ -33,6 +34,7 @@ func TestAccIAMUsersDataSource_nameRegex(t *testing.T) { } func TestAccIAMUsersDataSource_pathPrefix(t *testing.T) { + ctx := acctest.Context(t) dataSourceName := "data.aws_iam_users.test" rCount := strconv.Itoa(sdkacctest.RandIntRange(1, 4)) rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) @@ -55,6 +57,7 @@ func TestAccIAMUsersDataSource_pathPrefix(t *testing.T) { } func TestAccIAMUsersDataSource_nonExistentNameRegex(t *testing.T) { + ctx := acctest.Context(t) dataSourceName := "data.aws_iam_users.test" resource.ParallelTest(t, resource.TestCase{ @@ -74,6 +77,7 @@ func TestAccIAMUsersDataSource_nonExistentNameRegex(t *testing.T) { } func TestAccIAMUsersDataSource_nonExistentPathPrefix(t *testing.T) { + ctx := acctest.Context(t) dataSourceName := "data.aws_iam_users.test" resource.ParallelTest(t, resource.TestCase{ From a718e045908bf03bd8f9e7063976d1bd4814b3a4 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Fri, 24 Feb 2023 17:02:03 -0500 Subject: [PATCH 297/763] Add 'ctx := acctest.Context(t)' for inspector. --- internal/service/inspector/rules_packages_data_source_test.go | 1 + 1 file changed, 1 insertion(+) diff --git a/internal/service/inspector/rules_packages_data_source_test.go b/internal/service/inspector/rules_packages_data_source_test.go index a2fb30b0471d..5b3e4a7d11c0 100644 --- a/internal/service/inspector/rules_packages_data_source_test.go +++ b/internal/service/inspector/rules_packages_data_source_test.go @@ -9,6 +9,7 @@ import ( ) func TestAccInspectorRulesPackagesDataSource_basic(t *testing.T) { + ctx := acctest.Context(t) resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, inspector.EndpointsID), From e44cf4d7e46564142932bd0dc772f5b803148560 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Fri, 24 Feb 2023 17:02:04 -0500 Subject: [PATCH 298/763] Add 'ctx := acctest.Context(t)' for iot. --- internal/service/iot/endpoint_data_source_test.go | 5 +++++ internal/service/iot/indexing_configuration_test.go | 2 ++ internal/service/iot/logging_options_test.go | 2 ++ 3 files changed, 9 insertions(+) diff --git a/internal/service/iot/endpoint_data_source_test.go b/internal/service/iot/endpoint_data_source_test.go index 30018cf232c5..477d6126615a 100644 --- a/internal/service/iot/endpoint_data_source_test.go +++ b/internal/service/iot/endpoint_data_source_test.go @@ -11,6 +11,7 @@ import ( ) func TestAccIoTEndpointDataSource_basic(t *testing.T) { + ctx := acctest.Context(t) dataSourceName := "data.aws_iot_endpoint.test" resource.ParallelTest(t, resource.TestCase{ @@ -29,6 +30,7 @@ func TestAccIoTEndpointDataSource_basic(t *testing.T) { } func TestAccIoTEndpointDataSource_EndpointType_iotCredentialProvider(t *testing.T) { + ctx := acctest.Context(t) dataSourceName := "data.aws_iot_endpoint.test" resource.ParallelTest(t, resource.TestCase{ @@ -47,6 +49,7 @@ func TestAccIoTEndpointDataSource_EndpointType_iotCredentialProvider(t *testing. } func TestAccIoTEndpointDataSource_EndpointType_iotData(t *testing.T) { + ctx := acctest.Context(t) dataSourceName := "data.aws_iot_endpoint.test" resource.ParallelTest(t, resource.TestCase{ @@ -65,6 +68,7 @@ func TestAccIoTEndpointDataSource_EndpointType_iotData(t *testing.T) { } func TestAccIoTEndpointDataSource_EndpointType_iotDataATS(t *testing.T) { + ctx := acctest.Context(t) dataSourceName := "data.aws_iot_endpoint.test" resource.ParallelTest(t, resource.TestCase{ @@ -83,6 +87,7 @@ func TestAccIoTEndpointDataSource_EndpointType_iotDataATS(t *testing.T) { } func TestAccIoTEndpointDataSource_EndpointType_iotJobs(t *testing.T) { + ctx := acctest.Context(t) dataSourceName := "data.aws_iot_endpoint.test" resource.ParallelTest(t, resource.TestCase{ diff --git a/internal/service/iot/indexing_configuration_test.go b/internal/service/iot/indexing_configuration_test.go index a929f45846db..123572e4bf75 100644 --- a/internal/service/iot/indexing_configuration_test.go +++ b/internal/service/iot/indexing_configuration_test.go @@ -20,6 +20,7 @@ func TestAccIoTIndexingConfiguration_serial(t *testing.T) { } func testAccIndexingConfiguration_basic(t *testing.T) { + ctx := acctest.Context(t) resourceName := "aws_iot_indexing_configuration.test" resource.Test(t, resource.TestCase{ @@ -54,6 +55,7 @@ func testAccIndexingConfiguration_basic(t *testing.T) { } func testAccIndexingConfiguration_allAttributes(t *testing.T) { + ctx := acctest.Context(t) resourceName := "aws_iot_indexing_configuration.test" resource.Test(t, resource.TestCase{ diff --git a/internal/service/iot/logging_options_test.go b/internal/service/iot/logging_options_test.go index 9d343cedac1f..aa24768cffd2 100644 --- a/internal/service/iot/logging_options_test.go +++ b/internal/service/iot/logging_options_test.go @@ -22,6 +22,7 @@ func TestAccIoTLoggingOptions_serial(t *testing.T) { } func testAccLoggingOptions_basic(t *testing.T) { + ctx := acctest.Context(t) rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resourceName := "aws_iot_logging_options.test" @@ -44,6 +45,7 @@ func testAccLoggingOptions_basic(t *testing.T) { } func testAccLoggingOptions_update(t *testing.T) { + ctx := acctest.Context(t) rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resourceName := "aws_iot_logging_options.test" From ef0554af0cad53f103c41deb60c1fbfa644f1e7f Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Fri, 24 Feb 2023 17:02:04 -0500 Subject: [PATCH 299/763] Add 'ctx := acctest.Context(t)' for ivs. --- internal/service/ivs/stream_key_data_source_test.go | 1 + 1 file changed, 1 insertion(+) diff --git a/internal/service/ivs/stream_key_data_source_test.go b/internal/service/ivs/stream_key_data_source_test.go index 3cb5180161c4..b0096c3b623f 100644 --- a/internal/service/ivs/stream_key_data_source_test.go +++ b/internal/service/ivs/stream_key_data_source_test.go @@ -12,6 +12,7 @@ import ( ) func TestAccIVSStreamKeyDataSource_basic(t *testing.T) { + ctx := acctest.Context(t) dataSourceName := "data.aws_ivs_stream_key.test" channelResourceName := "aws_ivs_channel.test" From ae671920f7074152cc4489e8f3d58096d4e8e649 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Fri, 24 Feb 2023 17:02:05 -0500 Subject: [PATCH 300/763] Add 'ctx := acctest.Context(t)' for kafkaconnect. --- internal/service/kafkaconnect/connector_data_source_test.go | 1 + internal/service/kafkaconnect/custom_plugin_data_source_test.go | 1 + .../kafkaconnect/worker_configuration_data_source_test.go | 1 + 3 files changed, 3 insertions(+) diff --git a/internal/service/kafkaconnect/connector_data_source_test.go b/internal/service/kafkaconnect/connector_data_source_test.go index 68e5aa634168..de6ca187865b 100644 --- a/internal/service/kafkaconnect/connector_data_source_test.go +++ b/internal/service/kafkaconnect/connector_data_source_test.go @@ -10,6 +10,7 @@ import ( ) func TestAccKafkaConnectConnectorDataSource_basic(t *testing.T) { + ctx := acctest.Context(t) rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resourceName := "aws_mskconnect_connector.test" dataSourceName := "data.aws_mskconnect_connector.test" diff --git a/internal/service/kafkaconnect/custom_plugin_data_source_test.go b/internal/service/kafkaconnect/custom_plugin_data_source_test.go index abb39bd02783..fb0d1fa42131 100644 --- a/internal/service/kafkaconnect/custom_plugin_data_source_test.go +++ b/internal/service/kafkaconnect/custom_plugin_data_source_test.go @@ -11,6 +11,7 @@ import ( ) func TestAccKafkaConnectCustomPluginDataSource_basic(t *testing.T) { + ctx := acctest.Context(t) rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resourceName := "aws_mskconnect_custom_plugin.test" dataSourceName := "data.aws_mskconnect_custom_plugin.test" diff --git a/internal/service/kafkaconnect/worker_configuration_data_source_test.go b/internal/service/kafkaconnect/worker_configuration_data_source_test.go index d0683cfe3f8b..3f2dfb62cf99 100644 --- a/internal/service/kafkaconnect/worker_configuration_data_source_test.go +++ b/internal/service/kafkaconnect/worker_configuration_data_source_test.go @@ -11,6 +11,7 @@ import ( ) func TestAccKafkaConnectWorkerConfigurationDataSource_basic(t *testing.T) { + ctx := acctest.Context(t) rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resourceName := "aws_mskconnect_worker_configuration.test" dataSourceName := "data.aws_mskconnect_worker_configuration.test" From 0c82b7f98dd891c7c1afa9b4a308d75ac17c969f Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Fri, 24 Feb 2023 17:02:05 -0500 Subject: [PATCH 301/763] Add 'ctx := acctest.Context(t)' for kinesis. --- internal/service/kinesis/stream_consumer_data_source_test.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/internal/service/kinesis/stream_consumer_data_source_test.go b/internal/service/kinesis/stream_consumer_data_source_test.go index 98b480ceb59a..5fa3b9a49440 100644 --- a/internal/service/kinesis/stream_consumer_data_source_test.go +++ b/internal/service/kinesis/stream_consumer_data_source_test.go @@ -11,6 +11,7 @@ import ( ) func TestAccKinesisStreamConsumerDataSource_basic(t *testing.T) { + ctx := acctest.Context(t) rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) dataSourceName := "data.aws_kinesis_stream_consumer.test" resourceName := "aws_kinesis_stream_consumer.test" @@ -37,6 +38,7 @@ func TestAccKinesisStreamConsumerDataSource_basic(t *testing.T) { } func TestAccKinesisStreamConsumerDataSource_name(t *testing.T) { + ctx := acctest.Context(t) rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) dataSourceName := "data.aws_kinesis_stream_consumer.test" resourceName := "aws_kinesis_stream_consumer.test" @@ -63,6 +65,7 @@ func TestAccKinesisStreamConsumerDataSource_name(t *testing.T) { } func TestAccKinesisStreamConsumerDataSource_arn(t *testing.T) { + ctx := acctest.Context(t) rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) dataSourceName := "data.aws_kinesis_stream_consumer.test" resourceName := "aws_kinesis_stream_consumer.test" From 40c895812cd1ce76cd91844db61325891c34e272 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Fri, 24 Feb 2023 17:02:06 -0500 Subject: [PATCH 302/763] Add 'ctx := acctest.Context(t)' for kms. --- internal/service/kms/alias_data_source_test.go | 2 ++ internal/service/kms/ciphertext_data_source_test.go | 3 +++ internal/service/kms/ciphertext_test.go | 3 +++ internal/service/kms/custom_key_store_data_source_test.go | 1 + internal/service/kms/key_data_source_test.go | 7 +++++++ internal/service/kms/public_key_data_source_test.go | 2 ++ internal/service/kms/secret_data_source_test.go | 1 + internal/service/kms/secrets_data_source_test.go | 8 ++++---- 8 files changed, 23 insertions(+), 4 deletions(-) diff --git a/internal/service/kms/alias_data_source_test.go b/internal/service/kms/alias_data_source_test.go index ceba26b03757..53a7cd262015 100644 --- a/internal/service/kms/alias_data_source_test.go +++ b/internal/service/kms/alias_data_source_test.go @@ -12,6 +12,7 @@ import ( ) func TestAccKMSAliasDataSource_service(t *testing.T) { + ctx := acctest.Context(t) rName := "alias/aws/s3" resourceName := "data.aws_kms_alias.test" @@ -34,6 +35,7 @@ func TestAccKMSAliasDataSource_service(t *testing.T) { } func TestAccKMSAliasDataSource_cmk(t *testing.T) { + ctx := acctest.Context(t) rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) aliasResourceName := "aws_kms_alias.test" datasourceAliasResourceName := "data.aws_kms_alias.test" diff --git a/internal/service/kms/ciphertext_data_source_test.go b/internal/service/kms/ciphertext_data_source_test.go index e7fba4908fb0..642c8944cd92 100644 --- a/internal/service/kms/ciphertext_data_source_test.go +++ b/internal/service/kms/ciphertext_data_source_test.go @@ -9,6 +9,7 @@ import ( ) func TestAccKMSCiphertextDataSource_basic(t *testing.T) { + ctx := acctest.Context(t) resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, kms.EndpointsID), @@ -26,6 +27,7 @@ func TestAccKMSCiphertextDataSource_basic(t *testing.T) { } func TestAccKMSCiphertextDataSource_validate(t *testing.T) { + ctx := acctest.Context(t) resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, kms.EndpointsID), @@ -43,6 +45,7 @@ func TestAccKMSCiphertextDataSource_validate(t *testing.T) { } func TestAccKMSCiphertextDataSource_Validate_withContext(t *testing.T) { + ctx := acctest.Context(t) resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, kms.EndpointsID), diff --git a/internal/service/kms/ciphertext_test.go b/internal/service/kms/ciphertext_test.go index 549897d532b5..ab72899770ad 100644 --- a/internal/service/kms/ciphertext_test.go +++ b/internal/service/kms/ciphertext_test.go @@ -9,6 +9,7 @@ import ( ) func TestAccKMSCiphertext_Resource_basic(t *testing.T) { + ctx := acctest.Context(t) resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, kms.EndpointsID), @@ -27,6 +28,7 @@ func TestAccKMSCiphertext_Resource_basic(t *testing.T) { } func TestAccKMSCiphertext_Resource_validate(t *testing.T) { + ctx := acctest.Context(t) kmsSecretsDataSource := "data.aws_kms_secrets.foo" resourceName := "aws_kms_ciphertext.foo" @@ -48,6 +50,7 @@ func TestAccKMSCiphertext_Resource_validate(t *testing.T) { } func TestAccKMSCiphertext_ResourceValidate_withContext(t *testing.T) { + ctx := acctest.Context(t) kmsSecretsDataSource := "data.aws_kms_secrets.foo" resourceName := "aws_kms_ciphertext.foo" 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 e9d69f0ad308..99d2b793ecc7 100644 --- a/internal/service/kms/custom_key_store_data_source_test.go +++ b/internal/service/kms/custom_key_store_data_source_test.go @@ -12,6 +12,7 @@ import ( ) func TestAccKMSCustomKeyStoreDataSource_basic(t *testing.T) { + ctx := acctest.Context(t) if os.Getenv("CLOUD_HSM_CLUSTER_ID") == "" { t.Skip("CLOUD_HSM_CLUSTER_ID environment variable not set") } diff --git a/internal/service/kms/key_data_source_test.go b/internal/service/kms/key_data_source_test.go index 50fb7fcc3538..1597db4f8adf 100644 --- a/internal/service/kms/key_data_source_test.go +++ b/internal/service/kms/key_data_source_test.go @@ -11,6 +11,7 @@ import ( ) func TestAccKMSKeyDataSource_byKeyARN(t *testing.T) { + ctx := acctest.Context(t) resourceName := "aws_kms_key.test" dataSourceName := "data.aws_kms_key.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) @@ -45,6 +46,7 @@ func TestAccKMSKeyDataSource_byKeyARN(t *testing.T) { } func TestAccKMSKeyDataSource_byKeyID(t *testing.T) { + ctx := acctest.Context(t) resourceName := "aws_kms_key.test" dataSourceName := "data.aws_kms_key.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) @@ -79,6 +81,7 @@ func TestAccKMSKeyDataSource_byKeyID(t *testing.T) { } func TestAccKMSKeyDataSource_byAliasARN(t *testing.T) { + ctx := acctest.Context(t) resourceName := "aws_kms_key.test" dataSourceName := "data.aws_kms_key.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) @@ -113,6 +116,7 @@ func TestAccKMSKeyDataSource_byAliasARN(t *testing.T) { } func TestAccKMSKeyDataSource_byAliasID(t *testing.T) { + ctx := acctest.Context(t) resourceName := "aws_kms_key.test" dataSourceName := "data.aws_kms_key.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) @@ -147,6 +151,7 @@ func TestAccKMSKeyDataSource_byAliasID(t *testing.T) { } func TestAccKMSKeyDataSource_grantToken(t *testing.T) { + ctx := acctest.Context(t) resourceName := "aws_kms_key.test" dataSourceName := "data.aws_kms_key.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) @@ -181,6 +186,7 @@ func TestAccKMSKeyDataSource_grantToken(t *testing.T) { } func TestAccKMSKeyDataSource_multiRegionConfigurationByARN(t *testing.T) { + ctx := acctest.Context(t) resourceName := "aws_kms_key.test" dataSourceName := "data.aws_kms_key.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) @@ -220,6 +226,7 @@ func TestAccKMSKeyDataSource_multiRegionConfigurationByARN(t *testing.T) { } func TestAccKMSKeyDataSource_multiRegionConfigurationByID(t *testing.T) { + ctx := acctest.Context(t) resourceName := "aws_kms_key.test" dataSourceName := "data.aws_kms_key.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) diff --git a/internal/service/kms/public_key_data_source_test.go b/internal/service/kms/public_key_data_source_test.go index 2e806fbb3fce..695244183782 100644 --- a/internal/service/kms/public_key_data_source_test.go +++ b/internal/service/kms/public_key_data_source_test.go @@ -12,6 +12,7 @@ import ( ) func TestAccKMSPublicKeyDataSource_basic(t *testing.T) { + ctx := acctest.Context(t) resourceName := "aws_kms_key.test" datasourceName := "data.aws_kms_public_key.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) @@ -38,6 +39,7 @@ func TestAccKMSPublicKeyDataSource_basic(t *testing.T) { } func TestAccKMSPublicKeyDataSource_encrypt(t *testing.T) { + ctx := acctest.Context(t) resourceName := "aws_kms_key.test" datasourceName := "data.aws_kms_public_key.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) diff --git a/internal/service/kms/secret_data_source_test.go b/internal/service/kms/secret_data_source_test.go index f41abb805bdf..044a460c0cc0 100644 --- a/internal/service/kms/secret_data_source_test.go +++ b/internal/service/kms/secret_data_source_test.go @@ -11,6 +11,7 @@ import ( ) func TestAccKMSSecretDataSource_removed(t *testing.T) { + ctx := acctest.Context(t) resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, kms.EndpointsID), diff --git a/internal/service/kms/secrets_data_source_test.go b/internal/service/kms/secrets_data_source_test.go index f7941793d313..e30c1d618d6f 100644 --- a/internal/service/kms/secrets_data_source_test.go +++ b/internal/service/kms/secrets_data_source_test.go @@ -34,7 +34,7 @@ func TestAccKMSSecretsDataSource_basic(t *testing.T) { testAccCheckKeyExists(ctx, resourceName, &key), testAccSecretsEncryptDataSource(ctx, &key, plaintext, &encryptedPayload), // We need to dereference the encryptedPayload in a test Terraform configuration - testAccSecretsDecryptDataSource(t, plaintext, &encryptedPayload), + testAccSecretsDecryptDataSource(ctx, t, plaintext, &encryptedPayload), ), }, }, @@ -61,7 +61,7 @@ func TestAccKMSSecretsDataSource_asymmetric(t *testing.T) { testAccCheckKeyExists(ctx, resourceName, &key), testAccSecretsEncryptDataSourceAsymmetric(ctx, &key, plaintext, &encryptedPayload), // We need to dereference the encryptedPayload in a test Terraform configuration - testAccSecretsDecryptDataSourceAsym(t, &key, plaintext, &encryptedPayload), + testAccSecretsDecryptDataSourceAsym(ctx, t, &key, plaintext, &encryptedPayload), ), }, }, @@ -114,7 +114,7 @@ func testAccSecretsEncryptDataSourceAsymmetric(ctx context.Context, key *kms.Key } } -func testAccSecretsDecryptDataSource(t *testing.T, plaintext string, encryptedPayload *string) resource.TestCheckFunc { +func testAccSecretsDecryptDataSource(ctx context.Context, t *testing.T, plaintext string, encryptedPayload *string) resource.TestCheckFunc { return func(s *terraform.State) error { dataSourceName := "data.aws_kms_secrets.test" @@ -137,7 +137,7 @@ func testAccSecretsDecryptDataSource(t *testing.T, plaintext string, encryptedPa } } -func testAccSecretsDecryptDataSourceAsym(t *testing.T, key *kms.KeyMetadata, plaintext string, encryptedPayload *string) resource.TestCheckFunc { +func testAccSecretsDecryptDataSourceAsym(ctx context.Context, t *testing.T, key *kms.KeyMetadata, plaintext string, encryptedPayload *string) resource.TestCheckFunc { return func(s *terraform.State) error { dataSourceName := "data.aws_kms_secrets.test" keyid := key.Arn From 30a320fa95021277d6bd9e8f2fa7556c034f8aa3 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Fri, 24 Feb 2023 17:02:06 -0500 Subject: [PATCH 303/763] Add 'ctx := acctest.Context(t)' for lambda. --- internal/service/lambda/alias_data_source_test.go | 1 + .../lambda/code_signing_config_data_source_test.go | 3 +++ internal/service/lambda/function_data_source_test.go | 12 ++++++++++++ internal/service/lambda/function_test.go | 5 ++++- .../service/lambda/function_url_data_source_test.go | 1 + .../service/lambda/functions_data_source_test.go | 1 + .../service/lambda/invocation_data_source_test.go | 3 +++ internal/service/lambda/invocation_test.go | 4 ++++ .../service/lambda/layer_version_data_source_test.go | 4 ++++ 9 files changed, 33 insertions(+), 1 deletion(-) diff --git a/internal/service/lambda/alias_data_source_test.go b/internal/service/lambda/alias_data_source_test.go index 2e511115aec7..b259f88aa279 100644 --- a/internal/service/lambda/alias_data_source_test.go +++ b/internal/service/lambda/alias_data_source_test.go @@ -11,6 +11,7 @@ import ( ) func TestAccLambdaAliasDataSource_basic(t *testing.T) { + ctx := acctest.Context(t) rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) dataSourceName := "data.aws_lambda_alias.test" 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 60581fbcdb03..1591104eb8e4 100644 --- a/internal/service/lambda/code_signing_config_data_source_test.go +++ b/internal/service/lambda/code_signing_config_data_source_test.go @@ -9,6 +9,7 @@ import ( ) func TestAccLambdaCodeSigningConfigDataSource_basic(t *testing.T) { + ctx := acctest.Context(t) dataSourceName := "data.aws_lambda_code_signing_config.test" resourceName := "aws_lambda_code_signing_config.test" resource.ParallelTest(t, resource.TestCase{ @@ -28,6 +29,7 @@ func TestAccLambdaCodeSigningConfigDataSource_basic(t *testing.T) { } func TestAccLambdaCodeSigningConfigDataSource_policyID(t *testing.T) { + ctx := acctest.Context(t) dataSourceName := "data.aws_lambda_code_signing_config.test" resourceName := "aws_lambda_code_signing_config.test" resource.ParallelTest(t, resource.TestCase{ @@ -49,6 +51,7 @@ func TestAccLambdaCodeSigningConfigDataSource_policyID(t *testing.T) { } func TestAccLambdaCodeSigningConfigDataSource_description(t *testing.T) { + ctx := acctest.Context(t) dataSourceName := "data.aws_lambda_code_signing_config.test" resourceName := "aws_lambda_code_signing_config.test" resource.ParallelTest(t, resource.TestCase{ diff --git a/internal/service/lambda/function_data_source_test.go b/internal/service/lambda/function_data_source_test.go index 634a9139d4f7..01f59d886205 100644 --- a/internal/service/lambda/function_data_source_test.go +++ b/internal/service/lambda/function_data_source_test.go @@ -12,6 +12,7 @@ import ( ) func TestAccLambdaFunctionDataSource_basic(t *testing.T) { + ctx := acctest.Context(t) rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) dataSourceName := "data.aws_lambda_function.test" resourceName := "aws_lambda_function.test" @@ -56,6 +57,7 @@ func TestAccLambdaFunctionDataSource_basic(t *testing.T) { } func TestAccLambdaFunctionDataSource_version(t *testing.T) { + ctx := acctest.Context(t) rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) dataSourceName := "data.aws_lambda_function.test" resourceName := "aws_lambda_function.test" @@ -81,6 +83,7 @@ func TestAccLambdaFunctionDataSource_version(t *testing.T) { } func TestAccLambdaFunctionDataSource_latestVersion(t *testing.T) { + ctx := acctest.Context(t) rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) dataSourceName := "data.aws_lambda_function.test" resourceName := "aws_lambda_function.test" @@ -105,6 +108,7 @@ func TestAccLambdaFunctionDataSource_latestVersion(t *testing.T) { } func TestAccLambdaFunctionDataSource_unpublishedVersion(t *testing.T) { + ctx := acctest.Context(t) rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) dataSourceName := "data.aws_lambda_function.test" resourceName := "aws_lambda_function.test" @@ -129,6 +133,7 @@ func TestAccLambdaFunctionDataSource_unpublishedVersion(t *testing.T) { } func TestAccLambdaFunctionDataSource_alias(t *testing.T) { + ctx := acctest.Context(t) rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) dataSourceName := "data.aws_lambda_function.test" lambdaAliasResourceName := "aws_lambda_alias.test" @@ -153,6 +158,7 @@ func TestAccLambdaFunctionDataSource_alias(t *testing.T) { } func TestAccLambdaFunctionDataSource_layers(t *testing.T) { + ctx := acctest.Context(t) rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) dataSourceName := "data.aws_lambda_function.test" resourceName := "aws_lambda_function.test" @@ -174,6 +180,7 @@ func TestAccLambdaFunctionDataSource_layers(t *testing.T) { } func TestAccLambdaFunctionDataSource_vpc(t *testing.T) { + ctx := acctest.Context(t) if testing.Short() { t.Skip("skipping long-running test in short mode") } @@ -201,6 +208,7 @@ func TestAccLambdaFunctionDataSource_vpc(t *testing.T) { } func TestAccLambdaFunctionDataSource_environment(t *testing.T) { + ctx := acctest.Context(t) rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) dataSourceName := "data.aws_lambda_function.test" resourceName := "aws_lambda_function.test" @@ -225,6 +233,7 @@ func TestAccLambdaFunctionDataSource_environment(t *testing.T) { } func TestAccLambdaFunctionDataSource_fileSystem(t *testing.T) { + ctx := acctest.Context(t) if testing.Short() { t.Skip("skipping long-running test in short mode") } @@ -252,6 +261,7 @@ func TestAccLambdaFunctionDataSource_fileSystem(t *testing.T) { } func TestAccLambdaFunctionDataSource_image(t *testing.T) { + ctx := acctest.Context(t) rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) dataSourceName := "data.aws_lambda_function.test" resourceName := "aws_lambda_function.test" @@ -275,6 +285,7 @@ func TestAccLambdaFunctionDataSource_image(t *testing.T) { } func TestAccLambdaFunctionDataSource_architectures(t *testing.T) { + ctx := acctest.Context(t) rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) dataSourceName := "data.aws_lambda_function.test" resourceName := "aws_lambda_function.test" @@ -295,6 +306,7 @@ func TestAccLambdaFunctionDataSource_architectures(t *testing.T) { } func TestAccLambdaFunctionDataSource_ephemeralStorage(t *testing.T) { + ctx := acctest.Context(t) rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) dataSourceName := "data.aws_lambda_function.test" resourceName := "aws_lambda_function.test" diff --git a/internal/service/lambda/function_test.go b/internal/service/lambda/function_test.go index 14c40a7065ce..5a91f2d19336 100644 --- a/internal/service/lambda/function_test.go +++ b/internal/service/lambda/function_test.go @@ -223,7 +223,10 @@ func TestAccLambdaFunction_codeSigning(t *testing.T) { cscUpdateResourceName := "aws_lambda_code_signing_config.code_signing_config_2" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckSignerSigningProfile(ctx, t, "AWSLambda-SHA384-ECDSA") }, + PreCheck: func() { + acctest.PreCheck(ctx, t) + testAccPreCheckSignerSigningProfile(ctx, t, "AWSLambda-SHA384-ECDSA") + }, ErrorCheck: acctest.ErrorCheck(t, lambda.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckFunctionDestroy(ctx), diff --git a/internal/service/lambda/function_url_data_source_test.go b/internal/service/lambda/function_url_data_source_test.go index 4fddb0525c59..7ae19012eae6 100644 --- a/internal/service/lambda/function_url_data_source_test.go +++ b/internal/service/lambda/function_url_data_source_test.go @@ -11,6 +11,7 @@ import ( ) func TestAccLambdaFunctionURLDataSource_basic(t *testing.T) { + ctx := acctest.Context(t) rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) dataSourceName := "data.aws_lambda_function_url.test" resourceName := "aws_lambda_function_url.test" diff --git a/internal/service/lambda/functions_data_source_test.go b/internal/service/lambda/functions_data_source_test.go index f05490f32046..85162c0a8423 100644 --- a/internal/service/lambda/functions_data_source_test.go +++ b/internal/service/lambda/functions_data_source_test.go @@ -10,6 +10,7 @@ import ( ) func TestAccLambdaFunctionsDataSource_basic(t *testing.T) { + ctx := acctest.Context(t) rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) dataSourceName := "data.aws_lambda_functions.test" diff --git a/internal/service/lambda/invocation_data_source_test.go b/internal/service/lambda/invocation_data_source_test.go index 478643bbd53a..da4b56ecb391 100644 --- a/internal/service/lambda/invocation_data_source_test.go +++ b/internal/service/lambda/invocation_data_source_test.go @@ -38,6 +38,7 @@ func testAccCheckInvocationResult(name, expectedResult string) resource.TestChec } func TestAccLambdaInvocationDataSource_basic(t *testing.T) { + ctx := acctest.Context(t) rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) testData := "value3" @@ -57,6 +58,7 @@ func TestAccLambdaInvocationDataSource_basic(t *testing.T) { } func TestAccLambdaInvocationDataSource_qualifier(t *testing.T) { + ctx := acctest.Context(t) rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) testData := "value3" @@ -76,6 +78,7 @@ func TestAccLambdaInvocationDataSource_qualifier(t *testing.T) { } func TestAccLambdaInvocationDataSource_complex(t *testing.T) { + ctx := acctest.Context(t) rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) testData := "value3" diff --git a/internal/service/lambda/invocation_test.go b/internal/service/lambda/invocation_test.go index 568cf379a092..683b3d9e2dba 100644 --- a/internal/service/lambda/invocation_test.go +++ b/internal/service/lambda/invocation_test.go @@ -12,6 +12,7 @@ import ( ) func TestAccLambdaInvocation_basic(t *testing.T) { + ctx := acctest.Context(t) resourceName := "aws_lambda_invocation.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) testData := "value3" @@ -33,6 +34,7 @@ func TestAccLambdaInvocation_basic(t *testing.T) { } func TestAccLambdaInvocation_qualifier(t *testing.T) { + ctx := acctest.Context(t) resourceName := "aws_lambda_invocation.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) testData := "value3" @@ -54,6 +56,7 @@ func TestAccLambdaInvocation_qualifier(t *testing.T) { } func TestAccLambdaInvocation_complex(t *testing.T) { + ctx := acctest.Context(t) resourceName := "aws_lambda_invocation.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) testData := "value3" @@ -75,6 +78,7 @@ func TestAccLambdaInvocation_complex(t *testing.T) { } func TestAccLambdaInvocation_triggers(t *testing.T) { + ctx := acctest.Context(t) resourceName := "aws_lambda_invocation.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) testData := "value3" diff --git a/internal/service/lambda/layer_version_data_source_test.go b/internal/service/lambda/layer_version_data_source_test.go index 8a7ff507fa2f..11082c78b463 100644 --- a/internal/service/lambda/layer_version_data_source_test.go +++ b/internal/service/lambda/layer_version_data_source_test.go @@ -11,6 +11,7 @@ import ( ) func TestAccLambdaLayerVersionDataSource_basic(t *testing.T) { + ctx := acctest.Context(t) rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) dataSourceName := "data.aws_lambda_layer_version.test" resourceName := "aws_lambda_layer_version.test" @@ -42,6 +43,7 @@ func TestAccLambdaLayerVersionDataSource_basic(t *testing.T) { } func TestAccLambdaLayerVersionDataSource_version(t *testing.T) { + ctx := acctest.Context(t) rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) dataSourceName := "data.aws_lambda_layer_version.test" resourceName := "aws_lambda_layer_version.test" @@ -63,6 +65,7 @@ func TestAccLambdaLayerVersionDataSource_version(t *testing.T) { } func TestAccLambdaLayerVersionDataSource_runtime(t *testing.T) { + ctx := acctest.Context(t) rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) dataSourceName := "data.aws_lambda_layer_version.test" resourceName := "aws_lambda_layer_version.test" @@ -84,6 +87,7 @@ func TestAccLambdaLayerVersionDataSource_runtime(t *testing.T) { } func TestAccLambdaLayerVersionDataSource_architectures(t *testing.T) { + ctx := acctest.Context(t) rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) dataSourceName := "data.aws_lambda_layer_version.test" resourceName := "aws_lambda_layer_version.test" From 28d27e58c3cff18210c823d0c9a252b797313686 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Fri, 24 Feb 2023 17:02:06 -0500 Subject: [PATCH 304/763] Add 'ctx := acctest.Context(t)' for lexmodels. --- internal/service/lexmodels/bot_alias_data_source_test.go | 1 + internal/service/lexmodels/bot_data_source_test.go | 2 ++ internal/service/lexmodels/intent_data_source_test.go | 2 ++ internal/service/lexmodels/slot_type_data_source_test.go | 2 ++ 4 files changed, 7 insertions(+) diff --git a/internal/service/lexmodels/bot_alias_data_source_test.go b/internal/service/lexmodels/bot_alias_data_source_test.go index cadbcbabc6f8..a52e07849d29 100644 --- a/internal/service/lexmodels/bot_alias_data_source_test.go +++ b/internal/service/lexmodels/bot_alias_data_source_test.go @@ -10,6 +10,7 @@ import ( ) func testAccBotAliasDataSource_basic(t *testing.T) { + ctx := acctest.Context(t) rName := sdkacctest.RandStringFromCharSet(8, sdkacctest.CharSetAlpha) dataSourceName := "data.aws_lex_bot_alias.test" resourceName := "aws_lex_bot_alias.test" diff --git a/internal/service/lexmodels/bot_data_source_test.go b/internal/service/lexmodels/bot_data_source_test.go index 4e70000cce7c..6a5a81aa6b6f 100644 --- a/internal/service/lexmodels/bot_data_source_test.go +++ b/internal/service/lexmodels/bot_data_source_test.go @@ -10,6 +10,7 @@ import ( ) func TestAccLexModelsBotDataSource_basic(t *testing.T) { + ctx := acctest.Context(t) rName := sdkacctest.RandStringFromCharSet(8, sdkacctest.CharSetAlpha) dataSourceName := "data.aws_lex_bot.test" resourceName := "aws_lex_bot.test" @@ -51,6 +52,7 @@ func TestAccLexModelsBotDataSource_basic(t *testing.T) { } func testAccBotDataSource_withVersion(t *testing.T) { + ctx := acctest.Context(t) rName := sdkacctest.RandStringFromCharSet(8, sdkacctest.CharSetAlpha) dataSourceName := "data.aws_lex_bot.test" resourceName := "aws_lex_bot.test" diff --git a/internal/service/lexmodels/intent_data_source_test.go b/internal/service/lexmodels/intent_data_source_test.go index e8c6aae1bece..f57e04306f8b 100644 --- a/internal/service/lexmodels/intent_data_source_test.go +++ b/internal/service/lexmodels/intent_data_source_test.go @@ -10,6 +10,7 @@ import ( ) func TestAccLexModelsIntentDataSource_basic(t *testing.T) { + ctx := acctest.Context(t) rName := sdkacctest.RandStringFromCharSet(8, sdkacctest.CharSetAlpha) dataSourceName := "data.aws_lex_intent.test" resourceName := "aws_lex_intent.test" @@ -42,6 +43,7 @@ func TestAccLexModelsIntentDataSource_basic(t *testing.T) { } func TestAccLexModelsIntentDataSource_withVersion(t *testing.T) { + ctx := acctest.Context(t) rName := sdkacctest.RandStringFromCharSet(8, sdkacctest.CharSetAlpha) dataSourceName := "data.aws_lex_intent.test" resourceName := "aws_lex_intent.test" diff --git a/internal/service/lexmodels/slot_type_data_source_test.go b/internal/service/lexmodels/slot_type_data_source_test.go index 175b74238cba..1c8f48b31f3c 100644 --- a/internal/service/lexmodels/slot_type_data_source_test.go +++ b/internal/service/lexmodels/slot_type_data_source_test.go @@ -10,6 +10,7 @@ import ( ) func TestAccLexModelsSlotTypeDataSource_basic(t *testing.T) { + ctx := acctest.Context(t) rName := sdkacctest.RandStringFromCharSet(8, sdkacctest.CharSetAlpha) dataSourceName := "data.aws_lex_slot_type.test" resourceName := "aws_lex_slot_type.test" @@ -43,6 +44,7 @@ func TestAccLexModelsSlotTypeDataSource_basic(t *testing.T) { } func TestAccLexModelsSlotTypeDataSource_withVersion(t *testing.T) { + ctx := acctest.Context(t) rName := sdkacctest.RandStringFromCharSet(8, sdkacctest.CharSetAlpha) dataSourceName := "data.aws_lex_slot_type.test" resourceName := "aws_lex_slot_type.test" From 237f405d54793036cd865ead515061f92a783a0b Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Fri, 24 Feb 2023 17:02:07 -0500 Subject: [PATCH 305/763] Add 'ctx := acctest.Context(t)' for logs. --- internal/service/logs/group_data_source_test.go | 1 + internal/service/logs/groups_data_source_test.go | 2 ++ 2 files changed, 3 insertions(+) diff --git a/internal/service/logs/group_data_source_test.go b/internal/service/logs/group_data_source_test.go index 6e560c82efe8..7189d32eb70b 100644 --- a/internal/service/logs/group_data_source_test.go +++ b/internal/service/logs/group_data_source_test.go @@ -11,6 +11,7 @@ import ( ) func TestAccLogsGroupDataSource_basic(t *testing.T) { + ctx := acctest.Context(t) rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) dataSourceName := "data.aws_cloudwatch_log_group.test" resourceName := "aws_cloudwatch_log_group.test" diff --git a/internal/service/logs/groups_data_source_test.go b/internal/service/logs/groups_data_source_test.go index 772e11594978..e29ff81c4023 100644 --- a/internal/service/logs/groups_data_source_test.go +++ b/internal/service/logs/groups_data_source_test.go @@ -11,6 +11,7 @@ import ( ) func TestAccLogsGroupsDataSource_basic(t *testing.T) { + ctx := acctest.Context(t) rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) dataSourceName := "data.aws_cloudwatch_log_groups.test" resource1Name := "aws_cloudwatch_log_group.test.0" @@ -37,6 +38,7 @@ func TestAccLogsGroupsDataSource_basic(t *testing.T) { } func TestAccLogsGroupsDataSource_noPrefix(t *testing.T) { + ctx := acctest.Context(t) rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) dataSourceName := "data.aws_cloudwatch_log_groups.test" resource1Name := "aws_cloudwatch_log_group.test.0" From dd850c8b96e65b45114429466ce3e49fc8b50a08 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Fri, 24 Feb 2023 17:02:08 -0500 Subject: [PATCH 306/763] Add 'ctx := acctest.Context(t)' for memorydb. --- internal/service/memorydb/acl_data_source_test.go | 1 + internal/service/memorydb/cluster_data_source_test.go | 1 + internal/service/memorydb/parameter_group_data_source_test.go | 1 + internal/service/memorydb/snapshot_data_source_test.go | 1 + internal/service/memorydb/subnet_group_data_source_test.go | 1 + internal/service/memorydb/user_data_source_test.go | 1 + 6 files changed, 6 insertions(+) diff --git a/internal/service/memorydb/acl_data_source_test.go b/internal/service/memorydb/acl_data_source_test.go index 796b60565fc4..52ce881d232e 100644 --- a/internal/service/memorydb/acl_data_source_test.go +++ b/internal/service/memorydb/acl_data_source_test.go @@ -11,6 +11,7 @@ import ( ) func TestAccMemoryDBACLDataSource_basic(t *testing.T) { + ctx := acctest.Context(t) rName := "tf-test-" + sdkacctest.RandString(8) resourceName := "aws_memorydb_acl.test" dataSourceName := "data.aws_memorydb_acl.test" diff --git a/internal/service/memorydb/cluster_data_source_test.go b/internal/service/memorydb/cluster_data_source_test.go index 478b46306712..0266306dee61 100644 --- a/internal/service/memorydb/cluster_data_source_test.go +++ b/internal/service/memorydb/cluster_data_source_test.go @@ -11,6 +11,7 @@ import ( ) func TestAccMemoryDBClusterDataSource_basic(t *testing.T) { + ctx := acctest.Context(t) rName := "tf-test-" + sdkacctest.RandString(8) resourceName := "aws_memorydb_cluster.test" dataSourceName := "data.aws_memorydb_cluster.test" diff --git a/internal/service/memorydb/parameter_group_data_source_test.go b/internal/service/memorydb/parameter_group_data_source_test.go index 4120d09dedd1..ce01914b3970 100644 --- a/internal/service/memorydb/parameter_group_data_source_test.go +++ b/internal/service/memorydb/parameter_group_data_source_test.go @@ -11,6 +11,7 @@ import ( ) func TestAccMemoryDBParameterGroupDataSource_basic(t *testing.T) { + ctx := acctest.Context(t) rName := "tf-test-" + sdkacctest.RandString(8) resourceName := "aws_memorydb_parameter_group.test" dataSourceName := "data.aws_memorydb_parameter_group.test" diff --git a/internal/service/memorydb/snapshot_data_source_test.go b/internal/service/memorydb/snapshot_data_source_test.go index a61e867313a9..02ef3486a05f 100644 --- a/internal/service/memorydb/snapshot_data_source_test.go +++ b/internal/service/memorydb/snapshot_data_source_test.go @@ -11,6 +11,7 @@ import ( ) func TestAccMemoryDBSnapshotDataSource_basic(t *testing.T) { + ctx := acctest.Context(t) rName := "tf-test-" + sdkacctest.RandString(8) resourceName := "aws_memorydb_snapshot.test" dataSourceName := "data.aws_memorydb_snapshot.test" diff --git a/internal/service/memorydb/subnet_group_data_source_test.go b/internal/service/memorydb/subnet_group_data_source_test.go index 85a031e02789..907fb3429831 100644 --- a/internal/service/memorydb/subnet_group_data_source_test.go +++ b/internal/service/memorydb/subnet_group_data_source_test.go @@ -11,6 +11,7 @@ import ( ) func TestAccMemoryDBSubnetGroupDataSource_basic(t *testing.T) { + ctx := acctest.Context(t) rName := "tf-test-" + sdkacctest.RandString(8) resourceName := "aws_memorydb_subnet_group.test" dataSourceName := "data.aws_memorydb_subnet_group.test" diff --git a/internal/service/memorydb/user_data_source_test.go b/internal/service/memorydb/user_data_source_test.go index 6263ef8cb3eb..f8a3878a0c7c 100644 --- a/internal/service/memorydb/user_data_source_test.go +++ b/internal/service/memorydb/user_data_source_test.go @@ -11,6 +11,7 @@ import ( ) func TestAccMemoryDBUserDataSource_basic(t *testing.T) { + ctx := acctest.Context(t) rName := "tf-test-" + sdkacctest.RandString(8) resourceName := "aws_memorydb_user.test" dataSourceName := "data.aws_memorydb_user.test" From 622e6bb453c126de126669e374537c490b735a59 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Fri, 24 Feb 2023 17:02:08 -0500 Subject: [PATCH 307/763] Add 'ctx := acctest.Context(t)' for meta. --- internal/service/meta/arn_data_source_test.go | 2 ++ .../service/meta/billing_service_account_data_source_test.go | 1 + internal/service/meta/default_tags_data_source_test.go | 4 ++++ internal/service/meta/ip_ranges_data_source_test.go | 4 ++++ internal/service/meta/partition_data_source_test.go | 1 + internal/service/meta/region_data_source_test.go | 4 ++++ internal/service/meta/regions_data_source_test.go | 4 ++++ internal/service/meta/service_data_source_test.go | 5 +++++ 8 files changed, 25 insertions(+) diff --git a/internal/service/meta/arn_data_source_test.go b/internal/service/meta/arn_data_source_test.go index e08995608417..635f757e0203 100644 --- a/internal/service/meta/arn_data_source_test.go +++ b/internal/service/meta/arn_data_source_test.go @@ -10,6 +10,7 @@ import ( ) func TestAccMetaARNDataSource_basic(t *testing.T) { + ctx := acctest.Context(t) arn := "arn:aws:rds:eu-west-1:123456789012:db:mysql-db" // lintignore:AWSAT003,AWSAT005 dataSourceName := "data.aws_arn.test" @@ -34,6 +35,7 @@ func TestAccMetaARNDataSource_basic(t *testing.T) { } func TestAccMetaARNDataSource_s3Bucket(t *testing.T) { + ctx := acctest.Context(t) arn := "arn:aws:s3:::my_corporate_bucket/Development/*" // lintignore:AWSAT005 dataSourceName := "data.aws_arn.test" 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 02055056f6c1..d18f8f5e80e3 100644 --- a/internal/service/meta/billing_service_account_data_source_test.go +++ b/internal/service/meta/billing_service_account_data_source_test.go @@ -9,6 +9,7 @@ import ( ) func TestAccMetaBillingServiceAccountDataSource_basic(t *testing.T) { + ctx := acctest.Context(t) dataSourceName := "data.aws_billing_service_account.test" billingAccountID := "386209384616" diff --git a/internal/service/meta/default_tags_data_source_test.go b/internal/service/meta/default_tags_data_source_test.go index 165854904b8b..ebec08919234 100644 --- a/internal/service/meta/default_tags_data_source_test.go +++ b/internal/service/meta/default_tags_data_source_test.go @@ -9,6 +9,7 @@ import ( ) func TestAccMetaDefaultTagsDataSource_basic(t *testing.T) { + ctx := acctest.Context(t) dataSourceName := "data.aws_default_tags.test" resource.ParallelTest(t, resource.TestCase{ @@ -32,6 +33,7 @@ func TestAccMetaDefaultTagsDataSource_basic(t *testing.T) { } func TestAccMetaDefaultTagsDataSource_empty(t *testing.T) { + ctx := acctest.Context(t) dataSourceName := "data.aws_default_tags.test" resource.ParallelTest(t, resource.TestCase{ @@ -51,6 +53,7 @@ func TestAccMetaDefaultTagsDataSource_empty(t *testing.T) { } func TestAccMetaDefaultTagsDataSource_multiple(t *testing.T) { + ctx := acctest.Context(t) dataSourceName := "data.aws_default_tags.test" resource.ParallelTest(t, resource.TestCase{ @@ -75,6 +78,7 @@ func TestAccMetaDefaultTagsDataSource_multiple(t *testing.T) { } func TestAccMetaDefaultTagsDataSource_ignore(t *testing.T) { + ctx := acctest.Context(t) dataSourceName := "data.aws_default_tags.test" resource.ParallelTest(t, resource.TestCase{ diff --git a/internal/service/meta/ip_ranges_data_source_test.go b/internal/service/meta/ip_ranges_data_source_test.go index 8886b81be562..4e2aa439ff2a 100644 --- a/internal/service/meta/ip_ranges_data_source_test.go +++ b/internal/service/meta/ip_ranges_data_source_test.go @@ -17,6 +17,7 @@ import ( ) func TestAccMetaIPRangesDataSource_basic(t *testing.T) { + ctx := acctest.Context(t) dataSourceName := "data.aws_ip_ranges.test" resource.ParallelTest(t, resource.TestCase{ @@ -37,6 +38,7 @@ func TestAccMetaIPRangesDataSource_basic(t *testing.T) { } func TestAccMetaIPRangesDataSource_none(t *testing.T) { + ctx := acctest.Context(t) dataSourceName := "data.aws_ip_ranges.test" resource.ParallelTest(t, resource.TestCase{ @@ -56,6 +58,7 @@ func TestAccMetaIPRangesDataSource_none(t *testing.T) { } func TestAccMetaIPRangesDataSource_url(t *testing.T) { + ctx := acctest.Context(t) dataSourceName := "data.aws_ip_ranges.test" resource.ParallelTest(t, resource.TestCase{ @@ -76,6 +79,7 @@ func TestAccMetaIPRangesDataSource_url(t *testing.T) { } func TestAccMetaIPRangesDataSource_uppercase(t *testing.T) { + ctx := acctest.Context(t) dataSourceName := "data.aws_ip_ranges.test" resource.ParallelTest(t, resource.TestCase{ diff --git a/internal/service/meta/partition_data_source_test.go b/internal/service/meta/partition_data_source_test.go index ea5a274c21dd..5429d9c50f7c 100644 --- a/internal/service/meta/partition_data_source_test.go +++ b/internal/service/meta/partition_data_source_test.go @@ -11,6 +11,7 @@ import ( ) func TestAccMetaPartitionDataSource_basic(t *testing.T) { + ctx := acctest.Context(t) dataSourceName := "data.aws_partition.test" resource.ParallelTest(t, resource.TestCase{ diff --git a/internal/service/meta/region_data_source_test.go b/internal/service/meta/region_data_source_test.go index 8c186fdd260a..60c3fdd64c8c 100644 --- a/internal/service/meta/region_data_source_test.go +++ b/internal/service/meta/region_data_source_test.go @@ -80,6 +80,7 @@ func TestFindRegionByName(t *testing.T) { } func TestAccMetaRegionDataSource_basic(t *testing.T) { + ctx := acctest.Context(t) dataSourceName := "data.aws_region.test" resource.ParallelTest(t, resource.TestCase{ @@ -100,6 +101,7 @@ func TestAccMetaRegionDataSource_basic(t *testing.T) { } func TestAccMetaRegionDataSource_endpoint(t *testing.T) { + ctx := acctest.Context(t) dataSourceName := "data.aws_region.test" resource.ParallelTest(t, resource.TestCase{ @@ -120,6 +122,7 @@ func TestAccMetaRegionDataSource_endpoint(t *testing.T) { } func TestAccMetaRegionDataSource_endpointAndName(t *testing.T) { + ctx := acctest.Context(t) dataSourceName := "data.aws_region.test" resource.ParallelTest(t, resource.TestCase{ @@ -140,6 +143,7 @@ func TestAccMetaRegionDataSource_endpointAndName(t *testing.T) { } func TestAccMetaRegionDataSource_name(t *testing.T) { + ctx := acctest.Context(t) dataSourceName := "data.aws_region.test" resource.ParallelTest(t, resource.TestCase{ diff --git a/internal/service/meta/regions_data_source_test.go b/internal/service/meta/regions_data_source_test.go index 82a7f53d5a18..75d792301e23 100644 --- a/internal/service/meta/regions_data_source_test.go +++ b/internal/service/meta/regions_data_source_test.go @@ -10,6 +10,7 @@ import ( ) func TestAccMetaRegionsDataSource_basic(t *testing.T) { + ctx := acctest.Context(t) dataSourceName := "data.aws_regions.test" resource.ParallelTest(t, resource.TestCase{ @@ -28,6 +29,7 @@ func TestAccMetaRegionsDataSource_basic(t *testing.T) { } func TestAccMetaRegionsDataSource_filter(t *testing.T) { + ctx := acctest.Context(t) dataSourceName := "data.aws_regions.test" resource.ParallelTest(t, resource.TestCase{ @@ -46,6 +48,7 @@ func TestAccMetaRegionsDataSource_filter(t *testing.T) { } func TestAccMetaRegionsDataSource_allRegions(t *testing.T) { + ctx := acctest.Context(t) dataSourceName := "data.aws_regions.test" resource.ParallelTest(t, resource.TestCase{ @@ -64,6 +67,7 @@ func TestAccMetaRegionsDataSource_allRegions(t *testing.T) { } func TestAccMetaRegionsDataSource_nonExistentRegion(t *testing.T) { + ctx := acctest.Context(t) dataSourceName := "data.aws_regions.test" resource.ParallelTest(t, resource.TestCase{ diff --git a/internal/service/meta/service_data_source_test.go b/internal/service/meta/service_data_source_test.go index d299b60a366f..edec899ac3ed 100644 --- a/internal/service/meta/service_data_source_test.go +++ b/internal/service/meta/service_data_source_test.go @@ -15,6 +15,7 @@ import ( ) func TestAccMetaService_basic(t *testing.T) { + ctx := acctest.Context(t) dataSourceName := "data.aws_service.test" resource.ParallelTest(t, resource.TestCase{ @@ -39,6 +40,7 @@ func TestAccMetaService_basic(t *testing.T) { } func TestAccMetaService_byReverseDNSName(t *testing.T) { + ctx := acctest.Context(t) dataSourceName := "data.aws_service.test" resource.ParallelTest(t, resource.TestCase{ @@ -61,6 +63,7 @@ func TestAccMetaService_byReverseDNSName(t *testing.T) { } func TestAccMetaService_byDNSName(t *testing.T) { + ctx := acctest.Context(t) dataSourceName := "data.aws_service.test" resource.ParallelTest(t, resource.TestCase{ @@ -83,6 +86,7 @@ func TestAccMetaService_byDNSName(t *testing.T) { } func TestAccMetaService_byParts(t *testing.T) { + ctx := acctest.Context(t) dataSourceName := "data.aws_service.test" resource.ParallelTest(t, resource.TestCase{ @@ -103,6 +107,7 @@ func TestAccMetaService_byParts(t *testing.T) { } func TestAccMetaService_unsupported(t *testing.T) { + ctx := acctest.Context(t) dataSourceName := "data.aws_service.test" resource.ParallelTest(t, resource.TestCase{ From 1dd67051f90e5422ce22de95ef9802ef53483d10 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Fri, 24 Feb 2023 17:02:08 -0500 Subject: [PATCH 308/763] Add 'ctx := acctest.Context(t)' for mq. --- internal/service/mq/broker_data_source_test.go | 1 + .../mq/broker_instance_type_offerings_data_source_test.go | 1 + 2 files changed, 2 insertions(+) diff --git a/internal/service/mq/broker_data_source_test.go b/internal/service/mq/broker_data_source_test.go index 9f4fb6738bf0..7defc2d52a0f 100644 --- a/internal/service/mq/broker_data_source_test.go +++ b/internal/service/mq/broker_data_source_test.go @@ -11,6 +11,7 @@ import ( ) func TestAccMQBrokerDataSource_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/mq/broker_instance_type_offerings_data_source_test.go b/internal/service/mq/broker_instance_type_offerings_data_source_test.go index 36235f495eb3..73558ec84e98 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 @@ -9,6 +9,7 @@ import ( ) func TestAccMQBrokerInstanceTypeOfferingsDataSource_basic(t *testing.T) { + ctx := acctest.Context(t) resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(mq.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, mq.EndpointsID), From e17a49418eb701757282d0fec397eb41640054de Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Fri, 24 Feb 2023 17:02:09 -0500 Subject: [PATCH 309/763] Add 'ctx := acctest.Context(t)' for networkmanager. --- internal/service/networkmanager/connection_data_source_test.go | 1 + internal/service/networkmanager/connections_data_source_test.go | 1 + .../core_network_policy_document_data_source_test.go | 1 + internal/service/networkmanager/device_data_source_test.go | 1 + internal/service/networkmanager/devices_data_source_test.go | 1 + .../service/networkmanager/global_network_data_source_test.go | 1 + .../service/networkmanager/global_networks_data_source_test.go | 1 + internal/service/networkmanager/link_data_source_test.go | 1 + internal/service/networkmanager/links_data_source_test.go | 1 + internal/service/networkmanager/site_data_source_test.go | 1 + internal/service/networkmanager/sites_data_source_test.go | 1 + 11 files changed, 11 insertions(+) diff --git a/internal/service/networkmanager/connection_data_source_test.go b/internal/service/networkmanager/connection_data_source_test.go index ded5645cd82c..82ee38f55fe6 100644 --- a/internal/service/networkmanager/connection_data_source_test.go +++ b/internal/service/networkmanager/connection_data_source_test.go @@ -10,6 +10,7 @@ import ( ) func TestAccNetworkManagerConnectionDataSource_basic(t *testing.T) { + ctx := acctest.Context(t) dataSourceName := "data.aws_networkmanager_connection.test" resourceName := "aws_networkmanager_connection.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) diff --git a/internal/service/networkmanager/connections_data_source_test.go b/internal/service/networkmanager/connections_data_source_test.go index 4ab3dabfe87d..9100c16f8ddb 100644 --- a/internal/service/networkmanager/connections_data_source_test.go +++ b/internal/service/networkmanager/connections_data_source_test.go @@ -11,6 +11,7 @@ import ( ) func TestAccNetworkManagerConnectionsDataSource_basic(t *testing.T) { + ctx := acctest.Context(t) dataSourceAllName := "data.aws_networkmanager_connections.all" dataSourceByTagsName := "data.aws_networkmanager_connections.by_tags" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) 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 c71480a94b99..3787d99f65e9 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 @@ -12,6 +12,7 @@ func TestAccNetworkManagerCoreNetworkPolicyDocumentDataSource_basic(t *testing.T // This really ought to be able to be a unit test rather than an // acceptance test, but just instantiating the AWS provider requires // some AWS API calls, and so this needs valid AWS credentials to work. + ctx := acctest.Context(t) resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, networkmanager.EndpointsID), diff --git a/internal/service/networkmanager/device_data_source_test.go b/internal/service/networkmanager/device_data_source_test.go index 7d289a6ece0b..face6528abde 100644 --- a/internal/service/networkmanager/device_data_source_test.go +++ b/internal/service/networkmanager/device_data_source_test.go @@ -11,6 +11,7 @@ import ( ) func TestAccNetworkManagerDeviceDataSource_basic(t *testing.T) { + ctx := acctest.Context(t) dataSourceName := "data.aws_networkmanager_device.test" resourceName := "aws_networkmanager_device.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) diff --git a/internal/service/networkmanager/devices_data_source_test.go b/internal/service/networkmanager/devices_data_source_test.go index 58c0a7c42be9..79e28a7cb533 100644 --- a/internal/service/networkmanager/devices_data_source_test.go +++ b/internal/service/networkmanager/devices_data_source_test.go @@ -11,6 +11,7 @@ import ( ) func TestAccNetworkManagerDevicesDataSource_basic(t *testing.T) { + ctx := acctest.Context(t) dataSourceAllName := "data.aws_networkmanager_devices.all" dataSourceByTagsName := "data.aws_networkmanager_devices.by_tags" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) diff --git a/internal/service/networkmanager/global_network_data_source_test.go b/internal/service/networkmanager/global_network_data_source_test.go index 8731b1217aa0..784f1764962a 100644 --- a/internal/service/networkmanager/global_network_data_source_test.go +++ b/internal/service/networkmanager/global_network_data_source_test.go @@ -11,6 +11,7 @@ import ( ) func TestAccNetworkManagerGlobalNetworkDataSource_basic(t *testing.T) { + ctx := acctest.Context(t) dataSourceName := "data.aws_networkmanager_global_network.test" resourceName := "aws_networkmanager_global_network.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) diff --git a/internal/service/networkmanager/global_networks_data_source_test.go b/internal/service/networkmanager/global_networks_data_source_test.go index 719d22ec2361..6ee7a0cd49f6 100644 --- a/internal/service/networkmanager/global_networks_data_source_test.go +++ b/internal/service/networkmanager/global_networks_data_source_test.go @@ -11,6 +11,7 @@ import ( ) func TestAccNetworkManagerGlobalNetworksDataSource_basic(t *testing.T) { + ctx := acctest.Context(t) dataSourceAllName := "data.aws_networkmanager_global_networks.all" dataSourceByTagsName := "data.aws_networkmanager_global_networks.by_tags" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) diff --git a/internal/service/networkmanager/link_data_source_test.go b/internal/service/networkmanager/link_data_source_test.go index 7d3ea418f1db..085064cc75b2 100644 --- a/internal/service/networkmanager/link_data_source_test.go +++ b/internal/service/networkmanager/link_data_source_test.go @@ -11,6 +11,7 @@ import ( ) func TestAccNetworkManagerLinkDataSource_basic(t *testing.T) { + ctx := acctest.Context(t) dataSourceName := "data.aws_networkmanager_link.test" resourceName := "aws_networkmanager_link.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) diff --git a/internal/service/networkmanager/links_data_source_test.go b/internal/service/networkmanager/links_data_source_test.go index 8faf33600e4f..af11919261b5 100644 --- a/internal/service/networkmanager/links_data_source_test.go +++ b/internal/service/networkmanager/links_data_source_test.go @@ -11,6 +11,7 @@ import ( ) func TestAccNetworkManagerLinksDataSource_basic(t *testing.T) { + ctx := acctest.Context(t) dataSourceAllName := "data.aws_networkmanager_links.all" dataSourceByTagsName := "data.aws_networkmanager_links.by_tags" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) diff --git a/internal/service/networkmanager/site_data_source_test.go b/internal/service/networkmanager/site_data_source_test.go index 7a36d7f4b19c..019507ec52d8 100644 --- a/internal/service/networkmanager/site_data_source_test.go +++ b/internal/service/networkmanager/site_data_source_test.go @@ -11,6 +11,7 @@ import ( ) func TestAccNetworkManagerSiteDataSource_basic(t *testing.T) { + ctx := acctest.Context(t) dataSourceName := "data.aws_networkmanager_site.test" resourceName := "aws_networkmanager_site.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) diff --git a/internal/service/networkmanager/sites_data_source_test.go b/internal/service/networkmanager/sites_data_source_test.go index e44176fe1abc..fa4b2f192aec 100644 --- a/internal/service/networkmanager/sites_data_source_test.go +++ b/internal/service/networkmanager/sites_data_source_test.go @@ -11,6 +11,7 @@ import ( ) func TestAccNetworkManagerSitesDataSource_basic(t *testing.T) { + ctx := acctest.Context(t) dataSourceAllName := "data.aws_networkmanager_sites.all" dataSourceByTagsName := "data.aws_networkmanager_sites.by_tags" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) From c5f9e88f188be9696ea373f5be33d4a973b0bf66 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Fri, 24 Feb 2023 17:02:09 -0500 Subject: [PATCH 310/763] Add 'ctx := acctest.Context(t)' for organizations. --- .../organizations/delegated_administrators_data_source_test.go | 1 + 1 file changed, 1 insertion(+) diff --git a/internal/service/organizations/delegated_administrators_data_source_test.go b/internal/service/organizations/delegated_administrators_data_source_test.go index 746ebb4dc1db..d91c4b68a2cc 100644 --- a/internal/service/organizations/delegated_administrators_data_source_test.go +++ b/internal/service/organizations/delegated_administrators_data_source_test.go @@ -92,6 +92,7 @@ func TestAccOrganizationsDelegatedAdministratorsDataSource_servicePrincipal(t *t } func TestAccOrganizationsDelegatedAdministratorsDataSource_empty(t *testing.T) { + ctx := acctest.Context(t) dataSourceName := "data.aws_organizations_delegated_administrators.test" servicePrincipal := "config-multiaccountsetup.amazonaws.com" From 56ec1c6d58d65a37a1fc7d2f06ae709701412a38 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Fri, 24 Feb 2023 17:02:10 -0500 Subject: [PATCH 311/763] Add 'ctx := acctest.Context(t)' for qldb. --- internal/service/qldb/ledger_data_source_test.go | 1 + 1 file changed, 1 insertion(+) diff --git a/internal/service/qldb/ledger_data_source_test.go b/internal/service/qldb/ledger_data_source_test.go index a2586eb9fe82..2b7ed8ed6b72 100644 --- a/internal/service/qldb/ledger_data_source_test.go +++ b/internal/service/qldb/ledger_data_source_test.go @@ -11,6 +11,7 @@ import ( ) func TestAccQLDBLedgerDataSource_basic(t *testing.T) { + ctx := acctest.Context(t) rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resourceName := "aws_qldb_ledger.test" datasourceName := "data.aws_qldb_ledger.test" From dd3a123754c78217a8401a2b1e1e8bfd230b05bb Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Fri, 24 Feb 2023 17:02:10 -0500 Subject: [PATCH 312/763] Add 'ctx := acctest.Context(t)' for ram. --- internal/service/ram/resource_share_data_source_test.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/internal/service/ram/resource_share_data_source_test.go b/internal/service/ram/resource_share_data_source_test.go index 95fe02760046..92fe1d8e344b 100644 --- a/internal/service/ram/resource_share_data_source_test.go +++ b/internal/service/ram/resource_share_data_source_test.go @@ -12,6 +12,7 @@ import ( ) func TestAccRAMResourceShareDataSource_basic(t *testing.T) { + ctx := acctest.Context(t) rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resourceName := "aws_ram_resource_share.test" datasourceName := "data.aws_ram_resource_share.test" @@ -38,6 +39,7 @@ func TestAccRAMResourceShareDataSource_basic(t *testing.T) { } func TestAccRAMResourceShareDataSource_tags(t *testing.T) { + ctx := acctest.Context(t) rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resourceName := "aws_ram_resource_share.test" datasourceName := "data.aws_ram_resource_share.test" @@ -60,6 +62,7 @@ func TestAccRAMResourceShareDataSource_tags(t *testing.T) { } func TestAccRAMResourceShareDataSource_status(t *testing.T) { + ctx := acctest.Context(t) rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resourceName := "aws_ram_resource_share.test" datasourceName := "data.aws_ram_resource_share.test" From 5d4a24d1246bb9c0846923c6583fb5191a991be1 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Fri, 24 Feb 2023 17:02:11 -0500 Subject: [PATCH 313/763] Add 'ctx := acctest.Context(t)' for rds. --- internal/service/rds/cluster_data_source_test.go | 1 + internal/service/rds/cluster_snapshot_data_source_test.go | 3 +++ internal/service/rds/event_categories_data_source_test.go | 2 ++ internal/service/rds/instance_data_source_test.go | 1 + internal/service/rds/proxy_data_source_test.go | 1 + .../service/rds/reserved_instance_offering_data_source_test.go | 1 + internal/service/rds/snapshot_data_source_test.go | 1 + internal/service/rds/subnet_group_data_source_test.go | 1 + 8 files changed, 11 insertions(+) diff --git a/internal/service/rds/cluster_data_source_test.go b/internal/service/rds/cluster_data_source_test.go index ab9a6dd190fd..e70ec1e33a5d 100644 --- a/internal/service/rds/cluster_data_source_test.go +++ b/internal/service/rds/cluster_data_source_test.go @@ -11,6 +11,7 @@ import ( ) func TestAccRDSClusterDataSource_basic(t *testing.T) { + ctx := acctest.Context(t) rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) dataSourceName := "data.aws_rds_cluster.test" resourceName := "aws_rds_cluster.test" diff --git a/internal/service/rds/cluster_snapshot_data_source_test.go b/internal/service/rds/cluster_snapshot_data_source_test.go index 858a6517e89d..3b3a8ed3770e 100644 --- a/internal/service/rds/cluster_snapshot_data_source_test.go +++ b/internal/service/rds/cluster_snapshot_data_source_test.go @@ -12,6 +12,7 @@ import ( ) func TestAccRDSClusterSnapshotDataSource_dbClusterSnapshotIdentifier(t *testing.T) { + ctx := acctest.Context(t) rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) dataSourceName := "data.aws_db_cluster_snapshot.test" resourceName := "aws_db_cluster_snapshot.test" @@ -49,6 +50,7 @@ func TestAccRDSClusterSnapshotDataSource_dbClusterSnapshotIdentifier(t *testing. } func TestAccRDSClusterSnapshotDataSource_dbClusterIdentifier(t *testing.T) { + ctx := acctest.Context(t) rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) dataSourceName := "data.aws_db_cluster_snapshot.test" resourceName := "aws_db_cluster_snapshot.test" @@ -86,6 +88,7 @@ func TestAccRDSClusterSnapshotDataSource_dbClusterIdentifier(t *testing.T) { } func TestAccRDSClusterSnapshotDataSource_mostRecent(t *testing.T) { + ctx := acctest.Context(t) rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) dataSourceName := "data.aws_db_cluster_snapshot.test" resourceName := "aws_db_cluster_snapshot.test" diff --git a/internal/service/rds/event_categories_data_source_test.go b/internal/service/rds/event_categories_data_source_test.go index 91549213f4ec..9795e7ac2d20 100644 --- a/internal/service/rds/event_categories_data_source_test.go +++ b/internal/service/rds/event_categories_data_source_test.go @@ -10,6 +10,7 @@ import ( ) func TestAccRDSEventCategoriesDataSource_basic(t *testing.T) { + ctx := acctest.Context(t) dataSourceName := "data.aws_db_event_categories.test" resource.ParallelTest(t, resource.TestCase{ @@ -41,6 +42,7 @@ func TestAccRDSEventCategoriesDataSource_basic(t *testing.T) { } func TestAccRDSEventCategoriesDataSource_sourceType(t *testing.T) { + ctx := acctest.Context(t) dataSourceName := "data.aws_db_event_categories.test" resource.ParallelTest(t, resource.TestCase{ diff --git a/internal/service/rds/instance_data_source_test.go b/internal/service/rds/instance_data_source_test.go index 72e275005ac1..d1d9a6c08970 100644 --- a/internal/service/rds/instance_data_source_test.go +++ b/internal/service/rds/instance_data_source_test.go @@ -11,6 +11,7 @@ import ( ) func TestAccRDSInstanceDataSource_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/rds/proxy_data_source_test.go b/internal/service/rds/proxy_data_source_test.go index 791dc982c373..e1671b15c614 100644 --- a/internal/service/rds/proxy_data_source_test.go +++ b/internal/service/rds/proxy_data_source_test.go @@ -11,6 +11,7 @@ import ( ) func TestAccRDSProxyDataSource_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/rds/reserved_instance_offering_data_source_test.go b/internal/service/rds/reserved_instance_offering_data_source_test.go index 96896c34dd3f..6513e3fefe76 100644 --- a/internal/service/rds/reserved_instance_offering_data_source_test.go +++ b/internal/service/rds/reserved_instance_offering_data_source_test.go @@ -9,6 +9,7 @@ import ( ) func TestAccRDSInstanceOffering_basic(t *testing.T) { + ctx := acctest.Context(t) dataSourceName := "data.aws_rds_reserved_instance_offering.test" resource.ParallelTest(t, resource.TestCase{ diff --git a/internal/service/rds/snapshot_data_source_test.go b/internal/service/rds/snapshot_data_source_test.go index fe6a9355925d..d906396e38ae 100644 --- a/internal/service/rds/snapshot_data_source_test.go +++ b/internal/service/rds/snapshot_data_source_test.go @@ -12,6 +12,7 @@ import ( ) func TestAccRDSSnapshotDataSource_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/rds/subnet_group_data_source_test.go b/internal/service/rds/subnet_group_data_source_test.go index bad5e488e368..7308c4b46dcf 100644 --- a/internal/service/rds/subnet_group_data_source_test.go +++ b/internal/service/rds/subnet_group_data_source_test.go @@ -10,6 +10,7 @@ import ( ) func TestAccRDSSubnetGroupDataSource_basic(t *testing.T) { + ctx := acctest.Context(t) rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resourceName := "aws_db_subnet_group.test" dataSourceName := "data.aws_db_subnet_group.test" From 00b2b2613fba18a9912bd5bcc1a6ea912de4d8f1 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Fri, 24 Feb 2023 17:02:11 -0500 Subject: [PATCH 314/763] Add 'ctx := acctest.Context(t)' for redshift. --- .../service/redshift/cluster_credentials_data_source_test.go | 1 + internal/service/redshift/cluster_data_source_test.go | 4 ++++ internal/service/redshift/service_account_data_source_test.go | 2 ++ internal/service/redshift/subnet_group_data_source_test.go | 1 + 4 files changed, 8 insertions(+) diff --git a/internal/service/redshift/cluster_credentials_data_source_test.go b/internal/service/redshift/cluster_credentials_data_source_test.go index 63a49ebda40b..3b9c5762ce63 100644 --- a/internal/service/redshift/cluster_credentials_data_source_test.go +++ b/internal/service/redshift/cluster_credentials_data_source_test.go @@ -11,6 +11,7 @@ import ( ) func TestAccRedshiftClusterCredentialsDataSource_basic(t *testing.T) { + ctx := acctest.Context(t) dataSourceName := "data.aws_redshift_cluster_credentials.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) diff --git a/internal/service/redshift/cluster_data_source_test.go b/internal/service/redshift/cluster_data_source_test.go index 1553feda7918..da798fcebb6f 100644 --- a/internal/service/redshift/cluster_data_source_test.go +++ b/internal/service/redshift/cluster_data_source_test.go @@ -11,6 +11,7 @@ import ( ) func TestAccRedshiftClusterDataSource_basic(t *testing.T) { + ctx := acctest.Context(t) dataSourceName := "data.aws_redshift_cluster.test" resourceName := "aws_redshift_cluster.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) @@ -54,6 +55,7 @@ func TestAccRedshiftClusterDataSource_basic(t *testing.T) { } func TestAccRedshiftClusterDataSource_vpc(t *testing.T) { + ctx := acctest.Context(t) dataSourceName := "data.aws_redshift_cluster.test" subnetGroupResourceName := "aws_redshift_subnet_group.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) @@ -77,6 +79,7 @@ func TestAccRedshiftClusterDataSource_vpc(t *testing.T) { } func TestAccRedshiftClusterDataSource_logging(t *testing.T) { + ctx := acctest.Context(t) dataSourceName := "data.aws_redshift_cluster.test" bucketResourceName := "aws_s3_bucket.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) @@ -99,6 +102,7 @@ func TestAccRedshiftClusterDataSource_logging(t *testing.T) { } func TestAccRedshiftClusterDataSource_availabilityZoneRelocationEnabled(t *testing.T) { + ctx := acctest.Context(t) dataSourceName := "data.aws_redshift_cluster.test" resourceName := "aws_redshift_cluster.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) diff --git a/internal/service/redshift/service_account_data_source_test.go b/internal/service/redshift/service_account_data_source_test.go index 35d0c141dbe0..b19e8e64fa18 100644 --- a/internal/service/redshift/service_account_data_source_test.go +++ b/internal/service/redshift/service_account_data_source_test.go @@ -10,6 +10,7 @@ import ( ) func TestAccRedshiftServiceAccountDataSource_basic(t *testing.T) { + ctx := acctest.Context(t) expectedAccountID := tfredshift.ServiceAccountPerRegionMap[acctest.Region()] dataSourceName := "data.aws_redshift_service_account.main" @@ -31,6 +32,7 @@ func TestAccRedshiftServiceAccountDataSource_basic(t *testing.T) { } func TestAccRedshiftServiceAccountDataSource_region(t *testing.T) { + ctx := acctest.Context(t) expectedAccountID := tfredshift.ServiceAccountPerRegionMap[acctest.Region()] dataSourceName := "data.aws_redshift_service_account.regional" diff --git a/internal/service/redshift/subnet_group_data_source_test.go b/internal/service/redshift/subnet_group_data_source_test.go index dd90946128bb..1f74cacea787 100644 --- a/internal/service/redshift/subnet_group_data_source_test.go +++ b/internal/service/redshift/subnet_group_data_source_test.go @@ -10,6 +10,7 @@ import ( ) func TestAccRedshiftSubnetGroupDataSource_basic(t *testing.T) { + ctx := acctest.Context(t) dataSourceName := "data.aws_redshift_subnet_group.test" resourceName := "aws_redshift_subnet_group.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) From ca101b8118551272c0c9c45a9a98a5a9f087d510 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Fri, 24 Feb 2023 17:02:11 -0500 Subject: [PATCH 315/763] Add 'ctx := acctest.Context(t)' for redshiftserverless. --- .../service/redshiftserverless/credentials_data_source_test.go | 1 + 1 file changed, 1 insertion(+) diff --git a/internal/service/redshiftserverless/credentials_data_source_test.go b/internal/service/redshiftserverless/credentials_data_source_test.go index 5dab28d18796..48b1514acf86 100644 --- a/internal/service/redshiftserverless/credentials_data_source_test.go +++ b/internal/service/redshiftserverless/credentials_data_source_test.go @@ -11,6 +11,7 @@ import ( ) func TestAccRedshiftServerlessCredentialsDataSource_basic(t *testing.T) { + ctx := acctest.Context(t) dataSourceName := "data.aws_redshiftserverless_credentials.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) From 3105d5e0fe5a98362a279c3db16893343c9601ba Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Fri, 24 Feb 2023 17:02:11 -0500 Subject: [PATCH 316/763] Add 'ctx := acctest.Context(t)' for resourceexplorer2. --- .../service/resourceexplorer2/index_test.go | 20 ++++++++++++--- .../service/resourceexplorer2/view_test.go | 25 +++++++++++++++---- 2 files changed, 36 insertions(+), 9 deletions(-) diff --git a/internal/service/resourceexplorer2/index_test.go b/internal/service/resourceexplorer2/index_test.go index 3f0abcb1cab3..03a31c052b4d 100644 --- a/internal/service/resourceexplorer2/index_test.go +++ b/internal/service/resourceexplorer2/index_test.go @@ -20,7 +20,10 @@ func testAccIndex_basic(t *testing.T) { resourceName := "aws_resourceexplorer2_index.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(names.ResourceExplorer2EndpointID, t) }, + PreCheck: func() { + acctest.PreCheck(ctx, t) + acctest.PreCheckPartitionHasService(names.ResourceExplorer2EndpointID, t) + }, ErrorCheck: acctest.ErrorCheck(t, names.ResourceExplorer2EndpointID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckIndexDestroy(ctx), @@ -47,7 +50,10 @@ func testAccIndex_disappears(t *testing.T) { resourceName := "aws_resourceexplorer2_index.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(names.ResourceExplorer2EndpointID, t) }, + PreCheck: func() { + acctest.PreCheck(ctx, t) + acctest.PreCheckPartitionHasService(names.ResourceExplorer2EndpointID, t) + }, ErrorCheck: acctest.ErrorCheck(t, names.ResourceExplorer2EndpointID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckIndexDestroy(ctx), @@ -69,7 +75,10 @@ func testAccIndex_tags(t *testing.T) { resourceName := "aws_resourceexplorer2_index.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(names.ResourceExplorer2EndpointID, t) }, + PreCheck: func() { + acctest.PreCheck(ctx, t) + acctest.PreCheckPartitionHasService(names.ResourceExplorer2EndpointID, t) + }, ErrorCheck: acctest.ErrorCheck(t, names.ResourceExplorer2EndpointID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckIndexDestroy(ctx), @@ -113,7 +122,10 @@ func testAccIndex_type(t *testing.T) { resourceName := "aws_resourceexplorer2_index.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(names.ResourceExplorer2EndpointID, t) }, + PreCheck: func() { + acctest.PreCheck(ctx, t) + acctest.PreCheckPartitionHasService(names.ResourceExplorer2EndpointID, t) + }, ErrorCheck: acctest.ErrorCheck(t, names.ResourceExplorer2EndpointID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckIndexDestroy(ctx), diff --git a/internal/service/resourceexplorer2/view_test.go b/internal/service/resourceexplorer2/view_test.go index d033a80198ec..094d9df52ff1 100644 --- a/internal/service/resourceexplorer2/view_test.go +++ b/internal/service/resourceexplorer2/view_test.go @@ -24,7 +24,10 @@ func testAccView_basic(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(names.ResourceExplorer2EndpointID, t) }, + PreCheck: func() { + acctest.PreCheck(ctx, t) + acctest.PreCheckPartitionHasService(names.ResourceExplorer2EndpointID, t) + }, ErrorCheck: acctest.ErrorCheck(t, names.ResourceExplorer2EndpointID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckViewDestroy(ctx), @@ -57,7 +60,10 @@ func testAccView_defaultView(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(names.ResourceExplorer2EndpointID, t) }, + PreCheck: func() { + acctest.PreCheck(ctx, t) + acctest.PreCheckPartitionHasService(names.ResourceExplorer2EndpointID, t) + }, ErrorCheck: acctest.ErrorCheck(t, names.ResourceExplorer2EndpointID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckViewDestroy(ctx), @@ -99,7 +105,10 @@ func testAccView_disappears(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(names.ResourceExplorer2EndpointID, t) }, + PreCheck: func() { + acctest.PreCheck(ctx, t) + acctest.PreCheckPartitionHasService(names.ResourceExplorer2EndpointID, t) + }, ErrorCheck: acctest.ErrorCheck(t, names.ResourceExplorer2EndpointID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckViewDestroy(ctx), @@ -123,7 +132,10 @@ func testAccView_filter(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(names.ResourceExplorer2EndpointID, t) }, + PreCheck: func() { + acctest.PreCheck(ctx, t) + acctest.PreCheckPartitionHasService(names.ResourceExplorer2EndpointID, t) + }, ErrorCheck: acctest.ErrorCheck(t, names.ResourceExplorer2EndpointID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckViewDestroy(ctx), @@ -172,7 +184,10 @@ func testAccView_tags(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(names.ResourceExplorer2EndpointID, t) }, + PreCheck: func() { + acctest.PreCheck(ctx, t) + acctest.PreCheckPartitionHasService(names.ResourceExplorer2EndpointID, t) + }, ErrorCheck: acctest.ErrorCheck(t, names.ResourceExplorer2EndpointID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckViewDestroy(ctx), From da402a8a4b26cd7132a9aa478af86613ea31565b Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Fri, 24 Feb 2023 17:02:12 -0500 Subject: [PATCH 317/763] Add 'ctx := acctest.Context(t)' for resourcegroupstaggingapi. --- .../resourcegroupstaggingapi/resources_data_source_test.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/internal/service/resourcegroupstaggingapi/resources_data_source_test.go b/internal/service/resourcegroupstaggingapi/resources_data_source_test.go index 83ada58a7abb..3afff5078c9a 100644 --- a/internal/service/resourcegroupstaggingapi/resources_data_source_test.go +++ b/internal/service/resourcegroupstaggingapi/resources_data_source_test.go @@ -11,6 +11,7 @@ import ( ) func TestAccResourceGroupsTaggingAPIResourcesDataSource_tagFilter(t *testing.T) { + ctx := acctest.Context(t) dataSourceName := "data.aws_resourcegroupstaggingapi_resources.test" resourceName := "aws_vpc.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) @@ -34,6 +35,7 @@ func TestAccResourceGroupsTaggingAPIResourcesDataSource_tagFilter(t *testing.T) } func TestAccResourceGroupsTaggingAPIResourcesDataSource_includeComplianceDetails(t *testing.T) { + ctx := acctest.Context(t) dataSourceName := "data.aws_resourcegroupstaggingapi_resources.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) @@ -54,6 +56,7 @@ func TestAccResourceGroupsTaggingAPIResourcesDataSource_includeComplianceDetails } func TestAccResourceGroupsTaggingAPIResourcesDataSource_resourceTypeFilters(t *testing.T) { + ctx := acctest.Context(t) dataSourceName := "data.aws_resourcegroupstaggingapi_resources.test" resourceName := "aws_vpc.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) @@ -77,6 +80,7 @@ func TestAccResourceGroupsTaggingAPIResourcesDataSource_resourceTypeFilters(t *t } func TestAccResourceGroupsTaggingAPIResourcesDataSource_resourceARNList(t *testing.T) { + ctx := acctest.Context(t) dataSourceName := "data.aws_resourcegroupstaggingapi_resources.test" resourceName := "aws_vpc.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) From 0058cd2ca1217be7ac4015ee19e595251c184271 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Fri, 24 Feb 2023 17:02:12 -0500 Subject: [PATCH 318/763] Add 'ctx := acctest.Context(t)' for route53. --- internal/service/route53/delegation_set_data_source_test.go | 1 + .../service/route53/traffic_policy_document_data_source_test.go | 2 ++ 2 files changed, 3 insertions(+) diff --git a/internal/service/route53/delegation_set_data_source_test.go b/internal/service/route53/delegation_set_data_source_test.go index 6d45dd889710..830b19088c1e 100644 --- a/internal/service/route53/delegation_set_data_source_test.go +++ b/internal/service/route53/delegation_set_data_source_test.go @@ -11,6 +11,7 @@ import ( ) func TestAccRoute53DelegationSetDataSource_basic(t *testing.T) { + ctx := acctest.Context(t) dataSourceName := "data.aws_route53_delegation_set.dset" resourceName := "aws_route53_delegation_set.dset" 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 e7e96c54e1da..2381e3303507 100644 --- a/internal/service/route53/traffic_policy_document_data_source_test.go +++ b/internal/service/route53/traffic_policy_document_data_source_test.go @@ -14,6 +14,7 @@ import ( ) func TestAccRoute53TrafficPolicyDocumentDataSource_basic(t *testing.T) { + ctx := acctest.Context(t) resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { acctest.PreCheck(ctx, t) }, ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, @@ -31,6 +32,7 @@ func TestAccRoute53TrafficPolicyDocumentDataSource_basic(t *testing.T) { } func TestAccRoute53TrafficPolicyDocumentDataSource_complete(t *testing.T) { + ctx := acctest.Context(t) resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { acctest.PreCheck(ctx, t) }, ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, From bd169867df7c5dccf1226eef2f0557f351e823c6 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Fri, 24 Feb 2023 17:02:13 -0500 Subject: [PATCH 319/763] Add 'ctx := acctest.Context(t)' for route53resolver. --- internal/service/route53resolver/endpoint_data_source_test.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/internal/service/route53resolver/endpoint_data_source_test.go b/internal/service/route53resolver/endpoint_data_source_test.go index afd99b690bd2..66de6112c3db 100644 --- a/internal/service/route53resolver/endpoint_data_source_test.go +++ b/internal/service/route53resolver/endpoint_data_source_test.go @@ -10,6 +10,7 @@ import ( ) func TestAccRoute53ResolverEndpointDataSource_basic(t *testing.T) { + ctx := acctest.Context(t) rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resourceName := "aws_route53_resolver_endpoint.test" datasourceName := "data.aws_route53_resolver_endpoint.test" @@ -36,6 +37,7 @@ func TestAccRoute53ResolverEndpointDataSource_basic(t *testing.T) { } func TestAccRoute53ResolverEndpointDataSource_filter(t *testing.T) { + ctx := acctest.Context(t) rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resourceName := "aws_route53_resolver_endpoint.test" datasourceName := "data.aws_route53_resolver_endpoint.test" From 0df5f3089c594655ea337cffcd4c116703a077a6 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Fri, 24 Feb 2023 17:02:13 -0500 Subject: [PATCH 320/763] Add 'ctx := acctest.Context(t)' for s3. --- internal/service/s3/bucket_objects_data_source_test.go | 8 ++++++++ internal/service/s3/canonical_user_id_data_source_test.go | 1 + internal/service/s3/objects_data_source_test.go | 8 ++++++++ 3 files changed, 17 insertions(+) diff --git a/internal/service/s3/bucket_objects_data_source_test.go b/internal/service/s3/bucket_objects_data_source_test.go index fd52b3f30a81..430fe3e88926 100644 --- a/internal/service/s3/bucket_objects_data_source_test.go +++ b/internal/service/s3/bucket_objects_data_source_test.go @@ -15,6 +15,7 @@ import ( ) func TestAccS3BucketObjectsDataSource_basic(t *testing.T) { + ctx := acctest.Context(t) rInt := sdkacctest.RandInt() resource.ParallelTest(t, resource.TestCase{ @@ -41,6 +42,7 @@ func TestAccS3BucketObjectsDataSource_basic(t *testing.T) { } func TestAccS3BucketObjectsDataSource_basicViaAccessPoint(t *testing.T) { + ctx := acctest.Context(t) rInt := sdkacctest.RandInt() resource.ParallelTest(t, resource.TestCase{ @@ -67,6 +69,7 @@ func TestAccS3BucketObjectsDataSource_basicViaAccessPoint(t *testing.T) { } func TestAccS3BucketObjectsDataSource_all(t *testing.T) { + ctx := acctest.Context(t) rInt := sdkacctest.RandInt() resource.ParallelTest(t, resource.TestCase{ @@ -98,6 +101,7 @@ func TestAccS3BucketObjectsDataSource_all(t *testing.T) { } func TestAccS3BucketObjectsDataSource_prefixes(t *testing.T) { + ctx := acctest.Context(t) rInt := sdkacctest.RandInt() resource.ParallelTest(t, resource.TestCase{ @@ -128,6 +132,7 @@ func TestAccS3BucketObjectsDataSource_prefixes(t *testing.T) { } func TestAccS3BucketObjectsDataSource_encoded(t *testing.T) { + ctx := acctest.Context(t) rInt := sdkacctest.RandInt() resource.ParallelTest(t, resource.TestCase{ @@ -154,6 +159,7 @@ func TestAccS3BucketObjectsDataSource_encoded(t *testing.T) { } func TestAccS3BucketObjectsDataSource_maxKeys(t *testing.T) { + ctx := acctest.Context(t) rInt := sdkacctest.RandInt() resource.ParallelTest(t, resource.TestCase{ @@ -180,6 +186,7 @@ func TestAccS3BucketObjectsDataSource_maxKeys(t *testing.T) { } func TestAccS3BucketObjectsDataSource_startAfter(t *testing.T) { + ctx := acctest.Context(t) rInt := sdkacctest.RandInt() resource.ParallelTest(t, resource.TestCase{ @@ -205,6 +212,7 @@ func TestAccS3BucketObjectsDataSource_startAfter(t *testing.T) { } func TestAccS3BucketObjectsDataSource_fetchOwner(t *testing.T) { + ctx := acctest.Context(t) rInt := sdkacctest.RandInt() resource.ParallelTest(t, resource.TestCase{ 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 6cd8825a7bd4..ba2ed60474af 100644 --- a/internal/service/s3/canonical_user_id_data_source_test.go +++ b/internal/service/s3/canonical_user_id_data_source_test.go @@ -11,6 +11,7 @@ import ( ) func TestAccS3CanonicalUserIDDataSource_basic(t *testing.T) { + ctx := acctest.Context(t) resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, s3.EndpointsID), diff --git a/internal/service/s3/objects_data_source_test.go b/internal/service/s3/objects_data_source_test.go index 77ea15325e44..8d93915e85f9 100644 --- a/internal/service/s3/objects_data_source_test.go +++ b/internal/service/s3/objects_data_source_test.go @@ -12,6 +12,7 @@ import ( ) func TestAccS3ObjectsDataSource_basic(t *testing.T) { + ctx := acctest.Context(t) rInt := sdkacctest.RandInt() resource.ParallelTest(t, resource.TestCase{ @@ -38,6 +39,7 @@ func TestAccS3ObjectsDataSource_basic(t *testing.T) { } func TestAccS3ObjectsDataSource_basicViaAccessPoint(t *testing.T) { + ctx := acctest.Context(t) rInt := sdkacctest.RandInt() resource.ParallelTest(t, resource.TestCase{ @@ -64,6 +66,7 @@ func TestAccS3ObjectsDataSource_basicViaAccessPoint(t *testing.T) { } func TestAccS3ObjectsDataSource_all(t *testing.T) { + ctx := acctest.Context(t) rInt := sdkacctest.RandInt() resource.ParallelTest(t, resource.TestCase{ @@ -95,6 +98,7 @@ func TestAccS3ObjectsDataSource_all(t *testing.T) { } func TestAccS3ObjectsDataSource_prefixes(t *testing.T) { + ctx := acctest.Context(t) rInt := sdkacctest.RandInt() resource.ParallelTest(t, resource.TestCase{ @@ -125,6 +129,7 @@ func TestAccS3ObjectsDataSource_prefixes(t *testing.T) { } func TestAccS3ObjectsDataSource_encoded(t *testing.T) { + ctx := acctest.Context(t) rInt := sdkacctest.RandInt() resource.ParallelTest(t, resource.TestCase{ @@ -151,6 +156,7 @@ func TestAccS3ObjectsDataSource_encoded(t *testing.T) { } func TestAccS3ObjectsDataSource_maxKeys(t *testing.T) { + ctx := acctest.Context(t) rInt := sdkacctest.RandInt() resource.ParallelTest(t, resource.TestCase{ @@ -177,6 +183,7 @@ func TestAccS3ObjectsDataSource_maxKeys(t *testing.T) { } func TestAccS3ObjectsDataSource_startAfter(t *testing.T) { + ctx := acctest.Context(t) rInt := sdkacctest.RandInt() resource.ParallelTest(t, resource.TestCase{ @@ -202,6 +209,7 @@ func TestAccS3ObjectsDataSource_startAfter(t *testing.T) { } func TestAccS3ObjectsDataSource_fetchOwner(t *testing.T) { + ctx := acctest.Context(t) rInt := sdkacctest.RandInt() resource.ParallelTest(t, resource.TestCase{ From a5ceeb5127113236ea3c463bdbb7b9f5c6310bb0 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Fri, 24 Feb 2023 17:02:13 -0500 Subject: [PATCH 321/763] Add 'ctx := acctest.Context(t)' for s3control. --- .../s3control/account_public_access_block_data_source_test.go | 1 + 1 file changed, 1 insertion(+) 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 0583fbfad092..d73b23ae87d9 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 @@ -9,6 +9,7 @@ import ( ) func testAccAccountPublicAccessBlockDataSource_basic(t *testing.T) { + ctx := acctest.Context(t) resourceName := "aws_s3_account_public_access_block.test" dataSourceName := "data.aws_s3_account_public_access_block.test" From 874fe604634a707a28194aa7de34f7373b75b3ee Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Fri, 24 Feb 2023 17:02:13 -0500 Subject: [PATCH 322/763] Add 'ctx := acctest.Context(t)' for sagemaker. --- .../service/sagemaker/prebuilt_ecr_image_data_source_test.go | 2 ++ 1 file changed, 2 insertions(+) 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 956aa976d48e..6556ecc771db 100644 --- a/internal/service/sagemaker/prebuilt_ecr_image_data_source_test.go +++ b/internal/service/sagemaker/prebuilt_ecr_image_data_source_test.go @@ -10,6 +10,7 @@ import ( ) func TestAccSageMakerPrebuiltECRImageDataSource_basic(t *testing.T) { + ctx := acctest.Context(t) expectedID := tfsagemaker.PrebuiltECRImageIDByRegion_factorMachines[acctest.Region()] dataSourceName := "data.aws_sagemaker_prebuilt_ecr_image.test" @@ -32,6 +33,7 @@ func TestAccSageMakerPrebuiltECRImageDataSource_basic(t *testing.T) { } func TestAccSageMakerPrebuiltECRImageDataSource_region(t *testing.T) { + ctx := acctest.Context(t) expectedID := tfsagemaker.PrebuiltECRImageIDByRegion_sparkML[acctest.Region()] dataSourceName := "data.aws_sagemaker_prebuilt_ecr_image.test" From e33a9e882187f00467a4e2ea3c6c2e673b6e9616 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Fri, 24 Feb 2023 17:02:14 -0500 Subject: [PATCH 323/763] Add 'ctx := acctest.Context(t)' for securityhub. --- internal/service/securityhub/standards_control_test.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/internal/service/securityhub/standards_control_test.go b/internal/service/securityhub/standards_control_test.go index 159f1b2f27b1..0fbb13824616 100644 --- a/internal/service/securityhub/standards_control_test.go +++ b/internal/service/securityhub/standards_control_test.go @@ -68,6 +68,8 @@ func testAccStandardsControl_disabledControlStatus(t *testing.T) { } func testAccStandardsControl_enabledControlStatusAndDisabledReason(t *testing.T) { + ctx := acctest.Context(t) + resource.Test(t, resource.TestCase{ PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, securityhub.EndpointsID), From 3d4c20ea27dce381c441c6ea1ed716ced3cc23f5 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Fri, 24 Feb 2023 17:02:14 -0500 Subject: [PATCH 324/763] Add 'ctx := acctest.Context(t)' for serverlessrepo. --- internal/service/serverlessrepo/application_data_source_test.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/internal/service/serverlessrepo/application_data_source_test.go b/internal/service/serverlessrepo/application_data_source_test.go index 2ed07b6172ea..c4afe228fd1e 100644 --- a/internal/service/serverlessrepo/application_data_source_test.go +++ b/internal/service/serverlessrepo/application_data_source_test.go @@ -12,6 +12,7 @@ import ( ) func TestAccServerlessRepoApplicationDataSource_basic(t *testing.T) { + ctx := acctest.Context(t) datasourceName := "data.aws_serverlessapplicationrepository_application.secrets_manager_postgres_single_user_rotator" appARN := testAccCloudFormationApplicationID() @@ -40,6 +41,7 @@ func TestAccServerlessRepoApplicationDataSource_basic(t *testing.T) { } func TestAccServerlessRepoApplicationDataSource_versioned(t *testing.T) { + ctx := acctest.Context(t) datasourceName := "data.aws_serverlessapplicationrepository_application.secrets_manager_postgres_single_user_rotator" appARN := testAccCloudFormationApplicationID() From f4fc9f34d862c0d0fefa2677c34837ec8871ac03 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Fri, 24 Feb 2023 17:02:14 -0500 Subject: [PATCH 325/763] Add 'ctx := acctest.Context(t)' for servicecatalog. --- internal/service/servicecatalog/launch_paths_data_source_test.go | 1 + .../servicecatalog/portfolio_constraints_data_source_test.go | 1 + 2 files changed, 2 insertions(+) diff --git a/internal/service/servicecatalog/launch_paths_data_source_test.go b/internal/service/servicecatalog/launch_paths_data_source_test.go index ff5ef592a676..f26af5161049 100644 --- a/internal/service/servicecatalog/launch_paths_data_source_test.go +++ b/internal/service/servicecatalog/launch_paths_data_source_test.go @@ -11,6 +11,7 @@ import ( ) func TestAccServiceCatalogLaunchPathsDataSource_basic(t *testing.T) { + ctx := acctest.Context(t) dataSourceName := "data.aws_servicecatalog_launch_paths.test" resourceNameProduct := "aws_servicecatalog_product.test" resourceNamePortfolio := "aws_servicecatalog_portfolio.test" diff --git a/internal/service/servicecatalog/portfolio_constraints_data_source_test.go b/internal/service/servicecatalog/portfolio_constraints_data_source_test.go index d08bd3583a42..f4924c5ba025 100644 --- a/internal/service/servicecatalog/portfolio_constraints_data_source_test.go +++ b/internal/service/servicecatalog/portfolio_constraints_data_source_test.go @@ -10,6 +10,7 @@ import ( ) func TestAccServiceCatalogPortfolioConstraintsDataSource_Constraint_basic(t *testing.T) { + ctx := acctest.Context(t) resourceName := "aws_servicecatalog_constraint.test" dataSourceName := "data.aws_servicecatalog_portfolio_constraints.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) From 1f3d63b1f180caf05343dde005ddcc1b6ff959c9 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Fri, 24 Feb 2023 17:02:15 -0500 Subject: [PATCH 326/763] Add 'ctx := acctest.Context(t)' for servicequotas. --- internal/service/servicequotas/service_data_source_test.go | 1 + 1 file changed, 1 insertion(+) diff --git a/internal/service/servicequotas/service_data_source_test.go b/internal/service/servicequotas/service_data_source_test.go index fada76451c95..3135168e3a86 100644 --- a/internal/service/servicequotas/service_data_source_test.go +++ b/internal/service/servicequotas/service_data_source_test.go @@ -10,6 +10,7 @@ import ( ) func TestAccServiceQuotasServiceDataSource_serviceName(t *testing.T) { + ctx := acctest.Context(t) dataSourceName := "data.aws_servicequotas_service.test" resource.ParallelTest(t, resource.TestCase{ From a9ee873001b8255b42f375667ef856aab19aef12 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Fri, 24 Feb 2023 17:02:15 -0500 Subject: [PATCH 327/763] Add 'ctx := acctest.Context(t)' for sfn. --- internal/service/sfn/activity_data_source_test.go | 1 + internal/service/sfn/state_machine_data_source_test.go | 1 + 2 files changed, 2 insertions(+) diff --git a/internal/service/sfn/activity_data_source_test.go b/internal/service/sfn/activity_data_source_test.go index 65574294404d..a04d83959610 100644 --- a/internal/service/sfn/activity_data_source_test.go +++ b/internal/service/sfn/activity_data_source_test.go @@ -11,6 +11,7 @@ import ( ) func TestAccSFNActivityDataSource_basic(t *testing.T) { + ctx := acctest.Context(t) rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resourceName := "aws_sfn_activity.test" dataSource1Name := "data.aws_sfn_activity.by_name" diff --git a/internal/service/sfn/state_machine_data_source_test.go b/internal/service/sfn/state_machine_data_source_test.go index d171fdd6d023..6252d8c95657 100644 --- a/internal/service/sfn/state_machine_data_source_test.go +++ b/internal/service/sfn/state_machine_data_source_test.go @@ -10,6 +10,7 @@ import ( ) func TestAccSFNStateMachineDataSource_basic(t *testing.T) { + ctx := acctest.Context(t) rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) dataSourceName := "data.aws_sfn_state_machine.test" resourceName := "aws_sfn_state_machine.test" From ad276495f7741380b57f8b85e2b55342a810eaab Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Fri, 24 Feb 2023 17:02:15 -0500 Subject: [PATCH 328/763] Add 'ctx := acctest.Context(t)' for signer. --- .../signer/signing_job_data_source_test.go | 5 +++- internal/service/signer/signing_job_test.go | 5 +++- .../signing_profile_data_source_test.go | 5 +++- .../signer/signing_profile_permission_test.go | 20 ++++++++++++--- .../service/signer/signing_profile_test.go | 25 +++++++++++++++---- 5 files changed, 48 insertions(+), 12 deletions(-) diff --git a/internal/service/signer/signing_job_data_source_test.go b/internal/service/signer/signing_job_data_source_test.go index 4df87fdeb0b1..f539ddd00d8d 100644 --- a/internal/service/signer/signing_job_data_source_test.go +++ b/internal/service/signer/signing_job_data_source_test.go @@ -17,7 +17,10 @@ func TestAccSignerSigningJobDataSource_basic(t *testing.T) { resourceName := "aws_signer_signing_job.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckSingerSigningProfile(ctx, t, "AWSLambda-SHA384-ECDSA") }, + PreCheck: func() { + acctest.PreCheck(ctx, t) + testAccPreCheckSingerSigningProfile(ctx, t, "AWSLambda-SHA384-ECDSA") + }, ErrorCheck: acctest.ErrorCheck(t, signer.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ diff --git a/internal/service/signer/signing_job_test.go b/internal/service/signer/signing_job_test.go index 6f01dceeda5f..7d2fcc24bc12 100644 --- a/internal/service/signer/signing_job_test.go +++ b/internal/service/signer/signing_job_test.go @@ -24,7 +24,10 @@ func TestAccSignerSigningJob_basic(t *testing.T) { var conf signer.GetSigningProfileOutput resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckSingerSigningProfile(ctx, t, "AWSLambda-SHA384-ECDSA") }, + PreCheck: func() { + acctest.PreCheck(ctx, t) + testAccPreCheckSingerSigningProfile(ctx, t, "AWSLambda-SHA384-ECDSA") + }, ErrorCheck: acctest.ErrorCheck(t, signer.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: nil, diff --git a/internal/service/signer/signing_profile_data_source_test.go b/internal/service/signer/signing_profile_data_source_test.go index 83bb76f2ff01..cda223157489 100644 --- a/internal/service/signer/signing_profile_data_source_test.go +++ b/internal/service/signer/signing_profile_data_source_test.go @@ -18,7 +18,10 @@ func TestAccSignerSigningProfileDataSource_basic(t *testing.T) { profileName := fmt.Sprintf("tf_acc_sp_basic_%s", rString) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckSingerSigningProfile(ctx, t, "AWSLambda-SHA384-ECDSA") }, + PreCheck: func() { + acctest.PreCheck(ctx, t) + testAccPreCheckSingerSigningProfile(ctx, t, "AWSLambda-SHA384-ECDSA") + }, ErrorCheck: acctest.ErrorCheck(t, signer.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ diff --git a/internal/service/signer/signing_profile_permission_test.go b/internal/service/signer/signing_profile_permission_test.go index ee0a3184183e..bdfc0a42df3f 100644 --- a/internal/service/signer/signing_profile_permission_test.go +++ b/internal/service/signer/signing_profile_permission_test.go @@ -25,7 +25,10 @@ func TestAccSignerSigningProfilePermission_basic(t *testing.T) { var sppconf signer.ListProfilePermissionsOutput resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckSingerSigningProfile(ctx, t, "AWSLambda-SHA384-ECDSA") }, + PreCheck: func() { + acctest.PreCheck(ctx, t) + testAccPreCheckSingerSigningProfile(ctx, t, "AWSLambda-SHA384-ECDSA") + }, ErrorCheck: acctest.ErrorCheck(t, signer.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSigningProfileDestroy(ctx), @@ -60,7 +63,10 @@ func TestAccSignerSigningProfilePermission_getSigningProfile(t *testing.T) { var sppconf signer.ListProfilePermissionsOutput resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckSingerSigningProfile(ctx, t, "AWSLambda-SHA384-ECDSA") }, + PreCheck: func() { + acctest.PreCheck(ctx, t) + testAccPreCheckSingerSigningProfile(ctx, t, "AWSLambda-SHA384-ECDSA") + }, ErrorCheck: acctest.ErrorCheck(t, signer.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSigningProfileDestroy(ctx), @@ -103,7 +109,10 @@ func TestAccSignerSigningProfilePermission_StartSigningJob_getSP(t *testing.T) { var sppconf signer.ListProfilePermissionsOutput resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckSingerSigningProfile(ctx, t, "AWSLambda-SHA384-ECDSA") }, + PreCheck: func() { + acctest.PreCheck(ctx, t) + testAccPreCheckSingerSigningProfile(ctx, t, "AWSLambda-SHA384-ECDSA") + }, ErrorCheck: acctest.ErrorCheck(t, signer.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSigningProfileDestroy(ctx), @@ -138,7 +147,10 @@ func TestAccSignerSigningProfilePermission_statementPrefix(t *testing.T) { var sppconf signer.ListProfilePermissionsOutput resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckSingerSigningProfile(ctx, t, "AWSLambda-SHA384-ECDSA") }, + PreCheck: func() { + acctest.PreCheck(ctx, t) + testAccPreCheckSingerSigningProfile(ctx, t, "AWSLambda-SHA384-ECDSA") + }, ErrorCheck: acctest.ErrorCheck(t, signer.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSigningProfileDestroy(ctx), diff --git a/internal/service/signer/signing_profile_test.go b/internal/service/signer/signing_profile_test.go index e5bd5ce153ca..3c5273069495 100644 --- a/internal/service/signer/signing_profile_test.go +++ b/internal/service/signer/signing_profile_test.go @@ -25,7 +25,10 @@ func TestAccSignerSigningProfile_basic(t *testing.T) { var conf signer.GetSigningProfileOutput resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckSingerSigningProfile(ctx, t, "AWSLambda-SHA384-ECDSA") }, + PreCheck: func() { + acctest.PreCheck(ctx, t) + testAccPreCheckSingerSigningProfile(ctx, t, "AWSLambda-SHA384-ECDSA") + }, ErrorCheck: acctest.ErrorCheck(t, signer.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSigningProfileDestroy(ctx), @@ -57,7 +60,10 @@ func TestAccSignerSigningProfile_generateNameWithNamePrefix(t *testing.T) { var conf signer.GetSigningProfileOutput resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckSingerSigningProfile(ctx, t, "AWSLambda-SHA384-ECDSA") }, + PreCheck: func() { + acctest.PreCheck(ctx, t) + testAccPreCheckSingerSigningProfile(ctx, t, "AWSLambda-SHA384-ECDSA") + }, ErrorCheck: acctest.ErrorCheck(t, signer.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSigningProfileDestroy(ctx), @@ -80,7 +86,10 @@ func TestAccSignerSigningProfile_generateName(t *testing.T) { var conf signer.GetSigningProfileOutput resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckSingerSigningProfile(ctx, t, "AWSLambda-SHA384-ECDSA") }, + PreCheck: func() { + acctest.PreCheck(ctx, t) + testAccPreCheckSingerSigningProfile(ctx, t, "AWSLambda-SHA384-ECDSA") + }, ErrorCheck: acctest.ErrorCheck(t, signer.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSigningProfileDestroy(ctx), @@ -104,7 +113,10 @@ func TestAccSignerSigningProfile_tags(t *testing.T) { var conf signer.GetSigningProfileOutput resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckSingerSigningProfile(ctx, t, "AWSLambda-SHA384-ECDSA") }, + PreCheck: func() { + acctest.PreCheck(ctx, t) + testAccPreCheckSingerSigningProfile(ctx, t, "AWSLambda-SHA384-ECDSA") + }, ErrorCheck: acctest.ErrorCheck(t, signer.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSigningProfileDestroy(ctx), @@ -136,7 +148,10 @@ func TestAccSignerSigningProfile_signatureValidityPeriod(t *testing.T) { var conf signer.GetSigningProfileOutput resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckSingerSigningProfile(ctx, t, "AWSLambda-SHA384-ECDSA") }, + PreCheck: func() { + acctest.PreCheck(ctx, t) + testAccPreCheckSingerSigningProfile(ctx, t, "AWSLambda-SHA384-ECDSA") + }, ErrorCheck: acctest.ErrorCheck(t, signer.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSigningProfileDestroy(ctx), From 3869219341d896c84077cc4425ecdcb61c790588 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Fri, 24 Feb 2023 17:02:16 -0500 Subject: [PATCH 329/763] Add 'ctx := acctest.Context(t)' for sns. --- internal/service/sns/topic_data_source_test.go | 1 + 1 file changed, 1 insertion(+) diff --git a/internal/service/sns/topic_data_source_test.go b/internal/service/sns/topic_data_source_test.go index 19533700f052..b00581c7abef 100644 --- a/internal/service/sns/topic_data_source_test.go +++ b/internal/service/sns/topic_data_source_test.go @@ -11,6 +11,7 @@ import ( ) func TestAccSNSTopicDataSource_basic(t *testing.T) { + ctx := acctest.Context(t) resourceName := "aws_sns_topic.test" datasourceName := "data.aws_sns_topic.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) From 30c867cfe91550a14e5f5897c8458f315b2c6fbe Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Fri, 24 Feb 2023 17:02:16 -0500 Subject: [PATCH 330/763] Add 'ctx := acctest.Context(t)' for sqs. --- internal/service/sqs/queue_data_source_test.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/internal/service/sqs/queue_data_source_test.go b/internal/service/sqs/queue_data_source_test.go index 20c5589133eb..cfe58a4533e2 100644 --- a/internal/service/sqs/queue_data_source_test.go +++ b/internal/service/sqs/queue_data_source_test.go @@ -12,6 +12,7 @@ import ( ) func TestAccSQSQueueDataSource_basic(t *testing.T) { + ctx := acctest.Context(t) rName := sdkacctest.RandomWithPrefix("tf_acc_test_") resourceName := "aws_sqs_queue.test" datasourceName := "data.aws_sqs_queue.by_name" @@ -33,6 +34,7 @@ func TestAccSQSQueueDataSource_basic(t *testing.T) { } func TestAccSQSQueueDataSource_tags(t *testing.T) { + ctx := acctest.Context(t) rName := sdkacctest.RandomWithPrefix("tf_acc_test_") resourceName := "aws_sqs_queue.test" datasourceName := "data.aws_sqs_queue.by_name" From 0ab008b52c4a2f074365b0392362212f902d27a0 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Fri, 24 Feb 2023 17:02:16 -0500 Subject: [PATCH 331/763] Add 'ctx := acctest.Context(t)' for ssm. --- internal/service/ssm/document_data_source_test.go | 2 ++ internal/service/ssm/instances_data_source_test.go | 1 + internal/service/ssm/parameter_data_source_test.go | 2 ++ internal/service/ssm/parameters_by_path_data_source_test.go | 2 ++ internal/service/ssm/patch_baseline_data_source_test.go | 1 + 5 files changed, 8 insertions(+) diff --git a/internal/service/ssm/document_data_source_test.go b/internal/service/ssm/document_data_source_test.go index 198c7c107d37..9562b0597b31 100644 --- a/internal/service/ssm/document_data_source_test.go +++ b/internal/service/ssm/document_data_source_test.go @@ -11,6 +11,7 @@ import ( ) func TestAccSSMDocumentDataSource_basic(t *testing.T) { + ctx := acctest.Context(t) resourceName := "data.aws_ssm_document.test" name := fmt.Sprintf("test_document-%d", sdkacctest.RandInt()) @@ -46,6 +47,7 @@ func TestAccSSMDocumentDataSource_basic(t *testing.T) { } func TestAccSSMDocumentDataSource_managed(t *testing.T) { + ctx := acctest.Context(t) resourceName := "data.aws_ssm_document.test" resource.ParallelTest(t, resource.TestCase{ diff --git a/internal/service/ssm/instances_data_source_test.go b/internal/service/ssm/instances_data_source_test.go index 5a27672d88ac..ae94a5241ee3 100644 --- a/internal/service/ssm/instances_data_source_test.go +++ b/internal/service/ssm/instances_data_source_test.go @@ -14,6 +14,7 @@ import ( ) func TestAccSSMInstancesDataSource_filter(t *testing.T) { + ctx := acctest.Context(t) rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) dataSourceName := "data.aws_ssm_instances.test" resourceName := "aws_instance.test" diff --git a/internal/service/ssm/parameter_data_source_test.go b/internal/service/ssm/parameter_data_source_test.go index 1778762cd642..4f91903064f5 100644 --- a/internal/service/ssm/parameter_data_source_test.go +++ b/internal/service/ssm/parameter_data_source_test.go @@ -11,6 +11,7 @@ import ( ) func TestAccSSMParameterDataSource_basic(t *testing.T) { + ctx := acctest.Context(t) resourceName := "data.aws_ssm_parameter.test" name := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) @@ -45,6 +46,7 @@ func TestAccSSMParameterDataSource_basic(t *testing.T) { } func TestAccSSMParameterDataSource_fullPath(t *testing.T) { + ctx := acctest.Context(t) resourceName := "data.aws_ssm_parameter.test" name := sdkacctest.RandomWithPrefix("/tf-acc-test/tf-acc-test") 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 3d066279373c..68600bdf40d1 100644 --- a/internal/service/ssm/parameters_by_path_data_source_test.go +++ b/internal/service/ssm/parameters_by_path_data_source_test.go @@ -11,6 +11,7 @@ import ( ) func TestAccSSMParametersByPathDataSource_basic(t *testing.T) { + ctx := acctest.Context(t) resourceName := "data.aws_ssm_parameters_by_path.test" rName1 := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) rName2 := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) @@ -69,6 +70,7 @@ data "aws_ssm_parameters_by_path" "test" { } func TestAccSSMParametersByPathDataSource_withRecursion(t *testing.T) { + ctx := acctest.Context(t) resourceName := "data.aws_ssm_parameters_by_path.recursive" pathPrefix := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) diff --git a/internal/service/ssm/patch_baseline_data_source_test.go b/internal/service/ssm/patch_baseline_data_source_test.go index 21aa277b934b..93229dde2568 100644 --- a/internal/service/ssm/patch_baseline_data_source_test.go +++ b/internal/service/ssm/patch_baseline_data_source_test.go @@ -11,6 +11,7 @@ import ( ) func TestAccSSMPatchBaselineDataSource_existingBaseline(t *testing.T) { + ctx := acctest.Context(t) dataSourceName := "data.aws_ssm_patch_baseline.test" resource.ParallelTest(t, resource.TestCase{ From 8151c3a608aa870b0059e31596771f117e290f3e Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Fri, 24 Feb 2023 17:02:17 -0500 Subject: [PATCH 332/763] Add 'ctx := acctest.Context(t)' for sts. --- internal/service/sts/caller_identity_data_source_test.go | 1 + 1 file changed, 1 insertion(+) diff --git a/internal/service/sts/caller_identity_data_source_test.go b/internal/service/sts/caller_identity_data_source_test.go index 1789db424ee2..c4bbf8adb336 100644 --- a/internal/service/sts/caller_identity_data_source_test.go +++ b/internal/service/sts/caller_identity_data_source_test.go @@ -9,6 +9,7 @@ import ( ) func TestAccSTSCallerIdentityDataSource_basic(t *testing.T) { + ctx := acctest.Context(t) resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, sts.EndpointsID), From 3cf43a348e7e8e68c3ab436be7a4476a9006bf0d Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Fri, 24 Feb 2023 17:02:17 -0500 Subject: [PATCH 333/763] Add 'ctx := acctest.Context(t)' for waf. --- internal/service/waf/ipset_data_source_test.go | 1 + internal/service/waf/rate_based_rule_data_source_test.go | 1 + internal/service/waf/rule_data_source_test.go | 1 + internal/service/waf/subscribed_rule_group_test.go | 1 + internal/service/waf/web_acl_data_source_test.go | 1 + 5 files changed, 5 insertions(+) diff --git a/internal/service/waf/ipset_data_source_test.go b/internal/service/waf/ipset_data_source_test.go index f178d0f75486..e19140dba76e 100644 --- a/internal/service/waf/ipset_data_source_test.go +++ b/internal/service/waf/ipset_data_source_test.go @@ -12,6 +12,7 @@ import ( ) func TestAccWAFIPSetDataSource_basic(t *testing.T) { + ctx := acctest.Context(t) name := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resourceName := "aws_waf_ipset.ipset" datasourceName := "data.aws_waf_ipset.ipset" 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 f0e02b9644b6..c6b7703e1881 100644 --- a/internal/service/waf/rate_based_rule_data_source_test.go +++ b/internal/service/waf/rate_based_rule_data_source_test.go @@ -12,6 +12,7 @@ import ( ) func TestAccWAFRateBasedRuleDataSource_basic(t *testing.T) { + ctx := acctest.Context(t) name := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resourceName := "aws_waf_rate_based_rule.wafrule" datasourceName := "data.aws_waf_rate_based_rule.wafrule" diff --git a/internal/service/waf/rule_data_source_test.go b/internal/service/waf/rule_data_source_test.go index 86c806cbc9fd..e0973659ec31 100644 --- a/internal/service/waf/rule_data_source_test.go +++ b/internal/service/waf/rule_data_source_test.go @@ -12,6 +12,7 @@ import ( ) func TestAccWAFRuleDataSource_basic(t *testing.T) { + ctx := acctest.Context(t) name := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resourceName := "aws_waf_rule.wafrule" datasourceName := "data.aws_waf_rule.wafrule" diff --git a/internal/service/waf/subscribed_rule_group_test.go b/internal/service/waf/subscribed_rule_group_test.go index 9c69a4f179f7..b11bfcb8fc58 100644 --- a/internal/service/waf/subscribed_rule_group_test.go +++ b/internal/service/waf/subscribed_rule_group_test.go @@ -12,6 +12,7 @@ import ( ) func TestAccWAFSubscribedRuleGroupDataSource_basic(t *testing.T) { + ctx := acctest.Context(t) if os.Getenv("WAF_SUBSCRIBED_RULE_GROUP_NAME") == "" { t.Skip("Environment variable WAF_SUBSCRIBED_RULE_GROUP_NAME is not set") } diff --git a/internal/service/waf/web_acl_data_source_test.go b/internal/service/waf/web_acl_data_source_test.go index 42c2fe5ae655..02a41e9de25f 100644 --- a/internal/service/waf/web_acl_data_source_test.go +++ b/internal/service/waf/web_acl_data_source_test.go @@ -12,6 +12,7 @@ import ( ) func TestAccWAFWebACLDataSource_basic(t *testing.T) { + ctx := acctest.Context(t) name := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resourceName := "aws_waf_web_acl.web_acl" datasourceName := "data.aws_waf_web_acl.web_acl" From 7e5a8ce03a6a3bda1cb5b17ee1ac4acba5439e0d Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Fri, 24 Feb 2023 17:02:18 -0500 Subject: [PATCH 334/763] Add 'ctx := acctest.Context(t)' for wafregional. --- internal/service/wafregional/ipset_data_source_test.go | 1 + internal/service/wafregional/rate_based_rule_data_source_test.go | 1 + internal/service/wafregional/rule_data_source_test.go | 1 + internal/service/wafregional/subscribed_rule_group_test.go | 1 + internal/service/wafregional/web_acl_data_source_test.go | 1 + 5 files changed, 5 insertions(+) diff --git a/internal/service/wafregional/ipset_data_source_test.go b/internal/service/wafregional/ipset_data_source_test.go index aebbb7e013c2..a71e81c45e37 100644 --- a/internal/service/wafregional/ipset_data_source_test.go +++ b/internal/service/wafregional/ipset_data_source_test.go @@ -12,6 +12,7 @@ import ( ) func TestAccWAFRegionalIPSetDataSource_basic(t *testing.T) { + ctx := acctest.Context(t) name := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resourceName := "aws_wafregional_ipset.ipset" datasourceName := "data.aws_wafregional_ipset.ipset" 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 cf57e29cf282..1df094fec37c 100644 --- a/internal/service/wafregional/rate_based_rule_data_source_test.go +++ b/internal/service/wafregional/rate_based_rule_data_source_test.go @@ -12,6 +12,7 @@ import ( ) func TestAccWAFRegionalRateBasedRuleDataSource_basic(t *testing.T) { + ctx := acctest.Context(t) name := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resourceName := "aws_wafregional_rate_based_rule.wafrule" datasourceName := "data.aws_wafregional_rate_based_rule.wafrule" diff --git a/internal/service/wafregional/rule_data_source_test.go b/internal/service/wafregional/rule_data_source_test.go index e1725601b587..3df0ed3dd559 100644 --- a/internal/service/wafregional/rule_data_source_test.go +++ b/internal/service/wafregional/rule_data_source_test.go @@ -12,6 +12,7 @@ import ( ) func TestAccWAFRegionalRuleDataSource_basic(t *testing.T) { + ctx := acctest.Context(t) name := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resourceName := "aws_wafregional_rule.wafrule" datasourceName := "data.aws_wafregional_rule.wafrule" diff --git a/internal/service/wafregional/subscribed_rule_group_test.go b/internal/service/wafregional/subscribed_rule_group_test.go index 4a948c2295b4..8e4c526e28ee 100644 --- a/internal/service/wafregional/subscribed_rule_group_test.go +++ b/internal/service/wafregional/subscribed_rule_group_test.go @@ -12,6 +12,7 @@ import ( ) func TestAccWAFRegionalSubscribedRuleGroupDataSource_basic(t *testing.T) { + ctx := acctest.Context(t) if os.Getenv("WAF_SUBSCRIBED_RULE_GROUP_NAME") == "" { t.Skip("Environment variable WAF_SUBSCRIBED_RULE_GROUP_NAME is not set") } diff --git a/internal/service/wafregional/web_acl_data_source_test.go b/internal/service/wafregional/web_acl_data_source_test.go index d5fcd4537ca3..d515b746eced 100644 --- a/internal/service/wafregional/web_acl_data_source_test.go +++ b/internal/service/wafregional/web_acl_data_source_test.go @@ -12,6 +12,7 @@ import ( ) func TestAccWAFRegionalWebACLDataSource_basic(t *testing.T) { + ctx := acctest.Context(t) name := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resourceName := "aws_wafregional_web_acl.web_acl" datasourceName := "data.aws_wafregional_web_acl.web_acl" From 7f3c0032c7c88ea93ccd91b16023320494f52173 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Fri, 24 Feb 2023 17:02:18 -0500 Subject: [PATCH 335/763] Add 'ctx := acctest.Context(t)' for workspaces. --- internal/service/workspaces/bundle_data_source_test.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/internal/service/workspaces/bundle_data_source_test.go b/internal/service/workspaces/bundle_data_source_test.go index 015f1075ffbc..4b770c4a916d 100644 --- a/internal/service/workspaces/bundle_data_source_test.go +++ b/internal/service/workspaces/bundle_data_source_test.go @@ -12,6 +12,7 @@ import ( ) func testAccWorkspaceBundleDataSource_basic(t *testing.T) { + ctx := acctest.Context(t) dataSourceName := "data.aws_workspaces_bundle.test" resource.Test(t, resource.TestCase{ @@ -39,6 +40,7 @@ func testAccWorkspaceBundleDataSource_basic(t *testing.T) { } func testAccWorkspaceBundleDataSource_byOwnerName(t *testing.T) { + ctx := acctest.Context(t) dataSourceName := "data.aws_workspaces_bundle.test" resource.Test(t, resource.TestCase{ @@ -66,6 +68,7 @@ func testAccWorkspaceBundleDataSource_byOwnerName(t *testing.T) { } func testAccWorkspaceBundleDataSource_bundleIDAndNameConflict(t *testing.T) { + ctx := acctest.Context(t) resource.Test(t, resource.TestCase{ PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, workspaces.EndpointsID), @@ -80,6 +83,7 @@ func testAccWorkspaceBundleDataSource_bundleIDAndNameConflict(t *testing.T) { } func testAccWorkspaceBundleDataSource_privateOwner(t *testing.T) { + ctx := acctest.Context(t) dataSourceName := "data.aws_workspaces_bundle.test" bundleName := os.Getenv("AWS_WORKSPACES_BUNDLE_NAME") From 35646eff7052f857100395997bf265ae90568ef0 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Fri, 24 Feb 2023 17:05:43 -0500 Subject: [PATCH 336/763] Add 'Context' argument to 'acctest.PreCheck' - skaff. --- skaff/datasource/datasourcetest.tmpl | 2 +- skaff/resource/resourcetest.tmpl | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/skaff/datasource/datasourcetest.tmpl b/skaff/datasource/datasourcetest.tmpl index 1a29de3097f4..2a50e1082c9c 100644 --- a/skaff/datasource/datasourcetest.tmpl +++ b/skaff/datasource/datasourcetest.tmpl @@ -172,7 +172,7 @@ func TestAcc{{ .Service }}{{ .DataSource }}DataSource_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService({{ .ServicePackage }}.EndpointsID, t) testAccPreCheck(ctx, t) }, diff --git a/skaff/resource/resourcetest.tmpl b/skaff/resource/resourcetest.tmpl index 03d99df7144e..e06e8ed0c70b 100644 --- a/skaff/resource/resourcetest.tmpl +++ b/skaff/resource/resourcetest.tmpl @@ -173,7 +173,7 @@ func TestAcc{{ .Service }}{{ .Resource }}_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) {{- if .AWSGoSDKV2 }} acctest.PreCheckPartitionHasService(names.{{ .Service }}EndpointID, t) {{- else }} @@ -226,7 +226,7 @@ func TestAcc{{ .Service }}{{ .Resource }}_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) {{- if .AWSGoSDKV2 }} acctest.PreCheckPartitionHasService(names.{{ .Service }}EndpointID, t) {{- else }} From 50371dc8617fa0abd7d165dd84375782f5f903af Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Fri, 24 Feb 2023 17:14:18 -0500 Subject: [PATCH 337/763] Add 'Context' argument to 'acctest.PreCheck' - contributor documentation. --- docs/adding-a-tag-resource.md | 6 ++-- docs/resource-name-generation.md | 14 ++++++---- docs/resource-tagging.md | 19 +++++++------ docs/running-and-writing-acceptance-tests.md | 29 ++++++++++++-------- docs/service-package-pullrequest-guide.md | 2 +- 5 files changed, 39 insertions(+), 31 deletions(-) diff --git a/docs/adding-a-tag-resource.md b/docs/adding-a-tag-resource.md index e25784a36434..c41a2dad2ef2 100644 --- a/docs/adding-a-tag-resource.md +++ b/docs/adding-a-tag-resource.md @@ -25,7 +25,7 @@ func TestAcc{Service}Tag_basic(t *testing.T) { resourceName := "aws_{service}_tag.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, {Service}.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheck{Service}TagDestroy(ctx), @@ -53,7 +53,7 @@ func TestAcc{Service}Tag_disappears(t *testing.T) { resourceName := "aws_{service}_tag.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, {Service}.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheck{Service}TagDestroy(ctx), @@ -76,7 +76,7 @@ func TestAcc{Service}Tag_Value(t *testing.T) { resourceName := "aws_{service}_tag.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, {Service}.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheck{Service}TagDestroy(ctx), diff --git a/docs/resource-name-generation.md b/docs/resource-name-generation.md index ffede4dbf6c8..85a4e3ad3145 100644 --- a/docs/resource-name-generation.md +++ b/docs/resource-name-generation.md @@ -52,19 +52,20 @@ d.Set("name_prefix", create.NamePrefixFromName(aws.StringValue(resp.Name))) ```go func TestAccServiceThing_nameGenerated(t *testing.T) { + ctx := acctest.Context(t) var thing service.ServiceThing resourceName := "aws_service_thing.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, service.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - CheckDestroy: testAccCheckThingDestroy, + CheckDestroy: testAccCheckThingDestroy(ctx), Steps: []resource.TestStep{ { Config: testAccThingConfig_nameGenerated(), Check: resource.ComposeTestCheckFunc( - testAccCheckThingExists(resourceName, &thing), + testAccCheckThingExists(ctx, resourceName, &thing), acctest.CheckResourceAttrNameGenerated(resourceName, "name"), resource.TestCheckResourceAttr(resourceName, "name_prefix", resource.UniqueIdPrefix), ), @@ -80,19 +81,20 @@ func TestAccServiceThing_nameGenerated(t *testing.T) { } func TestAccServiceThing_namePrefix(t *testing.T) { + ctx := acctest.Context(t) var thing service.ServiceThing resourceName := "aws_service_thing.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, service.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - CheckDestroy: testAccCheckThingDestroy, + CheckDestroy: testAccCheckThingDestroy(ctx), Steps: []resource.TestStep{ { Config: testAccThingConfig_namePrefix("tf-acc-test-prefix-"), Check: resource.ComposeTestCheckFunc( - testAccCheckThingExists(resourceName, &thing), + testAccCheckThingExists(ctx, resourceName, &thing), acctest.CheckResourceAttrNameFromPrefix(resourceName, "name", "tf-acc-test-prefix-"), resource.TestCheckResourceAttr(resourceName, "name_prefix", "tf-acc-test-prefix-"), ), diff --git a/docs/resource-tagging.md b/docs/resource-tagging.md index 619e4624883c..73ceb2a494c4 100644 --- a/docs/resource-tagging.md +++ b/docs/resource-tagging.md @@ -229,7 +229,7 @@ tags := defaultTagsConfig.MergeTags(tftags.New(ctx, d.Get("tags").(map[string]in /* ... creation steps ... */ if len(tags) > 0 { - if err := UpdateTags(conn, d.Id(), nil, tags); err != nil { + if err := UpdateTags(ctx, conn, d.Id(), nil, tags); err != nil { return fmt.Errorf("adding DeviceFarm Device Pool (%s) tags: %w", d.Id(), err) } } @@ -282,7 +282,7 @@ ignoreTagsConfig := meta.(*AWSClient).IgnoreTagsConfig /* ... other d.Set(...) logic ... */ -tags, err := ListTags(conn, arn.String()) +tags, err := ListTags(ctx, conn, arn.String()) if err != nil { return fmt.Errorf("listing tags for resource (%s): %w", arn, err) @@ -306,7 +306,7 @@ In the resource `Update` operation, implement the logic to handle tagging update ```go if d.HasChange("tags_all") { o, n := d.GetChange("tags_all") - if err := UpdateTags(conn, d.Get("arn").(string), o, n); err != nil { + if err := UpdateTags(ctx, conn, d.Get("arn").(string), o, n); err != nil { return fmt.Errorf("updating tags: %w", err) } } @@ -323,7 +323,7 @@ if d.HasChangesExcept("tags", "tags_all") { SetAsDefault: aws.Bool(true), } - if _, err := conn.CreatePolicyVersion(request); err != nil { + if _, err := conn.CreatePolicyVersionWithContext(ctx, request); err != nil { return fmt.Errorf("updating IAM policy (%s): %w", d.Id(), err) } } @@ -337,20 +337,21 @@ In the resource testing, implement a new test named `_tags` with associated conf ```go func TestAccEKSCluster_tags(t *testing.T) { + ctx := acctest.Context(t) var cluster1, cluster2, cluster3 eks.Cluster rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resourceName := "aws_eks_cluster.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(t) }, ErrorCheck: acctest.ErrorCheck(t, eks.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - CheckDestroy: testAccCheckClusterDestroy, + CheckDestroy: testAccCheckClusterDestroy(ctx), Steps: []resource.TestStep{ { Config: testAccClusterConfig_tags1(rName, "key1", "value1"), Check: resource.ComposeTestCheckFunc( - testAccCheckClusterExists(resourceName, &cluster1), + testAccCheckClusterExists(ctx, resourceName, &cluster1), resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), resource.TestCheckResourceAttr(resourceName, "tags.key1", "value1"), ), @@ -363,7 +364,7 @@ func TestAccEKSCluster_tags(t *testing.T) { { Config: testAccClusterConfig_tags2(rName, "key1", "value1updated", "key2", "value2"), Check: resource.ComposeTestCheckFunc( - testAccCheckClusterExists(resourceName, &cluster2), + testAccCheckClusterExists(ctx, resourceName, &cluster2), resource.TestCheckResourceAttr(resourceName, "tags.%", "2"), resource.TestCheckResourceAttr(resourceName, "tags.key1", "value1updated"), resource.TestCheckResourceAttr(resourceName, "tags.key2", "value2"), @@ -372,7 +373,7 @@ func TestAccEKSCluster_tags(t *testing.T) { { Config: testAccClusterConfig_tags1(rName, "key2", "value2"), Check: resource.ComposeTestCheckFunc( - testAccCheckClusterExists(resourceName, &cluster3), + testAccCheckClusterExists(ctx, resourceName, &cluster3), resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), resource.TestCheckResourceAttr(resourceName, "tags.key2", "value2"), ), diff --git a/docs/running-and-writing-acceptance-tests.md b/docs/running-and-writing-acceptance-tests.md index a872a9c19e36..03970f5f93b6 100644 --- a/docs/running-and-writing-acceptance-tests.md +++ b/docs/running-and-writing-acceptance-tests.md @@ -194,8 +194,9 @@ func TestAccCloudWatchDashboard_basic(t *testing.T) { ctx := acctest.Context(t) var dashboard cloudwatch.GetDashboardOutput rInt := acctest.RandInt() + resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, cloudwatch.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDashboardDestroy(ctx), @@ -412,6 +413,7 @@ For example: ```go func TestAccExampleThing_basic(t *testing.T) { + ctx := acctest.Context(t) rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) // ... omitted for brevity ... @@ -461,6 +463,7 @@ For example: ```go func TestAccExampleThing_basic(t *testing.T) { + ctx := acctest.Context(t) // ... omitted for brevity ... resourceName := "aws_example_thing.test" @@ -511,7 +514,7 @@ func TestAccExampleThing_basic(t *testing.T) { resourceName := "aws_example_thing.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, service.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckExampleThingDestroy(ctx), @@ -553,11 +556,12 @@ Here is an example of the default PreCheck: ```go func TestAccExampleThing_basic(t *testing.T) { + ctx := acctest.Context(t) rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resourceName := "aws_example_thing.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, // ... additional checks follow ... }) } @@ -580,11 +584,12 @@ This is an example of using a standard PreCheck function. For an established ser ```go func TestAccExampleThing_basic(t *testing.T) { + ctx := acctest.Context(t) rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resourceName := "aws_example_thing.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(waf.EndpointsID, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionHasService(waf.EndpointsID, t) }, // ... additional checks follow ... }) } @@ -603,7 +608,7 @@ func TestAccExampleThing_basic(t *testing.T) { resourceName := "aws_example_thing.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t), testAccPreCheckExample(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t), testAccPreCheckExample(ctx, t) }, // ... additional checks follow ... }) } @@ -711,7 +716,7 @@ func TestAccExampleThing_disappears(t *testing.T) { resourceName := "aws_example_thing.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, service.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckExampleThingDestroy(ctx), @@ -755,7 +760,7 @@ func TestAccExampleChildThing_disappears_ParentThing(t *testing.T) { resourceName := "aws_example_child_thing.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, service.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckExampleChildThingDestroy(ctx), @@ -786,7 +791,7 @@ func TestAccExampleThing_Description(t *testing.T) { resourceName := "aws_example_thing.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, service.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckExampleThingDestroy(ctx), @@ -844,7 +849,7 @@ func TestAccExample_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckOrganizationsAccount(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, service.EndpointsID), @@ -908,7 +913,7 @@ func TestAccExample_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { - acctest.PreCheck(t) + acctest.PreCheck(ctx, t) acctest.PreCheckMultipleRegion(t, 2) }, ErrorCheck: acctest.ErrorCheck(t, service.EndpointsID), @@ -1048,7 +1053,7 @@ func testAccGetPricingRegion() string { For the resource or data source acceptance tests, the key items to adjust are: * Ensure `TestCase` uses `ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories` instead of `ProviderFactories: acctest.ProviderFactories` or `Providers: acctest.Providers` -* Add the call for the new `PreCheck` function (keeping `acctest.PreCheck(t)`), e.g. `PreCheck: func() { acctest.PreCheck(t); testAccPreCheckPricing(t) },` +* Add the call for the new `PreCheck` function (keeping `acctest.PreCheck(ctx, t)`), e.g. `PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckPricing(t) },` * If the testing is for a managed resource with a `CheckDestroy` function, ensure it uses the new provider instance, e.g. `testAccProviderPricing`, instead of `acctest.Provider`. * If the testing is for a managed resource with a `Check...Exists` function, ensure it uses the new provider instance, e.g. `testAccProviderPricing`, instead of `acctest.Provider`. * In each `TestStep` configuration, ensure the new provider configuration function is called, e.g. @@ -1120,7 +1125,7 @@ func TestAccExampleThingDataSource_Name(t *testing.T) { resourceName := "aws_example_thing.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, service.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckExampleThingDestroy(ctx), diff --git a/docs/service-package-pullrequest-guide.md b/docs/service-package-pullrequest-guide.md index cd2d486f73be..9adc4be3ed9d 100644 --- a/docs/service-package-pullrequest-guide.md +++ b/docs/service-package-pullrequest-guide.md @@ -166,7 +166,7 @@ with the pull request author. | `isResourceNotFoundError(α)` | `tfresource.NotFound(α)` | | `isResourceTimeoutError(α)` | `tfresource.TimedOut(α)` | | `testSweepSkipResourceError(α)` | `tfawserr.ErrCodeContains(α, "AccessDenied")` | - | `testAccPreCheck(t)` | `acctest.PreCheck(t)` | + | `testAccPreCheck(t)` | `acctest.PreCheck(ctx, t)` | | `testAccProviders` | `acctest.Providers` | | `acctest.RandomWithPrefix("tf-acc-test")` | `sdkacctest.RandomWithPrefix(acctest.ResourcePrefix)` | | `composeConfig(α)` | `acctest.ConfigCompose(α)` | From d635a3b942df266ad5cdb6ae9b967b2b354faa68 Mon Sep 17 00:00:00 2001 From: bjernie Date: Sat, 25 Feb 2023 00:51:34 +0100 Subject: [PATCH 338/763] Added change to changelog --- .changelog/29635.txt | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 .changelog/29635.txt diff --git a/.changelog/29635.txt b/.changelog/29635.txt new file mode 100644 index 000000000000..12bd91534d91 --- /dev/null +++ b/.changelog/29635.txt @@ -0,0 +1,3 @@ +```release-note:enhancement +resource/aws_qldb_ledger: Added timeouts +``` \ No newline at end of file From 8fe62a4bbc3fdb6b506a9a8ee8e4234c15869ba2 Mon Sep 17 00:00:00 2001 From: bjernie Date: Sat, 25 Feb 2023 00:54:41 +0100 Subject: [PATCH 339/763] formatting --- internal/service/qldb/ledger.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/service/qldb/ledger.go b/internal/service/qldb/ledger.go index e2ada6e822fd..8b712406c9eb 100644 --- a/internal/service/qldb/ledger.go +++ b/internal/service/qldb/ledger.go @@ -315,4 +315,4 @@ func waitLedgerDeleted(ctx context.Context, conn *qldb.QLDB, name string) (*qldb } return nil, err -} \ No newline at end of file +} From a9face37f3ce9f8ffbf2ba43e67f940fa895a577 Mon Sep 17 00:00:00 2001 From: drfaust92 Date: Sat, 25 Feb 2023 19:18:26 +0200 Subject: [PATCH 340/763] rebase --- internal/service/rds/consts.go | 5 +++ internal/service/rds/snapshot.go | 45 +------------------- internal/service/rds/snapshot_copy.go | 59 ++++++++++----------------- internal/service/rds/snapshot_test.go | 2 +- internal/service/rds/status.go | 16 ++++++++ internal/service/rds/wait.go | 15 +++++++ 6 files changed, 60 insertions(+), 82 deletions(-) diff --git a/internal/service/rds/consts.go b/internal/service/rds/consts.go index dc00aaf5dd21..ec1663363a4d 100644 --- a/internal/service/rds/consts.go +++ b/internal/service/rds/consts.go @@ -101,6 +101,11 @@ const ( EventSubscriptionStatusModifying = "modifying" ) +const ( + DBSnapshotAvailable = "available" + DBSnapshotCreating = "creating" +) + const ( ClusterEngineAurora = "aurora" ClusterEngineAuroraMySQL = "aurora-mysql" diff --git a/internal/service/rds/snapshot.go b/internal/service/rds/snapshot.go index c72959a1f279..f9d18cb00931 100644 --- a/internal/service/rds/snapshot.go +++ b/internal/service/rds/snapshot.go @@ -2,7 +2,6 @@ package rds import ( "context" - "fmt" "log" "time" @@ -10,7 +9,6 @@ import ( "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/resource" "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" @@ -145,18 +143,8 @@ func resourceSnapshotCreate(ctx context.Context, d *schema.ResourceData, meta in } d.SetId(aws.StringValue(resp.DBSnapshot.DBSnapshotIdentifier)) - stateConf := &resource.StateChangeConf{ - Pending: []string{"creating"}, - Target: []string{"available"}, - Refresh: resourceSnapshotStateRefreshFunc(ctx, d, meta), - Timeout: d.Timeout(schema.TimeoutRead), - MinTimeout: 10 * time.Second, - Delay: 30 * time.Second, // Wait 30 secs before starting - } - - _, err = stateConf.WaitForStateContext(ctx) - if err != nil { - return sdkdiag.AppendErrorf(diags, "creating AWS DB Snapshot (%s): waiting for completion: %s", dBInstanceIdentifier, err) + if err := waitDBSnapshotAvailable(ctx, conn, d.Id(), d.Timeout(schema.TimeoutCreate)); err != nil { + return sdkdiag.AppendErrorf(diags, "waiting for RDS DB Snapshot (%s) to be available: %s", d.Id(), err) } if v, ok := d.GetOk("shared_accounts"); ok && v.(*schema.Set).Len() > 0 { @@ -300,32 +288,3 @@ func resourceSnapshotUpdate(ctx context.Context, d *schema.ResourceData, meta in return diags } - -func resourceSnapshotStateRefreshFunc(ctx context.Context, - d *schema.ResourceData, meta interface{}) resource.StateRefreshFunc { - return func() (interface{}, string, error) { - conn := meta.(*conns.AWSClient).RDSConn() - - opts := &rds.DescribeDBSnapshotsInput{ - DBSnapshotIdentifier: aws.String(d.Id()), - } - - log.Printf("[DEBUG] DB Snapshot describe configuration: %#v", opts) - - resp, err := conn.DescribeDBSnapshotsWithContext(ctx, opts) - if tfawserr.ErrCodeEquals(err, rds.ErrCodeDBSnapshotNotFoundFault) { - return nil, "", nil - } - if err != nil { - return nil, "", fmt.Errorf("Error retrieving DB Snapshots: %s", err) - } - - if len(resp.DBSnapshots) != 1 { - return nil, "", fmt.Errorf("No snapshots returned for %s", d.Id()) - } - - snapshot := resp.DBSnapshots[0] - - return resp, *snapshot.Status, nil - } -} diff --git a/internal/service/rds/snapshot_copy.go b/internal/service/rds/snapshot_copy.go index 7a29489eb016..6b196bd3337d 100644 --- a/internal/service/rds/snapshot_copy.go +++ b/internal/service/rds/snapshot_copy.go @@ -10,10 +10,10 @@ import ( "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/resource" "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" @@ -140,6 +140,7 @@ func ResourceSnapshotCopy() *schema.Resource { } func resourceSnapshotCopyCreate(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { + var diags diag.Diagnostics conn := meta.(*conns.AWSClient).RDSConn() defaultTagsConfig := meta.(*conns.AWSClient).DefaultTagsConfig tags := defaultTagsConfig.MergeTags(tftags.New(ctx, d.Get("tags").(map[string]interface{}))) @@ -168,20 +169,20 @@ func resourceSnapshotCopyCreate(ctx context.Context, d *schema.ResourceData, met out, err := conn.CopyDBSnapshotWithContext(ctx, in) if err != nil { - return diag.Errorf("error creating RDS DB Snapshot Copy %s", err) + return sdkdiag.AppendErrorf(diags, "error creating RDS DB Snapshot Copy %s", err) } d.SetId(aws.StringValue(out.DBSnapshot.DBSnapshotIdentifier)) - err = waitSnapshotCopyAvailable(ctx, d, meta) - if err != nil { - return diag.FromErr(err) + if err := waitDBSnapshotAvailable(ctx, conn, d.Id(), d.Timeout(schema.TimeoutCreate)); err != nil { + return sdkdiag.AppendErrorf(diags, "waiting for RDS DB Snapshot Copy (%s) to be available: %s", d.Id(), err) } - return resourceSnapshotCopyRead(ctx, d, meta) + return append(diags, resourceSnapshotCopyRead(ctx, d, meta)...) } func resourceSnapshotCopyRead(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { + var diags diag.Diagnostics conn := meta.(*conns.AWSClient).RDSConn() defaultTagsConfig := meta.(*conns.AWSClient).DefaultTagsConfig ignoreTagsConfig := meta.(*conns.AWSClient).IgnoreTagsConfig @@ -195,7 +196,7 @@ func resourceSnapshotCopyRead(ctx context.Context, d *schema.ResourceData, meta } if err != nil { - return diag.Errorf("reading RDS DB snapshot (%s): %s", d.Id(), err) + return sdkdiag.AppendErrorf(diags, "reading RDS DB snapshot (%s): %s", d.Id(), err) } arn := aws.StringValue(snapshot.DBSnapshotArn) @@ -220,31 +221,32 @@ func resourceSnapshotCopyRead(ctx context.Context, d *schema.ResourceData, meta tags, err := ListTags(ctx, conn, arn) if err != nil { - return diag.Errorf("error listing tags for RDS DB Snapshot (%s): %s", arn, err) + return sdkdiag.AppendErrorf(diags, "error listing tags for RDS DB Snapshot (%s): %s", arn, err) } tags = tags.IgnoreAWS().IgnoreConfig(ignoreTagsConfig) //lintignore:AWSR002 if err := d.Set("tags", tags.RemoveDefaultConfig(defaultTagsConfig).Map()); err != nil { - return diag.Errorf("error setting tags: %s", err) + return sdkdiag.AppendErrorf(diags, "error setting tags: %s", err) } if err := d.Set("tags_all", tags.Map()); err != nil { - return diag.Errorf("error setting tags_all: %s", err) + return sdkdiag.AppendErrorf(diags, "error setting tags_all: %s", err) } - return nil + return diags } func resourceSnapshotCopyUpdate(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { + var diags diag.Diagnostics conn := meta.(*conns.AWSClient).RDSConn() if d.HasChange("tags_all") { o, n := d.GetChange("tags_all") if err := UpdateTags(ctx, conn, d.Get("db_snapshot_arn").(string), o, n); err != nil { - return diag.Errorf("error updating RDS DB Snapshot (%s) tags: %s", d.Get("db_snapshot_arn").(string), err) + sdkdiag.AppendErrorf(diags, "error updating RDS DB Snapshot (%s) tags: %s", d.Get("db_snapshot_arn").(string), err) } } @@ -252,40 +254,21 @@ func resourceSnapshotCopyUpdate(ctx context.Context, d *schema.ResourceData, met } func resourceSnapshotCopyDelete(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { + var diags diag.Diagnostics conn := meta.(*conns.AWSClient).RDSConn() - log.Printf("[INFO] Deleting RDS DB Snapshot %s", d.Id()) - - in := &rds.DeleteDBSnapshotInput{ + log.Printf("[DEBUG] Deleting RDS DB Snapshot: %s", d.Id()) + _, err := conn.DeleteDBSnapshotWithContext(ctx, &rds.DeleteDBSnapshotInput{ DBSnapshotIdentifier: aws.String(d.Id()), - } + }) - _, err := conn.DeleteDBSnapshotWithContext(ctx, in) if tfawserr.ErrCodeEquals(err, rds.ErrCodeDBSnapshotNotFoundFault) { - return nil + return diags } if err != nil { - return diag.Errorf("error deleting RDS DB Snapshot (%s): %s", d.Id(), err) + return sdkdiag.AppendErrorf(diags, "deleting RDS DB Snapshot (%s): %s", d.Id(), err) } - return nil -} - -func waitSnapshotCopyAvailable(ctx context.Context, d *schema.ResourceData, meta interface{}) error { - log.Printf("[DEBUG] Waiting for Snapshot %s to become available...", d.Id()) - - stateConf := &resource.StateChangeConf{ - Pending: []string{"creating"}, - Target: []string{"available"}, - Refresh: resourceSnapshotStateRefreshFunc(ctx, d, meta), - Timeout: d.Timeout(schema.TimeoutCreate), - MinTimeout: 10 * time.Second, - Delay: 30 * time.Second, // Wait 30 secs before starting - } - - // Wait, catching any errors - _, err := stateConf.WaitForStateContext(ctx) - - return err + return diags } diff --git a/internal/service/rds/snapshot_test.go b/internal/service/rds/snapshot_test.go index 5e65c4e68a4c..46a61373e7c0 100644 --- a/internal/service/rds/snapshot_test.go +++ b/internal/service/rds/snapshot_test.go @@ -210,7 +210,7 @@ func testAccCheckDBSnapshotExists(ctx context.Context, n string, v *rds.DBSnapsh conn := acctest.Provider.Meta().(*conns.AWSClient).RDSConn() - out, err := tfrds.FindDBSnapshotByID(context.Background(), conn, rs.Primary.ID) + out, err := tfrds.FindDBSnapshotByID(ctx, conn, rs.Primary.ID) if err != nil { return err } diff --git a/internal/service/rds/status.go b/internal/service/rds/status.go index 5ae62f64f434..c00351923687 100644 --- a/internal/service/rds/status.go +++ b/internal/service/rds/status.go @@ -158,3 +158,19 @@ func statusReservedInstance(ctx context.Context, conn *rds.RDS, id string) resou return output, aws.StringValue(output.State), nil } } + +func statusDBSnapshot(ctx context.Context, conn *rds.RDS, id string) resource.StateRefreshFunc { + return func() (interface{}, string, error) { + output, err := FindDBSnapshotByID(ctx, conn, id) + + if tfresource.NotFound(err) { + return nil, "", nil + } + + if err != nil { + return nil, "", err + } + + return output, aws.StringValue(output.Status), nil + } +} diff --git a/internal/service/rds/wait.go b/internal/service/rds/wait.go index 33e02dc5e2ff..c8e34e8f909d 100644 --- a/internal/service/rds/wait.go +++ b/internal/service/rds/wait.go @@ -383,3 +383,18 @@ func waitReservedInstanceCreated(ctx context.Context, conn *rds.RDS, id string, return err } + +func waitDBSnapshotAvailable(ctx context.Context, conn *rds.RDS, id string, timeout time.Duration) error { + stateConf := &resource.StateChangeConf{ + Pending: []string{DBSnapshotAvailable}, + Target: []string{DBSnapshotAvailable}, + Refresh: statusDBSnapshot(ctx, conn, id), + Timeout: timeout, + MinTimeout: 10 * time.Second, + Delay: 30 * time.Second, + } + + _, err := stateConf.WaitForStateContext(ctx) + + return err +} From 3ed095bd7f7dc0d15bc63f1c8a0f9e911a73ca27 Mon Sep 17 00:00:00 2001 From: drfaust92 Date: Sat, 25 Feb 2023 19:34:57 +0200 Subject: [PATCH 341/763] rebase --- internal/service/rds/wait.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/service/rds/wait.go b/internal/service/rds/wait.go index c8e34e8f909d..6179309ee25a 100644 --- a/internal/service/rds/wait.go +++ b/internal/service/rds/wait.go @@ -386,7 +386,7 @@ func waitReservedInstanceCreated(ctx context.Context, conn *rds.RDS, id string, func waitDBSnapshotAvailable(ctx context.Context, conn *rds.RDS, id string, timeout time.Duration) error { stateConf := &resource.StateChangeConf{ - Pending: []string{DBSnapshotAvailable}, + Pending: []string{DBSnapshotCreating}, Target: []string{DBSnapshotAvailable}, Refresh: statusDBSnapshot(ctx, conn, id), Timeout: timeout, From 96e0d77ee36b110de1c6feb18e085564c227718d Mon Sep 17 00:00:00 2001 From: drfaust92 Date: Sat, 25 Feb 2023 19:51:44 +0200 Subject: [PATCH 342/763] redshift snapshot sweep --- a.txt | 8 ++++++++ internal/service/redshift/sweep.go | 22 ++++++++++++++++------ 2 files changed, 24 insertions(+), 6 deletions(-) create mode 100644 a.txt diff --git a/a.txt b/a.txt new file mode 100644 index 000000000000..bceac209381b --- /dev/null +++ b/a.txt @@ -0,0 +1,8 @@ +==> Checking that code complies with gofmt requirements... +TF_ACC=1 go test ./internal/service/rds/... -v -count 1 -parallel 20 -run='TestAccRDSSnapshot_share' -timeout 180m +=== RUN TestAccRDSSnapshot_share +=== PAUSE TestAccRDSSnapshot_share +=== CONT TestAccRDSSnapshot_share +--- PASS: TestAccRDSSnapshot_share (698.03s) +PASS +ok github.com/hashicorp/terraform-provider-aws/internal/service/rds 700.312s diff --git a/internal/service/redshift/sweep.go b/internal/service/redshift/sweep.go index bba4c8af7717..c81b365c9260 100644 --- a/internal/service/redshift/sweep.go +++ b/internal/service/redshift/sweep.go @@ -76,6 +76,8 @@ func sweepClusterSnapshots(region string) error { return fmt.Errorf("getting client: %w", err) } conn := client.(*conns.AWSClient).RedshiftConn() + sweepResources := make([]sweep.Sweepable, 0) + var errs *multierror.Error err = conn.DescribeClusterSnapshotsPagesWithContext(ctx, &redshift.DescribeClusterSnapshotsInput{}, func(resp *redshift.DescribeClusterSnapshotsOutput, lastPage bool) bool { if len(resp.Snapshots) == 0 { @@ -93,14 +95,22 @@ func sweepClusterSnapshots(region string) error { return !lastPage }) + if err != nil { - if sweep.SkipSweepError(err) { - log.Printf("[WARN] Skipping Redshift Cluster Snapshot sweep for %s: %s", region, err) - return nil - } - return fmt.Errorf("Error retrieving Redshift cluster snapshots: %w", err) + errs = multierror.Append(errs, fmt.Errorf("describing Redshift Snapshots: %w", err)) + // in case work can be done, don't jump out yet } - return nil + + if err = sweep.SweepOrchestratorWithContext(ctx, sweepResources); err != nil { + errs = multierror.Append(errs, fmt.Errorf("sweeping Redshift Snapshots for %s: %w", region, err)) + } + + if sweep.SkipSweepError(errs.ErrorOrNil()) { + log.Printf("[WARN] Skipping Redshift Snapshots sweep for %s: %s", region, err) + return nil + } + + return errs.ErrorOrNil() } func sweepClusters(region string) error { From 93246d748301bc5399a2fa02a622d98b5b5b9130 Mon Sep 17 00:00:00 2001 From: drfaust92 Date: Sat, 25 Feb 2023 19:53:14 +0200 Subject: [PATCH 343/763] redshift snapshot sweep --- a.txt | 8 -------- 1 file changed, 8 deletions(-) delete mode 100644 a.txt diff --git a/a.txt b/a.txt deleted file mode 100644 index bceac209381b..000000000000 --- a/a.txt +++ /dev/null @@ -1,8 +0,0 @@ -==> Checking that code complies with gofmt requirements... -TF_ACC=1 go test ./internal/service/rds/... -v -count 1 -parallel 20 -run='TestAccRDSSnapshot_share' -timeout 180m -=== RUN TestAccRDSSnapshot_share -=== PAUSE TestAccRDSSnapshot_share -=== CONT TestAccRDSSnapshot_share ---- PASS: TestAccRDSSnapshot_share (698.03s) -PASS -ok github.com/hashicorp/terraform-provider-aws/internal/service/rds 700.312s From d0f9e8bf9b5e654e1812ff693f5ba8a57fe72062 Mon Sep 17 00:00:00 2001 From: Albert Silva Date: Sat, 25 Feb 2023 13:58:54 -0500 Subject: [PATCH 344/763] add autogenerated files --- .ci/.semgrep-service-name0.yml | 117 +++++++++--------- .ci/.semgrep-service-name1.yml | 87 ++++++++----- .ci/.semgrep-service-name2.yml | 56 ++++----- .ci/.semgrep-service-name3.yml | 28 +++++ .../components/generated/services_all.kt | 1 + internal/provider/service_packages_gen.go | 2 + internal/sweep/sweep_test.go | 1 + 7 files changed, 177 insertions(+), 115 deletions(-) diff --git a/.ci/.semgrep-service-name0.yml b/.ci/.semgrep-service-name0.yml index 41541420f1ef..4aed7d51792e 100644 --- a/.ci/.semgrep-service-name0.yml +++ b/.ci/.semgrep-service-name0.yml @@ -2709,6 +2709,64 @@ rules: patterns: - pattern-regex: "(?i)codedeploy" severity: WARNING + - id: codegurureviewer-in-func-name + languages: + - go + message: Do not use "CodeGuruReviewer" in func name inside codegurureviewer package + paths: + include: + - internal/service/codegurureviewer + patterns: + - pattern: func $NAME( ... ) { ... } + - metavariable-pattern: + metavariable: $NAME + patterns: + - pattern-regex: "(?i)CodeGuruReviewer" + - pattern-not-regex: ^TestAcc.* + severity: WARNING + - id: codegurureviewer-in-test-name + languages: + - go + message: Include "CodeGuruReviewer" in test name + paths: + include: + - internal/service/codegurureviewer/*_test.go + patterns: + - pattern: func $NAME( ... ) { ... } + - metavariable-pattern: + metavariable: $NAME + patterns: + - pattern-not-regex: "^TestAccCodeGuruReviewer" + - pattern-regex: ^TestAcc.* + severity: WARNING + - id: codegurureviewer-in-const-name + languages: + - go + message: Do not use "CodeGuruReviewer" in const name inside codegurureviewer package + paths: + include: + - internal/service/codegurureviewer + patterns: + - pattern: const $NAME = ... + - metavariable-pattern: + metavariable: $NAME + patterns: + - pattern-regex: "(?i)CodeGuruReviewer" + severity: WARNING + - id: codegurureviewer-in-var-name + languages: + - go + message: Do not use "CodeGuruReviewer" in var name inside codegurureviewer package + paths: + include: + - internal/service/codegurureviewer + patterns: + - pattern: var $NAME = ... + - metavariable-pattern: + metavariable: $NAME + patterns: + - pattern-regex: "(?i)CodeGuruReviewer" + severity: WARNING - id: codepipeline-in-func-name languages: - go @@ -3173,62 +3231,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 - - id: configservice-in-const-name - languages: - - go - message: Do not use "ConfigService" in const name inside configservice package - paths: - include: - - internal/service/configservice - patterns: - - pattern: const $NAME = ... - - metavariable-pattern: - metavariable: $NAME - patterns: - - pattern-regex: "(?i)ConfigService" - severity: WARNING - - id: configservice-in-var-name - languages: - - go - message: Do not use "ConfigService" in var name inside configservice package - paths: - include: - - internal/service/configservice - patterns: - - pattern: var $NAME = ... - - metavariable-pattern: - metavariable: $NAME - patterns: - - pattern-regex: "(?i)ConfigService" - severity: WARNING - - id: connect-in-func-name - languages: - - go - message: Do not use "Connect" in func name inside connect package - paths: - include: - - internal/service/connect - patterns: - - pattern: func $NAME( ... ) { ... } - - metavariable-pattern: - metavariable: $NAME - patterns: - - pattern-regex: "(?i)Connect" - - pattern-not-regex: .*uickConnect.* - - pattern-not-regex: ^TestAcc.* - severity: WARNING diff --git a/.ci/.semgrep-service-name1.yml b/.ci/.semgrep-service-name1.yml index 5f01f2824827..f0cd86ff2599 100644 --- a/.ci/.semgrep-service-name1.yml +++ b/.ci/.semgrep-service-name1.yml @@ -1,5 +1,64 @@ # 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 + message: Do not use "ConfigService" in const name inside configservice package + paths: + include: + - internal/service/configservice + patterns: + - pattern: const $NAME = ... + - metavariable-pattern: + metavariable: $NAME + patterns: + - pattern-regex: "(?i)ConfigService" + severity: WARNING + - id: configservice-in-var-name + languages: + - go + message: Do not use "ConfigService" in var name inside configservice package + paths: + include: + - internal/service/configservice + patterns: + - pattern: var $NAME = ... + - metavariable-pattern: + metavariable: $NAME + patterns: + - pattern-regex: "(?i)ConfigService" + severity: WARNING + - id: connect-in-func-name + languages: + - go + message: Do not use "Connect" in func name inside connect package + paths: + include: + - internal/service/connect + patterns: + - pattern: func $NAME( ... ) { ... } + - metavariable-pattern: + metavariable: $NAME + patterns: + - pattern-regex: "(?i)Connect" + - pattern-not-regex: .*uickConnect.* + - pattern-not-regex: ^TestAcc.* + severity: WARNING - id: connect-in-test-name languages: - go @@ -3176,31 +3235,3 @@ rules: - pattern-not-regex: "^TestAccInspector2" - pattern-regex: ^TestAcc.* severity: WARNING - - id: inspector2-in-const-name - languages: - - go - message: Do not use "Inspector2" in const name inside inspector2 package - paths: - include: - - internal/service/inspector2 - patterns: - - pattern: const $NAME = ... - - metavariable-pattern: - metavariable: $NAME - patterns: - - pattern-regex: "(?i)Inspector2" - severity: WARNING - - id: inspector2-in-var-name - languages: - - go - message: Do not use "Inspector2" in var name inside inspector2 package - paths: - include: - - internal/service/inspector2 - patterns: - - pattern: var $NAME = ... - - metavariable-pattern: - metavariable: $NAME - patterns: - - pattern-regex: "(?i)Inspector2" - severity: WARNING diff --git a/.ci/.semgrep-service-name2.yml b/.ci/.semgrep-service-name2.yml index 1156593d468d..189345c40e10 100644 --- a/.ci/.semgrep-service-name2.yml +++ b/.ci/.semgrep-service-name2.yml @@ -1,5 +1,33 @@ # Generated by internal/generate/servicesemgrep/main.go; DO NOT EDIT. rules: + - id: inspector2-in-const-name + languages: + - go + message: Do not use "Inspector2" in const name inside inspector2 package + paths: + include: + - internal/service/inspector2 + patterns: + - pattern: const $NAME = ... + - metavariable-pattern: + metavariable: $NAME + patterns: + - pattern-regex: "(?i)Inspector2" + severity: WARNING + - id: inspector2-in-var-name + languages: + - go + message: Do not use "Inspector2" in var name inside inspector2 package + paths: + include: + - internal/service/inspector2 + patterns: + - pattern: var $NAME = ... + - metavariable-pattern: + metavariable: $NAME + patterns: + - pattern-regex: "(?i)Inspector2" + severity: WARNING - id: inspectorv2-in-func-name languages: - go @@ -3202,31 +3230,3 @@ rules: - pattern-not-regex: "^TestAccRDS" - pattern-regex: ^TestAcc.* severity: WARNING - - id: rds-in-const-name - languages: - - go - message: Do not use "RDS" in const name inside rds package - paths: - include: - - internal/service/rds - patterns: - - pattern: const $NAME = ... - - metavariable-pattern: - metavariable: $NAME - patterns: - - pattern-regex: "(?i)RDS" - severity: WARNING - - id: rds-in-var-name - languages: - - go - message: Do not use "RDS" in var name inside rds package - paths: - include: - - internal/service/rds - patterns: - - pattern: var $NAME = ... - - metavariable-pattern: - metavariable: $NAME - patterns: - - pattern-regex: "(?i)RDS" - severity: WARNING diff --git a/.ci/.semgrep-service-name3.yml b/.ci/.semgrep-service-name3.yml index 9a70513e0884..2ceac17e8637 100644 --- a/.ci/.semgrep-service-name3.yml +++ b/.ci/.semgrep-service-name3.yml @@ -1,5 +1,33 @@ # Generated by internal/generate/servicesemgrep/main.go; DO NOT EDIT. rules: + - id: rds-in-const-name + languages: + - go + message: Do not use "RDS" in const name inside rds package + paths: + include: + - internal/service/rds + patterns: + - pattern: const $NAME = ... + - metavariable-pattern: + metavariable: $NAME + patterns: + - pattern-regex: "(?i)RDS" + severity: WARNING + - id: rds-in-var-name + languages: + - go + message: Do not use "RDS" in var name inside rds package + paths: + include: + - internal/service/rds + patterns: + - pattern: var $NAME = ... + - metavariable-pattern: + metavariable: $NAME + patterns: + - pattern-regex: "(?i)RDS" + severity: WARNING - id: redshift-in-func-name languages: - go diff --git a/.teamcity/components/generated/services_all.kt b/.teamcity/components/generated/services_all.kt index a1f1448c0f49..351c4cbbf61d 100644 --- a/.teamcity/components/generated/services_all.kt +++ b/.teamcity/components/generated/services_all.kt @@ -38,6 +38,7 @@ val services = mapOf( "codeartifact" to ServiceSpec("CodeArtifact"), "codebuild" to ServiceSpec("CodeBuild"), "codecommit" to ServiceSpec("CodeCommit"), + "codegurureviewer" to ServiceSpec("CodeGuru Reviewer"), "codepipeline" to ServiceSpec("CodePipeline"), "codestarconnections" to ServiceSpec("CodeStar Connections"), "codestarnotifications" to ServiceSpec("CodeStar Notifications"), diff --git a/internal/provider/service_packages_gen.go b/internal/provider/service_packages_gen.go index 5553cb845f2c..022f366142cc 100644 --- a/internal/provider/service_packages_gen.go +++ b/internal/provider/service_packages_gen.go @@ -43,6 +43,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/service/codeartifact" "github.com/hashicorp/terraform-provider-aws/internal/service/codebuild" "github.com/hashicorp/terraform-provider-aws/internal/service/codecommit" + "github.com/hashicorp/terraform-provider-aws/internal/service/codegurureviewer" "github.com/hashicorp/terraform-provider-aws/internal/service/codepipeline" "github.com/hashicorp/terraform-provider-aws/internal/service/codestarconnections" "github.com/hashicorp/terraform-provider-aws/internal/service/codestarnotifications" @@ -238,6 +239,7 @@ func servicePackages(context.Context) []conns.ServicePackage { codeartifact.ServicePackage, codebuild.ServicePackage, codecommit.ServicePackage, + codegurureviewer.ServicePackage, codepipeline.ServicePackage, codestarconnections.ServicePackage, codestarnotifications.ServicePackage, diff --git a/internal/sweep/sweep_test.go b/internal/sweep/sweep_test.go index e8405bee8052..141d8a5879a9 100644 --- a/internal/sweep/sweep_test.go +++ b/internal/sweep/sweep_test.go @@ -34,6 +34,7 @@ import ( _ "github.com/hashicorp/terraform-provider-aws/internal/service/cloudwatch" _ "github.com/hashicorp/terraform-provider-aws/internal/service/codeartifact" _ "github.com/hashicorp/terraform-provider-aws/internal/service/codebuild" + _ "github.com/hashicorp/terraform-provider-aws/internal/service/codegurureviewer" _ "github.com/hashicorp/terraform-provider-aws/internal/service/codepipeline" _ "github.com/hashicorp/terraform-provider-aws/internal/service/codestarconnections" _ "github.com/hashicorp/terraform-provider-aws/internal/service/cognitoidp" From 8f477f5f1847062a1efa9874fffcec796ac61089 Mon Sep 17 00:00:00 2001 From: Albert Silva Date: Sat, 25 Feb 2023 13:59:31 -0500 Subject: [PATCH 345/763] update provider.go aws_codegurureviewer_repository_association resource --- internal/provider/provider.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/internal/provider/provider.go b/internal/provider/provider.go index 1c2fcaada922..6c25c24b6108 100644 --- a/internal/provider/provider.go +++ b/internal/provider/provider.go @@ -52,6 +52,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/service/codeartifact" "github.com/hashicorp/terraform-provider-aws/internal/service/codebuild" "github.com/hashicorp/terraform-provider-aws/internal/service/codecommit" + "github.com/hashicorp/terraform-provider-aws/internal/service/codegurureviewer" "github.com/hashicorp/terraform-provider-aws/internal/service/codepipeline" "github.com/hashicorp/terraform-provider-aws/internal/service/codestarconnections" "github.com/hashicorp/terraform-provider-aws/internal/service/codestarnotifications" @@ -1163,6 +1164,8 @@ func New(ctx context.Context) (*schema.Provider, error) { "aws_codedeploy_deployment_config": deploy.ResourceDeploymentConfig(), "aws_codedeploy_deployment_group": deploy.ResourceDeploymentGroup(), + "aws_codegurureviewer_repository_association": codegurureviewer.ResourceRepositoryAssociation(), + "aws_codepipeline": codepipeline.ResourcePipeline(), "aws_codepipeline_custom_action_type": codepipeline.ResourceCustomActionType(), "aws_codepipeline_webhook": codepipeline.ResourceWebhook(), From 7cb3e7fd2a641a264f99ccc9138c8243d2bd4a27 Mon Sep 17 00:00:00 2001 From: Albert Silva Date: Sat, 25 Feb 2023 14:00:35 -0500 Subject: [PATCH 346/763] add generate.go for codegurureviewer service --- internal/service/codegurureviewer/generate.go | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 internal/service/codegurureviewer/generate.go diff --git a/internal/service/codegurureviewer/generate.go b/internal/service/codegurureviewer/generate.go new file mode 100644 index 000000000000..43ee60105dc5 --- /dev/null +++ b/internal/service/codegurureviewer/generate.go @@ -0,0 +1,4 @@ +//go:generate go run ../../generate/tags/main.go -ListTags -ServiceTagsMap -UpdateTags -ContextOnly +// ONLY generate directives and package declaration! Do not add anything else to this file. + +package codegurureviewer From 42052ed37f5d60bf4b40c20160026064c8b37b51 Mon Sep 17 00:00:00 2001 From: Albert Silva Date: Sat, 25 Feb 2023 14:01:05 -0500 Subject: [PATCH 347/763] add service_package_gen.go for codegurureviewer service --- .../codegurureviewer/service_package_gen.go | 36 +++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 internal/service/codegurureviewer/service_package_gen.go diff --git a/internal/service/codegurureviewer/service_package_gen.go b/internal/service/codegurureviewer/service_package_gen.go new file mode 100644 index 000000000000..208c78d4dc17 --- /dev/null +++ b/internal/service/codegurureviewer/service_package_gen.go @@ -0,0 +1,36 @@ +// Code generated by internal/generate/servicepackages/main.go; DO NOT EDIT. + +package codegurureviewer + +import ( + "context" + + "github.com/hashicorp/terraform-plugin-framework/datasource" + "github.com/hashicorp/terraform-plugin-framework/resource" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "github.com/hashicorp/terraform-provider-aws/names" +) + +type servicePackage struct{} + +func (p *servicePackage) FrameworkDataSources(ctx context.Context) []func(context.Context) (datasource.DataSourceWithConfigure, error) { + return []func(context.Context) (datasource.DataSourceWithConfigure, error){} +} + +func (p *servicePackage) FrameworkResources(ctx context.Context) []func(context.Context) (resource.ResourceWithConfigure, error) { + return []func(context.Context) (resource.ResourceWithConfigure, error){} +} + +func (p *servicePackage) SDKDataSources(ctx context.Context) map[string]func() *schema.Resource { + return map[string]func() *schema.Resource{} +} + +func (p *servicePackage) SDKResources(ctx context.Context) map[string]func() *schema.Resource { + return map[string]func() *schema.Resource{} +} + +func (p *servicePackage) ServicePackageName() string { + return names.CodeGuruReviewer +} + +var ServicePackage = &servicePackage{} From 7dd4d6de6585003ef2b79f136f0adcd4a5ad751d Mon Sep 17 00:00:00 2001 From: Albert Silva Date: Sat, 25 Feb 2023 14:01:23 -0500 Subject: [PATCH 348/763] tags_gen.go for codegurureviewer service --- internal/service/codegurureviewer/tags_gen.go | 77 +++++++++++++++++++ 1 file changed, 77 insertions(+) create mode 100644 internal/service/codegurureviewer/tags_gen.go diff --git a/internal/service/codegurureviewer/tags_gen.go b/internal/service/codegurureviewer/tags_gen.go new file mode 100644 index 000000000000..6b7c67089e89 --- /dev/null +++ b/internal/service/codegurureviewer/tags_gen.go @@ -0,0 +1,77 @@ +// Code generated by internal/generate/tags/main.go; DO NOT EDIT. +package codegurureviewer + +import ( + "context" + "fmt" + + "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/service/codegurureviewer" + "github.com/aws/aws-sdk-go/service/codegurureviewer/codegururevieweriface" + tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" +) + +// ListTags lists codegurureviewer service tags. +// The identifier is typically the Amazon Resource Name (ARN), although +// it may also be a different identifier depending on the service. +func ListTags(ctx context.Context, conn codegururevieweriface.CodeGuruReviewerAPI, identifier string) (tftags.KeyValueTags, error) { + input := &codegurureviewer.ListTagsForResourceInput{ + ResourceArn: aws.String(identifier), + } + + output, err := conn.ListTagsForResourceWithContext(ctx, input) + + if err != nil { + return tftags.New(ctx, nil), err + } + + return KeyValueTags(ctx, output.Tags), nil +} + +// map[string]*string handling + +// Tags returns codegurureviewer service tags. +func Tags(tags tftags.KeyValueTags) map[string]*string { + return aws.StringMap(tags.Map()) +} + +// KeyValueTags creates KeyValueTags from codegurureviewer service tags. +func KeyValueTags(ctx context.Context, tags map[string]*string) tftags.KeyValueTags { + return tftags.New(ctx, tags) +} + +// UpdateTags updates codegurureviewer 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 codegururevieweriface.CodeGuruReviewerAPI, identifier string, oldTagsMap interface{}, newTagsMap interface{}) error { + oldTags := tftags.New(ctx, oldTagsMap) + newTags := tftags.New(ctx, newTagsMap) + + if removedTags := oldTags.Removed(newTags); len(removedTags) > 0 { + input := &codegurureviewer.UntagResourceInput{ + ResourceArn: aws.String(identifier), + TagKeys: aws.StringSlice(removedTags.IgnoreAWS().Keys()), + } + + _, err := conn.UntagResourceWithContext(ctx, input) + + if err != nil { + return fmt.Errorf("untagging resource (%s): %w", identifier, err) + } + } + + if updatedTags := oldTags.Updated(newTags); len(updatedTags) > 0 { + input := &codegurureviewer.TagResourceInput{ + ResourceArn: aws.String(identifier), + Tags: Tags(updatedTags.IgnoreAWS()), + } + + _, err := conn.TagResourceWithContext(ctx, input) + + if err != nil { + return fmt.Errorf("tagging resource (%s): %w", identifier, err) + } + } + + return nil +} From b3c5cf67ffb32281185a158f63e7004a70faa6e6 Mon Sep 17 00:00:00 2001 From: Albert Silva Date: Sat, 25 Feb 2023 14:01:43 -0500 Subject: [PATCH 349/763] add sweep.go for codegurureviewer service --- internal/service/codegurureviewer/sweep.go | 68 ++++++++++++++++++++++ 1 file changed, 68 insertions(+) create mode 100644 internal/service/codegurureviewer/sweep.go diff --git a/internal/service/codegurureviewer/sweep.go b/internal/service/codegurureviewer/sweep.go new file mode 100644 index 000000000000..a802ea54c857 --- /dev/null +++ b/internal/service/codegurureviewer/sweep.go @@ -0,0 +1,68 @@ +//go:build sweep +// +build sweep + +package codegurureviewer + +import ( + "fmt" + "log" + + "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-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/sweep" +) + +func init() { + resource.AddTestSweepers("aws_codegurureviewer", &resource.Sweeper{ + Name: "aws_codegurureviewer", + F: sweepAssociations, + }) +} + +func sweepAssociations(region string) error { + ctx := sweep.Context(region) + client, err := sweep.SharedRegionalSweepClient(region) + if err != nil { + return fmt.Errorf("error getting client: %w", err) + } + input := &codegurureviewer.ListRepositoryAssociationsInput{} + conn := client.(*conns.AWSClient).CodeGuruReviewerConn() + + sweepResources := make([]sweep.Sweepable, 0) + + err = conn.ListRepositoryAssociationsPagesWithContext(ctx, input, func(page *codegurureviewer.ListRepositoryAssociationsOutput, lastPage bool) bool { + if page == nil { + return !lastPage + } + + for _, v := range page.Associations { + r := ResourceAssociation() + d := r.Data(nil) + + d.SetId(aws.StringValue(v.Name)) + + sweepResources = append(sweepResources, sweep.NewSweepResource(r, d, client)) + } + + return !lastPage + }) + + if sweep.SkipSweepError(err) { + log.Printf("[WARN] Skipping CodeGuruReviewer Association sweep for %s: %s", region, err) + return nil + } + + if err != nil { + return fmt.Errorf("error listing CodeGuruReviewer Associations (%s): %w", region, err) + } + + err = sweep.SweepOrchestratorWithContext(ctx, sweepResources) + + if err != nil { + return fmt.Errorf("error sweeping CodeGuruReviewer Associations (%s): %w", region, err) + } + + return nil +} From d1c3c2abd900e3b31eafe553602bbef63b2c7bce Mon Sep 17 00:00:00 2001 From: Albert Silva Date: Sat, 25 Feb 2023 14:02:16 -0500 Subject: [PATCH 350/763] add resource for codegurureviewer_repository_association --- .../repository_association.go | 644 ++++++++++++++++++ 1 file changed, 644 insertions(+) create mode 100644 internal/service/codegurureviewer/repository_association.go diff --git a/internal/service/codegurureviewer/repository_association.go b/internal/service/codegurureviewer/repository_association.go new file mode 100644 index 000000000000..96ffcdfaa561 --- /dev/null +++ b/internal/service/codegurureviewer/repository_association.go @@ -0,0 +1,644 @@ +package codegurureviewer + +import ( + "context" + "errors" + "log" + "regexp" + "time" + + "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" + "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/resource" + "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" + 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" + "github.com/hashicorp/terraform-provider-aws/names" +) + +func ResourceRepositoryAssociation() *schema.Resource { + return &schema.Resource{ + + CreateWithoutTimeout: resourceRepositoryAssociationCreate, + ReadWithoutTimeout: resourceRepositoryAssociationRead, + UpdateWithoutTimeout: resourceRepositoryAssociationUpdate, + DeleteWithoutTimeout: resourceRepositoryAssociationDelete, + + Timeouts: &schema.ResourceTimeout{ + Create: schema.DefaultTimeout(30 * time.Minute), + Update: schema.DefaultTimeout(30 * time.Minute), + Delete: schema.DefaultTimeout(30 * time.Minute), + }, + + Schema: map[string]*schema.Schema{ + "arn": { + Type: schema.TypeString, + Computed: true, + }, + "association_id": { + Type: schema.TypeString, + Computed: true, + }, + "connection_arn": { + Type: schema.TypeString, + Computed: true, + }, + "kms_key_details": { + Type: schema.TypeList, + Optional: true, + ForceNew: true, + MaxItems: 1, + DiffSuppressFunc: func(k, old, new string, d *schema.ResourceData) bool { + // Show difference for new resources + if d.Id() == "" { + return false + } + // Show difference if existing state reflects different default type + _, defaultEncryptionOption := d.GetChange("kms_key_details.0.encryption_option") + if defaultEncryptionOption.(string) != codegurureviewer.EncryptionOptionAwsOwnedCmk { + return defaultEncryptionOption.(string) == codegurureviewer.EncryptionOptionAwsOwnedCmk + } + return true + }, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "encryption_option": { + Type: schema.TypeString, + ForceNew: true, + Optional: true, + ValidateFunc: validation.StringInSlice(codegurureviewer.EncryptionOption_Values(), false), + }, + "kms_key_id": { + Type: schema.TypeString, + ForceNew: true, + Optional: true, + ValidateFunc: validation.All( + validation.StringLenBetween(1, 2048), + validation.StringMatch(regexp.MustCompile(`[a-zA-Z0-9-]+`), ""), + ), + }, + }, + }, + }, + "name": { + Type: schema.TypeString, + Computed: true, + }, + "owner": { + Type: schema.TypeString, + Computed: true, + }, + "provider_type": { + Type: schema.TypeString, + Computed: true, + }, + "repository": { + Type: schema.TypeList, + Required: true, + ForceNew: true, + MaxItems: 1, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "bitbucket": { + Type: schema.TypeList, + ForceNew: true, + Optional: true, + MaxItems: 1, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "connection_arn": { + Type: schema.TypeString, + Required: true, + ValidateFunc: verify.ValidARN, + }, + "name": { + Type: schema.TypeString, + Required: true, + ValidateFunc: validation.All( + validation.StringLenBetween(1, 100), + validation.StringMatch(regexp.MustCompile(`^\S[\w.-]*$`), ""), + ), + }, + "owner": { + Type: schema.TypeString, + Required: true, + ValidateFunc: validation.All( + validation.StringLenBetween(1, 100), + validation.StringMatch(regexp.MustCompile(`^\S(.*\S)?$`), ""), + ), + }, + }, + }, + }, + "codecommit": { + Type: schema.TypeList, + ForceNew: true, + Optional: true, + MaxItems: 1, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "name": { + Type: schema.TypeString, + Required: true, + ValidateFunc: validation.All( + validation.StringLenBetween(1, 100), + validation.StringMatch(regexp.MustCompile(`^\S[\w.-]*$`), ""), + ), + }, + }, + }, + }, + "github_enterprise_server": { + Type: schema.TypeList, + ForceNew: true, + Optional: true, + MaxItems: 1, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "connection_arn": { + Type: schema.TypeString, + Required: true, + ValidateFunc: verify.ValidARN, + }, + "name": { + Type: schema.TypeString, + Required: true, + ValidateFunc: validation.All( + validation.StringLenBetween(1, 100), + validation.StringMatch(regexp.MustCompile(`^\S[\w.-]*$`), ""), + ), + }, + "owner": { + Type: schema.TypeString, + Required: true, + ValidateFunc: validation.All( + validation.StringLenBetween(1, 100), + validation.StringMatch(regexp.MustCompile(`^\S(.*\S)?$`), ""), + ), + }, + }, + }, + }, + "s3_bucket": { + Type: schema.TypeList, + ForceNew: true, + Optional: true, + MaxItems: 1, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "bucket_name": { + Type: schema.TypeString, + Required: true, + ValidateFunc: validation.All( + validation.StringLenBetween(1, 63), + validation.StringMatch(regexp.MustCompile(`^\S(.*\S)?$`), ""), + ), + }, + "name": { + Type: schema.TypeString, + Required: true, + ValidateFunc: validation.All( + validation.StringLenBetween(1, 100), + validation.StringMatch(regexp.MustCompile(`^\S[\w.-]*$`), ""), + ), + }, + }, + }, + }, + }, + }, + }, + "s3_repository_details": { + Type: schema.TypeList, + Computed: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "bucket_name": { + Type: schema.TypeString, + Computed: true, + }, + "code_artifacts": { + Type: schema.TypeList, + Computed: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "build_artifacts_object_key": { + Type: schema.TypeString, + Computed: true, + }, + "source_code_artifacts_object_key": { + Type: schema.TypeString, + Computed: true, + }, + }, + }, + }, + }, + }, + }, + "state": { + Type: schema.TypeString, + Computed: true, + }, + "state_reason": { + Type: schema.TypeString, + Computed: true, + }, + "tags": tftags.TagsSchema(), + "tags_all": tftags.TagsSchemaComputed(), + }, + CustomizeDiff: customdiff.Sequence( + verify.SetTagsDiff, + ), + } +} + +const ( + ResNameRepositoryAssociation = "RepositoryAssociation" +) + +func resourceRepositoryAssociationCreate(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { + conn := meta.(*conns.AWSClient).CodeGuruReviewerConn() + + in := &codegurureviewer.AssociateRepositoryInput{} + + in.KMSKeyDetails = expandKMSKeyDetails(d.Get("kms_key_details").([]interface{})) + + if v, ok := d.GetOk("repository"); ok { + in.Repository = expandRepository(v.([]interface{})) + } + + defaultTagsConfig := meta.(*conns.AWSClient).DefaultTagsConfig + tags := defaultTagsConfig.MergeTags(tftags.New(ctx, d.Get("tags").(map[string]interface{}))) + + if len(tags) > 0 { + in.Tags = Tags(tags.IgnoreAWS()) + } + + out, err := conn.AssociateRepositoryWithContext(ctx, in) + + if err != nil { + return create.DiagError(names.CodeGuruReviewer, create.ErrActionCreating, ResNameRepositoryAssociation, d.Get("name").(string), err) + } + + if out == nil || out.RepositoryAssociation == nil { + return create.DiagError(names.CodeGuruReviewer, create.ErrActionCreating, ResNameRepositoryAssociation, d.Get("name").(string), errors.New("empty output")) + } + + d.SetId(aws.StringValue(out.RepositoryAssociation.AssociationArn)) + + if _, err := waitRepositoryAssociationCreated(ctx, conn, d.Id(), d.Timeout(schema.TimeoutCreate)); err != nil { + return create.DiagError(names.CodeGuruReviewer, create.ErrActionWaitingForCreation, ResNameRepositoryAssociation, d.Id(), err) + } + + return resourceRepositoryAssociationRead(ctx, d, meta) +} + +func resourceRepositoryAssociationRead(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { + + conn := meta.(*conns.AWSClient).CodeGuruReviewerConn() + + out, err := findRepositoryAssociationByID(ctx, conn, d.Id()) + + if !d.IsNewResource() && tfresource.NotFound(err) { + log.Printf("[WARN] CodeGuruReviewer RepositoryAssociation (%s) not found, removing from state", d.Id()) + d.SetId("") + return nil + } + if err != nil { + return create.DiagError(names.CodeGuruReviewer, create.ErrActionReading, ResNameRepositoryAssociation, d.Id(), err) + } + + d.Set("arn", out.AssociationArn) + d.Set("association_id", out.AssociationId) + d.Set("connection_arn", out.ConnectionArn) + + if err := d.Set("kms_key_details", flattenKMSKeyDetails(out.KMSKeyDetails)); err != nil { + return create.DiagError(names.CodeGuruReviewer, create.ErrActionSetting, ResNameRepositoryAssociation, d.Id(), err) + } + + d.Set("name", out.Name) + d.Set("owner", out.Owner) + d.Set("provider_type", out.ProviderType) + + if err := d.Set("s3_repository_details", flattenS3RepositoryDetails(out.S3RepositoryDetails)); err != nil { + return create.DiagError(names.CodeGuruReviewer, create.ErrActionSetting, ResNameRepositoryAssociation, d.Id(), err) + } + + d.Set("state", out.State) + d.Set("state_reason", out.StateReason) + + tags, err := ListTags(ctx, conn, d.Id()) + if err != nil { + return create.DiagError(names.CodeGuruReviewer, create.ErrActionReading, ResNameRepositoryAssociation, d.Id(), err) + } + + defaultTagsConfig := meta.(*conns.AWSClient).DefaultTagsConfig + ignoreTagsConfig := meta.(*conns.AWSClient).IgnoreTagsConfig + tags = tags.IgnoreAWS().IgnoreConfig(ignoreTagsConfig) + + if err := d.Set("tags", tags.RemoveDefaultConfig(defaultTagsConfig).Map()); err != nil { + return create.DiagError(names.CodeGuruReviewer, create.ErrActionSetting, ResNameRepositoryAssociation, d.Id(), err) + } + + if err := d.Set("tags_all", tags.Map()); err != nil { + return create.DiagError(names.CodeGuruReviewer, create.ErrActionSetting, ResNameRepositoryAssociation, d.Id(), err) + } + + return nil +} + +func resourceRepositoryAssociationUpdate(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { + var diags diag.Diagnostics + conn := meta.(*conns.AWSClient).CodeGuruReviewerConn() + + if d.HasChange("tags_all") { + o, n := d.GetChange("tags_all") + arn := d.Get("arn").(string) + + if err := UpdateTags(ctx, conn, arn, o, n); err != nil { + return sdkdiag.AppendErrorf(diags, "updating CodeGuru Repository RepositoryAssociation (%s) tags: %s", d.Get("id").(string), err) + } + } + + return append(diags, resourceRepositoryAssociationRead(ctx, d, meta)...) +} + +func resourceRepositoryAssociationDelete(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { + + conn := meta.(*conns.AWSClient).CodeGuruReviewerConn() + + log.Printf("[INFO] Deleting CodeGuruReviewer RepositoryAssociation %s", d.Id()) + + _, err := conn.DisassociateRepositoryWithContext(ctx, &codegurureviewer.DisassociateRepositoryInput{ + AssociationArn: aws.String(d.Id()), + }) + + if tfawserr.ErrCodeEquals(err, codegurureviewer.ErrCodeNotFoundException) { + return nil + } + + if err != nil { + return create.DiagError(names.CodeGuruReviewer, create.ErrActionDeleting, ResNameRepositoryAssociation, d.Id(), err) + } + + if _, err := waitRepositoryAssociationDeleted(ctx, conn, d.Id(), d.Timeout(schema.TimeoutDelete)); err != nil { + return create.DiagError(names.CodeGuruReviewer, create.ErrActionWaitingForDeletion, ResNameRepositoryAssociation, d.Id(), err) + } + + return nil +} + +func waitRepositoryAssociationCreated(ctx context.Context, conn *codegurureviewer.CodeGuruReviewer, id string, timeout time.Duration) (*codegurureviewer.RepositoryAssociation, error) { + stateConf := &resource.StateChangeConf{ + Pending: []string{codegurureviewer.RepositoryAssociationStateAssociating}, + Target: []string{codegurureviewer.RepositoryAssociationStateAssociated}, + Refresh: statusRepositoryAssociation(ctx, conn, id), + Timeout: timeout, + NotFoundChecks: 20, + ContinuousTargetOccurence: 2, + } + + outputRaw, err := stateConf.WaitForStateContext(ctx) + if out, ok := outputRaw.(*codegurureviewer.RepositoryAssociation); ok { + return out, err + } + + return nil, err +} + +func waitRepositoryAssociationDeleted(ctx context.Context, conn *codegurureviewer.CodeGuruReviewer, id string, timeout time.Duration) (*codegurureviewer.RepositoryAssociation, error) { + stateConf := &resource.StateChangeConf{ + Pending: []string{codegurureviewer.RepositoryAssociationStateDisassociating, codegurureviewer.RepositoryAssociationStateAssociated}, + Target: []string{}, + Refresh: statusRepositoryAssociation(ctx, conn, id), + Timeout: timeout, + } + + outputRaw, err := stateConf.WaitForStateContext(ctx) + if out, ok := outputRaw.(*codegurureviewer.RepositoryAssociation); ok { + return out, err + } + + return nil, err +} + +func statusRepositoryAssociation(ctx context.Context, conn *codegurureviewer.CodeGuruReviewer, id string) resource.StateRefreshFunc { + return func() (interface{}, string, error) { + out, err := findRepositoryAssociationByID(ctx, conn, id) + if tfresource.NotFound(err) { + return nil, "", nil + } + + if err != nil { + return nil, "", err + } + + return out, aws.StringValue(out.State), nil + } +} + +func findRepositoryAssociationByID(ctx context.Context, conn *codegurureviewer.CodeGuruReviewer, id string) (*codegurureviewer.RepositoryAssociation, error) { + in := &codegurureviewer.DescribeRepositoryAssociationInput{ + AssociationArn: aws.String(id), + } + out, err := conn.DescribeRepositoryAssociationWithContext(ctx, in) + if tfawserr.ErrCodeEquals(err, codegurureviewer.ErrCodeNotFoundException) { + return nil, &resource.NotFoundError{ + LastError: err, + LastRequest: in, + } + } + + if err != nil { + return nil, err + } + + if out == nil || out.RepositoryAssociation == nil { + return nil, tfresource.NewEmptyResultError(in) + } + + return out.RepositoryAssociation, nil +} + +func flattenKMSKeyDetails(kmsKeyDetails *codegurureviewer.KMSKeyDetails) []interface{} { + if kmsKeyDetails == nil { + return nil + } + + values := map[string]interface{}{} + + if v := kmsKeyDetails.EncryptionOption; v != nil { + values["encryption_option"] = aws.StringValue(v) + } + + if v := kmsKeyDetails.KMSKeyId; v != nil { + values["kms_key_id"] = aws.StringValue(v) + } + + return []interface{}{values} +} + +func flattenS3RepositoryDetails(s3RepositoryDetails *codegurureviewer.S3RepositoryDetails) []interface{} { + if s3RepositoryDetails == nil { + return nil + } + + values := map[string]interface{}{} + + if v := s3RepositoryDetails.BucketName; v != nil { + values["bucket_name"] = aws.StringValue(v) + } + + if v := s3RepositoryDetails.CodeArtifacts; v != nil { + values["code_artifacts"] = flattenCodeArtifacts(v) + } + + return []interface{}{values} +} + +func flattenCodeArtifacts(apiObject *codegurureviewer.CodeArtifacts) map[string]interface{} { + if apiObject == nil { + return nil + } + + m := map[string]interface{}{} + + if v := apiObject.BuildArtifactsObjectKey; v != nil { + m["build_artifacts_object_key"] = aws.StringValue(v) + } + + if v := apiObject.SourceCodeArtifactsObjectKey; v != nil { + m["source_code_artifacts_object_key"] = aws.StringValue(v) + } + + return m +} + +func expandKMSKeyDetails(kmsKeyDetails []interface{}) *codegurureviewer.KMSKeyDetails { + if len(kmsKeyDetails) == 0 || kmsKeyDetails[0] == nil { + return nil + } + + tfMap, ok := kmsKeyDetails[0].(map[string]interface{}) + if !ok { + return nil + } + + result := &codegurureviewer.KMSKeyDetails{} + + if v, ok := tfMap["encryption_option"].(string); ok && v != "" { + result.EncryptionOption = aws.String(v) + } + + if v, ok := tfMap["kms_key_id"].(string); ok && v != "" { + result.KMSKeyId = aws.String(v) + } + + return result +} + +func expandCodeCommitRepository(repository []interface{}) *codegurureviewer.CodeCommitRepository { + if len(repository) == 0 || repository[0] == nil { + return nil + } + + tfMap, ok := repository[0].(map[string]interface{}) + if !ok { + return nil + } + + result := &codegurureviewer.CodeCommitRepository{} + + if v, ok := tfMap["name"].(string); ok && v != "" { + result.Name = aws.String(v) + } + + return result +} + +func expandRepository(repository []interface{}) *codegurureviewer.Repository { + if len(repository) == 0 || repository[0] == nil { + return nil + } + + tfMap, ok := repository[0].(map[string]interface{}) + if !ok { + return nil + } + + result := &codegurureviewer.Repository{} + + if v, ok := tfMap["bitbucket"]; ok { + result.Bitbucket = expandThirdPartySourceRepository(v.([]interface{})) + } + if v, ok := tfMap["codecommit"]; ok { + result.CodeCommit = expandCodeCommitRepository(v.([]interface{})) + } + if v, ok := tfMap["github_enterprise_server"]; ok { + result.GitHubEnterpriseServer = expandThirdPartySourceRepository(v.([]interface{})) + } + if v, ok := tfMap["s3_bucket"]; ok { + result.S3Bucket = expandS3Repository(v.([]interface{})) + } + + return result +} + +func expandS3Repository(repository []interface{}) *codegurureviewer.S3Repository { + if len(repository) == 0 || repository[0] == nil { + return nil + } + + tfMap, ok := repository[0].(map[string]interface{}) + if !ok { + return nil + } + + result := &codegurureviewer.S3Repository{} + + if v, ok := tfMap["bucket_name"].(string); ok && v != "" { + result.BucketName = aws.String(v) + } + + if v, ok := tfMap["name"].(string); ok && v != "" { + result.Name = aws.String(v) + } + + return result +} + +func expandThirdPartySourceRepository(repository []interface{}) *codegurureviewer.ThirdPartySourceRepository { + if len(repository) == 0 || repository[0] == nil { + return nil + } + + tfMap, ok := repository[0].(map[string]interface{}) + if !ok { + return nil + } + + result := &codegurureviewer.ThirdPartySourceRepository{} + + if v, ok := tfMap["connection_arn"].(string); ok && v != "" { + result.ConnectionArn = aws.String(v) + } + + if v, ok := tfMap["name"].(string); ok && v != "" { + result.Name = aws.String(v) + } + + if v, ok := tfMap["owner"].(string); ok && v != "" { + result.Owner = aws.String(v) + } + + return result +} From 67f7a166e7da16a6a913d36c62a42823cd53d957 Mon Sep 17 00:00:00 2001 From: Albert Silva Date: Sat, 25 Feb 2023 14:02:28 -0500 Subject: [PATCH 351/763] add tests for codegurureviewer_repository_association --- .../repository_association_test.go | 399 ++++++++++++++++++ 1 file changed, 399 insertions(+) create mode 100644 internal/service/codegurureviewer/repository_association_test.go diff --git a/internal/service/codegurureviewer/repository_association_test.go b/internal/service/codegurureviewer/repository_association_test.go new file mode 100644 index 000000000000..2f1be83e9017 --- /dev/null +++ b/internal/service/codegurureviewer/repository_association_test.go @@ -0,0 +1,399 @@ +package codegurureviewer_test + +import ( + "context" + "errors" + "fmt" + "regexp" + "testing" + + "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" + "github.com/hashicorp/terraform-provider-aws/internal/acctest" + "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/create" + "github.com/hashicorp/terraform-provider-aws/names" + + tfcodegurureviewer "github.com/hashicorp/terraform-provider-aws/internal/service/codegurureviewer" +) + +// Repository types of "BitBucket and GitHubEnterpriseServer cannot be tested, as they require their CodeStar Connection to be in "AVAILABLE" status vs "PENDING", requiring console interaction +// However, this has been manually tested succesfully +func TestAccCodeGuruReviewerRepositoryAssociation_basic(t *testing.T) { + if testing.Short() { + t.Skip("skipping long-running test in short mode") + } + ctx := acctest.Context(t) + var repositoryassociation codegurureviewer.DescribeRepositoryAssociationOutput + rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) + resourceName := "aws_codegurureviewer_repository_association.test" + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { + acctest.PreCheck(t) + acctest.PreCheckPartitionHasService(t, codegurureviewer.EndpointsID) + testAccPreCheck(t) + }, + ErrorCheck: acctest.ErrorCheck(t, codegurureviewer.EndpointsID), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + CheckDestroy: testAccCheckRepositoryAssociationDestroy(ctx), + Steps: []resource.TestStep{ + { + Config: testAccRepositoryAssociationConfig_basic(rName), + Check: resource.ComposeTestCheckFunc( + testAccCheckRepositoryAssociationExists(ctx, resourceName, &repositoryassociation), + acctest.MatchResourceAttrRegionalARN(resourceName, "arn", "codeguru-reviewer", regexp.MustCompile(`association:+.`)), + acctest.MatchResourceAttrRegionalARN(resourceName, "id", "codeguru-reviewer", regexp.MustCompile(`association:+.`)), + resource.TestCheckResourceAttr(resourceName, "repository.0.bitbucket.#", "0"), + resource.TestCheckResourceAttr(resourceName, "repository.0.codecommit.#", "1"), + resource.TestCheckResourceAttr(resourceName, "repository.0.github_enterprise_server.#", "0"), + resource.TestCheckResourceAttr(resourceName, "repository.0.s3_bucket.#", "0"), + resource.TestCheckResourceAttr(resourceName, "repository.0.codecommit.0.name", rName), + resource.TestCheckResourceAttr(resourceName, "kms_key_details.#", "1"), + resource.TestCheckResourceAttr(resourceName, "kms_key_details.0.encryption_option", "AWS_OWNED_CMK"), + ), + }, + }, + }) +} + +func TestAccCodeGuruReviewerRepositoryAssociation_KMSKey(t *testing.T) { + if testing.Short() { + t.Skip("skipping long-running test in short mode") + } + ctx := acctest.Context(t) + var repositoryassociation codegurureviewer.DescribeRepositoryAssociationOutput + rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) + resourceName := "aws_codegurureviewer_repository_association.test" + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { + acctest.PreCheck(t) + acctest.PreCheckPartitionHasService(t, codegurureviewer.EndpointsID) + testAccPreCheck(t) + }, + ErrorCheck: acctest.ErrorCheck(t, codegurureviewer.EndpointsID), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + CheckDestroy: testAccCheckRepositoryAssociationDestroy(ctx), + Steps: []resource.TestStep{ + { + Config: testAccRepositoryAssociationConfig_kms_key(rName), + Check: resource.ComposeTestCheckFunc( + testAccCheckRepositoryAssociationExists(ctx, resourceName, &repositoryassociation), + acctest.MatchResourceAttrRegionalARN(resourceName, "arn", "codeguru-reviewer", regexp.MustCompile(`association:+.`)), + acctest.MatchResourceAttrRegionalARN(resourceName, "id", "codeguru-reviewer", regexp.MustCompile(`association:+.`)), + resource.TestCheckResourceAttr(resourceName, "repository.0.bitbucket.#", "0"), + resource.TestCheckResourceAttr(resourceName, "repository.0.codecommit.#", "1"), + resource.TestCheckResourceAttr(resourceName, "repository.0.github_enterprise_server.#", "0"), + resource.TestCheckResourceAttr(resourceName, "repository.0.s3_bucket.#", "0"), + resource.TestCheckResourceAttr(resourceName, "repository.0.codecommit.0.name", rName), + resource.TestCheckResourceAttr(resourceName, "kms_key_details.#", "1"), + resource.TestCheckResourceAttr(resourceName, "kms_key_details.0.encryption_option", "CUSTOMER_MANAGED_CMK"), + ), + }, + }, + }) +} + +func TestAccCodeGuruReviewerRepositoryAssociation_S3Repository(t *testing.T) { + if testing.Short() { + t.Skip("skipping long-running test in short mode") + } + ctx := acctest.Context(t) + var repositoryassociation codegurureviewer.DescribeRepositoryAssociationOutput + rName := "codeguru-reviewer-" + sdkacctest.RandString(10) + resourceName := "aws_codegurureviewer_repository_association.test" + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { + acctest.PreCheck(t) + acctest.PreCheckPartitionHasService(t, codegurureviewer.EndpointsID) + testAccPreCheck(t) + }, + ErrorCheck: acctest.ErrorCheck(t, codegurureviewer.EndpointsID), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + CheckDestroy: testAccCheckRepositoryAssociationDestroy(ctx), + Steps: []resource.TestStep{ + { + Config: testAccRepositoryAssociationConfig_s3_repository(rName), + Check: resource.ComposeTestCheckFunc( + testAccCheckRepositoryAssociationExists(ctx, resourceName, &repositoryassociation), + acctest.MatchResourceAttrRegionalARN(resourceName, "arn", "codeguru-reviewer", regexp.MustCompile(`association:+.`)), + acctest.MatchResourceAttrRegionalARN(resourceName, "id", "codeguru-reviewer", regexp.MustCompile(`association:+.`)), + resource.TestCheckResourceAttr(resourceName, "repository.0.bitbucket.#", "0"), + resource.TestCheckResourceAttr(resourceName, "repository.0.codecommit.#", "0"), + resource.TestCheckResourceAttr(resourceName, "repository.0.github_enterprise_server.#", "0"), + resource.TestCheckResourceAttr(resourceName, "repository.0.s3_bucket.#", "1"), + resource.TestCheckResourceAttr(resourceName, "repository.0.s3_bucket.0.bucket_name", rName), + resource.TestCheckResourceAttr(resourceName, "repository.0.s3_bucket.0.name", "test"), + resource.TestCheckResourceAttr(resourceName, "kms_key_details.#", "1"), + resource.TestCheckResourceAttr(resourceName, "kms_key_details.0.encryption_option", "AWS_OWNED_CMK"), + ), + }, + }, + }) +} + +func TestAccCodeGuruReviewerRepositoryAssociation_tags(t *testing.T) { + ctx := acctest.Context(t) + var repositoryassociation codegurureviewer.DescribeRepositoryAssociationOutput + resourceName := "aws_codegurureviewer_repository_association.test" + rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { + acctest.PreCheck(t) + acctest.PreCheckPartitionHasService(t, codegurureviewer.EndpointsID) + testAccPreCheck(t) + }, + ErrorCheck: acctest.ErrorCheck(t, codegurureviewer.EndpointsID), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + CheckDestroy: testAccCheckRepositoryAssociationDestroy(ctx), + Steps: []resource.TestStep{ + { + Config: testAccRepositoryAssociationConfig_tags_1(rName, "key1", "value1"), + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheckRepositoryAssociationExists(ctx, resourceName, &repositoryassociation), + resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), + resource.TestCheckResourceAttr(resourceName, "tags.key1", "value1"), + ), + }, + { + Config: testAccRepositoryAssociationConfig_tags_2(rName, "key1", "value1updated", "key2", "value2"), + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheckRepositoryAssociationExists(ctx, resourceName, &repositoryassociation), + resource.TestCheckResourceAttr(resourceName, "tags.%", "2"), + resource.TestCheckResourceAttr(resourceName, "tags.key1", "value1updated"), + resource.TestCheckResourceAttr(resourceName, "tags.key2", "value2"), + ), + }, + { + Config: testAccRepositoryAssociationConfig_tags_1(rName, "key2", "value2"), + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheckRepositoryAssociationExists(ctx, resourceName, &repositoryassociation), + resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), + resource.TestCheckResourceAttr(resourceName, "tags.key2", "value2"), + ), + }, + }, + }) +} + +func TestAccCodeGuruReviewerRepositoryAssociation_disappears(t *testing.T) { + if testing.Short() { + t.Skip("skipping long-running test in short mode") + } + ctx := acctest.Context(t) + var repositoryassociation codegurureviewer.DescribeRepositoryAssociationOutput + rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) + resourceName := "aws_codegurureviewer_repository_association.test" + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { + acctest.PreCheck(t) + acctest.PreCheckPartitionHasService(t, codegurureviewer.EndpointsID) + testAccPreCheck(t) + }, + ErrorCheck: acctest.ErrorCheck(t, codegurureviewer.EndpointsID), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + CheckDestroy: testAccCheckRepositoryAssociationDestroy(ctx), + Steps: []resource.TestStep{ + { + Config: testAccRepositoryAssociationConfig_basic(rName), + Check: resource.ComposeTestCheckFunc( + testAccCheckRepositoryAssociationExists(ctx, resourceName, &repositoryassociation), + acctest.CheckResourceDisappears(ctx, acctest.Provider, tfcodegurureviewer.ResourceRepositoryAssociation(), resourceName), + ), + ExpectNonEmptyPlan: true, + }, + }, + }) +} + +func testAccCheckRepositoryAssociationDestroy(ctx context.Context) resource.TestCheckFunc { + return func(s *terraform.State) error { + conn := acctest.Provider.Meta().(*conns.AWSClient).CodeGuruReviewerConn() + + for _, rs := range s.RootModule().Resources { + if rs.Type != "aws_codegurureviewer_repository_association" { + continue + } + + input := &codegurureviewer.DescribeRepositoryAssociationInput{ + AssociationArn: aws.String(rs.Primary.ID), + } + _, err := conn.DescribeRepositoryAssociationWithContext(ctx, input) + if err != nil { + if tfawserr.ErrCodeEquals(err, codegurureviewer.ErrCodeNotFoundException) { + return nil + } + return err + } + + return fmt.Errorf("CodeGuru Reviewer Association Connection %s still exists", rs.Primary.ID) + } + + return nil + } +} + +func testAccCheckRepositoryAssociationExists(ctx context.Context, name string, repositoryassociation *codegurureviewer.DescribeRepositoryAssociationOutput) resource.TestCheckFunc { + return func(s *terraform.State) error { + rs, ok := s.RootModule().Resources[name] + if !ok { + return create.Error(names.CodeGuruReviewer, create.ErrActionCheckingExistence, tfcodegurureviewer.ResNameRepositoryAssociation, name, errors.New("not found")) + } + + if rs.Primary.ID == "" { + return create.Error(names.CodeGuruReviewer, create.ErrActionCheckingExistence, tfcodegurureviewer.ResNameRepositoryAssociation, name, errors.New("not set")) + } + + conn := acctest.Provider.Meta().(*conns.AWSClient).CodeGuruReviewerConn() + resp, err := conn.DescribeRepositoryAssociationWithContext(ctx, &codegurureviewer.DescribeRepositoryAssociationInput{ + AssociationArn: aws.String(rs.Primary.ID), + }) + + if err != nil { + return create.Error(names.CodeGuruReviewer, create.ErrActionCheckingExistence, tfcodegurureviewer.ResNameRepositoryAssociation, rs.Primary.ID, err) + } + + *repositoryassociation = *resp + + return nil + } +} + +func testAccPreCheck(t *testing.T) { + conn := acctest.Provider.Meta().(*conns.AWSClient).CodeGuruReviewerConn() + ctx := context.Background() + + input := &codegurureviewer.ListRepositoryAssociationsInput{} + _, err := conn.ListRepositoryAssociationsWithContext(ctx, input) + + if acctest.PreCheckSkipError(err) { + t.Skipf("skipping acceptance testing: %s", err) + } + + if err != nil { + t.Fatalf("unexpected PreCheck error: %s", err) + } +} + +func testAccCheckRepositoryAssociationNotRecreated(before, after *codegurureviewer.DescribeRepositoryAssociationOutput) resource.TestCheckFunc { + return func(s *terraform.State) error { + if before, after := aws.StringValue(before.RepositoryAssociation.AssociationArn), aws.StringValue(after.RepositoryAssociation.AssociationArn); before != after { + return create.Error(names.CodeGuruReviewer, create.ErrActionCheckingNotRecreated, tfcodegurureviewer.ResNameRepositoryAssociation, before, errors.New("recreated")) + } + + return nil + } +} + +func testAccRepositoryAssociationConfig_basic(rName string) string { + return acctest.ConfigCompose(testAccRepositoryAssociation_codecommit_repository(rName), ` +resource "aws_codegurureviewer_repository_association" "test" { + repository { + codecommit { + name = aws_codecommit_repository.test.repository_name + } + } +} +`) +} + +func testAccRepositoryAssociationConfig_kms_key(rName string) string { + return acctest.ConfigCompose(testAccRepositoryAssociation_codecommit_repository(rName), testAccRepositoryAssociation_kms_key(), ` +resource "aws_codegurureviewer_repository_association" "test" { + repository { + codecommit { + name = aws_codecommit_repository.test.repository_name + } + } + + kms_key_details { + encryption_option = "CUSTOMER_MANAGED_CMK" + kms_key_id = aws_kms_key.test.key_id + } +} +`) +} + +func testAccRepositoryAssociationConfig_tags_1(rName, tagKey1, tagValue1 string) string { + return acctest.ConfigCompose(testAccRepositoryAssociation_codecommit_repository(rName), fmt.Sprintf(` +resource "aws_codegurureviewer_repository_association" "test" { + repository { + codecommit { + name = aws_codecommit_repository.test.repository_name + } + } + tags = { + %[1]q = %[2]q + } +} +`, tagKey1, tagValue1)) +} + +func testAccRepositoryAssociationConfig_tags_2(rName, tagKey1, tagValue1, tagKey2, tagValue2 string) string { + return acctest.ConfigCompose(testAccRepositoryAssociation_codecommit_repository(rName), fmt.Sprintf(` +resource "aws_codegurureviewer_repository_association" "test" { + repository { + codecommit { + name = aws_codecommit_repository.test.repository_name + } + } + tags = { + %[1]q = %[2]q + %[3]q = %[4]q + } +} +`, tagKey1, tagValue1, tagKey2, tagValue2)) +} + +func testAccRepositoryAssociationConfig_s3_repository(rName string) string { + return acctest.ConfigCompose(testAccRepositoryAssociation_s3_repository(rName), ` +resource "aws_codegurureviewer_repository_association" "test" { + repository { + s3_bucket { + bucket_name = aws_s3_bucket.test.id + name = "test" + } + } +} +`) +} + +func testAccRepositoryAssociation_codecommit_repository(rName string) string { + return fmt.Sprintf(` +resource "aws_codecommit_repository" "test" { + repository_name = %[1]q + description = "This is a test description" + lifecycle { + ignore_changes = [ + tags["codeguru-reviewer"] + ] + } +} +`, rName) +} + +func testAccRepositoryAssociation_s3_repository(rName string) string { + return fmt.Sprintf(` + +resource "aws_s3_bucket" "test" { + bucket = %[1]q +} +`, rName) +} + +func testAccRepositoryAssociation_kms_key() string { + return fmt.Sprint(` + + +resource "aws_kms_key" "test" { + deletion_window_in_days = 7 +} +`) +} From 49221c8ad24d214c7761b2e49d9ea1566c293b17 Mon Sep 17 00:00:00 2001 From: Albert Silva Date: Sat, 25 Feb 2023 14:02:43 -0500 Subject: [PATCH 352/763] add documentation for codegurureviewer_repository_association --- ...iewer_repository_association.html.markdown | 103 ++++++++++++++++++ 1 file changed, 103 insertions(+) create mode 100644 website/docs/r/codegurureviewer_repository_association.html.markdown diff --git a/website/docs/r/codegurureviewer_repository_association.html.markdown b/website/docs/r/codegurureviewer_repository_association.html.markdown new file mode 100644 index 000000000000..3e94142d8265 --- /dev/null +++ b/website/docs/r/codegurureviewer_repository_association.html.markdown @@ -0,0 +1,103 @@ +--- +subcategory: "CodeGuru Reviewer" +layout: "aws" +page_title: "AWS: aws_codegurureviewer_repository_association" +description: |- + Terraform resource for managing an AWS CodeGuru Reviewer Repository Association. +--- + +# Resource: aws_codegurureviewer_repository_association + +Terraform resource for managing an AWS CodeGuru Reviewer Repository Association. + +## Example Usage + +```terraform +resource "aws_kms_key" "example" {} + +resource "aws_codecommit_repository" "example" { + repository_name = "example-repo" + + # ignore tag added by CodeGuru service upon association + lifecycle { + ignore_changes = [ + tags["codeguru-reviewer"] + ] + } +} + +resource "aws_codegurureviewer_repository_association" "example" { + repository { + codecommit { + name = aws_codecommit_repository.example.repository_name + } + } + kms_key_details { + encryption_option = "CUSTOMER_MANAGED_CMK" + kms_key_id = aws_kms_key.example.key_id + } +} + +``` + +## Argument Reference + +The following arguments are required: + +* `repository` - (Required) An object describing the repository to associate. Valid values: `bitbucket`, `codecommit`, `github_enterprise_server`, or `s3_bucket`. Block is documented below. Note: for repositories that leverage CodeStar connections (ex. `bitbucket`, `github_enterprise_server`) the connection must be in `Available` status prior to creating this resource. + +The following arguments are optional: + +* `kms_key_details` - (Optional) An object describing the KMS key to asssociate. Block is documented below. + +## repository +This configuration block supports the following: + +### bitbucket + +* `connection_arn` - (Required) The Amazon Resource Name (ARN) of an AWS CodeStar Connections connection. +* `name` - (Required) The name of the third party source repository. +* `owner` - (Required) The username for the account that owns the repository. + +### codecommit + +* `name` - (Required) The name of the AWS CodeCommit repository. + +### github_enterprise_server + +* `connection_arn` - (Required) The Amazon Resource Name (ARN) of an AWS CodeStar Connections connection. +* `name` - (Required) The name of the third party source repository. +* `owner` - (Required) The username for the account that owns the repository. + +### s3_bucket + +* `bucket_name` - (Required) The name of the S3 bucket used for associating a new S3 repository. Note: The name must begin with `codeguru-reviewer-`. +* `name` - (Required) The name of the repository in the S3 bucket. + +## kms_key_details +This configuration block supports the following: + +* `encryption_option` - (Optional) The encryption option for a repository association. It is either owned by AWS Key Management Service (KMS) (`AWS_OWNED_CMK`) or customer managed (`CUSTOMER_MANAGED_CMK`). +* `kms_key_id` - (Optional) The ID of the AWS KMS key that is associated with a repository association. + +## Attributes Reference + +In addition to all arguments above, the following attributes are exported: + +* `arn` - The Amazon Resource Name (ARN) identifying the repository association. +* `association_id` - The ID of the repository association. +* `connection_arn` - The Amazon Resource Name (ARN) of an AWS CodeStar Connections connection. +* `id` - The Amazon Resource Name (ARN) identifying the repository association. +* `name` - The name of the repository. +* `owner` - The owner of the repository. +* `provider_type` - The provider type of the repository association. +* `state` - The state of the repository association. +* `state_reason` - A description of why the repository association is in the current state. + +## Timeouts + +[Configuration options](https://developer.hashicorp.com/terraform/language/resources/syntax#operation-timeouts): + +* `create` - (Default `60m`) +* `update` - (Default `180m`) +* `delete` - (Default `90m`) From ee57dbbfff4cbba2529bd05af73395b2fe41f7d2 Mon Sep 17 00:00:00 2001 From: Albert Silva Date: Sat, 25 Feb 2023 14:04:04 -0500 Subject: [PATCH 353/763] add changelog --- .changelog/29656.txt | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 .changelog/29656.txt diff --git a/.changelog/29656.txt b/.changelog/29656.txt new file mode 100644 index 000000000000..0612ee96a863 --- /dev/null +++ b/.changelog/29656.txt @@ -0,0 +1,3 @@ +```release-note:new-resource +codegurureviewer_repository_association +``` \ No newline at end of file From 7b6ffcec05f9ccad7df15d43e1062fa6fd5b2aa6 Mon Sep 17 00:00:00 2001 From: Albert Silva Date: Sat, 25 Feb 2023 14:15:16 -0500 Subject: [PATCH 354/763] fix imports --- .../service/codegurureviewer/repository_association_test.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/internal/service/codegurureviewer/repository_association_test.go b/internal/service/codegurureviewer/repository_association_test.go index 2f1be83e9017..2b07e74f44cd 100644 --- a/internal/service/codegurureviewer/repository_association_test.go +++ b/internal/service/codegurureviewer/repository_association_test.go @@ -16,9 +16,8 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" "github.com/hashicorp/terraform-provider-aws/internal/create" - "github.com/hashicorp/terraform-provider-aws/names" - tfcodegurureviewer "github.com/hashicorp/terraform-provider-aws/internal/service/codegurureviewer" + "github.com/hashicorp/terraform-provider-aws/names" ) // Repository types of "BitBucket and GitHubEnterpriseServer cannot be tested, as they require their CodeStar Connection to be in "AVAILABLE" status vs "PENDING", requiring console interaction From 1e84504cb7a24414619124b3f65e9bcc28249e80 Mon Sep 17 00:00:00 2001 From: Albert Silva Date: Sat, 25 Feb 2023 14:31:15 -0500 Subject: [PATCH 355/763] fix issues found in ci --- .../codegurureviewer/repository_association.go | 2 -- .../repository_association_test.go | 18 +++--------------- internal/service/codegurureviewer/sweep.go | 4 ++-- 3 files changed, 5 insertions(+), 19 deletions(-) diff --git a/internal/service/codegurureviewer/repository_association.go b/internal/service/codegurureviewer/repository_association.go index 96ffcdfaa561..640c2dbac37d 100644 --- a/internal/service/codegurureviewer/repository_association.go +++ b/internal/service/codegurureviewer/repository_association.go @@ -303,7 +303,6 @@ func resourceRepositoryAssociationCreate(ctx context.Context, d *schema.Resource } func resourceRepositoryAssociationRead(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - conn := meta.(*conns.AWSClient).CodeGuruReviewerConn() out, err := findRepositoryAssociationByID(ctx, conn, d.Id()) @@ -373,7 +372,6 @@ func resourceRepositoryAssociationUpdate(ctx context.Context, d *schema.Resource } func resourceRepositoryAssociationDelete(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - conn := meta.(*conns.AWSClient).CodeGuruReviewerConn() log.Printf("[INFO] Deleting CodeGuruReviewer RepositoryAssociation %s", d.Id()) diff --git a/internal/service/codegurureviewer/repository_association_test.go b/internal/service/codegurureviewer/repository_association_test.go index 2b07e74f44cd..038b9789b7f6 100644 --- a/internal/service/codegurureviewer/repository_association_test.go +++ b/internal/service/codegurureviewer/repository_association_test.go @@ -21,7 +21,7 @@ import ( ) // Repository types of "BitBucket and GitHubEnterpriseServer cannot be tested, as they require their CodeStar Connection to be in "AVAILABLE" status vs "PENDING", requiring console interaction -// However, this has been manually tested succesfully +// However, this has been manually tested successfully func TestAccCodeGuruReviewerRepositoryAssociation_basic(t *testing.T) { if testing.Short() { t.Skip("skipping long-running test in short mode") @@ -281,16 +281,6 @@ func testAccPreCheck(t *testing.T) { } } -func testAccCheckRepositoryAssociationNotRecreated(before, after *codegurureviewer.DescribeRepositoryAssociationOutput) resource.TestCheckFunc { - return func(s *terraform.State) error { - if before, after := aws.StringValue(before.RepositoryAssociation.AssociationArn), aws.StringValue(after.RepositoryAssociation.AssociationArn); before != after { - return create.Error(names.CodeGuruReviewer, create.ErrActionCheckingNotRecreated, tfcodegurureviewer.ResNameRepositoryAssociation, before, errors.New("recreated")) - } - - return nil - } -} - func testAccRepositoryAssociationConfig_basic(rName string) string { return acctest.ConfigCompose(testAccRepositoryAssociation_codecommit_repository(rName), ` resource "aws_codegurureviewer_repository_association" "test" { @@ -388,11 +378,9 @@ resource "aws_s3_bucket" "test" { } func testAccRepositoryAssociation_kms_key() string { - return fmt.Sprint(` - - + return ` resource "aws_kms_key" "test" { deletion_window_in_days = 7 } -`) +` } diff --git a/internal/service/codegurureviewer/sweep.go b/internal/service/codegurureviewer/sweep.go index a802ea54c857..1becaa2747fc 100644 --- a/internal/service/codegurureviewer/sweep.go +++ b/internal/service/codegurureviewer/sweep.go @@ -37,8 +37,8 @@ func sweepAssociations(region string) error { return !lastPage } - for _, v := range page.Associations { - r := ResourceAssociation() + for _, v := range page.RepositoryAssociationSummaries { + r := ResourceRepositoryAssociation() d := r.Data(nil) d.SetId(aws.StringValue(v.Name)) From cd963a0f16b52331199530002a7c83fc3fca64fd Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Sat, 25 Feb 2023 15:11:07 -0500 Subject: [PATCH 356/763] Remove Semgrep Autofix script. --- data-source-test-create-context.semgrep.yml | 28 --------------------- 1 file changed, 28 deletions(-) delete mode 100644 data-source-test-create-context.semgrep.yml diff --git a/data-source-test-create-context.semgrep.yml b/data-source-test-create-context.semgrep.yml deleted file mode 100644 index 7448e3977c1f..000000000000 --- a/data-source-test-create-context.semgrep.yml +++ /dev/null @@ -1,28 +0,0 @@ -rules: - - id: data-source-acceptance-test-no-Context - languages: [go] - message: $FUNCNAME should create Context - paths: - include: - - internal/service/**/*_data_source_test.go - patterns: - - pattern: | - func $FUNCNAME(t *testing.T) { - $...BODY - } - - pattern-not: | - func $FUNCNAME(t *testing.T) { - ... - ctx := acctest.Context(t) - ... - } - - metavariable-pattern: - metavariable: $FUNCNAME - patterns: - - pattern-regex: "^[Tt]estAcc[a-zA-Z0-9]+_[a-zA-Z0-9_]+$" - - pattern-not-regex: "^TestAcc[a-zA-Z0-9]+_serial$" - - focus-metavariable: $...BODY - fix: | - ctx := acctest.Context(t) - $...BODY - severity: WARNING \ No newline at end of file From a325cd7ccf5ceb2391574e8cf1ccff2d3218c384 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Sat, 25 Feb 2023 15:15:39 -0500 Subject: [PATCH 357/763] Tweak 'top5services' target. --- GNUmakefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/GNUmakefile b/GNUmakefile index d20f5310610f..dd0d62681004 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -304,14 +304,14 @@ tools: cd .ci/tools && $(GO_VER) install mvdan.cc/gofumpt top5services: - @echo "==> Rapid smoketest of top 5 services" + @echo "==> Rapid smoke test of top 5 services" TF_ACC=1 $(GO_VER) test \ ./internal/service/ec2/... \ ./internal/service/iam/... \ ./internal/service/logs/... \ ./internal/service/meta/... \ ./internal/service/sts/... \ - -v -count 1 -parallel 3 -run='TestAccIAMRole_basic|TestAccSTSCallerIdentityDataSource_basic|TestAccVPCSecurityGroup_tags|TestAccLogsGroup_basic|TestAccMetaRegionDataSource_basic' -timeout 180m + -v -count $(TEST_COUNT) -parallel $(ACCTEST_PARALLELISM) -run='TestAccIAMRole_basic|TestAccSTSCallerIdentityDataSource_basic|TestAccVPCSecurityGroup_tags|TestAccLogsGroup_basic|TestAccMetaRegionDataSource_basic' -timeout $(ACCTEST_TIMEOUT) website-link-check: @.ci/scripts/markdown-link-check.sh From d25e74d8632c1fa4b54a23348542c1fd57b99820 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Sat, 25 Feb 2023 16:35:06 -0500 Subject: [PATCH 358/763] Fix compilation errors. --- internal/service/autoscaling/policy_test.go | 2 +- .../cloudtrail/event_data_store_test.go | 2 +- internal/service/dms/endpoint_test.go | 4 +- internal/service/elbv2/listener_rule_test.go | 2 +- .../function_event_invoke_config_test.go | 28 +++--- internal/service/lambda/function_test.go | 94 +++++++++---------- .../provisioned_concurrency_config_test.go | 10 +- 7 files changed, 71 insertions(+), 71 deletions(-) diff --git a/internal/service/autoscaling/policy_test.go b/internal/service/autoscaling/policy_test.go index f362654e8b84..03e7183a21cd 100644 --- a/internal/service/autoscaling/policy_test.go +++ b/internal/service/autoscaling/policy_test.go @@ -476,7 +476,7 @@ func TestAccAutoScalingPolicy_TargetTrack_metricMath(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, autoscaling.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckPolicyDestroy(ctx), diff --git a/internal/service/cloudtrail/event_data_store_test.go b/internal/service/cloudtrail/event_data_store_test.go index c019079ec6ef..deaab87ccc16 100644 --- a/internal/service/cloudtrail/event_data_store_test.go +++ b/internal/service/cloudtrail/event_data_store_test.go @@ -64,7 +64,7 @@ func TestAccCloudTrailEventDataStore_kmsKeyId(t *testing.T) { kmsKeyResourceName := "aws_kms_key.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, cloudtrail.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckEventDataStoreDestroy(ctx), diff --git a/internal/service/dms/endpoint_test.go b/internal/service/dms/endpoint_test.go index 0cd498feb784..953a01dcd305 100644 --- a/internal/service/dms/endpoint_test.go +++ b/internal/service/dms/endpoint_test.go @@ -1580,7 +1580,7 @@ func TestAccDMSEndpoint_azureSQLManagedInstance(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, dms.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckEndpointDestroy(ctx), @@ -1621,7 +1621,7 @@ func TestAccDMSEndpoint_db2_secretID(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, dms.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckEndpointDestroy(ctx), diff --git a/internal/service/elbv2/listener_rule_test.go b/internal/service/elbv2/listener_rule_test.go index 99fc23e2a88a..618f0c0a8e9a 100644 --- a/internal/service/elbv2/listener_rule_test.go +++ b/internal/service/elbv2/listener_rule_test.go @@ -141,7 +141,7 @@ func TestAccELBV2ListenerRule_tags(t *testing.T) { resourceName := "aws_lb_listener_rule.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, elbv2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckListenerRuleDestroy(ctx), diff --git a/internal/service/lambda/function_event_invoke_config_test.go b/internal/service/lambda/function_event_invoke_config_test.go index 7e5537cbe3be..8f64488713c7 100644 --- a/internal/service/lambda/function_event_invoke_config_test.go +++ b/internal/service/lambda/function_event_invoke_config_test.go @@ -30,7 +30,7 @@ func TestAccLambdaFunctionEventInvokeConfig_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { acctest.PreCheck(ctx, t) }, - ErrorCheck: acctest.ErrorCheck(t, lambda.EndpointsID), + ErrorCheck: acctest.ErrorCheck(t, names.LambdaEndpointID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckFunctionEventInvokeConfigDestroy(ctx), Steps: []resource.TestStep{ @@ -63,7 +63,7 @@ func TestAccLambdaFunctionEventInvokeConfig_Disappears_lambdaFunction(t *testing resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { acctest.PreCheck(ctx, t) }, - ErrorCheck: acctest.ErrorCheck(t, lambda.EndpointsID), + ErrorCheck: acctest.ErrorCheck(t, names.LambdaEndpointID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckFunctionEventInvokeConfigDestroy(ctx), Steps: []resource.TestStep{ @@ -87,7 +87,7 @@ func TestAccLambdaFunctionEventInvokeConfig_Disappears_lambdaFunctionEventInvoke resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { acctest.PreCheck(ctx, t) }, - ErrorCheck: acctest.ErrorCheck(t, lambda.EndpointsID), + ErrorCheck: acctest.ErrorCheck(t, names.LambdaEndpointID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckFunctionEventInvokeConfigDestroy(ctx), Steps: []resource.TestStep{ @@ -116,7 +116,7 @@ func TestAccLambdaFunctionEventInvokeConfig_DestinationOnFailure_destination(t * resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { acctest.PreCheck(ctx, t) }, - ErrorCheck: acctest.ErrorCheck(t, lambda.EndpointsID), + ErrorCheck: acctest.ErrorCheck(t, names.LambdaEndpointID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckFunctionEventInvokeConfigDestroy(ctx), Steps: []resource.TestStep{ @@ -160,7 +160,7 @@ func TestAccLambdaFunctionEventInvokeConfig_DestinationOnSuccess_destination(t * resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { acctest.PreCheck(ctx, t) }, - ErrorCheck: acctest.ErrorCheck(t, lambda.EndpointsID), + ErrorCheck: acctest.ErrorCheck(t, names.LambdaEndpointID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckFunctionEventInvokeConfigDestroy(ctx), Steps: []resource.TestStep{ @@ -203,7 +203,7 @@ func TestAccLambdaFunctionEventInvokeConfig_Destination_remove(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { acctest.PreCheck(ctx, t) }, - ErrorCheck: acctest.ErrorCheck(t, lambda.EndpointsID), + ErrorCheck: acctest.ErrorCheck(t, names.LambdaEndpointID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckFunctionEventInvokeConfigDestroy(ctx), Steps: []resource.TestStep{ @@ -244,7 +244,7 @@ func TestAccLambdaFunctionEventInvokeConfig_Destination_swap(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { acctest.PreCheck(ctx, t) }, - ErrorCheck: acctest.ErrorCheck(t, lambda.EndpointsID), + ErrorCheck: acctest.ErrorCheck(t, names.LambdaEndpointID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckFunctionEventInvokeConfigDestroy(ctx), Steps: []resource.TestStep{ @@ -287,7 +287,7 @@ func TestAccLambdaFunctionEventInvokeConfig_FunctionName_arn(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { acctest.PreCheck(ctx, t) }, - ErrorCheck: acctest.ErrorCheck(t, lambda.EndpointsID), + ErrorCheck: acctest.ErrorCheck(t, names.LambdaEndpointID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckFunctionEventInvokeConfigDestroy(ctx), Steps: []resource.TestStep{ @@ -320,7 +320,7 @@ func TestAccLambdaFunctionEventInvokeConfig_QualifierFunctionName_arn(t *testing resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { acctest.PreCheck(ctx, t) }, - ErrorCheck: acctest.ErrorCheck(t, lambda.EndpointsID), + ErrorCheck: acctest.ErrorCheck(t, names.LambdaEndpointID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckFunctionEventInvokeConfigDestroy(ctx), Steps: []resource.TestStep{ @@ -352,7 +352,7 @@ func TestAccLambdaFunctionEventInvokeConfig_maximumEventAgeInSeconds(t *testing. resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { acctest.PreCheck(ctx, t) }, - ErrorCheck: acctest.ErrorCheck(t, lambda.EndpointsID), + ErrorCheck: acctest.ErrorCheck(t, names.LambdaEndpointID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckFunctionEventInvokeConfigDestroy(ctx), Steps: []resource.TestStep{ @@ -390,7 +390,7 @@ func TestAccLambdaFunctionEventInvokeConfig_maximumRetryAttempts(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { acctest.PreCheck(ctx, t) }, - ErrorCheck: acctest.ErrorCheck(t, lambda.EndpointsID), + ErrorCheck: acctest.ErrorCheck(t, names.LambdaEndpointID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckFunctionEventInvokeConfigDestroy(ctx), Steps: []resource.TestStep{ @@ -432,7 +432,7 @@ func TestAccLambdaFunctionEventInvokeConfig_Qualifier_aliasName(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { acctest.PreCheck(ctx, t) }, - ErrorCheck: acctest.ErrorCheck(t, lambda.EndpointsID), + ErrorCheck: acctest.ErrorCheck(t, names.LambdaEndpointID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckFunctionEventInvokeConfigDestroy(ctx), Steps: []resource.TestStep{ @@ -460,7 +460,7 @@ func TestAccLambdaFunctionEventInvokeConfig_Qualifier_functionVersion(t *testing resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { acctest.PreCheck(ctx, t) }, - ErrorCheck: acctest.ErrorCheck(t, lambda.EndpointsID), + ErrorCheck: acctest.ErrorCheck(t, names.LambdaEndpointID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckFunctionEventInvokeConfigDestroy(ctx), Steps: []resource.TestStep{ @@ -488,7 +488,7 @@ func TestAccLambdaFunctionEventInvokeConfig_Qualifier_latest(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { acctest.PreCheck(ctx, t) }, - ErrorCheck: acctest.ErrorCheck(t, lambda.EndpointsID), + ErrorCheck: acctest.ErrorCheck(t, names.LambdaEndpointID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckFunctionEventInvokeConfigDestroy(ctx), Steps: []resource.TestStep{ diff --git a/internal/service/lambda/function_test.go b/internal/service/lambda/function_test.go index 80c13cfc88b9..708fa365b90e 100644 --- a/internal/service/lambda/function_test.go +++ b/internal/service/lambda/function_test.go @@ -49,7 +49,7 @@ func TestAccLambdaFunction_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { acctest.PreCheck(ctx, t) }, - ErrorCheck: acctest.ErrorCheck(t, lambda.EndpointsID), + ErrorCheck: acctest.ErrorCheck(t, names.LambdaEndpointID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckFunctionDestroy(ctx), Steps: []resource.TestStep{ @@ -89,7 +89,7 @@ func TestAccLambdaFunction_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { acctest.PreCheck(ctx, t) }, - ErrorCheck: acctest.ErrorCheck(t, lambda.EndpointsID), + ErrorCheck: acctest.ErrorCheck(t, names.LambdaEndpointID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckFunctionDestroy(ctx), Steps: []resource.TestStep{ @@ -113,7 +113,7 @@ func TestAccLambdaFunction_tags(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { acctest.PreCheck(ctx, t) }, - ErrorCheck: acctest.ErrorCheck(t, lambda.EndpointsID), + ErrorCheck: acctest.ErrorCheck(t, names.LambdaEndpointID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckFunctionDestroy(ctx), Steps: []resource.TestStep{ @@ -173,7 +173,7 @@ func TestAccLambdaFunction_unpublishedCodeUpdate(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { acctest.PreCheck(ctx, t) }, - ErrorCheck: acctest.ErrorCheck(t, lambda.EndpointsID), + ErrorCheck: acctest.ErrorCheck(t, names.LambdaEndpointID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckFunctionDestroy(ctx), Steps: []resource.TestStep{ @@ -229,7 +229,7 @@ func TestAccLambdaFunction_codeSigning(t *testing.T) { acctest.PreCheck(ctx, t) testAccPreCheckSignerSigningProfile(ctx, t, "AWSLambda-SHA384-ECDSA") }, - ErrorCheck: acctest.ErrorCheck(t, lambda.EndpointsID), + ErrorCheck: acctest.ErrorCheck(t, names.LambdaEndpointID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckFunctionDestroy(ctx), Steps: []resource.TestStep{ @@ -282,7 +282,7 @@ func TestAccLambdaFunction_concurrency(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { acctest.PreCheck(ctx, t) }, - ErrorCheck: acctest.ErrorCheck(t, lambda.EndpointsID), + ErrorCheck: acctest.ErrorCheck(t, names.LambdaEndpointID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckFunctionDestroy(ctx), Steps: []resource.TestStep{ @@ -322,7 +322,7 @@ func TestAccLambdaFunction_concurrencyCycle(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { acctest.PreCheck(ctx, t) }, - ErrorCheck: acctest.ErrorCheck(t, lambda.EndpointsID), + ErrorCheck: acctest.ErrorCheck(t, names.LambdaEndpointID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckFunctionDestroy(ctx), Steps: []resource.TestStep{ @@ -363,7 +363,7 @@ func TestAccLambdaFunction_expectFilenameAndS3Attributes(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { acctest.PreCheck(ctx, t) }, - ErrorCheck: acctest.ErrorCheck(t, lambda.EndpointsID), + ErrorCheck: acctest.ErrorCheck(t, names.LambdaEndpointID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckFunctionDestroy(ctx), Steps: []resource.TestStep{ @@ -387,7 +387,7 @@ func TestAccLambdaFunction_envVariables(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { acctest.PreCheck(ctx, t) }, - ErrorCheck: acctest.ErrorCheck(t, lambda.EndpointsID), + ErrorCheck: acctest.ErrorCheck(t, names.LambdaEndpointID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckFunctionDestroy(ctx), Steps: []resource.TestStep{ @@ -442,7 +442,7 @@ func TestAccLambdaFunction_EnvironmentVariables_noValue(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { acctest.PreCheck(ctx, t) }, - ErrorCheck: acctest.ErrorCheck(t, lambda.EndpointsID), + ErrorCheck: acctest.ErrorCheck(t, names.LambdaEndpointID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckFunctionDestroy(ctx), Steps: []resource.TestStep{ @@ -477,7 +477,7 @@ func TestAccLambdaFunction_encryptedEnvVariables(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { acctest.PreCheck(ctx, t) }, - ErrorCheck: acctest.ErrorCheck(t, lambda.EndpointsID), + ErrorCheck: acctest.ErrorCheck(t, names.LambdaEndpointID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckFunctionDestroy(ctx), Steps: []resource.TestStep{ @@ -522,7 +522,7 @@ func TestAccLambdaFunction_nameValidation(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { acctest.PreCheck(ctx, t) }, - ErrorCheck: acctest.ErrorCheck(t, lambda.EndpointsID), + ErrorCheck: acctest.ErrorCheck(t, names.LambdaEndpointID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckFunctionDestroy(ctx), Steps: []resource.TestStep{ @@ -548,7 +548,7 @@ func TestAccLambdaFunction_versioned(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { acctest.PreCheck(ctx, t) }, - ErrorCheck: acctest.ErrorCheck(t, lambda.EndpointsID), + ErrorCheck: acctest.ErrorCheck(t, names.LambdaEndpointID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckFunctionDestroy(ctx), Steps: []resource.TestStep{ @@ -593,7 +593,7 @@ func TestAccLambdaFunction_versionedUpdate(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { acctest.PreCheck(ctx, t) }, - ErrorCheck: acctest.ErrorCheck(t, lambda.EndpointsID), + ErrorCheck: acctest.ErrorCheck(t, names.LambdaEndpointID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckFunctionDestroy(ctx), Steps: []resource.TestStep{ @@ -664,7 +664,7 @@ func TestAccLambdaFunction_enablePublish(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { acctest.PreCheck(ctx, t) }, - ErrorCheck: acctest.ErrorCheck(t, lambda.EndpointsID), + ErrorCheck: acctest.ErrorCheck(t, names.LambdaEndpointID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckFunctionDestroy(ctx), Steps: []resource.TestStep{ @@ -722,7 +722,7 @@ func TestAccLambdaFunction_disablePublish(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { acctest.PreCheck(ctx, t) }, - ErrorCheck: acctest.ErrorCheck(t, lambda.EndpointsID), + ErrorCheck: acctest.ErrorCheck(t, names.LambdaEndpointID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckFunctionDestroy(ctx), Steps: []resource.TestStep{ @@ -767,7 +767,7 @@ func TestAccLambdaFunction_deadLetter(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { acctest.PreCheck(ctx, t) }, - ErrorCheck: acctest.ErrorCheck(t, lambda.EndpointsID), + ErrorCheck: acctest.ErrorCheck(t, names.LambdaEndpointID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckFunctionDestroy(ctx), Steps: []resource.TestStep{ @@ -810,7 +810,7 @@ func TestAccLambdaFunction_deadLetterUpdated(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { acctest.PreCheck(ctx, t) }, - ErrorCheck: acctest.ErrorCheck(t, lambda.EndpointsID), + ErrorCheck: acctest.ErrorCheck(t, names.LambdaEndpointID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckFunctionDestroy(ctx), Steps: []resource.TestStep{ @@ -850,7 +850,7 @@ func TestAccLambdaFunction_nilDeadLetter(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { acctest.PreCheck(ctx, t) }, - ErrorCheck: acctest.ErrorCheck(t, lambda.EndpointsID), + ErrorCheck: acctest.ErrorCheck(t, names.LambdaEndpointID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckFunctionDestroy(ctx), Steps: []resource.TestStep{ @@ -875,7 +875,7 @@ func TestAccLambdaFunction_fileSystem(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { acctest.PreCheck(ctx, t) }, - ErrorCheck: acctest.ErrorCheck(t, lambda.EndpointsID), + ErrorCheck: acctest.ErrorCheck(t, names.LambdaEndpointID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckFunctionDestroy(ctx), Steps: []resource.TestStep{ @@ -946,7 +946,7 @@ func TestAccLambdaFunction_image(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { acctest.PreCheck(ctx, t) }, - ErrorCheck: acctest.ErrorCheck(t, lambda.EndpointsID), + ErrorCheck: acctest.ErrorCheck(t, names.LambdaEndpointID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckFunctionDestroy(ctx), Steps: []resource.TestStep{ @@ -1004,7 +1004,7 @@ func TestAccLambdaFunction_architectures(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { acctest.PreCheck(ctx, t) }, - ErrorCheck: acctest.ErrorCheck(t, lambda.EndpointsID), + ErrorCheck: acctest.ErrorCheck(t, names.LambdaEndpointID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckFunctionDestroy(ctx), Steps: []resource.TestStep{ @@ -1055,7 +1055,7 @@ func TestAccLambdaFunction_architecturesUpdate(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { acctest.PreCheck(ctx, t) }, - ErrorCheck: acctest.ErrorCheck(t, lambda.EndpointsID), + ErrorCheck: acctest.ErrorCheck(t, names.LambdaEndpointID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckFunctionDestroy(ctx), Steps: []resource.TestStep{ @@ -1106,7 +1106,7 @@ func TestAccLambdaFunction_architecturesWithLayer(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { acctest.PreCheck(ctx, t) }, - ErrorCheck: acctest.ErrorCheck(t, lambda.EndpointsID), + ErrorCheck: acctest.ErrorCheck(t, names.LambdaEndpointID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckFunctionDestroy(ctx), Steps: []resource.TestStep{ @@ -1153,7 +1153,7 @@ func TestAccLambdaFunction_ephemeralStorage(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { acctest.PreCheck(ctx, t) }, - ErrorCheck: acctest.ErrorCheck(t, lambda.EndpointsID), + ErrorCheck: acctest.ErrorCheck(t, names.LambdaEndpointID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckFunctionDestroy(ctx), @@ -1196,7 +1196,7 @@ func TestAccLambdaFunction_tracing(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { acctest.PreCheck(ctx, t); acctest.PreCheckPartitionNot(t, endpoints.AwsUsGovPartitionID) }, - ErrorCheck: acctest.ErrorCheck(t, lambda.EndpointsID), + ErrorCheck: acctest.ErrorCheck(t, names.LambdaEndpointID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckFunctionDestroy(ctx), Steps: []resource.TestStep{ @@ -1242,7 +1242,7 @@ func TestAccLambdaFunction_KMSKeyARN_noEnvironmentVariables(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { acctest.PreCheck(ctx, t) }, - ErrorCheck: acctest.ErrorCheck(t, lambda.EndpointsID), + ErrorCheck: acctest.ErrorCheck(t, names.LambdaEndpointID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckFunctionDestroy(ctx), Steps: []resource.TestStep{ @@ -1276,7 +1276,7 @@ func TestAccLambdaFunction_layers(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { acctest.PreCheck(ctx, t) }, - ErrorCheck: acctest.ErrorCheck(t, lambda.EndpointsID), + ErrorCheck: acctest.ErrorCheck(t, names.LambdaEndpointID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckFunctionDestroy(ctx), Steps: []resource.TestStep{ @@ -1310,7 +1310,7 @@ func TestAccLambdaFunction_layersUpdate(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { acctest.PreCheck(ctx, t) }, - ErrorCheck: acctest.ErrorCheck(t, lambda.EndpointsID), + ErrorCheck: acctest.ErrorCheck(t, names.LambdaEndpointID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckFunctionDestroy(ctx), Steps: []resource.TestStep{ @@ -1352,7 +1352,7 @@ func TestAccLambdaFunction_vpc(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { acctest.PreCheck(ctx, t) }, - ErrorCheck: acctest.ErrorCheck(t, lambda.EndpointsID), + ErrorCheck: acctest.ErrorCheck(t, names.LambdaEndpointID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckFunctionDestroy(ctx), Steps: []resource.TestStep{ @@ -1388,7 +1388,7 @@ func TestAccLambdaFunction_vpcRemoval(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { acctest.PreCheck(ctx, t) }, - ErrorCheck: acctest.ErrorCheck(t, lambda.EndpointsID), + ErrorCheck: acctest.ErrorCheck(t, names.LambdaEndpointID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckFunctionDestroy(ctx), Steps: []resource.TestStep{ @@ -1428,7 +1428,7 @@ func TestAccLambdaFunction_vpcUpdate(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { acctest.PreCheck(ctx, t) }, - ErrorCheck: acctest.ErrorCheck(t, lambda.EndpointsID), + ErrorCheck: acctest.ErrorCheck(t, names.LambdaEndpointID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckFunctionDestroy(ctx), Steps: []resource.TestStep{ @@ -1477,7 +1477,7 @@ func TestAccLambdaFunction_VPC_withInvocation(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { acctest.PreCheck(ctx, t) }, - ErrorCheck: acctest.ErrorCheck(t, lambda.EndpointsID), + ErrorCheck: acctest.ErrorCheck(t, names.LambdaEndpointID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckFunctionDestroy(ctx), Steps: []resource.TestStep{ @@ -1512,7 +1512,7 @@ func TestAccLambdaFunction_VPCPublishNo_changes(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { acctest.PreCheck(ctx, t) }, - ErrorCheck: acctest.ErrorCheck(t, lambda.EndpointsID), + ErrorCheck: acctest.ErrorCheck(t, names.LambdaEndpointID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckFunctionDestroy(ctx), Steps: []resource.TestStep{ @@ -1554,7 +1554,7 @@ func TestAccLambdaFunction_VPCPublishHas_changes(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { acctest.PreCheck(ctx, t) }, - ErrorCheck: acctest.ErrorCheck(t, lambda.EndpointsID), + ErrorCheck: acctest.ErrorCheck(t, names.LambdaEndpointID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckFunctionDestroy(ctx), @@ -1597,7 +1597,7 @@ func TestAccLambdaFunction_VPC_properIAMDependencies(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { acctest.PreCheck(ctx, t) }, - ErrorCheck: acctest.ErrorCheck(t, lambda.EndpointsID), + ErrorCheck: acctest.ErrorCheck(t, names.LambdaEndpointID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckFunctionDestroy(ctx), Steps: []resource.TestStep{ @@ -1628,7 +1628,7 @@ func TestAccLambdaFunction_VPC_replaceSGWithDefault(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { acctest.PreCheck(ctx, t) }, - ErrorCheck: acctest.ErrorCheck(t, lambda.EndpointsID), + ErrorCheck: acctest.ErrorCheck(t, names.LambdaEndpointID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckFunctionDestroy(ctx), Steps: []resource.TestStep{ @@ -1661,7 +1661,7 @@ func TestAccLambdaFunction_VPC_replaceSGWithCustom(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { acctest.PreCheck(ctx, t) }, - ErrorCheck: acctest.ErrorCheck(t, lambda.EndpointsID), + ErrorCheck: acctest.ErrorCheck(t, names.LambdaEndpointID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckFunctionDestroy(ctx), Steps: []resource.TestStep{ @@ -1690,7 +1690,7 @@ func TestAccLambdaFunction_emptyVPC(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { acctest.PreCheck(ctx, t) }, - ErrorCheck: acctest.ErrorCheck(t, lambda.EndpointsID), + ErrorCheck: acctest.ErrorCheck(t, names.LambdaEndpointID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckFunctionDestroy(ctx), Steps: []resource.TestStep{ @@ -1719,7 +1719,7 @@ func TestAccLambdaFunction_s3(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { acctest.PreCheck(ctx, t) }, - ErrorCheck: acctest.ErrorCheck(t, lambda.EndpointsID), + ErrorCheck: acctest.ErrorCheck(t, names.LambdaEndpointID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckFunctionDestroy(ctx), Steps: []resource.TestStep{ @@ -1760,7 +1760,7 @@ func TestAccLambdaFunction_localUpdate(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { acctest.PreCheck(ctx, t) }, - ErrorCheck: acctest.ErrorCheck(t, lambda.EndpointsID), + ErrorCheck: acctest.ErrorCheck(t, names.LambdaEndpointID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckFunctionDestroy(ctx), Steps: []resource.TestStep{ @@ -1826,7 +1826,7 @@ func TestAccLambdaFunction_LocalUpdate_nameOnly(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { acctest.PreCheck(ctx, t) }, - ErrorCheck: acctest.ErrorCheck(t, lambda.EndpointsID), + ErrorCheck: acctest.ErrorCheck(t, names.LambdaEndpointID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckFunctionDestroy(ctx), Steps: []resource.TestStep{ @@ -1880,7 +1880,7 @@ func TestAccLambdaFunction_S3Update_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { acctest.PreCheck(ctx, t) }, - ErrorCheck: acctest.ErrorCheck(t, lambda.EndpointsID), + ErrorCheck: acctest.ErrorCheck(t, names.LambdaEndpointID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckFunctionDestroy(ctx), Steps: []resource.TestStep{ @@ -1936,7 +1936,7 @@ func TestAccLambdaFunction_S3Update_unversioned(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { acctest.PreCheck(ctx, t) }, - ErrorCheck: acctest.ErrorCheck(t, lambda.EndpointsID), + ErrorCheck: acctest.ErrorCheck(t, names.LambdaEndpointID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckFunctionDestroy(ctx), Steps: []resource.TestStep{ @@ -1984,7 +1984,7 @@ func TestAccLambdaFunction_snapStart(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { acctest.PreCheck(ctx, t) }, - ErrorCheck: acctest.ErrorCheck(t, lambda.EndpointsID), + ErrorCheck: acctest.ErrorCheck(t, names.LambdaEndpointID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckFunctionDestroy(ctx), Steps: []resource.TestStep{ @@ -2077,7 +2077,7 @@ func TestAccLambdaFunction_runtimes(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { acctest.PreCheck(ctx, t) }, - ErrorCheck: acctest.ErrorCheck(t, lambda.EndpointsID), + ErrorCheck: acctest.ErrorCheck(t, names.LambdaEndpointID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckFunctionDestroy(ctx), Steps: steps, @@ -2090,7 +2090,7 @@ func TestAccLambdaFunction_Zip_validation(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { acctest.PreCheck(ctx, t) }, - ErrorCheck: acctest.ErrorCheck(t, lambda.EndpointsID), + ErrorCheck: acctest.ErrorCheck(t, names.LambdaEndpointID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckFunctionDestroy(ctx), Steps: []resource.TestStep{ diff --git a/internal/service/lambda/provisioned_concurrency_config_test.go b/internal/service/lambda/provisioned_concurrency_config_test.go index 1956327b6631..518a888774ef 100644 --- a/internal/service/lambda/provisioned_concurrency_config_test.go +++ b/internal/service/lambda/provisioned_concurrency_config_test.go @@ -26,7 +26,7 @@ func TestAccLambdaProvisionedConcurrencyConfig_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { acctest.PreCheck(ctx, t) }, - ErrorCheck: acctest.ErrorCheck(t, lambda.EndpointsID), + ErrorCheck: acctest.ErrorCheck(t, names.LambdaEndpointID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckProvisionedConcurrencyConfigDestroy(ctx), Steps: []resource.TestStep{ @@ -57,7 +57,7 @@ func TestAccLambdaProvisionedConcurrencyConfig_Disappears_lambdaFunction(t *test resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { acctest.PreCheck(ctx, t) }, - ErrorCheck: acctest.ErrorCheck(t, lambda.EndpointsID), + ErrorCheck: acctest.ErrorCheck(t, names.LambdaEndpointID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckProvisionedConcurrencyConfigDestroy(ctx), Steps: []resource.TestStep{ @@ -81,7 +81,7 @@ func TestAccLambdaProvisionedConcurrencyConfig_Disappears_lambdaProvisionedConcu resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { acctest.PreCheck(ctx, t) }, - ErrorCheck: acctest.ErrorCheck(t, lambda.EndpointsID), + ErrorCheck: acctest.ErrorCheck(t, names.LambdaEndpointID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckProvisionedConcurrencyConfigDestroy(ctx), Steps: []resource.TestStep{ @@ -108,7 +108,7 @@ func TestAccLambdaProvisionedConcurrencyConfig_provisionedConcurrentExecutions(t resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { acctest.PreCheck(ctx, t) }, - ErrorCheck: acctest.ErrorCheck(t, lambda.EndpointsID), + ErrorCheck: acctest.ErrorCheck(t, names.LambdaEndpointID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckProvisionedConcurrencyConfigDestroy(ctx), Steps: []resource.TestStep{ @@ -147,7 +147,7 @@ func TestAccLambdaProvisionedConcurrencyConfig_Qualifier_aliasName(t *testing.T) resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { acctest.PreCheck(ctx, t) }, - ErrorCheck: acctest.ErrorCheck(t, lambda.EndpointsID), + ErrorCheck: acctest.ErrorCheck(t, names.LambdaEndpointID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckProvisionedConcurrencyConfigDestroy(ctx), Steps: []resource.TestStep{ From 46e7d811c18caada3244340db74dda0f7da8d2c8 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Sat, 25 Feb 2023 16:48:17 -0500 Subject: [PATCH 359/763] Remove some linter excludes. --- .ci/.golangci2.yml | 4 ---- internal/tfresource/retry_test.go | 2 +- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/.ci/.golangci2.yml b/.ci/.golangci2.yml index ec08e169f118..fbf8f496ad2c 100644 --- a/.ci/.golangci2.yml +++ b/.ci/.golangci2.yml @@ -9,10 +9,6 @@ issues: - linters: - unparam text: "always receives" - - path: _test\.go - linters: - - contextcheck - - errorlint max-per-linter: 0 max-same-issues: 0 diff --git a/internal/tfresource/retry_test.go b/internal/tfresource/retry_test.go index 0bf15c5ab7a0..8878f268d413 100644 --- a/internal/tfresource/retry_test.go +++ b/internal/tfresource/retry_test.go @@ -386,7 +386,7 @@ func TestRetryContext_error(t *testing.T) { select { case err := <-errCh: - if err != expected { + if !errors.Is(err, expected) { t.Fatalf("bad: %#v", err) } case <-time.After(5 * time.Second): From 8e29b79cb504a64bd487c4ffc945e769c6761130 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Sat, 25 Feb 2023 16:50:10 -0500 Subject: [PATCH 360/763] Run 'go test' on large custom runner. --- .github/workflows/terraform_provider.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/terraform_provider.yml b/.github/workflows/terraform_provider.yml index 7c1d959ccb55..dc56b5f987b4 100644 --- a/.github/workflows/terraform_provider.yml +++ b/.github/workflows/terraform_provider.yml @@ -118,7 +118,7 @@ jobs: go_test: name: go test needs: [go_build] - runs-on: [custom, linux, medium] + runs-on: [custom, linux, large] steps: - uses: actions/checkout@v3 with: From 4393b5ff6d06ca4df1fcae9e0c1eba525d7d1594 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Sat, 25 Feb 2023 17:33:38 -0500 Subject: [PATCH 361/763] Fix golangci-lint 'staticcheck'. --- .../glue/data_catalog_encryption_settings_data_source_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 897e5d394447..3e790334aaee 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 @@ -9,9 +9,9 @@ import ( ) func testAccDataCatalogEncryptionSettingsDataSource_basic(t *testing.T) { - ctx := acctest.Context(t) t.Skipf("Skipping aws_glue_data_catalog_encryption_settings tests due to potential KMS key corruption") + ctx := acctest.Context(t) resourceName := "aws_glue_data_catalog_encryption_settings.test" dataSourceName := "data.aws_glue_data_catalog_encryption_settings.test" From 000494bd8bed4c8d7ab5b2d0bf781dae3b5d7331 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Sat, 25 Feb 2023 17:37:53 -0500 Subject: [PATCH 362/763] Fix compilation errors. --- internal/service/autoscaling/group_test.go | 4 ++-- internal/service/ec2/ec2_fleet_test.go | 4 ++-- internal/service/ec2/ec2_launch_template_test.go | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/internal/service/autoscaling/group_test.go b/internal/service/autoscaling/group_test.go index cfad33519925..c932a260b17e 100644 --- a/internal/service/autoscaling/group_test.go +++ b/internal/service/autoscaling/group_test.go @@ -2316,7 +2316,7 @@ func TestAccAutoScalingGroup_MixedInstancesPolicyLaunchTemplateOverride_instance resourceName := "aws_autoscaling_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, autoscaling.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckGroupDestroy(ctx), @@ -3016,7 +3016,7 @@ func TestAccAutoScalingGroup_MixedInstancesPolicyLaunchTemplateOverride_instance resourceName := "aws_autoscaling_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, autoscaling.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckGroupDestroy(ctx), diff --git a/internal/service/ec2/ec2_fleet_test.go b/internal/service/ec2/ec2_fleet_test.go index fe630ce36987..c2d36ac6531b 100644 --- a/internal/service/ec2/ec2_fleet_test.go +++ b/internal/service/ec2/ec2_fleet_test.go @@ -840,7 +840,7 @@ func TestAccEC2Fleet_LaunchTemplateOverride_instanceRequirements_allowedInstance resourceName := "aws_ec2_fleet.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckFleet(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckFleet(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckFleetDestroy(ctx), @@ -1630,7 +1630,7 @@ func TestAccEC2Fleet_LaunchTemplateOverride_instanceRequirements_networkBandwidt resourceName := "aws_ec2_fleet.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckFleet(ctx, t) }, + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckFleet(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckFleetDestroy(ctx), diff --git a/internal/service/ec2/ec2_launch_template_test.go b/internal/service/ec2/ec2_launch_template_test.go index 7b3b50583f9e..142f797afd3c 100644 --- a/internal/service/ec2/ec2_launch_template_test.go +++ b/internal/service/ec2/ec2_launch_template_test.go @@ -1789,7 +1789,7 @@ func TestAccEC2LaunchTemplate_instanceRequirements_allowedInstanceTypes(t *testi resourceName := "aws_launch_template.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckLaunchTemplateDestroy(ctx), @@ -2479,7 +2479,7 @@ func TestAccEC2LaunchTemplate_instanceRequirements_networkBandwidthGbps(t *testi resourceName := "aws_launch_template.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckLaunchTemplateDestroy(ctx), From b2b0b9bc9fc22008ccdd18e948038e54b1e8b4b9 Mon Sep 17 00:00:00 2001 From: Roy Rajan Date: Fri, 30 Dec 2022 15:44:41 +0000 Subject: [PATCH 363/763] Adding resource - OAM Sink --- internal/provider/provider.go | 3 + internal/service/oam/sink.go | 192 +++++++++++++++++++ internal/service/oam/sink_test.go | 256 ++++++++++++++++++++++++++ names/names.go | 39 ++-- website/docs/r/oam_sink.html.markdown | 58 ++++++ 5 files changed, 529 insertions(+), 19 deletions(-) create mode 100644 internal/service/oam/sink.go create mode 100644 internal/service/oam/sink_test.go create mode 100644 website/docs/r/oam_sink.html.markdown diff --git a/internal/provider/provider.go b/internal/provider/provider.go index 1c2fcaada922..a37832ad856b 100644 --- a/internal/provider/provider.go +++ b/internal/provider/provider.go @@ -135,6 +135,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/service/neptune" "github.com/hashicorp/terraform-provider-aws/internal/service/networkfirewall" "github.com/hashicorp/terraform-provider-aws/internal/service/networkmanager" + "github.com/hashicorp/terraform-provider-aws/internal/service/oam" "github.com/hashicorp/terraform-provider-aws/internal/service/opensearch" "github.com/hashicorp/terraform-provider-aws/internal/service/opsworks" "github.com/hashicorp/terraform-provider-aws/internal/service/organizations" @@ -1809,6 +1810,8 @@ func New(ctx context.Context) (*schema.Provider, error) { "aws_networkmanager_vpc_attachment": networkmanager.ResourceVPCAttachment(), "aws_networkmanager_site_to_site_vpn_attachment": networkmanager.ResourceSiteToSiteVPNAttachment(), + "aws_oam_sink": oam.ResourceSink(), + "aws_opensearch_domain": opensearch.ResourceDomain(), "aws_opensearch_domain_policy": opensearch.ResourceDomainPolicy(), "aws_opensearch_domain_saml_options": opensearch.ResourceDomainSAMLOptions(), diff --git a/internal/service/oam/sink.go b/internal/service/oam/sink.go new file mode 100644 index 000000000000..230eadf9ceb4 --- /dev/null +++ b/internal/service/oam/sink.go @@ -0,0 +1,192 @@ +package oam + +import ( + "context" + "errors" + "log" + "time" + + "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" + "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-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/create" + 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" + "github.com/hashicorp/terraform-provider-aws/names" +) + +func ResourceSink() *schema.Resource { + return &schema.Resource{ + CreateWithoutTimeout: resourceSinkCreate, + ReadWithoutTimeout: resourceSinkRead, + UpdateWithoutTimeout: resourceSinkUpdate, + DeleteWithoutTimeout: resourceSinkDelete, + + Importer: &schema.ResourceImporter{ + StateContext: schema.ImportStatePassthroughContext, + }, + + Timeouts: &schema.ResourceTimeout{ + Create: schema.DefaultTimeout(1 * time.Minute), + Update: schema.DefaultTimeout(1 * time.Minute), + Delete: schema.DefaultTimeout(1 * time.Minute), + }, + + Schema: map[string]*schema.Schema{ + "arn": { + Type: schema.TypeString, + Computed: true, + }, + "id": { + Type: schema.TypeString, + Computed: true, + }, + "name": { + Type: schema.TypeString, + Required: true, + ForceNew: true, + }, + "tags": tftags.TagsSchema(), + "tags_all": tftags.TagsSchemaComputed(), + }, + + CustomizeDiff: verify.SetTagsDiff, + } +} + +const ( + ResNameSink = "Sink" +) + +func resourceSinkCreate(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { + conn := meta.(*conns.AWSClient).ObservabilityAccessManagerClient() + + in := &oam.CreateSinkInput{ + Name: aws.String(d.Get("name").(string)), + } + + defaultTagsConfig := meta.(*conns.AWSClient).DefaultTagsConfig + tags := defaultTagsConfig.MergeTags(tftags.New(ctx, d.Get("tags").(map[string]interface{}))) + + if len(tags) > 0 { + in.Tags = Tags(tags.IgnoreAWS()) + } + + out, err := conn.CreateSink(ctx, in) + if err != nil { + return create.DiagError(names.ObservabilityAccessManager, create.ErrActionCreating, ResNameSink, d.Get("name").(string), err) + } + + if out == nil { + return create.DiagError(names.ObservabilityAccessManager, create.ErrActionCreating, ResNameSink, d.Get("name").(string), errors.New("empty output")) + } + + d.SetId(aws.ToString(out.Arn)) + + return resourceSinkRead(ctx, d, meta) +} + +func resourceSinkRead(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { + conn := meta.(*conns.AWSClient).ObservabilityAccessManagerClient() + + out, err := findSinkByID(ctx, conn, d.Id()) + + if !d.IsNewResource() && tfresource.NotFound(err) { + log.Printf("[WARN] ObservabilityAccessManager Sink (%s) not found, removing from state", d.Id()) + d.SetId("") + return nil + } + + if err != nil { + return create.DiagError(names.ObservabilityAccessManager, create.ErrActionReading, ResNameSink, d.Id(), err) + } + + d.Set("arn", out.Arn) + d.Set("id", out.Id) + d.Set("name", out.Name) + + tags, err := ListTags(ctx, conn, d.Id()) + if err != nil { + return create.DiagError(names.ObservabilityAccessManager, create.ErrActionReading, ResNameSink, d.Id(), err) + } + + defaultTagsConfig := meta.(*conns.AWSClient).DefaultTagsConfig + ignoreTagsConfig := meta.(*conns.AWSClient).IgnoreTagsConfig + tags = tags.IgnoreAWS().IgnoreConfig(ignoreTagsConfig) + + if err := d.Set("tags", tags.RemoveDefaultConfig(defaultTagsConfig).Map()); err != nil { + return create.DiagError(names.ObservabilityAccessManager, create.ErrActionSetting, ResNameSink, d.Id(), err) + } + + if err := d.Set("tags_all", tags.Map()); err != nil { + return create.DiagError(names.ObservabilityAccessManager, create.ErrActionSetting, ResNameSink, d.Id(), err) + } + + return nil +} + +func resourceSinkUpdate(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { + conn := meta.(*conns.AWSClient).ObservabilityAccessManagerClient() + + if d.HasChange("tags_all") { + log.Printf("[DEBUG] Updating ObservabilityAccessManager Sink Tags (%s): %#v", d.Id(), d.Get("tags_all")) + oldTags, newTags := d.GetChange("tags_all") + if err := UpdateTags(ctx, conn, d.Get("arn").(string), oldTags, newTags); err != nil { + return create.DiagError(names.ObservabilityAccessManager, create.ErrActionUpdating, ResNameSink, d.Id(), err) + } + + return resourceSinkRead(ctx, d, meta) + } + + return nil +} + +func resourceSinkDelete(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { + conn := meta.(*conns.AWSClient).ObservabilityAccessManagerClient() + + log.Printf("[INFO] Deleting ObservabilityAccessManager Sink %s", d.Id()) + + _, err := conn.DeleteSink(ctx, &oam.DeleteSinkInput{ + Identifier: aws.String(d.Id()), + }) + + if err != nil { + var nfe *types.ResourceNotFoundException + if errors.As(err, &nfe) { + return nil + } + + return create.DiagError(names.ObservabilityAccessManager, create.ErrActionDeleting, ResNameSink, d.Id(), err) + } + + return nil +} + +func findSinkByID(ctx context.Context, conn *oam.Client, id string) (*oam.GetSinkOutput, error) { + in := &oam.GetSinkInput{ + Identifier: aws.String(id), + } + out, err := conn.GetSink(ctx, in) + if err != nil { + var nfe *types.ResourceNotFoundException + if errors.As(err, &nfe) { + return nil, &resource.NotFoundError{ + LastError: err, + LastRequest: in, + } + } + + return nil, err + } + + if out == nil { + return nil, tfresource.NewEmptyResultError(in) + } + + return out, nil +} diff --git a/internal/service/oam/sink_test.go b/internal/service/oam/sink_test.go new file mode 100644 index 000000000000..f680978639b6 --- /dev/null +++ b/internal/service/oam/sink_test.go @@ -0,0 +1,256 @@ +package oam_test + +import ( + "context" + "errors" + "fmt" + "regexp" + "testing" + + "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" + "github.com/hashicorp/terraform-provider-aws/internal/acctest" + "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/create" + tfoam "github.com/hashicorp/terraform-provider-aws/internal/service/oam" + "github.com/hashicorp/terraform-provider-aws/names" +) + +func TestAccObservabilityAccessManagerSink_basic(t *testing.T) { + if testing.Short() { + t.Skip("skipping long-running test in short mode") + } + + var sink oam.GetSinkOutput + rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) + resourceName := "aws_oam_sink.test" + + resource.Test(t, resource.TestCase{ + PreCheck: func() { + acctest.PreCheck(t) + acctest.PreCheckPartitionHasService(t, names.ObservabilityAccessManagerEndpointID) + testAccPreCheck(t) + }, + ErrorCheck: acctest.ErrorCheck(t, names.ObservabilityAccessManagerEndpointID), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + CheckDestroy: testAccCheckSinkDestroy, + Steps: []resource.TestStep{ + { + Config: testAccSinkConfigBasic(rName), + Check: resource.ComposeTestCheckFunc( + testAccCheckSinkExists(resourceName, &sink), + resource.TestCheckResourceAttr(resourceName, "name", rName), + resource.TestCheckResourceAttrSet(resourceName, "id"), + resource.TestCheckResourceAttr(resourceName, "tags.%", "0"), + acctest.MatchResourceAttrRegionalARN(resourceName, "arn", "oam", regexp.MustCompile(`sink/+.`)), + ), + }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, + }, + }) +} + +func TestAccObservabilityAccessManagerSink_disappears(t *testing.T) { + if testing.Short() { + t.Skip("skipping long-running test in short mode") + } + + ctx := acctest.Context(t) + var sink oam.GetSinkOutput + rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) + resourceName := "aws_oam_sink.test" + + resource.Test(t, resource.TestCase{ + PreCheck: func() { + acctest.PreCheck(t) + acctest.PreCheckPartitionHasService(t, names.ObservabilityAccessManagerEndpointID) + testAccPreCheck(t) + }, + ErrorCheck: acctest.ErrorCheck(t, names.ObservabilityAccessManagerEndpointID), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + CheckDestroy: testAccCheckSinkDestroy, + Steps: []resource.TestStep{ + { + Config: testAccSinkConfigBasic(rName), + Check: resource.ComposeTestCheckFunc( + testAccCheckSinkExists(resourceName, &sink), + acctest.CheckResourceDisappears(ctx, acctest.Provider, tfoam.ResourceSink(), resourceName), + ), + ExpectNonEmptyPlan: true, + }, + }, + }) +} + +func TestAccObservabilityAccessManagerSink_tags(t *testing.T) { + if testing.Short() { + t.Skip("skipping long-running test in short mode") + } + + var sink oam.GetSinkOutput + rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) + resourceName := "aws_oam_sink.test" + + resource.Test(t, resource.TestCase{ + PreCheck: func() { + acctest.PreCheck(t) + acctest.PreCheckPartitionHasService(t, names.ObservabilityAccessManagerEndpointID) + testAccPreCheck(t) + }, + ErrorCheck: acctest.ErrorCheck(t, names.ObservabilityAccessManagerEndpointID), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + CheckDestroy: testAccCheckSinkDestroy, + Steps: []resource.TestStep{ + { + Config: testAccSinkConfigTags1(rName, "key1", "value1"), + Check: resource.ComposeTestCheckFunc( + testAccCheckSinkExists(resourceName, &sink), + resource.TestCheckResourceAttr(resourceName, "name", rName), + resource.TestCheckResourceAttrSet(resourceName, "id"), + resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), + resource.TestCheckResourceAttr(resourceName, "tags.key1", "value1"), + acctest.MatchResourceAttrRegionalARN(resourceName, "arn", "oam", regexp.MustCompile(`sink/+.`)), + ), + }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, + { + Config: testAccSinkConfigTags2(rName, "key1", "value1updated", "key2", "value2"), + Check: resource.ComposeTestCheckFunc( + testAccCheckSinkExists(resourceName, &sink), + resource.TestCheckResourceAttr(resourceName, "name", rName), + resource.TestCheckResourceAttrSet(resourceName, "id"), + resource.TestCheckResourceAttr(resourceName, "tags.%", "2"), + resource.TestCheckResourceAttr(resourceName, "tags.key1", "value1updated"), + resource.TestCheckResourceAttr(resourceName, "tags.key2", "value2"), + acctest.MatchResourceAttrRegionalARN(resourceName, "arn", "oam", regexp.MustCompile(`sink/+.`)), + ), + }, + { + Config: testAccSinkConfigTags1(rName, "key2", "value2"), + Check: resource.ComposeTestCheckFunc( + testAccCheckSinkExists(resourceName, &sink), + resource.TestCheckResourceAttr(resourceName, "name", rName), + resource.TestCheckResourceAttrSet(resourceName, "id"), + resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), + resource.TestCheckResourceAttr(resourceName, "tags.key2", "value2"), + acctest.MatchResourceAttrRegionalARN(resourceName, "arn", "oam", regexp.MustCompile(`sink/+.`)), + ), + }, + }, + }) +} + +func testAccCheckSinkDestroy(s *terraform.State) error { + conn := acctest.Provider.Meta().(*conns.AWSClient).ObservabilityAccessManagerClient() + ctx := context.Background() + + for _, rs := range s.RootModule().Resources { + if rs.Type != "aws_oam_sink" { + continue + } + + input := &oam.GetSinkInput{ + Identifier: aws.String(rs.Primary.ID), + } + _, err := conn.GetSink(ctx, input) + if err != nil { + var nfe *types.ResourceNotFoundException + if errors.As(err, &nfe) { + return nil + } + return err + } + + return create.Error(names.ObservabilityAccessManager, create.ErrActionCheckingDestroyed, tfoam.ResNameSink, rs.Primary.ID, errors.New("not destroyed")) + } + + return nil +} + +func testAccCheckSinkExists(name string, sink *oam.GetSinkOutput) resource.TestCheckFunc { + return func(s *terraform.State) error { + rs, ok := s.RootModule().Resources[name] + if !ok { + return create.Error(names.ObservabilityAccessManager, create.ErrActionCheckingExistence, tfoam.ResNameSink, name, errors.New("not found")) + } + + if rs.Primary.ID == "" { + return create.Error(names.ObservabilityAccessManager, create.ErrActionCheckingExistence, tfoam.ResNameSink, name, errors.New("not set")) + } + + conn := acctest.Provider.Meta().(*conns.AWSClient).ObservabilityAccessManagerClient() + ctx := context.Background() + resp, err := conn.GetSink(ctx, &oam.GetSinkInput{ + Identifier: aws.String(rs.Primary.ID), + }) + + if err != nil { + return create.Error(names.ObservabilityAccessManager, create.ErrActionCheckingExistence, tfoam.ResNameSink, rs.Primary.ID, err) + } + + *sink = *resp + + return nil + } +} + +func testAccPreCheck(t *testing.T) { + conn := acctest.Provider.Meta().(*conns.AWSClient).ObservabilityAccessManagerClient() + ctx := context.Background() + + input := &oam.ListSinksInput{} + _, err := conn.ListSinks(ctx, input) + + if acctest.PreCheckSkipError(err) { + t.Skipf("skipping acceptance testing: %s", err) + } + + if err != nil { + t.Fatalf("unexpected PreCheck error: %s", err) + } +} + +func testAccSinkConfigBasic(rName string) string { + return fmt.Sprintf(` +resource "aws_oam_sink" "test" { + name = %[1]q +} +`, rName) +} + +func testAccSinkConfigTags1(rName, tag1Key, tag1Value string) string { + return fmt.Sprintf(` +resource "aws_oam_sink" "test" { + name = %[1]q + + tags = { + %[2]q = %[3]q + } +} +`, rName, tag1Key, tag1Value) +} + +func testAccSinkConfigTags2(rName, tag1Key, tag1Value, tag2Key, tag2Value string) string { + return fmt.Sprintf(` +resource "aws_oam_sink" "test" { + name = %[1]q + + tags = { + %[2]q = %[3]q + %[4]q = %[5]q + } +} +`, rName, tag1Key, tag1Value, tag2Key, tag2Value) +} diff --git a/names/names.go b/names/names.go index d2ccc1ef7c7d..06a74bb49320 100644 --- a/names/names.go +++ b/names/names.go @@ -23,25 +23,26 @@ import ( // This "should" be defined by the AWS Go SDK v2, but currently isn't. const ( - AuditManagerEndpointID = "auditmanager" - CloudWatchLogsEndpointID = "logs" - ComprehendEndpointID = "comprehend" - ComputeOptimizerEndpointID = "computeoptimizer" - IdentityStoreEndpointID = "identitystore" - Inspector2EndpointID = "inspector2" - IVSChatEndpointID = "ivschat" - KendraEndpointID = "kendra" - LambdaEndpointID = "lambda" - MediaLiveEndpointID = "medialive" - OpenSearchServerlessEndpointID = "aoss" - PipesEndpointID = "pipes" - ResourceExplorer2EndpointID = "resource-explorer-2" - RolesAnywhereEndpointID = "rolesanywhere" - Route53DomainsEndpointID = "route53domains" - SchedulerEndpointID = "scheduler" - SESV2EndpointID = "sesv2" - SSMEndpointID = "ssm" - TranscribeEndpointID = "transcribe" + AuditManagerEndpointID = "auditmanager" + CloudWatchLogsEndpointID = "logs" + ComprehendEndpointID = "comprehend" + ComputeOptimizerEndpointID = "computeoptimizer" + IdentityStoreEndpointID = "identitystore" + Inspector2EndpointID = "inspector2" + IVSChatEndpointID = "ivschat" + KendraEndpointID = "kendra" + LambdaEndpointID = "lambda" + MediaLiveEndpointID = "medialive" + OpenSearchServerlessEndpointID = "aoss" + ObservabilityAccessManagerEndpointID = "oam" + PipesEndpointID = "pipes" + ResourceExplorer2EndpointID = "resource-explorer-2" + RolesAnywhereEndpointID = "rolesanywhere" + Route53DomainsEndpointID = "route53domains" + SchedulerEndpointID = "scheduler" + SESV2EndpointID = "sesv2" + SSMEndpointID = "ssm" + TranscribeEndpointID = "transcribe" ) // Type ServiceDatum corresponds closely to columns in `names_data.csv` and are diff --git a/website/docs/r/oam_sink.html.markdown b/website/docs/r/oam_sink.html.markdown new file mode 100644 index 000000000000..bd79783ae279 --- /dev/null +++ b/website/docs/r/oam_sink.html.markdown @@ -0,0 +1,58 @@ +--- +subcategory: "CloudWatch Observability Access Manager" +layout: "aws" +page_title: "AWS: aws_oam_sink" +description: |- + Terraform resource for managing an AWS CloudWatch Observability Access Manager Sink. +--- + +# Resource: aws_oam_sink + +Terraform resource for managing an AWS CloudWatch Observability Access Manager Sink. + +## Example Usage + +### Basic Usage + +```terraform +resource "aws_oam_sink" "example" { + name = "ExampleSink" + + tags = { + Env = "prod" + } +} +``` + +## Argument Reference + +The following arguments are required: + +* `name` - (Required) Name for the sink. + +The following arguments are optional: + +* `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. + +## Attributes Reference + +In addition to all arguments above, the following attributes are exported: + +* `arn` - ARN of the Sink. +* `id` - ID string that AWS generated as part of the sink ARN. + +## Timeouts + +[Configuration options](https://developer.hashicorp.com/terraform/language/resources/syntax#operation-timeouts): + +* `create` - (Default `1m`) +* `update` - (Default `1m`) +* `delete` - (Default `1m`) + +## Import + +CloudWatch Observability Access Manager Sink can be imported using the `arn`, e.g., + +``` +$ terraform import aws_oam_sink.example arn:aws:oam:us-west-2:123456789012:sink/sink-id +``` From f534b60c3587ad36e32c670121709ad9a0d6bc6d Mon Sep 17 00:00:00 2001 From: Roy Rajan Date: Sun, 26 Feb 2023 20:42:33 +0000 Subject: [PATCH 364/763] Fixing terrafmt validation failures --- internal/service/oam/sink_test.go | 6 +++--- website/docs/r/oam_sink.html.markdown | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/internal/service/oam/sink_test.go b/internal/service/oam/sink_test.go index f680978639b6..fd04d6d5c502 100644 --- a/internal/service/oam/sink_test.go +++ b/internal/service/oam/sink_test.go @@ -234,7 +234,7 @@ func testAccSinkConfigTags1(rName, tag1Key, tag1Value string) string { return fmt.Sprintf(` resource "aws_oam_sink" "test" { name = %[1]q - + tags = { %[2]q = %[3]q } @@ -246,10 +246,10 @@ func testAccSinkConfigTags2(rName, tag1Key, tag1Value, tag2Key, tag2Value string return fmt.Sprintf(` resource "aws_oam_sink" "test" { name = %[1]q - + tags = { %[2]q = %[3]q - %[4]q = %[5]q + %[4]q = %[5]q } } `, rName, tag1Key, tag1Value, tag2Key, tag2Value) diff --git a/website/docs/r/oam_sink.html.markdown b/website/docs/r/oam_sink.html.markdown index bd79783ae279..e9ebf34bd7f7 100644 --- a/website/docs/r/oam_sink.html.markdown +++ b/website/docs/r/oam_sink.html.markdown @@ -17,7 +17,7 @@ Terraform resource for managing an AWS CloudWatch Observability Access Manager S ```terraform resource "aws_oam_sink" "example" { name = "ExampleSink" - + tags = { Env = "prod" } From dcd63d6dcdf1e6624609e9713a01ac59d5c87664 Mon Sep 17 00:00:00 2001 From: Roy Rajan Date: Sun, 26 Feb 2023 21:03:00 +0000 Subject: [PATCH 365/763] Add changelog --- .changelog/29670.txt | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 .changelog/29670.txt diff --git a/.changelog/29670.txt b/.changelog/29670.txt new file mode 100644 index 000000000000..dcb1a9999da0 --- /dev/null +++ b/.changelog/29670.txt @@ -0,0 +1,3 @@ +```release-note:new-resource +aws_oam_sink +``` From f45ffe2f1b787dcd9027a4d462013c1741240ac3 Mon Sep 17 00:00:00 2001 From: Matt Burgess <549318+mattburgess@users.noreply.github.com> Date: Mon, 13 Sep 2021 22:37:37 +0100 Subject: [PATCH 366/763] Clarify the need for `subnet_id` or `availability_zone` for `cloudhsm_v2_hsm` resources. Fixes #20856. --- internal/service/cloudhsmv2/hsm.go | 18 ++++++++++-------- website/docs/r/cloudhsm_v2_hsm.html.markdown | 6 ++++-- 2 files changed, 14 insertions(+), 10 deletions(-) diff --git a/internal/service/cloudhsmv2/hsm.go b/internal/service/cloudhsmv2/hsm.go index 456f0bdf1925..62d6dd7de015 100644 --- a/internal/service/cloudhsmv2/hsm.go +++ b/internal/service/cloudhsmv2/hsm.go @@ -36,17 +36,19 @@ func ResourceHSM() *schema.Resource { }, "subnet_id": { - Type: schema.TypeString, - Optional: true, - Computed: true, - ForceNew: true, + Type: schema.TypeString, + Optional: true, + Computed: true, + ForceNew: true, + ConflictsWith: []string{"availability_zone"}, }, "availability_zone": { - Type: schema.TypeString, - Optional: true, - Computed: true, - ForceNew: true, + Type: schema.TypeString, + Optional: true, + Computed: true, + ForceNew: true, + ConflictsWith: []string{"subnet_id"}, }, "ip_address": { diff --git a/website/docs/r/cloudhsm_v2_hsm.html.markdown b/website/docs/r/cloudhsm_v2_hsm.html.markdown index e1c730a6afa8..e03caf789733 100644 --- a/website/docs/r/cloudhsm_v2_hsm.html.markdown +++ b/website/docs/r/cloudhsm_v2_hsm.html.markdown @@ -29,9 +29,11 @@ resource "aws_cloudhsm_v2_hsm" "cloudhsm_v2_hsm" { The following arguments are supported: +~> **NOTE:** Either `subnet_id` or `availability_zone` must be specified. + * `cluster_id` - (Required) The ID of Cloud HSM v2 cluster to which HSM will be added. -* `subnet_id` - (Optional) The ID of subnet in which HSM module will be located. -* `availability_zone` - (Optional) The IDs of AZ in which HSM module will be located. Do not use together with subnet_id. +* `subnet_id` - (Optional) The ID of subnet in which HSM module will be located. Conflicts with `availability_zone`. +* `availability_zone` - (Optional) The IDs of AZ in which HSM module will be located. Conflicts with `subnet_id`. * `ip_address` - (Optional) The IP address of HSM module. Must be within the CIDR of selected subnet. ## Attributes Reference From ec8c58fbd3db6b0701ac42c1605b95a2bab3eae0 Mon Sep 17 00:00:00 2001 From: Benny Lu Date: Mon, 27 Feb 2023 16:14:40 -0800 Subject: [PATCH 367/763] aws_transfer_workflow - add decrypt type --- internal/service/transfer/workflow.go | 204 +++++++++++++++++++++----- 1 file changed, 171 insertions(+), 33 deletions(-) diff --git a/internal/service/transfer/workflow.go b/internal/service/transfer/workflow.go index 26703e1491fa..1ce6e740e70d 100644 --- a/internal/service/transfer/workflow.go +++ b/internal/service/transfer/workflow.go @@ -356,6 +356,82 @@ func ResourceWorkflow() *schema.Resource { }, }, }, + "decrypt_step_details": { + Type: schema.TypeList, + Optional: true, + MaxItems: 1, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "destination_file_location": { + Type: schema.TypeList, + Optional: true, + MaxItems: 1, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "efs_file_location": { + Type: schema.TypeList, + Optional: true, + MaxItems: 1, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "file_system_id": { + Type: schema.TypeString, + Optional: true, + }, + "path": { + Type: schema.TypeString, + Optional: true, + ValidateFunc: validation.StringLenBetween(1, 65536), + }, + }, + }, + }, + "s3_file_location": { + Type: schema.TypeList, + Optional: true, + MaxItems: 1, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "bucket": { + Type: schema.TypeString, + Optional: true, + }, + "key": { + Type: schema.TypeString, + Optional: true, + ValidateFunc: validation.StringLenBetween(0, 1024), + }, + }, + }, + }, + }, + }, + }, + "name": { + Type: schema.TypeString, + Optional: true, + ValidateFunc: validation.All( + validation.StringLenBetween(0, 30), + validation.StringMatch(regexp.MustCompile(`^[\w-]*$`), "Must be of the pattern ^[\\w-]*$"), + ), + }, + "overwrite_existing": { + Type: schema.TypeString, + Optional: true, + Default: transfer.OverwriteExistingFalse, + ValidateFunc: validation.StringInSlice(transfer.OverwriteExisting_Values(), false), + }, + "source_file_location": { + Type: schema.TypeString, + Optional: true, + ValidateFunc: validation.All( + validation.StringLenBetween(0, 256), + validation.StringMatch(regexp.MustCompile(`^\$\{(\w+.)+\w+\}$`), "Must be of the pattern ^\\$\\{(\\w+.)+\\w+\\}$"), + ), + }, + }, + }, + }, "delete_step_details": { Type: schema.TypeList, Optional: true, @@ -566,10 +642,6 @@ func expandWorkflows(tfList []interface{}) []*transfer.WorkflowStep { Type: aws.String(tfMap["type"].(string)), } - if v, ok := tfMap["delete_step_details"].([]interface{}); ok && len(v) > 0 { - apiObject.DeleteStepDetails = expandDeleteStepDetails(v) - } - if v, ok := tfMap["copy_step_details"].([]interface{}); ok && len(v) > 0 { apiObject.CopyStepDetails = expandCopyStepDetails(v) } @@ -578,6 +650,14 @@ func expandWorkflows(tfList []interface{}) []*transfer.WorkflowStep { apiObject.CustomStepDetails = expandCustomStepDetails(v) } + if v, ok := tfMap["decrypt_step_details"].([]interface{}); ok && len(v) > 0 { + apiObject.DecryptStepDetails = expandDecryptStepDetails(v) + } + + if v, ok := tfMap["delete_step_details"].([]interface{}); ok && len(v) > 0 { + apiObject.DeleteStepDetails = expandDeleteStepDetails(v) + } + if v, ok := tfMap["tag_step_details"].([]interface{}); ok && len(v) > 0 { apiObject.TagStepDetails = expandTagStepDetails(v) } @@ -604,10 +684,6 @@ func flattenWorkflows(apiObjects []*transfer.WorkflowStep) []interface{} { "type": aws.StringValue(apiObject.Type), } - if apiObject.DeleteStepDetails != nil { - flattenedObject["delete_step_details"] = flattenDeleteStepDetails(apiObject.DeleteStepDetails) - } - if apiObject.DeleteStepDetails != nil { flattenedObject["copy_step_details"] = flattenCopyStepDetails(apiObject.CopyStepDetails) } @@ -616,6 +692,14 @@ func flattenWorkflows(apiObjects []*transfer.WorkflowStep) []interface{} { flattenedObject["custom_step_details"] = flattenCustomStepDetails(apiObject.CustomStepDetails) } + if apiObject.DecryptStepDetails != nil { + flattenedObject["decrypt_step_details"] = flattenDecryptStepDetails(apiObject.DecryptStepDetails) + } + + if apiObject.DeleteStepDetails != nil { + flattenedObject["delete_step_details"] = flattenDeleteStepDetails(apiObject.DeleteStepDetails) + } + if apiObject.TagStepDetails != nil { flattenedObject["tag_step_details"] = flattenTagStepDetails(apiObject.TagStepDetails) } @@ -626,27 +710,35 @@ func flattenWorkflows(apiObjects []*transfer.WorkflowStep) []interface{} { return tfList } -func expandDeleteStepDetails(tfMap []interface{}) *transfer.DeleteStepDetails { +func expandCopyStepDetails(tfMap []interface{}) *transfer.CopyStepDetails { if tfMap == nil { return nil } tfMapRaw := tfMap[0].(map[string]interface{}) - apiObject := &transfer.DeleteStepDetails{} + apiObject := &transfer.CopyStepDetails{} if v, ok := tfMapRaw["name"].(string); ok && v != "" { apiObject.Name = aws.String(v) } + if v, ok := tfMapRaw["overwrite_existing"].(string); ok && v != "" { + apiObject.OverwriteExisting = aws.String(v) + } + if v, ok := tfMapRaw["source_file_location"].(string); ok && v != "" { apiObject.SourceFileLocation = aws.String(v) } + if v, ok := tfMapRaw["destination_file_location"].([]interface{}); ok && len(v) > 0 { + apiObject.DestinationFileLocation = expandDestinationFileLocation(v) + } + return apiObject } -func flattenDeleteStepDetails(apiObject *transfer.DeleteStepDetails) []interface{} { +func flattenCopyStepDetails(apiObject *transfer.CopyStepDetails) []interface{} { if apiObject == nil { return nil } @@ -657,21 +749,83 @@ func flattenDeleteStepDetails(apiObject *transfer.DeleteStepDetails) []interface tfMap["name"] = aws.StringValue(v) } + if v := apiObject.OverwriteExisting; v != nil { + tfMap["overwrite_existing"] = aws.StringValue(v) + } + if v := apiObject.SourceFileLocation; v != nil { tfMap["source_file_location"] = aws.StringValue(v) } + if v := apiObject.DestinationFileLocation; v != nil { + tfMap["destination_file_location"] = flattenDestinationFileLocation(v) + } + return []interface{}{tfMap} } -func expandCopyStepDetails(tfMap []interface{}) *transfer.CopyStepDetails { +func expandCustomStepDetails(tfMap []interface{}) *transfer.CustomStepDetails { if tfMap == nil { return nil } tfMapRaw := tfMap[0].(map[string]interface{}) - apiObject := &transfer.CopyStepDetails{} + apiObject := &transfer.CustomStepDetails{} + + if v, ok := tfMapRaw["name"].(string); ok && v != "" { + apiObject.Name = aws.String(v) + } + + if v, ok := tfMapRaw["source_file_location"].(string); ok && v != "" { + apiObject.SourceFileLocation = aws.String(v) + } + + if v, ok := tfMapRaw["target"].(string); ok && v != "" { + apiObject.Target = aws.String(v) + } + + if v, ok := tfMapRaw["timeout_seconds"].(int); ok && v > 0 { + apiObject.TimeoutSeconds = aws.Int64(int64(v)) + } + + return apiObject +} + +func flattenCustomStepDetails(apiObject *transfer.CustomStepDetails) []interface{} { + if apiObject == nil { + return nil + } + + tfMap := map[string]interface{}{} + + if v := apiObject.Name; v != nil { + tfMap["name"] = aws.StringValue(v) + } + + if v := apiObject.SourceFileLocation; v != nil { + tfMap["source_file_location"] = aws.StringValue(v) + } + + if v := apiObject.Target; v != nil { + tfMap["target"] = aws.StringValue(v) + } + + if v := apiObject.TimeoutSeconds; v != nil { + tfMap["timeout_seconds"] = aws.Int64Value(v) + } + + return []interface{}{tfMap} +} + +func expandDecryptStepDetails(tfMap []interface{}) *transfer.DecryptStepDetails { + if tfMap == nil { + return nil + } + + tfMapRaw := tfMap[0].(map[string]interface{}) + + apiObject := &transfer.DecryptStepDetails{} if v, ok := tfMapRaw["name"].(string); ok && v != "" { apiObject.Name = aws.String(v) @@ -692,7 +846,7 @@ func expandCopyStepDetails(tfMap []interface{}) *transfer.CopyStepDetails { return apiObject } -func flattenCopyStepDetails(apiObject *transfer.CopyStepDetails) []interface{} { +func flattenDecryptStepDetails(apiObject *transfer.DecryptStepDetails) []interface{} { if apiObject == nil { return nil } @@ -718,14 +872,14 @@ func flattenCopyStepDetails(apiObject *transfer.CopyStepDetails) []interface{} { return []interface{}{tfMap} } -func expandCustomStepDetails(tfMap []interface{}) *transfer.CustomStepDetails { +func expandDeleteStepDetails(tfMap []interface{}) *transfer.DeleteStepDetails { if tfMap == nil { return nil } tfMapRaw := tfMap[0].(map[string]interface{}) - apiObject := &transfer.CustomStepDetails{} + apiObject := &transfer.DeleteStepDetails{} if v, ok := tfMapRaw["name"].(string); ok && v != "" { apiObject.Name = aws.String(v) @@ -735,18 +889,10 @@ func expandCustomStepDetails(tfMap []interface{}) *transfer.CustomStepDetails { apiObject.SourceFileLocation = aws.String(v) } - if v, ok := tfMapRaw["target"].(string); ok && v != "" { - apiObject.Target = aws.String(v) - } - - if v, ok := tfMapRaw["timeout_seconds"].(int); ok && v > 0 { - apiObject.TimeoutSeconds = aws.Int64(int64(v)) - } - return apiObject } -func flattenCustomStepDetails(apiObject *transfer.CustomStepDetails) []interface{} { +func flattenDeleteStepDetails(apiObject *transfer.DeleteStepDetails) []interface{} { if apiObject == nil { return nil } @@ -761,14 +907,6 @@ func flattenCustomStepDetails(apiObject *transfer.CustomStepDetails) []interface tfMap["source_file_location"] = aws.StringValue(v) } - if v := apiObject.Target; v != nil { - tfMap["target"] = aws.StringValue(v) - } - - if v := apiObject.TimeoutSeconds; v != nil { - tfMap["timeout_seconds"] = aws.Int64Value(v) - } - return []interface{}{tfMap} } From 8f1b1fc012930de4a40db4d5579a928f18ff6128 Mon Sep 17 00:00:00 2001 From: Benny Lu Date: Mon, 27 Feb 2023 16:17:33 -0800 Subject: [PATCH 368/763] changelog --- .changelog/29692.txt | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 .changelog/29692.txt diff --git a/.changelog/29692.txt b/.changelog/29692.txt new file mode 100644 index 000000000000..92276d43a5d0 --- /dev/null +++ b/.changelog/29692.txt @@ -0,0 +1,3 @@ +```release-note:enhancement +resource/aws_transfer_workflow: Add `decrypt_step_details` to the `steps` for `DECRYPT` type +``` From a4b0b54a4c1c338c387b29f1a8bab3b904abb855 Mon Sep 17 00:00:00 2001 From: Benny Lu Date: Mon, 27 Feb 2023 16:19:36 -0800 Subject: [PATCH 369/763] docs --- website/docs/r/transfer_workflow.html.markdown | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/website/docs/r/transfer_workflow.html.markdown b/website/docs/r/transfer_workflow.html.markdown index b61ad55204e0..0cfcfe5a6617 100644 --- a/website/docs/r/transfer_workflow.html.markdown +++ b/website/docs/r/transfer_workflow.html.markdown @@ -67,9 +67,10 @@ The following arguments are supported: * `copy_step_details` - (Optional) Details for a step that performs a file copy. See Copy Step Details below. * `custom_step_details` - (Optional) Details for a step that invokes a lambda function. +* `decrypt_step_details` - (Optional) Details for a step that decrypts the file. * `delete_step_details` - (Optional) Details for a step that deletes the file. * `tag_step_details` - (Optional) Details for a step that creates one or more tags. -* `type` - (Required) One of the following step types are supported. `COPY`, `CUSTOM`, `DELETE`, and `TAG`. +* `type` - (Required) One of the following step types are supported. `COPY`, `CUSTOM`, `DECRYPT`, `DELETE`, and `TAG`. #### Copy Step Details @@ -85,6 +86,13 @@ The following arguments are supported: * `target` - (Optional) The ARN for the lambda function that is being called. * `timeout_seconds` - (Optional) Timeout, in seconds, for the step. +#### Decrypt Step Details + +* `destination_file_location` - (Optional) Specifies the location for the file being copied. Use ${Transfer:username} in this field to parametrize the destination prefix by username. +* `name` - (Optional) The name of the step, used as an identifier. +* `overwrite_existing` - (Optional) A flag that indicates whether or not to overwrite an existing file of the same name. The default is `FALSE`. Valid values are `TRUE` and `FALSE`. +* `source_file_location` - (Optional) Specifies which file to use as input to the workflow step: either the output from the previous step, or the originally uploaded file for the workflow. Enter ${previous.file} to use the previous file as the input. In this case, this workflow step uses the output file from the previous workflow step as input. This is the default value. Enter ${original.file} to use the originally-uploaded file location as input for this step. + #### Delete Step Details * `name` - (Optional) The name of the step, used as an identifier. From 33ab4884aa83f3f027969e58db1a7f28b0a6caef Mon Sep 17 00:00:00 2001 From: Benny Lu Date: Mon, 27 Feb 2023 16:26:36 -0800 Subject: [PATCH 370/763] update --- .changelog/29692.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.changelog/29692.txt b/.changelog/29692.txt index 92276d43a5d0..eec491d68482 100644 --- a/.changelog/29692.txt +++ b/.changelog/29692.txt @@ -1,3 +1,3 @@ ```release-note:enhancement -resource/aws_transfer_workflow: Add `decrypt_step_details` to the `steps` for `DECRYPT` type +resource/aws_transfer_workflow: Add `decrypt_step_details` to the `steps` configuration block for `DECRYPT` type ``` From eacac5781b5e7bc8cbdbc1c58a84a2e4ee4c4c59 Mon Sep 17 00:00:00 2001 From: Filip Zjalic <118170660+zjalicf-cyberlab@users.noreply.github.com> Date: Wed, 1 Mar 2023 10:17:11 +0100 Subject: [PATCH 371/763] adding apigatewayv2 and error handling --- internal/conns/config.go | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/internal/conns/config.go b/internal/conns/config.go index 89ce54fc36ed..f4d5f7b07c7e 100644 --- a/internal/conns/config.go +++ b/internal/conns/config.go @@ -11,6 +11,7 @@ import ( "github.com/aws/aws-sdk-go/aws/endpoints" "github.com/aws/aws-sdk-go/aws/request" "github.com/aws/aws-sdk-go/service/apigateway" + "github.com/aws/aws-sdk-go/service/apigatewayv2" "github.com/aws/aws-sdk-go/service/appconfig" "github.com/aws/aws-sdk-go/service/applicationautoscaling" "github.com/aws/aws-sdk-go/service/appsync" @@ -266,6 +267,16 @@ func (c *Config) ConfigureProvider(ctx context.Context, client *AWSClient) (*AWS r.Retryable = aws.Bool(true) } }) + + //Potential fix for https://github.com/hashicorp/terraform-provider-aws/issues/18018 + client.apigatewayv2Conn.Handlers.Retry.PushBack(func(r *request.Request) { + // Many operations can return an error such as: + // ConflictException: Unable to complete operation due to concurrent modification. Please try again later. + // Handle them all globally for the service client. + if tfawserr.ErrMessageContains(r.Error, apigatewayv2.ErrCodeConflictException, "try again later") { + r.Retryable = aws.Bool(true) + } + }) // Workaround for https://github.com/aws/aws-sdk-go/issues/1472 client.applicationautoscalingConn.Handlers.Retry.PushBack(func(r *request.Request) { From 8fc35f0446b647b4b78d808c235f4dbe1f3f234a Mon Sep 17 00:00:00 2001 From: Filip Zjalic <118170660+zjalicf-cyberlab@users.noreply.github.com> Date: Wed, 1 Mar 2023 10:58:06 +0100 Subject: [PATCH 372/763] Create 29735.txt --- .changelog/29735.txt | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 .changelog/29735.txt diff --git a/.changelog/29735.txt b/.changelog/29735.txt new file mode 100644 index 000000000000..d2a9223f1236 --- /dev/null +++ b/.changelog/29735.txt @@ -0,0 +1,3 @@ +```release-note:bug +resource/aws_apigatewayv2_integration: Fix ConflictException: Unable to complete operation due to concurrent modification. +``` From efc8600568f54cb61a6fa2a9db0fb420da3d75a7 Mon Sep 17 00:00:00 2001 From: Albert Silva Date: Wed, 1 Mar 2023 07:48:10 -0500 Subject: [PATCH 373/763] update resource for self-registration --- .ci/.semgrep-service-name0.yml | 15 ++++ .ci/.semgrep-service-name1.yml | 73 +++++++++++-------- .ci/.semgrep-service-name2.yml | 43 +++++++---- .ci/.semgrep-service-name3.yml | 14 ---- .../repository_association.go | 1 + .../codegurureviewer/service_package_gen.go | 4 +- 6 files changed, 92 insertions(+), 58 deletions(-) diff --git a/.ci/.semgrep-service-name0.yml b/.ci/.semgrep-service-name0.yml index 4aed7d51792e..bad6833f6291 100644 --- a/.ci/.semgrep-service-name0.yml +++ b/.ci/.semgrep-service-name0.yml @@ -3231,3 +3231,18 @@ 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 163c352f6717..bc3b92402a5a 100644 --- a/.ci/.semgrep-service-name1.yml +++ b/.ci/.semgrep-service-name1.yml @@ -1,5 +1,49 @@ # Generated by internal/generate/servicesemgrep/main.go; DO NOT EDIT. rules: + - id: configservice-in-const-name + languages: + - go + message: Do not use "ConfigService" in const name inside configservice package + paths: + include: + - internal/service/configservice + patterns: + - pattern: const $NAME = ... + - metavariable-pattern: + metavariable: $NAME + patterns: + - pattern-regex: "(?i)ConfigService" + severity: WARNING + - id: configservice-in-var-name + languages: + - go + message: Do not use "ConfigService" in var name inside configservice package + paths: + include: + - internal/service/configservice + patterns: + - pattern: var $NAME = ... + - metavariable-pattern: + metavariable: $NAME + patterns: + - pattern-regex: "(?i)ConfigService" + severity: WARNING + - id: connect-in-func-name + languages: + - go + message: Do not use "Connect" in func name inside connect package + paths: + include: + - internal/service/connect + patterns: + - pattern: func $NAME( ... ) { ... } + - metavariable-pattern: + metavariable: $NAME + patterns: + - pattern-regex: "(?i)Connect" + - pattern-not-regex: .*uickConnect.* + - pattern-not-regex: ^TestAcc.* + severity: WARNING - id: connect-in-test-name languages: - go @@ -3190,32 +3234,3 @@ rules: patterns: - pattern-regex: "(?i)Inspector2" severity: WARNING - - id: inspector2-in-var-name - languages: - - go - message: Do not use "Inspector2" in var name inside inspector2 package - paths: - include: - - internal/service/inspector2 - patterns: - - pattern: var $NAME = ... - - metavariable-pattern: - metavariable: $NAME - patterns: - - pattern-regex: "(?i)Inspector2" - severity: WARNING - - id: inspectorv2-in-func-name - languages: - - go - message: Do not use "inspectorv2" in func name inside inspector2 package - paths: - include: - - internal/service/inspector2 - patterns: - - pattern: func $NAME( ... ) { ... } - - metavariable-pattern: - metavariable: $NAME - patterns: - - pattern-regex: "(?i)inspectorv2" - - pattern-not-regex: ^TestAcc.* - severity: WARNING diff --git a/.ci/.semgrep-service-name2.yml b/.ci/.semgrep-service-name2.yml index 33afded15564..57b2e087ff5c 100644 --- a/.ci/.semgrep-service-name2.yml +++ b/.ci/.semgrep-service-name2.yml @@ -1,5 +1,34 @@ # Generated by internal/generate/servicesemgrep/main.go; DO NOT EDIT. rules: + - id: inspector2-in-var-name + languages: + - go + message: Do not use "Inspector2" in var name inside inspector2 package + paths: + include: + - internal/service/inspector2 + patterns: + - pattern: var $NAME = ... + - metavariable-pattern: + metavariable: $NAME + patterns: + - pattern-regex: "(?i)Inspector2" + severity: WARNING + - id: inspectorv2-in-func-name + languages: + - go + message: Do not use "inspectorv2" in func name inside inspector2 package + paths: + include: + - internal/service/inspector2 + patterns: + - pattern: func $NAME( ... ) { ... } + - metavariable-pattern: + metavariable: $NAME + patterns: + - pattern-regex: "(?i)inspectorv2" + - pattern-not-regex: ^TestAcc.* + severity: WARNING - id: inspectorv2-in-const-name languages: - go @@ -3201,17 +3230,3 @@ rules: patterns: - pattern-regex: "(?i)RDS" severity: WARNING - - id: rds-in-var-name - languages: - - go - message: Do not use "RDS" in var name inside rds package - paths: - include: - - internal/service/rds - patterns: - - pattern: var $NAME = ... - - metavariable-pattern: - metavariable: $NAME - patterns: - - pattern-regex: "(?i)RDS" - severity: WARNING diff --git a/.ci/.semgrep-service-name3.yml b/.ci/.semgrep-service-name3.yml index 5c6daecba199..a8da3978a5da 100644 --- a/.ci/.semgrep-service-name3.yml +++ b/.ci/.semgrep-service-name3.yml @@ -1,19 +1,5 @@ # Generated by internal/generate/servicesemgrep/main.go; DO NOT EDIT. rules: - - id: rds-in-const-name - languages: - - go - message: Do not use "RDS" in const name inside rds package - paths: - include: - - internal/service/rds - patterns: - - pattern: const $NAME = ... - - metavariable-pattern: - metavariable: $NAME - patterns: - - pattern-regex: "(?i)RDS" - severity: WARNING - id: rds-in-var-name languages: - go diff --git a/internal/service/codegurureviewer/repository_association.go b/internal/service/codegurureviewer/repository_association.go index 640c2dbac37d..68d3301b31ab 100644 --- a/internal/service/codegurureviewer/repository_association.go +++ b/internal/service/codegurureviewer/repository_association.go @@ -24,6 +24,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/names" ) +// @SDKResource("aws_codegurureviewer_repository_association") func ResourceRepositoryAssociation() *schema.Resource { return &schema.Resource{ diff --git a/internal/service/codegurureviewer/service_package_gen.go b/internal/service/codegurureviewer/service_package_gen.go index 208c78d4dc17..9c878e786984 100644 --- a/internal/service/codegurureviewer/service_package_gen.go +++ b/internal/service/codegurureviewer/service_package_gen.go @@ -26,7 +26,9 @@ func (p *servicePackage) SDKDataSources(ctx context.Context) map[string]func() * } func (p *servicePackage) SDKResources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{} + return map[string]func() *schema.Resource{ + "aws_codegurureviewer_repository_association": ResourceRepositoryAssociation, + } } func (p *servicePackage) ServicePackageName() string { From 4850000b019586555377bb15b38b31eebf06316d Mon Sep 17 00:00:00 2001 From: Brittan DeYoung <32572259+brittandeyoung@users.noreply.github.com> Date: Wed, 1 Mar 2023 09:24:49 -0500 Subject: [PATCH 374/763] licensemanager: Add grant --- internal/service/licensemanager/grant.go | 232 +++++++++++++++++++++++ 1 file changed, 232 insertions(+) create mode 100644 internal/service/licensemanager/grant.go diff --git a/internal/service/licensemanager/grant.go b/internal/service/licensemanager/grant.go new file mode 100644 index 000000000000..79a74c3bee2c --- /dev/null +++ b/internal/service/licensemanager/grant.go @@ -0,0 +1,232 @@ +package licensemanager + +import ( + "context" + + "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/service/licensemanager" + "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/validation" + "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/create" + "github.com/hashicorp/terraform-provider-aws/internal/tfresource" + "github.com/hashicorp/terraform-provider-aws/internal/verify" + "github.com/hashicorp/terraform-provider-aws/names" +) + +const ( + ResGrant = "Grant" +) + +func ResourceGrant() *schema.Resource { + return &schema.Resource{ + CreateWithoutTimeout: resourceGrantCreate, + ReadWithoutTimeout: resourceGrantRead, + UpdateWithoutTimeout: resourceGrantUpdate, + DeleteWithoutTimeout: resourceGrantDelete, + + Importer: &schema.ResourceImporter{ + StateContext: schema.ImportStatePassthroughContext, + }, + + Schema: map[string]*schema.Schema{ + "allowed_operations": { + Type: schema.TypeSet, + Required: true, + MinItems: 1, + MaxItems: len(licensemanager.AllowedOperation_Values()), + Elem: &schema.Schema{ + Type: schema.TypeString, + ValidateFunc: validation.StringInSlice(licensemanager.AllowedOperation_Values(), true), + }, + Description: "Allowed operations for the grant.", + }, + "arn": { + Type: schema.TypeString, + Computed: true, + Description: "Amazon Resource Name (ARN) of the grant.", + }, + "home_region": { + Type: schema.TypeString, + Required: true, + ForceNew: true, + Description: "Home Region of the grant.", + }, + "license_arn": { + Type: schema.TypeString, + Required: true, + ForceNew: true, + ValidateFunc: verify.ValidARN, + Description: "License ARN.", + }, + "name": { + Type: schema.TypeString, + Required: true, + Description: "Name of the grant.", + }, + "parent_arn": { + Type: schema.TypeString, + Computed: true, + Description: "Parent ARN.", + }, + "principal": { + Type: schema.TypeString, + Required: true, + ForceNew: true, + ValidateFunc: verify.ValidARN, + Description: "The grantee principal ARN.", + }, + "status": { + Type: schema.TypeString, + Computed: true, + Description: "Grant status.", + }, + "version": { + Type: schema.TypeString, + Computed: true, + Description: "Grant version.", + }, + }, + } +} + +func resourceGrantCreate(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { + conn := meta.(*conns.AWSClient).LicenseManagerConn() + + in := &licensemanager.CreateGrantInput{ + AllowedOperations: aws.StringSlice(expandAllowedOperations(d.Get("allowed_operations").(*schema.Set).List())), + ClientToken: aws.String(resource.UniqueId()), + GrantName: aws.String(d.Get("name").(string)), + HomeRegion: aws.String(d.Get("home_region").(string)), + LicenseArn: aws.String(d.Get("license_arn").(string)), + Principals: aws.StringSlice([]string{d.Get("principal").(string)}), + } + + out, err := conn.CreateGrantWithContext(ctx, in) + + if err != nil { + return create.DiagError(names.LicenseManager, create.ErrActionCreating, ResGrant, d.Get("name").(string), err) + } + + d.SetId(*out.GrantArn) + + return resourceGrantRead(ctx, d, meta) +} + +func resourceGrantRead(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { + conn := meta.(*conns.AWSClient).LicenseManagerConn() + + out, err := FindGrantByARN(ctx, conn, d.Id()) + + if !d.IsNewResource() && tfresource.NotFound(err) { + create.LogNotFoundRemoveState(names.LicenseManager, create.ErrActionReading, ResGrant, d.Id()) + d.SetId("") + return nil + } + + if err != nil { + return create.DiagError(names.LicenseManager, create.ErrActionReading, ResGrant, d.Id(), err) + } + + d.Set("allowed_operations", out.GrantedOperations) + d.Set("arn", out.GrantArn) + d.Set("home_region", out.HomeRegion) + d.Set("license_arn", out.LicenseArn) + d.Set("name", out.GrantName) + d.Set("parent_arn", out.ParentArn) + d.Set("principal", out.GranteePrincipalArn) + d.Set("status", out.GrantStatus) + d.Set("version", out.Version) + + return nil +} + +func resourceGrantUpdate(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { + conn := meta.(*conns.AWSClient).LicenseManagerConn() + + in := &licensemanager.CreateGrantVersionInput{ + GrantArn: aws.String(d.Id()), + ClientToken: aws.String(resource.UniqueId()), + } + + if d.HasChange("allowed_operations") { + in.AllowedOperations = aws.StringSlice(d.Get("allowed_operations").([]string)) + } + + if d.HasChange("name") { + in.GrantName = aws.String(d.Get("name").(string)) + } + + _, err := conn.CreateGrantVersionWithContext(ctx, in) + + if err != nil { + return create.DiagError(names.LicenseManager, create.ErrActionUpdating, ResGrant, d.Id(), err) + } + + return resourceGrantRead(ctx, d, meta) +} + +func resourceGrantDelete(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { + conn := meta.(*conns.AWSClient).LicenseManagerConn() + + out, err := FindGrantByARN(ctx, conn, d.Id()) + + if err != nil { + return create.DiagError(names.LicenseManager, create.ErrActionReading, ResGrant, d.Id(), err) + } + + in := &licensemanager.DeleteGrantInput{ + GrantArn: aws.String(d.Id()), + Version: aws.String(*out.Version), + } + + _, err = conn.DeleteGrantWithContext(ctx, in) + + if err != nil { + return create.DiagError(names.LicenseManager, create.ErrActionDeleting, ResGrant, d.Id(), err) + } + + return nil +} + +func FindGrantByARN(ctx context.Context, conn *licensemanager.LicenseManager, id string) (*licensemanager.Grant, error) { + in := &licensemanager.GetGrantInput{ + GrantArn: aws.String(id), + } + + out, err := conn.GetGrantWithContext(ctx, in) + + if tfawserr.ErrCodeEquals(err, licensemanager.ErrCodeResourceNotFoundException) { + return nil, &resource.NotFoundError{ + LastError: err, + LastRequest: in, + } + } + + if err != nil { + return nil, err + } + + if out == nil || out.Grant == nil || aws.StringValue(out.Grant.GrantStatus) == licensemanager.GrantStatusDeleted { + return nil, tfresource.NewEmptyResultError(in) + } + + return out.Grant, nil +} + +func expandAllowedOperations(rawOperations []interface{}) []string { + if rawOperations == nil { + return nil + } + + operations := make([]string, 0, 8) + + for _, item := range rawOperations { + operations = append(operations, item.(string)) + } + + return operations +} From 967f68eac4fb1ee6788bbb9761fcb998838856ee Mon Sep 17 00:00:00 2001 From: Brittan DeYoung <32572259+brittandeyoung@users.noreply.github.com> Date: Wed, 1 Mar 2023 09:25:01 -0500 Subject: [PATCH 375/763] licensemanager: Add grant_test --- internal/service/licensemanager/grant_test.go | 241 ++++++++++++++++++ 1 file changed, 241 insertions(+) create mode 100644 internal/service/licensemanager/grant_test.go diff --git a/internal/service/licensemanager/grant_test.go b/internal/service/licensemanager/grant_test.go new file mode 100644 index 000000000000..89452df5ea3c --- /dev/null +++ b/internal/service/licensemanager/grant_test.go @@ -0,0 +1,241 @@ +package licensemanager_test + +import ( + "context" + "fmt" + "os" + "regexp" + "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" + "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" + "github.com/hashicorp/terraform-provider-aws/internal/tfresource" +) + +func TestAccLicenseManagerGrant_serial(t *testing.T) { + t.Parallel() + + testCases := map[string]map[string]func(t *testing.T){ + "grant": { + "basic": testAccLicenseManagerGrant_basic, + "disappears": testAccLicenseManagerGrant_disappears, + "name": testAccLicenseManagerGrant_name, + }, + } + + acctest.RunSerialTests2Levels(t, testCases, 0) +} + +func testAccLicenseManagerGrant_basic(t *testing.T) { + ctx := acctest.Context(t) + principalKey := "LICENSE_MANAGER_GRANT_PRINCIPAL" + licenseKey := "LICENSE_MANAGER_GRANT_LICENSE_ARN" + homeRegionKey := "LICENSE_MANAGER_GRANT_HOME_REGION" + principal := os.Getenv(principalKey) + if principal == "" { + t.Skipf("Environment variable %s is not set to true", principalKey) + } + licenseArn := os.Getenv(licenseKey) + if licenseArn == "" { + t.Skipf("Environment variable %s is not set to true", licenseKey) + } + homeRegion := os.Getenv(homeRegionKey) + if homeRegion == "" { + t.Skipf("Environment variable %s is not set to true", homeRegionKey) + } + rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) + resourceName := "aws_licensemanager_grant.test" + + resource.Test(t, resource.TestCase{ + PreCheck: func() { acctest.PreCheck(t) }, + ErrorCheck: acctest.ErrorCheck(t, licensemanager.EndpointsID), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + CheckDestroy: testAccCheckGrantDestroy(ctx), + Steps: []resource.TestStep{ + { + Config: testAccGrantConfig_basic(rName, licenseArn, principal, homeRegion), + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheckGrantExists(ctx, resourceName), + acctest.MatchResourceAttrGlobalARN(resourceName, "arn", "license-manager", regexp.MustCompile(`grant:g-.+`)), + resource.TestCheckTypeSetElemAttr(resourceName, "allowed_operations.*", "ListPurchasedLicenses"), + resource.TestCheckTypeSetElemAttr(resourceName, "allowed_operations.*", "CheckoutLicense"), + resource.TestCheckTypeSetElemAttr(resourceName, "allowed_operations.*", "CheckInLicense"), + resource.TestCheckTypeSetElemAttr(resourceName, "allowed_operations.*", "ExtendConsumptionLicense"), + resource.TestCheckTypeSetElemAttr(resourceName, "allowed_operations.*", "CreateToken"), + resource.TestCheckResourceAttr(resourceName, "home_region", "us-east-1"), + resource.TestCheckResourceAttr(resourceName, "license_arn", "arn:aws:license-manager::294406891311:license:l-ecbaa94eb71a4830b6d7e49268fecaa0"), + resource.TestCheckResourceAttr(resourceName, "name", rName), + resource.TestCheckResourceAttrSet(resourceName, "parent_arn"), + resource.TestCheckResourceAttr(resourceName, "principal", "arn:aws:iam::067863992282:root"), + resource.TestCheckResourceAttrSet(resourceName, "status"), + resource.TestCheckResourceAttr(resourceName, "version", "1"), + ), + }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, + }, + }) +} + +func testAccLicenseManagerGrant_disappears(t *testing.T) { + ctx := acctest.Context(t) + principalKey := "LICENSE_MANAGER_GRANT_PRINCIPAL" + licenseKey := "LICENSE_MANAGER_GRANT_LICENSE_ARN" + homeRegionKey := "LICENSE_MANAGER_GRANT_HOME_REGION" + principal := os.Getenv(principalKey) + if principal == "" { + t.Skipf("Environment variable %s is not set to true", principalKey) + } + licenseArn := os.Getenv(licenseKey) + if licenseArn == "" { + t.Skipf("Environment variable %s is not set to true", licenseKey) + } + homeRegion := os.Getenv(homeRegionKey) + if homeRegion == "" { + t.Skipf("Environment variable %s is not set to true", homeRegionKey) + } + rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) + resourceName := "aws_licensemanager_grant.test" + + resource.Test(t, resource.TestCase{ + PreCheck: func() { acctest.PreCheck(t) }, + ErrorCheck: acctest.ErrorCheck(t, licensemanager.EndpointsID), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + CheckDestroy: testAccCheckGrantDestroy(ctx), + Steps: []resource.TestStep{ + { + Config: testAccGrantConfig_basic(rName, licenseArn, principal, homeRegion), + Check: resource.ComposeTestCheckFunc( + testAccCheckGrantExists(ctx, resourceName), + acctest.CheckResourceDisappears(ctx, acctest.Provider, tflicensemanager.ResourceGrant(), resourceName), + ), + ExpectNonEmptyPlan: true, + }, + }, + }) +} + +func testAccLicenseManagerGrant_name(t *testing.T) { + ctx := acctest.Context(t) + principalKey := "LICENSE_MANAGER_GRANT_PRINCIPAL" + licenseKey := "LICENSE_MANAGER_GRANT_LICENSE_ARN" + homeRegionKey := "LICENSE_MANAGER_GRANT_HOME_REGION" + principal := os.Getenv(principalKey) + if principal == "" { + t.Skipf("Environment variable %s is not set to true", principalKey) + } + licenseArn := os.Getenv(licenseKey) + if licenseArn == "" { + t.Skipf("Environment variable %s is not set to true", licenseKey) + } + homeRegion := os.Getenv(homeRegionKey) + if homeRegion == "" { + t.Skipf("Environment variable %s is not set to true", homeRegionKey) + } + rName1 := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) + rName2 := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) + resourceName := "aws_licensemanager_grant.test" + + resource.Test(t, resource.TestCase{ + PreCheck: func() { acctest.PreCheck(t) }, + ErrorCheck: acctest.ErrorCheck(t, licensemanager.EndpointsID), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + CheckDestroy: testAccCheckGrantDestroy(ctx), + Steps: []resource.TestStep{ + { + Config: testAccGrantConfig_basic(rName1, licenseArn, principal, homeRegion), + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheckGrantExists(ctx, resourceName), + resource.TestCheckResourceAttr(resourceName, "name", rName1), + ), + }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, + { + Config: testAccGrantConfig_basic(rName2, licenseArn, principal, homeRegion), + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheckGrantExists(ctx, resourceName), + resource.TestCheckResourceAttr(resourceName, "name", rName2), + ), + }, + }, + }) +} + +func testAccCheckGrantExists(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 License Manager License Configuration ID is set") + } + + conn := acctest.Provider.Meta().(*conns.AWSClient).LicenseManagerConn() + + _, err := tflicensemanager.FindGrantByARN(ctx, conn, rs.Primary.ID) + + if err != nil { + return err + } + + return nil + } +} + +func testAccCheckGrantDestroy(ctx context.Context) resource.TestCheckFunc { + return func(s *terraform.State) error { + conn := acctest.Provider.Meta().(*conns.AWSClient).LicenseManagerConn() + + for _, rs := range s.RootModule().Resources { + if rs.Type != "aws_licensemanager_grant" { + continue + } + + _, err := tflicensemanager.FindGrantByARN(ctx, conn, rs.Primary.ID) + + if tfresource.NotFound(err) { + continue + } + + if err != nil { + return err + } + + return fmt.Errorf("License Manager Grant %s still exists", rs.Primary.ID) + } + + return nil + } +} + +func testAccGrantConfig_basic(rName string, licenseArn string, principal string, homeRegion string) string { + return fmt.Sprintf(` +resource "aws_licensemanager_grant" "test" { + name = %[1]q + allowed_operations = [ + "ListPurchasedLicenses", + "CheckoutLicense", + "CheckInLicense", + "ExtendConsumptionLicense", + "CreateToken" + ] + license_arn = %[2]q + principal = %[3]q + home_region = %[4]q +} +`, rName, licenseArn, principal, homeRegion) +} From 4bb06ad76517d7a2ecbf8bc552bbd6a3a2051f26 Mon Sep 17 00:00:00 2001 From: Brittan DeYoung <32572259+brittandeyoung@users.noreply.github.com> Date: Wed, 1 Mar 2023 09:58:08 -0500 Subject: [PATCH 376/763] licensemanager: Amend service_package_gen, add aws_licensemanager_grant --- internal/service/licensemanager/grant.go | 1 + internal/service/licensemanager/service_package_gen.go | 1 + 2 files changed, 2 insertions(+) diff --git a/internal/service/licensemanager/grant.go b/internal/service/licensemanager/grant.go index 79a74c3bee2c..6f442917c980 100644 --- a/internal/service/licensemanager/grant.go +++ b/internal/service/licensemanager/grant.go @@ -21,6 +21,7 @@ const ( ResGrant = "Grant" ) +// @SDKResource("aws_licensemanager_grant") func ResourceGrant() *schema.Resource { return &schema.Resource{ CreateWithoutTimeout: resourceGrantCreate, diff --git a/internal/service/licensemanager/service_package_gen.go b/internal/service/licensemanager/service_package_gen.go index 5dac227cfbc0..b75ae1c22559 100644 --- a/internal/service/licensemanager/service_package_gen.go +++ b/internal/service/licensemanager/service_package_gen.go @@ -28,6 +28,7 @@ func (p *servicePackage) SDKDataSources(ctx context.Context) map[string]func() * func (p *servicePackage) SDKResources(ctx context.Context) map[string]func() *schema.Resource { return map[string]func() *schema.Resource{ "aws_licensemanager_association": ResourceAssociation, + "aws_licensemanager_grant": ResourceGrant, "aws_licensemanager_license_configuration": ResourceLicenseConfiguration, } } From b1f2b1b2d91b614f3af238a7e00e65bb7cc070df Mon Sep 17 00:00:00 2001 From: Brittan DeYoung <32572259+brittandeyoung@users.noreply.github.com> Date: Wed, 1 Mar 2023 09:58:29 -0500 Subject: [PATCH 377/763] website: Add licensemanager_grant --- .../docs/r/licensemanager_grant.html.markdown | 57 +++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 website/docs/r/licensemanager_grant.html.markdown diff --git a/website/docs/r/licensemanager_grant.html.markdown b/website/docs/r/licensemanager_grant.html.markdown new file mode 100644 index 000000000000..a12e7ee44e4c --- /dev/null +++ b/website/docs/r/licensemanager_grant.html.markdown @@ -0,0 +1,57 @@ +--- +subcategory: "License Manager" +layout: "aws" +page_title: "AWS: aws_licensemanager_grant" +description: |- + Provides a License Manager grant resource. +--- + +# Resource: aws_licensemanager_grant + +Provides a License Manager grant. This allows for sharing licenses with other aws accounts. + +## Example Usage + +```terraform +resource "aws_licensemanager_grant" "test" { + name = "share-license-with-account" + allowed_operations = [ + "ListPurchasedLicenses", + "CheckoutLicense", + "CheckInLicense", + "ExtendConsumptionLicense", + "CreateToken" + ] + license_arn = "arn:aws:license-manager::111111111111:license:l-exampleARN" + principal = "arn:aws:iam::111111111112:root" + home_region = "us-east-1" +} +``` + +## Argument Reference + +The following arguments are supported: + +* `name` - (Required) The Name of the grant. +* `allowed_operations` - (Required) A list of the allowed operations for the grant. +* `license_arn` - (Required) The ARN of the license to grant. +* `principal` - (Required) The target account for the grant. +* `home_region` - (Required) The home region for the license. + +## Attributes Reference + +In addition to all arguments above, the following attributes are exported: + +* `id` - The grant ARN (Same as `arn`). +* `arn` - The grant ARN. +* `parent_arn` - The parent ARN. +* `status` - The grant status. +* `version` - The grant version. + +## Import + +`aws_licensemanager_grant` can be imported using the grant arn. + +```shell +$ terraform import aws_licensemanager_grant.test arn:aws:license-manager::123456789011:grant:g-01d313393d9e443d8664cc054db1e089 +``` From 6045312a9638bbbe190f43fffcaa8a0079d9856d Mon Sep 17 00:00:00 2001 From: Brittan DeYoung <32572259+brittandeyoung@users.noreply.github.com> Date: Wed, 1 Mar 2023 10:00:57 -0500 Subject: [PATCH 378/763] licensemanager: Amend grant_test, fmt --- internal/service/licensemanager/grant_test.go | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/internal/service/licensemanager/grant_test.go b/internal/service/licensemanager/grant_test.go index 89452df5ea3c..1c6de58a510f 100644 --- a/internal/service/licensemanager/grant_test.go +++ b/internal/service/licensemanager/grant_test.go @@ -225,16 +225,16 @@ func testAccCheckGrantDestroy(ctx context.Context) resource.TestCheckFunc { func testAccGrantConfig_basic(rName string, licenseArn string, principal string, homeRegion string) string { return fmt.Sprintf(` resource "aws_licensemanager_grant" "test" { - name = %[1]q + name = %[1]q allowed_operations = [ - "ListPurchasedLicenses", - "CheckoutLicense", - "CheckInLicense", - "ExtendConsumptionLicense", - "CreateToken" + "ListPurchasedLicenses", + "CheckoutLicense", + "CheckInLicense", + "ExtendConsumptionLicense", + "CreateToken" ] license_arn = %[2]q - principal = %[3]q + principal = %[3]q home_region = %[4]q } `, rName, licenseArn, principal, homeRegion) From 63c5406430bd1a3d7c24431b5a0bb7d53f319202 Mon Sep 17 00:00:00 2001 From: Brittan DeYoung <32572259+brittandeyoung@users.noreply.github.com> Date: Wed, 1 Mar 2023 10:44:04 -0500 Subject: [PATCH 379/763] licensemanager: Amend grant, prefer AWS Go SDK pointer conversion --- internal/service/licensemanager/grant.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/service/licensemanager/grant.go b/internal/service/licensemanager/grant.go index 6f442917c980..0aff7c2e047f 100644 --- a/internal/service/licensemanager/grant.go +++ b/internal/service/licensemanager/grant.go @@ -112,7 +112,7 @@ func resourceGrantCreate(ctx context.Context, d *schema.ResourceData, meta inter return create.DiagError(names.LicenseManager, create.ErrActionCreating, ResGrant, d.Get("name").(string), err) } - d.SetId(*out.GrantArn) + d.SetId(aws.StringValue(out.GrantArn)) return resourceGrantRead(ctx, d, meta) } From 0e10d600f2d0548cda77115abd96d3ded5a8d9b6 Mon Sep 17 00:00:00 2001 From: Brittan DeYoung <32572259+brittandeyoung@users.noreply.github.com> Date: Wed, 1 Mar 2023 10:44:36 -0500 Subject: [PATCH 380/763] licensemanager: Amend grant_test, remove service name from serialized tests --- internal/service/licensemanager/grant_test.go | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/internal/service/licensemanager/grant_test.go b/internal/service/licensemanager/grant_test.go index 1c6de58a510f..47d61916639d 100644 --- a/internal/service/licensemanager/grant_test.go +++ b/internal/service/licensemanager/grant_test.go @@ -22,16 +22,16 @@ func TestAccLicenseManagerGrant_serial(t *testing.T) { testCases := map[string]map[string]func(t *testing.T){ "grant": { - "basic": testAccLicenseManagerGrant_basic, - "disappears": testAccLicenseManagerGrant_disappears, - "name": testAccLicenseManagerGrant_name, + "basic": testAccGrant_basic, + "disappears": testAccGrant_disappears, + "name": testAccGrant_name, }, } acctest.RunSerialTests2Levels(t, testCases, 0) } -func testAccLicenseManagerGrant_basic(t *testing.T) { +func testAccGrant_basic(t *testing.T) { ctx := acctest.Context(t) principalKey := "LICENSE_MANAGER_GRANT_PRINCIPAL" licenseKey := "LICENSE_MANAGER_GRANT_LICENSE_ARN" @@ -85,7 +85,7 @@ func testAccLicenseManagerGrant_basic(t *testing.T) { }) } -func testAccLicenseManagerGrant_disappears(t *testing.T) { +func testAccGrant_disappears(t *testing.T) { ctx := acctest.Context(t) principalKey := "LICENSE_MANAGER_GRANT_PRINCIPAL" licenseKey := "LICENSE_MANAGER_GRANT_LICENSE_ARN" @@ -123,7 +123,7 @@ func testAccLicenseManagerGrant_disappears(t *testing.T) { }) } -func testAccLicenseManagerGrant_name(t *testing.T) { +func testAccGrant_name(t *testing.T) { ctx := acctest.Context(t) principalKey := "LICENSE_MANAGER_GRANT_PRINCIPAL" licenseKey := "LICENSE_MANAGER_GRANT_LICENSE_ARN" @@ -186,12 +186,16 @@ func testAccCheckGrantExists(ctx context.Context, n string) resource.TestCheckFu conn := acctest.Provider.Meta().(*conns.AWSClient).LicenseManagerConn() - _, err := tflicensemanager.FindGrantByARN(ctx, conn, rs.Primary.ID) + out, err := tflicensemanager.FindGrantByARN(ctx, conn, rs.Primary.ID) if err != nil { return err } + if out == nil { + return fmt.Errorf("Bucket %q does not exist", rs.Primary.ID) + } + return nil } } From 92151f62f930cc383def57a567a0654bd3e642ad Mon Sep 17 00:00:00 2001 From: Brittan DeYoung <32572259+brittandeyoung@users.noreply.github.com> Date: Wed, 1 Mar 2023 10:45:50 -0500 Subject: [PATCH 381/763] changelog: Add 29741 change log --- .changelog/29741.txt | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 .changelog/29741.txt diff --git a/.changelog/29741.txt b/.changelog/29741.txt new file mode 100644 index 000000000000..bfd8c47ad178 --- /dev/null +++ b/.changelog/29741.txt @@ -0,0 +1,3 @@ +```release-note:new-resource +aws_licensemanager_grant +``` \ No newline at end of file From b3acaf3c57a008f918a6e65f26dd8434c10dbdf8 Mon Sep 17 00:00:00 2001 From: Brittan DeYoung <32572259+brittandeyoung@users.noreply.github.com> Date: Wed, 1 Mar 2023 11:27:52 -0500 Subject: [PATCH 382/763] licensemanager: Amend grant_test, remove static arns --- internal/service/licensemanager/grant_test.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/internal/service/licensemanager/grant_test.go b/internal/service/licensemanager/grant_test.go index 47d61916639d..b00fe02c8721 100644 --- a/internal/service/licensemanager/grant_test.go +++ b/internal/service/licensemanager/grant_test.go @@ -67,11 +67,11 @@ func testAccGrant_basic(t *testing.T) { resource.TestCheckTypeSetElemAttr(resourceName, "allowed_operations.*", "CheckInLicense"), resource.TestCheckTypeSetElemAttr(resourceName, "allowed_operations.*", "ExtendConsumptionLicense"), resource.TestCheckTypeSetElemAttr(resourceName, "allowed_operations.*", "CreateToken"), - resource.TestCheckResourceAttr(resourceName, "home_region", "us-east-1"), - resource.TestCheckResourceAttr(resourceName, "license_arn", "arn:aws:license-manager::294406891311:license:l-ecbaa94eb71a4830b6d7e49268fecaa0"), + resource.TestCheckResourceAttr(resourceName, "home_region", homeRegion), + resource.TestCheckResourceAttr(resourceName, "license_arn", licenseArn), resource.TestCheckResourceAttr(resourceName, "name", rName), resource.TestCheckResourceAttrSet(resourceName, "parent_arn"), - resource.TestCheckResourceAttr(resourceName, "principal", "arn:aws:iam::067863992282:root"), + resource.TestCheckResourceAttr(resourceName, "principal", principal), resource.TestCheckResourceAttrSet(resourceName, "status"), resource.TestCheckResourceAttr(resourceName, "version", "1"), ), From 9644d684224b918f8b37983e962a9c67c4ff9d46 Mon Sep 17 00:00:00 2001 From: Brittan DeYoung <32572259+brittandeyoung@users.noreply.github.com> Date: Wed, 1 Mar 2023 15:49:01 -0500 Subject: [PATCH 383/763] changelog: Amend 29741, add aws_licensemanager_grant_accepter --- .changelog/29741.txt | 4 + .../licensemanager/grant_accepter_test.go | 147 ++++++++++++++++++ 2 files changed, 151 insertions(+) create mode 100644 internal/service/licensemanager/grant_accepter_test.go diff --git a/.changelog/29741.txt b/.changelog/29741.txt index bfd8c47ad178..983f40e9fdd3 100644 --- a/.changelog/29741.txt +++ b/.changelog/29741.txt @@ -1,3 +1,7 @@ ```release-note:new-resource aws_licensemanager_grant +``` + +```release-note:new-resource +aws_licensemanager_grant_accepter ``` \ No newline at end of file diff --git a/internal/service/licensemanager/grant_accepter_test.go b/internal/service/licensemanager/grant_accepter_test.go new file mode 100644 index 000000000000..7ea163585ede --- /dev/null +++ b/internal/service/licensemanager/grant_accepter_test.go @@ -0,0 +1,147 @@ +package licensemanager_test + +import ( + "context" + "fmt" + "os" + "testing" + + "github.com/aws/aws-sdk-go/service/licensemanager" + "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" + tflicensemanager "github.com/hashicorp/terraform-provider-aws/internal/service/licensemanager" + "github.com/hashicorp/terraform-provider-aws/internal/tfresource" +) + +func TestAccLicenseManagerGrantAccepter_basic(t *testing.T) { + ctx := acctest.Context(t) + grantARNKey := "LICENSE_MANAGER_GRANT_ACCEPTER_ARN_BASIC" + grantARN := os.Getenv(grantARNKey) + if grantARN == "" { + t.Skipf("Environment variable %s is not set to true", grantARNKey) + } + resourceName := "aws_licensemanager_grant_accepter.test" + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { acctest.PreCheck(t) }, + ErrorCheck: acctest.ErrorCheck(t, licensemanager.EndpointsID), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + CheckDestroy: testAccCheckGrantAccepterDestroy(ctx), + Steps: []resource.TestStep{ + { + Config: testAccGrantAccepterConfig_basic(grantARN), + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheckGrantAccepterExists(ctx, resourceName), + resource.TestCheckResourceAttrSet(resourceName, "grant_arn"), + resource.TestCheckTypeSetElemAttr(resourceName, "allowed_operations.*", "ListPurchasedLicenses"), + resource.TestCheckTypeSetElemAttr(resourceName, "allowed_operations.*", "CheckoutLicense"), + resource.TestCheckTypeSetElemAttr(resourceName, "allowed_operations.*", "CheckInLicense"), + resource.TestCheckTypeSetElemAttr(resourceName, "allowed_operations.*", "ExtendConsumptionLicense"), + resource.TestCheckTypeSetElemAttr(resourceName, "allowed_operations.*", "CreateToken"), + resource.TestCheckResourceAttrSet(resourceName, "home_region"), + resource.TestCheckResourceAttrSet(resourceName, "license_arn"), + resource.TestCheckResourceAttrSet(resourceName, "name"), + resource.TestCheckResourceAttrSet(resourceName, "parent_arn"), + resource.TestCheckResourceAttrSet(resourceName, "principal"), + resource.TestCheckResourceAttrSet(resourceName, "status"), + resource.TestCheckResourceAttrSet(resourceName, "version"), + ), + }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, + }, + }) +} + +func TestAccLicenseManagerGrantAccepter_disappears(t *testing.T) { + ctx := acctest.Context(t) + grantARNKey := "LICENSE_MANAGER_GRANT_ACCEPTER_ARN_DISAPPEARS" + grantARN := os.Getenv(grantARNKey) + if grantARN == "" { + t.Skipf("Environment variable %s is not set to true", grantARNKey) + } + resourceName := "aws_licensemanager_grant_accepter.test" + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { acctest.PreCheck(t) }, + ErrorCheck: acctest.ErrorCheck(t, licensemanager.EndpointsID), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + CheckDestroy: testAccCheckGrantAccepterDestroy(ctx), + Steps: []resource.TestStep{ + { + Config: testAccGrantAccepterConfig_basic(grantARN), + Check: resource.ComposeTestCheckFunc( + testAccCheckGrantAccepterExists(ctx, resourceName), + acctest.CheckResourceDisappears(ctx, acctest.Provider, tflicensemanager.ResourceGrantAccepter(), resourceName), + ), + ExpectNonEmptyPlan: true, + }, + }, + }) +} + +func testAccCheckGrantAccepterExists(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 License Manager License Configuration ID is set") + } + + conn := acctest.Provider.Meta().(*conns.AWSClient).LicenseManagerConn() + + out, err := tflicensemanager.FindGrantAccepterByGrantARN(ctx, conn, rs.Primary.ID) + + if err != nil { + return err + } + + if out == nil { + return fmt.Errorf("GrantAccepter %q does not exist", rs.Primary.ID) + } + + return nil + } +} + +func testAccCheckGrantAccepterDestroy(ctx context.Context) resource.TestCheckFunc { + return func(s *terraform.State) error { + conn := acctest.Provider.Meta().(*conns.AWSClient).LicenseManagerConn() + + for _, rs := range s.RootModule().Resources { + if rs.Type != "aws_licensemanager_grant_accepter" { + continue + } + + _, err := tflicensemanager.FindGrantAccepterByGrantARN(ctx, conn, rs.Primary.ID) + + if tfresource.NotFound(err) { + continue + } + + if err != nil { + return err + } + + return fmt.Errorf("License Manager GrantAccepter %s still exists", rs.Primary.ID) + } + + return nil + } +} + +func testAccGrantAccepterConfig_basic(grantARN string) string { + return fmt.Sprintf(` +resource "aws_licensemanager_grant_accepter" "test" { + grant_arn = %[1]q +} +`, grantARN) +} From c2ba41966596e6f8d922b0ba84fa594f0577bd7a Mon Sep 17 00:00:00 2001 From: Brittan DeYoung <32572259+brittandeyoung@users.noreply.github.com> Date: Wed, 1 Mar 2023 15:49:28 -0500 Subject: [PATCH 384/763] licensemanager: Add grant_accepter --- .../service/licensemanager/grant_accepter.go | 181 ++++++++++++++++++ .../licensemanager/service_package_gen.go | 1 + 2 files changed, 182 insertions(+) create mode 100644 internal/service/licensemanager/grant_accepter.go diff --git a/internal/service/licensemanager/grant_accepter.go b/internal/service/licensemanager/grant_accepter.go new file mode 100644 index 000000000000..91aebbe3a248 --- /dev/null +++ b/internal/service/licensemanager/grant_accepter.go @@ -0,0 +1,181 @@ +package licensemanager + +import ( + "context" + + "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/service/licensemanager" + "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-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/create" + "github.com/hashicorp/terraform-provider-aws/internal/tfresource" + "github.com/hashicorp/terraform-provider-aws/internal/verify" + "github.com/hashicorp/terraform-provider-aws/names" +) + +const ( + ResGrantAccepter = "Grant Accepter" +) + +// @SDKResource("aws_licensemanager_grant_accepter") +func ResourceGrantAccepter() *schema.Resource { + return &schema.Resource{ + CreateWithoutTimeout: resourceGrantAccepterCreate, + ReadWithoutTimeout: resourceGrantAccepterRead, + DeleteWithoutTimeout: resourceGrantAccepterDelete, + + Importer: &schema.ResourceImporter{ + StateContext: schema.ImportStatePassthroughContext, + }, + + Schema: map[string]*schema.Schema{ + "allowed_operations": { + Type: schema.TypeSet, + Computed: true, + Elem: &schema.Schema{ + Type: schema.TypeString, + }, + Description: "Allowed operations for the grant.", + }, + "home_region": { + Type: schema.TypeString, + Computed: true, + Description: "Home Region of the grant.", + }, + "license_arn": { + Type: schema.TypeString, + Computed: true, + Description: "License ARN.", + }, + "grant_arn": { + Type: schema.TypeString, + Required: true, + ForceNew: true, + ValidateFunc: verify.ValidARN, + Description: "Amazon Resource Name (ARN) of the grant.", + }, + "name": { + Type: schema.TypeString, + Computed: true, + Description: "Name of the grant.", + }, + "parent_arn": { + Type: schema.TypeString, + Computed: true, + Description: "Parent ARN.", + }, + "principal": { + Type: schema.TypeString, + Computed: true, + Description: "The grantee principal ARN.", + }, + "status": { + Type: schema.TypeString, + Computed: true, + Description: "GrantAccepter status.", + }, + "version": { + Type: schema.TypeString, + Computed: true, + Description: "GrantAccepter version.", + }, + }, + } +} + +func resourceGrantAccepterCreate(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { + conn := meta.(*conns.AWSClient).LicenseManagerConn() + + in := &licensemanager.AcceptGrantInput{ + GrantArn: aws.String(d.Get("grant_arn").(string)), + } + + out, err := conn.AcceptGrantWithContext(ctx, in) + + if err != nil { + return create.DiagError(names.LicenseManager, create.ErrActionCreating, ResGrantAccepter, d.Get("grant_arn").(string), err) + } + + d.SetId(aws.StringValue(out.GrantArn)) + + return resourceGrantAccepterRead(ctx, d, meta) +} + +func resourceGrantAccepterRead(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { + conn := meta.(*conns.AWSClient).LicenseManagerConn() + + out, err := FindGrantAccepterByGrantARN(ctx, conn, d.Id()) + + if !d.IsNewResource() && tfresource.NotFound(err) { + create.LogNotFoundRemoveState(names.LicenseManager, create.ErrActionReading, ResGrantAccepter, d.Id()) + d.SetId("") + return nil + } + + if err != nil { + return create.DiagError(names.LicenseManager, create.ErrActionReading, ResGrantAccepter, d.Id(), err) + } + + d.Set("allowed_operations", out.GrantedOperations) + d.Set("grant_arn", out.GrantArn) + d.Set("home_region", out.HomeRegion) + d.Set("license_arn", out.LicenseArn) + d.Set("name", out.GrantName) + d.Set("parent_arn", out.ParentArn) + d.Set("principal", out.GranteePrincipalArn) + d.Set("status", out.GrantStatus) + d.Set("version", out.Version) + + return nil +} + +func resourceGrantAccepterDelete(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { + conn := meta.(*conns.AWSClient).LicenseManagerConn() + + in := &licensemanager.RejectGrantInput{ + GrantArn: aws.String(d.Id()), + } + + _, err := conn.RejectGrantWithContext(ctx, in) + + if err != nil { + return create.DiagError(names.LicenseManager, create.ErrActionDeleting, ResGrantAccepter, d.Id(), err) + } + + return nil +} + +func FindGrantAccepterByGrantARN(ctx context.Context, conn *licensemanager.LicenseManager, arn string) (*licensemanager.Grant, error) { + in := &licensemanager.ListReceivedGrantsInput{ + GrantArns: aws.StringSlice([]string{arn}), + } + + out, err := conn.ListReceivedGrantsWithContext(ctx, in) + + if tfawserr.ErrCodeEquals(err, licensemanager.ErrCodeResourceNotFoundException) { + return nil, &resource.NotFoundError{ + LastError: err, + LastRequest: in, + } + } + + var entry *licensemanager.Grant + entryExists := false + + for _, grant := range out.Grants { + if arn == aws.StringValue(grant.GrantArn) && (licensemanager.GrantStatusActive == aws.StringValue(grant.GrantStatus) || licensemanager.GrantStatusDisabled == aws.StringValue(grant.GrantStatus)) { + entry = grant + entryExists = true + break + } + } + + if !entryExists { + return nil, tfresource.NewEmptyResultError(in) + } + + return entry, nil +} diff --git a/internal/service/licensemanager/service_package_gen.go b/internal/service/licensemanager/service_package_gen.go index b75ae1c22559..56f9ffc82ec7 100644 --- a/internal/service/licensemanager/service_package_gen.go +++ b/internal/service/licensemanager/service_package_gen.go @@ -29,6 +29,7 @@ func (p *servicePackage) SDKResources(ctx context.Context) map[string]func() *sc return map[string]func() *schema.Resource{ "aws_licensemanager_association": ResourceAssociation, "aws_licensemanager_grant": ResourceGrant, + "aws_licensemanager_grant_accepter": ResourceGrantAccepter, "aws_licensemanager_license_configuration": ResourceLicenseConfiguration, } } From fd4b5812f52480b09a134d1d718805c19d475eec Mon Sep 17 00:00:00 2001 From: Brittan DeYoung <32572259+brittandeyoung@users.noreply.github.com> Date: Wed, 1 Mar 2023 15:50:10 -0500 Subject: [PATCH 385/763] licensemanager: Amend grant, update find parameter name --- internal/service/licensemanager/grant.go | 4 ++-- internal/service/licensemanager/grant_test.go | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/internal/service/licensemanager/grant.go b/internal/service/licensemanager/grant.go index 0aff7c2e047f..c6111e8df7a1 100644 --- a/internal/service/licensemanager/grant.go +++ b/internal/service/licensemanager/grant.go @@ -193,9 +193,9 @@ func resourceGrantDelete(ctx context.Context, d *schema.ResourceData, meta inter return nil } -func FindGrantByARN(ctx context.Context, conn *licensemanager.LicenseManager, id string) (*licensemanager.Grant, error) { +func FindGrantByARN(ctx context.Context, conn *licensemanager.LicenseManager, arn string) (*licensemanager.Grant, error) { in := &licensemanager.GetGrantInput{ - GrantArn: aws.String(id), + GrantArn: aws.String(arn), } out, err := conn.GetGrantWithContext(ctx, in) diff --git a/internal/service/licensemanager/grant_test.go b/internal/service/licensemanager/grant_test.go index b00fe02c8721..f6f6f3fb0c27 100644 --- a/internal/service/licensemanager/grant_test.go +++ b/internal/service/licensemanager/grant_test.go @@ -193,7 +193,7 @@ func testAccCheckGrantExists(ctx context.Context, n string) resource.TestCheckFu } if out == nil { - return fmt.Errorf("Bucket %q does not exist", rs.Primary.ID) + return fmt.Errorf("Grant %q does not exist", rs.Primary.ID) } return nil From b7c112a312268c5ced9905b6e1989ca5c3cf9e65 Mon Sep 17 00:00:00 2001 From: Brittan DeYoung <32572259+brittandeyoung@users.noreply.github.com> Date: Wed, 1 Mar 2023 15:59:02 -0500 Subject: [PATCH 386/763] website: Add licensemanager_grant_accepter --- ...icensemanager_grant_accepter.html.markdown | 48 +++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 website/docs/r/licensemanager_grant_accepter.html.markdown diff --git a/website/docs/r/licensemanager_grant_accepter.html.markdown b/website/docs/r/licensemanager_grant_accepter.html.markdown new file mode 100644 index 000000000000..6d81eea415fe --- /dev/null +++ b/website/docs/r/licensemanager_grant_accepter.html.markdown @@ -0,0 +1,48 @@ +--- +subcategory: "License Manager" +layout: "aws" +page_title: "AWS: aws_licensemanager_grant_accepter" +description: |- + Accepts a License Manager grant resource. +--- + +# Resource: aws_licensemanager_grant_accepter + +Accepts a License Manager grant. This allows for sharing licenses with other aws accounts. + +## Example Usage + +```terraform +resource "aws_licensemanager_grant_accepter" "test" { + name = "arn:aws:license-manager::123456789012:grant:g-1cf9fba4ba2f42dcab11c686c4b4d329" +} +``` + +## Argument Reference + +The following arguments are supported: + +* `grant_arn` - (Required) The ARN of the grant to accept. + +## Attributes Reference + +In addition to all arguments above, the following attributes are exported: + +* `id` - The grant ARN (Same as `arn`). +* `arn` - The grant ARN. +* `name` - The Name of the grant. +* `allowed_operations` - A list of the allowed operations for the grant. +* `license_arn` - The ARN of the license for the grant. +* `principal` - The target account for the grant. +* `home_region` - The home region for the license. +* `parent_arn` - The parent ARN. +* `status` - The grant status. +* `version` - The grant version. + +## Import + +`aws_licensemanager_grant_accepter` can be imported using the grant arn. + +```shell +$ terraform import aws_licensemanager_grant_accepter.test arn:aws:license-manager::123456789012:grant:g-1cf9fba4ba2f42dcab11c686c4b4d329 +``` From f4a20e5ddc8ce4dc6d467b100c414fdc6aa3bd92 Mon Sep 17 00:00:00 2001 From: Albert Silva Date: Thu, 2 Mar 2023 09:17:57 -0500 Subject: [PATCH 387/763] remove testing.short logic, as it is not needed --- .../codegurureviewer/repository_association_test.go | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/internal/service/codegurureviewer/repository_association_test.go b/internal/service/codegurureviewer/repository_association_test.go index 038b9789b7f6..a08acfbed0e9 100644 --- a/internal/service/codegurureviewer/repository_association_test.go +++ b/internal/service/codegurureviewer/repository_association_test.go @@ -23,9 +23,6 @@ import ( // Repository types of "BitBucket and GitHubEnterpriseServer cannot be tested, as they require their CodeStar Connection to be in "AVAILABLE" status vs "PENDING", requiring console interaction // However, this has been manually tested successfully func TestAccCodeGuruReviewerRepositoryAssociation_basic(t *testing.T) { - if testing.Short() { - t.Skip("skipping long-running test in short mode") - } ctx := acctest.Context(t) var repositoryassociation codegurureviewer.DescribeRepositoryAssociationOutput rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) @@ -61,9 +58,6 @@ func TestAccCodeGuruReviewerRepositoryAssociation_basic(t *testing.T) { } func TestAccCodeGuruReviewerRepositoryAssociation_KMSKey(t *testing.T) { - if testing.Short() { - t.Skip("skipping long-running test in short mode") - } ctx := acctest.Context(t) var repositoryassociation codegurureviewer.DescribeRepositoryAssociationOutput rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) @@ -99,9 +93,6 @@ func TestAccCodeGuruReviewerRepositoryAssociation_KMSKey(t *testing.T) { } func TestAccCodeGuruReviewerRepositoryAssociation_S3Repository(t *testing.T) { - if testing.Short() { - t.Skip("skipping long-running test in short mode") - } ctx := acctest.Context(t) var repositoryassociation codegurureviewer.DescribeRepositoryAssociationOutput rName := "codeguru-reviewer-" + sdkacctest.RandString(10) @@ -183,9 +174,6 @@ func TestAccCodeGuruReviewerRepositoryAssociation_tags(t *testing.T) { } func TestAccCodeGuruReviewerRepositoryAssociation_disappears(t *testing.T) { - if testing.Short() { - t.Skip("skipping long-running test in short mode") - } ctx := acctest.Context(t) var repositoryassociation codegurureviewer.DescribeRepositoryAssociationOutput rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) From ac501c6785b4bab56191dc7e92ed505009be27a2 Mon Sep 17 00:00:00 2001 From: Matt Burgess <549318+mattburgess@users.noreply.github.com> Date: Thu, 2 Mar 2023 21:42:12 +0000 Subject: [PATCH 388/763] r/aws_acm_certificate: Update options in place --- internal/service/acm/certificate.go | 24 ++-- internal/service/acm/certificate_test.go | 143 +++++++++++++++++++++++ 2 files changed, 157 insertions(+), 10 deletions(-) diff --git a/internal/service/acm/certificate.go b/internal/service/acm/certificate.go index c793abb68569..62e100c05823 100644 --- a/internal/service/acm/certificate.go +++ b/internal/service/acm/certificate.go @@ -138,28 +138,19 @@ func ResourceCertificate() *schema.Resource { "options": { Type: schema.TypeList, Optional: true, + Computed: true, MaxItems: 1, Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ "certificate_transparency_logging_preference": { Type: schema.TypeString, Optional: true, - ForceNew: true, Default: acm.CertificateTransparencyLoggingPreferenceEnabled, ValidateFunc: validation.StringInSlice(acm.CertificateTransparencyLoggingPreference_Values(), false), ConflictsWith: []string{"certificate_body", "certificate_chain", "private_key"}, }, }, }, - DiffSuppressFunc: func(k, old, new string, d *schema.ResourceData) bool { - if _, ok := d.GetOk("private_key"); ok { - // ignore diffs for imported certs; they have a different logging preference - // default to requested certs which can't be changed by the ImportCertificate API - return true - } - // behave just like verify.SuppressMissingOptionalConfigurationBlock() for requested certs - return old == "1" && new == "0" - }, }, "pending_renewal": { Type: schema.TypeBool, @@ -546,6 +537,19 @@ func resourceCertificateUpdate(ctx context.Context, d *schema.ResourceData, meta } } + if d.HasChange("options") { + _, n := d.GetChange("options") + + log.Printf("[INFO] Updating Certificate Options (%s)", d.Id()) + _, err := conn.UpdateCertificateOptionsWithContext(ctx, &acm.UpdateCertificateOptionsInput{ + CertificateArn: aws.String(d.Get("arn").(string)), + Options: expandCertificateOptions(n.([]interface{})[0].(map[string]interface{})), + }) + if err != nil { + return diag.Errorf("updating certificate options (%s): %s", d.Id(), err) + } + } + if d.HasChange("tags_all") { o, n := d.GetChange("tags_all") diff --git a/internal/service/acm/certificate_test.go b/internal/service/acm/certificate_test.go index a35fe19677d0..00064e3dcfaf 100644 --- a/internal/service/acm/certificate_test.go +++ b/internal/service/acm/certificate_test.go @@ -1391,6 +1391,97 @@ func TestAccACMCertificate_disableCTLogging(t *testing.T) { }) } +func TestAccACMCertificate_disableReenableCTLogging(t *testing.T) { + ctx := acctest.Context(t) + resourceName := "aws_acm_certificate.test" + rootDomain := acctest.ACMCertificateDomainFromEnv(t) + var v acm.CertificateDetail + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { acctest.PreCheck(t) }, + ErrorCheck: acctest.ErrorCheck(t, acm.EndpointsID), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + CheckDestroy: testAccCheckCertificateDestroy(ctx), + Steps: []resource.TestStep{ + { + Config: testAccCertificateConfig_optionsWithValidation(rootDomain, acm.ValidationMethodDns, "ENABLED"), + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheckCertificateExists(ctx, resourceName, &v), + acctest.MatchResourceAttrRegionalARN(resourceName, "arn", "acm", regexp.MustCompile("certificate/.+$")), + resource.TestCheckResourceAttr(resourceName, "domain_name", rootDomain), + resource.TestCheckResourceAttr(resourceName, "domain_validation_options.#", "1"), + resource.TestCheckTypeSetElemNestedAttrs(resourceName, "domain_validation_options.*", map[string]string{ + "domain_name": rootDomain, + "resource_record_type": "CNAME", + }), + resource.TestCheckResourceAttr(resourceName, "subject_alternative_names.#", "1"), + resource.TestCheckTypeSetElemAttr(resourceName, "subject_alternative_names.*", rootDomain), + resource.TestCheckResourceAttr(resourceName, "status", acm.CertificateStatusIssued), + resource.TestCheckResourceAttr(resourceName, "validation_emails.#", "0"), + resource.TestCheckResourceAttr(resourceName, "validation_method", acm.ValidationMethodDns), + resource.TestCheckResourceAttr(resourceName, "options.#", "1"), + resource.TestCheckResourceAttr(resourceName, "options.0.certificate_transparency_logging_preference", acm.CertificateTransparencyLoggingPreferenceEnabled), + ), + }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, + { + Config: testAccCertificateConfig_optionsWithValidation(rootDomain, acm.ValidationMethodDns, "DISABLED"), + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheckCertificateExists(ctx, resourceName, &v), + acctest.MatchResourceAttrRegionalARN(resourceName, "arn", "acm", regexp.MustCompile("certificate/.+$")), + resource.TestCheckResourceAttr(resourceName, "domain_name", rootDomain), + resource.TestCheckResourceAttr(resourceName, "domain_validation_options.#", "1"), + resource.TestCheckTypeSetElemNestedAttrs(resourceName, "domain_validation_options.*", map[string]string{ + "domain_name": rootDomain, + "resource_record_type": "CNAME", + }), + resource.TestCheckResourceAttr(resourceName, "subject_alternative_names.#", "1"), + resource.TestCheckTypeSetElemAttr(resourceName, "subject_alternative_names.*", rootDomain), + resource.TestCheckResourceAttr(resourceName, "status", acm.CertificateStatusIssued), + resource.TestCheckResourceAttr(resourceName, "validation_emails.#", "0"), + resource.TestCheckResourceAttr(resourceName, "validation_method", acm.ValidationMethodDns), + resource.TestCheckResourceAttr(resourceName, "options.#", "1"), + resource.TestCheckResourceAttr(resourceName, "options.0.certificate_transparency_logging_preference", acm.CertificateTransparencyLoggingPreferenceDisabled), + ), + }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, + { + Config: testAccCertificateConfig_optionsWithValidation(rootDomain, acm.ValidationMethodDns, "ENABLED"), + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheckCertificateExists(ctx, resourceName, &v), + acctest.MatchResourceAttrRegionalARN(resourceName, "arn", "acm", regexp.MustCompile("certificate/.+$")), + resource.TestCheckResourceAttr(resourceName, "domain_name", rootDomain), + resource.TestCheckResourceAttr(resourceName, "domain_validation_options.#", "1"), + resource.TestCheckTypeSetElemNestedAttrs(resourceName, "domain_validation_options.*", map[string]string{ + "domain_name": rootDomain, + "resource_record_type": "CNAME", + }), + resource.TestCheckResourceAttr(resourceName, "subject_alternative_names.#", "1"), + resource.TestCheckTypeSetElemAttr(resourceName, "subject_alternative_names.*", rootDomain), + resource.TestCheckResourceAttr(resourceName, "status", acm.CertificateStatusIssued), + resource.TestCheckResourceAttr(resourceName, "validation_emails.#", "0"), + resource.TestCheckResourceAttr(resourceName, "validation_method", acm.ValidationMethodDns), + resource.TestCheckResourceAttr(resourceName, "options.#", "1"), + resource.TestCheckResourceAttr(resourceName, "options.0.certificate_transparency_logging_preference", acm.CertificateTransparencyLoggingPreferenceEnabled), + ), + }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, + }, + }) +} + // lintignore:AT002 func TestAccACMCertificate_Imported_domainName(t *testing.T) { ctx := acctest.Context(t) @@ -1918,6 +2009,58 @@ resource "aws_acm_certificate" "test" { `, domainName, validationMethod) } +func testAccCertificateConfig_optionsWithValidation(domainName, validationMethod, loggingPreference string) string { + return fmt.Sprintf(` +resource "aws_acm_certificate" "test" { + domain_name = %[1]q + validation_method = %[2]q + + options { + certificate_transparency_logging_preference = %[3]q + } +} + +data "aws_route53_zone" "test" { + name = %[1]q + private_zone = false +} + +# for_each acceptance testing requires SDKv2 +# +# resource "aws_route53_record" "test" { +# for_each = { +# for dvo in aws_acm_certificate.test.domain_validation_options : dvo.domain_name => { +# name = dvo.resource_record_name +# record = dvo.resource_record_value +# type = dvo.resource_record_type +# } +# } + +# allow_overwrite = true +# name = each.value.name +# records = [each.value.record] +# ttl = 60 +# type = each.value.type +# zone_id = data.aws_route53_zone.test.zone_id +# } + +resource "aws_route53_record" "test" { + allow_overwrite = true + name = tolist(aws_acm_certificate.test.domain_validation_options)[0].resource_record_name + records = [tolist(aws_acm_certificate.test.domain_validation_options)[0].resource_record_value] + ttl = 60 + type = tolist(aws_acm_certificate.test.domain_validation_options)[0].resource_record_type + zone_id = data.aws_route53_zone.test.zone_id +} + +resource "aws_acm_certificate_validation" "test" { + depends_on = [aws_route53_record.test] + + certificate_arn = aws_acm_certificate.test.arn +} +`, domainName, validationMethod, loggingPreference) +} + func testAccCertificateConfig_keyAlgorithm(domainName, validationMethod, keyAlgorithm string) string { return fmt.Sprintf(` resource "aws_acm_certificate" "test" { From 33ed03080db1cd3e497f3d3bd0bd4fdb94c1a1a6 Mon Sep 17 00:00:00 2001 From: Matt Burgess <549318+mattburgess@users.noreply.github.com> Date: Thu, 2 Mar 2023 21:55:23 +0000 Subject: [PATCH 389/763] Add Changelog --- .changelog/29763.txt | 3 +++ internal/service/acm/certificate_test.go | 21 ++++++++++----------- 2 files changed, 13 insertions(+), 11 deletions(-) create mode 100644 .changelog/29763.txt diff --git a/.changelog/29763.txt b/.changelog/29763.txt new file mode 100644 index 000000000000..37aecff7fe69 --- /dev/null +++ b/.changelog/29763.txt @@ -0,0 +1,3 @@ +```release-note:bug +resource/aws_acm_certificate: Update `certificate_transparency_logging_preference` in place rather than replacing the resource +``` diff --git a/internal/service/acm/certificate_test.go b/internal/service/acm/certificate_test.go index 00064e3dcfaf..5c074c36eaa9 100644 --- a/internal/service/acm/certificate_test.go +++ b/internal/service/acm/certificate_test.go @@ -2021,8 +2021,8 @@ resource "aws_acm_certificate" "test" { } data "aws_route53_zone" "test" { - name = %[1]q - private_zone = false + name = %[1]q + private_zone = false } # for_each acceptance testing requires SDKv2 @@ -2045,18 +2045,17 @@ data "aws_route53_zone" "test" { # } resource "aws_route53_record" "test" { - allow_overwrite = true - name = tolist(aws_acm_certificate.test.domain_validation_options)[0].resource_record_name - records = [tolist(aws_acm_certificate.test.domain_validation_options)[0].resource_record_value] - ttl = 60 - type = tolist(aws_acm_certificate.test.domain_validation_options)[0].resource_record_type - zone_id = data.aws_route53_zone.test.zone_id + allow_overwrite = true + name = tolist(aws_acm_certificate.test.domain_validation_options)[0].resource_record_name + records = [tolist(aws_acm_certificate.test.domain_validation_options)[0].resource_record_value] + ttl = 60 + type = tolist(aws_acm_certificate.test.domain_validation_options)[0].resource_record_type + zone_id = data.aws_route53_zone.test.zone_id } resource "aws_acm_certificate_validation" "test" { - depends_on = [aws_route53_record.test] - - certificate_arn = aws_acm_certificate.test.arn + depends_on = [aws_route53_record.test] + certificate_arn = aws_acm_certificate.test.arn } `, domainName, validationMethod, loggingPreference) } From dceff4861fb87f36f78be1fb779ad2e77f107770 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Fri, 3 Mar 2023 08:54:27 -0500 Subject: [PATCH 390/763] r/aws_lambda_function: Add 'TestAccLambdaFunction_skipDestroyInconsistentPlan'. --- internal/service/lambda/function_test.go | 37 ++++++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/internal/service/lambda/function_test.go b/internal/service/lambda/function_test.go index 1ce6d7dc7826..9e24a8c24e0e 100644 --- a/internal/service/lambda/function_test.go +++ b/internal/service/lambda/function_test.go @@ -2127,6 +2127,43 @@ func TestAccLambdaFunction_skipDestroy(t *testing.T) { }) } +// https://github.com/hashicorp/terraform-provider-aws/issues/29777. +func TestAccLambdaFunction_skipDestroyInconsistentPlan(t *testing.T) { + ctx := acctest.Context(t) + var conf lambda.GetFunctionOutput + rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) + resourceName := "aws_lambda_function.test" + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { acctest.PreCheck(t) }, + ErrorCheck: acctest.ErrorCheck(t, names.LambdaEndpointID), + CheckDestroy: testAccCheckFunctionDestroy(ctx), + Steps: []resource.TestStep{ + { + ExternalProviders: map[string]resource.ExternalProvider{ + "aws": { + Source: "hashicorp/aws", + VersionConstraint: "4.56.0", + }, + }, + Config: testAccFunctionConfig_basic(rName, rName, rName, rName), + Check: resource.ComposeTestCheckFunc( + testAccCheckFunctionExists(ctx, resourceName, &conf), + resource.TestCheckNoResourceAttr(resourceName, "skip_destroy"), + ), + }, + { + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + Config: testAccFunctionConfig_basic(rName, rName, rName, rName), + Check: resource.ComposeTestCheckFunc( + testAccCheckFunctionExists(ctx, resourceName, &conf), + resource.TestCheckResourceAttr(resourceName, "skip_destroy", "false"), + ), + }, + }, + }) +} + func testAccCheckFunctionDestroy(ctx context.Context) resource.TestCheckFunc { return func(s *terraform.State) error { conn := acctest.Provider.Meta().(*conns.AWSClient).LambdaClient() From 28a83f6b265f466fb6223a21f663231691efe9ba Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Fri, 3 Mar 2023 08:57:46 -0500 Subject: [PATCH 391/763] Tweak CHANGELOG entry. --- .changelog/29692.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.changelog/29692.txt b/.changelog/29692.txt index eec491d68482..91907e82a10d 100644 --- a/.changelog/29692.txt +++ b/.changelog/29692.txt @@ -1,3 +1,3 @@ ```release-note:enhancement -resource/aws_transfer_workflow: Add `decrypt_step_details` to the `steps` configuration block for `DECRYPT` type +resource/aws_transfer_workflow: Add `decrypt_step_details` to the `steps` configuration block ``` From 5d87f2618611e3a5878ef46e7ec78b7ed4c803f8 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Fri, 3 Mar 2023 10:44:59 -0500 Subject: [PATCH 392/763] r/aws_transfer_workflow: Cosmetics. Acceptance test output: % make testacc TESTARGS='-run=TestAccTransferWorkflow_basic' PKG=transfer ==> Checking that code complies with gofmt requirements... TF_ACC=1 go test ./internal/service/transfer/... -v -count 1 -parallel 20 -run=TestAccTransferWorkflow_basic -timeout 180m === RUN TestAccTransferWorkflow_basic --- PASS: TestAccTransferWorkflow_basic (15.15s) PASS ok github.com/hashicorp/terraform-provider-aws/internal/service/transfer 20.440s --- internal/service/transfer/workflow.go | 9 +++------ internal/service/transfer/workflow_test.go | 11 ++++++++--- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/internal/service/transfer/workflow.go b/internal/service/transfer/workflow.go index 0f30b8053a28..0a7e01b1e6d2 100644 --- a/internal/service/transfer/workflow.go +++ b/internal/service/transfer/workflow.go @@ -26,6 +26,7 @@ func ResourceWorkflow() *schema.Resource { ReadWithoutTimeout: resourceWorkflowRead, UpdateWithoutTimeout: resourceWorkflowUpdate, DeleteWithoutTimeout: resourceWorkflowDelete, + Importer: &schema.ResourceImporter{ StateContext: schema.ImportStatePassthroughContext, }, @@ -539,8 +540,6 @@ func resourceWorkflowCreate(ctx context.Context, d *schema.ResourceData, meta in if len(tags) > 0 { input.Tags = Tags(tags.IgnoreAWS()) } - - log.Printf("[DEBUG] Creating Transfer Workflow: %s", input) output, err := conn.CreateWorkflowWithContext(ctx, input) if err != nil { @@ -572,11 +571,9 @@ func resourceWorkflowRead(ctx context.Context, d *schema.ResourceData, meta inte d.Set("arn", output.Arn) d.Set("description", output.Description) - if err := d.Set("on_exception_steps", flattenWorkflows(output.OnExceptionSteps)); err != nil { return sdkdiag.AppendErrorf(diags, "setting on_exception_steps: %s", err) } - if err := d.Set("steps", flattenWorkflows(output.Steps)); err != nil { return sdkdiag.AppendErrorf(diags, "setting steps: %s", err) } @@ -602,7 +599,7 @@ func resourceWorkflowUpdate(ctx context.Context, d *schema.ResourceData, meta in if d.HasChange("tags_all") { o, n := d.GetChange("tags_all") if err := UpdateTags(ctx, conn, d.Get("arn").(string), o, n); err != nil { - return sdkdiag.AppendErrorf(diags, "updating tags: %s", err) + return sdkdiag.AppendErrorf(diags, "updating Transfer Workflow (%s) tags: %s", d.Id(), err) } } @@ -613,7 +610,7 @@ func resourceWorkflowDelete(ctx context.Context, d *schema.ResourceData, meta in var diags diag.Diagnostics conn := meta.(*conns.AWSClient).TransferConn() - log.Printf("[DEBUG] Deleting Transfer Workflow: (%s)", d.Id()) + log.Printf("[DEBUG] Deleting Transfer Workflow: %s", d.Id()) _, err := conn.DeleteWorkflowWithContext(ctx, &transfer.DeleteWorkflowInput{ WorkflowId: aws.String(d.Id()), }) diff --git a/internal/service/transfer/workflow_test.go b/internal/service/transfer/workflow_test.go index 2ef831b66a55..017d8f22bafa 100644 --- a/internal/service/transfer/workflow_test.go +++ b/internal/service/transfer/workflow_test.go @@ -30,15 +30,20 @@ func TestAccTransferWorkflow_basic(t *testing.T) { Steps: []resource.TestStep{ { Config: testAccWorkflowConfig_basic(rName), - Check: resource.ComposeTestCheckFunc( + Check: resource.ComposeAggregateTestCheckFunc( testAccCheckWorkflowExists(ctx, resourceName, &conf), acctest.MatchResourceAttrRegionalARN(resourceName, "arn", "transfer", regexp.MustCompile(`workflow/.+`)), + resource.TestCheckResourceAttr(resourceName, "description", ""), + resource.TestCheckResourceAttr(resourceName, "on_exception_steps.#", "0"), resource.TestCheckResourceAttr(resourceName, "steps.#", "1"), - resource.TestCheckResourceAttr(resourceName, "steps.0.type", "DELETE"), + resource.TestCheckResourceAttr(resourceName, "steps.0.copy_step_details.#", "0"), + resource.TestCheckResourceAttr(resourceName, "steps.0.custom_step_details.#", "0"), + resource.TestCheckResourceAttr(resourceName, "steps.0.decrypt_step_details.#", "0"), resource.TestCheckResourceAttr(resourceName, "steps.0.delete_step_details.#", "1"), resource.TestCheckResourceAttr(resourceName, "steps.0.delete_step_details.0.name", rName), resource.TestCheckResourceAttr(resourceName, "steps.0.delete_step_details.0.source_file_location", "${original.file}"), - resource.TestCheckResourceAttr(resourceName, "on_exception_steps.#", "0"), + resource.TestCheckResourceAttr(resourceName, "steps.0.tag_step_details.#", "0"), + resource.TestCheckResourceAttr(resourceName, "steps.0.type", "DELETE"), resource.TestCheckResourceAttr(resourceName, "tags.%", "0"), ), }, From 63a5d425a827bd18ef37afe033dab93a42cc8087 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Fri, 3 Mar 2023 11:08:15 -0500 Subject: [PATCH 393/763] r/aws_transfer_workflow: Ensure that only tags updates aren't ForceNew. Acceptance test output: % make testacc TESTARGS='-run=TestAccTransferWorkflow_' PKG=transfer ACCTEST_PARALLELISM=3 ==> Checking that code complies with gofmt requirements... TF_ACC=1 go test ./internal/service/transfer/... -v -count 1 -parallel 3 -run=TestAccTransferWorkflow_ -timeout 180m === RUN TestAccTransferWorkflow_basic --- PASS: TestAccTransferWorkflow_basic (15.92s) === RUN TestAccTransferWorkflow_onExceptionSteps --- PASS: TestAccTransferWorkflow_onExceptionSteps (14.72s) === RUN TestAccTransferWorkflow_description --- PASS: TestAccTransferWorkflow_description (14.33s) === RUN TestAccTransferWorkflow_tags --- PASS: TestAccTransferWorkflow_tags (33.73s) === RUN TestAccTransferWorkflow_disappears --- PASS: TestAccTransferWorkflow_disappears (10.61s) PASS ok github.com/hashicorp/terraform-provider-aws/internal/service/transfer 94.614s --- .changelog/29692.txt | 2 +- internal/service/transfer/workflow.go | 183 +++++++++++++++++++-- internal/service/transfer/workflow_test.go | 36 ++-- 3 files changed, 189 insertions(+), 32 deletions(-) diff --git a/.changelog/29692.txt b/.changelog/29692.txt index 91907e82a10d..5df1de6716e8 100644 --- a/.changelog/29692.txt +++ b/.changelog/29692.txt @@ -1,3 +1,3 @@ ```release-note:enhancement -resource/aws_transfer_workflow: Add `decrypt_step_details` to the `steps` configuration block +resource/aws_transfer_workflow: Add `decrypt_step_details` to the `on_exception_steps` and `steps` configuration blocks ``` diff --git a/internal/service/transfer/workflow.go b/internal/service/transfer/workflow.go index 0a7e01b1e6d2..79f9a0ac73fc 100644 --- a/internal/service/transfer/workflow.go +++ b/internal/service/transfer/workflow.go @@ -55,28 +55,33 @@ func ResourceWorkflow() *schema.Resource { "copy_step_details": { Type: schema.TypeList, Optional: true, + ForceNew: true, MaxItems: 1, Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ "destination_file_location": { Type: schema.TypeList, Optional: true, + ForceNew: true, MaxItems: 1, Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ "efs_file_location": { Type: schema.TypeList, Optional: true, + ForceNew: true, MaxItems: 1, Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ "file_system_id": { Type: schema.TypeString, Optional: true, + ForceNew: true, }, "path": { Type: schema.TypeString, Optional: true, + ForceNew: true, ValidateFunc: validation.StringLenBetween(1, 65536), }, }, @@ -85,16 +90,19 @@ func ResourceWorkflow() *schema.Resource { "s3_file_location": { Type: schema.TypeList, Optional: true, + ForceNew: true, MaxItems: 1, Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ "bucket": { Type: schema.TypeString, Optional: true, + ForceNew: true, }, "key": { Type: schema.TypeString, Optional: true, + ForceNew: true, ValidateFunc: validation.StringLenBetween(0, 1024), }, }, @@ -106,6 +114,7 @@ func ResourceWorkflow() *schema.Resource { "name": { Type: schema.TypeString, Optional: true, + ForceNew: true, ValidateFunc: validation.All( validation.StringLenBetween(0, 30), validation.StringMatch(regexp.MustCompile(`^[\w-]*$`), "Must be of the pattern ^[\\w-]*$"), @@ -114,12 +123,14 @@ func ResourceWorkflow() *schema.Resource { "overwrite_existing": { Type: schema.TypeString, Optional: true, + ForceNew: true, Default: transfer.OverwriteExistingFalse, ValidateFunc: validation.StringInSlice(transfer.OverwriteExisting_Values(), false), }, "source_file_location": { Type: schema.TypeString, Optional: true, + ForceNew: true, ValidateFunc: validation.All( validation.StringLenBetween(0, 256), validation.StringMatch(regexp.MustCompile(`^\$\{(\w+.)+\w+\}$`), "Must be of the pattern ^\\$\\{(\\w+.)+\\w+\\}$"), @@ -131,12 +142,14 @@ func ResourceWorkflow() *schema.Resource { "custom_step_details": { Type: schema.TypeList, Optional: true, + ForceNew: true, MaxItems: 1, Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ "name": { Type: schema.TypeString, Optional: true, + ForceNew: true, ValidateFunc: validation.All( validation.StringLenBetween(0, 30), validation.StringMatch(regexp.MustCompile(`^[\w-]*$`), "Must be of the pattern ^[\\w-]*$"), @@ -145,6 +158,7 @@ func ResourceWorkflow() *schema.Resource { "source_file_location": { Type: schema.TypeString, Optional: true, + ForceNew: true, ValidateFunc: validation.All( validation.StringLenBetween(0, 256), validation.StringMatch(regexp.MustCompile(`^\$\{(\w+.)+\w+\}$`), "Must be of the pattern ^\\$\\{(\\w+.)+\\w+\\}$"), @@ -153,25 +167,115 @@ func ResourceWorkflow() *schema.Resource { "target": { Type: schema.TypeString, Optional: true, + ForceNew: true, ValidateFunc: verify.ValidARN, }, "timeout_seconds": { Type: schema.TypeInt, Optional: true, + ForceNew: true, ValidateFunc: validation.IntBetween(1, 1800), }, }, }, }, + "decrypt_step_details": { + Type: schema.TypeList, + Optional: true, + ForceNew: true, + MaxItems: 1, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "destination_file_location": { + Type: schema.TypeList, + Optional: true, + ForceNew: true, + MaxItems: 1, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "efs_file_location": { + Type: schema.TypeList, + Optional: true, + ForceNew: true, + MaxItems: 1, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "file_system_id": { + Type: schema.TypeString, + Optional: true, + ForceNew: true, + }, + "path": { + Type: schema.TypeString, + Optional: true, + ForceNew: true, + ValidateFunc: validation.StringLenBetween(1, 65536), + }, + }, + }, + }, + "s3_file_location": { + Type: schema.TypeList, + Optional: true, + MaxItems: 1, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "bucket": { + Type: schema.TypeString, + Optional: true, + ForceNew: true, + }, + "key": { + Type: schema.TypeString, + Optional: true, + ForceNew: true, + ValidateFunc: validation.StringLenBetween(0, 1024), + }, + }, + }, + }, + }, + }, + }, + "name": { + Type: schema.TypeString, + Optional: true, + ForceNew: true, + ValidateFunc: validation.All( + validation.StringLenBetween(0, 30), + validation.StringMatch(regexp.MustCompile(`^[\w-]*$`), "Must be of the pattern ^[\\w-]*$"), + ), + }, + "overwrite_existing": { + Type: schema.TypeString, + Optional: true, + ForceNew: true, + Default: transfer.OverwriteExistingFalse, + ValidateFunc: validation.StringInSlice(transfer.OverwriteExisting_Values(), false), + }, + "source_file_location": { + Type: schema.TypeString, + Optional: true, + ForceNew: true, + ValidateFunc: validation.All( + validation.StringLenBetween(0, 256), + validation.StringMatch(regexp.MustCompile(`^\$\{(\w+.)+\w+\}$`), "Must be of the pattern ^\\$\\{(\\w+.)+\\w+\\}$"), + ), + }, + }, + }, + }, "delete_step_details": { Type: schema.TypeList, Optional: true, + ForceNew: true, MaxItems: 1, Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ "name": { Type: schema.TypeString, Optional: true, + ForceNew: true, ValidateFunc: validation.All( validation.StringLenBetween(0, 30), validation.StringMatch(regexp.MustCompile(`^[\w-]*$`), "Must be of the pattern ^[\\w-]*$"), @@ -180,6 +284,7 @@ func ResourceWorkflow() *schema.Resource { "source_file_location": { Type: schema.TypeString, Optional: true, + ForceNew: true, ValidateFunc: validation.All( validation.StringLenBetween(0, 256), validation.StringMatch(regexp.MustCompile(`^\$\{(\w+.)+\w+\}$`), "Must be of the pattern ^\\$\\{(\\w+.)+\\w+\\}$"), @@ -191,12 +296,14 @@ func ResourceWorkflow() *schema.Resource { "tag_step_details": { Type: schema.TypeList, Optional: true, + ForceNew: true, MaxItems: 1, Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ "name": { Type: schema.TypeString, Optional: true, + ForceNew: true, ValidateFunc: validation.All( validation.StringLenBetween(0, 30), validation.StringMatch(regexp.MustCompile(`^[\w-]*$`), "Must be of the pattern ^[\\w-]*$"), @@ -205,6 +312,7 @@ func ResourceWorkflow() *schema.Resource { "source_file_location": { Type: schema.TypeString, Optional: true, + ForceNew: true, ValidateFunc: validation.All( validation.StringLenBetween(0, 256), validation.StringMatch(regexp.MustCompile(`^\$\{(\w+.)+\w+\}$`), "Must be of the pattern ^\\$\\{(\\w+.)+\\w+\\}$"), @@ -213,17 +321,20 @@ func ResourceWorkflow() *schema.Resource { "tags": { Type: schema.TypeList, Optional: true, + ForceNew: true, MaxItems: 10, Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ "key": { Type: schema.TypeString, Required: true, + ForceNew: true, ValidateFunc: validation.StringLenBetween(0, 128), }, "value": { Type: schema.TypeString, Required: true, + ForceNew: true, ValidateFunc: validation.StringLenBetween(0, 256), }, }, @@ -235,6 +346,7 @@ func ResourceWorkflow() *schema.Resource { "type": { Type: schema.TypeString, Required: true, + ForceNew: true, ValidateFunc: validation.StringInSlice(transfer.WorkflowStepType_Values(), false), }, }, @@ -250,28 +362,33 @@ func ResourceWorkflow() *schema.Resource { "copy_step_details": { Type: schema.TypeList, Optional: true, + ForceNew: true, MaxItems: 1, Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ "destination_file_location": { Type: schema.TypeList, Optional: true, + ForceNew: true, MaxItems: 1, Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ "efs_file_location": { Type: schema.TypeList, Optional: true, + ForceNew: true, MaxItems: 1, Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ "file_system_id": { Type: schema.TypeString, Optional: true, + ForceNew: true, }, "path": { Type: schema.TypeString, Optional: true, + ForceNew: true, ValidateFunc: validation.StringLenBetween(1, 65536), }, }, @@ -280,16 +397,19 @@ func ResourceWorkflow() *schema.Resource { "s3_file_location": { Type: schema.TypeList, Optional: true, + ForceNew: true, MaxItems: 1, Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ "bucket": { Type: schema.TypeString, Optional: true, + ForceNew: true, }, "key": { Type: schema.TypeString, Optional: true, + ForceNew: true, ValidateFunc: validation.StringLenBetween(0, 1024), }, }, @@ -301,6 +421,7 @@ func ResourceWorkflow() *schema.Resource { "name": { Type: schema.TypeString, Optional: true, + ForceNew: true, ValidateFunc: validation.All( validation.StringLenBetween(0, 30), validation.StringMatch(regexp.MustCompile(`^[\w-]*$`), "Must be of the pattern ^[\\w-]*$"), @@ -309,12 +430,14 @@ func ResourceWorkflow() *schema.Resource { "overwrite_existing": { Type: schema.TypeString, Optional: true, + ForceNew: true, Default: transfer.OverwriteExistingFalse, ValidateFunc: validation.StringInSlice(transfer.OverwriteExisting_Values(), false), }, "source_file_location": { Type: schema.TypeString, Optional: true, + ForceNew: true, ValidateFunc: validation.All( validation.StringLenBetween(0, 256), validation.StringMatch(regexp.MustCompile(`^\$\{(\w+.)+\w+\}$`), "Must be of the pattern ^\\$\\{(\\w+.)+\\w+\\}$"), @@ -326,12 +449,14 @@ func ResourceWorkflow() *schema.Resource { "custom_step_details": { Type: schema.TypeList, Optional: true, + ForceNew: true, MaxItems: 1, Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ "name": { Type: schema.TypeString, Optional: true, + ForceNew: true, ValidateFunc: validation.All( validation.StringLenBetween(0, 30), validation.StringMatch(regexp.MustCompile(`^[\w-]*$`), "Must be of the pattern ^[\\w-]*$"), @@ -340,6 +465,7 @@ func ResourceWorkflow() *schema.Resource { "source_file_location": { Type: schema.TypeString, Optional: true, + ForceNew: true, ValidateFunc: validation.All( validation.StringLenBetween(0, 256), validation.StringMatch(regexp.MustCompile(`^\$\{(\w+.)+\w+\}$`), "Must be of the pattern ^\\$\\{(\\w+.)+\\w+\\}$"), @@ -348,11 +474,13 @@ func ResourceWorkflow() *schema.Resource { "target": { Type: schema.TypeString, Optional: true, + ForceNew: true, ValidateFunc: verify.ValidARN, }, "timeout_seconds": { Type: schema.TypeInt, Optional: true, + ForceNew: true, ValidateFunc: validation.IntBetween(1, 1800), }, }, @@ -361,28 +489,33 @@ func ResourceWorkflow() *schema.Resource { "decrypt_step_details": { Type: schema.TypeList, Optional: true, + ForceNew: true, MaxItems: 1, Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ "destination_file_location": { Type: schema.TypeList, Optional: true, + ForceNew: true, MaxItems: 1, Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ "efs_file_location": { Type: schema.TypeList, Optional: true, + ForceNew: true, MaxItems: 1, Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ "file_system_id": { Type: schema.TypeString, Optional: true, + ForceNew: true, }, "path": { Type: schema.TypeString, Optional: true, + ForceNew: true, ValidateFunc: validation.StringLenBetween(1, 65536), }, }, @@ -391,16 +524,19 @@ func ResourceWorkflow() *schema.Resource { "s3_file_location": { Type: schema.TypeList, Optional: true, + ForceNew: true, MaxItems: 1, Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ "bucket": { Type: schema.TypeString, Optional: true, + ForceNew: true, }, "key": { Type: schema.TypeString, Optional: true, + ForceNew: true, ValidateFunc: validation.StringLenBetween(0, 1024), }, }, @@ -412,6 +548,7 @@ func ResourceWorkflow() *schema.Resource { "name": { Type: schema.TypeString, Optional: true, + ForceNew: true, ValidateFunc: validation.All( validation.StringLenBetween(0, 30), validation.StringMatch(regexp.MustCompile(`^[\w-]*$`), "Must be of the pattern ^[\\w-]*$"), @@ -420,12 +557,14 @@ func ResourceWorkflow() *schema.Resource { "overwrite_existing": { Type: schema.TypeString, Optional: true, + ForceNew: true, Default: transfer.OverwriteExistingFalse, ValidateFunc: validation.StringInSlice(transfer.OverwriteExisting_Values(), false), }, "source_file_location": { Type: schema.TypeString, Optional: true, + ForceNew: true, ValidateFunc: validation.All( validation.StringLenBetween(0, 256), validation.StringMatch(regexp.MustCompile(`^\$\{(\w+.)+\w+\}$`), "Must be of the pattern ^\\$\\{(\\w+.)+\\w+\\}$"), @@ -437,12 +576,14 @@ func ResourceWorkflow() *schema.Resource { "delete_step_details": { Type: schema.TypeList, Optional: true, + ForceNew: true, MaxItems: 1, Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ "name": { Type: schema.TypeString, Optional: true, + ForceNew: true, ValidateFunc: validation.All( validation.StringLenBetween(0, 30), validation.StringMatch(regexp.MustCompile(`^[\w-]*$`), "Must be of the pattern ^[\\w-]*$"), @@ -451,6 +592,7 @@ func ResourceWorkflow() *schema.Resource { "source_file_location": { Type: schema.TypeString, Optional: true, + ForceNew: true, ValidateFunc: validation.All( validation.StringLenBetween(0, 256), validation.StringMatch(regexp.MustCompile(`^\$\{(\w+.)+\w+\}$`), "Must be of the pattern ^\\$\\{(\\w+.)+\\w+\\}$"), @@ -462,12 +604,14 @@ func ResourceWorkflow() *schema.Resource { "tag_step_details": { Type: schema.TypeList, Optional: true, + ForceNew: true, MaxItems: 1, Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ "name": { Type: schema.TypeString, Optional: true, + ForceNew: true, ValidateFunc: validation.All( validation.StringLenBetween(0, 30), validation.StringMatch(regexp.MustCompile(`^[\w-]*$`), "Must be of the pattern ^[\\w-]*$"), @@ -476,6 +620,7 @@ func ResourceWorkflow() *schema.Resource { "source_file_location": { Type: schema.TypeString, Optional: true, + ForceNew: true, ValidateFunc: validation.All( validation.StringLenBetween(0, 256), validation.StringMatch(regexp.MustCompile(`^\$\{(\w+.)+\w+\}$`), "Must be of the pattern ^\\$\\{(\\w+.)+\\w+\\}$"), @@ -484,17 +629,20 @@ func ResourceWorkflow() *schema.Resource { "tags": { Type: schema.TypeList, Optional: true, + ForceNew: true, MaxItems: 10, Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ "key": { Type: schema.TypeString, Required: true, + ForceNew: true, ValidateFunc: validation.StringLenBetween(0, 128), }, "value": { Type: schema.TypeString, Required: true, + ForceNew: true, ValidateFunc: validation.StringLenBetween(0, 256), }, }, @@ -506,6 +654,7 @@ func ResourceWorkflow() *schema.Resource { "type": { Type: schema.TypeString, Required: true, + ForceNew: true, ValidateFunc: validation.StringInSlice(transfer.WorkflowStepType_Values(), false), }, }, @@ -682,7 +831,7 @@ func flattenWorkflows(apiObjects []*transfer.WorkflowStep) []interface{} { "type": aws.StringValue(apiObject.Type), } - if apiObject.DeleteStepDetails != nil { + if apiObject.CopyStepDetails != nil { flattenedObject["copy_step_details"] = flattenCopyStepDetails(apiObject.CopyStepDetails) } @@ -717,6 +866,10 @@ func expandCopyStepDetails(tfMap []interface{}) *transfer.CopyStepDetails { apiObject := &transfer.CopyStepDetails{} + if v, ok := tfMapRaw["destination_file_location"].([]interface{}); ok && len(v) > 0 { + apiObject.DestinationFileLocation = expandDestinationFileLocation(v) + } + if v, ok := tfMapRaw["name"].(string); ok && v != "" { apiObject.Name = aws.String(v) } @@ -729,10 +882,6 @@ func expandCopyStepDetails(tfMap []interface{}) *transfer.CopyStepDetails { apiObject.SourceFileLocation = aws.String(v) } - if v, ok := tfMapRaw["destination_file_location"].([]interface{}); ok && len(v) > 0 { - apiObject.DestinationFileLocation = expandDestinationFileLocation(v) - } - return apiObject } @@ -743,6 +892,10 @@ func flattenCopyStepDetails(apiObject *transfer.CopyStepDetails) []interface{} { tfMap := map[string]interface{}{} + if v := apiObject.DestinationFileLocation; v != nil { + tfMap["destination_file_location"] = flattenDestinationFileLocation(v) + } + if v := apiObject.Name; v != nil { tfMap["name"] = aws.StringValue(v) } @@ -755,10 +908,6 @@ func flattenCopyStepDetails(apiObject *transfer.CopyStepDetails) []interface{} { tfMap["source_file_location"] = aws.StringValue(v) } - if v := apiObject.DestinationFileLocation; v != nil { - tfMap["destination_file_location"] = flattenDestinationFileLocation(v) - } - return []interface{}{tfMap} } @@ -825,6 +974,10 @@ func expandDecryptStepDetails(tfMap []interface{}) *transfer.DecryptStepDetails apiObject := &transfer.DecryptStepDetails{} + if v, ok := tfMapRaw["destination_file_location"].([]interface{}); ok && len(v) > 0 { + apiObject.DestinationFileLocation = expandDestinationFileLocation(v) + } + if v, ok := tfMapRaw["name"].(string); ok && v != "" { apiObject.Name = aws.String(v) } @@ -837,10 +990,6 @@ func expandDecryptStepDetails(tfMap []interface{}) *transfer.DecryptStepDetails apiObject.SourceFileLocation = aws.String(v) } - if v, ok := tfMapRaw["destination_file_location"].([]interface{}); ok && len(v) > 0 { - apiObject.DestinationFileLocation = expandDestinationFileLocation(v) - } - return apiObject } @@ -851,6 +1000,10 @@ func flattenDecryptStepDetails(apiObject *transfer.DecryptStepDetails) []interfa tfMap := map[string]interface{}{} + if v := apiObject.DestinationFileLocation; v != nil { + tfMap["destination_file_location"] = flattenDestinationFileLocation(v) + } + if v := apiObject.Name; v != nil { tfMap["name"] = aws.StringValue(v) } @@ -863,10 +1016,6 @@ func flattenDecryptStepDetails(apiObject *transfer.DecryptStepDetails) []interfa tfMap["source_file_location"] = aws.StringValue(v) } - if v := apiObject.DestinationFileLocation; v != nil { - tfMap["destination_file_location"] = flattenDestinationFileLocation(v) - } - return []interface{}{tfMap} } diff --git a/internal/service/transfer/workflow_test.go b/internal/service/transfer/workflow_test.go index 017d8f22bafa..b3750d9c42c4 100644 --- a/internal/service/transfer/workflow_test.go +++ b/internal/service/transfer/workflow_test.go @@ -56,7 +56,7 @@ func TestAccTransferWorkflow_basic(t *testing.T) { }) } -func TestAccTransferWorkflow_onExecution(t *testing.T) { +func TestAccTransferWorkflow_onExceptionSteps(t *testing.T) { ctx := acctest.Context(t) var conf transfer.DescribedWorkflow resourceName := "aws_transfer_workflow.test" @@ -69,20 +69,28 @@ func TestAccTransferWorkflow_onExecution(t *testing.T) { CheckDestroy: testAccCheckWorkflowDestroy(ctx), Steps: []resource.TestStep{ { - Config: testAccWorkflowConfig_onExec(rName), - Check: resource.ComposeTestCheckFunc( + Config: testAccWorkflowConfig_onExceptionSteps(rName), + Check: resource.ComposeAggregateTestCheckFunc( testAccCheckWorkflowExists(ctx, resourceName, &conf), acctest.MatchResourceAttrRegionalARN(resourceName, "arn", "transfer", regexp.MustCompile(`workflow/.+`)), - resource.TestCheckResourceAttr(resourceName, "steps.#", "1"), - resource.TestCheckResourceAttr(resourceName, "steps.0.type", "DELETE"), - resource.TestCheckResourceAttr(resourceName, "steps.0.delete_step_details.#", "1"), - resource.TestCheckResourceAttr(resourceName, "steps.0.delete_step_details.0.name", rName), - resource.TestCheckResourceAttr(resourceName, "steps.0.delete_step_details.0.source_file_location", "${original.file}"), resource.TestCheckResourceAttr(resourceName, "on_exception_steps.#", "1"), + resource.TestCheckResourceAttr(resourceName, "on_exception_steps.0.copy_step_details.#", "0"), + resource.TestCheckResourceAttr(resourceName, "on_exception_steps.0.custom_step_details.#", "0"), + resource.TestCheckResourceAttr(resourceName, "on_exception_steps.0.decrypt_step_details.#", "0"), resource.TestCheckResourceAttr(resourceName, "on_exception_steps.0.type", "DELETE"), resource.TestCheckResourceAttr(resourceName, "on_exception_steps.0.delete_step_details.#", "1"), resource.TestCheckResourceAttr(resourceName, "on_exception_steps.0.delete_step_details.0.name", rName), resource.TestCheckResourceAttr(resourceName, "on_exception_steps.0.delete_step_details.0.source_file_location", "${original.file}"), + resource.TestCheckResourceAttr(resourceName, "on_exception_steps.0.tag_step_details.#", "0"), + resource.TestCheckResourceAttr(resourceName, "steps.#", "1"), + resource.TestCheckResourceAttr(resourceName, "steps.0.copy_step_details.#", "0"), + resource.TestCheckResourceAttr(resourceName, "steps.0.custom_step_details.#", "0"), + resource.TestCheckResourceAttr(resourceName, "steps.0.decrypt_step_details.#", "0"), + resource.TestCheckResourceAttr(resourceName, "steps.0.delete_step_details.#", "1"), + resource.TestCheckResourceAttr(resourceName, "steps.0.delete_step_details.0.name", rName), + resource.TestCheckResourceAttr(resourceName, "steps.0.delete_step_details.0.source_file_location", "${original.file}"), + resource.TestCheckResourceAttr(resourceName, "steps.0.tag_step_details.#", "0"), + resource.TestCheckResourceAttr(resourceName, "steps.0.type", "DELETE"), resource.TestCheckResourceAttr(resourceName, "tags.%", "0"), ), }, @@ -108,10 +116,10 @@ func TestAccTransferWorkflow_description(t *testing.T) { CheckDestroy: testAccCheckWorkflowDestroy(ctx), Steps: []resource.TestStep{ { - Config: testAccWorkflowConfig_desc(rName), + Config: testAccWorkflowConfig_description(rName, "testing"), Check: resource.ComposeTestCheckFunc( testAccCheckWorkflowExists(ctx, resourceName, &conf), - resource.TestCheckResourceAttr(resourceName, "description", rName), + resource.TestCheckResourceAttr(resourceName, "description", "testing"), ), }, { @@ -258,10 +266,10 @@ resource "aws_transfer_workflow" "test" { `, rName) } -func testAccWorkflowConfig_desc(rName string) string { +func testAccWorkflowConfig_description(rName, description string) string { return fmt.Sprintf(` resource "aws_transfer_workflow" "test" { - description = %[1]q + description = %[2]q steps { delete_step_details { @@ -271,10 +279,10 @@ resource "aws_transfer_workflow" "test" { type = "DELETE" } } -`, rName) +`, rName, description) } -func testAccWorkflowConfig_onExec(rName string) string { +func testAccWorkflowConfig_onExceptionSteps(rName string) string { return fmt.Sprintf(` resource "aws_transfer_workflow" "test" { steps { From 52685f49908e296de5ec9130fd662ed39acf682e Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Fri, 3 Mar 2023 11:57:06 -0500 Subject: [PATCH 394/763] r/aws_transfer_workflow: Add 'type' to 'steps.decrypt_step_details'. Acceptance test output: % make testacc TESTARGS='-run=TestAccTransferWorkflow_allSteps' PKG=transfer ==> Checking that code complies with gofmt requirements... TF_ACC=1 go test ./internal/service/transfer/... -v -count 1 -parallel 20 -run=TestAccTransferWorkflow_allSteps -timeout 180m === RUN TestAccTransferWorkflow_allSteps --- PASS: TestAccTransferWorkflow_allSteps (45.60s) PASS ok github.com/hashicorp/terraform-provider-aws/internal/service/transfer 50.770s --- internal/service/transfer/workflow.go | 20 ++ internal/service/transfer/workflow_test.go | 177 ++++++++++++++++++ .../docs/r/transfer_workflow.html.markdown | 1 + 3 files changed, 198 insertions(+) diff --git a/internal/service/transfer/workflow.go b/internal/service/transfer/workflow.go index 79f9a0ac73fc..f2c9e39b1b07 100644 --- a/internal/service/transfer/workflow.go +++ b/internal/service/transfer/workflow.go @@ -262,6 +262,12 @@ func ResourceWorkflow() *schema.Resource { validation.StringMatch(regexp.MustCompile(`^\$\{(\w+.)+\w+\}$`), "Must be of the pattern ^\\$\\{(\\w+.)+\\w+\\}$"), ), }, + "type": { + Type: schema.TypeString, + Required: true, + ForceNew: true, + ValidateFunc: validation.StringInSlice(transfer.EncryptionType_Values(), false), + }, }, }, }, @@ -570,6 +576,12 @@ func ResourceWorkflow() *schema.Resource { validation.StringMatch(regexp.MustCompile(`^\$\{(\w+.)+\w+\}$`), "Must be of the pattern ^\\$\\{(\\w+.)+\\w+\\}$"), ), }, + "type": { + Type: schema.TypeString, + Required: true, + ForceNew: true, + ValidateFunc: validation.StringInSlice(transfer.EncryptionType_Values(), false), + }, }, }, }, @@ -990,6 +1002,10 @@ func expandDecryptStepDetails(tfMap []interface{}) *transfer.DecryptStepDetails apiObject.SourceFileLocation = aws.String(v) } + if v, ok := tfMapRaw["type"].(string); ok && v != "" { + apiObject.Type = aws.String(v) + } + return apiObject } @@ -1016,6 +1032,10 @@ func flattenDecryptStepDetails(apiObject *transfer.DecryptStepDetails) []interfa tfMap["source_file_location"] = aws.StringValue(v) } + if v := apiObject.Type; v != nil { + tfMap["type"] = aws.StringValue(v) + } + return []interface{}{tfMap} } diff --git a/internal/service/transfer/workflow_test.go b/internal/service/transfer/workflow_test.go index b3750d9c42c4..ee30949b657e 100644 --- a/internal/service/transfer/workflow_test.go +++ b/internal/service/transfer/workflow_test.go @@ -201,6 +201,97 @@ func TestAccTransferWorkflow_disappears(t *testing.T) { }) } +func TestAccTransferWorkflow_allSteps(t *testing.T) { + ctx := acctest.Context(t) + var conf transfer.DescribedWorkflow + resourceName := "aws_transfer_workflow.test" + rName := sdkacctest.RandString(25) + + resource.Test(t, resource.TestCase{ + PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + ErrorCheck: acctest.ErrorCheck(t, transfer.EndpointsID), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + CheckDestroy: testAccCheckWorkflowDestroy(ctx), + Steps: []resource.TestStep{ + { + Config: testAccWorkflowConfig_allSteps(rName), + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheckWorkflowExists(ctx, resourceName, &conf), + acctest.MatchResourceAttrRegionalARN(resourceName, "arn", "transfer", regexp.MustCompile(`workflow/.+`)), + resource.TestCheckResourceAttr(resourceName, "on_exception_steps.#", "0"), + resource.TestCheckResourceAttr(resourceName, "steps.#", "5"), + resource.TestCheckResourceAttr(resourceName, "steps.0.copy_step_details.#", "1"), + resource.TestCheckResourceAttr(resourceName, "steps.0.copy_step_details.0.destination_file_location.#", "1"), + resource.TestCheckResourceAttr(resourceName, "steps.0.copy_step_details.0.destination_file_location.0.efs_file_location.#", "0"), + resource.TestCheckResourceAttr(resourceName, "steps.0.copy_step_details.0.destination_file_location.0.s3_file_location.#", "1"), + resource.TestCheckResourceAttr(resourceName, "steps.0.copy_step_details.0.destination_file_location.0.s3_file_location.0.bucket", "testing"), + resource.TestCheckResourceAttr(resourceName, "steps.0.copy_step_details.0.destination_file_location.0.s3_file_location.0.key", "k1"), + resource.TestCheckResourceAttr(resourceName, "steps.0.copy_step_details.0.name", rName), + resource.TestCheckResourceAttr(resourceName, "steps.0.copy_step_details.0.overwrite_existing", "TRUE"), + resource.TestCheckResourceAttr(resourceName, "steps.0.copy_step_details.0.source_file_location", "${original.file}"), + resource.TestCheckResourceAttr(resourceName, "steps.0.custom_step_details.#", "0"), + resource.TestCheckResourceAttr(resourceName, "steps.0.decrypt_step_details.#", "0"), + resource.TestCheckResourceAttr(resourceName, "steps.0.delete_step_details.#", "0"), + resource.TestCheckResourceAttr(resourceName, "steps.0.tag_step_details.#", "0"), + resource.TestCheckResourceAttr(resourceName, "steps.0.type", "COPY"), + resource.TestCheckResourceAttr(resourceName, "steps.1.copy_step_details.#", "0"), + resource.TestCheckResourceAttr(resourceName, "steps.1.custom_step_details.#", "1"), + resource.TestCheckResourceAttr(resourceName, "steps.1.custom_step_details.0.name", rName), + resource.TestCheckResourceAttr(resourceName, "steps.1.custom_step_details.0.source_file_location", "${original.file}"), + resource.TestCheckResourceAttrPair(resourceName, "steps.1.custom_step_details.0.target", "aws_lambda_function.test", "arn"), + resource.TestCheckResourceAttr(resourceName, "steps.1.custom_step_details.0.timeout_seconds", "1001"), + resource.TestCheckResourceAttr(resourceName, "steps.1.decrypt_step_details.#", "0"), + resource.TestCheckResourceAttr(resourceName, "steps.1.delete_step_details.#", "0"), + resource.TestCheckResourceAttr(resourceName, "steps.1.tag_step_details.#", "0"), + resource.TestCheckResourceAttr(resourceName, "steps.1.type", "CUSTOM"), + resource.TestCheckResourceAttr(resourceName, "steps.2.copy_step_details.#", "0"), + resource.TestCheckResourceAttr(resourceName, "steps.2.custom_step_details.#", "0"), + resource.TestCheckResourceAttr(resourceName, "steps.2.decrypt_step_details.#", "1"), + resource.TestCheckResourceAttr(resourceName, "steps.2.decrypt_step_details.0.destination_file_location.#", "1"), + resource.TestCheckResourceAttr(resourceName, "steps.2.decrypt_step_details.0.destination_file_location.0.efs_file_location.#", "1"), + resource.TestCheckResourceAttrPair(resourceName, "steps.2.decrypt_step_details.0.destination_file_location.0.efs_file_location.0.file_system_id", "aws_efs_file_system.test", "id"), + resource.TestCheckResourceAttr(resourceName, "steps.2.decrypt_step_details.0.destination_file_location.0.efs_file_location.0.path", "/test"), + resource.TestCheckResourceAttr(resourceName, "steps.2.decrypt_step_details.0.destination_file_location.0.s3_file_location.#", "0"), + resource.TestCheckResourceAttr(resourceName, "steps.2.decrypt_step_details.0.name", rName), + resource.TestCheckResourceAttr(resourceName, "steps.2.decrypt_step_details.0.overwrite_existing", "FALSE"), + resource.TestCheckResourceAttr(resourceName, "steps.2.decrypt_step_details.0.source_file_location", "${original.file}"), + resource.TestCheckResourceAttr(resourceName, "steps.2.decrypt_step_details.0.type", "PGP"), + resource.TestCheckResourceAttr(resourceName, "steps.2.delete_step_details.#", "0"), + resource.TestCheckResourceAttr(resourceName, "steps.2.tag_step_details.#", "0"), + resource.TestCheckResourceAttr(resourceName, "steps.2.type", "DECRYPT"), + resource.TestCheckResourceAttr(resourceName, "steps.3.copy_step_details.#", "0"), + resource.TestCheckResourceAttr(resourceName, "steps.3.custom_step_details.#", "0"), + resource.TestCheckResourceAttr(resourceName, "steps.3.decrypt_step_details.#", "0"), + resource.TestCheckResourceAttr(resourceName, "steps.3.delete_step_details.#", "1"), + resource.TestCheckResourceAttr(resourceName, "steps.3.delete_step_details.0.name", rName), + resource.TestCheckResourceAttr(resourceName, "steps.3.delete_step_details.0.source_file_location", "${original.file}"), + resource.TestCheckResourceAttr(resourceName, "steps.3.tag_step_details.#", "0"), + resource.TestCheckResourceAttr(resourceName, "steps.3.type", "DELETE"), + resource.TestCheckResourceAttr(resourceName, "steps.4.copy_step_details.#", "0"), + resource.TestCheckResourceAttr(resourceName, "steps.4.custom_step_details.#", "0"), + resource.TestCheckResourceAttr(resourceName, "steps.4.decrypt_step_details.#", "0"), + resource.TestCheckResourceAttr(resourceName, "steps.4.delete_step_details.#", "0"), + resource.TestCheckResourceAttr(resourceName, "steps.4.tag_step_details.#", "1"), + resource.TestCheckResourceAttr(resourceName, "steps.4.tag_step_details.0.name", rName), + resource.TestCheckResourceAttr(resourceName, "steps.4.tag_step_details.0.source_file_location", "${original.file}"), + resource.TestCheckResourceAttr(resourceName, "steps.4.tag_step_details.0.tags.#", "2"), + resource.TestCheckResourceAttr(resourceName, "steps.4.tag_step_details.0.tags.0.key", "key1"), + resource.TestCheckResourceAttr(resourceName, "steps.4.tag_step_details.0.tags.0.value", "value1"), + resource.TestCheckResourceAttr(resourceName, "steps.4.tag_step_details.0.tags.1.key", "key2"), + resource.TestCheckResourceAttr(resourceName, "steps.4.tag_step_details.0.tags.1.value", "value2"), + resource.TestCheckResourceAttr(resourceName, "steps.4.type", "TAG"), + resource.TestCheckResourceAttr(resourceName, "tags.%", "0"), + ), + }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, + }, + }) +} + func testAccCheckWorkflowExists(ctx context.Context, n string, v *transfer.DescribedWorkflow) resource.TestCheckFunc { return func(s *terraform.State) error { rs, ok := s.RootModule().Resources[n] @@ -340,3 +431,89 @@ resource "aws_transfer_workflow" "test" { } `, rName, tagKey1, tagValue1, tagKey2, tagValue2) } + +func testAccWorkflowConfig_allSteps(rName string) string { + return acctest.ConfigCompose(acctest.ConfigLambdaBase(rName, rName, rName), fmt.Sprintf(` +resource "aws_lambda_function" "test" { + filename = "test-fixtures/lambdatest.zip" + function_name = %[1]q + role = aws_iam_role.iam_for_lambda.arn + handler = "index.handler" + runtime = "nodejs14.x" +} + +resource "aws_efs_file_system" "test" { + tags = { + Name = %[1]q + } +} + +resource "aws_transfer_workflow" "test" { + steps { + copy_step_details { + name = %[1]q + source_file_location = "$${original.file}" + destination_file_location { + s3_file_location { + bucket = "testing" + key = "k1" + } + } + overwrite_existing = "TRUE" + } + type = "COPY" + } + + steps { + custom_step_details { + name = %[1]q + source_file_location = "$${original.file}" + target = aws_lambda_function.test.arn + timeout_seconds = 1001 + } + type = "CUSTOM" + } + + steps { + decrypt_step_details { + name = %[1]q + source_file_location = "$${original.file}" + destination_file_location { + efs_file_location { + file_system_id = aws_efs_file_system.test.id + path = "/test" + } + } + type = "PGP" + } + type = "DECRYPT" + } + + steps { + delete_step_details { + name = %[1]q + source_file_location = "$${original.file}" + } + type = "DELETE" + } + + steps { + tag_step_details { + name = %[1]q + source_file_location = "$${original.file}" + + tags { + key = "key1" + value = "value1" + } + + tags { + key = "key2" + value = "value2" + } + } + type = "TAG" + } +} +`, rName)) +} diff --git a/website/docs/r/transfer_workflow.html.markdown b/website/docs/r/transfer_workflow.html.markdown index 0cfcfe5a6617..7897549227c8 100644 --- a/website/docs/r/transfer_workflow.html.markdown +++ b/website/docs/r/transfer_workflow.html.markdown @@ -92,6 +92,7 @@ The following arguments are supported: * `name` - (Optional) The name of the step, used as an identifier. * `overwrite_existing` - (Optional) A flag that indicates whether or not to overwrite an existing file of the same name. The default is `FALSE`. Valid values are `TRUE` and `FALSE`. * `source_file_location` - (Optional) Specifies which file to use as input to the workflow step: either the output from the previous step, or the originally uploaded file for the workflow. Enter ${previous.file} to use the previous file as the input. In this case, this workflow step uses the output file from the previous workflow step as input. This is the default value. Enter ${original.file} to use the originally-uploaded file location as input for this step. +* `type` - (Required) The type of encryption used. Currently, this value must be `"PGP"`. #### Delete Step Details From 044dd3f63d02dff39f907cf897505f3823e0c665 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Fri, 3 Mar 2023 13:41:19 -0500 Subject: [PATCH 395/763] r/aws_transfer_server: 'protocol_details' is Computed. Acceptance test output: % make testacc TESTARGS='-run=TestAccTransfer_serial/Server/basic' PKG=transfer ==> Checking that code complies with gofmt requirements... TF_ACC=1 go test ./internal/service/transfer/... -v -count 1 -parallel 20 -run=TestAccTransfer_serial/Server/basic -timeout 180m === RUN TestAccTransfer_serial === PAUSE TestAccTransfer_serial === CONT TestAccTransfer_serial === RUN TestAccTransfer_serial/Server === RUN TestAccTransfer_serial/Server/basic --- PASS: TestAccTransfer_serial (201.82s) --- PASS: TestAccTransfer_serial/Server (201.82s) --- PASS: TestAccTransfer_serial/Server/basic (201.82s) PASS ok github.com/hashicorp/terraform-provider-aws/internal/service/transfer 207.022s % make testacc TESTARGS='-run=TestAccTransfer_serial/Server/ProtocolDetails' PKG=transfer ==> Checking that code complies with gofmt requirements... TF_ACC=1 go test ./internal/service/transfer/... -v -count 1 -parallel 20 -run=TestAccTransfer_serial/Server/ProtocolDetails -timeout 180m === RUN TestAccTransfer_serial === PAUSE TestAccTransfer_serial === CONT TestAccTransfer_serial === RUN TestAccTransfer_serial/Server === RUN TestAccTransfer_serial/Server/ProtocolDetails --- PASS: TestAccTransfer_serial (200.96s) --- PASS: TestAccTransfer_serial/Server (200.96s) --- PASS: TestAccTransfer_serial/Server/ProtocolDetails (200.96s) PASS ok github.com/hashicorp/terraform-provider-aws/internal/service/transfer 206.064s --- internal/service/transfer/server.go | 45 +++++++++++++------- internal/service/transfer/server_test.go | 20 ++++++--- website/docs/r/transfer_server.html.markdown | 5 ++- 3 files changed, 46 insertions(+), 24 deletions(-) diff --git a/internal/service/transfer/server.go b/internal/service/transfer/server.go index c226649fef43..35b3be4d1769 100644 --- a/internal/service/transfer/server.go +++ b/internal/service/transfer/server.go @@ -171,30 +171,37 @@ func ResourceServer() *schema.Resource { "protocol_details": { Type: schema.TypeList, Optional: true, + Computed: true, MaxItems: 1, Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ + "as2_transports": { + Type: schema.TypeSet, + Optional: true, + Computed: true, + MaxItems: 1, + Elem: &schema.Schema{ + Type: schema.TypeString, + ValidateFunc: validation.StringInSlice(transfer.As2Transport_Values(), false), + }, + }, "passive_ip": { Type: schema.TypeString, Optional: true, + Computed: true, ValidateFunc: validation.StringLenBetween(0, 15), }, "set_stat_option": { - Type: schema.TypeString, - Optional: true, - ValidateFunc: validation.StringInSlice([]string{ - "DEFAULT", - "ENABLE_NO_OP", - }, false), + Type: schema.TypeString, + Optional: true, + Computed: true, + ValidateFunc: validation.StringInSlice(transfer.SetStatOption_Values(), false), }, "tls_session_resumption_mode": { - Type: schema.TypeString, - Optional: true, - ValidateFunc: validation.StringInSlice([]string{ - "DISABLED", - "ENABLED", - "ENFORCED", - }, false), + Type: schema.TypeString, + Optional: true, + Computed: true, + ValidateFunc: validation.StringInSlice(transfer.TlsSessionResumptionMode_Values(), false), }, }, }, @@ -479,11 +486,9 @@ func resourceServerRead(ctx context.Context, d *schema.ResourceData, meta interf d.Set("logging_role", output.LoggingRole) d.Set("post_authentication_login_banner", output.PostAuthenticationLoginBanner) d.Set("pre_authentication_login_banner", output.PreAuthenticationLoginBanner) - if err := d.Set("protocol_details", flattenProtocolDetails(output.ProtocolDetails)); err != nil { - return fmt.Errorf("error setting protocol_details: %w", err) + return sdkdiag.AppendErrorf(diags, "setting protocol_details: %s", err) } - d.Set("protocols", aws.StringValueSlice(output.Protocols)) d.Set("security_policy_name", output.SecurityPolicyName) if output.IdentityProviderDetails != nil { @@ -864,6 +869,10 @@ func expandProtocolDetails(m []interface{}) *transfer.ProtocolDetails { apiObject := &transfer.ProtocolDetails{} + if v, ok := tfMap["as2_transports"].(*schema.Set); ok && v.Len() > 0 { + apiObject.As2Transports = flex.ExpandStringSet(v) + } + if v, ok := tfMap["passive_ip"].(string); ok && len(v) > 0 { apiObject.PassiveIp = aws.String(v) } @@ -886,6 +895,10 @@ func flattenProtocolDetails(apiObject *transfer.ProtocolDetails) []interface{} { tfMap := map[string]interface{}{} + if v := apiObject.As2Transports; v != nil { + tfMap["as2_transport"] = aws.StringValueSlice(v) + } + if v := apiObject.PassiveIp; v != nil { tfMap["passive_ip"] = aws.StringValue(v) } diff --git a/internal/service/transfer/server_test.go b/internal/service/transfer/server_test.go index 0be3b05c1975..73724ff3e29e 100644 --- a/internal/service/transfer/server_test.go +++ b/internal/service/transfer/server_test.go @@ -60,6 +60,11 @@ func testAccServer_basic(t *testing.T) { resource.TestCheckResourceAttr(resourceName, "logging_role", ""), resource.TestCheckResourceAttr(resourceName, "post_authentication_login_banner", ""), resource.TestCheckResourceAttr(resourceName, "pre_authentication_login_banner", ""), + resource.TestCheckResourceAttr(resourceName, "protocol_details.#", "1"), + resource.TestCheckResourceAttr(resourceName, "protocol_details.0.as2_transports.#", "0"), + resource.TestCheckResourceAttr(resourceName, "protocol_details.0.passive_ip", "AUTO"), + resource.TestCheckResourceAttr(resourceName, "protocol_details.0.set_stat_option", "DEFAULT"), + resource.TestCheckResourceAttr(resourceName, "protocol_details.0.tls_session_resumption_mode", "ENFORCED"), resource.TestCheckResourceAttr(resourceName, "protocols.#", "1"), resource.TestCheckTypeSetElemAttr(resourceName, "protocols.*", "SFTP"), resource.TestCheckResourceAttr(resourceName, "security_policy_name", "TransferSecurityPolicy-2018-11"), @@ -792,20 +797,22 @@ func testAccServer_protocols(t *testing.T) { } func testAccServer_protocolDetails(t *testing.T) { + ctx := acctest.Context(t) var s transfer.DescribedServer resourceName := "aws_transfer_server.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(t) }, + PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, transfer.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - CheckDestroy: testAccCheckServerDestroy, + CheckDestroy: testAccCheckServerDestroy(ctx), Steps: []resource.TestStep{ { Config: testAccServerConfig_protocolDetails("AUTO", "DEFAULT", "ENFORCED"), Check: resource.ComposeTestCheckFunc( - testAccCheckServerExists(resourceName, &s), + testAccCheckServerExists(ctx, resourceName, &s), resource.TestCheckResourceAttr(resourceName, "protocol_details.#", "1"), + resource.TestCheckResourceAttr(resourceName, "protocol_details.0.as2_transports.#", "0"), resource.TestCheckResourceAttr(resourceName, "protocol_details.0.passive_ip", "AUTO"), resource.TestCheckResourceAttr(resourceName, "protocol_details.0.set_stat_option", "DEFAULT"), resource.TestCheckResourceAttr(resourceName, "protocol_details.0.tls_session_resumption_mode", "ENFORCED"), @@ -818,11 +825,12 @@ func testAccServer_protocolDetails(t *testing.T) { ImportStateVerifyIgnore: []string{"force_destroy"}, }, { - Config: testAccServerConfig_protocolDetails("AUTO", "ENABLE_NO_OP", "DISABLED"), + Config: testAccServerConfig_protocolDetails("8.8.8.8", "ENABLE_NO_OP", "DISABLED"), Check: resource.ComposeTestCheckFunc( - testAccCheckServerExists(resourceName, &s), + testAccCheckServerExists(ctx, resourceName, &s), resource.TestCheckResourceAttr(resourceName, "protocol_details.#", "1"), - resource.TestCheckResourceAttr(resourceName, "protocol_details.0.passive_ip", "AUTO"), + resource.TestCheckResourceAttr(resourceName, "protocol_details.0.as2_transports.#", "0"), + resource.TestCheckResourceAttr(resourceName, "protocol_details.0.passive_ip", "8.8.8.8"), resource.TestCheckResourceAttr(resourceName, "protocol_details.0.set_stat_option", "ENABLE_NO_OP"), resource.TestCheckResourceAttr(resourceName, "protocol_details.0.tls_session_resumption_mode", "DISABLED"), ), diff --git a/website/docs/r/transfer_server.html.markdown b/website/docs/r/transfer_server.html.markdown index a5c881a3fdf8..f06f3be50676 100644 --- a/website/docs/r/transfer_server.html.markdown +++ b/website/docs/r/transfer_server.html.markdown @@ -123,9 +123,10 @@ The following arguments are supported: ### Protocol Details +* `as2_transports` - (Optional) Indicates the transport method for the AS2 messages. Currently, only `HTTP` is supported. * `passive_ip` - (Optional) Indicates passive mode, for FTP and FTPS protocols. Enter a single IPv4 address, such as the public IP address of a firewall, router, or load balancer. -* `set_stat_option` - (Optional) Use to ignore the error that is generated when the client attempts to use `SETSTAT` on a file you are uploading to an S3 bucket. -* `tls_session_resumption_mode` - (Optional) A property used with Transfer Family servers that use the FTPS protocol. Provides a mechanism to resume or share a negotiated secret key between the control and data connection for an FTPS session. +* `set_stat_option` - (Optional) Use to ignore the error that is generated when the client attempts to use `SETSTAT` on a file you are uploading to an S3 bucket. Valid values: `DEFAULT`, `ENABLE_NO_OP`. +* `tls_session_resumption_mode` - (Optional) A property used with Transfer Family servers that use the FTPS protocol. Provides a mechanism to resume or share a negotiated secret key between the control and data connection for an FTPS session. Valid values: `DISABLED`, `ENABLED`, `ENFORCED`. ### Workflow Details From 52ad6cf221036b6428981d61ddbbb68ec37b01e7 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Fri, 3 Mar 2023 14:12:50 -0500 Subject: [PATCH 396/763] Fix providerlint 'S018: schema should use TypeList with MaxItems 1'. --- internal/service/transfer/server.go | 1 - 1 file changed, 1 deletion(-) diff --git a/internal/service/transfer/server.go b/internal/service/transfer/server.go index 35b3be4d1769..fe2f3afe685f 100644 --- a/internal/service/transfer/server.go +++ b/internal/service/transfer/server.go @@ -179,7 +179,6 @@ func ResourceServer() *schema.Resource { Type: schema.TypeSet, Optional: true, Computed: true, - MaxItems: 1, Elem: &schema.Schema{ Type: schema.TypeString, ValidateFunc: validation.StringInSlice(transfer.As2Transport_Values(), false), From 7857dc5e098d8b953953d67d11b283ccc6153545 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Fri, 3 Mar 2023 14:19:12 -0500 Subject: [PATCH 397/763] Remove 'make top5services'. --- GNUmakefile | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/GNUmakefile b/GNUmakefile index 7272fffa341c..b2ab0c0a9407 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -307,16 +307,6 @@ tools: cd .ci/tools && $(GO_VER) install github.com/rhysd/actionlint/cmd/actionlint cd .ci/tools && $(GO_VER) install mvdan.cc/gofumpt -top5services: - @echo "==> Rapid smoke test of top 5 services" - TF_ACC=1 $(GO_VER) test \ - ./internal/service/ec2/... \ - ./internal/service/iam/... \ - ./internal/service/logs/... \ - ./internal/service/meta/... \ - ./internal/service/sts/... \ - -v -count $(TEST_COUNT) -parallel $(ACCTEST_PARALLELISM) -run='TestAccIAMRole_basic|TestAccSTSCallerIdentityDataSource_basic|TestAccVPCSecurityGroup_tags|TestAccLogsGroup_basic|TestAccMetaRegionDataSource_basic' -timeout $(ACCTEST_TIMEOUT) - website-link-check: @.ci/scripts/markdown-link-check.sh @@ -380,7 +370,6 @@ yamllint: testacc-lint-fix \ tfsdk2fw \ tools \ - top5services \ website-link-check \ website-link-check-ghrc \ website-lint \ From c0c6a7e6b73c43715b68ba69cc0a69430fc75d55 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Fri, 3 Mar 2023 15:33:37 -0500 Subject: [PATCH 398/763] Update transfer_server.html.markdown --- website/docs/r/transfer_server.html.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/website/docs/r/transfer_server.html.markdown b/website/docs/r/transfer_server.html.markdown index f06f3be50676..77a64d2d71da 100644 --- a/website/docs/r/transfer_server.html.markdown +++ b/website/docs/r/transfer_server.html.markdown @@ -99,7 +99,7 @@ The following arguments are supported: * `endpoint_details` - (Optional) The virtual private cloud (VPC) endpoint settings that you want to configure for your SFTP server. Fields documented below. * `endpoint_type` - (Optional) The type of endpoint that you want your SFTP server connect to. If you connect to a `VPC` (or `VPC_ENDPOINT`), your SFTP server isn't accessible over the public internet. If you want to connect your SFTP server via public internet, set `PUBLIC`. Defaults to `PUBLIC`. * `invocation_role` - (Optional) Amazon Resource Name (ARN) of the IAM role used to authenticate the user account with an `identity_provider_type` of `API_GATEWAY`. -* `host_key` - (Optional) RSA private key (e.g., as generated by the `ssh-keygen -N "" -m PEM -f my-new-server-key` command). +* `host_key` - (Optional) RSA, ECDSA, or ED25519 private key (e.g., as generated by the `ssh-keygen -t rsa -b 2048 -N "" -m PEM -f my-new-server-key`, `ssh-keygen -t ecdsa -b 256 -N "" -m PEM -f my-new-server-key` or `ssh-keygen -t ed25519 -N "" -f my-new-server-key` commands). * `url` - (Optional) - URL of the service endpoint used to authenticate users with an `identity_provider_type` of `API_GATEWAY`. * `identity_provider_type` - (Optional) The mode of authentication enabled for this service. The default value is `SERVICE_MANAGED`, which allows you to store and access SFTP user credentials within the service. `API_GATEWAY` indicates that user authentication requires a call to an API Gateway endpoint URL provided by you to integrate an identity provider of your choice. Using `AWS_DIRECTORY_SERVICE` will allow for authentication against AWS Managed Active Directory or Microsoft Active Directory in your on-premises environment, or in AWS using AD Connectors. Use the `AWS_LAMBDA` value to directly use a Lambda function as your identity provider. If you choose this value, you must specify the ARN for the lambda function in the `function` argument. * `directory_id` - (Optional) The directory service ID of the directory service you want to connect to with an `identity_provider_type` of `AWS_DIRECTORY_SERVICE`. From fb55161c838cee88ce636e912258dacca3764690 Mon Sep 17 00:00:00 2001 From: Jared Baker Date: Wed, 1 Mar 2023 15:39:02 -0500 Subject: [PATCH 399/763] d/aws_ecs_task_execution: data source implementation --- internal/service/ecs/service_package_gen.go | 1 + .../service/ecs/task_execution_data_source.go | 477 ++++++++++++++++++ 2 files changed, 478 insertions(+) create mode 100644 internal/service/ecs/task_execution_data_source.go diff --git a/internal/service/ecs/service_package_gen.go b/internal/service/ecs/service_package_gen.go index f77ff991f175..238a14617987 100644 --- a/internal/service/ecs/service_package_gen.go +++ b/internal/service/ecs/service_package_gen.go @@ -27,6 +27,7 @@ func (p *servicePackage) SDKDataSources(ctx context.Context) map[string]func() * "aws_ecs_container_definition": DataSourceContainerDefinition, "aws_ecs_service": DataSourceService, "aws_ecs_task_definition": DataSourceTaskDefinition, + "aws_ecs_task_execution": DataSourceTaskExecution, } } diff --git a/internal/service/ecs/task_execution_data_source.go b/internal/service/ecs/task_execution_data_source.go new file mode 100644 index 000000000000..0057cce6b3da --- /dev/null +++ b/internal/service/ecs/task_execution_data_source.go @@ -0,0 +1,477 @@ +package ecs + +import ( + "context" + "strings" + + "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/service/ecs" + "github.com/hashicorp/terraform-plugin-sdk/v2/diag" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" + "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/create" + "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/names" +) + +// @SDKDataSource("aws_ecs_task_execution") +func DataSourceTaskExecution() *schema.Resource { + return &schema.Resource{ + ReadWithoutTimeout: dataSourceTaskExecutionRead, + + Schema: map[string]*schema.Schema{ + "capacity_provider_strategy": { + Type: schema.TypeSet, + Optional: true, + 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), + }, + }, + }, + }, + "cluster": { + Type: schema.TypeString, + Required: true, + }, + "desired_count": { + Type: schema.TypeInt, + Optional: true, + ValidateFunc: validation.IntBetween(0, 10), + }, + "enable_ecs_managed_tags": { + Type: schema.TypeBool, + Optional: true, + }, + "enable_execute_command": { + Type: schema.TypeBool, + Optional: true, + }, + "group": { + Type: schema.TypeString, + Optional: true, + }, + "launch_type": { + Type: schema.TypeString, + Optional: true, + ValidateFunc: validation.StringInSlice(ecs.LaunchType_Values(), false), + }, + "network_configuration": { + Type: schema.TypeList, + Optional: true, + MaxItems: 1, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "security_groups": { + Type: schema.TypeSet, + Optional: true, + Elem: &schema.Schema{Type: schema.TypeString}, + Set: schema.HashString, + }, + "subnets": { + Type: schema.TypeSet, + Required: true, + Elem: &schema.Schema{Type: schema.TypeString}, + Set: schema.HashString, + }, + "assign_public_ip": { + Type: schema.TypeBool, + Optional: true, + Default: false, + }, + }, + }, + }, + "overrides": { + Type: schema.TypeList, + Optional: true, + MaxItems: 1, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "container_overrides": { + Type: schema.TypeList, + Optional: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "command": { + Type: schema.TypeList, + Optional: true, + Elem: &schema.Schema{Type: schema.TypeString}, + }, + "cpu": { + Type: schema.TypeInt, + Optional: true, + }, + "environment": { + Type: schema.TypeSet, + Optional: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "key": { + Type: schema.TypeString, + Required: true, + }, + "value": { + Type: schema.TypeString, + Required: true, + }, + }, + }, + }, + "memory": { + Type: schema.TypeInt, + Optional: true, + }, + "memory_reservation": { + Type: schema.TypeInt, + Optional: true, + }, + "name": { + Type: schema.TypeString, + Required: true, + }, + "resource_requirements": { + Type: schema.TypeSet, + Optional: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "type": { + Type: schema.TypeString, + Required: true, + ValidateFunc: validation.StringInSlice(ecs.ResourceType_Values(), false), + }, + "value": { + Type: schema.TypeString, + Required: true, + }, + }, + }, + }, + }, + }, + }, + "cpu": { + Type: schema.TypeString, + Optional: true, + }, + "execution_role_arn": { + Type: schema.TypeString, + Optional: true, + }, + "inference_accelerator_overrides": { + Type: schema.TypeSet, + Optional: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "device_name": { + Type: schema.TypeString, + Optional: true, + }, + "device_type": { + Type: schema.TypeString, + Optional: true, + }, + }, + }, + }, + "memory": { + Type: schema.TypeString, + Optional: true, + }, + "task_role_arn": { + Type: schema.TypeString, + Optional: true, + }, + }, + }, + }, + "placement_constraints": { + Type: schema.TypeSet, + Optional: true, + MaxItems: 10, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "expression": { + Type: schema.TypeString, + Optional: true, + }, + "type": { + Type: schema.TypeString, + Required: true, + ValidateFunc: validation.StringInSlice(ecs.PlacementConstraintType_Values(), false), + }, + }, + }, + }, + "placement_strategy": { + Type: schema.TypeList, + Optional: true, + MaxItems: 5, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "field": { + Type: schema.TypeString, + Optional: true, + }, + "type": { + Type: schema.TypeString, + Required: true, + }, + }, + }, + }, + "platform_version": { + Type: schema.TypeString, + Optional: true, + }, + "propagate_tags": { + Type: schema.TypeString, + Optional: true, + ValidateFunc: validation.StringInSlice(ecs.PropagateTags_Values(), false), + }, + "reference_id": { + Type: schema.TypeString, + Optional: true, + }, + "started_by": { + Type: schema.TypeString, + Optional: true, + }, + "tags": tftags.TagsSchema(), + "task_arns": { + Type: schema.TypeList, + Computed: true, + Elem: &schema.Schema{Type: schema.TypeString}, + }, + "task_definition": { + Type: schema.TypeString, + Required: true, + }, + }, + } +} + +const ( + DSNameTaskExecution = "Task Execution Data Source" +) + +func dataSourceTaskExecutionRead(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { + var diags diag.Diagnostics + conn := meta.(*conns.AWSClient).ECSConn() + + cluster := d.Get("cluster").(string) + taskDefinition := d.Get("task_definition").(string) + d.SetId(strings.Join([]string{cluster, taskDefinition}, ",")) + + input := ecs.RunTaskInput{ + Cluster: aws.String(cluster), + TaskDefinition: aws.String(taskDefinition), + } + + defaultTagsConfig := meta.(*conns.AWSClient).DefaultTagsConfig + tags := defaultTagsConfig.MergeTags(tftags.New(ctx, d.Get("tags").(map[string]interface{}))) + if len(tags) > 0 { + input.Tags = Tags(tags.IgnoreAWS()) + } + + if v, ok := d.GetOk("capacity_provider_strategy"); ok { + input.CapacityProviderStrategy = expandCapacityProviderStrategy(v.(*schema.Set)) + } + if v, ok := d.GetOk("desired_count"); ok { + input.Count = aws.Int64(int64(v.(int))) + } + if v, ok := d.GetOk("enable_ecs_managed_tags"); ok { + input.EnableECSManagedTags = aws.Bool(v.(bool)) + } + if v, ok := d.GetOk("enable_execute_command"); ok { + input.EnableExecuteCommand = aws.Bool(v.(bool)) + } + if v, ok := d.GetOk("group"); ok { + input.Group = aws.String(v.(string)) + } + if v, ok := d.GetOk("launch_type"); ok { + input.LaunchType = aws.String(v.(string)) + } + if v, ok := d.GetOk("network_configuration"); ok { + input.NetworkConfiguration = expandNetworkConfiguration(v.([]interface{})) + } + if v, ok := d.GetOk("overrides"); ok { + input.Overrides = expandTaskOverride(v.([]interface{})) + } + if v, ok := d.GetOk("placement_constraints"); ok { + pc, err := expandPlacementConstraints(v.(*schema.Set).List()) + if err != nil { + return create.DiagError(names.ECS, create.ErrActionCreating, DSNameTaskExecution, d.Id(), err) + } + input.PlacementConstraints = pc + } + if v, ok := d.GetOk("placement_strategy"); ok { + ps, err := expandPlacementStrategy(v.([]interface{})) + if err != nil { + return create.DiagError(names.ECS, create.ErrActionCreating, DSNameTaskExecution, d.Id(), err) + } + input.PlacementStrategy = ps + } + if v, ok := d.GetOk("platform_version"); ok { + input.PlatformVersion = aws.String(v.(string)) + } + if v, ok := d.GetOk("propagate_tags"); ok { + input.PropagateTags = aws.String(v.(string)) + } + if v, ok := d.GetOk("reference_id"); ok { + input.ReferenceId = aws.String(v.(string)) + } + if v, ok := d.GetOk("started_by"); ok { + input.StartedBy = aws.String(v.(string)) + } + + out, err := conn.RunTaskWithContext(ctx, &input) + if err != nil { + return create.DiagError(names.ECS, create.ErrActionCreating, DSNameTaskExecution, d.Id(), err) + } + if out == nil || len(out.Tasks) == 0 { + return create.DiagError(names.ECS, create.ErrActionCreating, DSNameTaskExecution, d.Id(), tfresource.NewEmptyResultError(input)) + } + + var taskArns []*string + for _, t := range out.Tasks { + taskArns = append(taskArns, t.TaskArn) + } + d.Set("task_arns", flex.FlattenStringList(taskArns)) + + return diags +} + +func expandTaskOverride(tfList []interface{}) *ecs.TaskOverride { + if len(tfList) == 0 { + return nil + } + apiObject := &ecs.TaskOverride{} + tfMap := tfList[0].(map[string]interface{}) + + if v, ok := tfMap["cpu"]; ok { + apiObject.Cpu = aws.String(v.(string)) + } + if v, ok := tfMap["memory"]; ok { + apiObject.Memory = aws.String(v.(string)) + } + if v, ok := tfMap["execution_role_arn"]; ok { + apiObject.ExecutionRoleArn = aws.String(v.(string)) + } + if v, ok := tfMap["task_role_arn"]; ok { + apiObject.TaskRoleArn = aws.String(v.(string)) + } + if v, ok := tfMap["inference_accelerator_overrides"]; ok { + apiObject.InferenceAcceleratorOverrides = expandInferenceAcceleratorOverrides(v.([]interface{})) + } + if v, ok := tfMap["container_overrides"]; ok { + apiObject.ContainerOverrides = expandContainerOverride(v.([]interface{})) + } + + return apiObject +} + +func expandInferenceAcceleratorOverrides(tfList []interface{}) []*ecs.InferenceAcceleratorOverride { + if len(tfList) == 0 { + return nil + } + apiObject := make([]*ecs.InferenceAcceleratorOverride, 0) + + for _, item := range tfList { + tfMap := item.(map[string]interface{}) + iao := &ecs.InferenceAcceleratorOverride{ + DeviceName: aws.String(tfMap["device_name"].(string)), + DeviceType: aws.String(tfMap["device_type"].(string)), + } + apiObject = append(apiObject, iao) + } + + return apiObject +} + +func expandContainerOverride(tfList []interface{}) []*ecs.ContainerOverride { + if len(tfList) == 0 { + return nil + } + apiObject := make([]*ecs.ContainerOverride, 0) + + for _, item := range tfList { + tfMap := item.(map[string]interface{}) + co := &ecs.ContainerOverride{ + Name: aws.String(tfMap["name"].(string)), + } + if v, ok := tfMap["command"]; ok { + commandStrings := v.([]interface{}) + co.Command = flex.ExpandStringList(commandStrings) + } + if v, ok := tfMap["cpu"]; ok { + co.Cpu = aws.Int64(v.(int64)) + } + if v, ok := tfMap["environment"]; ok { + co.Environment = expandTaskEnvironment(v.([]interface{})) + } + if v, ok := tfMap["memory"]; ok { + co.Memory = aws.Int64(v.(int64)) + } + if v, ok := tfMap["memory_reservation"]; ok { + co.Memory = aws.Int64(v.(int64)) + } + if v, ok := tfMap["resource_requirements"]; ok { + co.ResourceRequirements = expandResourceRequirements(v.([]interface{})) + } + apiObject = append(apiObject, co) + } + + return apiObject +} + +func expandTaskEnvironment(tfList []interface{}) []*ecs.KeyValuePair { + if len(tfList) == 0 { + return nil + } + apiObject := make([]*ecs.KeyValuePair, 0) + + for _, item := range tfList { + tfMap := item.(map[string]interface{}) + te := &ecs.KeyValuePair{ + Name: aws.String(tfMap["name"].(string)), + Value: aws.String(tfMap["value"].(string)), + } + apiObject = append(apiObject, te) + } + + return apiObject +} + +func expandResourceRequirements(tfList []interface{}) []*ecs.ResourceRequirement { + if len(tfList) == 0 { + return nil + } + + apiObject := make([]*ecs.ResourceRequirement, 0) + for _, item := range tfList { + tfMap := item.(map[string]interface{}) + rr := &ecs.ResourceRequirement{ + Type: aws.String(tfMap["type"].(string)), + Value: aws.String(tfMap["value"].(string)), + } + apiObject = append(apiObject, rr) + } + + return apiObject +} From 0f15143b4ae681ff3c2a031ad4c55f12e22bcdf8 Mon Sep 17 00:00:00 2001 From: Jared Baker Date: Wed, 1 Mar 2023 17:10:37 -0500 Subject: [PATCH 400/763] d/aws_ecs_task_execution: tests --- .../ecs/task_execution_data_source_test.go | 181 ++++++++++++++++++ 1 file changed, 181 insertions(+) create mode 100644 internal/service/ecs/task_execution_data_source_test.go diff --git a/internal/service/ecs/task_execution_data_source_test.go b/internal/service/ecs/task_execution_data_source_test.go new file mode 100644 index 000000000000..a09d63eaa7b9 --- /dev/null +++ b/internal/service/ecs/task_execution_data_source_test.go @@ -0,0 +1,181 @@ +package ecs_test + +import ( + "fmt" + "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-provider-aws/internal/acctest" +) + +func TestAccECSTaskExecutionDataSource_basic(t *testing.T) { + if testing.Short() { + t.Skip("skipping long-running test in short mode") + } + + rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) + dataSourceName := "data.aws_ecs_task_execution.test" + clusterName := "aws_ecs_cluster.test" + taskDefinitionName := "aws_ecs_task_definition.test" + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { + acctest.PreCheck(t) + acctest.PreCheckPartitionHasService(t, ecs.EndpointsID) + }, + ErrorCheck: acctest.ErrorCheck(t, ecs.EndpointsID), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + Steps: []resource.TestStep{ + { + Config: testAccTaskExecutionDataSourceConfig_basic(rName), + Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttrPair(dataSourceName, "cluster", clusterName, "id"), + resource.TestCheckResourceAttrPair(dataSourceName, "task_definition", taskDefinitionName, "arn"), + resource.TestCheckResourceAttr(dataSourceName, "desired_count", "1"), + resource.TestCheckResourceAttr(dataSourceName, "launch_type", "FARGATE"), + resource.TestCheckResourceAttr(dataSourceName, "network_configuration.#", "1"), + resource.TestCheckResourceAttr(dataSourceName, "task_arns.#", "1"), + ), + }, + }, + }) +} + +func TestAccECSTaskExecutionDataSource_tags(t *testing.T) { + if testing.Short() { + t.Skip("skipping long-running test in short mode") + } + + rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) + dataSourceName := "data.aws_ecs_task_execution.test" + clusterName := "aws_ecs_cluster.test" + taskDefinitionName := "aws_ecs_task_definition.test" + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { + acctest.PreCheck(t) + acctest.PreCheckPartitionHasService(t, ecs.EndpointsID) + }, + ErrorCheck: acctest.ErrorCheck(t, ecs.EndpointsID), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + Steps: []resource.TestStep{ + { + Config: testAccTaskExecutionDataSourceConfig_tags(rName, "key1", "value1"), + Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttrPair(dataSourceName, "cluster", clusterName, "id"), + resource.TestCheckResourceAttrPair(dataSourceName, "task_definition", taskDefinitionName, "arn"), + resource.TestCheckResourceAttr(dataSourceName, "desired_count", "1"), + resource.TestCheckResourceAttr(dataSourceName, "launch_type", "FARGATE"), + resource.TestCheckResourceAttr(dataSourceName, "network_configuration.#", "1"), + resource.TestCheckResourceAttr(dataSourceName, "task_arns.#", "1"), + resource.TestCheckResourceAttr(dataSourceName, "tags.%", "1"), + resource.TestCheckResourceAttr(dataSourceName, "tags.key1", "value1"), + ), + }, + }, + }) +} + +func testAccTaskExecutionDataSourceConfig_base(rName string) string { + return fmt.Sprintf(` +resource "aws_security_group" "test" { + name = %[1]q + vpc_id = aws_vpc.test.id + + ingress { + protocol = "6" + from_port = 80 + to_port = 8000 + cidr_blocks = [aws_vpc.test.cidr_block] + } + + tags = { + Name = %[1]q + } +} + +resource "aws_ecs_cluster" "test" { + name = %[1]q +} + +resource "aws_ecs_cluster_capacity_providers" "test" { + cluster_name = aws_ecs_cluster.test.name + capacity_providers = ["FARGATE"] +} + +resource "aws_ecs_task_definition" "test" { + family = %[1]q + network_mode = "awsvpc" + requires_compatibilities = ["FARGATE"] + cpu = "256" + memory = "512" + + container_definitions = jsonencode([ + { + name = "sleep" + image = "busybox" + cpu = 10 + command = ["sleep", "10"] + memory = 10 + essential = true + portMappings = [ + { + protocol = "tcp" + containerPort = 8000 + } + ] + } + ]) +} +`, rName) +} + +func testAccTaskExecutionDataSourceConfig_basic(rName string) string { + return acctest.ConfigCompose( + acctest.ConfigVPCWithSubnets(rName, 2), + testAccTaskExecutionDataSourceConfig_base(rName), + ` +data "aws_ecs_task_execution" "test" { + depends_on = [aws_ecs_cluster_capacity_providers.test] + + cluster = aws_ecs_cluster.test.id + task_definition = aws_ecs_task_definition.test.arn + desired_count = 1 + launch_type = "FARGATE" + + network_configuration { + subnets = aws_subnet.test[*].id + security_groups = [aws_security_group.test.id] + assign_public_ip = false + } +} +`) +} + +func testAccTaskExecutionDataSourceConfig_tags(rName, tagKey1, tagValue1 string) string { + return acctest.ConfigCompose( + acctest.ConfigVPCWithSubnets(rName, 2), + testAccTaskExecutionDataSourceConfig_base(rName), + fmt.Sprintf(` +data "aws_ecs_task_execution" "test" { + depends_on = [aws_ecs_cluster_capacity_providers.test] + + cluster = aws_ecs_cluster.test.id + task_definition = aws_ecs_task_definition.test.arn + desired_count = 1 + launch_type = "FARGATE" + + network_configuration { + subnets = aws_subnet.test[*].id + security_groups = [aws_security_group.test.id] + assign_public_ip = false + } + + tags = { + %[1]q = %[2]q + } +} +`, tagKey1, tagValue1)) +} From d77a27881f2e0bf594acb83b3f177b39178cf839 Mon Sep 17 00:00:00 2001 From: Jared Baker Date: Fri, 3 Mar 2023 15:40:09 -0500 Subject: [PATCH 401/763] d/aws_ecs_task_execution: docs --- .../docs/d/ecs_task_execution.html.markdown | 124 ++++++++++++++++++ 1 file changed, 124 insertions(+) create mode 100644 website/docs/d/ecs_task_execution.html.markdown diff --git a/website/docs/d/ecs_task_execution.html.markdown b/website/docs/d/ecs_task_execution.html.markdown new file mode 100644 index 000000000000..6ea191b3e5a3 --- /dev/null +++ b/website/docs/d/ecs_task_execution.html.markdown @@ -0,0 +1,124 @@ +--- +subcategory: "ECS (Elastic Container)" +layout: "aws" +page_title: "AWS: aws_ecs_task_execution" +description: |- + Terraform data source for managing an AWS ECS (Elastic Container) Task Execution. +--- + +# Data Source: aws_ecs_task_execution + +Terraform data source for managing an AWS ECS (Elastic Container) Task Execution. This data source calls the [RunTask](https://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_RunTask.html) API, allowing execution of one-time tasks that don't fit a standard resource lifecycle. See the [feature request issue](https://github.com/hashicorp/terraform-provider-aws/issues/1703) for additional context. + +~> **NOTE on plan operations:** This data source calls the `RunTask` API on every read operation, which means new task(s) may be created from a `terraform plan` command if all attributes are known. Placing this functionality behind a data source is an intentional trade off to enable use cases requiring a one-time task execution without relying on [provisioners](https://developer.hashicorp.com/terraform/language/resources/provisioners/syntax). Caution should be taken to ensure the data source is only executed once, or that the resulting tasks can safely run in parallel. + +## Example Usage + +### Basic Usage + +```terraform +data "aws_ecs_task_execution" "example" { + cluster = aws_ecs_cluster.example.id + task_definition = aws_ecs_task_definition.example.arn + desired_count = 1 + launch_type = "FARGATE" + + network_configuration { + subnets = aws_subnet.example[*].id + security_groups = [aws_security_group.example.id] + assign_public_ip = false + } +} +``` + +## Argument Reference + +The following arguments are required: + +* `cluster` - (Required) Short name or full Amazon Resource Name (ARN) of the cluster to run the task on. +* `task_definition` - (Required) The `family` and `revision` (`family:revision`) or full ARN of the task definition to run. If a revision isn't specified, the latest `ACTIVE` revision is used. + +The following arguments are optional: + +* `capacity_provider_strategy` - (Optional) Set of capacity provider strategies to use for the cluster. See below. +* `desired_count` - (Optional) Number of instantiations of the specified task to place on your cluster. You can specify up to 10 tasks for each call. +* `enable_ecs_managed_tags` - (Optional) Specifies whether to enable Amazon ECS managed tags for the tasks within the service. +* `enable_execute_command` - (Optional) Specifies whether to enable Amazon ECS Exec for the tasks within the service. +* `group` - (Optional) Name of the task group to associate with the task. The default value is the family name of the task definition. +* `launch_type` - (Optional) Launch type on which to run your service. Valid values are `EC2`, `FARGATE`, and `EXTERNAL`. +* `network_configuration` - (Optional) Network configuration for the service. This parameter is required for task definitions that use the `awsvpc` network mode to receive their own Elastic Network Interface, and it is not supported for other network modes. See below. +* `overrides` - (Optional) A list of container overrides that specify the name of a container in the specified task definition and the overrides it should receive. +* `placement_constraints` - (Optional) An array of placement constraint objects to use for the task. You can specify up to 10 constraints for each task. See below. +* `placement_strategy` - (Optional) The placement strategy objects to use for the task. You can specify a maximum of 5 strategy rules for each task. See below. +* `platform_version` - (Optional) The platform version the task uses. A platform version is only specified for tasks hosted on Fargate. If one isn't specified, the `LATEST` platform version is used. +* `propagate_tags` - (Optional) Specifies whether to propagate the tags from the task definition to the task. If no value is specified, the tags aren't propagated. An error will be received if you specify the `SERVICE` option when running a task. Valid values are `TASK_DEFINITION` or `NONE`. +* `reference_id` - (Optional) The reference ID to use for the task. +* `started_by` - (Optional) An optional tag specified when a task is started. +* `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. + +### capacity_provider_strategy + +* `capacity_provider` - (Required) Name of the 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. Defaults to `0`. +* `weight` - (Optional) The relative percentage of the total number of launched tasks that should use the specified capacity provider. The `weight` value is taken into consideration after the `base` count of tasks has been satisfied. Defaults to `0`. + +### network_configuration + +* `subnets` - (Required) Subnets associated with the task or service. +* `security_groups` - (Optional) Security groups associated with the task or service. If you do not specify a security group, the default security group for the VPC is used. +* `assign_public_ip` - (Optional) Assign a public IP address to the ENI (Fargate launch type only). Valid values are `true` or `false`. Default `false`. + +For more information, see the [Task Networking](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task-networking.html) documentation. + +### overrides + +* `container_overrides` - (Optional) One or more container overrides that are sent to a task. See below. +* `cpu` - (Optional) The CPU override for the task. +* `execution_role_arn` - (Optional) Amazon Resource Name (ARN) of the task execution role override for the task. +* `inference_accelerator_overrides` - (Optional) Elastic Inference accelerator override for the task. See below. +* `memory` - (Optional) The memory override for the task. +* `task_role_arn` - (Optional) Amazon Resource Name (ARN) of the role that containers in this task can assume. + +### container_overrides + +* `command` - (Optional) The command to send to the container that overrides the default command from the Docker image or the task definition. +* `cpu` - (Optional) The number of cpu units reserved for the container, instead of the default value from the task definition. +* `environment` - (Optional) The environment variables to send to the container. You can add new environment variables, which are added to the container at launch, or you can override the existing environment variables from the Docker image or the task definition. See below. +* `memory` - (Optional) The hard limit (in MiB) of memory to present to the container, instead of the default value from the task definition. If your container attempts to exceed the memory specified here, the container is killed. +* `memory_reservation` - (Optional) The soft limit (in MiB) of memory to reserve for the container, instead of the default value from the task definition. +* `name` - (Optional) The name of the container that receives the override. This parameter is required if any override is specified. +* `resource_requirements` - (Optional) The type and amount of a resource to assign to a container, instead of the default value from the task definition. The only supported resource is a GPU. See below. + +### environment + +* `key` - (Required) The name of the key-value pair. For environment variables, this is the name of the environment variable. +* `value` - (Required) The value of the key-value pair. For environment variables, this is the value of the environment variable. + +### resource_requirements + +* `type` - (Required) The type of resource to assign to a container. Valid values are `GPU` or `InferenceAccelerator`. +* `value` - (Required) The value for the specified resource type. If the `GPU` type is used, the value is the number of physical GPUs the Amazon ECS container agent reserves for the container. The number of GPUs that's reserved for all containers in a task can't exceed the number of available GPUs on the container instance that the task is launched on. If the `InferenceAccelerator` type is used, the value matches the `deviceName` for an InferenceAccelerator specified in a task definition. + +### inference_accelerator_overrides + +* `device_name` - (Optional) The Elastic Inference accelerator device name to override for the task. This parameter must match a deviceName specified in the task definition. +* `device_type` - (Optional) The Elastic Inference accelerator type to use. + +### placement_constraints + +* `expression` - (Optional) A cluster query language expression to apply to the constraint. The expression can have a maximum length of 2000 characters. You can't specify an expression if the constraint type is `distinctInstance`. +* `type` - (Optional) The type of constraint. Valid values are `distinctInstance` or `memberOf`. Use `distinctInstance` to ensure that each task in a particular group is running on a different container instance. Use `memberOf` to restrict the selection to a group of valid candidates. + +### placement_strategy + +* `field` - (Optional) The field to apply the placement strategy against. +* `type` - (Optional) The type of placement strategy. Valid values are `random`, `spread`, and `binpack`. + +For more information, see the [Placement Strategy](https://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_PlacementStrategy.html) documentation. + +## Attributes Reference + +In addition to all arguments above, the following attributes are exported: + +* `task_arns` - A list of the provisioned task ARNs. +* `id` - The unique identifier, which is a comma-delimited string joining the `cluster` and `task_definition` attributes. From 03f166a06af9962c7923533eecb8fdbe86f2b072 Mon Sep 17 00:00:00 2001 From: Jared Baker Date: Fri, 3 Mar 2023 15:49:19 -0500 Subject: [PATCH 402/763] chore: changelog --- .changelog/29783.txt | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 .changelog/29783.txt diff --git a/.changelog/29783.txt b/.changelog/29783.txt new file mode 100644 index 000000000000..14bccc96b9a6 --- /dev/null +++ b/.changelog/29783.txt @@ -0,0 +1,3 @@ +```release-note:new-data-source +aws_ecs_task_execution +``` From 4c3c5cf2724d3b512f717e4e8ec231c18a71ba8d Mon Sep 17 00:00:00 2001 From: Antvirf Date: Sat, 4 Mar 2023 08:13:05 +0800 Subject: [PATCH 403/763] docs: improve detail for app runner secrets --- website/docs/r/apprunner_service.html.markdown | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/website/docs/r/apprunner_service.html.markdown b/website/docs/r/apprunner_service.html.markdown index 9e61638a3ef1..5113e2300cc7 100644 --- a/website/docs/r/apprunner_service.html.markdown +++ b/website/docs/r/apprunner_service.html.markdown @@ -236,7 +236,7 @@ The `code_configuration_values` blocks supports the following arguments: * `build_command` - (Optional) Command App Runner runs to build your application. * `port` - (Optional) Port that your application listens to in the container. Defaults to `"8080"`. * `runtime` - (Required) Runtime environment type for building and running an App Runner service. Represents a programming language runtime. Valid values: `PYTHON_3`, `NODEJS_12`, `NODEJS_14`, `NODEJS_16`, `CORRETTO_8`, `CORRETTO_11`, `GO_1`, `DOTNET_6`, `PHP_81`, `RUBY_31`. -* `runtime_environment_secrets` - (Optional) Secrets and parameters available to your service as environment variables. A map of key/value pairs. +* `runtime_environment_secrets` - (Optional) Secrets and parameters available to your service as environment variables. A map of key/value pairs, where the key is the desired name of the Secret in this environment (i.e. it does not have to match the name of the secret in Secrets Manager or SSM Parameter Store), and the value is the ARN of the secret from either AWS Secrets Manager or AWS SSM Parameter Store. * `runtime_environment_variables` - (Optional) Environment variables available to your running App Runner service. A map of key/value pairs. Keys with a prefix of `AWSAPPRUNNER` are reserved for system use and aren't valid. * `start_command` - (Optional) Command App Runner runs to start your application. @@ -245,7 +245,7 @@ The `code_configuration_values` blocks supports the following arguments: The `image_configuration` block supports the following arguments: * `port` - (Optional) Port that your application listens to in the container. Defaults to `"8080"`. -* `runtime_environment_secrets` - (Optional) Secrets and parameters available to your service as environment variables. A map of key/value pairs. +* `runtime_environment_secrets` - (Optional) Secrets and parameters available to your service as environment variables. A map of key/value pairs, where the key is the desired name of the Secret in this environment (i.e. it does not have to match the name of the secret in Secrets Manager or SSM Parameter Store), and the value is the ARN of the secret from either AWS Secrets Manager or AWS SSM Parameter Store. * `runtime_environment_variables` - (Optional) Environment variables available to your running App Runner service. A map of key/value pairs. Keys with a prefix of `AWSAPPRUNNER` are reserved for system use and aren't valid. * `start_command` - (Optional) Command App Runner runs to start the application in the source image. If specified, this command overrides the Docker image’s default start command. From 2bf32a49c288849b0ac397e0814df9edbd9b9bba Mon Sep 17 00:00:00 2001 From: Graham Davison Date: Fri, 3 Mar 2023 16:19:43 -0800 Subject: [PATCH 404/763] Adds all fields to `_basic` test --- internal/service/dynamodb/table_test.go | 26 +++++++++++++++++++++---- 1 file changed, 22 insertions(+), 4 deletions(-) diff --git a/internal/service/dynamodb/table_test.go b/internal/service/dynamodb/table_test.go index 5c096127f434..f460c106837e 100644 --- a/internal/service/dynamodb/table_test.go +++ b/internal/service/dynamodb/table_test.go @@ -342,15 +342,33 @@ func TestAccDynamoDBTable_basic(t *testing.T) { testAccCheckInitialTableExists(ctx, resourceName, &conf), acctest.CheckResourceAttrRegionalARN(resourceName, names.AttrARN, "dynamodb", fmt.Sprintf("table/%s", rName)), resource.TestCheckResourceAttr(resourceName, names.AttrName, rName), - resource.TestCheckResourceAttr(resourceName, "read_capacity", "1"), - resource.TestCheckResourceAttr(resourceName, "write_capacity", "1"), - resource.TestCheckResourceAttr(resourceName, "hash_key", rName), resource.TestCheckTypeSetElemNestedAttrs(resourceName, "attribute.*", map[string]string{ names.AttrName: rName, names.AttrType: "S", }), - resource.TestCheckResourceAttr(resourceName, "tags.%", "0"), + resource.TestCheckResourceAttr(resourceName, "billing_mode", "PROVISIONED"), + resource.TestCheckResourceAttr(resourceName, "global_secondary_index.#", "0"), + resource.TestCheckResourceAttr(resourceName, "hash_key", rName), + resource.TestCheckResourceAttr(resourceName, "local_secondary_index.#", "0"), + resource.TestCheckResourceAttr(resourceName, "point_in_time_recovery.#", "1"), + resource.TestCheckResourceAttr(resourceName, "point_in_time_recovery.0.enabled", "false"), + resource.TestCheckNoResourceAttr(resourceName, "range_key"), + resource.TestCheckResourceAttr(resourceName, "read_capacity", "1"), + resource.TestCheckResourceAttr(resourceName, "replica.#", "0"), + resource.TestCheckNoResourceAttr(resourceName, "restore_date_time"), + resource.TestCheckNoResourceAttr(resourceName, "restore_source_name"), + resource.TestCheckNoResourceAttr(resourceName, "restore_to_latest_time"), + resource.TestCheckResourceAttr(resourceName, "server_side_encryption.#", "0"), + resource.TestCheckResourceAttr(resourceName, "stream_arn", ""), + resource.TestCheckResourceAttr(resourceName, "stream_enabled", "false"), + resource.TestCheckResourceAttr(resourceName, "stream_label", ""), + resource.TestCheckResourceAttr(resourceName, "stream_view_type", ""), resource.TestCheckResourceAttr(resourceName, "table_class", ""), + resource.TestCheckResourceAttr(resourceName, "tags.%", "0"), + resource.TestCheckResourceAttr(resourceName, "tags_all.%", "0"), + resource.TestCheckResourceAttr(resourceName, "ttl.#", "1"), + resource.TestCheckResourceAttr(resourceName, "ttl.0.enabled", "false"), + resource.TestCheckResourceAttr(resourceName, "write_capacity", "1"), ), }, { From 989d6d39bbc51bd90e3d02f9b18e05ca238867c1 Mon Sep 17 00:00:00 2001 From: drfaust92 Date: Sun, 5 Mar 2023 18:04:18 +0200 Subject: [PATCH 405/763] network access --- internal/service/grafana/workspace.go | 83 +++++++++- internal/service/grafana/workspace_test.go | 147 ++++++++++++++++++ .../docs/r/grafana_workspace.html.markdown | 6 + 3 files changed, 235 insertions(+), 1 deletion(-) diff --git a/internal/service/grafana/workspace.go b/internal/service/grafana/workspace.go index 5092511e6e52..cee9ab3eb203 100644 --- a/internal/service/grafana/workspace.go +++ b/internal/service/grafana/workspace.go @@ -95,6 +95,27 @@ func ResourceWorkspace() *schema.Resource { Optional: true, Computed: true, }, + "network_access_control": { + Type: schema.TypeList, + MaxItems: 1, + Optional: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "prefix_list_ids": { + Type: schema.TypeSet, + Required: true, + MaxItems: 100, + Elem: &schema.Schema{Type: schema.TypeString}, + }, + "vpce_ids": { + Type: schema.TypeSet, + Required: true, + MaxItems: 100, + Elem: &schema.Schema{Type: schema.TypeString}, + }, + }, + }, + }, "notification_destinations": { Type: schema.TypeList, Optional: true, @@ -214,6 +235,10 @@ func resourceWorkspaceCreate(ctx context.Context, d *schema.ResourceData, meta i input.VpcConfiguration = expandVPCConfiguration(v.([]interface{})) } + if v, ok := d.GetOk("network_access_control"); ok { + input.NetworkAccessControl = expandNetworkAccessControl(v.([]interface{})) + } + log.Printf("[DEBUG] Creating Grafana Workspace: %s", input) output, err := conn.CreateWorkspaceWithContext(ctx, input) @@ -276,6 +301,10 @@ func resourceWorkspaceRead(ctx context.Context, d *schema.ResourceData, meta int return sdkdiag.AppendErrorf(diags, "setting vpc_configuration: %s", err) } + if err := d.Set("network_access_control", flattenNetworkAccessControl(workspace.NetworkAccessControl)); err != nil { + return sdkdiag.AppendErrorf(diags, "setting network_access_control: %s", err) + } + tags := KeyValueTags(ctx, workspace.Tags).IgnoreAWS().IgnoreConfig(ignoreTagsConfig) //lintignore:AWSR002 @@ -352,7 +381,23 @@ func resourceWorkspaceUpdate(ctx context.Context, d *schema.ResourceData, meta i } if d.HasChange("vpc_configuration") { - input.VpcConfiguration = expandVPCConfiguration(d.Get("vpc_configuration").([]interface{})) + if v, ok := d.Get("vpc_configuration").([]interface{}); ok { + if len(v) > 0 { + input.VpcConfiguration = expandVPCConfiguration(v) + } else { + input.RemoveVpcConfiguration = aws.Bool(true) + } + } + } + + if d.HasChange("network_access_control") { + if v, ok := d.Get("network_access_control").([]interface{}); ok { + if len(v) > 0 { + input.NetworkAccessControl = expandNetworkAccessControl(v) + } else { + input.RemoveNetworkAccessConfiguration = aws.Bool(true) + } + } } _, err := conn.UpdateWorkspaceWithContext(ctx, input) @@ -453,3 +498,39 @@ func flattenVPCConfiguration(rs *managedgrafana.VpcConfiguration) []interface{} return []interface{}{m} } + +func expandNetworkAccessControl(cfg []interface{}) *managedgrafana.NetworkAccessConfiguration { + if len(cfg) < 1 { + return nil + } + + conf := cfg[0].(map[string]interface{}) + + out := managedgrafana.NetworkAccessConfiguration{} + + if v, ok := conf["prefix_list_ids"].(*schema.Set); ok && v.Len() > 0 { + out.PrefixListIds = flex.ExpandStringSet(v) + } + + if v, ok := conf["vpce_ids"].(*schema.Set); ok && v.Len() > 0 { + out.VpceIds = flex.ExpandStringSet(v) + } + + return &out +} + +func flattenNetworkAccessControl(rs *managedgrafana.NetworkAccessConfiguration) []interface{} { + if rs == nil { + return []interface{}{} + } + + m := make(map[string]interface{}) + if rs.PrefixListIds != nil { + m["prefix_list_ids"] = flex.FlattenStringSet(rs.PrefixListIds) + } + if rs.VpceIds != nil { + m["vpce_ids"] = flex.FlattenStringSet(rs.VpceIds) + } + + return []interface{}{m} +} diff --git a/internal/service/grafana/workspace_test.go b/internal/service/grafana/workspace_test.go index 7afe64fbf2cf..7ac76cb245be 100644 --- a/internal/service/grafana/workspace_test.go +++ b/internal/service/grafana/workspace_test.go @@ -31,6 +31,7 @@ func TestAccGrafana_serial(t *testing.T) { "tags": testAccWorkspace_tags, "vpc": testAccWorkspace_vpc, "configuration": testAccWorkspace_configuration, + "networkAccess": testAccWorkspace_networkAccess, }, "ApiKey": { "basic": testAccWorkspaceAPIKey_basic, @@ -93,6 +94,7 @@ func testAccWorkspace_saml(t *testing.T) { resource.TestCheckResourceAttr(resourceName, "stack_set_name", ""), resource.TestCheckResourceAttr(resourceName, "tags.%", "0"), resource.TestCheckResourceAttr(resourceName, "vpc_configuration.#", "0"), + resource.TestCheckResourceAttr(resourceName, "network_access_control.#", "0"), ), }, { @@ -138,6 +140,13 @@ func testAccWorkspace_vpc(t *testing.T) { resource.TestCheckResourceAttr(resourceName, "vpc_configuration.0.subnet_ids.#", "3"), ), }, + { + Config: testAccWorkspaceConfig_vpcRemoved(rName, 3), + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheckWorkspaceExists(ctx, resourceName), + resource.TestCheckResourceAttr(resourceName, "vpc_configuration.#", "0"), + ), + }, }, }) } @@ -447,6 +456,51 @@ func testAccWorkspace_configuration(t *testing.T) { }) } +func testAccWorkspace_networkAccess(t *testing.T) { + ctx := acctest.Context(t) + rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) + resourceName := "aws_grafana_workspace.test" + + resource.Test(t, resource.TestCase{ + PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(t, managedgrafana.EndpointsID) }, + ErrorCheck: acctest.ErrorCheck(t, managedgrafana.EndpointsID), + CheckDestroy: testAccCheckWorkspaceDestroy(ctx), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + Steps: []resource.TestStep{ + { + Config: testAccWorkspaceConfig_networkAccess(rName, 1), + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheckWorkspaceExists(ctx, resourceName), + resource.TestCheckResourceAttr(resourceName, "network_access_control.#", "1"), + resource.TestCheckResourceAttr(resourceName, "network_access_control.0.prefix_list_ids.#", "1"), + resource.TestCheckResourceAttr(resourceName, "network_access_control.0.vpce_ids.#", "1"), + ), + }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, + { + Config: testAccWorkspaceConfig_networkAccess(rName, 2), + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheckWorkspaceExists(ctx, resourceName), + resource.TestCheckResourceAttr(resourceName, "network_access_control.#", "1"), + resource.TestCheckResourceAttr(resourceName, "network_access_control.0.prefix_list_ids.#", "1"), + resource.TestCheckResourceAttr(resourceName, "network_access_control.0.vpce_ids.#", "2"), + ), + }, + { + Config: testAccWorkspaceConfig_networkAccessRemoved(rName), + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheckWorkspaceExists(ctx, resourceName), + resource.TestCheckResourceAttr(resourceName, "network_access_control.#", "0"), + ), + }, + }, + }) +} + func testAccCheckWorkspaceExists(ctx context.Context, name string) resource.TestCheckFunc { return func(s *terraform.State) error { rs, ok := s.RootModule().Resources[name] @@ -617,6 +671,83 @@ resource "aws_grafana_workspace" "test" { `, rName)) } +func testAccWorkspaceConfig_networkAccess(rName string, endpoints int) string { + return acctest.ConfigCompose(testAccWorkspaceConfig_base(rName), acctest.ConfigVPCWithSubnets(rName, endpoints), fmt.Sprintf(` +resource "aws_ec2_managed_prefix_list" "test" { + name = %[1]q + address_family = "IPv4" + max_entries = 5 +} + +resource "aws_security_group" "test" { + description = %[1]q + vpc_id = aws_vpc.test.id +} + +data "aws_region" "current" {} + +resource "aws_vpc_endpoint" "test" { + count = %[2]d + + private_dns_enabled = false + security_group_ids = [aws_security_group.test.id] + service_name = "com.amazonaws.${data.aws_region.current.name}.grafana-workspace" + subnet_ids = [aws_subnet.test[count.index].id] + vpc_endpoint_type = "Interface" + vpc_id = aws_vpc.test.id +} + +resource "aws_grafana_workspace" "test" { + account_access_type = "CURRENT_ACCOUNT" + authentication_providers = ["SAML"] + permission_type = "SERVICE_MANAGED" + name = %[1]q + description = %[1]q + role_arn = aws_iam_role.test.arn + + network_access_control { + prefix_list_ids = [aws_ec2_managed_prefix_list.test.id] + vpce_ids = aws_vpc_endpoint.test[*].id + } +} +`, rName, endpoints)) +} + +func testAccWorkspaceConfig_networkAccessRemoved(rName string) string { + return acctest.ConfigCompose(testAccWorkspaceConfig_base(rName), acctest.ConfigVPCWithSubnets(rName, 1), fmt.Sprintf(` +resource "aws_ec2_managed_prefix_list" "test" { + name = %[1]q + address_family = "IPv4" + max_entries = 5 +} + +resource "aws_security_group" "test" { + description = %[1]q + vpc_id = aws_vpc.test.id +} + +data "aws_region" "current" {} + +resource "aws_vpc_endpoint" "test" { + private_dns_enabled = false + security_group_ids = [aws_security_group.test.id] + service_name = "com.amazonaws.${data.aws_region.current.name}.grafana-workspace" + subnet_ids = aws_subnet.test[*].id + vpc_endpoint_type = "Interface" + vpc_id = aws_vpc.test.id +} + +resource "aws_grafana_workspace" "test" { + account_access_type = "CURRENT_ACCOUNT" + authentication_providers = ["SAML"] + permission_type = "SERVICE_MANAGED" + name = %[1]q + description = %[1]q + role_arn = aws_iam_role.test.arn +} +`, rName)) +} + func testAccWorkspaceConfig_vpc(rName string, subnets int) string { return acctest.ConfigCompose(testAccWorkspaceConfig_base(rName), acctest.ConfigVPCWithSubnets(rName, subnets), fmt.Sprintf(` resource "aws_security_group" "test" { @@ -638,6 +769,22 @@ resource "aws_grafana_workspace" "test" { `, rName)) } +func testAccWorkspaceConfig_vpcRemoved(rName string, subnets int) string { + return acctest.ConfigCompose(testAccWorkspaceConfig_base(rName), acctest.ConfigVPCWithSubnets(rName, subnets), fmt.Sprintf(` +resource "aws_security_group" "test" { + description = %[1]q + vpc_id = aws_vpc.test.id +} + +resource "aws_grafana_workspace" "test" { + account_access_type = "CURRENT_ACCOUNT" + authentication_providers = ["SAML"] + permission_type = "SERVICE_MANAGED" + role_arn = aws_iam_role.test.arn +} +`, rName)) +} + func testAccWorkspaceConfig_configuration(rName, configuration string) string { return acctest.ConfigCompose(testAccWorkspaceConfig_base(rName), fmt.Sprintf(` resource "aws_grafana_workspace" "test" { diff --git a/website/docs/r/grafana_workspace.html.markdown b/website/docs/r/grafana_workspace.html.markdown index 8b2f2c6badc8..e4688131c7fc 100644 --- a/website/docs/r/grafana_workspace.html.markdown +++ b/website/docs/r/grafana_workspace.html.markdown @@ -54,6 +54,7 @@ The following arguments are optional: * `data_sources` - (Optional) The data sources for the workspace. Valid values are `AMAZON_OPENSEARCH_SERVICE`, `ATHENA`, `CLOUDWATCH`, `PROMETHEUS`, `REDSHIFT`, `SITEWISE`, `TIMESTREAM`, `XRAY` * `description` - (Optional) The workspace description. * `name` - (Optional) The Grafana workspace name. +* `network_access_control` - (Optional) Configuration for network access to your workspace.See [Network Access Control](#network-access-control) below. * `notification_destinations` - (Optional) The notification destinations. If a data source is specified here, Amazon Managed Grafana will create IAM roles and permissions needed to use these destinations. Must be set to `SNS`. * `organization_role_name` - (Optional) The role name that the workspace uses to access resources through Amazon Organizations. * `organizational_units` - (Optional) The Amazon Organizations organizational units that the workspace is authorized to use data sources from. @@ -62,6 +63,11 @@ The following arguments are optional: * `tags` - (Optional) Key-value mapping 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. * `vpc_configuration` - (Optional) The configuration settings for an Amazon VPC that contains data sources for your Grafana workspace to connect to. See [VPC Configuration](#vpc-configuration) below. +### Network Access Control + +* `prefix_list_ids` - (Required) - An array of prefix list IDs. +* `vpce_ids` - (Required) - An array of Amazon VPC endpoint IDs for the workspace. The only VPC endpoints that can be specified here are interface VPC endpoints for Grafana workspaces (using the com.amazonaws.[region].grafana-workspace service endpoint). Other VPC endpoints will be ignored. + ### VPC Configuration * `security_group_ids` - (Required) - The list of Amazon EC2 security group IDs attached to the Amazon VPC for your Grafana workspace to connect. From 4144f4749ba8469077a1b04e40203dbd1bcab2da Mon Sep 17 00:00:00 2001 From: drfaust92 Date: Sun, 5 Mar 2023 18:06:34 +0200 Subject: [PATCH 406/763] changelog --- .changelog/29793.txt | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 .changelog/29793.txt diff --git a/.changelog/29793.txt b/.changelog/29793.txt new file mode 100644 index 000000000000..8e9a6aef9634 --- /dev/null +++ b/.changelog/29793.txt @@ -0,0 +1,7 @@ +```release-note:enhancement +resource/aws_grafana_workspace: Add `network_access_control` argument +``` + +```release-note:bug +resource/aws_grafana_workspace: Allow removing `vpc_configuration` +``` \ No newline at end of file From a33c6632caa92224e487491acdf86156c18c9310 Mon Sep 17 00:00:00 2001 From: Benny Lu Date: Sun, 5 Mar 2023 15:25:25 -0800 Subject: [PATCH 407/763] aws_route53_hosted_zone_dnssec - match aws example --- .../route53_hosted_zone_dnssec.html.markdown | 25 ++----------------- 1 file changed, 2 insertions(+), 23 deletions(-) diff --git a/website/docs/r/route53_hosted_zone_dnssec.html.markdown b/website/docs/r/route53_hosted_zone_dnssec.html.markdown index 65d1cf7427f1..7fc2b38d1105 100644 --- a/website/docs/r/route53_hosted_zone_dnssec.html.markdown +++ b/website/docs/r/route53_hosted_zone_dnssec.html.markdown @@ -32,35 +32,14 @@ resource "aws_kms_key" "example" { "kms:DescribeKey", "kms:GetPublicKey", "kms:Sign", + "kms:Verify", ], Effect = "Allow" Principal = { Service = "dnssec-route53.amazonaws.com" } - Sid = "Allow Route 53 DNSSEC Service", Resource = "*" - Condition = { - StringEquals = { - "aws:SourceAccount" = data.aws_caller_identity.current.account_id - } - ArnLike = { - "aws:SourceArn" = "arn:aws:route53:::hostedzone/*" - } - } - }, - { - Action = "kms:CreateGrant", - Effect = "Allow" - Principal = { - Service = "dnssec-route53.amazonaws.com" - } - Sid = "Allow Route 53 DNSSEC Service to CreateGrant", - Resource = "*" - Condition = { - Bool = { - "kms:GrantIsForAWSResource" = "true" - } - } + Sid = "Allow Route 53 DNSSEC Service", }, { Action = "kms:*" From a21efe835ea44f3e25232838f56337fe74098af6 Mon Sep 17 00:00:00 2001 From: Benny Lu Date: Sun, 5 Mar 2023 15:51:59 -0800 Subject: [PATCH 408/763] aws_codebuild_project - update secondary_artifacts --- website/docs/r/codebuild_project.html.markdown | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/website/docs/r/codebuild_project.html.markdown b/website/docs/r/codebuild_project.html.markdown index 4c916b78798d..345ad439cb6a 100755 --- a/website/docs/r/codebuild_project.html.markdown +++ b/website/docs/r/codebuild_project.html.markdown @@ -340,15 +340,15 @@ See [ProjectFileSystemLocation](https://docs.aws.amazon.com/codebuild/latest/API ### secondary_artifacts * `artifact_identifier` - (Required) Artifact identifier. Must be the same specified inside the AWS CodeBuild build specification. -* `bucket_owner_access` - (Optional) Specifies the bucket owner's access for objects that another account uploads to their Amazon S3 bucket. By default, only the account that uploads the objects to the bucket has access to these objects. This property allows you to give the bucket owner access to these objects. Valid values are `NONE`, `READ_ONLY`, and `FULL`. your CodeBuild service role must have the `s3:PutBucketAcl` permission. This permission allows CodeBuild to modify the access control list for the bucket. +* `bucket_owner_access` - (Optional) Specifies the bucket owner's access for objects that another account uploads to their Amazon S3 bucket. By default, only the account that uploads the objects to the bucket has access to these objects. This property allows you to give the bucket owner access to these objects. Valid values are `NONE`, `READ_ONLY`, and `FULL`. The CodeBuild service role must have the `s3:PutBucketAcl` permission. This permission allows CodeBuild to modify the access control list for the bucket. * `encryption_disabled` - (Optional) Whether to disable encrypting output artifacts. If `type` is set to `NO_ARTIFACTS`, this value is ignored. Defaults to `false`. -* `location` - (Optional) Information about the build output artifact location. If `type` is set to `CODEPIPELINE` or `NO_ARTIFACTS`, this value is ignored. If `type` is set to `S3`, this is the name of the output bucket. If `path` is not also specified, then `location` can also specify the path of the output artifact in the output bucket. -* `name` - (Optional) Name of the project. If `type` is set to `S3`, this is the name of the output artifact object -* `namespace_type` - (Optional) Namespace to use in storing build artifacts. If `type` is set to `S3`, then valid values are `BUILD_ID` or `NONE`. +* `location` - (Optional) Information about the build output artifact location. If `type` is set to `CODEPIPELINE` or `NO_ARTIFACTS`, this value is ignored if specified. If `type` is set to `S3`, this is the name of the output bucket. If `path` is not specified, `location` can specify the path of the output artifact in the output bucket. +* `name` - (Optional) Name of the project. If `type` is set to `CODEPIPELINE` or `NO_ARTIFACTS`, this value is ignored if specified. If `type` is set to `S3`, this is the name of the output artifact object. +* `namespace_type` - (Optional) Namespace to use in storing build artifacts. If `type` is set to `CODEPIPELINE` or `NO_ARTIFACTS`, this value is ignored if specified. If `type` is set to `S3`, valid values are `BUILD_ID` or `NONE`. * `override_artifact_name` (Optional) Whether a name specified in the build specification overrides the artifact name. -* `packaging` - (Optional) Type of build output artifact to create. If `type` is set to `S3`, valid values are `NONE`, `ZIP` -* `path` - (Optional) If `type` is set to `S3`, this is the path to the output artifact. -* `type` - (Required) Build output artifact's type. The only valid value is `S3`. +* `packaging` - (Optional) Type of build output artifact to create. If `type` is set to `CODEPIPELINE` or `NO_ARTIFACTS`, this value is ignored if specified. If `type` is set to `S3`, valid values are `NONE` or `ZIP`. +* `path` - (Optional) Along with `namespace_type` and `name`, the pattern that AWS CodeBuild uses to name and store the output artifact. If `type` is set to `CODEPIPELINE` or `NO_ARTIFACTS`, this value is ignored if specified. If `type` is set to `S3`, this is the path to the output artifact. +* `type` - (Required) Build output artifact's type. Valid values `CODEPIPELINE`, `NO_ARTIFACTS`, and `S3`. ### secondary_sources From a23f8ad264d923f8925574d7ee3fb9d92f7d8e38 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 6 Mar 2023 06:58:15 +0000 Subject: [PATCH 409/763] build(deps): bump github.com/aws/aws-sdk-go-v2/service/medialive Bumps [github.com/aws/aws-sdk-go-v2/service/medialive](https://github.com/aws/aws-sdk-go-v2) from 1.29.4 to 1.30.0. - [Release notes](https://github.com/aws/aws-sdk-go-v2/releases) - [Changelog](https://github.com/aws/aws-sdk-go-v2/blob/main/CHANGELOG.md) - [Commits](https://github.com/aws/aws-sdk-go-v2/compare/service/s3/v1.29.4...service/s3/v1.30.0) --- updated-dependencies: - dependency-name: github.com/aws/aws-sdk-go-v2/service/medialive dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 5480f02b2726..8a0e80ebcede 100644 --- a/go.mod +++ b/go.mod @@ -20,7 +20,7 @@ require ( github.com/aws/aws-sdk-go-v2/service/ivschat v1.3.4 github.com/aws/aws-sdk-go-v2/service/kendra v1.38.5 github.com/aws/aws-sdk-go-v2/service/lambda v1.30.0 - github.com/aws/aws-sdk-go-v2/service/medialive v1.29.4 + github.com/aws/aws-sdk-go-v2/service/medialive v1.30.0 github.com/aws/aws-sdk-go-v2/service/oam v1.1.5 github.com/aws/aws-sdk-go-v2/service/opensearchserverless v1.1.5 github.com/aws/aws-sdk-go-v2/service/pipes v1.2.0 diff --git a/go.sum b/go.sum index f499474cdaa2..a63ba4b22fa9 100644 --- a/go.sum +++ b/go.sum @@ -76,8 +76,8 @@ github.com/aws/aws-sdk-go-v2/service/kendra v1.38.5 h1:vYyn1h1+/eRL8UxfzRgxhH8tm github.com/aws/aws-sdk-go-v2/service/kendra v1.38.5/go.mod h1:PMq9hXXhaNxmBMIolmknhJ9gXi4PYDsZwsFBaJs7Zak= github.com/aws/aws-sdk-go-v2/service/lambda v1.30.0 h1:i2AFUTfisQPZP0iZlUEJiGfOBxEN7Yy+d3zBfDYRmnQ= github.com/aws/aws-sdk-go-v2/service/lambda v1.30.0/go.mod h1:iPDYs5hrSZ+/8Ifoq9ZpoiuHZXDEJx9Udurdoq20958= -github.com/aws/aws-sdk-go-v2/service/medialive v1.29.4 h1:1K+jiIQQdFGgYUmITnQRTRFQSCv0fUIH/X//Kgq0m/8= -github.com/aws/aws-sdk-go-v2/service/medialive v1.29.4/go.mod h1:MDHSj74ylVyTusJYPIoFhNXqwaD8W8cIf8yTEI7+ccc= +github.com/aws/aws-sdk-go-v2/service/medialive v1.30.0 h1:NkQZuHbEyoDDoyu0g4hpUrOV9fitbrZZkIHdXnEaSAA= +github.com/aws/aws-sdk-go-v2/service/medialive v1.30.0/go.mod h1:MDHSj74ylVyTusJYPIoFhNXqwaD8W8cIf8yTEI7+ccc= github.com/aws/aws-sdk-go-v2/service/oam v1.1.5 h1:b4IaVHpAfwj2cOmTUgoIFTjLjTuC1yh3Ml3K7cjZFaU= github.com/aws/aws-sdk-go-v2/service/oam v1.1.5/go.mod h1:wjIJYruJrl1fA6qqfQSOjUUUjASLrjbVsD7y6NYcoOc= github.com/aws/aws-sdk-go-v2/service/opensearchserverless v1.1.5 h1:3EqOT8+GTVfZny8ltIZk0VUflBjC7Ks55jw2M2edneM= From db5133917b928d3db036574f90a6d9af98b189a0 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 6 Mar 2023 06:58:40 +0000 Subject: [PATCH 410/763] build(deps): bump github.com/aws/aws-sdk-go-v2/service/ec2 Bumps [github.com/aws/aws-sdk-go-v2/service/ec2](https://github.com/aws/aws-sdk-go-v2) from 1.87.0 to 1.88.0. - [Release notes](https://github.com/aws/aws-sdk-go-v2/releases) - [Changelog](https://github.com/aws/aws-sdk-go-v2/blob/main/CHANGELOG.md) - [Commits](https://github.com/aws/aws-sdk-go-v2/compare/service/ec2/v1.87.0...service/ec2/v1.88.0) --- updated-dependencies: - dependency-name: github.com/aws/aws-sdk-go-v2/service/ec2 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 5480f02b2726..dcc585cacfb4 100644 --- a/go.mod +++ b/go.mod @@ -12,7 +12,7 @@ require ( github.com/aws/aws-sdk-go-v2/service/cloudwatchlogs v1.20.5 github.com/aws/aws-sdk-go-v2/service/comprehend v1.22.0 github.com/aws/aws-sdk-go-v2/service/computeoptimizer v1.21.3 - github.com/aws/aws-sdk-go-v2/service/ec2 v1.87.0 + github.com/aws/aws-sdk-go-v2/service/ec2 v1.88.0 github.com/aws/aws-sdk-go-v2/service/fis v1.14.4 github.com/aws/aws-sdk-go-v2/service/healthlake v1.15.4 github.com/aws/aws-sdk-go-v2/service/identitystore v1.16.4 diff --git a/go.sum b/go.sum index f499474cdaa2..9480e2c02b3d 100644 --- a/go.sum +++ b/go.sum @@ -53,8 +53,8 @@ github.com/aws/aws-sdk-go-v2/service/comprehend v1.22.0 h1:HfIi9A8XYph6xwnoevrO9 github.com/aws/aws-sdk-go-v2/service/comprehend v1.22.0/go.mod h1:wR/O51vYY5XCt2FzuaSgvHV36BozkKxKWW4NoDIXrlc= github.com/aws/aws-sdk-go-v2/service/computeoptimizer v1.21.3 h1:JkWxBPjWWDKjVWjBoiIw9zbMA72Ynde66y5fInm9Q/g= github.com/aws/aws-sdk-go-v2/service/computeoptimizer v1.21.3/go.mod h1:U4bKXeB586zd73RIAkJX+ZmUtwI00xLJhDKJ7+hTCO0= -github.com/aws/aws-sdk-go-v2/service/ec2 v1.87.0 h1:ovugMha0/ApeDHONkCp8MvBJc6JEtL9o41JyZNTFcYE= -github.com/aws/aws-sdk-go-v2/service/ec2 v1.87.0/go.mod h1:2HxUY7Pkfmt1uIhPrFp0/O6+0aGoLaGIN5tXp/rYDL8= +github.com/aws/aws-sdk-go-v2/service/ec2 v1.88.0 h1:YVxTUKCZqTzp2bT/ctafMOf/36TYKlk+Zio9kuHYxXU= +github.com/aws/aws-sdk-go-v2/service/ec2 v1.88.0/go.mod h1:2HxUY7Pkfmt1uIhPrFp0/O6+0aGoLaGIN5tXp/rYDL8= github.com/aws/aws-sdk-go-v2/service/fis v1.14.4 h1:YHeT7fN7oQY7wUzOwZv4gfzULrrojjbFq9vipBUvFgE= github.com/aws/aws-sdk-go-v2/service/fis v1.14.4/go.mod h1:IQGhkhTVkQE+/bVqKbLpipbH9H935C05Z0/z6k7eVPQ= github.com/aws/aws-sdk-go-v2/service/healthlake v1.15.4 h1:VFI+riYGn52qqqU8hbCgOhYkVz7ZDjKJ1HN4vsaqkdE= From 7f1356318caad8c63a1f0349818cc4c4493cde58 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 6 Mar 2023 07:00:10 +0000 Subject: [PATCH 411/763] build(deps): bump github.com/aws/aws-sdk-go-v2/service/transcribe Bumps [github.com/aws/aws-sdk-go-v2/service/transcribe](https://github.com/aws/aws-sdk-go-v2) from 1.25.4 to 1.26.0. - [Release notes](https://github.com/aws/aws-sdk-go-v2/releases) - [Changelog](https://github.com/aws/aws-sdk-go-v2/blob/main/CHANGELOG.md) - [Commits](https://github.com/aws/aws-sdk-go-v2/compare/service/fsx/v1.25.4...service/s3/v1.26.0) --- updated-dependencies: - dependency-name: github.com/aws/aws-sdk-go-v2/service/transcribe dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 5480f02b2726..69e82c1de88e 100644 --- a/go.mod +++ b/go.mod @@ -33,7 +33,7 @@ require ( github.com/aws/aws-sdk-go-v2/service/sesv2 v1.16.4 github.com/aws/aws-sdk-go-v2/service/ssm v1.35.5 github.com/aws/aws-sdk-go-v2/service/ssmincidents v1.20.4 - github.com/aws/aws-sdk-go-v2/service/transcribe v1.25.4 + github.com/aws/aws-sdk-go-v2/service/transcribe v1.26.0 github.com/aws/smithy-go v1.13.5 github.com/beevik/etree v1.1.0 github.com/google/go-cmp v0.5.9 diff --git a/go.sum b/go.sum index f499474cdaa2..611479c02cd7 100644 --- a/go.sum +++ b/go.sum @@ -111,8 +111,8 @@ github.com/aws/aws-sdk-go-v2/service/ssooidc v1.14.4/go.mod h1:zVwRrfdSmbRZWkUkW github.com/aws/aws-sdk-go-v2/service/sts v1.18.3/go.mod h1:b+psTJn33Q4qGoDaM7ZiOVVG8uVjGI6HaZ8WBHdgDgU= github.com/aws/aws-sdk-go-v2/service/sts v1.18.5 h1:L1600eLr0YvTT7gNh3Ni24yGI7NSHkq9Gp62vijPRCs= github.com/aws/aws-sdk-go-v2/service/sts v1.18.5/go.mod h1:1mKZHLLpDMHTNSYPJ7qrcnCQdHCWsNQaT0xRvq2u80s= -github.com/aws/aws-sdk-go-v2/service/transcribe v1.25.4 h1:OwII6iBkiA3sw3XfuSJ7X8cZ7enxL3f4ckLeTmCPdj8= -github.com/aws/aws-sdk-go-v2/service/transcribe v1.25.4/go.mod h1:Sfekn5aPGiTP+22/2DOuE6WoVBY19xfW6esh0HjdgzQ= +github.com/aws/aws-sdk-go-v2/service/transcribe v1.26.0 h1:3cwoie+qJvBJWOa9r/1AONz9XgrcLSWnL37rHNRMS6s= +github.com/aws/aws-sdk-go-v2/service/transcribe v1.26.0/go.mod h1:Sfekn5aPGiTP+22/2DOuE6WoVBY19xfW6esh0HjdgzQ= github.com/aws/smithy-go v1.13.5 h1:hgz0X/DX0dGqTYpGALqXJoRKRj5oQ7150i5FdTePzO8= github.com/aws/smithy-go v1.13.5/go.mod h1:Tg+OJXh4MB2R/uN61Ko2f6hTZwB/ZYGOtib8J3gBHzA= github.com/beevik/etree v1.1.0 h1:T0xke/WvNtMoCqgzPhkX2r4rjY3GDZFi+FjpRZY2Jbs= From f6026703a8b40303718d24f1339622b78bf3ecbb Mon Sep 17 00:00:00 2001 From: Isaac Carrington Date: Mon, 6 Mar 2023 22:02:48 +1300 Subject: [PATCH 412/763] Add RDS cli command to help determine engine version when using aws_rds_cluster --- 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 29a4ec2a4fbf..443be6245655 100644 --- a/website/docs/r/rds_cluster.html.markdown +++ b/website/docs/r/rds_cluster.html.markdown @@ -172,7 +172,7 @@ The following arguments are supported: * `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_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. 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. +* `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). From 85ab268368b4ac4e0685e12f31cad07573c40e81 Mon Sep 17 00:00:00 2001 From: drfaust92 Date: Mon, 6 Mar 2023 13:08:14 +0200 Subject: [PATCH 413/763] fmt --- internal/service/grafana/workspace_test.go | 26 +++++++++++----------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/internal/service/grafana/workspace_test.go b/internal/service/grafana/workspace_test.go index 7ac76cb245be..9213cf9c07d0 100644 --- a/internal/service/grafana/workspace_test.go +++ b/internal/service/grafana/workspace_test.go @@ -698,16 +698,16 @@ resource "aws_vpc_endpoint" "test" { } resource "aws_grafana_workspace" "test" { - account_access_type = "CURRENT_ACCOUNT" - authentication_providers = ["SAML"] - permission_type = "SERVICE_MANAGED" - name = %[1]q - description = %[1]q - role_arn = aws_iam_role.test.arn + account_access_type = "CURRENT_ACCOUNT" + authentication_providers = ["SAML"] + permission_type = "SERVICE_MANAGED" + name = %[1]q + description = %[1]q + role_arn = aws_iam_role.test.arn network_access_control { prefix_list_ids = [aws_ec2_managed_prefix_list.test.id] - vpce_ids = aws_vpc_endpoint.test[*].id + vpce_ids = aws_vpc_endpoint.test[*].id } } `, rName, endpoints)) @@ -738,12 +738,12 @@ resource "aws_vpc_endpoint" "test" { } resource "aws_grafana_workspace" "test" { - account_access_type = "CURRENT_ACCOUNT" - authentication_providers = ["SAML"] - permission_type = "SERVICE_MANAGED" - name = %[1]q - description = %[1]q - role_arn = aws_iam_role.test.arn + account_access_type = "CURRENT_ACCOUNT" + authentication_providers = ["SAML"] + permission_type = "SERVICE_MANAGED" + name = %[1]q + description = %[1]q + role_arn = aws_iam_role.test.arn } `, rName)) } From 9f03e7ce88150057729ddfb388fcd4f95e9d7586 Mon Sep 17 00:00:00 2001 From: bjernie Date: Mon, 6 Mar 2023 13:23:04 +0100 Subject: [PATCH 414/763] Ran go mod tidy --- go.mod | 1 - go.sum | 2 -- 2 files changed, 3 deletions(-) diff --git a/go.mod b/go.mod index 2101e8e9836b..2f795c0e2a5c 100644 --- a/go.mod +++ b/go.mod @@ -23,7 +23,6 @@ require ( github.com/aws/aws-sdk-go-v2/service/oam v1.1.5 github.com/aws/aws-sdk-go-v2/service/opensearchserverless v1.1.5 github.com/aws/aws-sdk-go-v2/service/pipes v1.1.4 - github.com/aws/aws-sdk-go-v2/service/qldb v1.15.4 github.com/aws/aws-sdk-go-v2/service/rds v1.40.5 github.com/aws/aws-sdk-go-v2/service/resourceexplorer2 v1.2.5 github.com/aws/aws-sdk-go-v2/service/rolesanywhere v1.1.4 diff --git a/go.sum b/go.sum index d580eb84eae8..386b89774587 100644 --- a/go.sum +++ b/go.sum @@ -82,8 +82,6 @@ github.com/aws/aws-sdk-go-v2/service/opensearchserverless v1.1.5 h1:3EqOT8+GTVfZ github.com/aws/aws-sdk-go-v2/service/opensearchserverless v1.1.5/go.mod h1:zyCz2VSeUsBE9LMtZc+rVaTSPqJM64cjvLL50FJbblM= github.com/aws/aws-sdk-go-v2/service/pipes v1.1.4 h1:KAGParM+d33STJa8vDxIfLHEAerLFluqx1RFDUMb5RE= github.com/aws/aws-sdk-go-v2/service/pipes v1.1.4/go.mod h1:+c65uht0a5kyjx9emTS00DdDiVYBoXLKDF7LQ0/2g5U= -github.com/aws/aws-sdk-go-v2/service/qldb v1.15.4 h1:1j+mxsdwnPaY2kPOfYWnSG6iXLzZEAUTNxIsROiS6gE= -github.com/aws/aws-sdk-go-v2/service/qldb v1.15.4/go.mod h1:/NFJfE+jHk5Gy9aHc+DuGNIUmMi++czor2fa6DDvBWQ= github.com/aws/aws-sdk-go-v2/service/rds v1.40.5 h1:m4v9hSOgnLmSDbdVdNT0H8GTY6tik7uB7SVV/SFbhLY= github.com/aws/aws-sdk-go-v2/service/rds v1.40.5/go.mod h1:994zebv5Cj1WoGzo3zrrscm1zBLFvGwoA3ve1eVYNVQ= github.com/aws/aws-sdk-go-v2/service/resourceexplorer2 v1.2.5 h1:+F3ULspZOOeUy3LWcIrTguJdO1/A1llhML7alifHldQ= From 55068a0c20304a9fb4ffaec602a8f2f2a21f6568 Mon Sep 17 00:00:00 2001 From: bjernie Date: Mon, 6 Mar 2023 13:54:05 +0100 Subject: [PATCH 415/763] changed release notes --- .changelog/29635.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.changelog/29635.txt b/.changelog/29635.txt index 12bd91534d91..b5e8f13c13ec 100644 --- a/.changelog/29635.txt +++ b/.changelog/29635.txt @@ -1,3 +1,3 @@ -```release-note:enhancement +```release-note:fix resource/aws_qldb_ledger: Added timeouts ``` \ No newline at end of file From 3469ed988bdc8be892cb5508f2c33f9adc8ce9a0 Mon Sep 17 00:00:00 2001 From: Jared Baker Date: Mon, 6 Mar 2023 09:57:41 -0500 Subject: [PATCH 416/763] chore: go mod tidy --- go.mod | 2 +- go.sum | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/go.mod b/go.mod index d9ca22ce69df..a8a4f2467f72 100644 --- a/go.mod +++ b/go.mod @@ -32,6 +32,7 @@ require ( github.com/aws/aws-sdk-go-v2/service/scheduler v1.1.4 github.com/aws/aws-sdk-go-v2/service/sesv2 v1.16.4 github.com/aws/aws-sdk-go-v2/service/ssm v1.35.5 + github.com/aws/aws-sdk-go-v2/service/ssmcontacts v1.14.3 github.com/aws/aws-sdk-go-v2/service/ssmincidents v1.20.4 github.com/aws/aws-sdk-go-v2/service/transcribe v1.26.0 github.com/aws/smithy-go v1.13.5 @@ -86,7 +87,6 @@ require ( github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.9.23 // indirect github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.13.23 // indirect github.com/aws/aws-sdk-go-v2/service/sso v1.12.4 // indirect - github.com/aws/aws-sdk-go-v2/service/ssmcontacts v1.14.3 // indirect github.com/aws/aws-sdk-go-v2/service/ssooidc v1.14.4 // indirect github.com/aws/aws-sdk-go-v2/service/sts v1.18.5 // indirect github.com/bgentry/speakeasy v0.1.0 // indirect diff --git a/go.sum b/go.sum index ae2b9c89d415..fa62aaa8d7f9 100644 --- a/go.sum +++ b/go.sum @@ -38,7 +38,6 @@ github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.12.23/go.mod h1:mOtmAg65GT1HIL/ github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.28/go.mod h1:3lwChorpIM/BhImY/hy+Z6jekmN92cXGPI1QJasVPYY= github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.29 h1:9/aKwwus0TQxppPXFmf010DFrE+ssSbzroLVYINA+xE= github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.29/go.mod h1:Dip3sIGv485+xerzVv24emnjX5Sg88utCL8fwGmCeWg= -github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.22 h1:7AwGYXDdqRQYsluvKFmWoqpcOQJ4bH634SkYf3FNj/A= github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.22/go.mod h1:EqK7gVrIGAHyZItrD1D8B0ilgwMD1GiWAmbU4u/JHNk= github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.23 h1:b/Vn141DBuLVgXbhRWIrl9g+ww7G+ScV5SzniWR13jQ= github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.23/go.mod h1:mr6c4cHC+S/MMkrjtSlG4QA36kOznDep+0fga5L/fGQ= From 2999718d33bb0be74af813eb231bcd6de903c88e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 6 Mar 2023 10:48:17 -0500 Subject: [PATCH 417/763] build(deps): bump github.com/aws/aws-sdk-go in /.ci/providerlint (#29803) Bumps [github.com/aws/aws-sdk-go](https://github.com/aws/aws-sdk-go) from 1.44.213 to 1.44.214. - [Release notes](https://github.com/aws/aws-sdk-go/releases) - [Commits](https://github.com/aws/aws-sdk-go/compare/v1.44.213...v1.44.214) --- updated-dependencies: - dependency-name: github.com/aws/aws-sdk-go dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .ci/providerlint/go.mod | 2 +- .ci/providerlint/go.sum | 4 ++-- .../aws/aws-sdk-go/aws/endpoints/defaults.go | 18 ++++++++++++++---- .ci/providerlint/vendor/modules.txt | 2 +- 4 files changed, 18 insertions(+), 8 deletions(-) diff --git a/.ci/providerlint/go.mod b/.ci/providerlint/go.mod index 3234e502eb8f..0c69908d9643 100644 --- a/.ci/providerlint/go.mod +++ b/.ci/providerlint/go.mod @@ -3,7 +3,7 @@ module github.com/hashicorp/terraform-provider-aws/ci/providerlint go 1.19 require ( - github.com/aws/aws-sdk-go v1.44.213 + github.com/aws/aws-sdk-go v1.44.214 github.com/bflad/tfproviderlint v0.28.1 github.com/hashicorp/terraform-plugin-sdk/v2 v2.25.0 golang.org/x/tools v0.1.12 diff --git a/.ci/providerlint/go.sum b/.ci/providerlint/go.sum index a5ece0418223..ccec456ff00a 100644 --- a/.ci/providerlint/go.sum +++ b/.ci/providerlint/go.sum @@ -65,8 +65,8 @@ github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5/go.mod h1:wHh0iHkY github.com/aws/aws-sdk-go v1.15.78/go.mod h1:E3/ieXAlvM0XWO57iftYVDLLvQ824smPP3ATZkfNZeM= github.com/aws/aws-sdk-go v1.25.3/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo= github.com/aws/aws-sdk-go v1.37.0/go.mod h1:hcU610XS61/+aQV88ixoOzUoG7v3b31pl2zKMmprdro= -github.com/aws/aws-sdk-go v1.44.213 h1:WahquyWs7cQdz0vpDVWyWETEemgSoORx0PbWL9oz2WA= -github.com/aws/aws-sdk-go v1.44.213/go.mod h1:aVsgQcEevwlmQ7qHE9I3h+dtQgpqhFB+i8Phjh7fkwI= +github.com/aws/aws-sdk-go v1.44.214 h1:YzDuC+9UtrAOUkItlK7l3BvKI9o6qAog9X8i289HORc= +github.com/aws/aws-sdk-go v1.44.214/go.mod h1:aVsgQcEevwlmQ7qHE9I3h+dtQgpqhFB+i8Phjh7fkwI= github.com/bflad/gopaniccheck v0.1.0 h1:tJftp+bv42ouERmUMWLoUn/5bi/iQZjHPznM00cP/bU= github.com/bflad/gopaniccheck v0.1.0/go.mod h1:ZCj2vSr7EqVeDaqVsWN4n2MwdROx1YL+LFo47TSWtsA= github.com/bflad/tfproviderlint v0.28.1 h1:7f54/ynV6/lK5/1EyG7tHtc4sMdjJSEFGjZNRJKwBs8= diff --git a/.ci/providerlint/vendor/github.com/aws/aws-sdk-go/aws/endpoints/defaults.go b/.ci/providerlint/vendor/github.com/aws/aws-sdk-go/aws/endpoints/defaults.go index 357e30733e3a..ad6cf3696dfb 100644 --- a/.ci/providerlint/vendor/github.com/aws/aws-sdk-go/aws/endpoints/defaults.go +++ b/.ci/providerlint/vendor/github.com/aws/aws-sdk-go/aws/endpoints/defaults.go @@ -18309,6 +18309,9 @@ var awsPartition = partition{ }, Deprecated: boxedTrue, }, + endpointKey{ + Region: "me-central-1", + }: endpoint{}, endpointKey{ Region: "me-south-1", }: endpoint{}, @@ -19820,9 +19823,6 @@ var awsPartition = partition{ endpointKey{ Region: "ap-southeast-2", }: endpoint{}, - endpointKey{ - Region: "api", - }: endpoint{}, endpointKey{ Region: "ca-central-1", }: endpoint{}, @@ -34104,12 +34104,22 @@ var awsusgovPartition = partition{ "mediaconvert": service{ Endpoints: serviceEndpoints{ endpointKey{ - Region: "us-gov-west-1", + Region: "fips-us-gov-west-1", }: endpoint{ Hostname: "mediaconvert.us-gov-west-1.amazonaws.com", CredentialScope: credentialScope{ Region: "us-gov-west-1", }, + Deprecated: boxedTrue, + }, + endpointKey{ + Region: "us-gov-west-1", + }: endpoint{}, + endpointKey{ + Region: "us-gov-west-1", + Variant: fipsVariant, + }: endpoint{ + Hostname: "mediaconvert.us-gov-west-1.amazonaws.com", }, }, }, diff --git a/.ci/providerlint/vendor/modules.txt b/.ci/providerlint/vendor/modules.txt index 334a2c393b2c..031697f59589 100644 --- a/.ci/providerlint/vendor/modules.txt +++ b/.ci/providerlint/vendor/modules.txt @@ -4,7 +4,7 @@ github.com/agext/levenshtein # github.com/apparentlymart/go-textseg/v13 v13.0.0 ## explicit; go 1.16 github.com/apparentlymart/go-textseg/v13/textseg -# github.com/aws/aws-sdk-go v1.44.213 +# github.com/aws/aws-sdk-go v1.44.214 ## explicit; go 1.11 github.com/aws/aws-sdk-go/aws/awserr github.com/aws/aws-sdk-go/aws/endpoints From a95b1da7a7d187d4bba42a7e6554c1d5f71514ec Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 6 Mar 2023 11:26:27 -0500 Subject: [PATCH 418/763] build(deps): bump github.com/aws/aws-sdk-go from 1.44.213 to 1.44.214 (#29800) Bumps [github.com/aws/aws-sdk-go](https://github.com/aws/aws-sdk-go) from 1.44.213 to 1.44.214. - [Release notes](https://github.com/aws/aws-sdk-go/releases) - [Commits](https://github.com/aws/aws-sdk-go/compare/v1.44.213...v1.44.214) --- updated-dependencies: - dependency-name: github.com/aws/aws-sdk-go dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index a8a4f2467f72..7a71d2b58aa5 100644 --- a/go.mod +++ b/go.mod @@ -4,7 +4,7 @@ go 1.19 require ( github.com/ProtonMail/go-crypto v0.0.0-20230201104953-d1d05f4e2bfb - github.com/aws/aws-sdk-go v1.44.213 + github.com/aws/aws-sdk-go v1.44.214 github.com/aws/aws-sdk-go-v2 v1.17.5 github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.12.23 github.com/aws/aws-sdk-go-v2/service/auditmanager v1.24.1 diff --git a/go.sum b/go.sum index fa62aaa8d7f9..fb22d1e4d492 100644 --- a/go.sum +++ b/go.sum @@ -23,8 +23,8 @@ github.com/apparentlymart/go-textseg/v13 v13.0.0/go.mod h1:ZK2fH7c4NqDTLtiYLvIkE github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310 h1:BUAU3CGlLvorLI26FmByPp2eC2qla6E1Tw+scpcg/to= github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5/go.mod h1:wHh0iHkYZB8zMSxRWpUBQtwG5a7fFgvEO+odwuTv2gs= -github.com/aws/aws-sdk-go v1.44.213 h1:WahquyWs7cQdz0vpDVWyWETEemgSoORx0PbWL9oz2WA= -github.com/aws/aws-sdk-go v1.44.213/go.mod h1:aVsgQcEevwlmQ7qHE9I3h+dtQgpqhFB+i8Phjh7fkwI= +github.com/aws/aws-sdk-go v1.44.214 h1:YzDuC+9UtrAOUkItlK7l3BvKI9o6qAog9X8i289HORc= +github.com/aws/aws-sdk-go v1.44.214/go.mod h1:aVsgQcEevwlmQ7qHE9I3h+dtQgpqhFB+i8Phjh7fkwI= github.com/aws/aws-sdk-go-v2 v1.17.4/go.mod h1:uzbQtefpm44goOPmdKyAlXSNcwlRgF3ePWVW6EtJvvw= github.com/aws/aws-sdk-go-v2 v1.17.5 h1:TzCUW1Nq4H8Xscph5M/skINUitxM5UBAyvm2s7XBzL4= github.com/aws/aws-sdk-go-v2 v1.17.5/go.mod h1:uzbQtefpm44goOPmdKyAlXSNcwlRgF3ePWVW6EtJvvw= From a83fd00a30cfae4537ea23ce01dc0634c34b94b0 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 6 Mar 2023 11:29:38 -0500 Subject: [PATCH 419/763] build(deps): bump golang.org/x/crypto from 0.6.0 to 0.7.0 (#29801) Bumps [golang.org/x/crypto](https://github.com/golang/crypto) from 0.6.0 to 0.7.0. - [Release notes](https://github.com/golang/crypto/releases) - [Commits](https://github.com/golang/crypto/compare/v0.6.0...v0.7.0) --- updated-dependencies: - dependency-name: golang.org/x/crypto dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- go.mod | 10 +++++----- go.sum | 23 ++++++++++++----------- 2 files changed, 17 insertions(+), 16 deletions(-) diff --git a/go.mod b/go.mod index 7a71d2b58aa5..efca936e4063 100644 --- a/go.mod +++ b/go.mod @@ -63,9 +63,9 @@ require ( github.com/mitchellh/go-testing-interface v1.14.1 github.com/pquerna/otp v1.4.0 github.com/shopspring/decimal v1.3.1 - golang.org/x/crypto v0.6.0 + golang.org/x/crypto v0.7.0 golang.org/x/exp v0.0.0-20230206171751-46f607a40771 - golang.org/x/tools v0.2.0 + golang.org/x/tools v0.6.0 gopkg.in/dnaeon/go-vcr.v3 v3.1.2 gopkg.in/yaml.v2 v2.4.0 syreclabs.com/go/faker v1.2.3 @@ -129,9 +129,9 @@ require ( go.opentelemetry.io/otel v1.13.0 // indirect go.opentelemetry.io/otel/trace v1.13.0 // indirect golang.org/x/mod v0.8.0 // indirect - golang.org/x/net v0.7.0 // indirect - golang.org/x/sys v0.5.0 // indirect - golang.org/x/text v0.7.0 // indirect + golang.org/x/net v0.8.0 // indirect + golang.org/x/sys v0.6.0 // indirect + golang.org/x/text v0.8.0 // indirect google.golang.org/appengine v1.6.7 // indirect google.golang.org/genproto v0.0.0-20230202175211-008b39050e57 // indirect google.golang.org/grpc v1.53.0 // indirect diff --git a/go.sum b/go.sum index fb22d1e4d492..aedf314447eb 100644 --- a/go.sum +++ b/go.sum @@ -358,8 +358,8 @@ golang.org/x/crypto v0.0.0-20210322153248-0c34fe9e7dc2/go.mod h1:T9bdIzuCu7OtxOm golang.org/x/crypto v0.0.0-20210421170649-83a5a9bb288b/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.5.0/go.mod h1:NK/OQwhpMQP3MwtdjgLlYHnH9ebylxKWv3e0fK+mkQU= -golang.org/x/crypto v0.6.0 h1:qfktjS5LUO+fFKeJXZ+ikTRijMmljikvG68fpMMruSc= -golang.org/x/crypto v0.6.0/go.mod h1:OFC/31mSvZgRz0V1QTNCzfAI1aIRzbiufJtkMIlEp58= +golang.org/x/crypto v0.7.0 h1:AvwMYaRytfdeVt3u6mLaxYtErKYjxA2OXjJ1HHq6t3A= +golang.org/x/crypto v0.7.0/go.mod h1:pYwdfH91IfpZVANVyUOhSIPZaFoJGxTFbZhFTx+dXZU= golang.org/x/exp v0.0.0-20230206171751-46f607a40771 h1:xP7rWLUr1e1n2xkK5YB4LI0hPEy3LJC6Wk+D4pGlOJg= golang.org/x/exp v0.0.0-20230206171751-46f607a40771/go.mod h1:CxIveKay+FTh1D0yPZemJVgC/95VzuuOLq5Qi4xnoYc= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= @@ -380,13 +380,14 @@ golang.org/x/net v0.0.0-20210326060303-6b1517762897/go.mod h1:uSPa2vr4CLtc/ILN5o golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= golang.org/x/net v0.1.0/go.mod h1:Cx3nUiGt4eDBEyega/BKRp+/AlGL8hYe7U9odMt2Cco= golang.org/x/net v0.5.0/go.mod h1:DivGGAXEgPSlEBzxGzZI+ZLohi+xUj054jfeKui00ws= -golang.org/x/net v0.7.0 h1:rJrUqqhjsgNp7KqAIc25s9pZnjU7TUcSY7HcVZjdn1g= -golang.org/x/net v0.7.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= +golang.org/x/net v0.8.0 h1:Zrh2ngAOFYneWTAIAPethzeaQLuHwhuBkuV6ZiRnUaQ= +golang.org/x/net v0.8.0/go.mod h1:QVkue5JL9kW//ek3r6jTKnTFis1tRmNAW2P1shuFdJc= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.1.0 h1:wsuoTGHzEhffawBOhz5CYhcrV4IdKZbEyZjBMuTp12o= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -409,13 +410,13 @@ golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.4.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.5.0 h1:MUK/U/4lj1t1oPg0HfuXDN/Z1wv31ZJ/YcPiGccS4DU= -golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.6.0 h1:MVltZSvRTcU2ljQOhs94SXPftV6DCNnZViHeQps87pQ= +golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.1.0/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.4.0/go.mod h1:9P2UbLfCdcvo3p/nzKvsmas4TnlujnuoV9hGgYzW1lQ= -golang.org/x/term v0.5.0 h1:n2a8QNdAb0sZNpU9R1ALUXBbY+w51fCQDN+7EdxNBsY= +golang.org/x/term v0.6.0 h1:clScbb1cHjoCkyRbWwBEUZ5H/tIFu5TAXIqaZD0Gcjw= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= @@ -423,13 +424,13 @@ golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.6.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= -golang.org/x/text v0.7.0 h1:4BRB4x83lYWy72KwLD/qYDuTu7q9PjSagHvijDw7cLo= -golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= +golang.org/x/text v0.8.0 h1:57P1ETyNKtuIjB4SRd15iJxuhj8Gc416Y78H3qgMh68= +golang.org/x/text v0.8.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= -golang.org/x/tools v0.2.0 h1:G6AHpWxTMGY1KyEYoAQ5WTtIekUUvDNjan3ugu60JvE= -golang.org/x/tools v0.2.0/go.mod h1:y4OqIKeOV/fWJetJ8bXPU1sEVniLMIyDAZWeHdV+NTA= +golang.org/x/tools v0.6.0 h1:BOw41kyTf3PuCW1pVQf8+Cyg8pMlkYB1oo9iJ6D/lKM= +golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= From 4219262f378ebd3c0aa18c402af78f82319b6d90 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Mon, 6 Mar 2023 13:52:02 -0500 Subject: [PATCH 420/763] r/aws_lambda_function: Set 'skip_destroy' in resource Read. --- internal/service/lambda/function.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/internal/service/lambda/function.go b/internal/service/lambda/function.go index 18b289e1f6d3..cd8a70bf201f 100644 --- a/internal/service/lambda/function.go +++ b/internal/service/lambda/function.go @@ -638,6 +638,8 @@ func resourceFunctionRead(ctx context.Context, d *schema.ResourceData, meta inte d.Set("runtime", function.Runtime) d.Set("signing_job_arn", function.SigningJobArn) d.Set("signing_profile_version_arn", function.SigningProfileVersionArn) + // Support in-place update of non-refreshable attribute. + d.Set("skip_destroy", d.Get("skip_destroy")) if err := d.Set("snap_start", flattenSnapStart(function.SnapStart)); err != nil { return sdkdiag.AppendErrorf(diags, "setting snap_start: %s", err) } From 1295773750ca33f94e3a0214e7c0860bc9dcdd39 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Mon, 6 Mar 2023 13:58:04 -0500 Subject: [PATCH 421/763] Add CHANGELOG entry. --- .changelog/29812.txt | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 .changelog/29812.txt diff --git a/.changelog/29812.txt b/.changelog/29812.txt new file mode 100644 index 000000000000..a3a4769eccfd --- /dev/null +++ b/.changelog/29812.txt @@ -0,0 +1,3 @@ +```release-note:bug +resource/aws_lambda_function: Prevent `Provider produced inconsistent final plan` errors produced by null `skip_destroy` attribute value. NOTE: Because the maintainers have been unable to reproduce the reported problem, the fix is best effort and we ask for community help in testing +``` \ No newline at end of file From 9537e467f665624b05b06f07dbe1a9d8808aa916 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Mon, 6 Mar 2023 14:24:58 -0500 Subject: [PATCH 422/763] r/aws_lambda_function: Remove 'skip_destroy' from acceptance test 'ImportStateVerifyIgnore'. --- internal/service/lambda/function_test.go | 80 ++++++++++++------------ 1 file changed, 40 insertions(+), 40 deletions(-) diff --git a/internal/service/lambda/function_test.go b/internal/service/lambda/function_test.go index 9e24a8c24e0e..0173e908a4a9 100644 --- a/internal/service/lambda/function_test.go +++ b/internal/service/lambda/function_test.go @@ -76,7 +76,7 @@ func TestAccLambdaFunction_basic(t *testing.T) { ResourceName: resourceName, ImportState: true, ImportStateVerify: true, - ImportStateVerifyIgnore: []string{"filename", "publish", "skip_destroy"}, + ImportStateVerifyIgnore: []string{"filename", "publish"}, }, }, }) @@ -130,7 +130,7 @@ func TestAccLambdaFunction_tags(t *testing.T) { ResourceName: resourceName, ImportState: true, ImportStateVerify: true, - ImportStateVerifyIgnore: []string{"filename", "publish", "skip_destroy"}, + ImportStateVerifyIgnore: []string{"filename", "publish"}, }, { Config: testAccFunctionConfig_tags2(rName, "key1", "value1updated", "key2", "value2"), @@ -207,7 +207,7 @@ func TestAccLambdaFunction_unpublishedCodeUpdate(t *testing.T) { ResourceName: resourceName, ImportState: true, ImportStateVerify: true, - ImportStateVerifyIgnore: []string{"filename", "publish", "skip_destroy"}, + ImportStateVerifyIgnore: []string{"filename", "publish"}, }, }, }) @@ -242,7 +242,7 @@ func TestAccLambdaFunction_codeSigning(t *testing.T) { ResourceName: resourceName, ImportState: true, ImportStateVerify: true, - ImportStateVerifyIgnore: []string{"filename", "publish", "skip_destroy"}, + ImportStateVerifyIgnore: []string{"filename", "publish"}, }, { Config: testAccFunctionConfig_cscUpdate(rName), @@ -255,7 +255,7 @@ func TestAccLambdaFunction_codeSigning(t *testing.T) { ResourceName: resourceName, ImportState: true, ImportStateVerify: true, - ImportStateVerifyIgnore: []string{"filename", "publish", "skip_destroy"}, + ImportStateVerifyIgnore: []string{"filename", "publish"}, }, { Config: testAccFunctionConfig_cscDelete(rName), @@ -295,7 +295,7 @@ func TestAccLambdaFunction_concurrency(t *testing.T) { ResourceName: resourceName, ImportState: true, ImportStateVerify: true, - ImportStateVerifyIgnore: []string{"filename", "publish", "skip_destroy"}, + ImportStateVerifyIgnore: []string{"filename", "publish"}, }, { Config: testAccFunctionConfig_concurrencyUpdate(rName), @@ -335,7 +335,7 @@ func TestAccLambdaFunction_concurrencyCycle(t *testing.T) { ResourceName: resourceName, ImportState: true, ImportStateVerify: true, - ImportStateVerifyIgnore: []string{"filename", "publish", "skip_destroy"}, + ImportStateVerifyIgnore: []string{"filename", "publish"}, }, { Config: testAccFunctionConfig_concurrencyUpdate(rName), @@ -400,7 +400,7 @@ func TestAccLambdaFunction_envVariables(t *testing.T) { ResourceName: resourceName, ImportState: true, ImportStateVerify: true, - ImportStateVerifyIgnore: []string{"filename", "publish", "skip_destroy"}, + ImportStateVerifyIgnore: []string{"filename", "publish"}, }, { Config: testAccFunctionConfig_envVariables(rName), @@ -455,7 +455,7 @@ func TestAccLambdaFunction_EnvironmentVariables_noValue(t *testing.T) { ResourceName: resourceName, ImportState: true, ImportStateVerify: true, - ImportStateVerifyIgnore: []string{"filename", "publish", "skip_destroy"}, + ImportStateVerifyIgnore: []string{"filename", "publish"}, }, }, }) @@ -491,7 +491,7 @@ func TestAccLambdaFunction_encryptedEnvVariables(t *testing.T) { ResourceName: resourceName, ImportState: true, ImportStateVerify: true, - ImportStateVerifyIgnore: []string{"filename", "publish", "skip_destroy"}, + ImportStateVerifyIgnore: []string{"filename", "publish"}, }, { Config: testAccFunctionConfig_encryptedEnvVariablesKey2(rName), @@ -562,7 +562,7 @@ func TestAccLambdaFunction_versioned(t *testing.T) { ResourceName: resourceName, ImportState: true, ImportStateVerify: true, - ImportStateVerifyIgnore: []string{"filename", "publish", "skip_destroy"}, + ImportStateVerifyIgnore: []string{"filename", "publish"}, }, }, }) @@ -640,7 +640,7 @@ func TestAccLambdaFunction_versionedUpdate(t *testing.T) { ResourceName: resourceName, ImportState: true, ImportStateVerify: true, - ImportStateVerifyIgnore: []string{"filename", "publish", "skip_destroy"}, + ImportStateVerifyIgnore: []string{"filename", "publish"}, }, }, }) @@ -689,7 +689,7 @@ func TestAccLambdaFunction_enablePublish(t *testing.T) { ResourceName: resourceName, ImportState: true, ImportStateVerify: true, - ImportStateVerifyIgnore: []string{"filename", "publish", "skip_destroy"}, + ImportStateVerifyIgnore: []string{"filename", "publish"}, }, { // No changes, `publish` is true. This should not publish a new version. @@ -747,7 +747,7 @@ func TestAccLambdaFunction_disablePublish(t *testing.T) { ResourceName: resourceName, ImportState: true, ImportStateVerify: true, - ImportStateVerifyIgnore: []string{"filename", "publish", "skip_destroy"}, + ImportStateVerifyIgnore: []string{"filename", "publish"}, }, }, }) @@ -782,7 +782,7 @@ func TestAccLambdaFunction_deadLetter(t *testing.T) { ResourceName: resourceName, ImportState: true, ImportStateVerify: true, - ImportStateVerifyIgnore: []string{"filename", "publish", "skip_destroy"}, + ImportStateVerifyIgnore: []string{"filename", "publish"}, }, // Ensure configuration can be removed { @@ -832,7 +832,7 @@ func TestAccLambdaFunction_deadLetterUpdated(t *testing.T) { ResourceName: resourceName, ImportState: true, ImportStateVerify: true, - ImportStateVerifyIgnore: []string{"filename", "publish", "skip_destroy"}, + ImportStateVerifyIgnore: []string{"filename", "publish"}, }, }, }) @@ -894,7 +894,7 @@ func TestAccLambdaFunction_fileSystem(t *testing.T) { ResourceName: resourceName, ImportState: true, ImportStateVerify: true, - ImportStateVerifyIgnore: []string{"filename", "publish", "skip_destroy"}, + ImportStateVerifyIgnore: []string{"filename", "publish"}, }, // Ensure lambda file system configuration can be updated { @@ -967,7 +967,7 @@ func TestAccLambdaFunction_image(t *testing.T) { ResourceName: resourceName, ImportState: true, ImportStateVerify: true, - ImportStateVerifyIgnore: []string{"filename", "publish", "skip_destroy"}, + ImportStateVerifyIgnore: []string{"filename", "publish"}, }, // Ensure lambda image code can be updated { @@ -1023,7 +1023,7 @@ func TestAccLambdaFunction_architectures(t *testing.T) { ResourceName: resourceName, ImportState: true, ImportStateVerify: true, - ImportStateVerifyIgnore: []string{"filename", "publish", "skip_destroy"}, + ImportStateVerifyIgnore: []string{"filename", "publish"}, }, // Ensure function's "architectures" attribute can be removed. The actual architecture remains unchanged. { @@ -1074,7 +1074,7 @@ func TestAccLambdaFunction_architecturesUpdate(t *testing.T) { ResourceName: resourceName, ImportState: true, ImportStateVerify: true, - ImportStateVerifyIgnore: []string{"filename", "publish", "skip_destroy"}, + ImportStateVerifyIgnore: []string{"filename", "publish"}, }, // Ensure function architecture can be updated { @@ -1125,7 +1125,7 @@ func TestAccLambdaFunction_architecturesWithLayer(t *testing.T) { ResourceName: resourceName, ImportState: true, ImportStateVerify: true, - ImportStateVerifyIgnore: []string{"filename", "publish", "skip_destroy"}, + ImportStateVerifyIgnore: []string{"filename", "publish"}, }, // Ensure function architecture can be updated { @@ -1168,7 +1168,7 @@ func TestAccLambdaFunction_ephemeralStorage(t *testing.T) { ResourceName: resourceName, ImportState: true, ImportStateVerify: true, - ImportStateVerifyIgnore: []string{"filename", "publish", "skip_destroy"}, + ImportStateVerifyIgnore: []string{"filename", "publish"}, }, { Config: testAccFunctionConfig_updateEphemeralStorage(rName), @@ -1210,7 +1210,7 @@ func TestAccLambdaFunction_tracing(t *testing.T) { ResourceName: resourceName, ImportState: true, ImportStateVerify: true, - ImportStateVerifyIgnore: []string{"filename", "publish", "skip_destroy"}, + ImportStateVerifyIgnore: []string{"filename", "publish"}, }, { Config: testAccFunctionConfig_tracingUpdated(rName), @@ -1256,7 +1256,7 @@ func TestAccLambdaFunction_KMSKeyARN_noEnvironmentVariables(t *testing.T) { ResourceName: resourceName, ImportState: true, ImportStateVerify: true, - ImportStateVerifyIgnore: []string{"filename", "publish", "skip_destroy"}, + ImportStateVerifyIgnore: []string{"filename", "publish"}, }, }, }) @@ -1290,7 +1290,7 @@ func TestAccLambdaFunction_layers(t *testing.T) { ResourceName: resourceName, ImportState: true, ImportStateVerify: true, - ImportStateVerifyIgnore: []string{"filename", "publish", "skip_destroy"}, + ImportStateVerifyIgnore: []string{"filename", "publish"}, }, }, }) @@ -1324,7 +1324,7 @@ func TestAccLambdaFunction_layersUpdate(t *testing.T) { ResourceName: resourceName, ImportState: true, ImportStateVerify: true, - ImportStateVerifyIgnore: []string{"filename", "publish", "skip_destroy"}, + ImportStateVerifyIgnore: []string{"filename", "publish"}, }, { Config: testAccFunctionConfig_layersUpdated(rName), @@ -1368,7 +1368,7 @@ func TestAccLambdaFunction_vpc(t *testing.T) { ResourceName: resourceName, ImportState: true, ImportStateVerify: true, - ImportStateVerifyIgnore: []string{"filename", "publish", "skip_destroy"}, + ImportStateVerifyIgnore: []string{"filename", "publish"}, }, }, }) @@ -1401,7 +1401,7 @@ func TestAccLambdaFunction_vpcRemoval(t *testing.T) { ResourceName: resourceName, ImportState: true, ImportStateVerify: true, - ImportStateVerifyIgnore: []string{"filename", "publish", "skip_destroy"}, + ImportStateVerifyIgnore: []string{"filename", "publish"}, }, { Config: testAccFunctionConfig_basic(rName, rName, rName, rName), @@ -1444,7 +1444,7 @@ func TestAccLambdaFunction_vpcUpdate(t *testing.T) { ResourceName: resourceName, ImportState: true, ImportStateVerify: true, - ImportStateVerifyIgnore: []string{"filename", "publish", "skip_destroy"}, + ImportStateVerifyIgnore: []string{"filename", "publish"}, }, { Config: testAccFunctionConfig_vpcUpdated(rName), @@ -1490,7 +1490,7 @@ func TestAccLambdaFunction_VPC_withInvocation(t *testing.T) { ResourceName: resourceName, ImportState: true, ImportStateVerify: true, - ImportStateVerifyIgnore: []string{"filename", "publish", "skip_destroy"}, + ImportStateVerifyIgnore: []string{"filename", "publish"}, }, }, }) @@ -1525,7 +1525,7 @@ func TestAccLambdaFunction_VPCPublishNo_changes(t *testing.T) { ResourceName: resourceName, ImportState: true, ImportStateVerify: true, - ImportStateVerifyIgnore: []string{"filename", "publish", "skip_destroy"}, + ImportStateVerifyIgnore: []string{"filename", "publish"}, }, { Config: testAccFunctionConfig_vpcPublish(rName), @@ -1568,7 +1568,7 @@ func TestAccLambdaFunction_VPCPublishHas_changes(t *testing.T) { ResourceName: resourceName, ImportState: true, ImportStateVerify: true, - ImportStateVerifyIgnore: []string{"filename", "publish", "skip_destroy"}, + ImportStateVerifyIgnore: []string{"filename", "publish"}, }, { Config: testAccFunctionConfig_vpcUpdatedPublish(rName), @@ -1703,7 +1703,7 @@ func TestAccLambdaFunction_emptyVPC(t *testing.T) { ResourceName: resourceName, ImportState: true, ImportStateVerify: true, - ImportStateVerifyIgnore: []string{"filename", "publish", "skip_destroy"}, + ImportStateVerifyIgnore: []string{"filename", "publish"}, }, }, }) @@ -1732,7 +1732,7 @@ func TestAccLambdaFunction_s3(t *testing.T) { ResourceName: resourceName, ImportState: true, ImportStateVerify: true, - ImportStateVerifyIgnore: []string{"publish", "s3_bucket", "s3_key", "skip_destroy"}, + ImportStateVerifyIgnore: []string{"publish", "s3_bucket", "s3_key"}, }, }, }) @@ -1778,7 +1778,7 @@ func TestAccLambdaFunction_localUpdate(t *testing.T) { ResourceName: resourceName, ImportState: true, ImportStateVerify: true, - ImportStateVerifyIgnore: []string{"filename", "publish", "skip_destroy"}, + ImportStateVerifyIgnore: []string{"filename", "publish"}, }, { PreConfig: func() { @@ -1844,7 +1844,7 @@ func TestAccLambdaFunction_LocalUpdate_nameOnly(t *testing.T) { ResourceName: resourceName, ImportState: true, ImportStateVerify: true, - ImportStateVerifyIgnore: []string{"filename", "publish", "skip_destroy"}, + ImportStateVerifyIgnore: []string{"filename", "publish"}, }, { PreConfig: func() { @@ -1899,7 +1899,7 @@ func TestAccLambdaFunction_S3Update_basic(t *testing.T) { ResourceName: resourceName, ImportState: true, ImportStateVerify: true, - ImportStateVerifyIgnore: []string{"filename", "publish", "s3_bucket", "s3_key", "s3_object_version", "skip_destroy"}, + ImportStateVerifyIgnore: []string{"filename", "publish", "s3_bucket", "s3_key", "s3_object_version"}, }, { PreConfig: func() { @@ -1955,7 +1955,7 @@ func TestAccLambdaFunction_S3Update_unversioned(t *testing.T) { ResourceName: resourceName, ImportState: true, ImportStateVerify: true, - ImportStateVerifyIgnore: []string{"filename", "publish", "s3_bucket", "s3_key", "skip_destroy"}, + ImportStateVerifyIgnore: []string{"filename", "publish", "s3_bucket", "s3_key"}, }, { PreConfig: func() { @@ -1998,7 +1998,7 @@ func TestAccLambdaFunction_snapStart(t *testing.T) { ResourceName: resourceName, ImportState: true, ImportStateVerify: true, - ImportStateVerifyIgnore: []string{"filename", "publish", "skip_destroy"}, + ImportStateVerifyIgnore: []string{"filename", "publish"}, }, { Config: testAccFunctionConfig_snapStartDisabled(rName), @@ -2070,7 +2070,7 @@ func TestAccLambdaFunction_runtimes(t *testing.T) { ResourceName: resourceName, ImportState: true, ImportStateVerify: true, - ImportStateVerifyIgnore: []string{"filename", "publish", "skip_destroy"}, + ImportStateVerifyIgnore: []string{"filename", "publish"}, }) resource.ParallelTest(t, resource.TestCase{ From a572a764be66308d59837393f857627956f9b168 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Mon, 6 Mar 2023 14:26:11 -0500 Subject: [PATCH 423/763] Tweak CHANGELOG entry. --- .changelog/29812.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.changelog/29812.txt b/.changelog/29812.txt index a3a4769eccfd..c4caa974853d 100644 --- a/.changelog/29812.txt +++ b/.changelog/29812.txt @@ -1,3 +1,3 @@ ```release-note:bug -resource/aws_lambda_function: Prevent `Provider produced inconsistent final plan` errors produced by null `skip_destroy` attribute value. NOTE: Because the maintainers have been unable to reproduce the reported problem, the fix is best effort and we ask for community help in testing +resource/aws_lambda_function: Prevent `Provider produced inconsistent final plan` errors produced by null `skip_destroy` attribute value. NOTE: Because the maintainers have been unable to reproduce the reported problem, the fix is best effort and we ask for community community support in verifying the fix ``` \ No newline at end of file From 6c88865c6cf3c78240f565fcacdfee16e06423c1 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Mon, 6 Mar 2023 14:38:58 -0500 Subject: [PATCH 424/763] Update .changelog/29812.txt Co-authored-by: Justin Retzolk <44710313+justinretzolk@users.noreply.github.com> --- .changelog/29812.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.changelog/29812.txt b/.changelog/29812.txt index c4caa974853d..c5a4ef5121c6 100644 --- a/.changelog/29812.txt +++ b/.changelog/29812.txt @@ -1,3 +1,3 @@ ```release-note:bug -resource/aws_lambda_function: Prevent `Provider produced inconsistent final plan` errors produced by null `skip_destroy` attribute value. NOTE: Because the maintainers have been unable to reproduce the reported problem, the fix is best effort and we ask for community community support in verifying the fix +resource/aws_lambda_function: Prevent `Provider produced inconsistent final plan` errors produced by null `skip_destroy` attribute value. NOTE: Because the maintainers have been unable to reproduce the reported problem, the fix is best effort and we ask for community support in verifying the fix. ``` \ No newline at end of file From 46b16a42bec58beac3af568d7b6bf2168fa3ab97 Mon Sep 17 00:00:00 2001 From: Graham Davison Date: Mon, 6 Mar 2023 12:06:55 -0800 Subject: [PATCH 425/763] Sets default for `table_class` --- internal/service/dynamodb/table.go | 12 ++-- internal/service/dynamodb/table_test.go | 74 +++++++++++++++++++-- website/docs/r/dynamodb_table.html.markdown | 6 +- 3 files changed, 82 insertions(+), 10 deletions(-) diff --git a/internal/service/dynamodb/table.go b/internal/service/dynamodb/table.go index ee9d408f61ad..9214927f8d93 100644 --- a/internal/service/dynamodb/table.go +++ b/internal/service/dynamodb/table.go @@ -356,8 +356,12 @@ func ResourceTable() *schema.Resource { ValidateFunc: validation.StringInSlice(append(dynamodb.StreamViewType_Values(), ""), false), }, "table_class": { - Type: schema.TypeString, - Optional: true, + Type: schema.TypeString, + Optional: true, + Default: dynamodb.TableClassStandard, + DiffSuppressFunc: func(k, old, new string, d *schema.ResourceData) bool { + return old == "" && new == dynamodb.TableClassStandard + }, ValidateFunc: validation.StringInSlice(dynamodb.TableClass_Values(), false), }, names.AttrTags: tftags.TagsSchema(), @@ -656,8 +660,8 @@ func resourceTableRead(ctx context.Context, d *schema.ResourceData, meta interfa } if table.StreamSpecification != nil { - d.Set("stream_view_type", table.StreamSpecification.StreamViewType) d.Set("stream_enabled", table.StreamSpecification.StreamEnabled) + d.Set("stream_view_type", table.StreamSpecification.StreamViewType) } else { d.Set("stream_enabled", false) d.Set("stream_view_type", d.Get("stream_view_type").(string)) @@ -693,7 +697,7 @@ func resourceTableRead(ctx context.Context, d *schema.ResourceData, meta interfa if table.TableClassSummary != nil { d.Set("table_class", table.TableClassSummary.TableClass) } else { - d.Set("table_class", nil) + d.Set("table_class", dynamodb.TableClassStandard) } pitrOut, err := conn.DescribeContinuousBackupsWithContext(ctx, &dynamodb.DescribeContinuousBackupsInput{ diff --git a/internal/service/dynamodb/table_test.go b/internal/service/dynamodb/table_test.go index f460c106837e..35a8f80a58a9 100644 --- a/internal/service/dynamodb/table_test.go +++ b/internal/service/dynamodb/table_test.go @@ -363,7 +363,7 @@ func TestAccDynamoDBTable_basic(t *testing.T) { resource.TestCheckResourceAttr(resourceName, "stream_enabled", "false"), resource.TestCheckResourceAttr(resourceName, "stream_label", ""), resource.TestCheckResourceAttr(resourceName, "stream_view_type", ""), - resource.TestCheckResourceAttr(resourceName, "table_class", ""), + resource.TestCheckResourceAttr(resourceName, "table_class", "STANDARD"), resource.TestCheckResourceAttr(resourceName, "tags.%", "0"), resource.TestCheckResourceAttr(resourceName, "tags_all.%", "0"), resource.TestCheckResourceAttr(resourceName, "ttl.#", "1"), @@ -2314,6 +2314,71 @@ func TestAccDynamoDBTable_tableClassInfrequentAccess(t *testing.T) { }) } +func TestAccDynamoDBTable_tableClassExplicitDefault(t *testing.T) { + ctx := acctest.Context(t) + var table dynamodb.TableDescription + resourceName := "aws_dynamodb_table.test" + rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { acctest.PreCheck(t) }, + ErrorCheck: acctest.ErrorCheck(t, dynamodb.EndpointsID), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + CheckDestroy: testAccCheckTableDestroy(ctx), + Steps: []resource.TestStep{ + { + Config: testAccTableConfig_basic(rName), + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheckInitialTableExists(ctx, resourceName, &table), + resource.TestCheckResourceAttr(resourceName, "table_class", "STANDARD"), + ), + }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, + { + Config: testAccTableConfig_class(rName, "STANDARD"), + PlanOnly: true, + }, + }, + }) +} + +func TestAccDynamoDBTable_tableClass_migrate(t *testing.T) { + ctx := acctest.Context(t) + var table dynamodb.TableDescription + resourceName := "aws_dynamodb_table.test" + rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { acctest.PreCheck(t) }, + ErrorCheck: acctest.ErrorCheck(t, dynamodb.EndpointsID), + CheckDestroy: testAccCheckTableDestroy(ctx), + Steps: []resource.TestStep{ + { + ExternalProviders: map[string]resource.ExternalProvider{ + "aws": { + Source: "hashicorp/aws", + VersionConstraint: "4.57.0", + }, + }, + Config: testAccTableConfig_basic(rName), + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheckInitialTableExists(ctx, resourceName, &table), + resource.TestCheckResourceAttr(resourceName, "table_class", ""), + ), + }, + { + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + Config: testAccTableConfig_basic(rName), + PlanOnly: true, + }, + }, + }) +} + func TestAccDynamoDBTable_backupEncryption(t *testing.T) { ctx := acctest.Context(t) if testing.Short() { @@ -4117,14 +4182,15 @@ resource "aws_dynamodb_table" "test" { func testAccTableConfig_class(rName, tableClass string) string { return fmt.Sprintf(` resource "aws_dynamodb_table" "test" { - hash_key = "TestTableHashKey" name = %[1]q read_capacity = 1 write_capacity = 1 - table_class = %[2]q + hash_key = %[1]q + + table_class = %[2]q attribute { - name = "TestTableHashKey" + name = %[1]q type = "S" } } diff --git a/website/docs/r/dynamodb_table.html.markdown b/website/docs/r/dynamodb_table.html.markdown index e6f88577ae4e..5a7e9a4a1b9f 100644 --- a/website/docs/r/dynamodb_table.html.markdown +++ b/website/docs/r/dynamodb_table.html.markdown @@ -177,7 +177,7 @@ Optional arguments: * `billing_mode` - (Optional) Controls how you are charged for read and write throughput and how you manage capacity. The valid values are `PROVISIONED` and `PAY_PER_REQUEST`. Defaults to `PROVISIONED`. * `global_secondary_index` - (Optional) Describe a GSI for the table; subject to the normal limits on the number of GSIs, projected attributes, etc. See below. -* `local_secondary_index` - (Optional, Forces new resource) Describe an LSI on the table; these can only be allocated *at creation* so you cannot change this definition after you have created the resource. See below. +* `local_secondary_index` - (Optional, Forces new resource) Describe an LSI on the table; these can only be allocated _at creation_ so you cannot change this definition after you have created the resource. See below. * `point_in_time_recovery` - (Optional) Enable point-in-time recovery options. See below. * `range_key` - (Optional, Forces new resource) Attribute to use as the range (sort) key. Must also be defined as an `attribute`, see below. * `read_capacity` - (Optional) Number of read units for this table. If the `billing_mode` is `PROVISIONED`, this field is required. @@ -188,7 +188,9 @@ Optional arguments: * `server_side_encryption` - (Optional) Encryption at rest options. AWS DynamoDB tables are automatically encrypted at rest with an AWS-owned Customer Master Key if this argument isn't specified. See below. * `stream_enabled` - (Optional) Whether Streams are enabled. * `stream_view_type` - (Optional) When an item in the table is modified, StreamViewType determines what information is written to the table's stream. Valid values are `KEYS_ONLY`, `NEW_IMAGE`, `OLD_IMAGE`, `NEW_AND_OLD_IMAGES`. -* `table_class` - (Optional) Storage class of the table. Valid values are `STANDARD` and `STANDARD_INFREQUENT_ACCESS`. +* `table_class` - (Optional) Storage class of the table. + Valid values are `STANDARD` and `STANDARD_INFREQUENT_ACCESS`. + Default value is `STANDARD`. * `tags` - (Optional) A map of tags to populate on the created table. 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. * `ttl` - (Optional) Configuration block for TTL. See below. * `write_capacity` - (Optional) Number of write units for this table. If the `billing_mode` is `PROVISIONED`, this field is required. From 4c9caef849fec126a67431d51f66f39833141765 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Mon, 6 Mar 2023 15:33:26 -0500 Subject: [PATCH 426/763] Next release will be v4.57.1. --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 57f93f03fadb..d1857267aa57 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,4 @@ -## 4.58.0 (Unreleased) +## 4.57.1 (Unreleased) ## 4.57.0 (March 3, 2023) NOTES: From ed85c200664a82bf84220990cb9453afbeeb01bf Mon Sep 17 00:00:00 2001 From: megubyte <939805+megubyte@users.noreply.github.com> Date: Mon, 6 Mar 2023 20:31:11 +0000 Subject: [PATCH 427/763] r/aws_amplify_domain_association: add enable_auto_sub_domain attribute --- .../service/amplify/domain_association.go | 30 ++++++++++++++----- .../amplify/domain_association_test.go | 25 +++++++++------- 2 files changed, 38 insertions(+), 17 deletions(-) diff --git a/internal/service/amplify/domain_association.go b/internal/service/amplify/domain_association.go index ed8f17882e02..7fc051f83e4e 100644 --- a/internal/service/amplify/domain_association.go +++ b/internal/service/amplify/domain_association.go @@ -50,6 +50,12 @@ func ResourceDomainAssociation() *schema.Resource { ValidateFunc: validation.StringLenBetween(1, 255), }, + "enable_auto_sub_domain": { + Type: schema.TypeBool, + Optional: true, + Default: false, + }, + "sub_domain": { Type: schema.TypeSet, Required: true, @@ -92,12 +98,14 @@ func resourceDomainAssociationCreate(ctx context.Context, d *schema.ResourceData appID := d.Get("app_id").(string) domainName := d.Get("domain_name").(string) + enableAutoSubDomain := d.Get("enable_auto_sub_domain").(bool) id := DomainAssociationCreateResourceID(appID, domainName) input := &lify.CreateDomainAssociationInput{ - AppId: aws.String(appID), - DomainName: aws.String(domainName), - SubDomainSettings: expandSubDomainSettings(d.Get("sub_domain").(*schema.Set).List()), + AppId: aws.String(appID), + DomainName: aws.String(domainName), + SubDomainSettings: expandSubDomainSettings(d.Get("sub_domain").(*schema.Set).List()), + EnableAutoSubDomain: aws.Bool(enableAutoSubDomain), } log.Printf("[DEBUG] Creating Amplify Domain Association: %s", input) @@ -148,6 +156,7 @@ func resourceDomainAssociationRead(ctx context.Context, d *schema.ResourceData, d.Set("arn", domainAssociation.DomainAssociationArn) d.Set("certificate_verification_dns_record", domainAssociation.CertificateVerificationDNSRecord) d.Set("domain_name", domainAssociation.DomainName) + d.Set("enable_auto_sub_domain", domainAssociation.EnableAutoSubDomain) if err := d.Set("sub_domain", flattenSubDomains(domainAssociation.SubDomains)); err != nil { return sdkdiag.AppendErrorf(diags, "setting sub_domain: %s", err) } @@ -165,11 +174,18 @@ func resourceDomainAssociationUpdate(ctx context.Context, d *schema.ResourceData return sdkdiag.AppendErrorf(diags, "parsing Amplify Domain Association ID: %s", err) } - if d.HasChange("sub_domain") { + if d.HasChanges("sub_domain", "enable_auto_sub_domain") { input := &lify.UpdateDomainAssociationInput{ - AppId: aws.String(appID), - DomainName: aws.String(domainName), - SubDomainSettings: expandSubDomainSettings(d.Get("sub_domain").(*schema.Set).List()), + AppId: aws.String(appID), + DomainName: aws.String(domainName), + } + + if d.HasChange("sub_domain") { + input.SubDomainSettings = expandSubDomainSettings(d.Get("sub_domain").(*schema.Set).List()) + } + + if d.HasChange("enable_auto_sub_domain") { + input.EnableAutoSubDomain = aws.Bool(d.Get("enable_auto_sub_domain").(bool)) } log.Printf("[DEBUG] Creating Amplify Domain Association: %s", input) diff --git a/internal/service/amplify/domain_association_test.go b/internal/service/amplify/domain_association_test.go index 13e0a1f40403..44a06f798193 100644 --- a/internal/service/amplify/domain_association_test.go +++ b/internal/service/amplify/domain_association_test.go @@ -36,7 +36,7 @@ func testAccDomainAssociation_basic(t *testing.T) { CheckDestroy: testAccCheckDomainAssociationDestroy(ctx), Steps: []resource.TestStep{ { - Config: testAccDomainAssociationConfig_basic(rName, domainName, false), + Config: testAccDomainAssociationConfig_basic(rName, domainName, false, false), Check: resource.ComposeTestCheckFunc( testAccCheckDomainAssociationExists(ctx, resourceName, &domain), acctest.MatchResourceAttrRegionalARN(resourceName, "arn", "amplify", regexp.MustCompile(`apps/.+/domains/.+`)), @@ -46,6 +46,7 @@ func testAccDomainAssociation_basic(t *testing.T) { "branch_name": rName, "prefix": "", }), + resource.TestCheckResourceAttr(resourceName, "enable_auto_sub_domain", "false"), resource.TestCheckResourceAttr(resourceName, "wait_for_verification", "false"), ), }, @@ -78,7 +79,7 @@ func testAccDomainAssociation_disappears(t *testing.T) { CheckDestroy: testAccCheckDomainAssociationDestroy(ctx), Steps: []resource.TestStep{ { - Config: testAccDomainAssociationConfig_basic(rName, domainName, false), + Config: testAccDomainAssociationConfig_basic(rName, domainName, false, false), Check: resource.ComposeTestCheckFunc( testAccCheckDomainAssociationExists(ctx, resourceName, &domain), acctest.CheckResourceDisappears(ctx, acctest.Provider, tfamplify.ResourceDomainAssociation(), resourceName), @@ -108,7 +109,7 @@ func testAccDomainAssociation_update(t *testing.T) { CheckDestroy: testAccCheckDomainAssociationDestroy(ctx), Steps: []resource.TestStep{ { - Config: testAccDomainAssociationConfig_basic(rName, domainName, true), + Config: testAccDomainAssociationConfig_basic(rName, domainName, false, true), Check: resource.ComposeTestCheckFunc( testAccCheckDomainAssociationExists(ctx, resourceName, &domain), acctest.MatchResourceAttrRegionalARN(resourceName, "arn", "amplify", regexp.MustCompile(`apps/.+/domains/.+`)), @@ -118,6 +119,7 @@ func testAccDomainAssociation_update(t *testing.T) { "branch_name": rName, "prefix": "", }), + resource.TestCheckResourceAttr(resourceName, "enable_auto_sub_domain", "false"), resource.TestCheckResourceAttr(resourceName, "wait_for_verification", "true"), ), }, @@ -128,7 +130,7 @@ func testAccDomainAssociation_update(t *testing.T) { ImportStateVerifyIgnore: []string{"wait_for_verification"}, }, { - Config: testAccDomainAssociationConfig_updated(rName, domainName, true), + Config: testAccDomainAssociationConfig_updated(rName, domainName, true, true), Check: resource.ComposeTestCheckFunc( testAccCheckDomainAssociationExists(ctx, resourceName, &domain), acctest.MatchResourceAttrRegionalARN(resourceName, "arn", "amplify", regexp.MustCompile(`apps/.+/domains/.+`)), @@ -142,6 +144,7 @@ func testAccDomainAssociation_update(t *testing.T) { "branch_name": fmt.Sprintf("%s-2", rName), "prefix": "www", }), + resource.TestCheckResourceAttr(resourceName, "enable_auto_sub_domain", "true"), resource.TestCheckResourceAttr(resourceName, "wait_for_verification", "true"), ), }, @@ -212,7 +215,7 @@ func testAccCheckDomainAssociationDestroy(ctx context.Context) resource.TestChec } } -func testAccDomainAssociationConfig_basic(rName, domainName string, waitForVerification bool) string { +func testAccDomainAssociationConfig_basic(rName, domainName string, enableAutoSubDomain bool, waitForVerification bool) string { return fmt.Sprintf(` resource "aws_amplify_app" "test" { name = %[1]q @@ -232,12 +235,13 @@ resource "aws_amplify_domain_association" "test" { prefix = "" } - wait_for_verification = %[3]t + enable_auto_sub_domain = %[3]t + wait_for_verification = %[4]t } -`, rName, domainName, waitForVerification) +`, rName, domainName, enableAutoSubDomain, waitForVerification) } -func testAccDomainAssociationConfig_updated(rName, domainName string, waitForVerification bool) string { +func testAccDomainAssociationConfig_updated(rName, domainName string, enableAutoSubDomain bool, waitForVerification bool) string { return fmt.Sprintf(` resource "aws_amplify_app" "test" { name = %[1]q @@ -267,7 +271,8 @@ resource "aws_amplify_domain_association" "test" { prefix = "www" } - wait_for_verification = %[3]t + enable_auto_sub_domain = %[3]t + wait_for_verification = %[4]t } -`, rName, domainName, waitForVerification) +`, rName, domainName, enableAutoSubDomain, waitForVerification) } From 0e0d058989bb1f8635a90dbec838643d726ec4e1 Mon Sep 17 00:00:00 2001 From: megubyte <939805+megubyte@users.noreply.github.com> Date: Mon, 6 Mar 2023 20:48:46 +0000 Subject: [PATCH 428/763] changelog --- .changelog/92814.txt | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 .changelog/92814.txt diff --git a/.changelog/92814.txt b/.changelog/92814.txt new file mode 100644 index 000000000000..92b8a45d9a01 --- /dev/null +++ b/.changelog/92814.txt @@ -0,0 +1,3 @@ +```release-note:enhancement +resource/aws_amplify_domain_association: Add `enable_auto_sub_domain` argument +``` \ No newline at end of file From 730ce06e7d12a2482ac55d059b0f15a0c2b182c4 Mon Sep 17 00:00:00 2001 From: megubyte <939805+megubyte@users.noreply.github.com> Date: Mon, 6 Mar 2023 20:51:51 +0000 Subject: [PATCH 429/763] fmt --- internal/service/amplify/domain_association_test.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/service/amplify/domain_association_test.go b/internal/service/amplify/domain_association_test.go index 44a06f798193..c8663dad3f20 100644 --- a/internal/service/amplify/domain_association_test.go +++ b/internal/service/amplify/domain_association_test.go @@ -236,7 +236,7 @@ resource "aws_amplify_domain_association" "test" { } enable_auto_sub_domain = %[3]t - wait_for_verification = %[4]t + wait_for_verification = %[4]t } `, rName, domainName, enableAutoSubDomain, waitForVerification) } @@ -272,7 +272,7 @@ resource "aws_amplify_domain_association" "test" { } enable_auto_sub_domain = %[3]t - wait_for_verification = %[4]t + wait_for_verification = %[4]t } `, rName, domainName, enableAutoSubDomain, waitForVerification) } From 2fd1cc0319973766a51aafef35443de09ceb7f1c Mon Sep 17 00:00:00 2001 From: changelogbot Date: Mon, 6 Mar 2023 21:11:32 +0000 Subject: [PATCH 430/763] Update CHANGELOG.md for #29812 --- CHANGELOG.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index d1857267aa57..f73125e24059 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,9 @@ ## 4.57.1 (Unreleased) + +BUG FIXES: + +* resource/aws_lambda_function: Prevent `Provider produced inconsistent final plan` errors produced by null `skip_destroy` attribute value. NOTE: Because the maintainers have been unable to reproduce the reported problem, the fix is best effort and we ask for community support in verifying the fix. ([#29812](https://github.com/hashicorp/terraform-provider-aws/issues/29812)) + ## 4.57.0 (March 3, 2023) NOTES: From a329e9e74b9d03b750db5f01da4702333939021e Mon Sep 17 00:00:00 2001 From: Graham Davison Date: Mon, 6 Mar 2023 13:46:48 -0800 Subject: [PATCH 431/763] Updates `table_class` without updating other parameters --- internal/service/dynamodb/table.go | 19 ++++++-- internal/service/dynamodb/table_test.go | 61 +++++++++++++++++++++++++ 2 files changed, 75 insertions(+), 5 deletions(-) diff --git a/internal/service/dynamodb/table.go b/internal/service/dynamodb/table.go index 9214927f8d93..3cdb2e491e88 100644 --- a/internal/service/dynamodb/table.go +++ b/internal/service/dynamodb/table.go @@ -797,6 +797,20 @@ func resourceTableUpdate(ctx context.Context, d *schema.ResourceData, meta inter } } + // Table Class cannot be changed concurrently with other values + if d.HasChange("table_class") { + _, err := conn.UpdateTableWithContext(ctx, &dynamodb.UpdateTableInput{ + TableName: aws.String(d.Id()), + TableClass: aws.String(d.Get("table_class").(string)), + }) + if err != nil { + return sdkdiag.AppendErrorf(diags, "updating DynamoDB Table (%s) table class: %s", d.Id(), err) + } + if _, err := waitTableActive(ctx, conn, d.Id(), d.Timeout(schema.TimeoutUpdate)); err != nil { + return sdkdiag.AppendErrorf(diags, "updating DynamoDB Table (%s) table class: waiting for completion: %s", d.Id(), err) + } + } + hasTableUpdate := false input := &dynamodb.UpdateTableInput{ TableName: aws.String(d.Id()), @@ -854,11 +868,6 @@ func resourceTableUpdate(ctx context.Context, d *schema.ResourceData, meta inter } } - if d.HasChange("table_class") { - hasTableUpdate = true - input.TableClass = aws.String(d.Get("table_class").(string)) - } - if hasTableUpdate { log.Printf("[DEBUG] Updating DynamoDB Table: %s", input) _, err := conn.UpdateTableWithContext(ctx, input) diff --git a/internal/service/dynamodb/table_test.go b/internal/service/dynamodb/table_test.go index 35a8f80a58a9..d25eb7e7bcc3 100644 --- a/internal/service/dynamodb/table_test.go +++ b/internal/service/dynamodb/table_test.go @@ -2346,6 +2346,50 @@ func TestAccDynamoDBTable_tableClassExplicitDefault(t *testing.T) { }) } +func TestAccDynamoDBTable_tableClass_ConcurrentModification(t *testing.T) { + ctx := acctest.Context(t) + var table dynamodb.TableDescription + resourceName := "aws_dynamodb_table.test" + rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { acctest.PreCheck(t) }, + ErrorCheck: acctest.ErrorCheck(t, dynamodb.EndpointsID), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + CheckDestroy: testAccCheckTableDestroy(ctx), + Steps: []resource.TestStep{ + { + Config: testAccTableConfig_classConcurrent(rName, "STANDARD_INFREQUENT_ACCESS", 1), + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheckInitialTableExists(ctx, resourceName, &table), + resource.TestCheckResourceAttr(resourceName, "table_class", "STANDARD_INFREQUENT_ACCESS"), + resource.TestCheckResourceAttr(resourceName, "read_capacity", "1"), + resource.TestCheckResourceAttr(resourceName, "write_capacity", "1"), + ), + }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, + { + Config: testAccTableConfig_classConcurrent(rName, "STANDARD", 5), + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheckInitialTableExists(ctx, resourceName, &table), + resource.TestCheckResourceAttr(resourceName, "table_class", "STANDARD"), + resource.TestCheckResourceAttr(resourceName, "read_capacity", "5"), + resource.TestCheckResourceAttr(resourceName, "write_capacity", "5"), + ), + }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, + }, + }) +} + func TestAccDynamoDBTable_tableClass_migrate(t *testing.T) { ctx := acctest.Context(t) var table dynamodb.TableDescription @@ -4197,6 +4241,23 @@ resource "aws_dynamodb_table" "test" { `, rName, tableClass) } +func testAccTableConfig_classConcurrent(rName, tableClass string, capacity int) string { + return fmt.Sprintf(` +resource "aws_dynamodb_table" "test" { + hash_key = "TestTableHashKey" + name = %[1]q + read_capacity = %[2]d + write_capacity = %[2]d + table_class = %[3]q + + attribute { + name = "TestTableHashKey" + type = "S" + } +} +`, rName, capacity, tableClass) +} + func testAccTableConfig_backupInitialStateOverrideEncryption(rName string) string { return fmt.Sprintf(` resource "aws_dynamodb_table" "source" { From da2f68ed1f492788cdf52f96688d37774b3eb446 Mon Sep 17 00:00:00 2001 From: Graham Davison Date: Mon, 6 Mar 2023 13:47:15 -0800 Subject: [PATCH 432/763] Updates `acctest-terraform-lint.yml` to use `go.mod` --- .github/workflows/acctest-terraform-lint.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/acctest-terraform-lint.yml b/.github/workflows/acctest-terraform-lint.yml index 88722a6303a6..c32d3bc7b3af 100644 --- a/.github/workflows/acctest-terraform-lint.yml +++ b/.github/workflows/acctest-terraform-lint.yml @@ -7,7 +7,7 @@ on: pull_request: paths: - .github/workflows/acctest-terraform-lint.yml - - .go-version + - go.sum - .ci/.tflint.hcl - .ci/scripts/validate-terraform.sh - .ci/tools/go.mod @@ -20,7 +20,7 @@ jobs: - uses: actions/checkout@v3 - uses: actions/setup-go@v3 with: - go-version-file: .go-version + go-version-file: go.mod - uses: actions/cache@v3 continue-on-error: true timeout-minutes: 2 @@ -48,7 +48,7 @@ jobs: - uses: actions/checkout@v3 - uses: actions/setup-go@v3 with: - go-version-file: .go-version + go-version-file: go.mod - uses: actions/cache@v3 continue-on-error: true timeout-minutes: 2 From 696d7c51a84b9cdd0ccf2d190059283b7f37a354 Mon Sep 17 00:00:00 2001 From: changelogbot Date: Mon, 6 Mar 2023 22:30:31 +0000 Subject: [PATCH 433/763] Update CHANGELOG.md after v4.57.1 --- CHANGELOG.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f73125e24059..321fd420c666 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,5 @@ -## 4.57.1 (Unreleased) +## 4.58.0 (Unreleased) +## 4.57.1 (March 6, 2023) BUG FIXES: From a669ee8759ed9e0ce21ea89b4a60d900d0b56eb9 Mon Sep 17 00:00:00 2001 From: Antti Date: Tue, 7 Mar 2023 08:02:57 +0800 Subject: [PATCH 434/763] fix: align with suggestion #1 Co-authored-by: Justin Retzolk <44710313+justinretzolk@users.noreply.github.com> --- website/docs/r/apprunner_service.html.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/website/docs/r/apprunner_service.html.markdown b/website/docs/r/apprunner_service.html.markdown index 5113e2300cc7..c09087c1d9d5 100644 --- a/website/docs/r/apprunner_service.html.markdown +++ b/website/docs/r/apprunner_service.html.markdown @@ -236,7 +236,7 @@ The `code_configuration_values` blocks supports the following arguments: * `build_command` - (Optional) Command App Runner runs to build your application. * `port` - (Optional) Port that your application listens to in the container. Defaults to `"8080"`. * `runtime` - (Required) Runtime environment type for building and running an App Runner service. Represents a programming language runtime. Valid values: `PYTHON_3`, `NODEJS_12`, `NODEJS_14`, `NODEJS_16`, `CORRETTO_8`, `CORRETTO_11`, `GO_1`, `DOTNET_6`, `PHP_81`, `RUBY_31`. -* `runtime_environment_secrets` - (Optional) Secrets and parameters available to your service as environment variables. A map of key/value pairs, where the key is the desired name of the Secret in this environment (i.e. it does not have to match the name of the secret in Secrets Manager or SSM Parameter Store), and the value is the ARN of the secret from either AWS Secrets Manager or AWS SSM Parameter Store. +* `runtime_environment_secrets` - (Optional) Secrets and parameters available to your service as environment variables. A map of key/value pairs, where the key is the desired name of the Secret in the environment (i.e. it does not have to match the name of the secret in Secrets Manager or SSM Parameter Store), and the value is the ARN of the secret from AWS Secrets Manager or the ARN of the parameter in AWS SSM Parameter Store. * `runtime_environment_variables` - (Optional) Environment variables available to your running App Runner service. A map of key/value pairs. Keys with a prefix of `AWSAPPRUNNER` are reserved for system use and aren't valid. * `start_command` - (Optional) Command App Runner runs to start your application. From 43df64bfedebc24cdf86731485e45f7b26f81de6 Mon Sep 17 00:00:00 2001 From: Antti Date: Tue, 7 Mar 2023 08:03:05 +0800 Subject: [PATCH 435/763] fix: align with suggestion #2 Co-authored-by: Justin Retzolk <44710313+justinretzolk@users.noreply.github.com> --- website/docs/r/apprunner_service.html.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/website/docs/r/apprunner_service.html.markdown b/website/docs/r/apprunner_service.html.markdown index c09087c1d9d5..5782488d1dff 100644 --- a/website/docs/r/apprunner_service.html.markdown +++ b/website/docs/r/apprunner_service.html.markdown @@ -245,7 +245,7 @@ The `code_configuration_values` blocks supports the following arguments: The `image_configuration` block supports the following arguments: * `port` - (Optional) Port that your application listens to in the container. Defaults to `"8080"`. -* `runtime_environment_secrets` - (Optional) Secrets and parameters available to your service as environment variables. A map of key/value pairs, where the key is the desired name of the Secret in this environment (i.e. it does not have to match the name of the secret in Secrets Manager or SSM Parameter Store), and the value is the ARN of the secret from either AWS Secrets Manager or AWS SSM Parameter Store. +* `runtime_environment_secrets` - (Optional) Secrets and parameters available to your service as environment variables. A map of key/value pairs, where the key is the desired name of the Secret in the environment (i.e. it does not have to match the name of the secret in Secrets Manager or SSM Parameter Store), and the value is the ARN of the secret from AWS Secrets Manager or the ARN of the parameter in AWS SSM Parameter Store. * `runtime_environment_variables` - (Optional) Environment variables available to your running App Runner service. A map of key/value pairs. Keys with a prefix of `AWSAPPRUNNER` are reserved for system use and aren't valid. * `start_command` - (Optional) Command App Runner runs to start the application in the source image. If specified, this command overrides the Docker image’s default start command. From 452bcd0cf55f74d3179882a7c266933016e3bae1 Mon Sep 17 00:00:00 2001 From: Graham Davison Date: Mon, 6 Mar 2023 16:13:51 -0800 Subject: [PATCH 436/763] Fixes parameter order --- internal/service/batch/job_definition.go | 38 ++++++++++++------------ 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/internal/service/batch/job_definition.go b/internal/service/batch/job_definition.go index 2275e35b99d3..9eab1ddcfe6a 100644 --- a/internal/service/batch/job_definition.go +++ b/internal/service/batch/job_definition.go @@ -35,11 +35,9 @@ func ResourceJobDefinition() *schema.Resource { }, Schema: map[string]*schema.Schema{ - "name": { - Type: schema.TypeString, - Required: true, - ForceNew: true, - ValidateFunc: validName, + "arn": { + Type: schema.TypeString, + Computed: true, }, "container_properties": { Type: schema.TypeString, @@ -56,6 +54,12 @@ func ResourceJobDefinition() *schema.Resource { }, ValidateFunc: validJobContainerProperties, }, + "name": { + Type: schema.TypeString, + Required: true, + ForceNew: true, + ValidateFunc: validName, + }, "parameters": { Type: schema.TypeMap, Optional: true, @@ -71,6 +75,12 @@ func ResourceJobDefinition() *schema.Resource { ValidateFunc: validation.StringInSlice(batch.PlatformCapability_Values(), false), }, }, + "propagate_tags": { + Type: schema.TypeBool, + Optional: true, + ForceNew: true, + Default: false, + }, "retry_strategy": { Type: schema.TypeList, Optional: true, @@ -134,14 +144,12 @@ func ResourceJobDefinition() *schema.Resource { }, }, }, + "revision": { + Type: schema.TypeInt, + Computed: true, + }, "tags": tftags.TagsSchema(), "tags_all": tftags.TagsSchemaComputed(), - "propagate_tags": { - Type: schema.TypeBool, - Optional: true, - ForceNew: true, - Default: false, - }, "timeout": { Type: schema.TypeList, Optional: true, @@ -164,14 +172,6 @@ func ResourceJobDefinition() *schema.Resource { ForceNew: true, ValidateFunc: validation.StringInSlice([]string{batch.JobDefinitionTypeContainer}, true), }, - "revision": { - Type: schema.TypeInt, - Computed: true, - }, - "arn": { - Type: schema.TypeString, - Computed: true, - }, }, CustomizeDiff: verify.SetTagsDiff, From 7cd8162d2870bc7d638423dfd8707476b5f93a04 Mon Sep 17 00:00:00 2001 From: Graham Davison Date: Mon, 6 Mar 2023 16:32:46 -0800 Subject: [PATCH 437/763] Tests actual `container_properties` values --- internal/acctest/acctest.go | 52 ++++++++++- internal/service/batch/job_definition_test.go | 88 ++++++++++++++----- 2 files changed, 115 insertions(+), 25 deletions(-) diff --git a/internal/acctest/acctest.go b/internal/acctest/acctest.go index 8ee4df971d8c..be342bd4a76e 100644 --- a/internal/acctest/acctest.go +++ b/internal/acctest/acctest.go @@ -585,6 +585,47 @@ func CheckResourceAttrEquivalentJSON(resourceName, attributeName, expectedJSON s } } +func CheckResourceAttrJMES(name, key, jmesPath, value string) resource.TestCheckFunc { + return func(s *terraform.State) error { + is, err := PrimaryInstanceState(s, name) + if err != nil { + return err + } + + attr, ok := is.Attributes[key] + if !ok { + return fmt.Errorf("%s: Attribute %q not set", name, key) + } + + var jsonData any + err = json.Unmarshal([]byte(attr), &jsonData) + if err != nil { + return fmt.Errorf("%s: Expected attribute %q to be JSON: %w", name, key, err) + } + + result, err := jmespath.Search(jmesPath, jsonData) + if err != nil { + return fmt.Errorf("Invalid JMESPath %q: %w", jmesPath, err) + } + + var v string + switch x := result.(type) { + case string: + v = x + case float64: + v = strconv.FormatFloat(x, 'f', -1, 64) + default: + return fmt.Errorf(`%[1]s: Attribute %[2]q, JMESPath %[3]q got "%#[4]v" (%[4]T)`, name, key, jmesPath, result) + } + + if v != value { + return fmt.Errorf("%s: Attribute %q, JMESPath %q expected %#v, got %#v", name, key, jmesPath, value, v) + } + + return nil + } +} + func CheckResourceAttrJMESPair(nameFirst, keyFirst, jmesPath, nameSecond, keySecond string) resource.TestCheckFunc { return func(s *terraform.State) error { first, err := PrimaryInstanceState(s, nameFirst) @@ -613,9 +654,14 @@ func CheckResourceAttrJMESPair(nameFirst, keyFirst, jmesPath, nameSecond, keySec return fmt.Errorf("Invalid JMESPath %q: %w", jmesPath, err) } - value, ok := result.(string) - if !ok { - return fmt.Errorf("%s: Attribute %q, JMESPath %q, expected single string, got %#v", nameFirst, keyFirst, jmesPath, result) + var value string + switch x := result.(type) { + case string: + value = x + case float64: + value = strconv.FormatFloat(x, 'f', -1, 64) + default: + return fmt.Errorf(`%[1]s: Attribute %[2]q, JMESPath %[3]q got "%#[4]v" (%[4]T)`, nameFirst, keyFirst, jmesPath, result) } vSecond, okSecond := second.Attributes[keySecond] diff --git a/internal/service/batch/job_definition_test.go b/internal/service/batch/job_definition_test.go index 21bca63976e8..ffa04948df5a 100644 --- a/internal/service/batch/job_definition_test.go +++ b/internal/service/batch/job_definition_test.go @@ -33,17 +33,29 @@ func TestAccBatchJobDefinition_basic(t *testing.T) { Steps: []resource.TestStep{ { Config: testAccJobDefinitionConfig_name(rName), - Check: resource.ComposeTestCheckFunc( + Check: resource.ComposeAggregateTestCheckFunc( testAccCheckJobDefinitionExists(ctx, resourceName, &jd), acctest.MatchResourceAttrRegionalARN(resourceName, "arn", "batch", regexp.MustCompile(fmt.Sprintf(`job-definition/%s:\d+`, rName))), - resource.TestCheckResourceAttrSet(resourceName, "container_properties"), + acctest.CheckResourceAttrEquivalentJSON(resourceName, "container_properties", `{ + "command": ["echo", "test"], + "image": "busybox", + "memory": 128, + "vcpus": 1, + "environment": [], + "mountPoints": [], + "resourceRequirements": [], + "secrets": [], + "ulimits": [], + "volumes": [] + }`), resource.TestCheckResourceAttr(resourceName, "name", rName), resource.TestCheckResourceAttr(resourceName, "parameters.%", "0"), resource.TestCheckResourceAttr(resourceName, "platform_capabilities.#", "0"), resource.TestCheckResourceAttr(resourceName, "propagate_tags", "false"), resource.TestCheckResourceAttr(resourceName, "retry_strategy.#", "0"), - resource.TestCheckResourceAttrSet(resourceName, "revision"), + resource.TestCheckResourceAttr(resourceName, "revision", "1"), resource.TestCheckResourceAttr(resourceName, "tags.%", "0"), + resource.TestCheckResourceAttr(resourceName, "tags_all.%", "0"), resource.TestCheckResourceAttr(resourceName, "timeout.#", "0"), resource.TestCheckResourceAttr(resourceName, "type", "container"), ), @@ -71,7 +83,7 @@ func TestAccBatchJobDefinition_disappears(t *testing.T) { Steps: []resource.TestStep{ { Config: testAccJobDefinitionConfig_name(rName), - Check: resource.ComposeTestCheckFunc( + Check: resource.ComposeAggregateTestCheckFunc( testAccCheckJobDefinitionExists(ctx, resourceName, &jd), acctest.CheckResourceDisappears(ctx, acctest.Provider, tfbatch.ResourceJobDefinition(), resourceName), ), @@ -95,17 +107,28 @@ func TestAccBatchJobDefinition_PlatformCapabilities_ec2(t *testing.T) { Steps: []resource.TestStep{ { Config: testAccJobDefinitionConfig_capabilitiesEC2(rName), - Check: resource.ComposeTestCheckFunc( + Check: resource.ComposeAggregateTestCheckFunc( testAccCheckJobDefinitionExists(ctx, resourceName, &jd), acctest.MatchResourceAttrRegionalARN(resourceName, "arn", "batch", regexp.MustCompile(fmt.Sprintf(`job-definition/%s:\d+`, rName))), - resource.TestCheckResourceAttrSet(resourceName, "container_properties"), + acctest.CheckResourceAttrEquivalentJSON(resourceName, "container_properties", `{ + "command": ["echo", "test"], + "image": "busybox", + "memory": 128, + "vcpus": 1, + "environment": [], + "mountPoints": [], + "resourceRequirements": [], + "secrets": [], + "ulimits": [], + "volumes": [] + }`), resource.TestCheckResourceAttr(resourceName, "name", rName), resource.TestCheckResourceAttr(resourceName, "parameters.%", "0"), resource.TestCheckResourceAttr(resourceName, "platform_capabilities.#", "1"), resource.TestCheckTypeSetElemAttr(resourceName, "platform_capabilities.*", "EC2"), resource.TestCheckResourceAttr(resourceName, "propagate_tags", "false"), resource.TestCheckResourceAttr(resourceName, "retry_strategy.#", "0"), - resource.TestCheckResourceAttrSet(resourceName, "revision"), + resource.TestCheckResourceAttr(resourceName, "revision", "1"), resource.TestCheckResourceAttr(resourceName, "tags.%", "0"), resource.TestCheckResourceAttr(resourceName, "timeout.#", "0"), resource.TestCheckResourceAttr(resourceName, "type", "container"), @@ -134,17 +157,22 @@ func TestAccBatchJobDefinition_PlatformCapabilitiesFargate_containerPropertiesDe Steps: []resource.TestStep{ { Config: testAccJobDefinitionConfig_capabilitiesFargateContainerPropertiesDefaults(rName), - Check: resource.ComposeTestCheckFunc( + Check: resource.ComposeAggregateTestCheckFunc( testAccCheckJobDefinitionExists(ctx, resourceName, &jd), acctest.MatchResourceAttrRegionalARN(resourceName, "arn", "batch", regexp.MustCompile(fmt.Sprintf(`job-definition/%s:\d+`, rName))), - resource.TestCheckResourceAttrSet(resourceName, "container_properties"), + acctest.CheckResourceAttrJMES(resourceName, "container_properties", "length(command)", "0"), + acctest.CheckResourceAttrJMESPair(resourceName, "container_properties", "executionRoleArn", "aws_iam_role.ecs_task_execution_role", "arn"), + acctest.CheckResourceAttrJMES(resourceName, "container_properties", "fargatePlatformConfiguration.platformVersion", "LATEST"), + acctest.CheckResourceAttrJMES(resourceName, "container_properties", "length(resourceRequirements)", "2"), + acctest.CheckResourceAttrJMES(resourceName, "container_properties", "resourceRequirements[?type=='VCPU'].value | [0]", "0.25"), + acctest.CheckResourceAttrJMES(resourceName, "container_properties", "resourceRequirements[?type=='MEMORY'].value | [0]", "512"), resource.TestCheckResourceAttr(resourceName, "name", rName), resource.TestCheckResourceAttr(resourceName, "parameters.%", "0"), resource.TestCheckResourceAttr(resourceName, "platform_capabilities.#", "1"), resource.TestCheckTypeSetElemAttr(resourceName, "platform_capabilities.*", "FARGATE"), resource.TestCheckResourceAttr(resourceName, "propagate_tags", "false"), resource.TestCheckResourceAttr(resourceName, "retry_strategy.#", "0"), - resource.TestCheckResourceAttrSet(resourceName, "revision"), + resource.TestCheckResourceAttr(resourceName, "revision", "1"), resource.TestCheckResourceAttr(resourceName, "tags.%", "0"), resource.TestCheckResourceAttr(resourceName, "timeout.#", "0"), resource.TestCheckResourceAttr(resourceName, "type", "container"), @@ -173,17 +201,22 @@ func TestAccBatchJobDefinition_PlatformCapabilities_fargate(t *testing.T) { Steps: []resource.TestStep{ { Config: testAccJobDefinitionConfig_capabilitiesFargate(rName), - Check: resource.ComposeTestCheckFunc( + Check: resource.ComposeAggregateTestCheckFunc( testAccCheckJobDefinitionExists(ctx, resourceName, &jd), acctest.MatchResourceAttrRegionalARN(resourceName, "arn", "batch", regexp.MustCompile(fmt.Sprintf(`job-definition/%s:\d+`, rName))), - resource.TestCheckResourceAttrSet(resourceName, "container_properties"), + acctest.CheckResourceAttrJMESPair(resourceName, "container_properties", "executionRoleArn", "aws_iam_role.ecs_task_execution_role", "arn"), + acctest.CheckResourceAttrJMES(resourceName, "container_properties", "fargatePlatformConfiguration.platformVersion", "LATEST"), + acctest.CheckResourceAttrJMES(resourceName, "container_properties", "networkConfiguration.assignPublicIp", "DISABLED"), + acctest.CheckResourceAttrJMES(resourceName, "container_properties", "length(resourceRequirements)", "2"), + acctest.CheckResourceAttrJMES(resourceName, "container_properties", "resourceRequirements[?type=='VCPU'].value | [0]", "0.25"), + acctest.CheckResourceAttrJMES(resourceName, "container_properties", "resourceRequirements[?type=='MEMORY'].value | [0]", "512"), resource.TestCheckResourceAttr(resourceName, "name", rName), resource.TestCheckResourceAttr(resourceName, "parameters.%", "0"), resource.TestCheckResourceAttr(resourceName, "platform_capabilities.#", "1"), resource.TestCheckTypeSetElemAttr(resourceName, "platform_capabilities.*", "FARGATE"), resource.TestCheckResourceAttr(resourceName, "propagate_tags", "false"), resource.TestCheckResourceAttr(resourceName, "retry_strategy.#", "0"), - resource.TestCheckResourceAttrSet(resourceName, "revision"), + resource.TestCheckResourceAttr(resourceName, "revision", "1"), resource.TestCheckResourceAttr(resourceName, "tags.%", "0"), resource.TestCheckResourceAttr(resourceName, "timeout.#", "0"), resource.TestCheckResourceAttr(resourceName, "type", "container"), @@ -251,7 +284,7 @@ func TestAccBatchJobDefinition_ContainerProperties_advanced(t *testing.T) { Steps: []resource.TestStep{ { Config: testAccJobDefinitionConfig_containerPropertiesAdvanced(rName), - Check: resource.ComposeTestCheckFunc( + Check: resource.ComposeAggregateTestCheckFunc( testAccCheckJobDefinitionExists(ctx, resourceName, &jd), testAccCheckJobDefinitionAttributes(&jd, &compare), ), @@ -279,14 +312,14 @@ func TestAccBatchJobDefinition_updateForcesNewResource(t *testing.T) { Steps: []resource.TestStep{ { Config: testAccJobDefinitionConfig_containerPropertiesAdvanced(rName), - Check: resource.ComposeTestCheckFunc( + Check: resource.ComposeAggregateTestCheckFunc( testAccCheckJobDefinitionExists(ctx, resourceName, &before), testAccCheckJobDefinitionAttributes(&before, nil), ), }, { Config: testAccJobDefinitionConfig_containerPropertiesAdvancedUpdate(rName), - Check: resource.ComposeTestCheckFunc( + Check: resource.ComposeAggregateTestCheckFunc( testAccCheckJobDefinitionExists(ctx, resourceName, &after), testAccCheckJobDefinitionRecreated(t, &before, &after), ), @@ -314,7 +347,7 @@ func TestAccBatchJobDefinition_tags(t *testing.T) { Steps: []resource.TestStep{ { Config: testAccJobDefinitionConfig_tags1(rName, "key1", "value1"), - Check: resource.ComposeTestCheckFunc( + Check: resource.ComposeAggregateTestCheckFunc( testAccCheckJobDefinitionExists(ctx, resourceName, &jd), resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), resource.TestCheckResourceAttr(resourceName, "tags.key1", "value1"), @@ -327,7 +360,7 @@ func TestAccBatchJobDefinition_tags(t *testing.T) { }, { Config: testAccJobDefinitionConfig_tags2(rName, "key1", "value1updated", "key2", "value2"), - Check: resource.ComposeTestCheckFunc( + Check: resource.ComposeAggregateTestCheckFunc( testAccCheckJobDefinitionExists(ctx, resourceName, &jd), resource.TestCheckResourceAttr(resourceName, "tags.%", "2"), resource.TestCheckResourceAttr(resourceName, "tags.key1", "value1updated"), @@ -336,7 +369,7 @@ func TestAccBatchJobDefinition_tags(t *testing.T) { }, { Config: testAccJobDefinitionConfig_tags1(rName, "key2", "value2"), - Check: resource.ComposeTestCheckFunc( + Check: resource.ComposeAggregateTestCheckFunc( testAccCheckJobDefinitionExists(ctx, resourceName, &jd), resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), resource.TestCheckResourceAttr(resourceName, "tags.key2", "value2"), @@ -360,16 +393,27 @@ func TestAccBatchJobDefinition_propagateTags(t *testing.T) { Steps: []resource.TestStep{ { Config: testAccJobDefinitionConfig_propagateTags(rName), - Check: resource.ComposeTestCheckFunc( + Check: resource.ComposeAggregateTestCheckFunc( testAccCheckJobDefinitionExists(ctx, resourceName, &jd), acctest.MatchResourceAttrRegionalARN(resourceName, "arn", "batch", regexp.MustCompile(fmt.Sprintf(`job-definition/%s:\d+`, rName))), - resource.TestCheckResourceAttrSet(resourceName, "container_properties"), + acctest.CheckResourceAttrEquivalentJSON(resourceName, "container_properties", `{ + "command": ["echo", "test"], + "image": "busybox", + "memory": 128, + "vcpus": 1, + "environment": [], + "mountPoints": [], + "resourceRequirements": [], + "secrets": [], + "ulimits": [], + "volumes": [] + }`), resource.TestCheckResourceAttr(resourceName, "name", rName), resource.TestCheckResourceAttr(resourceName, "parameters.%", "0"), resource.TestCheckResourceAttr(resourceName, "platform_capabilities.#", "0"), resource.TestCheckResourceAttr(resourceName, "propagate_tags", "true"), resource.TestCheckResourceAttr(resourceName, "retry_strategy.#", "0"), - resource.TestCheckResourceAttrSet(resourceName, "revision"), + resource.TestCheckResourceAttr(resourceName, "revision", "1"), resource.TestCheckResourceAttr(resourceName, "tags.%", "0"), resource.TestCheckResourceAttr(resourceName, "timeout.#", "0"), resource.TestCheckResourceAttr(resourceName, "type", "container"), From b64fe1096d1b1afbe30ca1a7a02ab06fcc32411a Mon Sep 17 00:00:00 2001 From: Graham Davison Date: Mon, 6 Mar 2023 16:39:45 -0800 Subject: [PATCH 438/763] Makes testcases into map --- .../batch/container_properties_test.go | 31 +++++++------------ 1 file changed, 11 insertions(+), 20 deletions(-) diff --git a/internal/service/batch/container_properties_test.go b/internal/service/batch/container_properties_test.go index 415c56483040..1e3f93762ef1 100644 --- a/internal/service/batch/container_properties_test.go +++ b/internal/service/batch/container_properties_test.go @@ -9,21 +9,18 @@ import ( func TestEquivalentContainerPropertiesJSON(t *testing.T) { t.Parallel() - testCases := []struct { - Name string + testCases := map[string]struct { ApiJson string ConfigurationJson string ExpectEquivalent bool ExpectError bool }{ - { - Name: "empty", + "empty": { ApiJson: ``, ConfigurationJson: ``, ExpectEquivalent: true, }, - { - Name: "empty ResourceRequirements", + "empty ResourceRequirements": { ApiJson: ` { "command": ["ls", "-la"], @@ -99,8 +96,7 @@ func TestEquivalentContainerPropertiesJSON(t *testing.T) { `, ExpectEquivalent: true, }, - { - Name: "reordered Environment", + "reordered Environment": { ApiJson: ` { "command": ["ls", "-la"], @@ -185,8 +181,7 @@ func TestEquivalentContainerPropertiesJSON(t *testing.T) { `, ExpectEquivalent: true, }, - { - Name: "empty environment, mountPoints, ulimits, and volumes", + "empty environment, mountPoints, ulimits, and volumes": { //lintignore:AWSAT005 ApiJson: ` { @@ -214,8 +209,7 @@ func TestEquivalentContainerPropertiesJSON(t *testing.T) { `, ExpectEquivalent: true, }, - { - Name: "empty command, logConfiguration.secretOptions, mountPoints, resourceRequirements, secrets, ulimits, volumes", + "empty command, logConfiguration.secretOptions, mountPoints, resourceRequirements, secrets, ulimits, volumes": { //lintignore:AWSAT003,AWSAT005 ApiJson: ` { @@ -256,8 +250,7 @@ func TestEquivalentContainerPropertiesJSON(t *testing.T) { `, ExpectEquivalent: true, }, - { - Name: "no fargatePlatformConfiguration", + "no fargatePlatformConfiguration": { //lintignore:AWSAT003,AWSAT005 ApiJson: ` { @@ -295,8 +288,7 @@ func TestEquivalentContainerPropertiesJSON(t *testing.T) { `, ExpectEquivalent: true, }, - { - Name: "empty linuxParameters.devices, linuxParameters.tmpfs, logConfiguration.options", + "empty linuxParameters.devices, linuxParameters.tmpfs, logConfiguration.options": { //lintignore:AWSAT003,AWSAT005 ApiJson: ` { @@ -334,8 +326,7 @@ func TestEquivalentContainerPropertiesJSON(t *testing.T) { `, ExpectEquivalent: true, }, - { - Name: "empty linuxParameters.devices.permissions, linuxParameters.tmpfs.mountOptions", + "empty linuxParameters.devices.permissions, linuxParameters.tmpfs.mountOptions": { //lintignore:AWSAT003,AWSAT005 ApiJson: ` { @@ -384,9 +375,9 @@ func TestEquivalentContainerPropertiesJSON(t *testing.T) { }, } - for _, testCase := range testCases { + for name, testCase := range testCases { testCase := testCase - t.Run(testCase.Name, func(t *testing.T) { + t.Run(name, func(t *testing.T) { t.Parallel() got, err := tfbatch.EquivalentContainerPropertiesJSON(testCase.ConfigurationJson, testCase.ApiJson) From 5025196b9458e281acd05eb3fcee2374da639c87 Mon Sep 17 00:00:00 2001 From: Graham Davison Date: Mon, 6 Mar 2023 17:41:56 -0800 Subject: [PATCH 439/763] Handles empty environment variables --- .../service/batch/container_properties.go | 9 +++ .../batch/container_properties_test.go | 73 +++++++++++++++++++ internal/service/batch/job_definition_test.go | 57 +++++++++++++++ 3 files changed, 139 insertions(+) diff --git a/internal/service/batch/container_properties.go b/internal/service/batch/container_properties.go index 17932284fcc9..98e0eb83b298 100644 --- a/internal/service/batch/container_properties.go +++ b/internal/service/batch/container_properties.go @@ -9,6 +9,7 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/private/protocol/json/jsonutil" "github.com/aws/aws-sdk-go/service/batch" + tfslices "github.com/hashicorp/terraform-provider-aws/internal/slices" ) type containerProperties batch.ContainerProperties @@ -24,6 +25,14 @@ func (cp *containerProperties) Reduce() error { cp.Command = nil } + // Remove environment variables with empty values + cp.Environment = tfslices.Filter(cp.Environment, func(kvp *batch.KeyValuePair) bool { + if kvp == nil { + return false + } + return aws.StringValue(kvp.Value) != "" + }) + // Prevent difference of API response that adds an empty array when not configured during the request if len(cp.Environment) == 0 { cp.Environment = nil diff --git a/internal/service/batch/container_properties_test.go b/internal/service/batch/container_properties_test.go index 1e3f93762ef1..556f5d4209d5 100644 --- a/internal/service/batch/container_properties_test.go +++ b/internal/service/batch/container_properties_test.go @@ -373,6 +373,79 @@ func TestEquivalentContainerPropertiesJSON(t *testing.T) { `, ExpectEquivalent: true, }, + "empty environment variables": { + //lintignore:AWSAT005 + ApiJson: ` +{ + "image": "example:image", + "vcpus": 8, + "memory": 2048, + "command": ["start.py", "Ref::S3bucket", "Ref::S3key"], + "environment": [ + { + "name": "VALUE", + "value": "test" + } + ], + "jobRoleArn": "arn:aws:iam::123456789012:role/example", + "volumes": [], + "mountPoints": [], + "ulimits": [], + "resourceRequirements": [] +}`, + //lintignore:AWSAT005 + ConfigurationJson: ` +{ + "command": ["start.py", "Ref::S3bucket", "Ref::S3key"], + "image": "example:image", + "memory": 2048, + "vcpus": 8, + "environment": [ + { + "name": "EMPTY", + "value": "" + }, + { + "name": "VALUE", + "value": "test" + } + ], + "jobRoleArn": "arn:aws:iam::123456789012:role/example" +}`, + ExpectEquivalent: true, + }, + "empty environment variable": { + //lintignore:AWSAT005 + ApiJson: ` +{ + "image": "example:image", + "vcpus": 8, + "memory": 2048, + "command": ["start.py", "Ref::S3bucket", "Ref::S3key"], + "environment": [], + "jobRoleArn": "arn:aws:iam::123456789012:role/example", + "volumes": [], + "mountPoints": [], + "ulimits": [], + "resourceRequirements": [] +}`, + //lintignore:AWSAT005 + ConfigurationJson: ` +{ + "command": ["start.py", "Ref::S3bucket", "Ref::S3key"], + "image": "example:image", + "memory": 2048, + "vcpus": 8, + "environment": [ + { + "name": "EMPTY", + "value": "" + } + ], + "jobRoleArn": "arn:aws:iam::123456789012:role/example" +}`, + ExpectEquivalent: true, + }, } for name, testCase := range testCases { diff --git a/internal/service/batch/job_definition_test.go b/internal/service/batch/job_definition_test.go index ffa04948df5a..3660399f2ea4 100644 --- a/internal/service/batch/job_definition_test.go +++ b/internal/service/batch/job_definition_test.go @@ -423,6 +423,38 @@ func TestAccBatchJobDefinition_propagateTags(t *testing.T) { }) } +func TestAccBatchJobDefinition_ContainerProperties_EmptyField(t *testing.T) { + ctx := acctest.Context(t) + var jd batch.JobDefinition + rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) + resourceName := "aws_batch_job_definition.test" + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { + acctest.PreCheck(t) + testAccPreCheck(ctx, t) + }, + ErrorCheck: acctest.ErrorCheck(t, batch.EndpointsID), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + CheckDestroy: testAccCheckJobDefinitionDestroy(ctx), + Steps: []resource.TestStep{ + { + Config: testAccJobDefinitionConfig_containerProperties_emptyField(rName), + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheckJobDefinitionExists(ctx, resourceName, &jd), + acctest.CheckResourceAttrJMES(resourceName, "container_properties", "length(environment)", "1"), + acctest.CheckResourceAttrJMES(resourceName, "container_properties", "environment[?name=='VALUE'].value | [0]", "value"), + ), + }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, + }, + }) +} + func testAccCheckJobDefinitionExists(ctx context.Context, n string, jd *batch.JobDefinition) resource.TestCheckFunc { return func(s *terraform.State) error { rs, ok := s.RootModule().Resources[n] @@ -805,3 +837,28 @@ resource "aws_batch_job_definition" "test" { } `, rName) } + +func testAccJobDefinitionConfig_containerProperties_emptyField(rName string) string { + return fmt.Sprintf(` +resource "aws_batch_job_definition" "test" { + container_properties = jsonencode({ + command = ["echo", "test"] + image = "busybox" + memory = 128 + vcpus = 1 + environment = [ + { + name = "EMPTY" + value = "" + }, + { + name = "VALUE" + value = "value" + } + ] + }) + name = %[1]q + type = "container" +} +`, rName) +} From ec0d18cc771e5c6e300de2c248cded5052f1dbf4 Mon Sep 17 00:00:00 2001 From: Graham Davison Date: Mon, 6 Mar 2023 22:39:05 -0800 Subject: [PATCH 440/763] Adds warning for empty environment variable --- internal/errs/diag.go | 15 +++++++++++++++ internal/service/batch/job_definition.go | 12 ++++++++++++ 2 files changed, 27 insertions(+) diff --git a/internal/errs/diag.go b/internal/errs/diag.go index 6c302b5254b0..98b7c85766ec 100644 --- a/internal/errs/diag.go +++ b/internal/errs/diag.go @@ -42,6 +42,13 @@ func NewAttributeErrorDiagnostic(path cty.Path, summary, detail string) diag.Dia ) } +func NewAttributeWarningDiagnostic(path cty.Path, summary, detail string) diag.Diagnostic { + return withPath( + NewWarningDiagnostic(summary, detail), + path, + ) +} + func NewErrorDiagnostic(summary, detail string) diag.Diagnostic { return diag.Diagnostic{ Severity: diag.Error, @@ -50,6 +57,14 @@ func NewErrorDiagnostic(summary, detail string) diag.Diagnostic { } } +func NewWarningDiagnostic(summary, detail string) diag.Diagnostic { + return diag.Diagnostic{ + Severity: diag.Warning, + Summary: summary, + Detail: detail, + } +} + func FromAttributeError(path cty.Path, err error) diag.Diagnostic { return withPath( NewErrorDiagnostic(err.Error(), ""), diff --git a/internal/service/batch/job_definition.go b/internal/service/batch/job_definition.go index 9eab1ddcfe6a..1fd31c68c128 100644 --- a/internal/service/batch/job_definition.go +++ b/internal/service/batch/job_definition.go @@ -11,11 +11,13 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/private/protocol/json/jsonutil" "github.com/aws/aws-sdk-go/service/batch" + "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-plugin-sdk/v2/helper/structure" "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" "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" @@ -197,6 +199,16 @@ func resourceJobDefinitionCreate(ctx context.Context, d *schema.ResourceData, me return sdkdiag.AppendErrorf(diags, "creating Batch Job Definition (%s): %s", name, err) } + for _, env := range props.Environment { + if aws.StringValue(env.Value) == "" { + diags = append(diags, errs.NewAttributeWarningDiagnostic( + cty.GetAttrPath("container_properties"), + "Ignoring environment variable", + fmt.Sprintf("The environment variable %q has an empty value, which is ignored by the Batch service", aws.StringValue(env.Name))), + ) + } + } + input.ContainerProperties = props } From fe66f186f1490e81615986ac48be44895f3827a7 Mon Sep 17 00:00:00 2001 From: Graham Davison Date: Mon, 6 Mar 2023 23:02:38 -0800 Subject: [PATCH 441/763] Adds CHANGELOG entry --- .changelog/29820.txt | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 .changelog/29820.txt diff --git a/.changelog/29820.txt b/.changelog/29820.txt new file mode 100644 index 000000000000..b93cc4f37cc1 --- /dev/null +++ b/.changelog/29820.txt @@ -0,0 +1,3 @@ +```release-note:bug +resource/aws_batch_job_definition: Prevents perpetual diff when container properties environment variable has emtpy value. +``` From ba8b5e6c5a6cb45b283f28571641f0fbd9881a02 Mon Sep 17 00:00:00 2001 From: Graham Davison Date: Mon, 6 Mar 2023 23:06:16 -0800 Subject: [PATCH 442/763] Spelling --- .changelog/29820.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.changelog/29820.txt b/.changelog/29820.txt index b93cc4f37cc1..41873a810cf8 100644 --- a/.changelog/29820.txt +++ b/.changelog/29820.txt @@ -1,3 +1,3 @@ ```release-note:bug -resource/aws_batch_job_definition: Prevents perpetual diff when container properties environment variable has emtpy value. +resource/aws_batch_job_definition: Prevents perpetual diff when container properties environment variable has empty value. ``` From c1a49fea56b5a80feed82e11632064610fb6488f Mon Sep 17 00:00:00 2001 From: quartercastle Date: Tue, 14 Feb 2023 09:22:24 +0100 Subject: [PATCH 443/763] fix issue with video_pid not being set correctly video_pid is assigned the value of timed_metadata_pid by mistake --- internal/service/medialive/channel_encoder_settings_schema.go | 2 +- internal/service/medialive/channel_test.go | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/internal/service/medialive/channel_encoder_settings_schema.go b/internal/service/medialive/channel_encoder_settings_schema.go index 0299c83e5cb4..7c95ae30d27a 100644 --- a/internal/service/medialive/channel_encoder_settings_schema.go +++ b/internal/service/medialive/channel_encoder_settings_schema.go @@ -4104,7 +4104,7 @@ func expandM2tsSettings(tfList []interface{}) *types.M2tsSettings { s.TransportStreamId = int32(v) } if v, ok := m["video_pid"].(string); ok && v != "" { - s.TimedMetadataPid = aws.String(v) + s.VideoPid = aws.String(v) } return &s diff --git a/internal/service/medialive/channel_test.go b/internal/service/medialive/channel_test.go index 5eef1b78cc31..9fa6d13e1afc 100644 --- a/internal/service/medialive/channel_test.go +++ b/internal/service/medialive/channel_test.go @@ -129,6 +129,7 @@ func TestAccMediaLiveChannel_m2ts_settings(t *testing.T) { "dvb_sub_pids": "300", "arib_captions_pid": "100", "arib_captions_pid_control": "AUTO", + "video_pid": "101", }), ), }, @@ -791,6 +792,7 @@ resource "aws_medialive_channel" "test" { dvb_sub_pids = "300" arib_captions_pid = "100" arib_captions_pid_control = "AUTO" + video_pid = "101" } } } From 78e9de7abe123843a08877e67d7cb53bba6b8aeb Mon Sep 17 00:00:00 2001 From: quartercastle Date: Mon, 6 Mar 2023 16:55:11 +0100 Subject: [PATCH 444/763] add changelog --- .changelog/29397.txt | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 .changelog/29397.txt diff --git a/.changelog/29397.txt b/.changelog/29397.txt new file mode 100644 index 000000000000..f03a4d8e9854 --- /dev/null +++ b/.changelog/29397.txt @@ -0,0 +1,3 @@ +```release-note:bug +resource/aws_medialive_channel: Fix setting of the `video_pid` attribute in `m2ts_settings` +``` From 17fc0970312c658c2f3c70959e7a2a1780ec4c0f Mon Sep 17 00:00:00 2001 From: Brittan DeYoung <32572259+brittandeyoung@users.noreply.github.com> Date: Tue, 7 Mar 2023 08:01:06 -0500 Subject: [PATCH 445/763] licensemanager: Amend grant, Update home_region to computed field --- internal/service/licensemanager/grant.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/internal/service/licensemanager/grant.go b/internal/service/licensemanager/grant.go index c6111e8df7a1..d3948ed6c905 100644 --- a/internal/service/licensemanager/grant.go +++ b/internal/service/licensemanager/grant.go @@ -52,8 +52,7 @@ func ResourceGrant() *schema.Resource { }, "home_region": { Type: schema.TypeString, - Required: true, - ForceNew: true, + Computed: true, Description: "Home Region of the grant.", }, "license_arn": { @@ -101,7 +100,7 @@ func resourceGrantCreate(ctx context.Context, d *schema.ResourceData, meta inter AllowedOperations: aws.StringSlice(expandAllowedOperations(d.Get("allowed_operations").(*schema.Set).List())), ClientToken: aws.String(resource.UniqueId()), GrantName: aws.String(d.Get("name").(string)), - HomeRegion: aws.String(d.Get("home_region").(string)), + HomeRegion: aws.String(meta.(*conns.AWSClient).Region), LicenseArn: aws.String(d.Get("license_arn").(string)), Principals: aws.StringSlice([]string{d.Get("principal").(string)}), } From 07a16446d06f99d2f69c56ba90fd7011ca556616 Mon Sep 17 00:00:00 2001 From: Brittan DeYoung <32572259+brittandeyoung@users.noreply.github.com> Date: Tue, 7 Mar 2023 08:05:39 -0500 Subject: [PATCH 446/763] website: Amend licensemanager_grant, Proper casing for AWS --- website/docs/r/licensemanager_grant.html.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/website/docs/r/licensemanager_grant.html.markdown b/website/docs/r/licensemanager_grant.html.markdown index a12e7ee44e4c..2efbf93c5a0a 100644 --- a/website/docs/r/licensemanager_grant.html.markdown +++ b/website/docs/r/licensemanager_grant.html.markdown @@ -8,7 +8,7 @@ description: |- # Resource: aws_licensemanager_grant -Provides a License Manager grant. This allows for sharing licenses with other aws accounts. +Provides a License Manager grant. This allows for sharing licenses with other AWS accounts. ## Example Usage From 4849882cd884209a01b755b5c5326696a04a2bf7 Mon Sep 17 00:00:00 2001 From: Brittan DeYoung <32572259+brittandeyoung@users.noreply.github.com> Date: Tue, 7 Mar 2023 08:08:19 -0500 Subject: [PATCH 447/763] licensemanager: Amend grant, improve principal description. --- internal/service/licensemanager/grant.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/service/licensemanager/grant.go b/internal/service/licensemanager/grant.go index d3948ed6c905..881068e4e318 100644 --- a/internal/service/licensemanager/grant.go +++ b/internal/service/licensemanager/grant.go @@ -77,7 +77,7 @@ func ResourceGrant() *schema.Resource { Required: true, ForceNew: true, ValidateFunc: verify.ValidARN, - Description: "The grantee principal ARN.", + Description: "The grantee principal ARN. The target account for the grant in the form of the ARN for an account principal of the root user.", }, "status": { Type: schema.TypeString, From 0c08cf4e03d74de52a069fa1360cc97d17bf56c2 Mon Sep 17 00:00:00 2001 From: Brittan DeYoung <32572259+brittandeyoung@users.noreply.github.com> Date: Tue, 7 Mar 2023 08:08:42 -0500 Subject: [PATCH 448/763] website: Amend licensemanager_grant, improve principal description --- website/docs/r/licensemanager_grant.html.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/website/docs/r/licensemanager_grant.html.markdown b/website/docs/r/licensemanager_grant.html.markdown index 2efbf93c5a0a..cc8c710cbb85 100644 --- a/website/docs/r/licensemanager_grant.html.markdown +++ b/website/docs/r/licensemanager_grant.html.markdown @@ -35,7 +35,7 @@ The following arguments are supported: * `name` - (Required) The Name of the grant. * `allowed_operations` - (Required) A list of the allowed operations for the grant. * `license_arn` - (Required) The ARN of the license to grant. -* `principal` - (Required) The target account for the grant. +* `principal` - (Required) The target account for the grant in the form of the ARN for an account principal of the root user. * `home_region` - (Required) The home region for the license. ## Attributes Reference From 7b1a6da725ed05844f3fe6dcb1d14c6c3d4f5c11 Mon Sep 17 00:00:00 2001 From: Brittan DeYoung <32572259+brittandeyoung@users.noreply.github.com> Date: Tue, 7 Mar 2023 08:10:28 -0500 Subject: [PATCH 449/763] licensemanager: Amend grant, improve allowed_operations description --- internal/service/licensemanager/grant.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/service/licensemanager/grant.go b/internal/service/licensemanager/grant.go index 881068e4e318..3aceab47d436 100644 --- a/internal/service/licensemanager/grant.go +++ b/internal/service/licensemanager/grant.go @@ -43,7 +43,7 @@ func ResourceGrant() *schema.Resource { Type: schema.TypeString, ValidateFunc: validation.StringInSlice(licensemanager.AllowedOperation_Values(), true), }, - Description: "Allowed operations for the grant.", + Description: "Allowed operations for the grant. This is a subset of the allowed operations on the license.", }, "arn": { Type: schema.TypeString, From fee1b2adf93ac30fcaa40af9c635e4d465027355 Mon Sep 17 00:00:00 2001 From: Brittan DeYoung <32572259+brittandeyoung@users.noreply.github.com> Date: Tue, 7 Mar 2023 08:10:53 -0500 Subject: [PATCH 450/763] website: Amend licensemanagert_grant, improve allowed_operations description --- website/docs/r/licensemanager_grant.html.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/website/docs/r/licensemanager_grant.html.markdown b/website/docs/r/licensemanager_grant.html.markdown index cc8c710cbb85..95e95b17b8c2 100644 --- a/website/docs/r/licensemanager_grant.html.markdown +++ b/website/docs/r/licensemanager_grant.html.markdown @@ -33,7 +33,7 @@ resource "aws_licensemanager_grant" "test" { The following arguments are supported: * `name` - (Required) The Name of the grant. -* `allowed_operations` - (Required) A list of the allowed operations for the grant. +* `allowed_operations` - (Required) A list of the allowed operations for the grant. This is a subset of the allowed operations on the license. * `license_arn` - (Required) The ARN of the license to grant. * `principal` - (Required) The target account for the grant in the form of the ARN for an account principal of the root user. * `home_region` - (Required) The home region for the license. From bb2e200b02d5bc942c09d047b1aded7667358ec7 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Tue, 7 Mar 2023 09:05:37 -0500 Subject: [PATCH 451/763] r/aws_db_instance: Set 'listener_endpoint' even if API result is nil. --- internal/service/rds/instance.go | 2 ++ internal/service/rds/instance_test.go | 2 ++ 2 files changed, 4 insertions(+) diff --git a/internal/service/rds/instance.go b/internal/service/rds/instance.go index 687955c12e8c..c62ece13b483 100644 --- a/internal/service/rds/instance.go +++ b/internal/service/rds/instance.go @@ -1671,6 +1671,8 @@ func resourceInstanceRead(ctx context.Context, d *schema.ResourceData, meta inte if err := d.Set("listener_endpoint", []interface{}{flattenEndpoint(v.ListenerEndpoint)}); err != nil { return sdkdiag.AppendErrorf(diags, "setting listener_endpoint: %s", err) } + } else { + d.Set("listener_endpoint", nil) } dbSetResourceDataEngineVersionFromInstance(d, v) diff --git a/internal/service/rds/instance_test.go b/internal/service/rds/instance_test.go index 202e22a64ff7..feddd6cadddf 100644 --- a/internal/service/rds/instance_test.go +++ b/internal/service/rds/instance_test.go @@ -65,6 +65,7 @@ func TestAccRDSInstance_basic(t *testing.T) { resource.TestCheckResourceAttrPair(resourceName, "instance_class", "data.aws_rds_orderable_db_instance.test", "instance_class"), resource.TestCheckResourceAttr(resourceName, "iops", "0"), resource.TestCheckResourceAttr(resourceName, "license_model", "general-public-license"), + resource.TestCheckResourceAttr(resourceName, "listener_endpoint.#", "0"), resource.TestCheckResourceAttrSet(resourceName, "maintenance_window"), resource.TestCheckResourceAttr(resourceName, "max_allocated_storage", "0"), resource.TestCheckResourceAttr(resourceName, "name", "test"), @@ -2827,6 +2828,7 @@ func TestAccRDSInstance_SnapshotIdentifier_multiAZSQLServer(t *testing.T) { testAccCheckInstanceExists(ctx, sourceDbResourceName, &sourceDbInstance), testAccCheckDBSnapshotExists(ctx, snapshotResourceName, &dbSnapshot), testAccCheckInstanceExists(ctx, resourceName, &dbInstance), + resource.TestCheckResourceAttr(resourceName, "listener_endpoint.#", "1"), resource.TestCheckResourceAttr(resourceName, "multi_az", "true"), ), }, From a9b8ec30ffa7030aa688066ca86ae162e85cb753 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 7 Mar 2023 09:19:18 -0500 Subject: [PATCH 452/763] build(deps): bump github.com/aws/aws-sdk-go-v2/service/ssmcontacts (#29822) Bumps [github.com/aws/aws-sdk-go-v2/service/ssmcontacts](https://github.com/aws/aws-sdk-go-v2) from 1.14.3 to 1.14.4. - [Release notes](https://github.com/aws/aws-sdk-go-v2/releases) - [Changelog](https://github.com/aws/aws-sdk-go-v2/blob/main/CHANGELOG.md) - [Commits](https://github.com/aws/aws-sdk-go-v2/compare/service/mq/v1.14.3...service/mq/v1.14.4) --- updated-dependencies: - dependency-name: github.com/aws/aws-sdk-go-v2/service/ssmcontacts dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index efca936e4063..57721de5caee 100644 --- a/go.mod +++ b/go.mod @@ -32,7 +32,7 @@ require ( github.com/aws/aws-sdk-go-v2/service/scheduler v1.1.4 github.com/aws/aws-sdk-go-v2/service/sesv2 v1.16.4 github.com/aws/aws-sdk-go-v2/service/ssm v1.35.5 - github.com/aws/aws-sdk-go-v2/service/ssmcontacts v1.14.3 + github.com/aws/aws-sdk-go-v2/service/ssmcontacts v1.14.4 github.com/aws/aws-sdk-go-v2/service/ssmincidents v1.20.4 github.com/aws/aws-sdk-go-v2/service/transcribe v1.26.0 github.com/aws/smithy-go v1.13.5 diff --git a/go.sum b/go.sum index aedf314447eb..3c584b898709 100644 --- a/go.sum +++ b/go.sum @@ -100,8 +100,8 @@ github.com/aws/aws-sdk-go-v2/service/sesv2 v1.16.4 h1:2bikS7i3POwibqKLlkyZBYKsdT github.com/aws/aws-sdk-go-v2/service/sesv2 v1.16.4/go.mod h1:uIM2GAheOB6xz7UuG5By72Zw2B/20fViFsbDY1JVTVY= github.com/aws/aws-sdk-go-v2/service/ssm v1.35.5 h1:x7FjoHx8A559fAHi0WMnrVxxk9iXwyj1UK5S7TrqFAM= github.com/aws/aws-sdk-go-v2/service/ssm v1.35.5/go.mod h1:DlzAqaXaUSJVQGuZrGPb4TWTkDG6vUs5OiIoX0AxjkU= -github.com/aws/aws-sdk-go-v2/service/ssmcontacts v1.14.3 h1:51jPnor4Xf6myN5ylSvGl7XgeOhKE93XIZ21EpsmSpg= -github.com/aws/aws-sdk-go-v2/service/ssmcontacts v1.14.3/go.mod h1:t9IGXyK+eDt/FSGD2mLQgNS5nK1J+37r0d7jI4d8hqs= +github.com/aws/aws-sdk-go-v2/service/ssmcontacts v1.14.4 h1:IzV/IHEKeM0taWRbFuHU8onhj7R088VzYau7Ka2jDsw= +github.com/aws/aws-sdk-go-v2/service/ssmcontacts v1.14.4/go.mod h1:t9IGXyK+eDt/FSGD2mLQgNS5nK1J+37r0d7jI4d8hqs= github.com/aws/aws-sdk-go-v2/service/ssmincidents v1.20.4 h1:gglh7K4VN15y6ENH2wM16TO6E0MgiLtKh2CCSHkCQuM= github.com/aws/aws-sdk-go-v2/service/ssmincidents v1.20.4/go.mod h1:hYnjkk6Qz1eI1aXZVWXdmcyb3HGK1sPAFM8efXREt5Q= github.com/aws/aws-sdk-go-v2/service/sso v1.12.1/go.mod h1:IgV8l3sj22nQDd5qcAGY0WenwCzCphqdbFOpfktZPrI= From c4b3e886a1a3526f108f1ea8e000e623ece2b279 Mon Sep 17 00:00:00 2001 From: changelogbot Date: Tue, 7 Mar 2023 14:21:42 +0000 Subject: [PATCH 453/763] Update CHANGELOG.md for #29822 --- CHANGELOG.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 321fd420c666..ca9a91546fc6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,16 @@ ## 4.58.0 (Unreleased) + +ENHANCEMENTS: + +* resource/aws_grafana_workspace: Add `network_access_control` argument ([#29793](https://github.com/hashicorp/terraform-provider-aws/issues/29793)) +* resource/aws_sesv2_configuration_set: Add `vdm_options` argument ([#28812](https://github.com/hashicorp/terraform-provider-aws/issues/28812)) +* resource/aws_transfer_server: Add `protocol_details` argument ([#28621](https://github.com/hashicorp/terraform-provider-aws/issues/28621)) +* resource/aws_transfer_workflow: Add `decrypt_step_details` to the `on_exception_steps` and `steps` configuration blocks ([#29692](https://github.com/hashicorp/terraform-provider-aws/issues/29692)) + +BUG FIXES: + +* resource/aws_grafana_workspace: Allow removing `vpc_configuration` ([#29793](https://github.com/hashicorp/terraform-provider-aws/issues/29793)) + ## 4.57.1 (March 6, 2023) BUG FIXES: From 758c900da93715868e66efa2518919471208c940 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 7 Mar 2023 10:18:28 -0500 Subject: [PATCH 454/763] build(deps): bump github.com/aws/aws-sdk-go in /.ci/providerlint (#29823) Bumps [github.com/aws/aws-sdk-go](https://github.com/aws/aws-sdk-go) from 1.44.214 to 1.44.215. - [Release notes](https://github.com/aws/aws-sdk-go/releases) - [Commits](https://github.com/aws/aws-sdk-go/compare/v1.44.214...v1.44.215) --- updated-dependencies: - dependency-name: github.com/aws/aws-sdk-go dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .ci/providerlint/go.mod | 2 +- .ci/providerlint/go.sum | 4 ++-- .ci/providerlint/vendor/modules.txt | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.ci/providerlint/go.mod b/.ci/providerlint/go.mod index 0c69908d9643..20e3e59aae55 100644 --- a/.ci/providerlint/go.mod +++ b/.ci/providerlint/go.mod @@ -3,7 +3,7 @@ module github.com/hashicorp/terraform-provider-aws/ci/providerlint go 1.19 require ( - github.com/aws/aws-sdk-go v1.44.214 + github.com/aws/aws-sdk-go v1.44.215 github.com/bflad/tfproviderlint v0.28.1 github.com/hashicorp/terraform-plugin-sdk/v2 v2.25.0 golang.org/x/tools v0.1.12 diff --git a/.ci/providerlint/go.sum b/.ci/providerlint/go.sum index ccec456ff00a..db7b6bffa1ba 100644 --- a/.ci/providerlint/go.sum +++ b/.ci/providerlint/go.sum @@ -65,8 +65,8 @@ github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5/go.mod h1:wHh0iHkY github.com/aws/aws-sdk-go v1.15.78/go.mod h1:E3/ieXAlvM0XWO57iftYVDLLvQ824smPP3ATZkfNZeM= github.com/aws/aws-sdk-go v1.25.3/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo= github.com/aws/aws-sdk-go v1.37.0/go.mod h1:hcU610XS61/+aQV88ixoOzUoG7v3b31pl2zKMmprdro= -github.com/aws/aws-sdk-go v1.44.214 h1:YzDuC+9UtrAOUkItlK7l3BvKI9o6qAog9X8i289HORc= -github.com/aws/aws-sdk-go v1.44.214/go.mod h1:aVsgQcEevwlmQ7qHE9I3h+dtQgpqhFB+i8Phjh7fkwI= +github.com/aws/aws-sdk-go v1.44.215 h1:K3KERfO6MaV349idub2w1u1H0R0KSkED0LshPnaAn3Q= +github.com/aws/aws-sdk-go v1.44.215/go.mod h1:aVsgQcEevwlmQ7qHE9I3h+dtQgpqhFB+i8Phjh7fkwI= github.com/bflad/gopaniccheck v0.1.0 h1:tJftp+bv42ouERmUMWLoUn/5bi/iQZjHPznM00cP/bU= github.com/bflad/gopaniccheck v0.1.0/go.mod h1:ZCj2vSr7EqVeDaqVsWN4n2MwdROx1YL+LFo47TSWtsA= github.com/bflad/tfproviderlint v0.28.1 h1:7f54/ynV6/lK5/1EyG7tHtc4sMdjJSEFGjZNRJKwBs8= diff --git a/.ci/providerlint/vendor/modules.txt b/.ci/providerlint/vendor/modules.txt index 031697f59589..e814d5961dec 100644 --- a/.ci/providerlint/vendor/modules.txt +++ b/.ci/providerlint/vendor/modules.txt @@ -4,7 +4,7 @@ github.com/agext/levenshtein # github.com/apparentlymart/go-textseg/v13 v13.0.0 ## explicit; go 1.16 github.com/apparentlymart/go-textseg/v13/textseg -# github.com/aws/aws-sdk-go v1.44.214 +# github.com/aws/aws-sdk-go v1.44.215 ## explicit; go 1.11 github.com/aws/aws-sdk-go/aws/awserr github.com/aws/aws-sdk-go/aws/endpoints From 61b74774a0665793dc580e7cb254e66a752aecdd Mon Sep 17 00:00:00 2001 From: changelogbot Date: Tue, 7 Mar 2023 15:20:55 +0000 Subject: [PATCH 455/763] Update CHANGELOG.md for #29823 --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index ca9a91546fc6..a26ceb9daaf4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ ## 4.58.0 (Unreleased) +FEATURES: + +* **New Data Source:** `aws_ecs_task_execution` ([#29783](https://github.com/hashicorp/terraform-provider-aws/issues/29783)) + ENHANCEMENTS: * resource/aws_grafana_workspace: Add `network_access_control` argument ([#29793](https://github.com/hashicorp/terraform-provider-aws/issues/29793)) From 4a76b9ce927ef2392439ca6de5e55c5938a7eb15 Mon Sep 17 00:00:00 2001 From: changhyuni Date: Wed, 8 Mar 2023 00:24:59 +0900 Subject: [PATCH 456/763] Fix opensearch kibana endpoint --- internal/service/opensearch/domain.go | 10 +++++----- internal/service/opensearch/domain_data_source.go | 8 ++++---- internal/service/opensearch/domain_test.go | 2 +- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/internal/service/opensearch/domain.go b/internal/service/opensearch/domain.go index 2ab5107f15d4..eae5c3076875 100644 --- a/internal/service/opensearch/domain.go +++ b/internal/service/opensearch/domain.go @@ -449,7 +449,7 @@ func ResourceDomain() *schema.Resource { Optional: true, Default: "OpenSearch_1.1", }, - "kibana_endpoint": { + "dashboard_endpoint": { Type: schema.TypeString, Computed: true, }, @@ -848,14 +848,14 @@ func resourceDomainRead(ctx context.Context, d *schema.ResourceData, meta interf endpoints := flex.PointersMapToStringList(ds.Endpoints) d.Set("endpoint", endpoints["vpc"]) - d.Set("kibana_endpoint", getKibanaEndpoint(d)) + d.Set("dashboard_endpoint", getDashboardEndpoint(d)) if ds.Endpoint != nil { return sdkdiag.AppendErrorf(diags, "%q: OpenSearch domain in VPC expected to have null Endpoint value", d.Id()) } } else { if ds.Endpoint != nil { d.Set("endpoint", ds.Endpoint) - d.Set("kibana_endpoint", getKibanaEndpoint(d)) + d.Set("dashboard_endpoint", getDashboardEndpoint(d)) } if ds.Endpoints != nil { return sdkdiag.AppendErrorf(diags, "%q: OpenSearch domain not in VPC expected to have null Endpoints value", d.Id()) @@ -1097,8 +1097,8 @@ func suppressEquivalentKMSKeyIDs(k, old, new string, d *schema.ResourceData) boo return strings.Contains(old, new) } -func getKibanaEndpoint(d *schema.ResourceData) string { - return d.Get("endpoint").(string) + "/_plugin/kibana/" +func getDashboardEndpoint(d *schema.ResourceData) string { + return d.Get("endpoint").(string) + "/_dashboards" } func isDedicatedMasterDisabled(k, old, new string, d *schema.ResourceData) bool { diff --git a/internal/service/opensearch/domain_data_source.go b/internal/service/opensearch/domain_data_source.go index 2018f3c4172e..56e277d19e74 100644 --- a/internal/service/opensearch/domain_data_source.go +++ b/internal/service/opensearch/domain_data_source.go @@ -109,7 +109,7 @@ func DataSourceDomain() *schema.Resource { Type: schema.TypeString, Computed: true, }, - "kibana_endpoint": { + "dashboard_endpoint": { Type: schema.TypeString, Computed: true, }, @@ -386,7 +386,7 @@ func dataSourceDomainRead(ctx context.Context, d *schema.ResourceData, meta inte d.Set("arn", ds.ARN) d.Set("domain_id", ds.DomainId) d.Set("endpoint", ds.Endpoint) - d.Set("kibana_endpoint", getKibanaEndpoint(d)) + d.Set("dashboard_endpoint", getDashboardEndpoint(d)) if err := d.Set("advanced_security_options", flattenAdvancedSecurityOptions(ds.AdvancedSecurityOptions)); err != nil { return sdkdiag.AppendErrorf(diags, "setting advanced_security_options: %s", err) @@ -427,14 +427,14 @@ func dataSourceDomainRead(ctx context.Context, d *schema.ResourceData, meta inte if err := d.Set("endpoint", endpoints["vpc"]); err != nil { return sdkdiag.AppendErrorf(diags, "setting endpoint: %s", err) } - d.Set("kibana_endpoint", getKibanaEndpoint(d)) + d.Set("dashboard_endpoint", getDashboardEndpoint(d)) if ds.Endpoint != nil { return sdkdiag.AppendErrorf(diags, "%q: OpenSearch domain in VPC expected to have null Endpoint value", d.Id()) } } else { if ds.Endpoint != nil { d.Set("endpoint", ds.Endpoint) - d.Set("kibana_endpoint", getKibanaEndpoint(d)) + d.Set("dashboard_endpoint", getDashboardEndpoint(d)) } if ds.Endpoints != nil { return sdkdiag.AppendErrorf(diags, "%q: OpenSearch domain not in VPC expected to have null Endpoints value", d.Id()) diff --git a/internal/service/opensearch/domain_test.go b/internal/service/opensearch/domain_test.go index 7e2d0939d0a5..d004bf2878d6 100644 --- a/internal/service/opensearch/domain_test.go +++ b/internal/service/opensearch/domain_test.go @@ -150,7 +150,7 @@ func TestAccOpenSearchDomain_basic(t *testing.T) { Check: resource.ComposeTestCheckFunc( testAccCheckDomainExists(ctx, resourceName, &domain), resource.TestCheckResourceAttr(resourceName, "engine_version", "OpenSearch_1.1"), - resource.TestMatchResourceAttr(resourceName, "kibana_endpoint", regexp.MustCompile(`.*(opensearch|es)\..*/_plugin/kibana/`)), + resource.TestMatchResourceAttr(resourceName, "dashboard_endpoint", regexp.MustCompile(`.*(opensearch|es)\..*/_dashboards/`)), resource.TestCheckResourceAttr(resourceName, "vpc_options.#", "0"), resource.TestCheckResourceAttr(resourceName, "tags.%", "0"), ), From bfc96266a99793dd95b578a1b6032c50de0aa433 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Tue, 7 Mar 2023 10:25:37 -0500 Subject: [PATCH 457/763] r/aws_cloudhsm_v2_hsm: Alphabetize attributes. --- internal/service/cloudhsmv2/hsm.go | 38 +++++++++++++----------------- 1 file changed, 16 insertions(+), 22 deletions(-) diff --git a/internal/service/cloudhsmv2/hsm.go b/internal/service/cloudhsmv2/hsm.go index 95ec57110351..512d2d75334d 100644 --- a/internal/service/cloudhsmv2/hsm.go +++ b/internal/service/cloudhsmv2/hsm.go @@ -30,20 +30,6 @@ func ResourceHSM() *schema.Resource { }, Schema: map[string]*schema.Schema{ - "cluster_id": { - Type: schema.TypeString, - Required: true, - ForceNew: true, - }, - - "subnet_id": { - Type: schema.TypeString, - Optional: true, - Computed: true, - ForceNew: true, - ConflictsWith: []string{"availability_zone"}, - }, - "availability_zone": { Type: schema.TypeString, Optional: true, @@ -51,27 +37,35 @@ func ResourceHSM() *schema.Resource { ForceNew: true, ConflictsWith: []string{"subnet_id"}, }, - - "ip_address": { + "cluster_id": { Type: schema.TypeString, - Optional: true, - Computed: true, + Required: true, ForceNew: true, }, - + "hsm_eni_id": { + Type: schema.TypeString, + Computed: true, + }, "hsm_id": { Type: schema.TypeString, Computed: true, }, - "hsm_state": { Type: schema.TypeString, Computed: true, }, - - "hsm_eni_id": { + "ip_address": { Type: schema.TypeString, + Optional: true, Computed: true, + ForceNew: true, + }, + "subnet_id": { + Type: schema.TypeString, + Optional: true, + Computed: true, + ForceNew: true, + ConflictsWith: []string{"availability_zone"}, }, }, } From df67224a3fda9c3edaf61b09d56da5af382ff12d Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Tue, 7 Mar 2023 10:26:59 -0500 Subject: [PATCH 458/763] 'FindCluster' -> 'FindClusterByID'. --- internal/service/cloudhsmv2/cluster.go | 2 +- internal/service/cloudhsmv2/cluster_test.go | 4 ++-- internal/service/cloudhsmv2/find.go | 2 +- internal/service/cloudhsmv2/hsm.go | 2 +- internal/service/cloudhsmv2/status.go | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/internal/service/cloudhsmv2/cluster.go b/internal/service/cloudhsmv2/cluster.go index 53c79f42ea61..be30295356d3 100644 --- a/internal/service/cloudhsmv2/cluster.go +++ b/internal/service/cloudhsmv2/cluster.go @@ -163,7 +163,7 @@ func resourceClusterRead(ctx context.Context, d *schema.ResourceData, meta inter defaultTagsConfig := meta.(*conns.AWSClient).DefaultTagsConfig ignoreTagsConfig := meta.(*conns.AWSClient).IgnoreTagsConfig - cluster, err := FindCluster(ctx, conn, d.Id()) + cluster, err := FindClusterByID(ctx, conn, d.Id()) if err != nil { return sdkdiag.AppendErrorf(diags, "reading CloudHSMv2 Cluster (%s): %s", d.Id(), err) diff --git a/internal/service/cloudhsmv2/cluster_test.go b/internal/service/cloudhsmv2/cluster_test.go index 9339df471854..b03253788b62 100644 --- a/internal/service/cloudhsmv2/cluster_test.go +++ b/internal/service/cloudhsmv2/cluster_test.go @@ -190,7 +190,7 @@ func testAccCheckClusterDestroy(ctx context.Context) resource.TestCheckFunc { if rs.Type != "aws_cloudhsm_v2_cluster" { continue } - cluster, err := tfcloudhsmv2.FindCluster(ctx, conn, rs.Primary.ID) + cluster, err := tfcloudhsmv2.FindClusterByID(ctx, conn, rs.Primary.ID) if err != nil { return err @@ -213,7 +213,7 @@ func testAccCheckClusterExists(ctx context.Context, name string) resource.TestCh return fmt.Errorf("Not found: %s", name) } - _, err := tfcloudhsmv2.FindCluster(ctx, conn, it.Primary.ID) + _, err := tfcloudhsmv2.FindClusterByID(ctx, conn, it.Primary.ID) if err != nil { return fmt.Errorf("CloudHSM cluster not found: %s", err) diff --git a/internal/service/cloudhsmv2/find.go b/internal/service/cloudhsmv2/find.go index 10e6e2a05705..3cc27b4f238a 100644 --- a/internal/service/cloudhsmv2/find.go +++ b/internal/service/cloudhsmv2/find.go @@ -7,7 +7,7 @@ import ( "github.com/aws/aws-sdk-go/service/cloudhsmv2" ) -func FindCluster(ctx context.Context, conn *cloudhsmv2.CloudHSMV2, id string) (*cloudhsmv2.Cluster, error) { +func FindClusterByID(ctx context.Context, conn *cloudhsmv2.CloudHSMV2, id string) (*cloudhsmv2.Cluster, error) { input := &cloudhsmv2.DescribeClustersInput{ Filters: map[string][]*string{ "clusterIds": aws.StringSlice([]string{id}), diff --git a/internal/service/cloudhsmv2/hsm.go b/internal/service/cloudhsmv2/hsm.go index 512d2d75334d..ec290388dc8b 100644 --- a/internal/service/cloudhsmv2/hsm.go +++ b/internal/service/cloudhsmv2/hsm.go @@ -82,7 +82,7 @@ func resourceHSMCreate(ctx context.Context, d *schema.ResourceData, meta interfa if v, ok := d.GetOk("availability_zone"); ok { input.AvailabilityZone = aws.String(v.(string)) } else { - cluster, err := FindCluster(ctx, conn, d.Get("cluster_id").(string)) + cluster, err := FindClusterByID(ctx, conn, d.Get("cluster_id").(string)) if err != nil { return sdkdiag.AppendErrorf(diags, "reading CloudHSMv2 Cluster (%s): %s", d.Id(), err) diff --git a/internal/service/cloudhsmv2/status.go b/internal/service/cloudhsmv2/status.go index 7c2f2b52d371..e28508612403 100644 --- a/internal/service/cloudhsmv2/status.go +++ b/internal/service/cloudhsmv2/status.go @@ -10,7 +10,7 @@ import ( func statusClusterState(ctx context.Context, conn *cloudhsmv2.CloudHSMV2, id string) resource.StateRefreshFunc { return func() (interface{}, string, error) { - cluster, err := FindCluster(ctx, conn, id) + cluster, err := FindClusterByID(ctx, conn, id) if err != nil { return nil, "", err From 59e10312d3bb5a5048c284161ce5cec02bb82f80 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Tue, 7 Mar 2023 10:29:05 -0500 Subject: [PATCH 459/763] 'FindHSM' -> 'FindHSMByTwoPartKey'. --- internal/service/cloudhsmv2/find.go | 2 +- internal/service/cloudhsmv2/hsm.go | 2 +- internal/service/cloudhsmv2/hsm_test.go | 4 ++-- internal/service/cloudhsmv2/status.go | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/internal/service/cloudhsmv2/find.go b/internal/service/cloudhsmv2/find.go index 3cc27b4f238a..2742e0feff6d 100644 --- a/internal/service/cloudhsmv2/find.go +++ b/internal/service/cloudhsmv2/find.go @@ -42,7 +42,7 @@ func FindClusterByID(ctx context.Context, conn *cloudhsmv2.CloudHSMV2, id string return result, nil } -func FindHSM(ctx context.Context, conn *cloudhsmv2.CloudHSMV2, hsmID string, eniID string) (*cloudhsmv2.Hsm, error) { +func FindHSMByTwoPartKey(ctx context.Context, conn *cloudhsmv2.CloudHSMV2, hsmID, eniID string) (*cloudhsmv2.Hsm, error) { input := &cloudhsmv2.DescribeClustersInput{} var result *cloudhsmv2.Hsm diff --git a/internal/service/cloudhsmv2/hsm.go b/internal/service/cloudhsmv2/hsm.go index ec290388dc8b..a78113d5a817 100644 --- a/internal/service/cloudhsmv2/hsm.go +++ b/internal/service/cloudhsmv2/hsm.go @@ -125,7 +125,7 @@ func resourceHSMRead(ctx context.Context, d *schema.ResourceData, meta interface var diags diag.Diagnostics conn := meta.(*conns.AWSClient).CloudHSMV2Conn() - hsm, err := FindHSM(ctx, conn, d.Id(), d.Get("hsm_eni_id").(string)) + hsm, err := FindHSMByTwoPartKey(ctx, conn, d.Id(), d.Get("hsm_eni_id").(string)) if err != nil { return sdkdiag.AppendErrorf(diags, "reading CloudHSMv2 HSM (%s): %s", d.Id(), err) diff --git a/internal/service/cloudhsmv2/hsm_test.go b/internal/service/cloudhsmv2/hsm_test.go index cfc2b097fd4e..39d22ddf22ea 100644 --- a/internal/service/cloudhsmv2/hsm_test.go +++ b/internal/service/cloudhsmv2/hsm_test.go @@ -220,7 +220,7 @@ func testAccCheckHSMDestroy(ctx context.Context) resource.TestCheckFunc { continue } - hsm, err := tfcloudhsmv2.FindHSM(ctx, conn, rs.Primary.ID, rs.Primary.Attributes["hsm_eni_id"]) + hsm, err := tfcloudhsmv2.FindHSMByTwoPartKey(ctx, conn, rs.Primary.ID, rs.Primary.Attributes["hsm_eni_id"]) if err != nil { return err @@ -244,7 +244,7 @@ func testAccCheckHSMExists(ctx context.Context, name string) resource.TestCheckF return fmt.Errorf("Not found: %s", name) } - _, err := tfcloudhsmv2.FindHSM(ctx, conn, it.Primary.ID, it.Primary.Attributes["hsm_eni_id"]) + _, err := tfcloudhsmv2.FindHSMByTwoPartKey(ctx, conn, it.Primary.ID, it.Primary.Attributes["hsm_eni_id"]) if err != nil { return fmt.Errorf("CloudHSM cluster not found: %s", err) } diff --git a/internal/service/cloudhsmv2/status.go b/internal/service/cloudhsmv2/status.go index e28508612403..0fad6a3478d8 100644 --- a/internal/service/cloudhsmv2/status.go +++ b/internal/service/cloudhsmv2/status.go @@ -26,7 +26,7 @@ func statusClusterState(ctx context.Context, conn *cloudhsmv2.CloudHSMV2, id str func statusHSMState(ctx context.Context, conn *cloudhsmv2.CloudHSMV2, id string) resource.StateRefreshFunc { return func() (interface{}, string, error) { - hsm, err := FindHSM(ctx, conn, id, "") + hsm, err := FindHSMByTwoPartKey(ctx, conn, id, "") if err != nil { return nil, "", err From efc286780a56a4368888eb71afa3dc97ec1ecbb4 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Tue, 7 Mar 2023 10:45:15 -0500 Subject: [PATCH 460/763] Add 'findClusters' and 'findCluster'. --- internal/service/cloudhsmv2/find.go | 98 ++++++++++++++++++----------- 1 file changed, 62 insertions(+), 36 deletions(-) diff --git a/internal/service/cloudhsmv2/find.go b/internal/service/cloudhsmv2/find.go index 2742e0feff6d..a9d2808d328d 100644 --- a/internal/service/cloudhsmv2/find.go +++ b/internal/service/cloudhsmv2/find.go @@ -5,6 +5,8 @@ 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-provider-aws/internal/tfresource" ) func FindClusterByID(ctx context.Context, conn *cloudhsmv2.CloudHSMV2, id string) (*cloudhsmv2.Cluster, error) { @@ -14,21 +16,58 @@ func FindClusterByID(ctx context.Context, conn *cloudhsmv2.CloudHSMV2, id string }, } - var result *cloudhsmv2.Cluster + output, err := findCluster(ctx, conn, input) + + if err != nil { + return nil, err + } + + if state := aws.StringValue(output.State); state == cloudhsmv2.ClusterStateDeleted { + return nil, &resource.NotFoundError{ + Message: state, + LastRequest: input, + } + } + + // Eventual consistency check. + if aws.StringValue(output.ClusterId) != id { + return nil, &resource.NotFoundError{ + LastRequest: input, + } + } + + return output, nil +} + +func findCluster(ctx context.Context, conn *cloudhsmv2.CloudHSMV2, input *cloudhsmv2.DescribeClustersInput) (*cloudhsmv2.Cluster, error) { + output, err := findClusters(ctx, conn, input) + + if err != nil { + return nil, err + } + + if len(output) == 0 || output[0] == nil { + return nil, tfresource.NewEmptyResultError(input) + } + + if count := len(output); count > 1 { + return nil, tfresource.NewTooManyResultsError(count, input) + } + + return output[0], nil +} + +func findClusters(ctx context.Context, conn *cloudhsmv2.CloudHSMV2, input *cloudhsmv2.DescribeClustersInput) ([]*cloudhsmv2.Cluster, error) { + var output []*cloudhsmv2.Cluster err := conn.DescribeClustersPagesWithContext(ctx, input, func(page *cloudhsmv2.DescribeClustersOutput, lastPage bool) bool { if page == nil { return !lastPage } - for _, cluster := range page.Clusters { - if cluster == nil { - continue - } - - if aws.StringValue(cluster.ClusterId) == id { - result = cluster - break + for _, v := range page.Clusters { + if v != nil { + output = append(output, v) } } @@ -39,45 +78,32 @@ func FindClusterByID(ctx context.Context, conn *cloudhsmv2.CloudHSMV2, id string return nil, err } - return result, nil + return output, nil } func FindHSMByTwoPartKey(ctx context.Context, conn *cloudhsmv2.CloudHSMV2, hsmID, eniID string) (*cloudhsmv2.Hsm, error) { input := &cloudhsmv2.DescribeClustersInput{} - var result *cloudhsmv2.Hsm + output, err := findClusters(ctx, conn, input) - err := conn.DescribeClustersPagesWithContext(ctx, input, func(page *cloudhsmv2.DescribeClustersOutput, lastPage bool) bool { - if page == nil { - return !lastPage - } + if err != nil { + return nil, err + } - for _, cluster := range page.Clusters { - if cluster == nil { + for _, v := range output { + for _, v := range v.Hsms { + if v == nil { continue } - for _, hsm := range cluster.Hsms { - if hsm == nil { - continue - } - - // CloudHSMv2 HSM instances can be recreated, but the ENI ID will - // remain consistent. Without this ENI matching, HSM instances - // instances can become orphaned. - if aws.StringValue(hsm.HsmId) == hsmID || aws.StringValue(hsm.EniId) == eniID { - result = hsm - return false - } + // CloudHSMv2 HSM instances can be recreated, but the ENI ID will + // remain consistent. Without this ENI matching, HSM instances + // instances can become orphaned. + if aws.StringValue(v.HsmId) == hsmID || aws.StringValue(v.EniId) == eniID { + return v, nil } } - - return !lastPage - }) - - if err != nil { - return nil, err } - return result, nil + return nil, &resource.NotFoundError{} } From 75d0131e8bca4a50d885db2e75507c318bd7590c Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Tue, 7 Mar 2023 10:50:24 -0500 Subject: [PATCH 461/763] 'statusClusterState' -> 'statusCluster' and 'statusHSMState' -> 'statusHSM'. --- internal/service/cloudhsmv2/status.go | 29 +++++++++--------- internal/service/cloudhsmv2/wait.go | 42 ++++++++++++--------------- 2 files changed, 33 insertions(+), 38 deletions(-) diff --git a/internal/service/cloudhsmv2/status.go b/internal/service/cloudhsmv2/status.go index 0fad6a3478d8..4ae429edd61c 100644 --- a/internal/service/cloudhsmv2/status.go +++ b/internal/service/cloudhsmv2/status.go @@ -6,36 +6,37 @@ 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-provider-aws/internal/tfresource" ) -func statusClusterState(ctx context.Context, conn *cloudhsmv2.CloudHSMV2, id string) resource.StateRefreshFunc { +func statusCluster(ctx context.Context, conn *cloudhsmv2.CloudHSMV2, id string) resource.StateRefreshFunc { return func() (interface{}, string, error) { - cluster, err := FindClusterByID(ctx, conn, id) + output, err := FindClusterByID(ctx, conn, id) - if err != nil { - return nil, "", err + if tfresource.NotFound(err) { + return nil, "", nil } - if cluster == nil { - return nil, "", nil + if err != nil { + return nil, "", err } - return cluster, aws.StringValue(cluster.State), err + return output, aws.StringValue(output.State), err } } -func statusHSMState(ctx context.Context, conn *cloudhsmv2.CloudHSMV2, id string) resource.StateRefreshFunc { +func statusHSM(ctx context.Context, conn *cloudhsmv2.CloudHSMV2, id string) resource.StateRefreshFunc { return func() (interface{}, string, error) { - hsm, err := FindHSMByTwoPartKey(ctx, conn, id, "") + output, err := FindHSMByTwoPartKey(ctx, conn, id, "") - if err != nil { - return nil, "", err + if tfresource.NotFound(err) { + return nil, "", nil } - if hsm == nil { - return nil, "", nil + if err != nil { + return nil, "", err } - return hsm, aws.StringValue(hsm.State), err + return output, aws.StringValue(output.State), err } } diff --git a/internal/service/cloudhsmv2/wait.go b/internal/service/cloudhsmv2/wait.go index 68c41b1f1b3c..9ac5caa437c7 100644 --- a/internal/service/cloudhsmv2/wait.go +++ b/internal/service/cloudhsmv2/wait.go @@ -10,12 +10,9 @@ import ( func waitClusterActive(ctx context.Context, conn *cloudhsmv2.CloudHSMV2, id string, timeout time.Duration) (*cloudhsmv2.Cluster, error) { stateConf := &resource.StateChangeConf{ - Pending: []string{ - cloudhsmv2.ClusterStateCreateInProgress, - cloudhsmv2.ClusterStateInitializeInProgress, - }, + Pending: []string{cloudhsmv2.ClusterStateCreateInProgress, cloudhsmv2.ClusterStateInitializeInProgress}, Target: []string{cloudhsmv2.ClusterStateActive}, - Refresh: statusClusterState(ctx, conn, id), + Refresh: statusCluster(ctx, conn, id), Timeout: timeout, MinTimeout: 30 * time.Second, Delay: 30 * time.Second, @@ -23,8 +20,8 @@ func waitClusterActive(ctx context.Context, conn *cloudhsmv2.CloudHSMV2, id stri outputRaw, err := stateConf.WaitForStateContext(ctx) - if v, ok := outputRaw.(*cloudhsmv2.Cluster); ok { - return v, err + if output, ok := outputRaw.(*cloudhsmv2.Cluster); ok { + return output, err } return nil, err @@ -33,8 +30,8 @@ func waitClusterActive(ctx context.Context, conn *cloudhsmv2.CloudHSMV2, id stri func waitClusterDeleted(ctx context.Context, conn *cloudhsmv2.CloudHSMV2, id string, timeout time.Duration) (*cloudhsmv2.Cluster, error) { stateConf := &resource.StateChangeConf{ Pending: []string{cloudhsmv2.ClusterStateDeleteInProgress}, - Target: []string{cloudhsmv2.ClusterStateDeleted}, - Refresh: statusClusterState(ctx, conn, id), + Target: []string{}, + Refresh: statusCluster(ctx, conn, id), Timeout: timeout, MinTimeout: 30 * time.Second, Delay: 30 * time.Second, @@ -42,8 +39,8 @@ func waitClusterDeleted(ctx context.Context, conn *cloudhsmv2.CloudHSMV2, id str outputRaw, err := stateConf.WaitForStateContext(ctx) - if v, ok := outputRaw.(*cloudhsmv2.Cluster); ok { - return v, err + if output, ok := outputRaw.(*cloudhsmv2.Cluster); ok { + return output, err } return nil, err @@ -51,12 +48,9 @@ func waitClusterDeleted(ctx context.Context, conn *cloudhsmv2.CloudHSMV2, id str func waitClusterUninitialized(ctx context.Context, conn *cloudhsmv2.CloudHSMV2, id string, timeout time.Duration) (*cloudhsmv2.Cluster, error) { stateConf := &resource.StateChangeConf{ - Pending: []string{ - cloudhsmv2.ClusterStateCreateInProgress, - cloudhsmv2.ClusterStateInitializeInProgress, - }, + Pending: []string{cloudhsmv2.ClusterStateCreateInProgress, cloudhsmv2.ClusterStateInitializeInProgress}, Target: []string{cloudhsmv2.ClusterStateUninitialized}, - Refresh: statusClusterState(ctx, conn, id), + Refresh: statusCluster(ctx, conn, id), Timeout: timeout, MinTimeout: 30 * time.Second, Delay: 30 * time.Second, @@ -64,8 +58,8 @@ func waitClusterUninitialized(ctx context.Context, conn *cloudhsmv2.CloudHSMV2, outputRaw, err := stateConf.WaitForStateContext(ctx) - if v, ok := outputRaw.(*cloudhsmv2.Cluster); ok { - return v, err + if output, ok := outputRaw.(*cloudhsmv2.Cluster); ok { + return output, err } return nil, err @@ -75,7 +69,7 @@ func waitHSMActive(ctx context.Context, conn *cloudhsmv2.CloudHSMV2, id string, stateConf := &resource.StateChangeConf{ Pending: []string{cloudhsmv2.HsmStateCreateInProgress}, Target: []string{cloudhsmv2.HsmStateActive}, - Refresh: statusHSMState(ctx, conn, id), + Refresh: statusHSM(ctx, conn, id), Timeout: timeout, MinTimeout: 30 * time.Second, Delay: 30 * time.Second, @@ -83,8 +77,8 @@ func waitHSMActive(ctx context.Context, conn *cloudhsmv2.CloudHSMV2, id string, outputRaw, err := stateConf.WaitForStateContext(ctx) - if v, ok := outputRaw.(*cloudhsmv2.Hsm); ok { - return v, err + if output, ok := outputRaw.(*cloudhsmv2.Hsm); ok { + return output, err } return nil, err @@ -94,7 +88,7 @@ func waitHSMDeleted(ctx context.Context, conn *cloudhsmv2.CloudHSMV2, id string, stateConf := &resource.StateChangeConf{ Pending: []string{cloudhsmv2.HsmStateDeleteInProgress}, Target: []string{}, - Refresh: statusHSMState(ctx, conn, id), + Refresh: statusHSM(ctx, conn, id), Timeout: timeout, MinTimeout: 30 * time.Second, Delay: 30 * time.Second, @@ -102,8 +96,8 @@ func waitHSMDeleted(ctx context.Context, conn *cloudhsmv2.CloudHSMV2, id string, outputRaw, err := stateConf.WaitForStateContext(ctx) - if v, ok := outputRaw.(*cloudhsmv2.Hsm); ok { - return v, err + if output, ok := outputRaw.(*cloudhsmv2.Hsm); ok { + return output, err } return nil, err From ed66daa3bd3a6fe31c298010baf1dbf076574f43 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Tue, 7 Mar 2023 10:51:12 -0500 Subject: [PATCH 462/763] 'waitHSMActive' -> 'waitHSMCreated'. --- internal/service/cloudhsmv2/hsm.go | 2 +- internal/service/cloudhsmv2/wait.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/service/cloudhsmv2/hsm.go b/internal/service/cloudhsmv2/hsm.go index a78113d5a817..9ca5e6cecf1f 100644 --- a/internal/service/cloudhsmv2/hsm.go +++ b/internal/service/cloudhsmv2/hsm.go @@ -114,7 +114,7 @@ func resourceHSMCreate(ctx context.Context, d *schema.ResourceData, meta interfa d.SetId(aws.StringValue(output.Hsm.HsmId)) - if _, err := waitHSMActive(ctx, conn, d.Id(), d.Timeout(schema.TimeoutCreate)); err != nil { + if _, err := waitHSMCreated(ctx, conn, d.Id(), d.Timeout(schema.TimeoutCreate)); err != nil { return sdkdiag.AppendErrorf(diags, "waiting for CloudHSMv2 HSM (%s) creation: %s", d.Id(), err) } diff --git a/internal/service/cloudhsmv2/wait.go b/internal/service/cloudhsmv2/wait.go index 9ac5caa437c7..29fe4eea29ec 100644 --- a/internal/service/cloudhsmv2/wait.go +++ b/internal/service/cloudhsmv2/wait.go @@ -65,7 +65,7 @@ func waitClusterUninitialized(ctx context.Context, conn *cloudhsmv2.CloudHSMV2, return nil, err } -func waitHSMActive(ctx context.Context, conn *cloudhsmv2.CloudHSMV2, id string, timeout time.Duration) (*cloudhsmv2.Hsm, error) { +func waitHSMCreated(ctx context.Context, conn *cloudhsmv2.CloudHSMV2, id string, timeout time.Duration) (*cloudhsmv2.Hsm, error) { stateConf := &resource.StateChangeConf{ Pending: []string{cloudhsmv2.HsmStateCreateInProgress}, Target: []string{cloudhsmv2.HsmStateActive}, From c31019d7e9af77d9c438d98a13f52bcdcd5a75fd Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Tue, 7 Mar 2023 10:57:10 -0500 Subject: [PATCH 463/763] cloudhsmv2: Use 'tfresource.SetLastError'. --- internal/service/cloudhsmv2/wait.go | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/internal/service/cloudhsmv2/wait.go b/internal/service/cloudhsmv2/wait.go index 29fe4eea29ec..5344f3bbcf28 100644 --- a/internal/service/cloudhsmv2/wait.go +++ b/internal/service/cloudhsmv2/wait.go @@ -2,10 +2,13 @@ package cloudhsmv2 import ( "context" + "errors" "time" + "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-provider-aws/internal/tfresource" ) func waitClusterActive(ctx context.Context, conn *cloudhsmv2.CloudHSMV2, id string, timeout time.Duration) (*cloudhsmv2.Cluster, error) { @@ -21,6 +24,8 @@ func waitClusterActive(ctx context.Context, conn *cloudhsmv2.CloudHSMV2, id stri outputRaw, err := stateConf.WaitForStateContext(ctx) if output, ok := outputRaw.(*cloudhsmv2.Cluster); ok { + tfresource.SetLastError(err, errors.New(aws.StringValue(output.StateMessage))) + return output, err } @@ -40,6 +45,8 @@ func waitClusterDeleted(ctx context.Context, conn *cloudhsmv2.CloudHSMV2, id str outputRaw, err := stateConf.WaitForStateContext(ctx) if output, ok := outputRaw.(*cloudhsmv2.Cluster); ok { + tfresource.SetLastError(err, errors.New(aws.StringValue(output.StateMessage))) + return output, err } @@ -59,6 +66,8 @@ func waitClusterUninitialized(ctx context.Context, conn *cloudhsmv2.CloudHSMV2, outputRaw, err := stateConf.WaitForStateContext(ctx) if output, ok := outputRaw.(*cloudhsmv2.Cluster); ok { + tfresource.SetLastError(err, errors.New(aws.StringValue(output.StateMessage))) + return output, err } @@ -78,6 +87,8 @@ func waitHSMCreated(ctx context.Context, conn *cloudhsmv2.CloudHSMV2, id string, outputRaw, err := stateConf.WaitForStateContext(ctx) if output, ok := outputRaw.(*cloudhsmv2.Hsm); ok { + tfresource.SetLastError(err, errors.New(aws.StringValue(output.StateMessage))) + return output, err } @@ -97,6 +108,8 @@ func waitHSMDeleted(ctx context.Context, conn *cloudhsmv2.CloudHSMV2, id string, outputRaw, err := stateConf.WaitForStateContext(ctx) if output, ok := outputRaw.(*cloudhsmv2.Hsm); ok { + tfresource.SetLastError(err, errors.New(aws.StringValue(output.StateMessage))) + return output, err } From 215b1dce4f98fd2a888c830baff46c3b736ab81d Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Tue, 7 Mar 2023 11:19:12 -0500 Subject: [PATCH 464/763] Cosmetics. --- internal/service/rds/snapshot.go | 101 +++++++++++---------- internal/service/rds/snapshot_copy.go | 49 +++++----- internal/service/rds/snapshot_copy_test.go | 26 ++---- internal/service/rds/snapshot_test.go | 36 +++----- internal/service/rds/wait.go | 2 +- website/docs/r/db_snapshot.html.markdown | 2 +- 6 files changed, 106 insertions(+), 110 deletions(-) diff --git a/internal/service/rds/snapshot.go b/internal/service/rds/snapshot.go index ba1bf4b8555a..056a70fd423a 100644 --- a/internal/service/rds/snapshot.go +++ b/internal/service/rds/snapshot.go @@ -25,12 +25,13 @@ func ResourceSnapshot() *schema.Resource { ReadWithoutTimeout: resourceSnapshotRead, UpdateWithoutTimeout: resourceSnapshotUpdate, DeleteWithoutTimeout: resourceSnapshotDelete, + Importer: &schema.ResourceImporter{ StateContext: schema.ImportStatePassthroughContext, }, Timeouts: &schema.ResourceTimeout{ - Read: schema.DefaultTimeout(20 * time.Minute), + Create: schema.DefaultTimeout(20 * time.Minute), }, Schema: map[string]*schema.Schema{ @@ -130,34 +131,37 @@ func resourceSnapshotCreate(ctx context.Context, d *schema.ResourceData, meta in conn := meta.(*conns.AWSClient).RDSConn() defaultTagsConfig := meta.(*conns.AWSClient).DefaultTagsConfig tags := defaultTagsConfig.MergeTags(tftags.New(ctx, d.Get("tags").(map[string]interface{}))) - dBInstanceIdentifier := d.Get("db_instance_identifier").(string) - params := &rds.CreateDBSnapshotInput{ - DBInstanceIdentifier: aws.String(dBInstanceIdentifier), - DBSnapshotIdentifier: aws.String(d.Get("db_snapshot_identifier").(string)), + dbSnapshotID := d.Get("db_snapshot_identifier").(string) + input := &rds.CreateDBSnapshotInput{ + DBInstanceIdentifier: aws.String(d.Get("db_instance_identifier").(string)), + DBSnapshotIdentifier: aws.String(dbSnapshotID), Tags: Tags(tags.IgnoreAWS()), } - resp, err := conn.CreateDBSnapshotWithContext(ctx, params) + output, err := conn.CreateDBSnapshotWithContext(ctx, input) + if err != nil { - return sdkdiag.AppendErrorf(diags, "creating AWS DB Snapshot (%s): %s", dBInstanceIdentifier, err) + return sdkdiag.AppendErrorf(diags, "creating RDS DB Snapshot (%s): %s", dbSnapshotID, err) } - d.SetId(aws.StringValue(resp.DBSnapshot.DBSnapshotIdentifier)) - if err := waitDBSnapshotAvailable(ctx, conn, d.Id(), d.Timeout(schema.TimeoutCreate)); err != nil { - return sdkdiag.AppendErrorf(diags, "waiting for RDS DB Snapshot (%s) to be available: %s", d.Id(), err) + d.SetId(aws.StringValue(output.DBSnapshot.DBSnapshotIdentifier)) + + if err := waitDBSnapshotCreated(ctx, conn, d.Id(), d.Timeout(schema.TimeoutCreate)); err != nil { + return sdkdiag.AppendErrorf(diags, "waiting for RDS DB Snapshot (%s) create: %s", d.Id(), err) } if v, ok := d.GetOk("shared_accounts"); ok && v.(*schema.Set).Len() > 0 { - attrInput := &rds.ModifyDBSnapshotAttributeInput{ - DBSnapshotIdentifier: aws.String(dBInstanceIdentifier), + input := &rds.ModifyDBSnapshotAttributeInput{ AttributeName: aws.String("restore"), + DBSnapshotIdentifier: aws.String(d.Id()), ValuesToAdd: flex.ExpandStringSet(v.(*schema.Set)), } - _, err := conn.ModifyDBSnapshotAttributeWithContext(ctx, attrInput) + _, err := conn.ModifyDBSnapshotAttributeWithContext(ctx, input) + if err != nil { - return sdkdiag.AppendErrorf(diags, "error modifying AWS DB Snapshot Attribute %s: %s", dBInstanceIdentifier, err) + return sdkdiag.AppendErrorf(diags, "modifying RDS DB Snapshot (%s) attribute: %s", d.Id(), err) } } @@ -171,22 +175,23 @@ func resourceSnapshotRead(ctx context.Context, d *schema.ResourceData, meta inte ignoreTagsConfig := meta.(*conns.AWSClient).IgnoreTagsConfig snapshot, err := FindDBSnapshotByID(ctx, conn, d.Id()) + if !d.IsNewResource() && tfresource.NotFound(err) { log.Printf("[WARN] RDS DB Snapshot (%s) not found, removing from state", d.Id()) d.SetId("") - return nil + return diags } if err != nil { - return diag.Errorf("reading RDS DB snapshot (%s): %s", d.Id(), err) + return sdkdiag.AppendErrorf(diags, "reading RDS DB Snapshot (%s): %s", d.Id(), err) } arn := aws.StringValue(snapshot.DBSnapshotArn) - d.Set("db_snapshot_identifier", snapshot.DBSnapshotIdentifier) - d.Set("db_instance_identifier", snapshot.DBInstanceIdentifier) d.Set("allocated_storage", snapshot.AllocatedStorage) d.Set("availability_zone", snapshot.AvailabilityZone) + d.Set("db_instance_identifier", snapshot.DBInstanceIdentifier) d.Set("db_snapshot_arn", arn) + d.Set("db_snapshot_identifier", snapshot.DBSnapshotIdentifier) d.Set("encrypted", snapshot.Encrypted) d.Set("engine", snapshot.Engine) d.Set("engine_version", snapshot.EngineVersion) @@ -218,39 +223,18 @@ func resourceSnapshotRead(ctx context.Context, d *schema.ResourceData, meta inte return sdkdiag.AppendErrorf(diags, "setting tags_all: %s", err) } - attrInput := &rds.DescribeDBSnapshotAttributesInput{ + input := &rds.DescribeDBSnapshotAttributesInput{ DBSnapshotIdentifier: aws.String(d.Id()), } - attrResp, err := conn.DescribeDBSnapshotAttributesWithContext(ctx, attrInput) - if err != nil { - return sdkdiag.AppendErrorf(diags, "error describing AWS DB Snapshot Attribute %s: %s", d.Id(), err) - } - - attr := attrResp.DBSnapshotAttributesResult.DBSnapshotAttributes[0] - - d.Set("shared_accounts", flex.FlattenStringSet(attr.AttributeValues)) - - return diags -} - -func resourceSnapshotDelete(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - var diags diag.Diagnostics - conn := meta.(*conns.AWSClient).RDSConn() - - log.Printf("[DEBUG] Deleting RDS DB Snapshot: %s", d.Id()) - _, err := conn.DeleteDBSnapshotWithContext(ctx, &rds.DeleteDBSnapshotInput{ - DBSnapshotIdentifier: aws.String(d.Id()), - }) - - if tfawserr.ErrCodeEquals(err, rds.ErrCodeDBSnapshotNotFoundFault) { - return diags - } + output, err := conn.DescribeDBSnapshotAttributesWithContext(ctx, input) if err != nil { - return sdkdiag.AppendErrorf(diags, "deleting RDS DB Snapshot (%s): %s", d.Id(), err) + return sdkdiag.AppendErrorf(diags, "reading RDS DB Snapshot (%s) attribute: %s", d.Id(), err) } + d.Set("shared_accounts", flex.FlattenStringSet(output.DBSnapshotAttributesResult.DBSnapshotAttributes[0].AttributeValues)) + return diags } @@ -266,16 +250,17 @@ func resourceSnapshotUpdate(ctx context.Context, d *schema.ResourceData, meta in additionList := ns.Difference(os) removalList := os.Difference(ns) - attrInput := &rds.ModifyDBSnapshotAttributeInput{ - DBSnapshotIdentifier: aws.String(d.Id()), + input := &rds.ModifyDBSnapshotAttributeInput{ AttributeName: aws.String("restore"), + DBSnapshotIdentifier: aws.String(d.Id()), ValuesToAdd: flex.ExpandStringSet(additionList), ValuesToRemove: flex.ExpandStringSet(removalList), } - _, err := conn.ModifyDBSnapshotAttributeWithContext(ctx, attrInput) + _, err := conn.ModifyDBSnapshotAttributeWithContext(ctx, input) + if err != nil { - return sdkdiag.AppendErrorf(diags, "error modifying AWS DB Snapshot Attribute %s: %s", d.Id(), err) + return sdkdiag.AppendErrorf(diags, "modifying RDS DB Snapshot (%s) attribute: %s", d.Id(), err) } } @@ -289,3 +274,23 @@ func resourceSnapshotUpdate(ctx context.Context, d *schema.ResourceData, meta in return diags } + +func resourceSnapshotDelete(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { + var diags diag.Diagnostics + conn := meta.(*conns.AWSClient).RDSConn() + + log.Printf("[DEBUG] Deleting RDS DB Snapshot: %s", d.Id()) + _, err := conn.DeleteDBSnapshotWithContext(ctx, &rds.DeleteDBSnapshotInput{ + DBSnapshotIdentifier: aws.String(d.Id()), + }) + + if tfawserr.ErrCodeEquals(err, rds.ErrCodeDBSnapshotNotFoundFault) { + return diags + } + + if err != nil { + return sdkdiag.AppendErrorf(diags, "deleting RDS DB Snapshot (%s): %s", d.Id(), err) + } + + return diags +} diff --git a/internal/service/rds/snapshot_copy.go b/internal/service/rds/snapshot_copy.go index e8074e0a590e..96530191464f 100644 --- a/internal/service/rds/snapshot_copy.go +++ b/internal/service/rds/snapshot_copy.go @@ -26,6 +26,7 @@ func ResourceSnapshotCopy() *schema.Resource { ReadWithoutTimeout: resourceSnapshotCopyRead, UpdateWithoutTimeout: resourceSnapshotCopyUpdate, DeleteWithoutTimeout: resourceSnapshotCopyDelete, + Importer: &schema.ResourceImporter{ StateContext: schema.ImportStatePassthroughContext, }, @@ -146,37 +147,43 @@ func resourceSnapshotCopyCreate(ctx context.Context, d *schema.ResourceData, met defaultTagsConfig := meta.(*conns.AWSClient).DefaultTagsConfig tags := defaultTagsConfig.MergeTags(tftags.New(ctx, d.Get("tags").(map[string]interface{}))) - in := &rds.CopyDBSnapshotInput{ + targetDBSnapshotID := d.Get("target_db_snapshot_identifier").(string) + input := &rds.CopyDBSnapshotInput{ SourceDBSnapshotIdentifier: aws.String(d.Get("source_db_snapshot_identifier").(string)), - TargetDBSnapshotIdentifier: aws.String(d.Get("target_db_snapshot_identifier").(string)), Tags: Tags(tags.IgnoreAWS()), + TargetDBSnapshotIdentifier: aws.String(targetDBSnapshotID), } if v, ok := d.GetOk("copy_tags"); ok { - in.CopyTags = aws.Bool(v.(bool)) + input.CopyTags = aws.Bool(v.(bool)) } + + if v, ok := d.GetOk("destination_region"); ok { + input.DestinationRegion = aws.String(v.(string)) + } + if v, ok := d.GetOk("kms_key_id"); ok { - in.KmsKeyId = aws.String(v.(string)) + input.KmsKeyId = aws.String(v.(string)) } + if v, ok := d.GetOk("option_group_name"); ok { - in.OptionGroupName = aws.String(v.(string)) - } - if v, ok := d.GetOk("destination_region"); ok { - in.DestinationRegion = aws.String(v.(string)) + input.OptionGroupName = aws.String(v.(string)) } + if v, ok := d.GetOk("presigned_url"); ok { - in.PreSignedUrl = aws.String(v.(string)) + input.PreSignedUrl = aws.String(v.(string)) } - out, err := conn.CopyDBSnapshotWithContext(ctx, in) + output, err := conn.CopyDBSnapshotWithContext(ctx, input) + if err != nil { - return sdkdiag.AppendErrorf(diags, "error creating RDS DB Snapshot Copy %s", err) + return sdkdiag.AppendErrorf(diags, "creating RDS DB Snapshot Copy (%s): %s", targetDBSnapshotID, err) } - d.SetId(aws.StringValue(out.DBSnapshot.DBSnapshotIdentifier)) + d.SetId(aws.StringValue(output.DBSnapshot.DBSnapshotIdentifier)) - if err := waitDBSnapshotAvailable(ctx, conn, d.Id(), d.Timeout(schema.TimeoutCreate)); err != nil { - return sdkdiag.AppendErrorf(diags, "waiting for RDS DB Snapshot Copy (%s) to be available: %s", d.Id(), err) + if err := waitDBSnapshotCreated(ctx, conn, d.Id(), d.Timeout(schema.TimeoutCreate)); err != nil { + return sdkdiag.AppendErrorf(diags, "waiting for RDS DB Snapshot Copy (%s) create: %s", d.Id(), err) } return append(diags, resourceSnapshotCopyRead(ctx, d, meta)...) @@ -197,7 +204,7 @@ func resourceSnapshotCopyRead(ctx context.Context, d *schema.ResourceData, meta } if err != nil { - return sdkdiag.AppendErrorf(diags, "reading RDS DB snapshot (%s): %s", d.Id(), err) + return sdkdiag.AppendErrorf(diags, "reading RDS DB Snapshot Copy (%s): %s", d.Id(), err) } arn := aws.StringValue(snapshot.DBSnapshotArn) @@ -222,18 +229,18 @@ func resourceSnapshotCopyRead(ctx context.Context, d *schema.ResourceData, meta tags, err := ListTags(ctx, conn, arn) if err != nil { - return sdkdiag.AppendErrorf(diags, "error listing tags for RDS DB Snapshot (%s): %s", arn, err) + return sdkdiag.AppendErrorf(diags, "listing tags for RDS DB Snapshot Copy (%s): %s", arn, err) } tags = tags.IgnoreAWS().IgnoreConfig(ignoreTagsConfig) //lintignore:AWSR002 if err := d.Set("tags", tags.RemoveDefaultConfig(defaultTagsConfig).Map()); err != nil { - return sdkdiag.AppendErrorf(diags, "error setting tags: %s", err) + return sdkdiag.AppendErrorf(diags, "setting tags: %s", err) } if err := d.Set("tags_all", tags.Map()); err != nil { - return sdkdiag.AppendErrorf(diags, "error setting tags_all: %s", err) + return sdkdiag.AppendErrorf(diags, "setting tags_all: %s", err) } return diags @@ -247,7 +254,7 @@ func resourceSnapshotCopyUpdate(ctx context.Context, d *schema.ResourceData, met o, n := d.GetChange("tags_all") if err := UpdateTags(ctx, conn, d.Get("db_snapshot_arn").(string), o, n); err != nil { - sdkdiag.AppendErrorf(diags, "error updating RDS DB Snapshot (%s) tags: %s", d.Get("db_snapshot_arn").(string), err) + sdkdiag.AppendErrorf(diags, "updating RDS DB Snapshot Copy (%s) tags: %s", d.Get("db_snapshot_arn").(string), err) } } @@ -258,7 +265,7 @@ func resourceSnapshotCopyDelete(ctx context.Context, d *schema.ResourceData, met var diags diag.Diagnostics conn := meta.(*conns.AWSClient).RDSConn() - log.Printf("[DEBUG] Deleting RDS DB Snapshot: %s", d.Id()) + log.Printf("[DEBUG] Deleting RDS DB Snapshot Copy: %s", d.Id()) _, err := conn.DeleteDBSnapshotWithContext(ctx, &rds.DeleteDBSnapshotInput{ DBSnapshotIdentifier: aws.String(d.Id()), }) @@ -268,7 +275,7 @@ func resourceSnapshotCopyDelete(ctx context.Context, d *schema.ResourceData, met } if err != nil { - return sdkdiag.AppendErrorf(diags, "deleting RDS DB Snapshot (%s): %s", d.Id(), err) + return sdkdiag.AppendErrorf(diags, "deleting RDS DB Snapshot Copy (%s): %s", d.Id(), err) } return diags diff --git a/internal/service/rds/snapshot_copy_test.go b/internal/service/rds/snapshot_copy_test.go index 35bd49d00118..ef1b8489aba0 100644 --- a/internal/service/rds/snapshot_copy_test.go +++ b/internal/service/rds/snapshot_copy_test.go @@ -143,7 +143,7 @@ func testAccCheckSnapshotCopyDestroy(ctx context.Context) resource.TestCheckFunc return err } - return fmt.Errorf("RDS DB Snapshot %s still exists", rs.Primary.ID) + return fmt.Errorf("RDS DB Snapshot Copy %s still exists", rs.Primary.ID) } return nil @@ -158,7 +158,7 @@ func testAccCheckSnapshotCopyExists(ctx context.Context, n string, v *rds.DBSnap } if rs.Primary.ID == "" { - return fmt.Errorf("No RDS DB Snapshot ID is set") + return fmt.Errorf("No RDS DB Snapshot Copy ID is set") } conn := acctest.Provider.Meta().(*conns.AWSClient).RDSConn() @@ -169,13 +169,13 @@ func testAccCheckSnapshotCopyExists(ctx context.Context, n string, v *rds.DBSnap return err } - v = output + *v = *output return nil } } -func testAccSnapshotCopyBaseConfig(rName string) string { +func testAccSnapshotCopyConfig_base(rName string) string { return fmt.Sprintf(` data "aws_rds_engine_version" "default" { engine = "mysql" @@ -192,10 +192,10 @@ resource "aws_db_instance" "test" { engine = data.aws_rds_engine_version.default.engine engine_version = data.aws_rds_engine_version.default.version instance_class = data.aws_rds_orderable_db_instance.test.instance_class - name = "baz" + name = "test" identifier = %[1]q - password = "barbarbarbar" - username = "foo" + password = "avoid-plaintext-passwords" + username = "tfacctest" maintenance_window = "Fri:09:00-Fri:09:30" backup_retention_period = 0 parameter_group_name = "default.${data.aws_rds_engine_version.default.parameter_group_family}" @@ -209,9 +209,7 @@ resource "aws_db_snapshot" "test" { } func testAccSnapshotCopyConfig_basic(rName string) string { - return acctest.ConfigCompose( - testAccSnapshotCopyBaseConfig(rName), - fmt.Sprintf(` + return acctest.ConfigCompose(testAccSnapshotCopyConfig_base(rName), fmt.Sprintf(` resource "aws_db_snapshot_copy" "test" { source_db_snapshot_identifier = aws_db_snapshot.test.db_snapshot_arn target_db_snapshot_identifier = "%[1]s-target" @@ -219,9 +217,7 @@ resource "aws_db_snapshot_copy" "test" { } func testAccSnapshotCopyConfig_tags1(rName, tagKey, tagValue string) string { - return acctest.ConfigCompose( - testAccSnapshotCopyBaseConfig(rName), - fmt.Sprintf(` + return acctest.ConfigCompose(testAccSnapshotCopyConfig_base(rName), fmt.Sprintf(` resource "aws_db_snapshot_copy" "test" { source_db_snapshot_identifier = aws_db_snapshot.test.db_snapshot_arn target_db_snapshot_identifier = "%[1]s-target" @@ -233,9 +229,7 @@ resource "aws_db_snapshot_copy" "test" { } func testAccSnapshotCopyConfig_tags2(rName, tagKey1, tagValue1, tagKey2, tagValue2 string) string { - return acctest.ConfigCompose( - testAccSnapshotCopyBaseConfig(rName), - fmt.Sprintf(` + return acctest.ConfigCompose(testAccSnapshotCopyConfig_base(rName), fmt.Sprintf(` resource "aws_db_snapshot_copy" "test" { source_db_snapshot_identifier = aws_db_snapshot.test.db_snapshot_arn target_db_snapshot_identifier = "%[1]s-target" diff --git a/internal/service/rds/snapshot_test.go b/internal/service/rds/snapshot_test.go index 46a61373e7c0..4227e6754319 100644 --- a/internal/service/rds/snapshot_test.go +++ b/internal/service/rds/snapshot_test.go @@ -3,7 +3,6 @@ package rds_test import ( "context" "fmt" - "log" "regexp" "testing" @@ -37,9 +36,9 @@ func TestAccRDSSnapshot_basic(t *testing.T) { Config: testAccSnapshotConfig_basic(rName), Check: resource.ComposeTestCheckFunc( testAccCheckDBSnapshotExists(ctx, resourceName, &v), - resource.TestCheckResourceAttr(resourceName, "tags.%", "0"), acctest.MatchResourceAttrRegionalARN(resourceName, "db_snapshot_arn", "rds", regexp.MustCompile(`snapshot:.+`)), resource.TestCheckResourceAttr(resourceName, "shared_accounts.#", "0"), + resource.TestCheckResourceAttr(resourceName, "tags.%", "0"), ), }, { @@ -178,8 +177,6 @@ func testAccCheckDBSnapshotDestroy(ctx context.Context) resource.TestCheckFunc { continue } - log.Printf("[DEBUG] Checking if RDS DB Snapshot %s exists", rs.Primary.ID) - _, err := tfrds.FindDBSnapshotByID(ctx, conn, rs.Primary.ID) if tfresource.NotFound(err) { @@ -205,23 +202,24 @@ func testAccCheckDBSnapshotExists(ctx context.Context, n string, v *rds.DBSnapsh } if rs.Primary.ID == "" { - return fmt.Errorf("No ID is set") + return fmt.Errorf("No RDS DB Snapshot ID is set") } conn := acctest.Provider.Meta().(*conns.AWSClient).RDSConn() - out, err := tfrds.FindDBSnapshotByID(ctx, conn, rs.Primary.ID) + output, err := tfrds.FindDBSnapshotByID(ctx, conn, rs.Primary.ID) + if err != nil { return err } - v = out + *v = *output return nil } } -func testAccSnapshotBaseConfig(rName string) string { +func testAccSnapshotConfig_base(rName string) string { return fmt.Sprintf(` data "aws_rds_engine_version" "default" { engine = "mysql" @@ -238,10 +236,10 @@ resource "aws_db_instance" "test" { engine = data.aws_rds_engine_version.default.engine engine_version = data.aws_rds_engine_version.default.version instance_class = data.aws_rds_orderable_db_instance.test.instance_class - name = "baz" + name = "test" identifier = %[1]q - password = "barbarbarbar" - username = "foo" + password = "avoid-plaintext-passwords" + username = "tfacctest" maintenance_window = "Fri:09:00-Fri:09:30" backup_retention_period = 0 parameter_group_name = "default.${data.aws_rds_engine_version.default.parameter_group_family}" @@ -250,9 +248,7 @@ resource "aws_db_instance" "test" { } func testAccSnapshotConfig_basic(rName string) string { - return acctest.ConfigCompose( - testAccSnapshotBaseConfig(rName), - fmt.Sprintf(` + return acctest.ConfigCompose(testAccSnapshotConfig_base(rName), fmt.Sprintf(` resource "aws_db_snapshot" "test" { db_instance_identifier = aws_db_instance.test.id db_snapshot_identifier = %[1]q @@ -261,9 +257,7 @@ resource "aws_db_snapshot" "test" { } func testAccSnapshotConfig_tags1(rName, tag1Key, tag1Value string) string { - return acctest.ConfigCompose( - testAccSnapshotBaseConfig(rName), - fmt.Sprintf(` + return acctest.ConfigCompose(testAccSnapshotConfig_base(rName), fmt.Sprintf(` resource "aws_db_snapshot" "test" { db_instance_identifier = aws_db_instance.test.id db_snapshot_identifier = %[1]q @@ -276,9 +270,7 @@ resource "aws_db_snapshot" "test" { } func testAccSnapshotConfig_tags2(rName, tag1Key, tag1Value, tag2Key, tag2Value string) string { - return acctest.ConfigCompose( - testAccSnapshotBaseConfig(rName), - fmt.Sprintf(` + return acctest.ConfigCompose(testAccSnapshotConfig_base(rName), fmt.Sprintf(` resource "aws_db_snapshot" "test" { db_instance_identifier = aws_db_instance.test.id db_snapshot_identifier = %[1]q @@ -292,9 +284,7 @@ resource "aws_db_snapshot" "test" { } func testAccSnapshotConfig_share(rName string) string { - return acctest.ConfigCompose( - testAccSnapshotBaseConfig(rName), - fmt.Sprintf(` + return acctest.ConfigCompose(testAccSnapshotConfig_base(rName), fmt.Sprintf(` resource "aws_db_snapshot" "test" { db_instance_identifier = aws_db_instance.test.id db_snapshot_identifier = %[1]q diff --git a/internal/service/rds/wait.go b/internal/service/rds/wait.go index 6179309ee25a..7490fc950c9a 100644 --- a/internal/service/rds/wait.go +++ b/internal/service/rds/wait.go @@ -384,7 +384,7 @@ func waitReservedInstanceCreated(ctx context.Context, conn *rds.RDS, id string, return err } -func waitDBSnapshotAvailable(ctx context.Context, conn *rds.RDS, id string, timeout time.Duration) error { +func waitDBSnapshotCreated(ctx context.Context, conn *rds.RDS, id string, timeout time.Duration) error { stateConf := &resource.StateChangeConf{ Pending: []string{DBSnapshotCreating}, Target: []string{DBSnapshotAvailable}, diff --git a/website/docs/r/db_snapshot.html.markdown b/website/docs/r/db_snapshot.html.markdown index 206a01fe8704..560722f0705c 100644 --- a/website/docs/r/db_snapshot.html.markdown +++ b/website/docs/r/db_snapshot.html.markdown @@ -67,7 +67,7 @@ In addition to all arguments above, the following attributes are exported: [Configuration options](https://developer.hashicorp.com/terraform/language/resources/syntax#operation-timeouts): -- `read` - (Default `20m`) +- `create` - (Default `20m`) ## Import From 9d7059d3721616d0fb8387fd05c2a298b5ba88f9 Mon Sep 17 00:00:00 2001 From: quartercastle Date: Tue, 7 Mar 2023 17:33:55 +0100 Subject: [PATCH 465/763] rename changelog --- .changelog/{29397.txt => 29824.txt} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename .changelog/{29397.txt => 29824.txt} (100%) diff --git a/.changelog/29397.txt b/.changelog/29824.txt similarity index 100% rename from .changelog/29397.txt rename to .changelog/29824.txt From 993f873927fd3119ec3da9a62f435dc0fc68c86e Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Tue, 7 Mar 2023 11:33:48 -0500 Subject: [PATCH 466/763] r/aws_cloudhsm_v2_cluster: Alphabetize attributes. --- internal/service/cloudhsmv2/cluster.go | 68 ++++++++++++-------------- 1 file changed, 30 insertions(+), 38 deletions(-) diff --git a/internal/service/cloudhsmv2/cluster.go b/internal/service/cloudhsmv2/cluster.go index be30295356d3..1f1c28e251bc 100644 --- a/internal/service/cloudhsmv2/cluster.go +++ b/internal/service/cloudhsmv2/cluster.go @@ -24,6 +24,7 @@ func ResourceCluster() *schema.Resource { ReadWithoutTimeout: resourceClusterRead, UpdateWithoutTimeout: resourceClusterUpdate, DeleteWithoutTimeout: resourceClusterDelete, + Importer: &schema.ResourceImporter{ StateContext: schema.ImportStatePassthroughContext, }, @@ -35,51 +36,20 @@ func ResourceCluster() *schema.Resource { }, Schema: map[string]*schema.Schema{ - "source_backup_identifier": { - Type: schema.TypeString, - Optional: true, - ForceNew: true, - }, - - "hsm_type": { - Type: schema.TypeString, - Required: true, - ForceNew: true, - ValidateFunc: validation.StringInSlice([]string{"hsm1.medium"}, false), - }, - - "subnet_ids": { - Type: schema.TypeSet, - Required: true, - Elem: &schema.Schema{Type: schema.TypeString}, - Set: schema.HashString, - ForceNew: true, - }, - - "cluster_id": { - Type: schema.TypeString, - Computed: true, - }, - - "vpc_id": { - Type: schema.TypeString, - Computed: true, - }, - "cluster_certificates": { Type: schema.TypeList, Computed: true, Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "cluster_certificate": { + "aws_hardware_certificate": { Type: schema.TypeString, Computed: true, }, - "cluster_csr": { + "cluster_certificate": { Type: schema.TypeString, Computed: true, }, - "aws_hardware_certificate": { + "cluster_csr": { Type: schema.TypeString, Computed: true, }, @@ -94,19 +64,41 @@ func ResourceCluster() *schema.Resource { }, }, }, - - "security_group_id": { + "cluster_id": { Type: schema.TypeString, Computed: true, }, - "cluster_state": { Type: schema.TypeString, Computed: true, }, - + "hsm_type": { + Type: schema.TypeString, + Required: true, + ForceNew: true, + ValidateFunc: validation.StringInSlice([]string{"hsm1.medium"}, false), + }, + "security_group_id": { + Type: schema.TypeString, + Computed: true, + }, + "source_backup_identifier": { + Type: schema.TypeString, + Optional: true, + ForceNew: true, + }, + "subnet_ids": { + Type: schema.TypeSet, + Required: true, + ForceNew: true, + Elem: &schema.Schema{Type: schema.TypeString}, + }, "tags": tftags.TagsSchema(), "tags_all": tftags.TagsSchemaComputed(), + "vpc_id": { + Type: schema.TypeString, + Computed: true, + }, }, CustomizeDiff: verify.SetTagsDiff, From e84879d56e653f39f257c0b9709364a94c734dac Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 7 Mar 2023 11:42:29 -0500 Subject: [PATCH 467/763] build(deps): bump github.com/aws/aws-sdk-go from 1.44.214 to 1.44.215 (#29821) Bumps [github.com/aws/aws-sdk-go](https://github.com/aws/aws-sdk-go) from 1.44.214 to 1.44.215. - [Release notes](https://github.com/aws/aws-sdk-go/releases) - [Commits](https://github.com/aws/aws-sdk-go/compare/v1.44.214...v1.44.215) --- updated-dependencies: - dependency-name: github.com/aws/aws-sdk-go dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 57721de5caee..274df8cc8471 100644 --- a/go.mod +++ b/go.mod @@ -4,7 +4,7 @@ go 1.19 require ( github.com/ProtonMail/go-crypto v0.0.0-20230201104953-d1d05f4e2bfb - github.com/aws/aws-sdk-go v1.44.214 + github.com/aws/aws-sdk-go v1.44.215 github.com/aws/aws-sdk-go-v2 v1.17.5 github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.12.23 github.com/aws/aws-sdk-go-v2/service/auditmanager v1.24.1 diff --git a/go.sum b/go.sum index 3c584b898709..20a4d703c179 100644 --- a/go.sum +++ b/go.sum @@ -23,8 +23,8 @@ github.com/apparentlymart/go-textseg/v13 v13.0.0/go.mod h1:ZK2fH7c4NqDTLtiYLvIkE github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310 h1:BUAU3CGlLvorLI26FmByPp2eC2qla6E1Tw+scpcg/to= github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5/go.mod h1:wHh0iHkYZB8zMSxRWpUBQtwG5a7fFgvEO+odwuTv2gs= -github.com/aws/aws-sdk-go v1.44.214 h1:YzDuC+9UtrAOUkItlK7l3BvKI9o6qAog9X8i289HORc= -github.com/aws/aws-sdk-go v1.44.214/go.mod h1:aVsgQcEevwlmQ7qHE9I3h+dtQgpqhFB+i8Phjh7fkwI= +github.com/aws/aws-sdk-go v1.44.215 h1:K3KERfO6MaV349idub2w1u1H0R0KSkED0LshPnaAn3Q= +github.com/aws/aws-sdk-go v1.44.215/go.mod h1:aVsgQcEevwlmQ7qHE9I3h+dtQgpqhFB+i8Phjh7fkwI= github.com/aws/aws-sdk-go-v2 v1.17.4/go.mod h1:uzbQtefpm44goOPmdKyAlXSNcwlRgF3ePWVW6EtJvvw= github.com/aws/aws-sdk-go-v2 v1.17.5 h1:TzCUW1Nq4H8Xscph5M/skINUitxM5UBAyvm2s7XBzL4= github.com/aws/aws-sdk-go-v2 v1.17.5/go.mod h1:uzbQtefpm44goOPmdKyAlXSNcwlRgF3ePWVW6EtJvvw= From 35a4b59ea800470458cef8166db047d9c7f26de5 Mon Sep 17 00:00:00 2001 From: changelogbot Date: Tue, 7 Mar 2023 16:45:03 +0000 Subject: [PATCH 468/763] Update CHANGELOG.md for #29821 --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index a26ceb9daaf4..331b41113dc2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,8 @@ FEATURES: ENHANCEMENTS: +* resource/aws_db_instance: Add `listener_endpoint` attribute ([#28434](https://github.com/hashicorp/terraform-provider-aws/issues/28434)) +* resource/aws_db_instance: Add plan time validations for `backup_retention_period`, `monitoring_interval`, and `monitoring_role_arn` ([#28434](https://github.com/hashicorp/terraform-provider-aws/issues/28434)) * resource/aws_grafana_workspace: Add `network_access_control` argument ([#29793](https://github.com/hashicorp/terraform-provider-aws/issues/29793)) * resource/aws_sesv2_configuration_set: Add `vdm_options` argument ([#28812](https://github.com/hashicorp/terraform-provider-aws/issues/28812)) * resource/aws_transfer_server: Add `protocol_details` argument ([#28621](https://github.com/hashicorp/terraform-provider-aws/issues/28621)) From ec3059bfd16401ec398e6878dc88020ff0944ae0 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Tue, 7 Mar 2023 11:57:47 -0500 Subject: [PATCH 469/763] r/aws_cloudhsm_v2_cluster: Tidy up. --- internal/service/cloudhsmv2/cluster.go | 110 ++++++++---------- .../service/cloudhsmv2/cluster_data_source.go | 100 ++++++---------- 2 files changed, 85 insertions(+), 125 deletions(-) diff --git a/internal/service/cloudhsmv2/cluster.go b/internal/service/cloudhsmv2/cluster.go index 1f1c28e251bc..5bd81f456797 100644 --- a/internal/service/cloudhsmv2/cluster.go +++ b/internal/service/cloudhsmv2/cluster.go @@ -7,6 +7,7 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/cloudhsmv2" + "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-plugin-sdk/v2/helper/validation" @@ -14,6 +15,7 @@ import ( "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" ) @@ -116,15 +118,13 @@ func resourceClusterCreate(ctx context.Context, d *schema.ResourceData, meta int SubnetIds: flex.ExpandStringSet(d.Get("subnet_ids").(*schema.Set)), } - if v := d.Get("tags").(map[string]interface{}); len(v) > 0 { - input.TagList = Tags(tags.IgnoreAWS()) - } - if v, ok := d.GetOk("source_backup_identifier"); ok { input.SourceBackupId = aws.String(v.(string)) } - log.Printf("[DEBUG] CloudHSMv2 Cluster create %s", input) + if len(tags) > 0 { + input.TagList = Tags(tags.IgnoreAWS()) + } output, err := conn.CreateClusterWithContext(ctx, input) @@ -133,17 +133,14 @@ func resourceClusterCreate(ctx context.Context, d *schema.ResourceData, meta int } d.SetId(aws.StringValue(output.Cluster.ClusterId)) - log.Printf("[INFO] CloudHSMv2 Cluster ID: %s", d.Id()) - log.Println("[INFO] Waiting for CloudHSMv2 Cluster to be available") + f := waitClusterUninitialized if input.SourceBackupId != nil { - if _, err := waitClusterActive(ctx, conn, d.Id(), d.Timeout(schema.TimeoutCreate)); err != nil { - return sdkdiag.AppendErrorf(diags, "waiting for CloudHSMv2 Cluster (%s) creation: %s", d.Id(), err) - } - } else { - if _, err := waitClusterUninitialized(ctx, conn, d.Id(), d.Timeout(schema.TimeoutCreate)); err != nil { - return sdkdiag.AppendErrorf(diags, "waiting for CloudHSMv2 Cluster (%s) creation: %s", d.Id(), err) - } + f = waitClusterActive + } + + if _, err := f(ctx, conn, d.Id(), d.Timeout(schema.TimeoutCreate)); err != nil { + return sdkdiag.AppendErrorf(diags, "waiting for CloudHSMv2 Cluster (%s) create: %s", d.Id(), err) } return append(diags, resourceClusterRead(ctx, d, meta)...) @@ -157,49 +154,30 @@ func resourceClusterRead(ctx context.Context, d *schema.ResourceData, meta inter cluster, err := FindClusterByID(ctx, conn, d.Id()) - if err != nil { - return sdkdiag.AppendErrorf(diags, "reading CloudHSMv2 Cluster (%s): %s", d.Id(), err) - } - - if cluster == nil { - if d.IsNewResource() { - return sdkdiag.AppendErrorf(diags, "reading CloudHSMv2 Cluster (%s): not found after creation", d.Id()) - } - + if !d.IsNewResource() && tfresource.NotFound(err) { log.Printf("[WARN] CloudHSMv2 Cluster (%s) not found, removing from state", d.Id()) d.SetId("") return diags } - if aws.StringValue(cluster.State) == cloudhsmv2.ClusterStateDeleted { - if d.IsNewResource() { - return sdkdiag.AppendErrorf(diags, "reading CloudHSMv2 Cluster (%s): %s after creation", d.Id(), aws.StringValue(cluster.State)) - } - - log.Printf("[WARN] CloudHSMv2 Cluster (%s) not found, removing from state", d.Id()) - d.SetId("") - return diags + if err != nil { + return sdkdiag.AppendErrorf(diags, "reading CloudHSMv2 Cluster (%s): %s", d.Id(), err) } - log.Printf("[INFO] Reading CloudHSMv2 Cluster Information: %s", d.Id()) - + if err := d.Set("cluster_certificates", flattenCertificates(cluster)); err != nil { + return sdkdiag.AppendErrorf(diags, "setting cluster_certificates: %s", err) + } d.Set("cluster_id", cluster.ClusterId) d.Set("cluster_state", cluster.State) + d.Set("hsm_type", cluster.HsmType) d.Set("security_group_id", cluster.SecurityGroup) - d.Set("vpc_id", cluster.VpcId) d.Set("source_backup_identifier", cluster.SourceBackupId) - d.Set("hsm_type", cluster.HsmType) - if err := d.Set("cluster_certificates", readClusterCertificates(cluster)); err != nil { - return sdkdiag.AppendErrorf(diags, "setting cluster_certificates: %s", err) - } - - var subnets []string - for _, sn := range cluster.SubnetMapping { - subnets = append(subnets, aws.StringValue(sn)) - } - if err := d.Set("subnet_ids", subnets); err != nil { - return sdkdiag.AppendErrorf(diags, "Error saving Subnet IDs to state for CloudHSMv2 Cluster (%s): %s", d.Id(), err) + var subnetIDs []string + for _, v := range cluster.SubnetMapping { + subnetIDs = append(subnetIDs, aws.StringValue(v)) } + d.Set("subnet_ids", subnetIDs) + d.Set("vpc_id", cluster.VpcId) tags := KeyValueTags(ctx, cluster.TagList).IgnoreAWS().IgnoreConfig(ignoreTagsConfig) @@ -221,8 +199,9 @@ func resourceClusterUpdate(ctx context.Context, d *schema.ResourceData, meta int if d.HasChange("tags_all") { o, n := d.GetChange("tags_all") + if err := UpdateTags(ctx, conn, d.Id(), o, n); err != nil { - return sdkdiag.AppendErrorf(diags, "updating tags: %s", err) + return sdkdiag.AppendErrorf(diags, "updating CloudHSMv2 Cluster (%s) tags: %s", d.Id(), err) } } @@ -232,37 +211,44 @@ func resourceClusterUpdate(ctx context.Context, d *schema.ResourceData, meta int func resourceClusterDelete(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { var diags diag.Diagnostics conn := meta.(*conns.AWSClient).CloudHSMV2Conn() - input := &cloudhsmv2.DeleteClusterInput{ + + log.Printf("[INFO] Deleting CloudHSMv2 Cluster: %s", d.Id()) + _, err := conn.DeleteClusterWithContext(ctx, &cloudhsmv2.DeleteClusterInput{ ClusterId: aws.String(d.Id()), - } + }) - _, err := conn.DeleteClusterWithContext(ctx, input) + if tfawserr.ErrCodeEquals(err, cloudhsmv2.ErrCodeCloudHsmResourceNotFoundException) { + return diags + } if err != nil { return sdkdiag.AppendErrorf(diags, "deleting CloudHSMv2 Cluster (%s): %s", d.Id(), err) } if _, err := waitClusterDeleted(ctx, conn, d.Id(), d.Timeout(schema.TimeoutDelete)); err != nil { - return sdkdiag.AppendErrorf(diags, "waiting for CloudHSMv2 Cluster (%s) deletion: %s", d.Id(), err) + return sdkdiag.AppendErrorf(diags, "waiting for CloudHSMv2 Cluster (%s) delete: %s", d.Id(), err) } return diags } -func readClusterCertificates(cluster *cloudhsmv2.Cluster) []map[string]interface{} { - certs := map[string]interface{}{} - if cluster.Certificates != nil { - if aws.StringValue(cluster.State) == cloudhsmv2.ClusterStateUninitialized { - certs["cluster_csr"] = aws.StringValue(cluster.Certificates.ClusterCsr) - certs["aws_hardware_certificate"] = aws.StringValue(cluster.Certificates.AwsHardwareCertificate) - certs["hsm_certificate"] = aws.StringValue(cluster.Certificates.HsmCertificate) - certs["manufacturer_hardware_certificate"] = aws.StringValue(cluster.Certificates.ManufacturerHardwareCertificate) - } else if aws.StringValue(cluster.State) == cloudhsmv2.ClusterStateActive { - certs["cluster_certificate"] = aws.StringValue(cluster.Certificates.ClusterCertificate) +func flattenCertificates(apiObject *cloudhsmv2.Cluster) []map[string]interface{} { + tfMap := map[string]interface{}{} + + if apiObject, clusterState := apiObject.Certificates, aws.StringValue(apiObject.State); apiObject != nil { + if clusterState == cloudhsmv2.ClusterStateUninitialized { + tfMap["cluster_csr"] = aws.StringValue(apiObject.ClusterCsr) + tfMap["aws_hardware_certificate"] = aws.StringValue(apiObject.AwsHardwareCertificate) + tfMap["hsm_certificate"] = aws.StringValue(apiObject.HsmCertificate) + tfMap["manufacturer_hardware_certificate"] = aws.StringValue(apiObject.ManufacturerHardwareCertificate) + } else if clusterState == cloudhsmv2.ClusterStateActive { + tfMap["cluster_certificate"] = aws.StringValue(apiObject.ClusterCertificate) } } - if len(certs) > 0 { - return []map[string]interface{}{certs} + + if len(tfMap) > 0 { + return []map[string]interface{}{tfMap} } + return []map[string]interface{}{} } diff --git a/internal/service/cloudhsmv2/cluster_data_source.go b/internal/service/cloudhsmv2/cluster_data_source.go index 20bf625e342e..871380246916 100644 --- a/internal/service/cloudhsmv2/cluster_data_source.go +++ b/internal/service/cloudhsmv2/cluster_data_source.go @@ -2,7 +2,6 @@ package cloudhsmv2 import ( "context" - "log" "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/cloudhsmv2" @@ -18,41 +17,20 @@ func DataSourceCluster() *schema.Resource { ReadWithoutTimeout: dataSourceClusterRead, Schema: map[string]*schema.Schema{ - "cluster_id": { - Type: schema.TypeString, - Required: true, - }, - - "cluster_state": { - Type: schema.TypeString, - Optional: true, - Computed: true, - }, - - "vpc_id": { - Type: schema.TypeString, - Computed: true, - }, - - "security_group_id": { - Type: schema.TypeString, - Computed: true, - }, - "cluster_certificates": { Type: schema.TypeList, Computed: true, Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "cluster_certificate": { + "aws_hardware_certificate": { Type: schema.TypeString, Computed: true, }, - "cluster_csr": { + "cluster_certificate": { Type: schema.TypeString, Computed: true, }, - "aws_hardware_certificate": { + "cluster_csr": { Type: schema.TypeString, Computed: true, }, @@ -67,11 +45,27 @@ func DataSourceCluster() *schema.Resource { }, }, }, + "cluster_id": { + Type: schema.TypeString, + Required: true, + }, + "cluster_state": { + Type: schema.TypeString, + Optional: true, + Computed: true, + }, + "security_group_id": { + Type: schema.TypeString, + Computed: true, + }, "subnet_ids": { Type: schema.TypeSet, Computed: true, Elem: &schema.Schema{Type: schema.TypeString}, - Set: schema.HashString, + }, + "vpc_id": { + Type: schema.TypeString, + Computed: true, }, }, } @@ -81,55 +75,35 @@ func dataSourceClusterRead(ctx context.Context, d *schema.ResourceData, meta int var diags diag.Diagnostics conn := meta.(*conns.AWSClient).CloudHSMV2Conn() - clusterId := d.Get("cluster_id").(string) - filters := []*string{&clusterId} - log.Printf("[DEBUG] Reading CloudHSM v2 Cluster %s", clusterId) - result := int64(1) + clusterID := d.Get("cluster_id").(string) input := &cloudhsmv2.DescribeClustersInput{ Filters: map[string][]*string{ - "clusterIds": filters, + "clusterIds": aws.StringSlice([]string{clusterID}), }, - MaxResults: &result, + MaxResults: aws.Int64(1), } - state := d.Get("cluster_state").(string) - states := []*string{&state} - if len(state) > 0 { - input.Filters["states"] = states + if v, ok := d.GetOk("cluster_state"); ok { + input.Filters["states"] = aws.StringSlice([]string{v.(string)}) } - out, err := conn.DescribeClustersWithContext(ctx, input) - if err != nil { - return sdkdiag.AppendErrorf(diags, "describing CloudHSM v2 Cluster: %s", err) - } - - var cluster *cloudhsmv2.Cluster - for _, c := range out.Clusters { - if aws.StringValue(c.ClusterId) == clusterId { - cluster = c - break - } - } + cluster, err := findCluster(ctx, conn, input) - if cluster == nil { - return sdkdiag.AppendErrorf(diags, "cluster with id %s not found", clusterId) + if err != nil { + return sdkdiag.AppendErrorf(diags, "reading CloudHSM v2 Cluster (%s): %s", clusterID, err) } - d.SetId(clusterId) - d.Set("vpc_id", cluster.VpcId) - d.Set("security_group_id", cluster.SecurityGroup) - d.Set("cluster_state", cluster.State) - if err := d.Set("cluster_certificates", readClusterCertificates(cluster)); err != nil { + d.SetId(clusterID) + if err := d.Set("cluster_certificates", flattenCertificates(cluster)); err != nil { return sdkdiag.AppendErrorf(diags, "setting cluster_certificates: %s", err) } - - var subnets []string - for _, sn := range cluster.SubnetMapping { - subnets = append(subnets, *sn) - } - - if err := d.Set("subnet_ids", subnets); err != nil { - return sdkdiag.AppendErrorf(diags, "[DEBUG] Error saving Subnet IDs to state for CloudHSM v2 Cluster (%s): %s", d.Id(), err) + d.Set("cluster_state", cluster.State) + d.Set("security_group_id", cluster.SecurityGroup) + var subnetIDs []string + for _, v := range cluster.SubnetMapping { + subnetIDs = append(subnetIDs, aws.StringValue(v)) } + d.Set("subnet_ids", subnetIDs) + d.Set("vpc_id", cluster.VpcId) return diags } From 0753cda51e3ddea7d0306337015ac34e570d667b Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Tue, 7 Mar 2023 12:05:24 -0500 Subject: [PATCH 470/763] r/aws_cloudhsm_v2_hsm: Tidy up. --- internal/service/cloudhsmv2/hsm.go | 57 ++++++++++++------------------ 1 file changed, 22 insertions(+), 35 deletions(-) diff --git a/internal/service/cloudhsmv2/hsm.go b/internal/service/cloudhsmv2/hsm.go index 9ca5e6cecf1f..a1a842e9a204 100644 --- a/internal/service/cloudhsmv2/hsm.go +++ b/internal/service/cloudhsmv2/hsm.go @@ -12,6 +12,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/tfresource" ) // @SDKResource("aws_cloudhsm_v2_hsm") @@ -75,26 +76,23 @@ func resourceHSMCreate(ctx context.Context, d *schema.ResourceData, meta interfa var diags diag.Diagnostics conn := meta.(*conns.AWSClient).CloudHSMV2Conn() + clusterID := d.Get("cluster_id").(string) input := &cloudhsmv2.CreateHsmInput{ - ClusterId: aws.String(d.Get("cluster_id").(string)), + ClusterId: aws.String(clusterID), } if v, ok := d.GetOk("availability_zone"); ok { input.AvailabilityZone = aws.String(v.(string)) } else { - cluster, err := FindClusterByID(ctx, conn, d.Get("cluster_id").(string)) + cluster, err := FindClusterByID(ctx, conn, clusterID) if err != nil { - return sdkdiag.AppendErrorf(diags, "reading CloudHSMv2 Cluster (%s): %s", d.Id(), err) - } - - if cluster == nil { - return sdkdiag.AppendErrorf(diags, "reading CloudHSMv2 Cluster (%s): not found for subnet mappings", d.Id()) + return sdkdiag.AppendErrorf(diags, "reading CloudHSMv2 Cluster (%s): %s", clusterID, err) } - subnetId := d.Get("subnet_id").(string) + subnetID := d.Get("subnet_id").(string) for az, sn := range cluster.SubnetMapping { - if aws.StringValue(sn) == subnetId { + if aws.StringValue(sn) == subnetID { input.AvailabilityZone = aws.String(az) } } @@ -104,8 +102,6 @@ func resourceHSMCreate(ctx context.Context, d *schema.ResourceData, meta interfa input.IpAddress = aws.String(v.(string)) } - log.Printf("[DEBUG] CloudHSMv2 HSM create %s", input) - output, err := conn.CreateHsmWithContext(ctx, input) if err != nil { @@ -115,7 +111,7 @@ func resourceHSMCreate(ctx context.Context, d *schema.ResourceData, meta interfa d.SetId(aws.StringValue(output.Hsm.HsmId)) if _, err := waitHSMCreated(ctx, conn, d.Id(), d.Timeout(schema.TimeoutCreate)); err != nil { - return sdkdiag.AppendErrorf(diags, "waiting for CloudHSMv2 HSM (%s) creation: %s", d.Id(), err) + return sdkdiag.AppendErrorf(diags, "waiting for CloudHSMv2 HSM (%s) create: %s", d.Id(), err) } return append(diags, resourceHSMRead(ctx, d, meta)...) @@ -127,34 +123,28 @@ func resourceHSMRead(ctx context.Context, d *schema.ResourceData, meta interface hsm, err := FindHSMByTwoPartKey(ctx, conn, d.Id(), d.Get("hsm_eni_id").(string)) - if err != nil { - return sdkdiag.AppendErrorf(diags, "reading CloudHSMv2 HSM (%s): %s", d.Id(), err) - } - - if hsm == nil { - if d.IsNewResource() { - return sdkdiag.AppendErrorf(diags, "reading CloudHSMv2 HSM (%s): not found after creation", d.Id()) - } - + if !d.IsNewResource() && tfresource.NotFound(err) { log.Printf("[WARN] CloudHSMv2 HSM (%s) not found, removing from state", d.Id()) d.SetId("") return diags } + if err != nil { + return sdkdiag.AppendErrorf(diags, "reading CloudHSMv2 HSM (%s): %s", d.Id(), err) + } + // When matched by ENI ID, the ID should updated. if aws.StringValue(hsm.HsmId) != d.Id() { d.SetId(aws.StringValue(hsm.HsmId)) } - log.Printf("[INFO] Reading CloudHSMv2 HSM Information: %s", d.Id()) - - d.Set("cluster_id", hsm.ClusterId) - d.Set("subnet_id", hsm.SubnetId) d.Set("availability_zone", hsm.AvailabilityZone) - d.Set("ip_address", hsm.EniIp) + d.Set("cluster_id", hsm.ClusterId) + d.Set("hsm_eni_id", hsm.EniId) d.Set("hsm_id", hsm.HsmId) d.Set("hsm_state", hsm.State) - d.Set("hsm_eni_id", hsm.EniId) + d.Set("ip_address", hsm.EniIp) + d.Set("subnet_id", hsm.SubnetId) return diags } @@ -162,15 +152,12 @@ func resourceHSMRead(ctx context.Context, d *schema.ResourceData, meta interface func resourceHSMDelete(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { var diags diag.Diagnostics conn := meta.(*conns.AWSClient).CloudHSMV2Conn() - clusterId := d.Get("cluster_id").(string) - log.Printf("[DEBUG] CloudHSMv2 HSM delete %s %s", clusterId, d.Id()) - input := &cloudhsmv2.DeleteHsmInput{ - ClusterId: aws.String(clusterId), + log.Printf("[INFO] Deleting CloudHSMv2 HSM: %s", d.Id()) + _, err := conn.DeleteHsmWithContext(ctx, &cloudhsmv2.DeleteHsmInput{ + ClusterId: aws.String(d.Get("cluster_id").(string)), HsmId: aws.String(d.Id()), - } - - _, err := conn.DeleteHsmWithContext(ctx, input) + }) if tfawserr.ErrCodeEquals(err, cloudhsmv2.ErrCodeCloudHsmResourceNotFoundException) { return diags @@ -181,7 +168,7 @@ func resourceHSMDelete(ctx context.Context, d *schema.ResourceData, meta interfa } if _, err := waitHSMDeleted(ctx, conn, d.Id(), d.Timeout(schema.TimeoutDelete)); err != nil { - return sdkdiag.AppendErrorf(diags, "waiting for CloudHSMv2 HSM (%s) deletion: %s", d.Id(), err) + return sdkdiag.AppendErrorf(diags, "waiting for CloudHSMv2 HSM (%s) delete: %s", d.Id(), err) } return diags From 6f0e624db9a61068573004b8e3bd6e7d27ee322e Mon Sep 17 00:00:00 2001 From: Brittan DeYoung <32572259+brittandeyoung@users.noreply.github.com> Date: Tue, 7 Mar 2023 12:09:30 -0500 Subject: [PATCH 471/763] licensemanager: Amend generate, add pages function for ListReceivedLicenses,ListDistributedGrants --- internal/service/licensemanager/generate.go | 2 +- .../service/licensemanager/list_pages_gen.go | 34 ++++++++++++++++++- 2 files changed, 34 insertions(+), 2 deletions(-) diff --git a/internal/service/licensemanager/generate.go b/internal/service/licensemanager/generate.go index 7f0420d44eec..6f6c816647f2 100644 --- a/internal/service/licensemanager/generate.go +++ b/internal/service/licensemanager/generate.go @@ -1,5 +1,5 @@ //go:generate go run ../../generate/tags/main.go -ServiceTagsSlice -UpdateTags -ContextOnly -//go:generate go run ../../generate/listpages/main.go -ListOps=ListLicenseConfigurations,ListLicenseSpecificationsForResource -ContextOnly +//go:generate go run ../../generate/listpages/main.go -ListOps=ListLicenseConfigurations,ListLicenseSpecificationsForResource,ListReceivedLicenses,ListDistributedGrants -ContextOnly // ONLY generate directives and package declaration! Do not add anything else to this file. package licensemanager diff --git a/internal/service/licensemanager/list_pages_gen.go b/internal/service/licensemanager/list_pages_gen.go index d1c6b5c136ce..153408151eaf 100644 --- a/internal/service/licensemanager/list_pages_gen.go +++ b/internal/service/licensemanager/list_pages_gen.go @@ -1,4 +1,4 @@ -// Code generated by "internal/generate/listpages/main.go -ListOps=ListLicenseConfigurations,ListLicenseSpecificationsForResource -ContextOnly"; DO NOT EDIT. +// Code generated by "internal/generate/listpages/main.go -ListOps=ListLicenseConfigurations,ListLicenseSpecificationsForResource,ListReceivedLicenses,ListDistributedGrants -ContextOnly"; DO NOT EDIT. package licensemanager @@ -10,6 +10,22 @@ import ( "github.com/aws/aws-sdk-go/service/licensemanager/licensemanageriface" ) +func listDistributedGrantsPages(ctx context.Context, conn licensemanageriface.LicenseManagerAPI, input *licensemanager.ListDistributedGrantsInput, fn func(*licensemanager.ListDistributedGrantsOutput, bool) bool) error { + for { + output, err := conn.ListDistributedGrantsWithContext(ctx, input) + if err != nil { + return err + } + + lastPage := aws.StringValue(output.NextToken) == "" + if !fn(output, lastPage) || lastPage { + break + } + + input.NextToken = output.NextToken + } + return nil +} func listLicenseConfigurationsPages(ctx context.Context, conn licensemanageriface.LicenseManagerAPI, input *licensemanager.ListLicenseConfigurationsInput, fn func(*licensemanager.ListLicenseConfigurationsOutput, bool) bool) error { for { output, err := conn.ListLicenseConfigurationsWithContext(ctx, input) @@ -42,3 +58,19 @@ func listLicenseSpecificationsForResourcePages(ctx context.Context, conn license } return nil } +func listReceivedLicensesPages(ctx context.Context, conn licensemanageriface.LicenseManagerAPI, input *licensemanager.ListReceivedLicensesInput, fn func(*licensemanager.ListReceivedLicensesOutput, bool) bool) error { + for { + output, err := conn.ListReceivedLicensesWithContext(ctx, input) + if err != nil { + return err + } + + lastPage := aws.StringValue(output.NextToken) == "" + if !fn(output, lastPage) || lastPage { + break + } + + input.NextToken = output.NextToken + } + return nil +} From f383fd9d0a0adbb3aca96bee1217f1743140570b Mon Sep 17 00:00:00 2001 From: Brittan DeYoung <32572259+brittandeyoung@users.noreply.github.com> Date: Tue, 7 Mar 2023 12:10:21 -0500 Subject: [PATCH 472/763] licensemanager: Add common_schema_data_source --- .../common_schema_data_source.go | 44 +++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 internal/service/licensemanager/common_schema_data_source.go diff --git a/internal/service/licensemanager/common_schema_data_source.go b/internal/service/licensemanager/common_schema_data_source.go new file mode 100644 index 000000000000..99f220df60a9 --- /dev/null +++ b/internal/service/licensemanager/common_schema_data_source.go @@ -0,0 +1,44 @@ +package licensemanager + +import ( + "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/service/licensemanager" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" +) + +func BuildFiltersDataSource(set *schema.Set) []*licensemanager.Filter { + var filters []*licensemanager.Filter + for _, v := range set.List() { + m := v.(map[string]interface{}) + var filterValues []*string + for _, e := range m["values"].([]interface{}) { + filterValues = append(filterValues, aws.String(e.(string))) + } + filters = append(filters, &licensemanager.Filter{ + Name: aws.String(m["name"].(string)), + Values: filterValues, + }) + } + return filters +} + +func DataSourceFiltersSchema() *schema.Schema { + return &schema.Schema{ + Type: schema.TypeSet, + Optional: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "name": { + Type: schema.TypeString, + Required: true, + }, + + "values": { + Type: schema.TypeList, + Required: true, + Elem: &schema.Schema{Type: schema.TypeString}, + }, + }, + }, + } +} From e6d3e947708d03e492d9a73ffe378921507d6f9f Mon Sep 17 00:00:00 2001 From: Brittan DeYoung <32572259+brittandeyoung@users.noreply.github.com> Date: Tue, 7 Mar 2023 12:11:07 -0500 Subject: [PATCH 473/763] licensemanager: Add received_licenses_data_source --- .../received_licenses_data_source.go | 106 ++++++++++++++++++ 1 file changed, 106 insertions(+) create mode 100644 internal/service/licensemanager/received_licenses_data_source.go diff --git a/internal/service/licensemanager/received_licenses_data_source.go b/internal/service/licensemanager/received_licenses_data_source.go new file mode 100644 index 000000000000..fe5dcf7894e5 --- /dev/null +++ b/internal/service/licensemanager/received_licenses_data_source.go @@ -0,0 +1,106 @@ +package licensemanager + +import ( + "context" + + "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/service/licensemanager" + "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-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" +) + +// @SDKDataSource("aws_licensemanager_received_licenses") +func DataSourceReceivedLicenses() *schema.Resource { + return &schema.Resource{ + ReadWithoutTimeout: dataSourceReceivedLicensesRead, + Schema: map[string]*schema.Schema{ + "arns": { + Type: schema.TypeList, + Computed: true, + Elem: &schema.Schema{Type: schema.TypeString}, + }, + "filter": DataSourceFiltersSchema(), + }, + } +} + +func dataSourceReceivedLicensesRead(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { + var diags diag.Diagnostics + conn := meta.(*conns.AWSClient).LicenseManagerConn() + + in := &licensemanager.ListReceivedLicensesInput{} + + in.Filters = BuildFiltersDataSource( + d.Get("filter").(*schema.Set), + ) + + if len(in.Filters) == 0 { + in.Filters = nil + } + + out, err := FindReceivedLicenses(ctx, conn, in) + + if err != nil { + return sdkdiag.AppendErrorf(diags, "reading Received Licenses: %s", err) + } + + var licenseARNs []string + + for _, v := range out { + licenseARNs = append(licenseARNs, aws.StringValue(v.LicenseArn)) + } + + d.SetId(meta.(*conns.AWSClient).Region) + d.Set("arns", licenseARNs) + + return diags +} + +func FindReceivedLicenses(ctx context.Context, conn *licensemanager.LicenseManager, in *licensemanager.ListReceivedLicensesInput) ([]*licensemanager.GrantedLicense, error) { + var out []*licensemanager.GrantedLicense + + err := listReceivedLicensesPages(ctx, conn, in, func(page *licensemanager.ListReceivedLicensesOutput, lastPage bool) bool { + if page == nil { + return !lastPage + } + + for _, v := range page.Licenses { + if v != nil { + out = append(out, v) + } + } + + return !lastPage + }) + + if tfawserr.ErrCodeEquals(err, licensemanager.ErrCodeResourceNotFoundException) { + return nil, &resource.NotFoundError{ + LastError: err, + LastRequest: in, + } + } + + if err != nil { + return nil, err + } + + return out, nil +} + +func expandLicenseARNs(rawLicenseARNs []interface{}) []string { + if rawLicenseARNs == nil { + return nil + } + + licenseARNs := make([]string, 0, 8) + + for _, item := range rawLicenseARNs { + licenseARNs = append(licenseARNs, item.(string)) + } + + return licenseARNs +} From ebefd228736da0e1354d2fcdaaa76a77d6b934f3 Mon Sep 17 00:00:00 2001 From: Brittan DeYoung <32572259+brittandeyoung@users.noreply.github.com> Date: Tue, 7 Mar 2023 12:11:36 -0500 Subject: [PATCH 474/763] licensemanager: Add received_licenses_data_source_test --- .../received_licenses_data_source_test.go | 77 +++++++++++++++++++ 1 file changed, 77 insertions(+) create mode 100644 internal/service/licensemanager/received_licenses_data_source_test.go diff --git a/internal/service/licensemanager/received_licenses_data_source_test.go b/internal/service/licensemanager/received_licenses_data_source_test.go new file mode 100644 index 000000000000..736acd8ac5f7 --- /dev/null +++ b/internal/service/licensemanager/received_licenses_data_source_test.go @@ -0,0 +1,77 @@ +package licensemanager_test + +import ( + "fmt" + "os" + "testing" + + "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" +) + +func TestAccLicenseManagerReceivedLicensesDataSource_basic(t *testing.T) { + datasourceName := "data.aws_licensemanager_received_licenses.test" + productSKUKey := "LICENSE_MANAGER_LICENSE_PRODUCT_SKU" + productSKU := os.Getenv(productSKUKey) + if productSKU == "" { + t.Skipf("Environment variable %s is not set", productSKUKey) + } + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { acctest.PreCheck(t) }, + ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + Steps: []resource.TestStep{ + { + Config: testAccReceivedLicensesDataSourceConfig_arns(productSKU), + Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttr(datasourceName, "arns.#", "1"), + ), + }, + }, + }) +} + +func TestAccLicenseManagerReceivedLicensesDataSource_empty(t *testing.T) { + datasourceName := "data.aws_licensemanager_received_licenses.test" + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { acctest.PreCheck(t) }, + ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + Steps: []resource.TestStep{ + { + Config: testAccReceivedLicensesDataSourceConfig_empty(), + Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttr(datasourceName, "arns.#", "0"), + ), + }, + }, + }) +} + +func testAccReceivedLicensesDataSourceConfig_arns(productSKU string) string { + return fmt.Sprintf(` +data "aws_licensemanager_received_licenses" "test" { + filter { + name = "ProductSKU" + values = [ + %[1]q + ] + } +} +`, productSKU) +} + +func testAccReceivedLicensesDataSourceConfig_empty() string { + return fmt.Sprint(` +data "aws_licensemanager_received_licenses" "test" { + filter { + name = "IssuerName" + values = [ + "This Is Fake" + ] + } +} +`) +} From b5d78236ad185db8ed339691d3ecc3c7b3b38a32 Mon Sep 17 00:00:00 2001 From: Brittan DeYoung <32572259+brittandeyoung@users.noreply.github.com> Date: Tue, 7 Mar 2023 12:12:05 -0500 Subject: [PATCH 475/763] licensemanager: Amend service_package_gen, add aws_licensemanager_received_licenses --- internal/service/licensemanager/service_package_gen.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/internal/service/licensemanager/service_package_gen.go b/internal/service/licensemanager/service_package_gen.go index 56f9ffc82ec7..fb1fc7fc1875 100644 --- a/internal/service/licensemanager/service_package_gen.go +++ b/internal/service/licensemanager/service_package_gen.go @@ -22,7 +22,10 @@ func (p *servicePackage) FrameworkResources(ctx context.Context) []func(context. } func (p *servicePackage) SDKDataSources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{} + return map[string]func() *schema.Resource{ + "aws_licensemanager_received_license": DataSourceReceivedLicense, + "aws_licensemanager_received_licenses": DataSourceReceivedLicenses, + } } func (p *servicePackage) SDKResources(ctx context.Context) map[string]func() *schema.Resource { From c74079f9925a020acafd6ef996c00e8a43f91e49 Mon Sep 17 00:00:00 2001 From: Simon Davis Date: Tue, 7 Mar 2023 09:12:10 -0800 Subject: [PATCH 476/763] remove note stating TF compat deprecation (#29834) --- website/docs/guides/version-4-upgrade.html.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/website/docs/guides/version-4-upgrade.html.md b/website/docs/guides/version-4-upgrade.html.md index 51f02c58d6e9..0ae9e3a3ff5c 100644 --- a/website/docs/guides/version-4-upgrade.html.md +++ b/website/docs/guides/version-4-upgrade.html.md @@ -21,8 +21,6 @@ See [Changes to Authentication](#changes-to-authentication) for more details. ~> **NOTE:** Version 4.0.0 of the AWS Provider will be the last major version to support [EC2-Classic resources](#ec2-classic-resource-and-data-source-support) as AWS plans to fully retire EC2-Classic Networking. See the [AWS News Blog](https://aws.amazon.com/blogs/aws/ec2-classic-is-retiring-heres-how-to-prepare/) for additional details. -~> **NOTE:** Version 4.0.0 and 4.x.x versions of the AWS Provider will be the last versions compatible with Terraform 0.12-0.15. - Upgrade topics: From ed917ad713bd5560dc6088cf06ca9f915a7098c8 Mon Sep 17 00:00:00 2001 From: Brittan DeYoung <32572259+brittandeyoung@users.noreply.github.com> Date: Tue, 7 Mar 2023 12:12:23 -0500 Subject: [PATCH 477/763] website: Add licensemanager_received_licenses --- ...nsemanager_received_licenses.html.markdown | 53 +++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 website/docs/d/licensemanager_received_licenses.html.markdown diff --git a/website/docs/d/licensemanager_received_licenses.html.markdown b/website/docs/d/licensemanager_received_licenses.html.markdown new file mode 100644 index 000000000000..3451aa034897 --- /dev/null +++ b/website/docs/d/licensemanager_received_licenses.html.markdown @@ -0,0 +1,53 @@ +--- +subcategory: "License Manager" +layout: "aws" +page_title: "AWS: aws_licensemanager_received_licenses" +description: |- + Get information about a set of license manager received licenses +--- + +# Data Source: aws_licensemanager_received_licenses + +This resource can be used to get a set of license ARNs matching a filter. + +## Example Usage + +The following shows getting all license ARNs issued from the AWS marketplace. Providing no filter, would provide all license ARNs for the entire account. + +```terraform +data "aws_licensemanager_received_licenses" "test" { + filter { + name = "IssuerName" + values = [ + "AWS/Marketplace" + ] + } +} +``` + +## Argument Reference + +* `filter` - (Optional) Custom filter block as described below. + +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](https://docs.aws.amazon.com/license-manager/latest/APIReference/API_ListReceivedLicenses.html#API_ListReceivedLicenses_RequestSyntax). + For example, if filtering using `ProductSKU`, use: + +```terraform +data "aws_licensemanager_received_licenses" "selected" { + filter { + name = "ProductSKU" + values = [""] # insert values here + } +} +``` + +* `values` - (Required) Set of values that are accepted for the given field. + +## Attributes Reference + +* `arns` - List of all the license ARNs found. + From 2042fd4f35c4ca473147c9ef8f33c7bcf34f049a Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Tue, 7 Mar 2023 12:14:03 -0500 Subject: [PATCH 478/763] r/aws_cloudhsm_v2_cluster: Tidy up acceptance tests. --- .../service/cloudhsmv2/cloudhsmv2_test.go | 2 +- internal/service/cloudhsmv2/cluster_test.go | 141 ++++++++---------- 2 files changed, 63 insertions(+), 80 deletions(-) diff --git a/internal/service/cloudhsmv2/cloudhsmv2_test.go b/internal/service/cloudhsmv2/cloudhsmv2_test.go index 42cca37644f1..51fc3acb1f89 100644 --- a/internal/service/cloudhsmv2/cloudhsmv2_test.go +++ b/internal/service/cloudhsmv2/cloudhsmv2_test.go @@ -13,7 +13,7 @@ func TestAccCloudHSMV2_serial(t *testing.T) { "Cluster": { "basic": testAccCluster_basic, "disappears": testAccCluster_disappears, - "tags": testAccCluster_Tags, + "tags": testAccCluster_tags, }, "Hsm": { "availabilityZone": testAccHSM_AvailabilityZone, diff --git a/internal/service/cloudhsmv2/cluster_test.go b/internal/service/cloudhsmv2/cluster_test.go index b03253788b62..b5257d1f540d 100644 --- a/internal/service/cloudhsmv2/cluster_test.go +++ b/internal/service/cloudhsmv2/cluster_test.go @@ -6,18 +6,20 @@ import ( "regexp" "testing" - "github.com/aws/aws-sdk-go/aws" "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" "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" + "github.com/hashicorp/terraform-provider-aws/internal/tfresource" ) func testAccCluster_basic(t *testing.T) { ctx := acctest.Context(t) resourceName := "aws_cloudhsm_v2_cluster.test" + rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.Test(t, resource.TestCase{ PreCheck: func() { acctest.PreCheck(t) }, @@ -26,7 +28,7 @@ func testAccCluster_basic(t *testing.T) { CheckDestroy: testAccCheckClusterDestroy(ctx), Steps: []resource.TestStep{ { - Config: testAccClusterConfig_basic(), + Config: testAccClusterConfig_basic(rName), Check: resource.ComposeAggregateTestCheckFunc( testAccCheckClusterExists(ctx, resourceName), resource.TestMatchResourceAttr(resourceName, "cluster_id", regexp.MustCompile(`^cluster-.+`)), @@ -54,6 +56,7 @@ func testAccCluster_basic(t *testing.T) { func testAccCluster_disappears(t *testing.T) { ctx := acctest.Context(t) resourceName := "aws_cloudhsm_v2_cluster.test" + rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.Test(t, resource.TestCase{ PreCheck: func() { acctest.PreCheck(t) }, @@ -62,12 +65,10 @@ func testAccCluster_disappears(t *testing.T) { CheckDestroy: testAccCheckClusterDestroy(ctx), Steps: []resource.TestStep{ { - Config: testAccClusterConfig_basic(), + Config: testAccClusterConfig_basic(rName), Check: resource.ComposeTestCheckFunc( testAccCheckClusterExists(ctx, resourceName), acctest.CheckResourceDisappears(ctx, acctest.Provider, tfcloudhsmv2.ResourceCluster(), resourceName), - // Verify Delete error handling - acctest.CheckResourceDisappears(ctx, acctest.Provider, tfcloudhsmv2.ResourceCluster(), resourceName), ), ExpectNonEmptyPlan: true, }, @@ -75,9 +76,10 @@ func testAccCluster_disappears(t *testing.T) { }) } -func testAccCluster_Tags(t *testing.T) { +func testAccCluster_tags(t *testing.T) { ctx := acctest.Context(t) resourceName := "aws_cloudhsm_v2_cluster.test" + rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.Test(t, resource.TestCase{ PreCheck: func() { acctest.PreCheck(t) }, @@ -86,12 +88,11 @@ func testAccCluster_Tags(t *testing.T) { CheckDestroy: testAccCheckClusterDestroy(ctx), Steps: []resource.TestStep{ { - Config: testAccClusterConfig_tags2("key1", "value1", "key2", "value2"), + Config: testAccClusterConfig_tags1(rName, "key1", "value1"), Check: resource.ComposeTestCheckFunc( testAccCheckClusterExists(ctx, resourceName), - resource.TestCheckResourceAttr(resourceName, "tags.%", "2"), + resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), resource.TestCheckResourceAttr(resourceName, "tags.key1", "value1"), - resource.TestCheckResourceAttr(resourceName, "tags.key2", "value2"), ), }, { @@ -101,53 +102,76 @@ func testAccCluster_Tags(t *testing.T) { ImportStateVerifyIgnore: []string{"cluster_certificates"}, }, { - Config: testAccClusterConfig_tags1("key1", "value1updated"), + Config: testAccClusterConfig_tags2(rName, "key1", "value1updated", "key2", "value2"), Check: resource.ComposeTestCheckFunc( testAccCheckClusterExists(ctx, resourceName), - resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), + resource.TestCheckResourceAttr(resourceName, "tags.%", "2"), resource.TestCheckResourceAttr(resourceName, "tags.key1", "value1updated"), + resource.TestCheckResourceAttr(resourceName, "tags.key2", "value2"), ), }, { - Config: testAccClusterConfig_tags2("key1", "value1updated", "key3", "value3"), + Config: testAccClusterConfig_tags1(rName, "key2", "value2"), Check: resource.ComposeTestCheckFunc( testAccCheckClusterExists(ctx, resourceName), - resource.TestCheckResourceAttr(resourceName, "tags.%", "2"), - resource.TestCheckResourceAttr(resourceName, "tags.key1", "value1updated"), - resource.TestCheckResourceAttr(resourceName, "tags.key3", "value3"), + resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), + resource.TestCheckResourceAttr(resourceName, "tags.key2", "value2"), ), }, }, }) } -func testAccClusterBaseConfig() string { - return ` -data "aws_availability_zones" "available" { - state = "available" +func testAccCheckClusterDestroy(ctx context.Context) resource.TestCheckFunc { + return func(s *terraform.State) error { + conn := acctest.Provider.Meta().(*conns.AWSClient).CloudHSMV2Conn() - filter { - name = "opt-in-status" - values = ["opt-in-not-required"] - } -} + for _, rs := range s.RootModule().Resources { + if rs.Type != "aws_cloudhsm_v2_cluster" { + continue + } + + _, err := tfcloudhsmv2.FindClusterByID(ctx, conn, rs.Primary.ID) + + if tfresource.NotFound(err) { + continue + } + + if err != nil { + return err + } -resource "aws_vpc" "test" { - cidr_block = "10.0.0.0/16" + return fmt.Errorf("CloudHSMv2 Cluster %s still exists", rs.Primary.ID) + } + + return nil + } } -resource "aws_subnet" "test" { - count = 2 +func testAccCheckClusterExists(ctx context.Context, n string) resource.TestCheckFunc { + return func(s *terraform.State) error { + conn := acctest.Provider.Meta().(*conns.AWSClient).CloudHSMV2Conn() + rs, ok := s.RootModule().Resources[n] + if !ok { + return fmt.Errorf("Not found: %s", n) + } - availability_zone = element(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 + if rs.Primary.ID == "" { + return fmt.Errorf("No CloudHSMv2 Cluster ID is set") + } + + _, err := tfcloudhsmv2.FindClusterByID(ctx, conn, rs.Primary.ID) + + return err + } } -` + +func testAccClusterConfig_base(rName string) string { + return acctest.ConfigVPCWithSubnets(rName, 2) } -func testAccClusterConfig_basic() string { - return acctest.ConfigCompose(testAccClusterBaseConfig(), ` +func testAccClusterConfig_basic(rName string) string { + return acctest.ConfigCompose(testAccClusterConfig_base(rName), ` resource "aws_cloudhsm_v2_cluster" "test" { hsm_type = "hsm1.medium" subnet_ids = aws_subnet.test[*].id @@ -155,8 +179,8 @@ resource "aws_cloudhsm_v2_cluster" "test" { `) } -func testAccClusterConfig_tags1(tagKey1, tagValue1 string) string { - return acctest.ConfigCompose(testAccClusterBaseConfig(), fmt.Sprintf(` +func testAccClusterConfig_tags1(rName, tagKey1, tagValue1 string) string { + return acctest.ConfigCompose(testAccClusterConfig_base(rName), fmt.Sprintf(` resource "aws_cloudhsm_v2_cluster" "test" { hsm_type = "hsm1.medium" subnet_ids = aws_subnet.test[*].id @@ -168,8 +192,8 @@ resource "aws_cloudhsm_v2_cluster" "test" { `, tagKey1, tagValue1)) } -func testAccClusterConfig_tags2(tagKey1, tagValue1, tagKey2, tagValue2 string) string { - return acctest.ConfigCompose(testAccClusterBaseConfig(), fmt.Sprintf(` +func testAccClusterConfig_tags2(rName, tagKey1, tagValue1, tagKey2, tagValue2 string) string { + return acctest.ConfigCompose(testAccClusterConfig_base(rName), fmt.Sprintf(` resource "aws_cloudhsm_v2_cluster" "test" { hsm_type = "hsm1.medium" subnet_ids = aws_subnet.test[*].id @@ -181,44 +205,3 @@ resource "aws_cloudhsm_v2_cluster" "test" { } `, tagKey1, tagValue1, tagKey2, tagValue2)) } - -func testAccCheckClusterDestroy(ctx context.Context) resource.TestCheckFunc { - return func(s *terraform.State) error { - conn := acctest.Provider.Meta().(*conns.AWSClient).CloudHSMV2Conn() - - for _, rs := range s.RootModule().Resources { - if rs.Type != "aws_cloudhsm_v2_cluster" { - continue - } - cluster, err := tfcloudhsmv2.FindClusterByID(ctx, conn, rs.Primary.ID) - - if err != nil { - return err - } - - if cluster != nil && aws.StringValue(cluster.State) != cloudhsmv2.ClusterStateDeleted { - return fmt.Errorf("CloudHSM cluster still exists %s", cluster) - } - } - - return nil - } -} - -func testAccCheckClusterExists(ctx context.Context, name string) resource.TestCheckFunc { - return func(s *terraform.State) error { - conn := acctest.Provider.Meta().(*conns.AWSClient).CloudHSMV2Conn() - it, ok := s.RootModule().Resources[name] - if !ok { - return fmt.Errorf("Not found: %s", name) - } - - _, err := tfcloudhsmv2.FindClusterByID(ctx, conn, it.Primary.ID) - - if err != nil { - return fmt.Errorf("CloudHSM cluster not found: %s", err) - } - - return nil - } -} From 51057daf001f73039dbd5c78fcac4dd284bb98b5 Mon Sep 17 00:00:00 2001 From: changelogbot Date: Tue, 7 Mar 2023 17:15:01 +0000 Subject: [PATCH 479/763] Update CHANGELOG.md for #29834 --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 331b41113dc2..df248b454fb5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,10 +12,12 @@ ENHANCEMENTS: * resource/aws_sesv2_configuration_set: Add `vdm_options` argument ([#28812](https://github.com/hashicorp/terraform-provider-aws/issues/28812)) * resource/aws_transfer_server: Add `protocol_details` argument ([#28621](https://github.com/hashicorp/terraform-provider-aws/issues/28621)) * resource/aws_transfer_workflow: Add `decrypt_step_details` to the `on_exception_steps` and `steps` configuration blocks ([#29692](https://github.com/hashicorp/terraform-provider-aws/issues/29692)) +* resource/db_snapshot: Add `shared_accounts` argument ([#28424](https://github.com/hashicorp/terraform-provider-aws/issues/28424)) BUG FIXES: * resource/aws_grafana_workspace: Allow removing `vpc_configuration` ([#29793](https://github.com/hashicorp/terraform-provider-aws/issues/29793)) +* resource/aws_medialive_channel: Fix setting of the `video_pid` attribute in `m2ts_settings` ([#29824](https://github.com/hashicorp/terraform-provider-aws/issues/29824)) ## 4.57.1 (March 6, 2023) From d208902817ebaf6be17b1cf9163071aed27bbbeb Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Tue, 7 Mar 2023 12:21:52 -0500 Subject: [PATCH 480/763] r/aws_cloudhsm_v2_hsm: Tidy up acceptance tests. --- .../service/cloudhsmv2/cloudhsmv2_test.go | 9 +- internal/service/cloudhsmv2/hsm_test.go | 164 +++++++----------- 2 files changed, 65 insertions(+), 108 deletions(-) diff --git a/internal/service/cloudhsmv2/cloudhsmv2_test.go b/internal/service/cloudhsmv2/cloudhsmv2_test.go index 51fc3acb1f89..9bbe9bcc5185 100644 --- a/internal/service/cloudhsmv2/cloudhsmv2_test.go +++ b/internal/service/cloudhsmv2/cloudhsmv2_test.go @@ -16,11 +16,10 @@ func TestAccCloudHSMV2_serial(t *testing.T) { "tags": testAccCluster_tags, }, "Hsm": { - "availabilityZone": testAccHSM_AvailabilityZone, - "basic": testAccHSM_basic, - "disappears": testAccHSM_disappears, - "disappears_Cluster": testAccHSM_disappears_Cluster, - "ipAddress": testAccHSM_IPAddress, + "availabilityZone": testAccHSM_AvailabilityZone, + "basic": testAccHSM_basic, + "disappears": testAccHSM_disappears, + "ipAddress": testAccHSM_IPAddress, }, "DataSource": { "basic": testAccDataSourceCluster_basic, diff --git a/internal/service/cloudhsmv2/hsm_test.go b/internal/service/cloudhsmv2/hsm_test.go index 39d22ddf22ea..7b6a75acbb37 100644 --- a/internal/service/cloudhsmv2/hsm_test.go +++ b/internal/service/cloudhsmv2/hsm_test.go @@ -6,18 +6,20 @@ import ( "regexp" "testing" - "github.com/aws/aws-sdk-go/aws" "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" "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" + "github.com/hashicorp/terraform-provider-aws/internal/tfresource" ) func testAccHSM_basic(t *testing.T) { ctx := acctest.Context(t) resourceName := "aws_cloudhsm_v2_hsm.test" + rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.Test(t, resource.TestCase{ PreCheck: func() { acctest.PreCheck(t) }, @@ -26,7 +28,7 @@ func testAccHSM_basic(t *testing.T) { CheckDestroy: testAccCheckHSMDestroy(ctx), Steps: []resource.TestStep{ { - Config: testAccHSMConfig_subnetID(), + Config: testAccHSMConfig_subnetID(rName), Check: resource.ComposeAggregateTestCheckFunc( testAccCheckHSMExists(ctx, resourceName), resource.TestCheckResourceAttrPair(resourceName, "availability_zone", "aws_subnet.test.0", "availability_zone"), @@ -50,6 +52,7 @@ func testAccHSM_basic(t *testing.T) { func testAccHSM_disappears(t *testing.T) { ctx := acctest.Context(t) resourceName := "aws_cloudhsm_v2_hsm.test" + rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.Test(t, resource.TestCase{ PreCheck: func() { acctest.PreCheck(t) }, @@ -58,11 +61,9 @@ func testAccHSM_disappears(t *testing.T) { CheckDestroy: testAccCheckClusterDestroy(ctx), Steps: []resource.TestStep{ { - Config: testAccHSMConfig_subnetID(), + Config: testAccHSMConfig_subnetID(rName), Check: resource.ComposeTestCheckFunc( - testAccCheckClusterExists(ctx, resourceName), - acctest.CheckResourceDisappears(ctx, acctest.Provider, tfcloudhsmv2.ResourceHSM(), resourceName), - // Verify Delete error handling + testAccCheckClusterExists(ctx, "aws_cloudhsm_v2_cluster.test"), acctest.CheckResourceDisappears(ctx, acctest.Provider, tfcloudhsmv2.ResourceHSM(), resourceName), ), ExpectNonEmptyPlan: true, @@ -71,33 +72,10 @@ func testAccHSM_disappears(t *testing.T) { }) } -func testAccHSM_disappears_Cluster(t *testing.T) { - ctx := acctest.Context(t) - clusterResourceName := "aws_cloudhsm_v2_cluster.test" - resourceName := "aws_cloudhsm_v2_hsm.test" - - resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, - ErrorCheck: acctest.ErrorCheck(t, cloudhsmv2.EndpointsID), - ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - CheckDestroy: testAccCheckClusterDestroy(ctx), - Steps: []resource.TestStep{ - { - Config: testAccHSMConfig_subnetID(), - Check: resource.ComposeTestCheckFunc( - testAccCheckClusterExists(ctx, resourceName), - acctest.CheckResourceDisappears(ctx, acctest.Provider, tfcloudhsmv2.ResourceHSM(), resourceName), - acctest.CheckResourceDisappears(ctx, acctest.Provider, tfcloudhsmv2.ResourceCluster(), clusterResourceName), - ), - ExpectNonEmptyPlan: true, - }, - }, - }) -} - func testAccHSM_AvailabilityZone(t *testing.T) { ctx := acctest.Context(t) resourceName := "aws_cloudhsm_v2_hsm.test" + rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.Test(t, resource.TestCase{ PreCheck: func() { acctest.PreCheck(t) }, @@ -106,7 +84,7 @@ func testAccHSM_AvailabilityZone(t *testing.T) { CheckDestroy: testAccCheckHSMDestroy(ctx), Steps: []resource.TestStep{ { - Config: testAccHSMConfig_availabilityZone(), + Config: testAccHSMConfig_availabilityZone(rName), Check: resource.ComposeAggregateTestCheckFunc( testAccCheckHSMExists(ctx, resourceName), resource.TestCheckResourceAttrPair(resourceName, "availability_zone", "aws_subnet.test.0", "availability_zone"), @@ -124,6 +102,7 @@ func testAccHSM_AvailabilityZone(t *testing.T) { func testAccHSM_IPAddress(t *testing.T) { ctx := acctest.Context(t) resourceName := "aws_cloudhsm_v2_hsm.test" + rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.Test(t, resource.TestCase{ PreCheck: func() { acctest.PreCheck(t) }, @@ -132,7 +111,7 @@ func testAccHSM_IPAddress(t *testing.T) { CheckDestroy: testAccCheckHSMDestroy(ctx), Steps: []resource.TestStep{ { - Config: testAccHSMConfig_ipAddress(), + Config: testAccHSMConfig_ipAddress(rName), Check: resource.ComposeAggregateTestCheckFunc( testAccCheckHSMExists(ctx, resourceName), resource.TestCheckResourceAttr(resourceName, "ip_address", "10.0.0.5"), @@ -147,40 +126,65 @@ func testAccHSM_IPAddress(t *testing.T) { }) } -func testAccHSMBaseConfig() string { - return ` -data "aws_availability_zones" "available" { - state = "available" +func testAccCheckHSMDestroy(ctx context.Context) resource.TestCheckFunc { + return func(s *terraform.State) error { + conn := acctest.Provider.Meta().(*conns.AWSClient).CloudHSMV2Conn() + + for _, rs := range s.RootModule().Resources { + if rs.Type != "aws_cloudhsm_v2_hsm" { + continue + } - filter { - name = "opt-in-status" - values = ["opt-in-not-required"] - } -} + _, err := tfcloudhsmv2.FindHSMByTwoPartKey(ctx, conn, rs.Primary.ID, rs.Primary.Attributes["hsm_eni_id"]) -resource "aws_vpc" "test" { - cidr_block = "10.0.0.0/16" + if tfresource.NotFound(err) { + continue + } + + if err != nil { + return err + } + + return fmt.Errorf("CloudHSMv2 HSM %s still exists", rs.Primary.ID) + } + + return nil + } } -resource "aws_subnet" "test" { - count = 2 +func testAccCheckHSMExists(ctx context.Context, n string) resource.TestCheckFunc { + return func(s *terraform.State) error { + conn := acctest.Provider.Meta().(*conns.AWSClient).CloudHSMV2Conn() + rs, ok := s.RootModule().Resources[n] + if !ok { + return fmt.Errorf("Not found: %s", n) + } + + if rs.Primary.ID == "" { + return fmt.Errorf("No CloudHSMv2 HSM ID is set") + } + + _, err := tfcloudhsmv2.FindHSMByTwoPartKey(ctx, conn, rs.Primary.ID, rs.Primary.Attributes["hsm_eni_id"]) - availability_zone = element(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 + return err + } } +func testAccHSMConfig_base(rName string) string { + return acctest.ConfigCompose(testAccClusterConfig_base(rName), fmt.Sprintf(` resource "aws_cloudhsm_v2_cluster" "test" { hsm_type = "hsm1.medium" subnet_ids = aws_subnet.test[*].id + + tags = { + Name = %[1]q + } } -` +`, rName)) } -func testAccHSMConfig_availabilityZone() string { - return acctest.ConfigCompose( - testAccHSMBaseConfig(), - ` +func testAccHSMConfig_availabilityZone(rName string) string { + return acctest.ConfigCompose(testAccHSMConfig_base(rName), ` resource "aws_cloudhsm_v2_hsm" "test" { availability_zone = aws_subnet.test[0].availability_zone cluster_id = aws_cloudhsm_v2_cluster.test.cluster_id @@ -188,10 +192,8 @@ resource "aws_cloudhsm_v2_hsm" "test" { `) } -func testAccHSMConfig_ipAddress() string { - return acctest.ConfigCompose( - testAccHSMBaseConfig(), - ` +func testAccHSMConfig_ipAddress(rName string) string { + return acctest.ConfigCompose(testAccHSMConfig_base(rName), ` resource "aws_cloudhsm_v2_hsm" "test" { cluster_id = aws_cloudhsm_v2_cluster.test.cluster_id ip_address = cidrhost(aws_subnet.test[0].cidr_block, 5) @@ -200,55 +202,11 @@ resource "aws_cloudhsm_v2_hsm" "test" { `) } -func testAccHSMConfig_subnetID() string { - return acctest.ConfigCompose( - testAccHSMBaseConfig(), - ` +func testAccHSMConfig_subnetID(rName string) string { + return acctest.ConfigCompose(testAccHSMConfig_base(rName), ` resource "aws_cloudhsm_v2_hsm" "test" { cluster_id = aws_cloudhsm_v2_cluster.test.cluster_id subnet_id = aws_subnet.test[0].id } `) } - -func testAccCheckHSMDestroy(ctx context.Context) resource.TestCheckFunc { - return func(s *terraform.State) error { - conn := acctest.Provider.Meta().(*conns.AWSClient).CloudHSMV2Conn() - - for _, rs := range s.RootModule().Resources { - if rs.Type != "aws_cloudhsm_v2_hsm" { - continue - } - - hsm, err := tfcloudhsmv2.FindHSMByTwoPartKey(ctx, conn, rs.Primary.ID, rs.Primary.Attributes["hsm_eni_id"]) - - if err != nil { - return err - } - - if hsm != nil && aws.StringValue(hsm.State) != "DELETED" { - return fmt.Errorf("HSM still exists:\n%s", hsm) - } - } - - return nil - } -} - -func testAccCheckHSMExists(ctx context.Context, name string) resource.TestCheckFunc { - return func(s *terraform.State) error { - conn := acctest.Provider.Meta().(*conns.AWSClient).CloudHSMV2Conn() - - it, ok := s.RootModule().Resources[name] - if !ok { - return fmt.Errorf("Not found: %s", name) - } - - _, err := tfcloudhsmv2.FindHSMByTwoPartKey(ctx, conn, it.Primary.ID, it.Primary.Attributes["hsm_eni_id"]) - if err != nil { - return fmt.Errorf("CloudHSM cluster not found: %s", err) - } - - return nil - } -} From f508996fd5f735812c0c13a19947b822f1e00b7a Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Tue, 7 Mar 2023 12:28:56 -0500 Subject: [PATCH 481/763] d/aws_cloudhsm_v2_cluster: Tidy up acceptance tests. --- .../cloudhsmv2/cluster_data_source_test.go | 48 +++++-------------- 1 file changed, 13 insertions(+), 35 deletions(-) diff --git a/internal/service/cloudhsmv2/cluster_data_source_test.go b/internal/service/cloudhsmv2/cluster_data_source_test.go index 6232dfad6cc7..baf16212a572 100644 --- a/internal/service/cloudhsmv2/cluster_data_source_test.go +++ b/internal/service/cloudhsmv2/cluster_data_source_test.go @@ -11,8 +11,9 @@ import ( ) func testAccDataSourceCluster_basic(t *testing.T) { - resourceName := "aws_cloudhsm_v2_cluster.cluster" - dataSourceName := "data.aws_cloudhsm_v2_cluster.default" + resourceName := "aws_cloudhsm_v2_cluster.test" + dataSourceName := "data.aws_cloudhsm_v2_cluster.test" + rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.Test(t, resource.TestCase{ PreCheck: func() { acctest.PreCheck(t) }, @@ -20,7 +21,7 @@ func testAccDataSourceCluster_basic(t *testing.T) { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ { - Config: testAccClusterDataSourceConfig_basic, + Config: testAccClusterDataSourceConfig_basic(rName), Check: resource.ComposeTestCheckFunc( resource.TestCheckResourceAttr(dataSourceName, "cluster_state", "UNINITIALIZED"), resource.TestCheckResourceAttrPair(dataSourceName, "cluster_id", resourceName, "cluster_id"), @@ -34,42 +35,19 @@ func testAccDataSourceCluster_basic(t *testing.T) { }) } -var testAccClusterDataSourceConfig_basic = acctest.ConfigCompose(acctest.ConfigAvailableAZsNoOptIn(), fmt.Sprintf(` -variable "subnets" { - default = ["10.0.1.0/24", "10.0.2.0/24"] - type = list(string) -} - -resource "aws_vpc" "cloudhsm_v2_test_vpc" { - cidr_block = "10.0.0.0/16" - - tags = { - Name = "terraform-testacc-aws_cloudhsm_v2_cluster-data-source-basic" - } -} - -resource "aws_subnet" "cloudhsm_v2_test_subnets" { - count = 2 - vpc_id = aws_vpc.cloudhsm_v2_test_vpc.id - cidr_block = element(var.subnets, count.index) - map_public_ip_on_launch = false - availability_zone = element(data.aws_availability_zones.available.names, count.index) - - tags = { - Name = "tf-acc-aws_cloudhsm_v2_cluster-data-source-basic" - } -} - -resource "aws_cloudhsm_v2_cluster" "cluster" { +func testAccClusterDataSourceConfig_basic(rName string) string { + return acctest.ConfigCompose(testAccClusterConfig_base(rName), fmt.Sprintf(` +resource "aws_cloudhsm_v2_cluster" "test" { hsm_type = "hsm1.medium" - subnet_ids = aws_subnet.cloudhsm_v2_test_subnets[*].id + subnet_ids = aws_subnet.test[*].id tags = { - Name = "tf-acc-aws_cloudhsm_v2_cluster-data-source-basic-%d" + Name = %[1]q } } -data "aws_cloudhsm_v2_cluster" "default" { - cluster_id = aws_cloudhsm_v2_cluster.cluster.cluster_id +data "aws_cloudhsm_v2_cluster" "test" { + cluster_id = aws_cloudhsm_v2_cluster.test.cluster_id +} +`, rName)) } -`, sdkacctest.RandInt())) From be19e4e7a31eb22c8e00e38a140aae06dc9b1019 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Tue, 7 Mar 2023 12:35:17 -0500 Subject: [PATCH 482/763] r/aws_cloudhsm_v2_hsm: Enforce `ExactlyOneOf` for `availability_zone` and `subnet_id` arguments. --- .changelog/20891.txt | 3 +++ internal/service/cloudhsmv2/hsm.go | 20 ++++++++++---------- 2 files changed, 13 insertions(+), 10 deletions(-) create mode 100644 .changelog/20891.txt diff --git a/.changelog/20891.txt b/.changelog/20891.txt new file mode 100644 index 000000000000..563670eb6551 --- /dev/null +++ b/.changelog/20891.txt @@ -0,0 +1,3 @@ +```release-note:enhancement +resource/aws_cloudhsm_v2_hsm: Enforce `ExactlyOneOf` for `availability_zone` and `subnet_id` arguments +``` \ No newline at end of file diff --git a/internal/service/cloudhsmv2/hsm.go b/internal/service/cloudhsmv2/hsm.go index a1a842e9a204..384f4bf42bd0 100644 --- a/internal/service/cloudhsmv2/hsm.go +++ b/internal/service/cloudhsmv2/hsm.go @@ -32,11 +32,11 @@ func ResourceHSM() *schema.Resource { Schema: map[string]*schema.Schema{ "availability_zone": { - Type: schema.TypeString, - Optional: true, - Computed: true, - ForceNew: true, - ConflictsWith: []string{"subnet_id"}, + Type: schema.TypeString, + Optional: true, + Computed: true, + ForceNew: true, + ExactlyOneOf: []string{"availability_zone", "subnet_id"}, }, "cluster_id": { Type: schema.TypeString, @@ -62,11 +62,11 @@ func ResourceHSM() *schema.Resource { ForceNew: true, }, "subnet_id": { - Type: schema.TypeString, - Optional: true, - Computed: true, - ForceNew: true, - ConflictsWith: []string{"availability_zone"}, + Type: schema.TypeString, + Optional: true, + Computed: true, + ForceNew: true, + ExactlyOneOf: []string{"availability_zone", "subnet_id"}, }, }, } From 42ddf7955cb4e4e9c2b6fe0911a758056a356c15 Mon Sep 17 00:00:00 2001 From: Kyler Middleton Date: Tue, 7 Mar 2023 12:00:39 -0600 Subject: [PATCH 483/763] Fix file name reference for docs (#29835) --- website/docs/r/lambda_function.html.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/website/docs/r/lambda_function.html.markdown b/website/docs/r/lambda_function.html.markdown index 517a92c27b78..f0045a3edc64 100644 --- a/website/docs/r/lambda_function.html.markdown +++ b/website/docs/r/lambda_function.html.markdown @@ -44,7 +44,7 @@ resource "aws_iam_role" "iam_for_lambda" { data "archive_file" "lambda" { type = "zip" source_file = "lambda.js" - output_path = "lambda.zip" + output_path = "lambda_function_payload.zip" } resource "aws_lambda_function" "test_lambda" { From c913891d70e6625d1660ebcd7eba9864110b590b Mon Sep 17 00:00:00 2001 From: changelogbot Date: Tue, 7 Mar 2023 18:22:10 +0000 Subject: [PATCH 484/763] Update CHANGELOG.md for #29820 --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index df248b454fb5..e13c371cfecc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,7 @@ ENHANCEMENTS: BUG FIXES: +* resource/aws_batch_job_definition: Prevents perpetual diff when container properties environment variable has empty value. ([#29820](https://github.com/hashicorp/terraform-provider-aws/issues/29820)) * resource/aws_grafana_workspace: Allow removing `vpc_configuration` ([#29793](https://github.com/hashicorp/terraform-provider-aws/issues/29793)) * resource/aws_medialive_channel: Fix setting of the `video_pid` attribute in `m2ts_settings` ([#29824](https://github.com/hashicorp/terraform-provider-aws/issues/29824)) From 64708267fa6915f229e874c5a0644e59d32e4e0d Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Tue, 7 Mar 2023 14:17:36 -0500 Subject: [PATCH 485/763] Cosmetics. --- .changelog/29763.txt | 2 +- internal/service/acm/certificate.go | 62 ++++++++++++++++------------- 2 files changed, 36 insertions(+), 28 deletions(-) diff --git a/.changelog/29763.txt b/.changelog/29763.txt index 37aecff7fe69..502f329429ad 100644 --- a/.changelog/29763.txt +++ b/.changelog/29763.txt @@ -1,3 +1,3 @@ ```release-note:bug -resource/aws_acm_certificate: Update `certificate_transparency_logging_preference` in place rather than replacing the resource +resource/aws_acm_certificate: Update `options.certificate_transparency_logging_preference` in place rather than replacing the resource ``` diff --git a/internal/service/acm/certificate.go b/internal/service/acm/certificate.go index 62e100c05823..c2c9dd015b91 100644 --- a/internal/service/acm/certificate.go +++ b/internal/service/acm/certificate.go @@ -270,7 +270,7 @@ func ResourceCertificate() *schema.Resource { } if err := diff.SetNew("domain_validation_options", schema.NewSet(domainValidationOptionsHash, domainValidationOptionsList)); err != nil { - return fmt.Errorf("error setting new domain_validation_options diff: %w", err) + return fmt.Errorf("setting new domain_validation_options diff: %w", err) } } @@ -282,7 +282,7 @@ func ResourceCertificate() *schema.Resource { if sanSet, ok := diff.Get("subject_alternative_names").(*schema.Set); ok { sanSet.Add(domainName) if err := diff.SetNew("subject_alternative_names", sanSet); err != nil { - return fmt.Errorf("error setting new subject_alternative_names diff: %w", err) + return fmt.Errorf("setting new subject_alternative_names diff: %w", err) } } } @@ -328,7 +328,7 @@ func resourceCertificateCreate(ctx context.Context, d *schema.ResourceData, meta _, v2 := d.GetOk("validation_method") if !v1 && !v2 { - return diag.FromErr(errors.New("`certificate_authority_arn` or `validation_method` must be set when creating an ACM certificate")) + return diag.Errorf("`certificate_authority_arn` or `validation_method` must be set when creating an ACM certificate") } domainName := d.Get("domain_name").(string) @@ -367,7 +367,6 @@ func resourceCertificateCreate(ctx context.Context, d *schema.ResourceData, meta input.Tags = Tags(tags.IgnoreAWS()) } - log.Printf("[DEBUG] Requesting ACM Certificate: %s", input) output, err := conn.RequestCertificateWithContext(ctx, input) if err != nil { @@ -460,6 +459,7 @@ func resourceCertificateRead(ctx context.Context, d *schema.ResourceData, meta i } else { d.Set("options", nil) } + d.Set("pending_renewal", certificateSetPendingRenewal(d)) d.Set("renewal_eligibility", certificate.RenewalEligibility) if certificate.RenewalSummary != nil { if err := d.Set("renewal_summary", []interface{}{flattenRenewalSummary(certificate.RenewalSummary)}); err != nil { @@ -474,8 +474,6 @@ func resourceCertificateRead(ctx context.Context, d *schema.ResourceData, meta i d.Set("validation_emails", validationEmails) d.Set("validation_method", certificateValidationMethod(certificate)) - d.Set("pending_renewal", certificateSetPendingRenewal(d)) - tags, err := ListTags(ctx, conn, d.Id()) if err != nil { @@ -515,38 +513,37 @@ func resourceCertificateUpdate(ctx context.Context, d *schema.ResourceData, meta input.CertificateChain = []byte(chain.(string)) } - log.Printf("[INFO] Re-importing ACM Certificate (%s)", d.Id()) _, err := conn.ImportCertificateWithContext(ctx, input) if err != nil { - return diag.Errorf("re-importing ACM Certificate (%s): %s", d.Id(), err) + return diag.Errorf("importing ACM Certificate (%s): %s", d.Id(), err) } } } else if d.Get("pending_renewal").(bool) { - log.Printf("[INFO] Renewing ACM Certificate (%s)", d.Id()) _, err := conn.RenewCertificateWithContext(ctx, &acm.RenewCertificateInput{ CertificateArn: aws.String(d.Get("arn").(string)), }) + if err != nil { return diag.Errorf("renewing ACM Certificate (%s): %s", d.Id(), err) } - _, err = WaitCertificateRenewed(ctx, conn, d.Get("arn").(string), CertificateRenewalTimeout) - if err != nil { + if _, err := WaitCertificateRenewed(ctx, conn, d.Get("arn").(string), CertificateRenewalTimeout); err != nil { return diag.Errorf("waiting for ACM Certificate (%s) renewal: %s", d.Id(), err) } } if d.HasChange("options") { _, n := d.GetChange("options") - - log.Printf("[INFO] Updating Certificate Options (%s)", d.Id()) - _, err := conn.UpdateCertificateOptionsWithContext(ctx, &acm.UpdateCertificateOptionsInput{ + input := &acm.UpdateCertificateOptionsInput{ CertificateArn: aws.String(d.Get("arn").(string)), Options: expandCertificateOptions(n.([]interface{})[0].(map[string]interface{})), - }) + } + + _, err := conn.UpdateCertificateOptionsWithContext(ctx, input) + if err != nil { - return diag.Errorf("updating certificate options (%s): %s", d.Id(), err) + return diag.Errorf("updating ACM Certificate options (%s): %s", d.Id(), err) } } @@ -860,6 +857,20 @@ func FindCertificateByARN(ctx context.Context, conn *acm.ACM, arn string) (*acm. return output, nil } +func findCertificateRenewalByARN(ctx context.Context, conn *acm.ACM, arn string) (*acm.RenewalSummary, error) { + certificate, err := FindCertificateByARN(ctx, conn, arn) + + if err != nil { + return nil, err + } + + if certificate.RenewalSummary == nil { + return nil, tfresource.NewEmptyResultError(arn) + } + + return certificate.RenewalSummary, nil +} + func statusCertificateDomainValidationsAvailable(ctx context.Context, conn *acm.ACM, arn string) resource.StateRefreshFunc { return func() (interface{}, string, error) { certificate, err := FindCertificateByARN(ctx, conn, arn) @@ -916,7 +927,7 @@ func waitCertificateDomainValidationsAvailable(ctx context.Context, conn *acm.AC func statusCertificateRenewal(ctx context.Context, conn *acm.ACM, arn string) resource.StateRefreshFunc { return func() (interface{}, string, error) { - certificate, err := FindCertificateByARN(ctx, conn, arn) + output, err := findCertificateRenewalByARN(ctx, conn, arn) if tfresource.NotFound(err) { return nil, "", nil @@ -926,18 +937,11 @@ func statusCertificateRenewal(ctx context.Context, conn *acm.ACM, arn string) re return nil, "", err } - if certificate.RenewalSummary == nil { - return nil, "", nil - } - if aws.StringValue(certificate.RenewalSummary.RenewalStatus) == acm.RenewalStatusFailed { - return certificate, acm.RenewalStatusFailed, fmt.Errorf("renewing ACM Certificate (%s) failed: %s", arn, aws.StringValue(certificate.RenewalSummary.RenewalStatusReason)) - } - - return certificate, aws.StringValue(certificate.RenewalSummary.RenewalStatus), nil + return output, aws.StringValue(output.RenewalStatus), nil } } -func WaitCertificateRenewed(ctx context.Context, conn *acm.ACM, arn string, timeout time.Duration) (*acm.CertificateDetail, error) { +func WaitCertificateRenewed(ctx context.Context, conn *acm.ACM, arn string, timeout time.Duration) (*acm.RenewalSummary, error) { stateConf := &resource.StateChangeConf{ Pending: []string{acm.RenewalStatusPendingAutoRenewal}, Target: []string{acm.RenewalStatusSuccess}, @@ -947,7 +951,11 @@ func WaitCertificateRenewed(ctx context.Context, conn *acm.ACM, arn string, time outputRaw, err := stateConf.WaitForStateContext(ctx) - if output, ok := outputRaw.(*acm.CertificateDetail); ok { + if output, ok := outputRaw.(*acm.RenewalSummary); ok { + if aws.StringValue(output.RenewalStatus) == acm.RenewalStatusFailed { + tfresource.SetLastError(err, errors.New(aws.StringValue(output.RenewalStatusReason))) + } + return output, err } From 5bd5b7dac3b9940f7f2984bd8ab031c79d033178 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Wed, 1 Mar 2023 12:23:44 -0500 Subject: [PATCH 486/763] Add new structs for service package resources and data sources. --- internal/conns/conns.go | 12 +++---- internal/generate/servicepackages/spd.tmpl | 38 +++++++++++++--------- internal/provider/fwprovider/provider.go | 4 +-- internal/provider/provider.go | 12 ++++--- internal/types/service_package.go | 35 ++++++++++++++++++++ 5 files changed, 73 insertions(+), 28 deletions(-) create mode 100644 internal/types/service_package.go diff --git a/internal/conns/conns.go b/internal/conns/conns.go index 5aceaf55d49d..7267698c7399 100644 --- a/internal/conns/conns.go +++ b/internal/conns/conns.go @@ -8,19 +8,17 @@ import ( "github.com/aws/aws-sdk-go/aws/session" awsbase "github.com/hashicorp/aws-sdk-go-base/v2" awsbasev1 "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2" - "github.com/hashicorp/terraform-plugin-framework/datasource" - "github.com/hashicorp/terraform-plugin-framework/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "github.com/hashicorp/terraform-provider-aws/internal/types" "github.com/hashicorp/terraform-provider-aws/version" ) // ServicePackage is the minimal interface exported from each AWS service package. // Its methods return the Plugin SDK and Framework resources and data sources implemented in the package. type ServicePackage interface { - FrameworkDataSources(context.Context) []func(context.Context) (datasource.DataSourceWithConfigure, error) - FrameworkResources(context.Context) []func(context.Context) (resource.ResourceWithConfigure, error) - SDKDataSources(context.Context) map[string]func() *schema.Resource - SDKResources(context.Context) map[string]func() *schema.Resource + FrameworkDataSources(context.Context) []*types.ServicePackageFrameworkDataSource + FrameworkResources(context.Context) []*types.ServicePackageFrameworkResource + SDKDataSources(context.Context) []*types.ServicePackageSDKDataSource + SDKResources(context.Context) []*types.ServicePackageSDKResource ServicePackageName() string } diff --git a/internal/generate/servicepackages/spd.tmpl b/internal/generate/servicepackages/spd.tmpl index f93a9de05f99..73f0ae67a768 100644 --- a/internal/generate/servicepackages/spd.tmpl +++ b/internal/generate/servicepackages/spd.tmpl @@ -5,9 +5,7 @@ package {{ .ProviderPackage }} import ( "context" - "github.com/hashicorp/terraform-plugin-framework/datasource" - "github.com/hashicorp/terraform-plugin-framework/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "github.com/hashicorp/terraform-provider-aws/internal/types" {{- if ne .ProviderPackage "meta" }} "github.com/hashicorp/terraform-provider-aws/names" {{- end }} @@ -15,34 +13,44 @@ import ( type servicePackage struct {} -func (p *servicePackage) FrameworkDataSources(ctx context.Context) []func(context.Context) (datasource.DataSourceWithConfigure, error) { - return []func(context.Context) (datasource.DataSourceWithConfigure, error) { +func (p *servicePackage) FrameworkDataSources(ctx context.Context) []*types.ServicePackageFrameworkDataSource { + return []*types.ServicePackageFrameworkDataSource { {{- range .FrameworkDataSources }} - {{ . }}, + { + Factory: {{ . }}, + }, {{- end }} } } -func (p *servicePackage) FrameworkResources(ctx context.Context) []func(context.Context) (resource.ResourceWithConfigure, error) { - return []func(context.Context) (resource.ResourceWithConfigure, error) { +func (p *servicePackage) FrameworkResources(ctx context.Context) []*types.ServicePackageFrameworkResource { + return []*types.ServicePackageFrameworkResource { {{- range .FrameworkResources }} - {{ . }}, + { + Factory: {{ . }}, + }, {{- end }} } } -func (p *servicePackage) SDKDataSources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource { +func (p *servicePackage) SDKDataSources(ctx context.Context) []*types.ServicePackageSDKDataSource { + return []*types.ServicePackageSDKDataSource { {{- range $key, $value := .SDKDataSources }} - "{{ $key }}": {{ $value }}, + { + Factory: {{ $value }}, + TypeName: "{{ $key }}", + }, {{- end }} } } -func (p *servicePackage) SDKResources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource { +func (p *servicePackage) SDKResources(ctx context.Context) []*types.ServicePackageSDKResource { + return []*types.ServicePackageSDKResource { {{- range $key, $value := .SDKResources }} - "{{ $key }}": {{ $value }}, + { + Factory: {{ $value }}, + TypeName: "{{ $key }}", + }, {{- end }} } } diff --git a/internal/provider/fwprovider/provider.go b/internal/provider/fwprovider/provider.go index 641185469930..67bea0cca4da 100644 --- a/internal/provider/fwprovider/provider.go +++ b/internal/provider/fwprovider/provider.go @@ -302,7 +302,7 @@ func (p *fwprovider) DataSources(ctx context.Context) []func() datasource.DataSo for _, sp := range p.Primary.Meta().(*conns.AWSClient).ServicePackages { for _, v := range sp.FrameworkDataSources(ctx) { - v, err := v(ctx) + v, err := v.Factory(ctx) if err != nil { tflog.Warn(ctx, "creating data source", map[string]interface{}{ @@ -332,7 +332,7 @@ func (p *fwprovider) Resources(ctx context.Context) []func() resource.Resource { for _, sp := range p.Primary.Meta().(*conns.AWSClient).ServicePackages { for _, v := range sp.FrameworkResources(ctx) { - v, err := v(ctx) + v, err := v.Factory(ctx) if err != nil { tflog.Warn(ctx, "creating resource", map[string]interface{}{ diff --git a/internal/provider/provider.go b/internal/provider/provider.go index 45923390d4d1..38e561ffbb52 100644 --- a/internal/provider/provider.go +++ b/internal/provider/provider.go @@ -256,13 +256,15 @@ func New(ctx context.Context) (*schema.Provider, error) { servicePackages := servicePackages(ctx) for _, sp := range servicePackages { - for typeName, v := range sp.SDKDataSources(ctx) { + for _, v := range sp.SDKDataSources(ctx) { + typeName := v.TypeName + if _, ok := provider.DataSourcesMap[typeName]; ok { errs = multierror.Append(errs, fmt.Errorf("duplicate data source: %s", typeName)) continue } - ds := v() + ds := v.Factory() // Ensure that the correct CRUD handler variants are used. if ds.Read != nil || ds.ReadContext != nil { @@ -277,13 +279,15 @@ func New(ctx context.Context) (*schema.Provider, error) { provider.DataSourcesMap[typeName] = ds } - for typeName, v := range sp.SDKResources(ctx) { + for _, v := range sp.SDKResources(ctx) { + typeName := v.TypeName + if _, ok := provider.ResourcesMap[typeName]; ok { errs = multierror.Append(errs, fmt.Errorf("duplicate resource: %s", typeName)) continue } - r := v() + r := v.Factory() // Ensure that the correct CRUD handler variants are used. if r.Create != nil || r.CreateContext != nil { diff --git a/internal/types/service_package.go b/internal/types/service_package.go new file mode 100644 index 000000000000..e711892a785b --- /dev/null +++ b/internal/types/service_package.go @@ -0,0 +1,35 @@ +package types + +import ( + "context" + + "github.com/hashicorp/terraform-plugin-framework/datasource" + "github.com/hashicorp/terraform-plugin-framework/resource" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" +) + +// ServicePackageFrameworkDataSource represents a Terraform Plugin Framework data source +// implemented by a service package. +type ServicePackageFrameworkDataSource struct { + Factory func(context.Context) (datasource.DataSourceWithConfigure, error) +} + +// ServicePackageFrameworkResource represents a Terraform Plugin Framework resource +// implemented by a service package. +type ServicePackageFrameworkResource struct { + Factory func(context.Context) (resource.ResourceWithConfigure, error) +} + +// ServicePackageSDKDataSource represents a Terraform Plugin SDK data source +// implemented by a service package. +type ServicePackageSDKDataSource struct { + Factory func() *schema.Resource + TypeName string +} + +// ServicePackageSDKResource represents a Terraform Plugin SDK resource +// implemented by a service package. +type ServicePackageSDKResource struct { + Factory func() *schema.Resource + TypeName string +} From e9556f7dae889c6b172cf8cbf1c495d049de7ab8 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Tue, 7 Mar 2023 14:27:44 -0500 Subject: [PATCH 487/763] Run 'make servicepackages'. --- .../accessanalyzer/service_package_gen.go | 30 +- .../service/account/service_package_gen.go | 25 +- internal/service/acm/service_package_gen.go | 35 +- .../service/acmpca/service_package_gen.go | 55 +- internal/service/amp/service_package_gen.go | 40 +- .../service/amplify/service_package_gen.go | 45 +- .../service/apigateway/service_package_gen.go | 175 ++- .../apigatewayv2/service_package_gen.go | 95 +- .../appautoscaling/service_package_gen.go | 35 +- .../service/appconfig/service_package_gen.go | 80 +- .../service/appflow/service_package_gen.go | 30 +- .../appintegrations/service_package_gen.go | 25 +- .../service_package_gen.go | 25 +- .../service/appmesh/service_package_gen.go | 65 +- .../service/apprunner/service_package_gen.go | 55 +- .../service/appstream/service_package_gen.go | 55 +- .../service/appsync/service_package_gen.go | 65 +- .../service/athena/service_package_gen.go | 40 +- .../auditmanager/service_package_gen.go | 60 +- .../autoscaling/service_package_gen.go | 75 +- .../autoscalingplans/service_package_gen.go | 25 +- .../service/backup/service_package_gen.go | 95 +- internal/service/batch/service_package_gen.go | 55 +- .../service/budgets/service_package_gen.go | 30 +- internal/service/ce/service_package_gen.go | 50 +- internal/service/chime/service_package_gen.go | 55 +- .../service/cloud9/service_package_gen.go | 30 +- .../cloudcontrol/service_package_gen.go | 30 +- .../cloudformation/service_package_gen.go | 55 +- .../service/cloudfront/service_package_gen.go | 130 ++- .../service/cloudhsmv2/service_package_gen.go | 35 +- .../cloudsearch/service_package_gen.go | 30 +- .../service/cloudtrail/service_package_gen.go | 35 +- .../service/cloudwatch/service_package_gen.go | 40 +- .../codeartifact/service_package_gen.go | 50 +- .../service/codebuild/service_package_gen.go | 45 +- .../service/codecommit/service_package_gen.go | 50 +- .../codepipeline/service_package_gen.go | 35 +- .../service_package_gen.go | 35 +- .../service_package_gen.go | 25 +- .../cognitoidentity/service_package_gen.go | 35 +- .../service/cognitoidp/service_package_gen.go | 90 +- .../service/comprehend/service_package_gen.go | 30 +- .../computeoptimizer/service_package_gen.go | 20 +- .../configservice/service_package_gen.go | 75 +- .../service/connect/service_package_gen.go | 170 ++- .../controltower/service_package_gen.go | 30 +- internal/service/cur/service_package_gen.go | 30 +- .../dataexchange/service_package_gen.go | 30 +- .../datapipeline/service_package_gen.go | 40 +- .../service/datasync/service_package_gen.go | 75 +- internal/service/dax/service_package_gen.go | 35 +- .../service/deploy/service_package_gen.go | 35 +- .../service/detective/service_package_gen.go | 35 +- .../service/devicefarm/service_package_gen.go | 50 +- .../directconnect/service_package_gen.go | 140 ++- internal/service/dlm/service_package_gen.go | 25 +- internal/service/dms/service_package_gen.go | 55 +- internal/service/docdb/service_package_gen.go | 65 +- internal/service/ds/service_package_gen.go | 60 +- .../service/dynamodb/service_package_gen.go | 65 +- internal/service/ec2/service_package_gen.go | 1016 +++++++++++++---- internal/service/ecr/service_package_gen.go | 70 +- .../service/ecrpublic/service_package_gen.go | 35 +- internal/service/ecs/service_package_gen.go | 85 +- internal/service/efs/service_package_gen.go | 70 +- internal/service/eks/service_package_gen.go | 80 +- .../elasticache/service_package_gen.go | 85 +- .../elasticbeanstalk/service_package_gen.go | 55 +- .../elasticsearch/service_package_gen.go | 40 +- .../elastictranscoder/service_package_gen.go | 30 +- internal/service/elb/service_package_gen.go | 80 +- internal/service/elbv2/service_package_gen.go | 120 +- internal/service/emr/service_package_gen.go | 60 +- .../emrcontainers/service_package_gen.go | 30 +- .../emrserverless/service_package_gen.go | 25 +- .../service/events/service_package_gen.go | 75 +- .../service/evidently/service_package_gen.go | 40 +- .../service/firehose/service_package_gen.go | 30 +- internal/service/fis/service_package_gen.go | 25 +- internal/service/fms/service_package_gen.go | 30 +- internal/service/fsx/service_package_gen.go | 80 +- .../service/gamelift/service_package_gen.go | 50 +- .../service/glacier/service_package_gen.go | 30 +- .../globalaccelerator/service_package_gen.go | 39 +- internal/service/glue/service_package_gen.go | 130 ++- .../service/grafana/service_package_gen.go | 50 +- .../service/greengrass/service_package_gen.go | 20 +- .../service/guardduty/service_package_gen.go | 70 +- .../service/healthlake/service_package_gen.go | 20 +- internal/service/iam/service_package_gen.go | 225 +++- .../identitystore/service_package_gen.go | 45 +- .../imagebuilder/service_package_gen.go | 120 +- .../service/inspector/service_package_gen.go | 40 +- .../service/inspector2/service_package_gen.go | 35 +- internal/service/iot/service_package_gen.go | 100 +- .../iotanalytics/service_package_gen.go | 20 +- .../service/iotevents/service_package_gen.go | 20 +- internal/service/ivs/service_package_gen.go | 40 +- .../service/ivschat/service_package_gen.go | 30 +- internal/service/kafka/service_package_gen.go | 60 +- .../kafkaconnect/service_package_gen.go | 50 +- .../service/kendra/service_package_gen.go | 75 +- .../service/keyspaces/service_package_gen.go | 30 +- .../service/kinesis/service_package_gen.go | 40 +- .../kinesisanalytics/service_package_gen.go | 25 +- .../kinesisanalyticsv2/service_package_gen.go | 30 +- .../kinesisvideo/service_package_gen.go | 25 +- internal/service/kms/service_package_gen.go | 95 +- .../lakeformation/service_package_gen.go | 60 +- .../service/lambda/service_package_gen.go | 110 +- .../service/lexmodels/service_package_gen.go | 60 +- .../licensemanager/service_package_gen.go | 30 +- .../service/lightsail/service_package_gen.go | 130 ++- .../service/location/service_package_gen.go | 85 +- internal/service/logs/service_package_gen.go | 80 +- internal/service/macie/service_package_gen.go | 30 +- .../service/macie2/service_package_gen.go | 60 +- .../mediaconnect/service_package_gen.go | 20 +- .../mediaconvert/service_package_gen.go | 25 +- .../service/medialive/service_package_gen.go | 44 +- .../mediapackage/service_package_gen.go | 25 +- .../service/mediastore/service_package_gen.go | 30 +- .../service/memorydb/service_package_gen.go | 80 +- internal/service/meta/service_package_gen.go | 52 +- internal/service/mq/service_package_gen.go | 40 +- internal/service/mwaa/service_package_gen.go | 25 +- .../service/neptune/service_package_gen.go | 75 +- .../networkfirewall/service_package_gen.go | 55 +- .../networkmanager/service_package_gen.go | 165 ++- internal/service/oam/service_package_gen.go | 20 +- .../service/opensearch/service_package_gen.go | 50 +- .../service_package_gen.go | 20 +- .../service/opsworks/service_package_gen.go | 105 +- .../organizations/service_package_gen.go | 85 +- .../service/outposts/service_package_gen.go | 60 +- .../service/pinpoint/service_package_gen.go | 75 +- internal/service/pipes/service_package_gen.go | 20 +- .../service/pricing/service_package_gen.go | 25 +- internal/service/qldb/service_package_gen.go | 35 +- .../service/quicksight/service_package_gen.go | 40 +- internal/service/ram/service_package_gen.go | 45 +- internal/service/rds/service_package_gen.go | 204 +++- .../service/redshift/service_package_gen.go | 135 ++- .../redshiftdata/service_package_gen.go | 25 +- .../redshiftserverless/service_package_gen.go | 55 +- .../resourceexplorer2/service_package_gen.go | 28 +- .../resourcegroups/service_package_gen.go | 25 +- .../service_package_gen.go | 25 +- .../rolesanywhere/service_package_gen.go | 30 +- .../service/route53/service_package_gen.go | 98 +- .../route53domains/service_package_gen.go | 25 +- .../service_package_gen.go | 40 +- .../service_package_gen.go | 40 +- .../route53resolver/service_package_gen.go | 120 +- internal/service/rum/service_package_gen.go | 30 +- internal/service/s3/service_package_gen.go | 170 ++- .../service/s3control/service_package_gen.go | 85 +- .../service/s3outposts/service_package_gen.go | 25 +- .../service/sagemaker/service_package_gen.go | 150 ++- .../service/scheduler/service_package_gen.go | 30 +- .../service/schemas/service_package_gen.go | 40 +- .../secretsmanager/service_package_gen.go | 65 +- .../securityhub/service_package_gen.go | 75 +- .../serverlessrepo/service_package_gen.go | 30 +- .../servicecatalog/service_package_gen.go | 110 +- .../servicediscovery/service_package_gen.go | 60 +- .../servicequotas/service_package_gen.go | 35 +- internal/service/ses/service_package_gen.go | 105 +- internal/service/sesv2/service_package_gen.go | 60 +- internal/service/sfn/service_package_gen.go | 40 +- .../service/shield/service_package_gen.go | 35 +- .../service/signer/service_package_gen.go | 45 +- .../service/simpledb/service_package_gen.go | 24 +- internal/service/sns/service_package_gen.go | 50 +- internal/service/sqs/service_package_gen.go | 50 +- internal/service/ssm/service_package_gen.go | 110 +- .../service/ssoadmin/service_package_gen.go | 65 +- .../storagegateway/service_package_gen.go | 75 +- internal/service/sts/service_package_gen.go | 24 +- internal/service/swf/service_package_gen.go | 25 +- .../service/synthetics/service_package_gen.go | 25 +- .../timestreamwrite/service_package_gen.go | 30 +- .../service/transcribe/service_package_gen.go | 40 +- .../service/transfer/service_package_gen.go | 55 +- internal/service/waf/service_package_gen.go | 105 +- .../wafregional/service_package_gen.go | 110 +- internal/service/wafv2/service_package_gen.go | 70 +- .../service/worklink/service_package_gen.go | 30 +- .../service/workspaces/service_package_gen.go | 55 +- internal/service/xray/service_package_gen.go | 35 +- 191 files changed, 8088 insertions(+), 3701 deletions(-) diff --git a/internal/service/accessanalyzer/service_package_gen.go b/internal/service/accessanalyzer/service_package_gen.go index 5a1490132c6d..a5d8ad859016 100644 --- a/internal/service/accessanalyzer/service_package_gen.go +++ b/internal/service/accessanalyzer/service_package_gen.go @@ -5,30 +5,34 @@ package accessanalyzer import ( "context" - "github.com/hashicorp/terraform-plugin-framework/datasource" - "github.com/hashicorp/terraform-plugin-framework/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "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) []func(context.Context) (datasource.DataSourceWithConfigure, error) { - return []func(context.Context) (datasource.DataSourceWithConfigure, error){} +func (p *servicePackage) FrameworkDataSources(ctx context.Context) []*types.ServicePackageFrameworkDataSource { + return []*types.ServicePackageFrameworkDataSource{} } -func (p *servicePackage) FrameworkResources(ctx context.Context) []func(context.Context) (resource.ResourceWithConfigure, error) { - return []func(context.Context) (resource.ResourceWithConfigure, error){} +func (p *servicePackage) FrameworkResources(ctx context.Context) []*types.ServicePackageFrameworkResource { + return []*types.ServicePackageFrameworkResource{} } -func (p *servicePackage) SDKDataSources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{} +func (p *servicePackage) SDKDataSources(ctx context.Context) []*types.ServicePackageSDKDataSource { + return []*types.ServicePackageSDKDataSource{} } -func (p *servicePackage) SDKResources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{ - "aws_accessanalyzer_analyzer": ResourceAnalyzer, - "aws_accessanalyzer_archive_rule": ResourceArchiveRule, +func (p *servicePackage) SDKResources(ctx context.Context) []*types.ServicePackageSDKResource { + return []*types.ServicePackageSDKResource{ + { + Factory: ResourceAnalyzer, + TypeName: "aws_accessanalyzer_analyzer", + }, + { + Factory: ResourceArchiveRule, + TypeName: "aws_accessanalyzer_archive_rule", + }, } } diff --git a/internal/service/account/service_package_gen.go b/internal/service/account/service_package_gen.go index 41c5ae567cbe..2315fe234daf 100644 --- a/internal/service/account/service_package_gen.go +++ b/internal/service/account/service_package_gen.go @@ -5,29 +5,30 @@ package account import ( "context" - "github.com/hashicorp/terraform-plugin-framework/datasource" - "github.com/hashicorp/terraform-plugin-framework/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "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) []func(context.Context) (datasource.DataSourceWithConfigure, error) { - return []func(context.Context) (datasource.DataSourceWithConfigure, error){} +func (p *servicePackage) FrameworkDataSources(ctx context.Context) []*types.ServicePackageFrameworkDataSource { + return []*types.ServicePackageFrameworkDataSource{} } -func (p *servicePackage) FrameworkResources(ctx context.Context) []func(context.Context) (resource.ResourceWithConfigure, error) { - return []func(context.Context) (resource.ResourceWithConfigure, error){} +func (p *servicePackage) FrameworkResources(ctx context.Context) []*types.ServicePackageFrameworkResource { + return []*types.ServicePackageFrameworkResource{} } -func (p *servicePackage) SDKDataSources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{} +func (p *servicePackage) SDKDataSources(ctx context.Context) []*types.ServicePackageSDKDataSource { + return []*types.ServicePackageSDKDataSource{} } -func (p *servicePackage) SDKResources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{ - "aws_account_alternate_contact": ResourceAlternateContact, +func (p *servicePackage) SDKResources(ctx context.Context) []*types.ServicePackageSDKResource { + return []*types.ServicePackageSDKResource{ + { + Factory: ResourceAlternateContact, + TypeName: "aws_account_alternate_contact", + }, } } diff --git a/internal/service/acm/service_package_gen.go b/internal/service/acm/service_package_gen.go index 02e0270d668b..09405ff78819 100644 --- a/internal/service/acm/service_package_gen.go +++ b/internal/service/acm/service_package_gen.go @@ -5,32 +5,39 @@ package acm import ( "context" - "github.com/hashicorp/terraform-plugin-framework/datasource" - "github.com/hashicorp/terraform-plugin-framework/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "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) []func(context.Context) (datasource.DataSourceWithConfigure, error) { - return []func(context.Context) (datasource.DataSourceWithConfigure, error){} +func (p *servicePackage) FrameworkDataSources(ctx context.Context) []*types.ServicePackageFrameworkDataSource { + return []*types.ServicePackageFrameworkDataSource{} } -func (p *servicePackage) FrameworkResources(ctx context.Context) []func(context.Context) (resource.ResourceWithConfigure, error) { - return []func(context.Context) (resource.ResourceWithConfigure, error){} +func (p *servicePackage) FrameworkResources(ctx context.Context) []*types.ServicePackageFrameworkResource { + return []*types.ServicePackageFrameworkResource{} } -func (p *servicePackage) SDKDataSources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{ - "aws_acm_certificate": DataSourceCertificate, +func (p *servicePackage) SDKDataSources(ctx context.Context) []*types.ServicePackageSDKDataSource { + return []*types.ServicePackageSDKDataSource{ + { + Factory: DataSourceCertificate, + TypeName: "aws_acm_certificate", + }, } } -func (p *servicePackage) SDKResources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{ - "aws_acm_certificate": ResourceCertificate, - "aws_acm_certificate_validation": ResourceCertificateValidation, +func (p *servicePackage) SDKResources(ctx context.Context) []*types.ServicePackageSDKResource { + return []*types.ServicePackageSDKResource{ + { + Factory: ResourceCertificate, + TypeName: "aws_acm_certificate", + }, + { + Factory: ResourceCertificateValidation, + TypeName: "aws_acm_certificate_validation", + }, } } diff --git a/internal/service/acmpca/service_package_gen.go b/internal/service/acmpca/service_package_gen.go index db41248b983d..04cd5538c6d8 100644 --- a/internal/service/acmpca/service_package_gen.go +++ b/internal/service/acmpca/service_package_gen.go @@ -5,36 +5,55 @@ package acmpca import ( "context" - "github.com/hashicorp/terraform-plugin-framework/datasource" - "github.com/hashicorp/terraform-plugin-framework/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "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) []func(context.Context) (datasource.DataSourceWithConfigure, error) { - return []func(context.Context) (datasource.DataSourceWithConfigure, error){} +func (p *servicePackage) FrameworkDataSources(ctx context.Context) []*types.ServicePackageFrameworkDataSource { + return []*types.ServicePackageFrameworkDataSource{} } -func (p *servicePackage) FrameworkResources(ctx context.Context) []func(context.Context) (resource.ResourceWithConfigure, error) { - return []func(context.Context) (resource.ResourceWithConfigure, error){} +func (p *servicePackage) FrameworkResources(ctx context.Context) []*types.ServicePackageFrameworkResource { + return []*types.ServicePackageFrameworkResource{} } -func (p *servicePackage) SDKDataSources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{ - "aws_acmpca_certificate": DataSourceCertificate, - "aws_acmpca_certificate_authority": DataSourceCertificateAuthority, +func (p *servicePackage) SDKDataSources(ctx context.Context) []*types.ServicePackageSDKDataSource { + return []*types.ServicePackageSDKDataSource{ + { + Factory: DataSourceCertificate, + TypeName: "aws_acmpca_certificate", + }, + { + Factory: DataSourceCertificateAuthority, + TypeName: "aws_acmpca_certificate_authority", + }, } } -func (p *servicePackage) SDKResources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{ - "aws_acmpca_certificate": ResourceCertificate, - "aws_acmpca_certificate_authority": ResourceCertificateAuthority, - "aws_acmpca_certificate_authority_certificate": ResourceCertificateAuthorityCertificate, - "aws_acmpca_permission": ResourcePermission, - "aws_acmpca_policy": ResourcePolicy, +func (p *servicePackage) SDKResources(ctx context.Context) []*types.ServicePackageSDKResource { + return []*types.ServicePackageSDKResource{ + { + Factory: ResourceCertificate, + TypeName: "aws_acmpca_certificate", + }, + { + Factory: ResourceCertificateAuthority, + TypeName: "aws_acmpca_certificate_authority", + }, + { + Factory: ResourceCertificateAuthorityCertificate, + TypeName: "aws_acmpca_certificate_authority_certificate", + }, + { + Factory: ResourcePermission, + TypeName: "aws_acmpca_permission", + }, + { + Factory: ResourcePolicy, + TypeName: "aws_acmpca_policy", + }, } } diff --git a/internal/service/amp/service_package_gen.go b/internal/service/amp/service_package_gen.go index 7e8299dd4fd4..432a7c0ac014 100644 --- a/internal/service/amp/service_package_gen.go +++ b/internal/service/amp/service_package_gen.go @@ -5,33 +5,43 @@ package amp import ( "context" - "github.com/hashicorp/terraform-plugin-framework/datasource" - "github.com/hashicorp/terraform-plugin-framework/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "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) []func(context.Context) (datasource.DataSourceWithConfigure, error) { - return []func(context.Context) (datasource.DataSourceWithConfigure, error){} +func (p *servicePackage) FrameworkDataSources(ctx context.Context) []*types.ServicePackageFrameworkDataSource { + return []*types.ServicePackageFrameworkDataSource{} } -func (p *servicePackage) FrameworkResources(ctx context.Context) []func(context.Context) (resource.ResourceWithConfigure, error) { - return []func(context.Context) (resource.ResourceWithConfigure, error){} +func (p *servicePackage) FrameworkResources(ctx context.Context) []*types.ServicePackageFrameworkResource { + return []*types.ServicePackageFrameworkResource{} } -func (p *servicePackage) SDKDataSources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{ - "aws_prometheus_workspace": DataSourceWorkspace, +func (p *servicePackage) SDKDataSources(ctx context.Context) []*types.ServicePackageSDKDataSource { + return []*types.ServicePackageSDKDataSource{ + { + Factory: DataSourceWorkspace, + TypeName: "aws_prometheus_workspace", + }, } } -func (p *servicePackage) SDKResources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{ - "aws_prometheus_alert_manager_definition": ResourceAlertManagerDefinition, - "aws_prometheus_rule_group_namespace": ResourceRuleGroupNamespace, - "aws_prometheus_workspace": ResourceWorkspace, +func (p *servicePackage) SDKResources(ctx context.Context) []*types.ServicePackageSDKResource { + return []*types.ServicePackageSDKResource{ + { + Factory: ResourceAlertManagerDefinition, + TypeName: "aws_prometheus_alert_manager_definition", + }, + { + Factory: ResourceRuleGroupNamespace, + TypeName: "aws_prometheus_rule_group_namespace", + }, + { + Factory: ResourceWorkspace, + TypeName: "aws_prometheus_workspace", + }, } } diff --git a/internal/service/amplify/service_package_gen.go b/internal/service/amplify/service_package_gen.go index ccccda916035..3992e8e21f5b 100644 --- a/internal/service/amplify/service_package_gen.go +++ b/internal/service/amplify/service_package_gen.go @@ -5,33 +5,46 @@ package amplify import ( "context" - "github.com/hashicorp/terraform-plugin-framework/datasource" - "github.com/hashicorp/terraform-plugin-framework/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "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) []func(context.Context) (datasource.DataSourceWithConfigure, error) { - return []func(context.Context) (datasource.DataSourceWithConfigure, error){} +func (p *servicePackage) FrameworkDataSources(ctx context.Context) []*types.ServicePackageFrameworkDataSource { + return []*types.ServicePackageFrameworkDataSource{} } -func (p *servicePackage) FrameworkResources(ctx context.Context) []func(context.Context) (resource.ResourceWithConfigure, error) { - return []func(context.Context) (resource.ResourceWithConfigure, error){} +func (p *servicePackage) FrameworkResources(ctx context.Context) []*types.ServicePackageFrameworkResource { + return []*types.ServicePackageFrameworkResource{} } -func (p *servicePackage) SDKDataSources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{} +func (p *servicePackage) SDKDataSources(ctx context.Context) []*types.ServicePackageSDKDataSource { + return []*types.ServicePackageSDKDataSource{} } -func (p *servicePackage) SDKResources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{ - "aws_amplify_app": ResourceApp, - "aws_amplify_backend_environment": ResourceBackendEnvironment, - "aws_amplify_branch": ResourceBranch, - "aws_amplify_domain_association": ResourceDomainAssociation, - "aws_amplify_webhook": ResourceWebhook, +func (p *servicePackage) SDKResources(ctx context.Context) []*types.ServicePackageSDKResource { + return []*types.ServicePackageSDKResource{ + { + Factory: ResourceApp, + TypeName: "aws_amplify_app", + }, + { + Factory: ResourceBackendEnvironment, + TypeName: "aws_amplify_backend_environment", + }, + { + Factory: ResourceBranch, + TypeName: "aws_amplify_branch", + }, + { + Factory: ResourceDomainAssociation, + TypeName: "aws_amplify_domain_association", + }, + { + Factory: ResourceWebhook, + TypeName: "aws_amplify_webhook", + }, } } diff --git a/internal/service/apigateway/service_package_gen.go b/internal/service/apigateway/service_package_gen.go index 19e47b296cb5..25863229440c 100644 --- a/internal/service/apigateway/service_package_gen.go +++ b/internal/service/apigateway/service_package_gen.go @@ -5,60 +5,151 @@ package apigateway import ( "context" - "github.com/hashicorp/terraform-plugin-framework/datasource" - "github.com/hashicorp/terraform-plugin-framework/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "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) []func(context.Context) (datasource.DataSourceWithConfigure, error) { - return []func(context.Context) (datasource.DataSourceWithConfigure, error){} +func (p *servicePackage) FrameworkDataSources(ctx context.Context) []*types.ServicePackageFrameworkDataSource { + return []*types.ServicePackageFrameworkDataSource{} } -func (p *servicePackage) FrameworkResources(ctx context.Context) []func(context.Context) (resource.ResourceWithConfigure, error) { - return []func(context.Context) (resource.ResourceWithConfigure, error){} +func (p *servicePackage) FrameworkResources(ctx context.Context) []*types.ServicePackageFrameworkResource { + return []*types.ServicePackageFrameworkResource{} } -func (p *servicePackage) SDKDataSources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{ - "aws_api_gateway_api_key": DataSourceAPIKey, - "aws_api_gateway_domain_name": DataSourceDomainName, - "aws_api_gateway_export": DataSourceExport, - "aws_api_gateway_resource": DataSourceResource, - "aws_api_gateway_rest_api": DataSourceRestAPI, - "aws_api_gateway_sdk": DataSourceSdk, - "aws_api_gateway_vpc_link": DataSourceVPCLink, +func (p *servicePackage) SDKDataSources(ctx context.Context) []*types.ServicePackageSDKDataSource { + return []*types.ServicePackageSDKDataSource{ + { + Factory: DataSourceAPIKey, + TypeName: "aws_api_gateway_api_key", + }, + { + Factory: DataSourceDomainName, + TypeName: "aws_api_gateway_domain_name", + }, + { + Factory: DataSourceExport, + TypeName: "aws_api_gateway_export", + }, + { + Factory: DataSourceResource, + TypeName: "aws_api_gateway_resource", + }, + { + Factory: DataSourceRestAPI, + TypeName: "aws_api_gateway_rest_api", + }, + { + Factory: DataSourceSdk, + TypeName: "aws_api_gateway_sdk", + }, + { + Factory: DataSourceVPCLink, + TypeName: "aws_api_gateway_vpc_link", + }, } } -func (p *servicePackage) SDKResources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{ - "aws_api_gateway_account": ResourceAccount, - "aws_api_gateway_api_key": ResourceAPIKey, - "aws_api_gateway_authorizer": ResourceAuthorizer, - "aws_api_gateway_base_path_mapping": ResourceBasePathMapping, - "aws_api_gateway_client_certificate": ResourceClientCertificate, - "aws_api_gateway_deployment": ResourceDeployment, - "aws_api_gateway_documentation_part": ResourceDocumentationPart, - "aws_api_gateway_documentation_version": ResourceDocumentationVersion, - "aws_api_gateway_domain_name": ResourceDomainName, - "aws_api_gateway_gateway_response": ResourceGatewayResponse, - "aws_api_gateway_integration": ResourceIntegration, - "aws_api_gateway_integration_response": ResourceIntegrationResponse, - "aws_api_gateway_method": ResourceMethod, - "aws_api_gateway_method_response": ResourceMethodResponse, - "aws_api_gateway_method_settings": ResourceMethodSettings, - "aws_api_gateway_model": ResourceModel, - "aws_api_gateway_request_validator": ResourceRequestValidator, - "aws_api_gateway_resource": ResourceResource, - "aws_api_gateway_rest_api": ResourceRestAPI, - "aws_api_gateway_rest_api_policy": ResourceRestAPIPolicy, - "aws_api_gateway_stage": ResourceStage, - "aws_api_gateway_usage_plan": ResourceUsagePlan, - "aws_api_gateway_usage_plan_key": ResourceUsagePlanKey, - "aws_api_gateway_vpc_link": ResourceVPCLink, +func (p *servicePackage) SDKResources(ctx context.Context) []*types.ServicePackageSDKResource { + return []*types.ServicePackageSDKResource{ + { + Factory: ResourceAccount, + TypeName: "aws_api_gateway_account", + }, + { + Factory: ResourceAPIKey, + TypeName: "aws_api_gateway_api_key", + }, + { + Factory: ResourceAuthorizer, + TypeName: "aws_api_gateway_authorizer", + }, + { + Factory: ResourceBasePathMapping, + TypeName: "aws_api_gateway_base_path_mapping", + }, + { + Factory: ResourceClientCertificate, + TypeName: "aws_api_gateway_client_certificate", + }, + { + Factory: ResourceDeployment, + TypeName: "aws_api_gateway_deployment", + }, + { + Factory: ResourceDocumentationPart, + TypeName: "aws_api_gateway_documentation_part", + }, + { + Factory: ResourceDocumentationVersion, + TypeName: "aws_api_gateway_documentation_version", + }, + { + Factory: ResourceDomainName, + TypeName: "aws_api_gateway_domain_name", + }, + { + Factory: ResourceGatewayResponse, + TypeName: "aws_api_gateway_gateway_response", + }, + { + Factory: ResourceIntegration, + TypeName: "aws_api_gateway_integration", + }, + { + Factory: ResourceIntegrationResponse, + TypeName: "aws_api_gateway_integration_response", + }, + { + Factory: ResourceMethod, + TypeName: "aws_api_gateway_method", + }, + { + Factory: ResourceMethodResponse, + TypeName: "aws_api_gateway_method_response", + }, + { + Factory: ResourceMethodSettings, + TypeName: "aws_api_gateway_method_settings", + }, + { + Factory: ResourceModel, + TypeName: "aws_api_gateway_model", + }, + { + Factory: ResourceRequestValidator, + TypeName: "aws_api_gateway_request_validator", + }, + { + Factory: ResourceResource, + TypeName: "aws_api_gateway_resource", + }, + { + Factory: ResourceRestAPI, + TypeName: "aws_api_gateway_rest_api", + }, + { + Factory: ResourceRestAPIPolicy, + TypeName: "aws_api_gateway_rest_api_policy", + }, + { + Factory: ResourceStage, + TypeName: "aws_api_gateway_stage", + }, + { + Factory: ResourceUsagePlan, + TypeName: "aws_api_gateway_usage_plan", + }, + { + Factory: ResourceUsagePlanKey, + TypeName: "aws_api_gateway_usage_plan_key", + }, + { + Factory: ResourceVPCLink, + TypeName: "aws_api_gateway_vpc_link", + }, } } diff --git a/internal/service/apigatewayv2/service_package_gen.go b/internal/service/apigatewayv2/service_package_gen.go index ef4d2a5c7044..57fab55e818d 100644 --- a/internal/service/apigatewayv2/service_package_gen.go +++ b/internal/service/apigatewayv2/service_package_gen.go @@ -5,44 +5,87 @@ package apigatewayv2 import ( "context" - "github.com/hashicorp/terraform-plugin-framework/datasource" - "github.com/hashicorp/terraform-plugin-framework/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "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) []func(context.Context) (datasource.DataSourceWithConfigure, error) { - return []func(context.Context) (datasource.DataSourceWithConfigure, error){} +func (p *servicePackage) FrameworkDataSources(ctx context.Context) []*types.ServicePackageFrameworkDataSource { + return []*types.ServicePackageFrameworkDataSource{} } -func (p *servicePackage) FrameworkResources(ctx context.Context) []func(context.Context) (resource.ResourceWithConfigure, error) { - return []func(context.Context) (resource.ResourceWithConfigure, error){} +func (p *servicePackage) FrameworkResources(ctx context.Context) []*types.ServicePackageFrameworkResource { + return []*types.ServicePackageFrameworkResource{} } -func (p *servicePackage) SDKDataSources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{ - "aws_apigatewayv2_api": DataSourceAPI, - "aws_apigatewayv2_apis": DataSourceAPIs, - "aws_apigatewayv2_export": DataSourceExport, +func (p *servicePackage) SDKDataSources(ctx context.Context) []*types.ServicePackageSDKDataSource { + return []*types.ServicePackageSDKDataSource{ + { + Factory: DataSourceAPI, + TypeName: "aws_apigatewayv2_api", + }, + { + Factory: DataSourceAPIs, + TypeName: "aws_apigatewayv2_apis", + }, + { + Factory: DataSourceExport, + TypeName: "aws_apigatewayv2_export", + }, } } -func (p *servicePackage) SDKResources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{ - "aws_apigatewayv2_api": ResourceAPI, - "aws_apigatewayv2_api_mapping": ResourceAPIMapping, - "aws_apigatewayv2_authorizer": ResourceAuthorizer, - "aws_apigatewayv2_deployment": ResourceDeployment, - "aws_apigatewayv2_domain_name": ResourceDomainName, - "aws_apigatewayv2_integration": ResourceIntegration, - "aws_apigatewayv2_integration_response": ResourceIntegrationResponse, - "aws_apigatewayv2_model": ResourceModel, - "aws_apigatewayv2_route": ResourceRoute, - "aws_apigatewayv2_route_response": ResourceRouteResponse, - "aws_apigatewayv2_stage": ResourceStage, - "aws_apigatewayv2_vpc_link": ResourceVPCLink, +func (p *servicePackage) SDKResources(ctx context.Context) []*types.ServicePackageSDKResource { + return []*types.ServicePackageSDKResource{ + { + Factory: ResourceAPI, + TypeName: "aws_apigatewayv2_api", + }, + { + Factory: ResourceAPIMapping, + TypeName: "aws_apigatewayv2_api_mapping", + }, + { + Factory: ResourceAuthorizer, + TypeName: "aws_apigatewayv2_authorizer", + }, + { + Factory: ResourceDeployment, + TypeName: "aws_apigatewayv2_deployment", + }, + { + Factory: ResourceDomainName, + TypeName: "aws_apigatewayv2_domain_name", + }, + { + Factory: ResourceIntegration, + TypeName: "aws_apigatewayv2_integration", + }, + { + Factory: ResourceIntegrationResponse, + TypeName: "aws_apigatewayv2_integration_response", + }, + { + Factory: ResourceModel, + TypeName: "aws_apigatewayv2_model", + }, + { + Factory: ResourceRoute, + TypeName: "aws_apigatewayv2_route", + }, + { + Factory: ResourceRouteResponse, + TypeName: "aws_apigatewayv2_route_response", + }, + { + Factory: ResourceStage, + TypeName: "aws_apigatewayv2_stage", + }, + { + Factory: ResourceVPCLink, + TypeName: "aws_apigatewayv2_vpc_link", + }, } } diff --git a/internal/service/appautoscaling/service_package_gen.go b/internal/service/appautoscaling/service_package_gen.go index a9c0703d994a..93a431a33399 100644 --- a/internal/service/appautoscaling/service_package_gen.go +++ b/internal/service/appautoscaling/service_package_gen.go @@ -5,31 +5,38 @@ package appautoscaling import ( "context" - "github.com/hashicorp/terraform-plugin-framework/datasource" - "github.com/hashicorp/terraform-plugin-framework/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "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) []func(context.Context) (datasource.DataSourceWithConfigure, error) { - return []func(context.Context) (datasource.DataSourceWithConfigure, error){} +func (p *servicePackage) FrameworkDataSources(ctx context.Context) []*types.ServicePackageFrameworkDataSource { + return []*types.ServicePackageFrameworkDataSource{} } -func (p *servicePackage) FrameworkResources(ctx context.Context) []func(context.Context) (resource.ResourceWithConfigure, error) { - return []func(context.Context) (resource.ResourceWithConfigure, error){} +func (p *servicePackage) FrameworkResources(ctx context.Context) []*types.ServicePackageFrameworkResource { + return []*types.ServicePackageFrameworkResource{} } -func (p *servicePackage) SDKDataSources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{} +func (p *servicePackage) SDKDataSources(ctx context.Context) []*types.ServicePackageSDKDataSource { + return []*types.ServicePackageSDKDataSource{} } -func (p *servicePackage) SDKResources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{ - "aws_appautoscaling_policy": ResourcePolicy, - "aws_appautoscaling_scheduled_action": ResourceScheduledAction, - "aws_appautoscaling_target": ResourceTarget, +func (p *servicePackage) SDKResources(ctx context.Context) []*types.ServicePackageSDKResource { + return []*types.ServicePackageSDKResource{ + { + Factory: ResourcePolicy, + TypeName: "aws_appautoscaling_policy", + }, + { + Factory: ResourceScheduledAction, + TypeName: "aws_appautoscaling_scheduled_action", + }, + { + Factory: ResourceTarget, + TypeName: "aws_appautoscaling_target", + }, } } diff --git a/internal/service/appconfig/service_package_gen.go b/internal/service/appconfig/service_package_gen.go index 9ddea91ba995..c71fdbb7d8f4 100644 --- a/internal/service/appconfig/service_package_gen.go +++ b/internal/service/appconfig/service_package_gen.go @@ -5,41 +5,75 @@ package appconfig import ( "context" - "github.com/hashicorp/terraform-plugin-framework/datasource" - "github.com/hashicorp/terraform-plugin-framework/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "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) []func(context.Context) (datasource.DataSourceWithConfigure, error) { - return []func(context.Context) (datasource.DataSourceWithConfigure, error){} +func (p *servicePackage) FrameworkDataSources(ctx context.Context) []*types.ServicePackageFrameworkDataSource { + return []*types.ServicePackageFrameworkDataSource{} } -func (p *servicePackage) FrameworkResources(ctx context.Context) []func(context.Context) (resource.ResourceWithConfigure, error) { - return []func(context.Context) (resource.ResourceWithConfigure, error){} +func (p *servicePackage) FrameworkResources(ctx context.Context) []*types.ServicePackageFrameworkResource { + return []*types.ServicePackageFrameworkResource{} } -func (p *servicePackage) SDKDataSources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{ - "aws_appconfig_configuration_profile": DataSourceConfigurationProfile, - "aws_appconfig_configuration_profiles": DataSourceConfigurationProfiles, - "aws_appconfig_environment": DataSourceEnvironment, - "aws_appconfig_environments": DataSourceEnvironments, +func (p *servicePackage) SDKDataSources(ctx context.Context) []*types.ServicePackageSDKDataSource { + return []*types.ServicePackageSDKDataSource{ + { + Factory: DataSourceConfigurationProfile, + TypeName: "aws_appconfig_configuration_profile", + }, + { + Factory: DataSourceConfigurationProfiles, + TypeName: "aws_appconfig_configuration_profiles", + }, + { + Factory: DataSourceEnvironment, + TypeName: "aws_appconfig_environment", + }, + { + Factory: DataSourceEnvironments, + TypeName: "aws_appconfig_environments", + }, } } -func (p *servicePackage) SDKResources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{ - "aws_appconfig_application": ResourceApplication, - "aws_appconfig_configuration_profile": ResourceConfigurationProfile, - "aws_appconfig_deployment": ResourceDeployment, - "aws_appconfig_deployment_strategy": ResourceDeploymentStrategy, - "aws_appconfig_environment": ResourceEnvironment, - "aws_appconfig_extension": ResourceExtension, - "aws_appconfig_extension_association": ResourceExtensionAssociation, - "aws_appconfig_hosted_configuration_version": ResourceHostedConfigurationVersion, +func (p *servicePackage) SDKResources(ctx context.Context) []*types.ServicePackageSDKResource { + return []*types.ServicePackageSDKResource{ + { + Factory: ResourceApplication, + TypeName: "aws_appconfig_application", + }, + { + Factory: ResourceConfigurationProfile, + TypeName: "aws_appconfig_configuration_profile", + }, + { + Factory: ResourceDeployment, + TypeName: "aws_appconfig_deployment", + }, + { + Factory: ResourceDeploymentStrategy, + TypeName: "aws_appconfig_deployment_strategy", + }, + { + Factory: ResourceEnvironment, + TypeName: "aws_appconfig_environment", + }, + { + Factory: ResourceExtension, + TypeName: "aws_appconfig_extension", + }, + { + Factory: ResourceExtensionAssociation, + TypeName: "aws_appconfig_extension_association", + }, + { + Factory: ResourceHostedConfigurationVersion, + TypeName: "aws_appconfig_hosted_configuration_version", + }, } } diff --git a/internal/service/appflow/service_package_gen.go b/internal/service/appflow/service_package_gen.go index 5a16e2904e4e..5e1f4fcbf312 100644 --- a/internal/service/appflow/service_package_gen.go +++ b/internal/service/appflow/service_package_gen.go @@ -5,30 +5,34 @@ package appflow import ( "context" - "github.com/hashicorp/terraform-plugin-framework/datasource" - "github.com/hashicorp/terraform-plugin-framework/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "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) []func(context.Context) (datasource.DataSourceWithConfigure, error) { - return []func(context.Context) (datasource.DataSourceWithConfigure, error){} +func (p *servicePackage) FrameworkDataSources(ctx context.Context) []*types.ServicePackageFrameworkDataSource { + return []*types.ServicePackageFrameworkDataSource{} } -func (p *servicePackage) FrameworkResources(ctx context.Context) []func(context.Context) (resource.ResourceWithConfigure, error) { - return []func(context.Context) (resource.ResourceWithConfigure, error){} +func (p *servicePackage) FrameworkResources(ctx context.Context) []*types.ServicePackageFrameworkResource { + return []*types.ServicePackageFrameworkResource{} } -func (p *servicePackage) SDKDataSources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{} +func (p *servicePackage) SDKDataSources(ctx context.Context) []*types.ServicePackageSDKDataSource { + return []*types.ServicePackageSDKDataSource{} } -func (p *servicePackage) SDKResources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{ - "aws_appflow_connector_profile": ResourceConnectorProfile, - "aws_appflow_flow": ResourceFlow, +func (p *servicePackage) SDKResources(ctx context.Context) []*types.ServicePackageSDKResource { + return []*types.ServicePackageSDKResource{ + { + Factory: ResourceConnectorProfile, + TypeName: "aws_appflow_connector_profile", + }, + { + Factory: ResourceFlow, + TypeName: "aws_appflow_flow", + }, } } diff --git a/internal/service/appintegrations/service_package_gen.go b/internal/service/appintegrations/service_package_gen.go index 20ffb672cc82..6746c734fae9 100644 --- a/internal/service/appintegrations/service_package_gen.go +++ b/internal/service/appintegrations/service_package_gen.go @@ -5,29 +5,30 @@ package appintegrations import ( "context" - "github.com/hashicorp/terraform-plugin-framework/datasource" - "github.com/hashicorp/terraform-plugin-framework/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "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) []func(context.Context) (datasource.DataSourceWithConfigure, error) { - return []func(context.Context) (datasource.DataSourceWithConfigure, error){} +func (p *servicePackage) FrameworkDataSources(ctx context.Context) []*types.ServicePackageFrameworkDataSource { + return []*types.ServicePackageFrameworkDataSource{} } -func (p *servicePackage) FrameworkResources(ctx context.Context) []func(context.Context) (resource.ResourceWithConfigure, error) { - return []func(context.Context) (resource.ResourceWithConfigure, error){} +func (p *servicePackage) FrameworkResources(ctx context.Context) []*types.ServicePackageFrameworkResource { + return []*types.ServicePackageFrameworkResource{} } -func (p *servicePackage) SDKDataSources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{} +func (p *servicePackage) SDKDataSources(ctx context.Context) []*types.ServicePackageSDKDataSource { + return []*types.ServicePackageSDKDataSource{} } -func (p *servicePackage) SDKResources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{ - "aws_appintegrations_event_integration": ResourceEventIntegration, +func (p *servicePackage) SDKResources(ctx context.Context) []*types.ServicePackageSDKResource { + return []*types.ServicePackageSDKResource{ + { + Factory: ResourceEventIntegration, + TypeName: "aws_appintegrations_event_integration", + }, } } diff --git a/internal/service/applicationinsights/service_package_gen.go b/internal/service/applicationinsights/service_package_gen.go index 215af6811327..922bfcca6cb0 100644 --- a/internal/service/applicationinsights/service_package_gen.go +++ b/internal/service/applicationinsights/service_package_gen.go @@ -5,29 +5,30 @@ package applicationinsights import ( "context" - "github.com/hashicorp/terraform-plugin-framework/datasource" - "github.com/hashicorp/terraform-plugin-framework/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "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) []func(context.Context) (datasource.DataSourceWithConfigure, error) { - return []func(context.Context) (datasource.DataSourceWithConfigure, error){} +func (p *servicePackage) FrameworkDataSources(ctx context.Context) []*types.ServicePackageFrameworkDataSource { + return []*types.ServicePackageFrameworkDataSource{} } -func (p *servicePackage) FrameworkResources(ctx context.Context) []func(context.Context) (resource.ResourceWithConfigure, error) { - return []func(context.Context) (resource.ResourceWithConfigure, error){} +func (p *servicePackage) FrameworkResources(ctx context.Context) []*types.ServicePackageFrameworkResource { + return []*types.ServicePackageFrameworkResource{} } -func (p *servicePackage) SDKDataSources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{} +func (p *servicePackage) SDKDataSources(ctx context.Context) []*types.ServicePackageSDKDataSource { + return []*types.ServicePackageSDKDataSource{} } -func (p *servicePackage) SDKResources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{ - "aws_applicationinsights_application": ResourceApplication, +func (p *servicePackage) SDKResources(ctx context.Context) []*types.ServicePackageSDKResource { + return []*types.ServicePackageSDKResource{ + { + Factory: ResourceApplication, + TypeName: "aws_applicationinsights_application", + }, } } diff --git a/internal/service/appmesh/service_package_gen.go b/internal/service/appmesh/service_package_gen.go index 54a3fd555408..144c11dec7ee 100644 --- a/internal/service/appmesh/service_package_gen.go +++ b/internal/service/appmesh/service_package_gen.go @@ -5,38 +5,63 @@ package appmesh import ( "context" - "github.com/hashicorp/terraform-plugin-framework/datasource" - "github.com/hashicorp/terraform-plugin-framework/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "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) []func(context.Context) (datasource.DataSourceWithConfigure, error) { - return []func(context.Context) (datasource.DataSourceWithConfigure, error){} +func (p *servicePackage) FrameworkDataSources(ctx context.Context) []*types.ServicePackageFrameworkDataSource { + return []*types.ServicePackageFrameworkDataSource{} } -func (p *servicePackage) FrameworkResources(ctx context.Context) []func(context.Context) (resource.ResourceWithConfigure, error) { - return []func(context.Context) (resource.ResourceWithConfigure, error){} +func (p *servicePackage) FrameworkResources(ctx context.Context) []*types.ServicePackageFrameworkResource { + return []*types.ServicePackageFrameworkResource{} } -func (p *servicePackage) SDKDataSources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{ - "aws_appmesh_mesh": DataSourceMesh, - "aws_appmesh_virtual_service": DataSourceVirtualService, +func (p *servicePackage) SDKDataSources(ctx context.Context) []*types.ServicePackageSDKDataSource { + return []*types.ServicePackageSDKDataSource{ + { + Factory: DataSourceMesh, + TypeName: "aws_appmesh_mesh", + }, + { + Factory: DataSourceVirtualService, + TypeName: "aws_appmesh_virtual_service", + }, } } -func (p *servicePackage) SDKResources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{ - "aws_appmesh_gateway_route": ResourceGatewayRoute, - "aws_appmesh_mesh": ResourceMesh, - "aws_appmesh_route": ResourceRoute, - "aws_appmesh_virtual_gateway": ResourceVirtualGateway, - "aws_appmesh_virtual_node": ResourceVirtualNode, - "aws_appmesh_virtual_router": ResourceVirtualRouter, - "aws_appmesh_virtual_service": ResourceVirtualService, +func (p *servicePackage) SDKResources(ctx context.Context) []*types.ServicePackageSDKResource { + return []*types.ServicePackageSDKResource{ + { + Factory: ResourceGatewayRoute, + TypeName: "aws_appmesh_gateway_route", + }, + { + Factory: ResourceMesh, + TypeName: "aws_appmesh_mesh", + }, + { + Factory: ResourceRoute, + TypeName: "aws_appmesh_route", + }, + { + Factory: ResourceVirtualGateway, + TypeName: "aws_appmesh_virtual_gateway", + }, + { + Factory: ResourceVirtualNode, + TypeName: "aws_appmesh_virtual_node", + }, + { + Factory: ResourceVirtualRouter, + TypeName: "aws_appmesh_virtual_router", + }, + { + Factory: ResourceVirtualService, + TypeName: "aws_appmesh_virtual_service", + }, } } diff --git a/internal/service/apprunner/service_package_gen.go b/internal/service/apprunner/service_package_gen.go index c7e0c893e2c3..049cb62679b0 100644 --- a/internal/service/apprunner/service_package_gen.go +++ b/internal/service/apprunner/service_package_gen.go @@ -5,35 +5,54 @@ package apprunner import ( "context" - "github.com/hashicorp/terraform-plugin-framework/datasource" - "github.com/hashicorp/terraform-plugin-framework/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "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) []func(context.Context) (datasource.DataSourceWithConfigure, error) { - return []func(context.Context) (datasource.DataSourceWithConfigure, error){} +func (p *servicePackage) FrameworkDataSources(ctx context.Context) []*types.ServicePackageFrameworkDataSource { + return []*types.ServicePackageFrameworkDataSource{} } -func (p *servicePackage) FrameworkResources(ctx context.Context) []func(context.Context) (resource.ResourceWithConfigure, error) { - return []func(context.Context) (resource.ResourceWithConfigure, error){} +func (p *servicePackage) FrameworkResources(ctx context.Context) []*types.ServicePackageFrameworkResource { + return []*types.ServicePackageFrameworkResource{} } -func (p *servicePackage) SDKDataSources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{} +func (p *servicePackage) SDKDataSources(ctx context.Context) []*types.ServicePackageSDKDataSource { + return []*types.ServicePackageSDKDataSource{} } -func (p *servicePackage) SDKResources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{ - "aws_apprunner_auto_scaling_configuration_version": ResourceAutoScalingConfigurationVersion, - "aws_apprunner_connection": ResourceConnection, - "aws_apprunner_custom_domain_association": ResourceCustomDomainAssociation, - "aws_apprunner_observability_configuration": ResourceObservabilityConfiguration, - "aws_apprunner_service": ResourceService, - "aws_apprunner_vpc_connector": ResourceVPCConnector, - "aws_apprunner_vpc_ingress_connection": ResourceVPCIngressConnection, +func (p *servicePackage) SDKResources(ctx context.Context) []*types.ServicePackageSDKResource { + return []*types.ServicePackageSDKResource{ + { + Factory: ResourceAutoScalingConfigurationVersion, + TypeName: "aws_apprunner_auto_scaling_configuration_version", + }, + { + Factory: ResourceConnection, + TypeName: "aws_apprunner_connection", + }, + { + Factory: ResourceCustomDomainAssociation, + TypeName: "aws_apprunner_custom_domain_association", + }, + { + Factory: ResourceObservabilityConfiguration, + TypeName: "aws_apprunner_observability_configuration", + }, + { + Factory: ResourceService, + TypeName: "aws_apprunner_service", + }, + { + Factory: ResourceVPCConnector, + TypeName: "aws_apprunner_vpc_connector", + }, + { + Factory: ResourceVPCIngressConnection, + TypeName: "aws_apprunner_vpc_ingress_connection", + }, } } diff --git a/internal/service/appstream/service_package_gen.go b/internal/service/appstream/service_package_gen.go index b4a6f42ac936..71b4031e6a4b 100644 --- a/internal/service/appstream/service_package_gen.go +++ b/internal/service/appstream/service_package_gen.go @@ -5,35 +5,54 @@ package appstream import ( "context" - "github.com/hashicorp/terraform-plugin-framework/datasource" - "github.com/hashicorp/terraform-plugin-framework/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "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) []func(context.Context) (datasource.DataSourceWithConfigure, error) { - return []func(context.Context) (datasource.DataSourceWithConfigure, error){} +func (p *servicePackage) FrameworkDataSources(ctx context.Context) []*types.ServicePackageFrameworkDataSource { + return []*types.ServicePackageFrameworkDataSource{} } -func (p *servicePackage) FrameworkResources(ctx context.Context) []func(context.Context) (resource.ResourceWithConfigure, error) { - return []func(context.Context) (resource.ResourceWithConfigure, error){} +func (p *servicePackage) FrameworkResources(ctx context.Context) []*types.ServicePackageFrameworkResource { + return []*types.ServicePackageFrameworkResource{} } -func (p *servicePackage) SDKDataSources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{} +func (p *servicePackage) SDKDataSources(ctx context.Context) []*types.ServicePackageSDKDataSource { + return []*types.ServicePackageSDKDataSource{} } -func (p *servicePackage) SDKResources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{ - "aws_appstream_directory_config": ResourceDirectoryConfig, - "aws_appstream_fleet": ResourceFleet, - "aws_appstream_fleet_stack_association": ResourceFleetStackAssociation, - "aws_appstream_image_builder": ResourceImageBuilder, - "aws_appstream_stack": ResourceStack, - "aws_appstream_user": ResourceUser, - "aws_appstream_user_stack_association": ResourceUserStackAssociation, +func (p *servicePackage) SDKResources(ctx context.Context) []*types.ServicePackageSDKResource { + return []*types.ServicePackageSDKResource{ + { + Factory: ResourceDirectoryConfig, + TypeName: "aws_appstream_directory_config", + }, + { + Factory: ResourceFleet, + TypeName: "aws_appstream_fleet", + }, + { + Factory: ResourceFleetStackAssociation, + TypeName: "aws_appstream_fleet_stack_association", + }, + { + Factory: ResourceImageBuilder, + TypeName: "aws_appstream_image_builder", + }, + { + Factory: ResourceStack, + TypeName: "aws_appstream_stack", + }, + { + Factory: ResourceUser, + TypeName: "aws_appstream_user", + }, + { + Factory: ResourceUserStackAssociation, + TypeName: "aws_appstream_user_stack_association", + }, } } diff --git a/internal/service/appsync/service_package_gen.go b/internal/service/appsync/service_package_gen.go index 0124f7e35fe0..ae31b7d7861e 100644 --- a/internal/service/appsync/service_package_gen.go +++ b/internal/service/appsync/service_package_gen.go @@ -5,37 +5,62 @@ package appsync import ( "context" - "github.com/hashicorp/terraform-plugin-framework/datasource" - "github.com/hashicorp/terraform-plugin-framework/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "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) []func(context.Context) (datasource.DataSourceWithConfigure, error) { - return []func(context.Context) (datasource.DataSourceWithConfigure, error){} +func (p *servicePackage) FrameworkDataSources(ctx context.Context) []*types.ServicePackageFrameworkDataSource { + return []*types.ServicePackageFrameworkDataSource{} } -func (p *servicePackage) FrameworkResources(ctx context.Context) []func(context.Context) (resource.ResourceWithConfigure, error) { - return []func(context.Context) (resource.ResourceWithConfigure, error){} +func (p *servicePackage) FrameworkResources(ctx context.Context) []*types.ServicePackageFrameworkResource { + return []*types.ServicePackageFrameworkResource{} } -func (p *servicePackage) SDKDataSources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{} +func (p *servicePackage) SDKDataSources(ctx context.Context) []*types.ServicePackageSDKDataSource { + return []*types.ServicePackageSDKDataSource{} } -func (p *servicePackage) SDKResources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{ - "aws_appsync_api_cache": ResourceAPICache, - "aws_appsync_api_key": ResourceAPIKey, - "aws_appsync_datasource": ResourceDataSource, - "aws_appsync_domain_name": ResourceDomainName, - "aws_appsync_domain_name_api_association": ResourceDomainNameAPIAssociation, - "aws_appsync_function": ResourceFunction, - "aws_appsync_graphql_api": ResourceGraphQLAPI, - "aws_appsync_resolver": ResourceResolver, - "aws_appsync_type": ResourceType, +func (p *servicePackage) SDKResources(ctx context.Context) []*types.ServicePackageSDKResource { + return []*types.ServicePackageSDKResource{ + { + Factory: ResourceAPICache, + TypeName: "aws_appsync_api_cache", + }, + { + Factory: ResourceAPIKey, + TypeName: "aws_appsync_api_key", + }, + { + Factory: ResourceDataSource, + TypeName: "aws_appsync_datasource", + }, + { + Factory: ResourceDomainName, + TypeName: "aws_appsync_domain_name", + }, + { + Factory: ResourceDomainNameAPIAssociation, + TypeName: "aws_appsync_domain_name_api_association", + }, + { + Factory: ResourceFunction, + TypeName: "aws_appsync_function", + }, + { + Factory: ResourceGraphQLAPI, + TypeName: "aws_appsync_graphql_api", + }, + { + Factory: ResourceResolver, + TypeName: "aws_appsync_resolver", + }, + { + Factory: ResourceType, + TypeName: "aws_appsync_type", + }, } } diff --git a/internal/service/athena/service_package_gen.go b/internal/service/athena/service_package_gen.go index 16647a360567..d6fac247fb53 100644 --- a/internal/service/athena/service_package_gen.go +++ b/internal/service/athena/service_package_gen.go @@ -5,32 +5,42 @@ package athena import ( "context" - "github.com/hashicorp/terraform-plugin-framework/datasource" - "github.com/hashicorp/terraform-plugin-framework/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "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) []func(context.Context) (datasource.DataSourceWithConfigure, error) { - return []func(context.Context) (datasource.DataSourceWithConfigure, error){} +func (p *servicePackage) FrameworkDataSources(ctx context.Context) []*types.ServicePackageFrameworkDataSource { + return []*types.ServicePackageFrameworkDataSource{} } -func (p *servicePackage) FrameworkResources(ctx context.Context) []func(context.Context) (resource.ResourceWithConfigure, error) { - return []func(context.Context) (resource.ResourceWithConfigure, error){} +func (p *servicePackage) FrameworkResources(ctx context.Context) []*types.ServicePackageFrameworkResource { + return []*types.ServicePackageFrameworkResource{} } -func (p *servicePackage) SDKDataSources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{} +func (p *servicePackage) SDKDataSources(ctx context.Context) []*types.ServicePackageSDKDataSource { + return []*types.ServicePackageSDKDataSource{} } -func (p *servicePackage) SDKResources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{ - "aws_athena_data_catalog": ResourceDataCatalog, - "aws_athena_database": ResourceDatabase, - "aws_athena_named_query": ResourceNamedQuery, - "aws_athena_workgroup": ResourceWorkGroup, +func (p *servicePackage) SDKResources(ctx context.Context) []*types.ServicePackageSDKResource { + return []*types.ServicePackageSDKResource{ + { + Factory: ResourceDataCatalog, + TypeName: "aws_athena_data_catalog", + }, + { + Factory: ResourceDatabase, + TypeName: "aws_athena_database", + }, + { + Factory: ResourceNamedQuery, + TypeName: "aws_athena_named_query", + }, + { + Factory: ResourceWorkGroup, + TypeName: "aws_athena_workgroup", + }, } } diff --git a/internal/service/auditmanager/service_package_gen.go b/internal/service/auditmanager/service_package_gen.go index 05fbf3e32598..61d8311d5797 100644 --- a/internal/service/auditmanager/service_package_gen.go +++ b/internal/service/auditmanager/service_package_gen.go @@ -5,40 +5,58 @@ package auditmanager import ( "context" - "github.com/hashicorp/terraform-plugin-framework/datasource" - "github.com/hashicorp/terraform-plugin-framework/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "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) []func(context.Context) (datasource.DataSourceWithConfigure, error) { - return []func(context.Context) (datasource.DataSourceWithConfigure, error){ - newDataSourceControl, - newDataSourceFramework, +func (p *servicePackage) FrameworkDataSources(ctx context.Context) []*types.ServicePackageFrameworkDataSource { + return []*types.ServicePackageFrameworkDataSource{ + { + Factory: newDataSourceControl, + }, + { + Factory: newDataSourceFramework, + }, } } -func (p *servicePackage) FrameworkResources(ctx context.Context) []func(context.Context) (resource.ResourceWithConfigure, error) { - return []func(context.Context) (resource.ResourceWithConfigure, error){ - newResourceAccountRegistration, - newResourceAssessment, - newResourceAssessmentDelegation, - newResourceAssessmentReport, - newResourceControl, - newResourceFramework, - newResourceFrameworkShare, - newResourceOrganizationAdminAccountRegistration, +func (p *servicePackage) FrameworkResources(ctx context.Context) []*types.ServicePackageFrameworkResource { + return []*types.ServicePackageFrameworkResource{ + { + Factory: newResourceAccountRegistration, + }, + { + Factory: newResourceAssessment, + }, + { + Factory: newResourceAssessmentDelegation, + }, + { + Factory: newResourceAssessmentReport, + }, + { + Factory: newResourceControl, + }, + { + Factory: newResourceFramework, + }, + { + Factory: newResourceFrameworkShare, + }, + { + Factory: newResourceOrganizationAdminAccountRegistration, + }, } } -func (p *servicePackage) SDKDataSources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{} +func (p *servicePackage) SDKDataSources(ctx context.Context) []*types.ServicePackageSDKDataSource { + return []*types.ServicePackageSDKDataSource{} } -func (p *servicePackage) SDKResources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{} +func (p *servicePackage) SDKResources(ctx context.Context) []*types.ServicePackageSDKResource { + return []*types.ServicePackageSDKResource{} } func (p *servicePackage) ServicePackageName() string { diff --git a/internal/service/autoscaling/service_package_gen.go b/internal/service/autoscaling/service_package_gen.go index 239a78e960f9..ae396498ea4e 100644 --- a/internal/service/autoscaling/service_package_gen.go +++ b/internal/service/autoscaling/service_package_gen.go @@ -5,40 +5,71 @@ package autoscaling import ( "context" - "github.com/hashicorp/terraform-plugin-framework/datasource" - "github.com/hashicorp/terraform-plugin-framework/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "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) []func(context.Context) (datasource.DataSourceWithConfigure, error) { - return []func(context.Context) (datasource.DataSourceWithConfigure, error){} +func (p *servicePackage) FrameworkDataSources(ctx context.Context) []*types.ServicePackageFrameworkDataSource { + return []*types.ServicePackageFrameworkDataSource{} } -func (p *servicePackage) FrameworkResources(ctx context.Context) []func(context.Context) (resource.ResourceWithConfigure, error) { - return []func(context.Context) (resource.ResourceWithConfigure, error){} +func (p *servicePackage) FrameworkResources(ctx context.Context) []*types.ServicePackageFrameworkResource { + return []*types.ServicePackageFrameworkResource{} } -func (p *servicePackage) SDKDataSources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{ - "aws_autoscaling_group": DataSourceGroup, - "aws_autoscaling_groups": DataSourceGroups, - "aws_launch_configuration": DataSourceLaunchConfiguration, +func (p *servicePackage) SDKDataSources(ctx context.Context) []*types.ServicePackageSDKDataSource { + return []*types.ServicePackageSDKDataSource{ + { + Factory: DataSourceGroup, + TypeName: "aws_autoscaling_group", + }, + { + Factory: DataSourceGroups, + TypeName: "aws_autoscaling_groups", + }, + { + Factory: DataSourceLaunchConfiguration, + TypeName: "aws_launch_configuration", + }, } } -func (p *servicePackage) SDKResources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{ - "aws_autoscaling_attachment": ResourceAttachment, - "aws_autoscaling_group": ResourceGroup, - "aws_autoscaling_group_tag": ResourceGroupTag, - "aws_autoscaling_lifecycle_hook": ResourceLifecycleHook, - "aws_autoscaling_notification": ResourceNotification, - "aws_autoscaling_policy": ResourcePolicy, - "aws_autoscaling_schedule": ResourceSchedule, - "aws_launch_configuration": ResourceLaunchConfiguration, +func (p *servicePackage) SDKResources(ctx context.Context) []*types.ServicePackageSDKResource { + return []*types.ServicePackageSDKResource{ + { + Factory: ResourceAttachment, + TypeName: "aws_autoscaling_attachment", + }, + { + Factory: ResourceGroup, + TypeName: "aws_autoscaling_group", + }, + { + Factory: ResourceGroupTag, + TypeName: "aws_autoscaling_group_tag", + }, + { + Factory: ResourceLifecycleHook, + TypeName: "aws_autoscaling_lifecycle_hook", + }, + { + Factory: ResourceNotification, + TypeName: "aws_autoscaling_notification", + }, + { + Factory: ResourcePolicy, + TypeName: "aws_autoscaling_policy", + }, + { + Factory: ResourceSchedule, + TypeName: "aws_autoscaling_schedule", + }, + { + Factory: ResourceLaunchConfiguration, + TypeName: "aws_launch_configuration", + }, } } diff --git a/internal/service/autoscalingplans/service_package_gen.go b/internal/service/autoscalingplans/service_package_gen.go index 1c73e8fc9c1c..65ee51ce3b3f 100644 --- a/internal/service/autoscalingplans/service_package_gen.go +++ b/internal/service/autoscalingplans/service_package_gen.go @@ -5,29 +5,30 @@ package autoscalingplans import ( "context" - "github.com/hashicorp/terraform-plugin-framework/datasource" - "github.com/hashicorp/terraform-plugin-framework/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "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) []func(context.Context) (datasource.DataSourceWithConfigure, error) { - return []func(context.Context) (datasource.DataSourceWithConfigure, error){} +func (p *servicePackage) FrameworkDataSources(ctx context.Context) []*types.ServicePackageFrameworkDataSource { + return []*types.ServicePackageFrameworkDataSource{} } -func (p *servicePackage) FrameworkResources(ctx context.Context) []func(context.Context) (resource.ResourceWithConfigure, error) { - return []func(context.Context) (resource.ResourceWithConfigure, error){} +func (p *servicePackage) FrameworkResources(ctx context.Context) []*types.ServicePackageFrameworkResource { + return []*types.ServicePackageFrameworkResource{} } -func (p *servicePackage) SDKDataSources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{} +func (p *servicePackage) SDKDataSources(ctx context.Context) []*types.ServicePackageSDKDataSource { + return []*types.ServicePackageSDKDataSource{} } -func (p *servicePackage) SDKResources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{ - "aws_autoscalingplans_scaling_plan": ResourceScalingPlan, +func (p *servicePackage) SDKResources(ctx context.Context) []*types.ServicePackageSDKResource { + return []*types.ServicePackageSDKResource{ + { + Factory: ResourceScalingPlan, + TypeName: "aws_autoscalingplans_scaling_plan", + }, } } diff --git a/internal/service/backup/service_package_gen.go b/internal/service/backup/service_package_gen.go index e202437168a6..868b04d21fb8 100644 --- a/internal/service/backup/service_package_gen.go +++ b/internal/service/backup/service_package_gen.go @@ -5,44 +5,87 @@ package backup import ( "context" - "github.com/hashicorp/terraform-plugin-framework/datasource" - "github.com/hashicorp/terraform-plugin-framework/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "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) []func(context.Context) (datasource.DataSourceWithConfigure, error) { - return []func(context.Context) (datasource.DataSourceWithConfigure, error){} +func (p *servicePackage) FrameworkDataSources(ctx context.Context) []*types.ServicePackageFrameworkDataSource { + return []*types.ServicePackageFrameworkDataSource{} } -func (p *servicePackage) FrameworkResources(ctx context.Context) []func(context.Context) (resource.ResourceWithConfigure, error) { - return []func(context.Context) (resource.ResourceWithConfigure, error){} +func (p *servicePackage) FrameworkResources(ctx context.Context) []*types.ServicePackageFrameworkResource { + return []*types.ServicePackageFrameworkResource{} } -func (p *servicePackage) SDKDataSources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{ - "aws_backup_framework": DataSourceFramework, - "aws_backup_plan": DataSourcePlan, - "aws_backup_report_plan": DataSourceReportPlan, - "aws_backup_selection": DataSourceSelection, - "aws_backup_vault": DataSourceVault, +func (p *servicePackage) SDKDataSources(ctx context.Context) []*types.ServicePackageSDKDataSource { + return []*types.ServicePackageSDKDataSource{ + { + Factory: DataSourceFramework, + TypeName: "aws_backup_framework", + }, + { + Factory: DataSourcePlan, + TypeName: "aws_backup_plan", + }, + { + Factory: DataSourceReportPlan, + TypeName: "aws_backup_report_plan", + }, + { + Factory: DataSourceSelection, + TypeName: "aws_backup_selection", + }, + { + Factory: DataSourceVault, + TypeName: "aws_backup_vault", + }, } } -func (p *servicePackage) SDKResources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{ - "aws_backup_framework": ResourceFramework, - "aws_backup_global_settings": ResourceGlobalSettings, - "aws_backup_plan": ResourcePlan, - "aws_backup_region_settings": ResourceRegionSettings, - "aws_backup_report_plan": ResourceReportPlan, - "aws_backup_selection": ResourceSelection, - "aws_backup_vault": ResourceVault, - "aws_backup_vault_lock_configuration": ResourceVaultLockConfiguration, - "aws_backup_vault_notifications": ResourceVaultNotifications, - "aws_backup_vault_policy": ResourceVaultPolicy, +func (p *servicePackage) SDKResources(ctx context.Context) []*types.ServicePackageSDKResource { + return []*types.ServicePackageSDKResource{ + { + Factory: ResourceFramework, + TypeName: "aws_backup_framework", + }, + { + Factory: ResourceGlobalSettings, + TypeName: "aws_backup_global_settings", + }, + { + Factory: ResourcePlan, + TypeName: "aws_backup_plan", + }, + { + Factory: ResourceRegionSettings, + TypeName: "aws_backup_region_settings", + }, + { + Factory: ResourceReportPlan, + TypeName: "aws_backup_report_plan", + }, + { + Factory: ResourceSelection, + TypeName: "aws_backup_selection", + }, + { + Factory: ResourceVault, + TypeName: "aws_backup_vault", + }, + { + Factory: ResourceVaultLockConfiguration, + TypeName: "aws_backup_vault_lock_configuration", + }, + { + Factory: ResourceVaultNotifications, + TypeName: "aws_backup_vault_notifications", + }, + { + Factory: ResourceVaultPolicy, + TypeName: "aws_backup_vault_policy", + }, } } diff --git a/internal/service/batch/service_package_gen.go b/internal/service/batch/service_package_gen.go index 7a3146be51b9..a7aaefd8f53f 100644 --- a/internal/service/batch/service_package_gen.go +++ b/internal/service/batch/service_package_gen.go @@ -5,36 +5,55 @@ package batch import ( "context" - "github.com/hashicorp/terraform-plugin-framework/datasource" - "github.com/hashicorp/terraform-plugin-framework/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "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) []func(context.Context) (datasource.DataSourceWithConfigure, error) { - return []func(context.Context) (datasource.DataSourceWithConfigure, error){} +func (p *servicePackage) FrameworkDataSources(ctx context.Context) []*types.ServicePackageFrameworkDataSource { + return []*types.ServicePackageFrameworkDataSource{} } -func (p *servicePackage) FrameworkResources(ctx context.Context) []func(context.Context) (resource.ResourceWithConfigure, error) { - return []func(context.Context) (resource.ResourceWithConfigure, error){} +func (p *servicePackage) FrameworkResources(ctx context.Context) []*types.ServicePackageFrameworkResource { + return []*types.ServicePackageFrameworkResource{} } -func (p *servicePackage) SDKDataSources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{ - "aws_batch_compute_environment": DataSourceComputeEnvironment, - "aws_batch_job_queue": DataSourceJobQueue, - "aws_batch_scheduling_policy": DataSourceSchedulingPolicy, +func (p *servicePackage) SDKDataSources(ctx context.Context) []*types.ServicePackageSDKDataSource { + return []*types.ServicePackageSDKDataSource{ + { + Factory: DataSourceComputeEnvironment, + TypeName: "aws_batch_compute_environment", + }, + { + Factory: DataSourceJobQueue, + TypeName: "aws_batch_job_queue", + }, + { + Factory: DataSourceSchedulingPolicy, + TypeName: "aws_batch_scheduling_policy", + }, } } -func (p *servicePackage) SDKResources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{ - "aws_batch_compute_environment": ResourceComputeEnvironment, - "aws_batch_job_definition": ResourceJobDefinition, - "aws_batch_job_queue": ResourceJobQueue, - "aws_batch_scheduling_policy": ResourceSchedulingPolicy, +func (p *servicePackage) SDKResources(ctx context.Context) []*types.ServicePackageSDKResource { + return []*types.ServicePackageSDKResource{ + { + Factory: ResourceComputeEnvironment, + TypeName: "aws_batch_compute_environment", + }, + { + Factory: ResourceJobDefinition, + TypeName: "aws_batch_job_definition", + }, + { + Factory: ResourceJobQueue, + TypeName: "aws_batch_job_queue", + }, + { + Factory: ResourceSchedulingPolicy, + TypeName: "aws_batch_scheduling_policy", + }, } } diff --git a/internal/service/budgets/service_package_gen.go b/internal/service/budgets/service_package_gen.go index 0c0977172fec..b2b83fdfee76 100644 --- a/internal/service/budgets/service_package_gen.go +++ b/internal/service/budgets/service_package_gen.go @@ -5,30 +5,34 @@ package budgets import ( "context" - "github.com/hashicorp/terraform-plugin-framework/datasource" - "github.com/hashicorp/terraform-plugin-framework/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "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) []func(context.Context) (datasource.DataSourceWithConfigure, error) { - return []func(context.Context) (datasource.DataSourceWithConfigure, error){} +func (p *servicePackage) FrameworkDataSources(ctx context.Context) []*types.ServicePackageFrameworkDataSource { + return []*types.ServicePackageFrameworkDataSource{} } -func (p *servicePackage) FrameworkResources(ctx context.Context) []func(context.Context) (resource.ResourceWithConfigure, error) { - return []func(context.Context) (resource.ResourceWithConfigure, error){} +func (p *servicePackage) FrameworkResources(ctx context.Context) []*types.ServicePackageFrameworkResource { + return []*types.ServicePackageFrameworkResource{} } -func (p *servicePackage) SDKDataSources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{} +func (p *servicePackage) SDKDataSources(ctx context.Context) []*types.ServicePackageSDKDataSource { + return []*types.ServicePackageSDKDataSource{} } -func (p *servicePackage) SDKResources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{ - "aws_budgets_budget": ResourceBudget, - "aws_budgets_budget_action": ResourceBudgetAction, +func (p *servicePackage) SDKResources(ctx context.Context) []*types.ServicePackageSDKResource { + return []*types.ServicePackageSDKResource{ + { + Factory: ResourceBudget, + TypeName: "aws_budgets_budget", + }, + { + Factory: ResourceBudgetAction, + TypeName: "aws_budgets_budget_action", + }, } } diff --git a/internal/service/ce/service_package_gen.go b/internal/service/ce/service_package_gen.go index ee2021b4d74b..fd422e9453f9 100644 --- a/internal/service/ce/service_package_gen.go +++ b/internal/service/ce/service_package_gen.go @@ -5,35 +5,51 @@ package ce import ( "context" - "github.com/hashicorp/terraform-plugin-framework/datasource" - "github.com/hashicorp/terraform-plugin-framework/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "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) []func(context.Context) (datasource.DataSourceWithConfigure, error) { - return []func(context.Context) (datasource.DataSourceWithConfigure, error){} +func (p *servicePackage) FrameworkDataSources(ctx context.Context) []*types.ServicePackageFrameworkDataSource { + return []*types.ServicePackageFrameworkDataSource{} } -func (p *servicePackage) FrameworkResources(ctx context.Context) []func(context.Context) (resource.ResourceWithConfigure, error) { - return []func(context.Context) (resource.ResourceWithConfigure, error){} +func (p *servicePackage) FrameworkResources(ctx context.Context) []*types.ServicePackageFrameworkResource { + return []*types.ServicePackageFrameworkResource{} } -func (p *servicePackage) SDKDataSources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{ - "aws_ce_cost_category": DataSourceCostCategory, - "aws_ce_tags": DataSourceTags, +func (p *servicePackage) SDKDataSources(ctx context.Context) []*types.ServicePackageSDKDataSource { + return []*types.ServicePackageSDKDataSource{ + { + Factory: DataSourceCostCategory, + TypeName: "aws_ce_cost_category", + }, + { + Factory: DataSourceTags, + TypeName: "aws_ce_tags", + }, } } -func (p *servicePackage) SDKResources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{ - "aws_ce_anomaly_monitor": ResourceAnomalyMonitor, - "aws_ce_anomaly_subscription": ResourceAnomalySubscription, - "aws_ce_cost_allocation_tag": ResourceCostAllocationTag, - "aws_ce_cost_category": ResourceCostCategory, +func (p *servicePackage) SDKResources(ctx context.Context) []*types.ServicePackageSDKResource { + return []*types.ServicePackageSDKResource{ + { + Factory: ResourceAnomalyMonitor, + TypeName: "aws_ce_anomaly_monitor", + }, + { + Factory: ResourceAnomalySubscription, + TypeName: "aws_ce_anomaly_subscription", + }, + { + Factory: ResourceCostAllocationTag, + TypeName: "aws_ce_cost_allocation_tag", + }, + { + Factory: ResourceCostCategory, + TypeName: "aws_ce_cost_category", + }, } } diff --git a/internal/service/chime/service_package_gen.go b/internal/service/chime/service_package_gen.go index 9f3f4916de56..56af19cd21f1 100644 --- a/internal/service/chime/service_package_gen.go +++ b/internal/service/chime/service_package_gen.go @@ -5,35 +5,54 @@ package chime import ( "context" - "github.com/hashicorp/terraform-plugin-framework/datasource" - "github.com/hashicorp/terraform-plugin-framework/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "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) []func(context.Context) (datasource.DataSourceWithConfigure, error) { - return []func(context.Context) (datasource.DataSourceWithConfigure, error){} +func (p *servicePackage) FrameworkDataSources(ctx context.Context) []*types.ServicePackageFrameworkDataSource { + return []*types.ServicePackageFrameworkDataSource{} } -func (p *servicePackage) FrameworkResources(ctx context.Context) []func(context.Context) (resource.ResourceWithConfigure, error) { - return []func(context.Context) (resource.ResourceWithConfigure, error){} +func (p *servicePackage) FrameworkResources(ctx context.Context) []*types.ServicePackageFrameworkResource { + return []*types.ServicePackageFrameworkResource{} } -func (p *servicePackage) SDKDataSources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{} +func (p *servicePackage) SDKDataSources(ctx context.Context) []*types.ServicePackageSDKDataSource { + return []*types.ServicePackageSDKDataSource{} } -func (p *servicePackage) SDKResources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{ - "aws_chime_voice_connector": ResourceVoiceConnector, - "aws_chime_voice_connector_group": ResourceVoiceConnectorGroup, - "aws_chime_voice_connector_logging": ResourceVoiceConnectorLogging, - "aws_chime_voice_connector_origination": ResourceVoiceConnectorOrigination, - "aws_chime_voice_connector_streaming": ResourceVoiceConnectorStreaming, - "aws_chime_voice_connector_termination": ResourceVoiceConnectorTermination, - "aws_chime_voice_connector_termination_credentials": ResourceVoiceConnectorTerminationCredentials, +func (p *servicePackage) SDKResources(ctx context.Context) []*types.ServicePackageSDKResource { + return []*types.ServicePackageSDKResource{ + { + Factory: ResourceVoiceConnector, + TypeName: "aws_chime_voice_connector", + }, + { + Factory: ResourceVoiceConnectorGroup, + TypeName: "aws_chime_voice_connector_group", + }, + { + Factory: ResourceVoiceConnectorLogging, + TypeName: "aws_chime_voice_connector_logging", + }, + { + Factory: ResourceVoiceConnectorOrigination, + TypeName: "aws_chime_voice_connector_origination", + }, + { + Factory: ResourceVoiceConnectorStreaming, + TypeName: "aws_chime_voice_connector_streaming", + }, + { + Factory: ResourceVoiceConnectorTermination, + TypeName: "aws_chime_voice_connector_termination", + }, + { + Factory: ResourceVoiceConnectorTerminationCredentials, + TypeName: "aws_chime_voice_connector_termination_credentials", + }, } } diff --git a/internal/service/cloud9/service_package_gen.go b/internal/service/cloud9/service_package_gen.go index 5c7cc6019f87..5f962362f49a 100644 --- a/internal/service/cloud9/service_package_gen.go +++ b/internal/service/cloud9/service_package_gen.go @@ -5,30 +5,34 @@ package cloud9 import ( "context" - "github.com/hashicorp/terraform-plugin-framework/datasource" - "github.com/hashicorp/terraform-plugin-framework/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "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) []func(context.Context) (datasource.DataSourceWithConfigure, error) { - return []func(context.Context) (datasource.DataSourceWithConfigure, error){} +func (p *servicePackage) FrameworkDataSources(ctx context.Context) []*types.ServicePackageFrameworkDataSource { + return []*types.ServicePackageFrameworkDataSource{} } -func (p *servicePackage) FrameworkResources(ctx context.Context) []func(context.Context) (resource.ResourceWithConfigure, error) { - return []func(context.Context) (resource.ResourceWithConfigure, error){} +func (p *servicePackage) FrameworkResources(ctx context.Context) []*types.ServicePackageFrameworkResource { + return []*types.ServicePackageFrameworkResource{} } -func (p *servicePackage) SDKDataSources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{} +func (p *servicePackage) SDKDataSources(ctx context.Context) []*types.ServicePackageSDKDataSource { + return []*types.ServicePackageSDKDataSource{} } -func (p *servicePackage) SDKResources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{ - "aws_cloud9_environment_ec2": ResourceEnvironmentEC2, - "aws_cloud9_environment_membership": ResourceEnvironmentMembership, +func (p *servicePackage) SDKResources(ctx context.Context) []*types.ServicePackageSDKResource { + return []*types.ServicePackageSDKResource{ + { + Factory: ResourceEnvironmentEC2, + TypeName: "aws_cloud9_environment_ec2", + }, + { + Factory: ResourceEnvironmentMembership, + TypeName: "aws_cloud9_environment_membership", + }, } } diff --git a/internal/service/cloudcontrol/service_package_gen.go b/internal/service/cloudcontrol/service_package_gen.go index 738d49e2793c..455d962b616b 100644 --- a/internal/service/cloudcontrol/service_package_gen.go +++ b/internal/service/cloudcontrol/service_package_gen.go @@ -5,31 +5,35 @@ package cloudcontrol import ( "context" - "github.com/hashicorp/terraform-plugin-framework/datasource" - "github.com/hashicorp/terraform-plugin-framework/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "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) []func(context.Context) (datasource.DataSourceWithConfigure, error) { - return []func(context.Context) (datasource.DataSourceWithConfigure, error){} +func (p *servicePackage) FrameworkDataSources(ctx context.Context) []*types.ServicePackageFrameworkDataSource { + return []*types.ServicePackageFrameworkDataSource{} } -func (p *servicePackage) FrameworkResources(ctx context.Context) []func(context.Context) (resource.ResourceWithConfigure, error) { - return []func(context.Context) (resource.ResourceWithConfigure, error){} +func (p *servicePackage) FrameworkResources(ctx context.Context) []*types.ServicePackageFrameworkResource { + return []*types.ServicePackageFrameworkResource{} } -func (p *servicePackage) SDKDataSources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{ - "aws_cloudcontrolapi_resource": DataSourceResource, +func (p *servicePackage) SDKDataSources(ctx context.Context) []*types.ServicePackageSDKDataSource { + return []*types.ServicePackageSDKDataSource{ + { + Factory: DataSourceResource, + TypeName: "aws_cloudcontrolapi_resource", + }, } } -func (p *servicePackage) SDKResources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{ - "aws_cloudcontrolapi_resource": ResourceResource, +func (p *servicePackage) SDKResources(ctx context.Context) []*types.ServicePackageSDKResource { + return []*types.ServicePackageSDKResource{ + { + Factory: ResourceResource, + TypeName: "aws_cloudcontrolapi_resource", + }, } } diff --git a/internal/service/cloudformation/service_package_gen.go b/internal/service/cloudformation/service_package_gen.go index 21b7028b76f6..f0d7faeaf5a5 100644 --- a/internal/service/cloudformation/service_package_gen.go +++ b/internal/service/cloudformation/service_package_gen.go @@ -5,36 +5,55 @@ package cloudformation import ( "context" - "github.com/hashicorp/terraform-plugin-framework/datasource" - "github.com/hashicorp/terraform-plugin-framework/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "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) []func(context.Context) (datasource.DataSourceWithConfigure, error) { - return []func(context.Context) (datasource.DataSourceWithConfigure, error){} +func (p *servicePackage) FrameworkDataSources(ctx context.Context) []*types.ServicePackageFrameworkDataSource { + return []*types.ServicePackageFrameworkDataSource{} } -func (p *servicePackage) FrameworkResources(ctx context.Context) []func(context.Context) (resource.ResourceWithConfigure, error) { - return []func(context.Context) (resource.ResourceWithConfigure, error){} +func (p *servicePackage) FrameworkResources(ctx context.Context) []*types.ServicePackageFrameworkResource { + return []*types.ServicePackageFrameworkResource{} } -func (p *servicePackage) SDKDataSources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{ - "aws_cloudformation_export": DataSourceExport, - "aws_cloudformation_stack": DataSourceStack, - "aws_cloudformation_type": DataSourceType, +func (p *servicePackage) SDKDataSources(ctx context.Context) []*types.ServicePackageSDKDataSource { + return []*types.ServicePackageSDKDataSource{ + { + Factory: DataSourceExport, + TypeName: "aws_cloudformation_export", + }, + { + Factory: DataSourceStack, + TypeName: "aws_cloudformation_stack", + }, + { + Factory: DataSourceType, + TypeName: "aws_cloudformation_type", + }, } } -func (p *servicePackage) SDKResources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{ - "aws_cloudformation_stack": ResourceStack, - "aws_cloudformation_stack_set": ResourceStackSet, - "aws_cloudformation_stack_set_instance": ResourceStackSetInstance, - "aws_cloudformation_type": ResourceType, +func (p *servicePackage) SDKResources(ctx context.Context) []*types.ServicePackageSDKResource { + return []*types.ServicePackageSDKResource{ + { + Factory: ResourceStack, + TypeName: "aws_cloudformation_stack", + }, + { + Factory: ResourceStackSet, + TypeName: "aws_cloudformation_stack_set", + }, + { + Factory: ResourceStackSetInstance, + TypeName: "aws_cloudformation_stack_set_instance", + }, + { + Factory: ResourceType, + TypeName: "aws_cloudformation_type", + }, } } diff --git a/internal/service/cloudfront/service_package_gen.go b/internal/service/cloudfront/service_package_gen.go index 542532f02132..e7d314da8d1c 100644 --- a/internal/service/cloudfront/service_package_gen.go +++ b/internal/service/cloudfront/service_package_gen.go @@ -5,51 +5,115 @@ package cloudfront import ( "context" - "github.com/hashicorp/terraform-plugin-framework/datasource" - "github.com/hashicorp/terraform-plugin-framework/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "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) []func(context.Context) (datasource.DataSourceWithConfigure, error) { - return []func(context.Context) (datasource.DataSourceWithConfigure, error){} +func (p *servicePackage) FrameworkDataSources(ctx context.Context) []*types.ServicePackageFrameworkDataSource { + return []*types.ServicePackageFrameworkDataSource{} } -func (p *servicePackage) FrameworkResources(ctx context.Context) []func(context.Context) (resource.ResourceWithConfigure, error) { - return []func(context.Context) (resource.ResourceWithConfigure, error){} +func (p *servicePackage) FrameworkResources(ctx context.Context) []*types.ServicePackageFrameworkResource { + return []*types.ServicePackageFrameworkResource{} } -func (p *servicePackage) SDKDataSources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{ - "aws_cloudfront_cache_policy": DataSourceCachePolicy, - "aws_cloudfront_distribution": DataSourceDistribution, - "aws_cloudfront_function": DataSourceFunction, - "aws_cloudfront_log_delivery_canonical_user_id": DataSourceLogDeliveryCanonicalUserID, - "aws_cloudfront_origin_access_identities": DataSourceOriginAccessIdentities, - "aws_cloudfront_origin_access_identity": DataSourceOriginAccessIdentity, - "aws_cloudfront_origin_request_policy": DataSourceOriginRequestPolicy, - "aws_cloudfront_realtime_log_config": DataSourceRealtimeLogConfig, - "aws_cloudfront_response_headers_policy": DataSourceResponseHeadersPolicy, +func (p *servicePackage) SDKDataSources(ctx context.Context) []*types.ServicePackageSDKDataSource { + return []*types.ServicePackageSDKDataSource{ + { + Factory: DataSourceCachePolicy, + TypeName: "aws_cloudfront_cache_policy", + }, + { + Factory: DataSourceDistribution, + TypeName: "aws_cloudfront_distribution", + }, + { + Factory: DataSourceFunction, + TypeName: "aws_cloudfront_function", + }, + { + Factory: DataSourceLogDeliveryCanonicalUserID, + TypeName: "aws_cloudfront_log_delivery_canonical_user_id", + }, + { + Factory: DataSourceOriginAccessIdentities, + TypeName: "aws_cloudfront_origin_access_identities", + }, + { + Factory: DataSourceOriginAccessIdentity, + TypeName: "aws_cloudfront_origin_access_identity", + }, + { + Factory: DataSourceOriginRequestPolicy, + TypeName: "aws_cloudfront_origin_request_policy", + }, + { + Factory: DataSourceRealtimeLogConfig, + TypeName: "aws_cloudfront_realtime_log_config", + }, + { + Factory: DataSourceResponseHeadersPolicy, + TypeName: "aws_cloudfront_response_headers_policy", + }, } } -func (p *servicePackage) SDKResources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{ - "aws_cloudfront_cache_policy": ResourceCachePolicy, - "aws_cloudfront_distribution": ResourceDistribution, - "aws_cloudfront_field_level_encryption_config": ResourceFieldLevelEncryptionConfig, - "aws_cloudfront_field_level_encryption_profile": ResourceFieldLevelEncryptionProfile, - "aws_cloudfront_function": ResourceFunction, - "aws_cloudfront_key_group": ResourceKeyGroup, - "aws_cloudfront_monitoring_subscription": ResourceMonitoringSubscription, - "aws_cloudfront_origin_access_control": ResourceOriginAccessControl, - "aws_cloudfront_origin_access_identity": ResourceOriginAccessIdentity, - "aws_cloudfront_origin_request_policy": ResourceOriginRequestPolicy, - "aws_cloudfront_public_key": ResourcePublicKey, - "aws_cloudfront_realtime_log_config": ResourceRealtimeLogConfig, - "aws_cloudfront_response_headers_policy": ResourceResponseHeadersPolicy, +func (p *servicePackage) SDKResources(ctx context.Context) []*types.ServicePackageSDKResource { + return []*types.ServicePackageSDKResource{ + { + Factory: ResourceCachePolicy, + TypeName: "aws_cloudfront_cache_policy", + }, + { + Factory: ResourceDistribution, + TypeName: "aws_cloudfront_distribution", + }, + { + Factory: ResourceFieldLevelEncryptionConfig, + TypeName: "aws_cloudfront_field_level_encryption_config", + }, + { + Factory: ResourceFieldLevelEncryptionProfile, + TypeName: "aws_cloudfront_field_level_encryption_profile", + }, + { + Factory: ResourceFunction, + TypeName: "aws_cloudfront_function", + }, + { + Factory: ResourceKeyGroup, + TypeName: "aws_cloudfront_key_group", + }, + { + Factory: ResourceMonitoringSubscription, + TypeName: "aws_cloudfront_monitoring_subscription", + }, + { + Factory: ResourceOriginAccessControl, + TypeName: "aws_cloudfront_origin_access_control", + }, + { + Factory: ResourceOriginAccessIdentity, + TypeName: "aws_cloudfront_origin_access_identity", + }, + { + Factory: ResourceOriginRequestPolicy, + TypeName: "aws_cloudfront_origin_request_policy", + }, + { + Factory: ResourcePublicKey, + TypeName: "aws_cloudfront_public_key", + }, + { + Factory: ResourceRealtimeLogConfig, + TypeName: "aws_cloudfront_realtime_log_config", + }, + { + Factory: ResourceResponseHeadersPolicy, + TypeName: "aws_cloudfront_response_headers_policy", + }, } } diff --git a/internal/service/cloudhsmv2/service_package_gen.go b/internal/service/cloudhsmv2/service_package_gen.go index ce2f8f1c20bc..5cc2c160cddc 100644 --- a/internal/service/cloudhsmv2/service_package_gen.go +++ b/internal/service/cloudhsmv2/service_package_gen.go @@ -5,32 +5,39 @@ package cloudhsmv2 import ( "context" - "github.com/hashicorp/terraform-plugin-framework/datasource" - "github.com/hashicorp/terraform-plugin-framework/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "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) []func(context.Context) (datasource.DataSourceWithConfigure, error) { - return []func(context.Context) (datasource.DataSourceWithConfigure, error){} +func (p *servicePackage) FrameworkDataSources(ctx context.Context) []*types.ServicePackageFrameworkDataSource { + return []*types.ServicePackageFrameworkDataSource{} } -func (p *servicePackage) FrameworkResources(ctx context.Context) []func(context.Context) (resource.ResourceWithConfigure, error) { - return []func(context.Context) (resource.ResourceWithConfigure, error){} +func (p *servicePackage) FrameworkResources(ctx context.Context) []*types.ServicePackageFrameworkResource { + return []*types.ServicePackageFrameworkResource{} } -func (p *servicePackage) SDKDataSources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{ - "aws_cloudhsm_v2_cluster": DataSourceCluster, +func (p *servicePackage) SDKDataSources(ctx context.Context) []*types.ServicePackageSDKDataSource { + return []*types.ServicePackageSDKDataSource{ + { + Factory: DataSourceCluster, + TypeName: "aws_cloudhsm_v2_cluster", + }, } } -func (p *servicePackage) SDKResources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{ - "aws_cloudhsm_v2_cluster": ResourceCluster, - "aws_cloudhsm_v2_hsm": ResourceHSM, +func (p *servicePackage) SDKResources(ctx context.Context) []*types.ServicePackageSDKResource { + return []*types.ServicePackageSDKResource{ + { + Factory: ResourceCluster, + TypeName: "aws_cloudhsm_v2_cluster", + }, + { + Factory: ResourceHSM, + TypeName: "aws_cloudhsm_v2_hsm", + }, } } diff --git a/internal/service/cloudsearch/service_package_gen.go b/internal/service/cloudsearch/service_package_gen.go index ac61ce33bd7f..3f08f502c515 100644 --- a/internal/service/cloudsearch/service_package_gen.go +++ b/internal/service/cloudsearch/service_package_gen.go @@ -5,30 +5,34 @@ package cloudsearch import ( "context" - "github.com/hashicorp/terraform-plugin-framework/datasource" - "github.com/hashicorp/terraform-plugin-framework/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "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) []func(context.Context) (datasource.DataSourceWithConfigure, error) { - return []func(context.Context) (datasource.DataSourceWithConfigure, error){} +func (p *servicePackage) FrameworkDataSources(ctx context.Context) []*types.ServicePackageFrameworkDataSource { + return []*types.ServicePackageFrameworkDataSource{} } -func (p *servicePackage) FrameworkResources(ctx context.Context) []func(context.Context) (resource.ResourceWithConfigure, error) { - return []func(context.Context) (resource.ResourceWithConfigure, error){} +func (p *servicePackage) FrameworkResources(ctx context.Context) []*types.ServicePackageFrameworkResource { + return []*types.ServicePackageFrameworkResource{} } -func (p *servicePackage) SDKDataSources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{} +func (p *servicePackage) SDKDataSources(ctx context.Context) []*types.ServicePackageSDKDataSource { + return []*types.ServicePackageSDKDataSource{} } -func (p *servicePackage) SDKResources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{ - "aws_cloudsearch_domain": ResourceDomain, - "aws_cloudsearch_domain_service_access_policy": ResourceDomainServiceAccessPolicy, +func (p *servicePackage) SDKResources(ctx context.Context) []*types.ServicePackageSDKResource { + return []*types.ServicePackageSDKResource{ + { + Factory: ResourceDomain, + TypeName: "aws_cloudsearch_domain", + }, + { + Factory: ResourceDomainServiceAccessPolicy, + TypeName: "aws_cloudsearch_domain_service_access_policy", + }, } } diff --git a/internal/service/cloudtrail/service_package_gen.go b/internal/service/cloudtrail/service_package_gen.go index e4e31e63f773..6f59ae35cb4c 100644 --- a/internal/service/cloudtrail/service_package_gen.go +++ b/internal/service/cloudtrail/service_package_gen.go @@ -5,32 +5,39 @@ package cloudtrail import ( "context" - "github.com/hashicorp/terraform-plugin-framework/datasource" - "github.com/hashicorp/terraform-plugin-framework/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "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) []func(context.Context) (datasource.DataSourceWithConfigure, error) { - return []func(context.Context) (datasource.DataSourceWithConfigure, error){} +func (p *servicePackage) FrameworkDataSources(ctx context.Context) []*types.ServicePackageFrameworkDataSource { + return []*types.ServicePackageFrameworkDataSource{} } -func (p *servicePackage) FrameworkResources(ctx context.Context) []func(context.Context) (resource.ResourceWithConfigure, error) { - return []func(context.Context) (resource.ResourceWithConfigure, error){} +func (p *servicePackage) FrameworkResources(ctx context.Context) []*types.ServicePackageFrameworkResource { + return []*types.ServicePackageFrameworkResource{} } -func (p *servicePackage) SDKDataSources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{ - "aws_cloudtrail_service_account": DataSourceServiceAccount, +func (p *servicePackage) SDKDataSources(ctx context.Context) []*types.ServicePackageSDKDataSource { + return []*types.ServicePackageSDKDataSource{ + { + Factory: DataSourceServiceAccount, + TypeName: "aws_cloudtrail_service_account", + }, } } -func (p *servicePackage) SDKResources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{ - "aws_cloudtrail": ResourceCloudTrail, - "aws_cloudtrail_event_data_store": ResourceEventDataStore, +func (p *servicePackage) SDKResources(ctx context.Context) []*types.ServicePackageSDKResource { + return []*types.ServicePackageSDKResource{ + { + Factory: ResourceCloudTrail, + TypeName: "aws_cloudtrail", + }, + { + Factory: ResourceEventDataStore, + TypeName: "aws_cloudtrail_event_data_store", + }, } } diff --git a/internal/service/cloudwatch/service_package_gen.go b/internal/service/cloudwatch/service_package_gen.go index 8a6196ab623c..d353b1110d15 100644 --- a/internal/service/cloudwatch/service_package_gen.go +++ b/internal/service/cloudwatch/service_package_gen.go @@ -5,32 +5,42 @@ package cloudwatch import ( "context" - "github.com/hashicorp/terraform-plugin-framework/datasource" - "github.com/hashicorp/terraform-plugin-framework/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "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) []func(context.Context) (datasource.DataSourceWithConfigure, error) { - return []func(context.Context) (datasource.DataSourceWithConfigure, error){} +func (p *servicePackage) FrameworkDataSources(ctx context.Context) []*types.ServicePackageFrameworkDataSource { + return []*types.ServicePackageFrameworkDataSource{} } -func (p *servicePackage) FrameworkResources(ctx context.Context) []func(context.Context) (resource.ResourceWithConfigure, error) { - return []func(context.Context) (resource.ResourceWithConfigure, error){} +func (p *servicePackage) FrameworkResources(ctx context.Context) []*types.ServicePackageFrameworkResource { + return []*types.ServicePackageFrameworkResource{} } -func (p *servicePackage) SDKDataSources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{} +func (p *servicePackage) SDKDataSources(ctx context.Context) []*types.ServicePackageSDKDataSource { + return []*types.ServicePackageSDKDataSource{} } -func (p *servicePackage) SDKResources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{ - "aws_cloudwatch_composite_alarm": ResourceCompositeAlarm, - "aws_cloudwatch_dashboard": ResourceDashboard, - "aws_cloudwatch_metric_alarm": ResourceMetricAlarm, - "aws_cloudwatch_metric_stream": ResourceMetricStream, +func (p *servicePackage) SDKResources(ctx context.Context) []*types.ServicePackageSDKResource { + return []*types.ServicePackageSDKResource{ + { + Factory: ResourceCompositeAlarm, + TypeName: "aws_cloudwatch_composite_alarm", + }, + { + Factory: ResourceDashboard, + TypeName: "aws_cloudwatch_dashboard", + }, + { + Factory: ResourceMetricAlarm, + TypeName: "aws_cloudwatch_metric_alarm", + }, + { + Factory: ResourceMetricStream, + TypeName: "aws_cloudwatch_metric_stream", + }, } } diff --git a/internal/service/codeartifact/service_package_gen.go b/internal/service/codeartifact/service_package_gen.go index 561cbb907adf..3900f078f991 100644 --- a/internal/service/codeartifact/service_package_gen.go +++ b/internal/service/codeartifact/service_package_gen.go @@ -5,35 +5,51 @@ package codeartifact import ( "context" - "github.com/hashicorp/terraform-plugin-framework/datasource" - "github.com/hashicorp/terraform-plugin-framework/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "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) []func(context.Context) (datasource.DataSourceWithConfigure, error) { - return []func(context.Context) (datasource.DataSourceWithConfigure, error){} +func (p *servicePackage) FrameworkDataSources(ctx context.Context) []*types.ServicePackageFrameworkDataSource { + return []*types.ServicePackageFrameworkDataSource{} } -func (p *servicePackage) FrameworkResources(ctx context.Context) []func(context.Context) (resource.ResourceWithConfigure, error) { - return []func(context.Context) (resource.ResourceWithConfigure, error){} +func (p *servicePackage) FrameworkResources(ctx context.Context) []*types.ServicePackageFrameworkResource { + return []*types.ServicePackageFrameworkResource{} } -func (p *servicePackage) SDKDataSources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{ - "aws_codeartifact_authorization_token": DataSourceAuthorizationToken, - "aws_codeartifact_repository_endpoint": DataSourceRepositoryEndpoint, +func (p *servicePackage) SDKDataSources(ctx context.Context) []*types.ServicePackageSDKDataSource { + return []*types.ServicePackageSDKDataSource{ + { + Factory: DataSourceAuthorizationToken, + TypeName: "aws_codeartifact_authorization_token", + }, + { + Factory: DataSourceRepositoryEndpoint, + TypeName: "aws_codeartifact_repository_endpoint", + }, } } -func (p *servicePackage) SDKResources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{ - "aws_codeartifact_domain": ResourceDomain, - "aws_codeartifact_domain_permissions_policy": ResourceDomainPermissionsPolicy, - "aws_codeartifact_repository": ResourceRepository, - "aws_codeartifact_repository_permissions_policy": ResourceRepositoryPermissionsPolicy, +func (p *servicePackage) SDKResources(ctx context.Context) []*types.ServicePackageSDKResource { + return []*types.ServicePackageSDKResource{ + { + Factory: ResourceDomain, + TypeName: "aws_codeartifact_domain", + }, + { + Factory: ResourceDomainPermissionsPolicy, + TypeName: "aws_codeartifact_domain_permissions_policy", + }, + { + Factory: ResourceRepository, + TypeName: "aws_codeartifact_repository", + }, + { + Factory: ResourceRepositoryPermissionsPolicy, + TypeName: "aws_codeartifact_repository_permissions_policy", + }, } } diff --git a/internal/service/codebuild/service_package_gen.go b/internal/service/codebuild/service_package_gen.go index 69b86d1aa69d..7953ea86f15f 100644 --- a/internal/service/codebuild/service_package_gen.go +++ b/internal/service/codebuild/service_package_gen.go @@ -5,33 +5,46 @@ package codebuild import ( "context" - "github.com/hashicorp/terraform-plugin-framework/datasource" - "github.com/hashicorp/terraform-plugin-framework/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "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) []func(context.Context) (datasource.DataSourceWithConfigure, error) { - return []func(context.Context) (datasource.DataSourceWithConfigure, error){} +func (p *servicePackage) FrameworkDataSources(ctx context.Context) []*types.ServicePackageFrameworkDataSource { + return []*types.ServicePackageFrameworkDataSource{} } -func (p *servicePackage) FrameworkResources(ctx context.Context) []func(context.Context) (resource.ResourceWithConfigure, error) { - return []func(context.Context) (resource.ResourceWithConfigure, error){} +func (p *servicePackage) FrameworkResources(ctx context.Context) []*types.ServicePackageFrameworkResource { + return []*types.ServicePackageFrameworkResource{} } -func (p *servicePackage) SDKDataSources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{} +func (p *servicePackage) SDKDataSources(ctx context.Context) []*types.ServicePackageSDKDataSource { + return []*types.ServicePackageSDKDataSource{} } -func (p *servicePackage) SDKResources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{ - "aws_codebuild_project": ResourceProject, - "aws_codebuild_report_group": ResourceReportGroup, - "aws_codebuild_resource_policy": ResourceResourcePolicy, - "aws_codebuild_source_credential": ResourceSourceCredential, - "aws_codebuild_webhook": ResourceWebhook, +func (p *servicePackage) SDKResources(ctx context.Context) []*types.ServicePackageSDKResource { + return []*types.ServicePackageSDKResource{ + { + Factory: ResourceProject, + TypeName: "aws_codebuild_project", + }, + { + Factory: ResourceReportGroup, + TypeName: "aws_codebuild_report_group", + }, + { + Factory: ResourceResourcePolicy, + TypeName: "aws_codebuild_resource_policy", + }, + { + Factory: ResourceSourceCredential, + TypeName: "aws_codebuild_source_credential", + }, + { + Factory: ResourceWebhook, + TypeName: "aws_codebuild_webhook", + }, } } diff --git a/internal/service/codecommit/service_package_gen.go b/internal/service/codecommit/service_package_gen.go index 781c4de9be11..d783634cc374 100644 --- a/internal/service/codecommit/service_package_gen.go +++ b/internal/service/codecommit/service_package_gen.go @@ -5,35 +5,51 @@ package codecommit import ( "context" - "github.com/hashicorp/terraform-plugin-framework/datasource" - "github.com/hashicorp/terraform-plugin-framework/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "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) []func(context.Context) (datasource.DataSourceWithConfigure, error) { - return []func(context.Context) (datasource.DataSourceWithConfigure, error){} +func (p *servicePackage) FrameworkDataSources(ctx context.Context) []*types.ServicePackageFrameworkDataSource { + return []*types.ServicePackageFrameworkDataSource{} } -func (p *servicePackage) FrameworkResources(ctx context.Context) []func(context.Context) (resource.ResourceWithConfigure, error) { - return []func(context.Context) (resource.ResourceWithConfigure, error){} +func (p *servicePackage) FrameworkResources(ctx context.Context) []*types.ServicePackageFrameworkResource { + return []*types.ServicePackageFrameworkResource{} } -func (p *servicePackage) SDKDataSources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{ - "aws_codecommit_approval_rule_template": DataSourceApprovalRuleTemplate, - "aws_codecommit_repository": DataSourceRepository, +func (p *servicePackage) SDKDataSources(ctx context.Context) []*types.ServicePackageSDKDataSource { + return []*types.ServicePackageSDKDataSource{ + { + Factory: DataSourceApprovalRuleTemplate, + TypeName: "aws_codecommit_approval_rule_template", + }, + { + Factory: DataSourceRepository, + TypeName: "aws_codecommit_repository", + }, } } -func (p *servicePackage) SDKResources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{ - "aws_codecommit_approval_rule_template": ResourceApprovalRuleTemplate, - "aws_codecommit_approval_rule_template_association": ResourceApprovalRuleTemplateAssociation, - "aws_codecommit_repository": ResourceRepository, - "aws_codecommit_trigger": ResourceTrigger, +func (p *servicePackage) SDKResources(ctx context.Context) []*types.ServicePackageSDKResource { + return []*types.ServicePackageSDKResource{ + { + Factory: ResourceApprovalRuleTemplate, + TypeName: "aws_codecommit_approval_rule_template", + }, + { + Factory: ResourceApprovalRuleTemplateAssociation, + TypeName: "aws_codecommit_approval_rule_template_association", + }, + { + Factory: ResourceRepository, + TypeName: "aws_codecommit_repository", + }, + { + Factory: ResourceTrigger, + TypeName: "aws_codecommit_trigger", + }, } } diff --git a/internal/service/codepipeline/service_package_gen.go b/internal/service/codepipeline/service_package_gen.go index 6c5d3a3ad082..e67267b5d340 100644 --- a/internal/service/codepipeline/service_package_gen.go +++ b/internal/service/codepipeline/service_package_gen.go @@ -5,31 +5,38 @@ package codepipeline import ( "context" - "github.com/hashicorp/terraform-plugin-framework/datasource" - "github.com/hashicorp/terraform-plugin-framework/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "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) []func(context.Context) (datasource.DataSourceWithConfigure, error) { - return []func(context.Context) (datasource.DataSourceWithConfigure, error){} +func (p *servicePackage) FrameworkDataSources(ctx context.Context) []*types.ServicePackageFrameworkDataSource { + return []*types.ServicePackageFrameworkDataSource{} } -func (p *servicePackage) FrameworkResources(ctx context.Context) []func(context.Context) (resource.ResourceWithConfigure, error) { - return []func(context.Context) (resource.ResourceWithConfigure, error){} +func (p *servicePackage) FrameworkResources(ctx context.Context) []*types.ServicePackageFrameworkResource { + return []*types.ServicePackageFrameworkResource{} } -func (p *servicePackage) SDKDataSources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{} +func (p *servicePackage) SDKDataSources(ctx context.Context) []*types.ServicePackageSDKDataSource { + return []*types.ServicePackageSDKDataSource{} } -func (p *servicePackage) SDKResources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{ - "aws_codepipeline": ResourcePipeline, - "aws_codepipeline_custom_action_type": ResourceCustomActionType, - "aws_codepipeline_webhook": ResourceWebhook, +func (p *servicePackage) SDKResources(ctx context.Context) []*types.ServicePackageSDKResource { + return []*types.ServicePackageSDKResource{ + { + Factory: ResourcePipeline, + TypeName: "aws_codepipeline", + }, + { + Factory: ResourceCustomActionType, + TypeName: "aws_codepipeline_custom_action_type", + }, + { + Factory: ResourceWebhook, + TypeName: "aws_codepipeline_webhook", + }, } } diff --git a/internal/service/codestarconnections/service_package_gen.go b/internal/service/codestarconnections/service_package_gen.go index a8b1e6fb7be4..f4b452e8c9ba 100644 --- a/internal/service/codestarconnections/service_package_gen.go +++ b/internal/service/codestarconnections/service_package_gen.go @@ -5,32 +5,39 @@ package codestarconnections import ( "context" - "github.com/hashicorp/terraform-plugin-framework/datasource" - "github.com/hashicorp/terraform-plugin-framework/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "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) []func(context.Context) (datasource.DataSourceWithConfigure, error) { - return []func(context.Context) (datasource.DataSourceWithConfigure, error){} +func (p *servicePackage) FrameworkDataSources(ctx context.Context) []*types.ServicePackageFrameworkDataSource { + return []*types.ServicePackageFrameworkDataSource{} } -func (p *servicePackage) FrameworkResources(ctx context.Context) []func(context.Context) (resource.ResourceWithConfigure, error) { - return []func(context.Context) (resource.ResourceWithConfigure, error){} +func (p *servicePackage) FrameworkResources(ctx context.Context) []*types.ServicePackageFrameworkResource { + return []*types.ServicePackageFrameworkResource{} } -func (p *servicePackage) SDKDataSources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{ - "aws_codestarconnections_connection": DataSourceConnection, +func (p *servicePackage) SDKDataSources(ctx context.Context) []*types.ServicePackageSDKDataSource { + return []*types.ServicePackageSDKDataSource{ + { + Factory: DataSourceConnection, + TypeName: "aws_codestarconnections_connection", + }, } } -func (p *servicePackage) SDKResources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{ - "aws_codestarconnections_connection": ResourceConnection, - "aws_codestarconnections_host": ResourceHost, +func (p *servicePackage) SDKResources(ctx context.Context) []*types.ServicePackageSDKResource { + return []*types.ServicePackageSDKResource{ + { + Factory: ResourceConnection, + TypeName: "aws_codestarconnections_connection", + }, + { + Factory: ResourceHost, + TypeName: "aws_codestarconnections_host", + }, } } diff --git a/internal/service/codestarnotifications/service_package_gen.go b/internal/service/codestarnotifications/service_package_gen.go index f5c4dcbaf7d8..bec503c99b20 100644 --- a/internal/service/codestarnotifications/service_package_gen.go +++ b/internal/service/codestarnotifications/service_package_gen.go @@ -5,29 +5,30 @@ package codestarnotifications import ( "context" - "github.com/hashicorp/terraform-plugin-framework/datasource" - "github.com/hashicorp/terraform-plugin-framework/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "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) []func(context.Context) (datasource.DataSourceWithConfigure, error) { - return []func(context.Context) (datasource.DataSourceWithConfigure, error){} +func (p *servicePackage) FrameworkDataSources(ctx context.Context) []*types.ServicePackageFrameworkDataSource { + return []*types.ServicePackageFrameworkDataSource{} } -func (p *servicePackage) FrameworkResources(ctx context.Context) []func(context.Context) (resource.ResourceWithConfigure, error) { - return []func(context.Context) (resource.ResourceWithConfigure, error){} +func (p *servicePackage) FrameworkResources(ctx context.Context) []*types.ServicePackageFrameworkResource { + return []*types.ServicePackageFrameworkResource{} } -func (p *servicePackage) SDKDataSources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{} +func (p *servicePackage) SDKDataSources(ctx context.Context) []*types.ServicePackageSDKDataSource { + return []*types.ServicePackageSDKDataSource{} } -func (p *servicePackage) SDKResources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{ - "aws_codestarnotifications_notification_rule": ResourceNotificationRule, +func (p *servicePackage) SDKResources(ctx context.Context) []*types.ServicePackageSDKResource { + return []*types.ServicePackageSDKResource{ + { + Factory: ResourceNotificationRule, + TypeName: "aws_codestarnotifications_notification_rule", + }, } } diff --git a/internal/service/cognitoidentity/service_package_gen.go b/internal/service/cognitoidentity/service_package_gen.go index dd35acaa94f1..b9e05fd12558 100644 --- a/internal/service/cognitoidentity/service_package_gen.go +++ b/internal/service/cognitoidentity/service_package_gen.go @@ -5,31 +5,38 @@ package cognitoidentity import ( "context" - "github.com/hashicorp/terraform-plugin-framework/datasource" - "github.com/hashicorp/terraform-plugin-framework/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "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) []func(context.Context) (datasource.DataSourceWithConfigure, error) { - return []func(context.Context) (datasource.DataSourceWithConfigure, error){} +func (p *servicePackage) FrameworkDataSources(ctx context.Context) []*types.ServicePackageFrameworkDataSource { + return []*types.ServicePackageFrameworkDataSource{} } -func (p *servicePackage) FrameworkResources(ctx context.Context) []func(context.Context) (resource.ResourceWithConfigure, error) { - return []func(context.Context) (resource.ResourceWithConfigure, error){} +func (p *servicePackage) FrameworkResources(ctx context.Context) []*types.ServicePackageFrameworkResource { + return []*types.ServicePackageFrameworkResource{} } -func (p *servicePackage) SDKDataSources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{} +func (p *servicePackage) SDKDataSources(ctx context.Context) []*types.ServicePackageSDKDataSource { + return []*types.ServicePackageSDKDataSource{} } -func (p *servicePackage) SDKResources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{ - "aws_cognito_identity_pool": ResourcePool, - "aws_cognito_identity_pool_provider_principal_tag": ResourcePoolProviderPrincipalTag, - "aws_cognito_identity_pool_roles_attachment": ResourcePoolRolesAttachment, +func (p *servicePackage) SDKResources(ctx context.Context) []*types.ServicePackageSDKResource { + return []*types.ServicePackageSDKResource{ + { + Factory: ResourcePool, + TypeName: "aws_cognito_identity_pool", + }, + { + Factory: ResourcePoolProviderPrincipalTag, + TypeName: "aws_cognito_identity_pool_provider_principal_tag", + }, + { + Factory: ResourcePoolRolesAttachment, + TypeName: "aws_cognito_identity_pool_roles_attachment", + }, } } diff --git a/internal/service/cognitoidp/service_package_gen.go b/internal/service/cognitoidp/service_package_gen.go index 3d8c2d418d2f..5674bb3ea964 100644 --- a/internal/service/cognitoidp/service_package_gen.go +++ b/internal/service/cognitoidp/service_package_gen.go @@ -5,43 +5,83 @@ package cognitoidp import ( "context" - "github.com/hashicorp/terraform-plugin-framework/datasource" - "github.com/hashicorp/terraform-plugin-framework/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "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) []func(context.Context) (datasource.DataSourceWithConfigure, error) { - return []func(context.Context) (datasource.DataSourceWithConfigure, error){} +func (p *servicePackage) FrameworkDataSources(ctx context.Context) []*types.ServicePackageFrameworkDataSource { + return []*types.ServicePackageFrameworkDataSource{} } -func (p *servicePackage) FrameworkResources(ctx context.Context) []func(context.Context) (resource.ResourceWithConfigure, error) { - return []func(context.Context) (resource.ResourceWithConfigure, error){} +func (p *servicePackage) FrameworkResources(ctx context.Context) []*types.ServicePackageFrameworkResource { + return []*types.ServicePackageFrameworkResource{} } -func (p *servicePackage) SDKDataSources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{ - "aws_cognito_user_pool_client": DataSourceUserPoolClient, - "aws_cognito_user_pool_clients": DataSourceUserPoolClients, - "aws_cognito_user_pool_signing_certificate": DataSourceUserPoolSigningCertificate, - "aws_cognito_user_pools": DataSourceUserPools, +func (p *servicePackage) SDKDataSources(ctx context.Context) []*types.ServicePackageSDKDataSource { + return []*types.ServicePackageSDKDataSource{ + { + Factory: DataSourceUserPoolClient, + TypeName: "aws_cognito_user_pool_client", + }, + { + Factory: DataSourceUserPoolClients, + TypeName: "aws_cognito_user_pool_clients", + }, + { + Factory: DataSourceUserPoolSigningCertificate, + TypeName: "aws_cognito_user_pool_signing_certificate", + }, + { + Factory: DataSourceUserPools, + TypeName: "aws_cognito_user_pools", + }, } } -func (p *servicePackage) SDKResources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{ - "aws_cognito_identity_provider": ResourceIdentityProvider, - "aws_cognito_resource_server": ResourceResourceServer, - "aws_cognito_risk_configuration": ResourceRiskConfiguration, - "aws_cognito_user": ResourceUser, - "aws_cognito_user_group": ResourceUserGroup, - "aws_cognito_user_in_group": ResourceUserInGroup, - "aws_cognito_user_pool": ResourceUserPool, - "aws_cognito_user_pool_client": ResourceUserPoolClient, - "aws_cognito_user_pool_domain": ResourceUserPoolDomain, - "aws_cognito_user_pool_ui_customization": ResourceUserPoolUICustomization, +func (p *servicePackage) SDKResources(ctx context.Context) []*types.ServicePackageSDKResource { + return []*types.ServicePackageSDKResource{ + { + Factory: ResourceIdentityProvider, + TypeName: "aws_cognito_identity_provider", + }, + { + Factory: ResourceResourceServer, + TypeName: "aws_cognito_resource_server", + }, + { + Factory: ResourceRiskConfiguration, + TypeName: "aws_cognito_risk_configuration", + }, + { + Factory: ResourceUser, + TypeName: "aws_cognito_user", + }, + { + Factory: ResourceUserGroup, + TypeName: "aws_cognito_user_group", + }, + { + Factory: ResourceUserInGroup, + TypeName: "aws_cognito_user_in_group", + }, + { + Factory: ResourceUserPool, + TypeName: "aws_cognito_user_pool", + }, + { + Factory: ResourceUserPoolClient, + TypeName: "aws_cognito_user_pool_client", + }, + { + Factory: ResourceUserPoolDomain, + TypeName: "aws_cognito_user_pool_domain", + }, + { + Factory: ResourceUserPoolUICustomization, + TypeName: "aws_cognito_user_pool_ui_customization", + }, } } diff --git a/internal/service/comprehend/service_package_gen.go b/internal/service/comprehend/service_package_gen.go index bf3f68a330f0..733d67a50bda 100644 --- a/internal/service/comprehend/service_package_gen.go +++ b/internal/service/comprehend/service_package_gen.go @@ -5,30 +5,34 @@ package comprehend import ( "context" - "github.com/hashicorp/terraform-plugin-framework/datasource" - "github.com/hashicorp/terraform-plugin-framework/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "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) []func(context.Context) (datasource.DataSourceWithConfigure, error) { - return []func(context.Context) (datasource.DataSourceWithConfigure, error){} +func (p *servicePackage) FrameworkDataSources(ctx context.Context) []*types.ServicePackageFrameworkDataSource { + return []*types.ServicePackageFrameworkDataSource{} } -func (p *servicePackage) FrameworkResources(ctx context.Context) []func(context.Context) (resource.ResourceWithConfigure, error) { - return []func(context.Context) (resource.ResourceWithConfigure, error){} +func (p *servicePackage) FrameworkResources(ctx context.Context) []*types.ServicePackageFrameworkResource { + return []*types.ServicePackageFrameworkResource{} } -func (p *servicePackage) SDKDataSources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{} +func (p *servicePackage) SDKDataSources(ctx context.Context) []*types.ServicePackageSDKDataSource { + return []*types.ServicePackageSDKDataSource{} } -func (p *servicePackage) SDKResources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{ - "aws_comprehend_document_classifier": ResourceDocumentClassifier, - "aws_comprehend_entity_recognizer": ResourceEntityRecognizer, +func (p *servicePackage) SDKResources(ctx context.Context) []*types.ServicePackageSDKResource { + return []*types.ServicePackageSDKResource{ + { + Factory: ResourceDocumentClassifier, + TypeName: "aws_comprehend_document_classifier", + }, + { + Factory: ResourceEntityRecognizer, + TypeName: "aws_comprehend_entity_recognizer", + }, } } diff --git a/internal/service/computeoptimizer/service_package_gen.go b/internal/service/computeoptimizer/service_package_gen.go index 41f840ad3934..c3eca435750e 100644 --- a/internal/service/computeoptimizer/service_package_gen.go +++ b/internal/service/computeoptimizer/service_package_gen.go @@ -5,28 +5,26 @@ package computeoptimizer import ( "context" - "github.com/hashicorp/terraform-plugin-framework/datasource" - "github.com/hashicorp/terraform-plugin-framework/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "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) []func(context.Context) (datasource.DataSourceWithConfigure, error) { - return []func(context.Context) (datasource.DataSourceWithConfigure, error){} +func (p *servicePackage) FrameworkDataSources(ctx context.Context) []*types.ServicePackageFrameworkDataSource { + return []*types.ServicePackageFrameworkDataSource{} } -func (p *servicePackage) FrameworkResources(ctx context.Context) []func(context.Context) (resource.ResourceWithConfigure, error) { - return []func(context.Context) (resource.ResourceWithConfigure, error){} +func (p *servicePackage) FrameworkResources(ctx context.Context) []*types.ServicePackageFrameworkResource { + return []*types.ServicePackageFrameworkResource{} } -func (p *servicePackage) SDKDataSources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{} +func (p *servicePackage) SDKDataSources(ctx context.Context) []*types.ServicePackageSDKDataSource { + return []*types.ServicePackageSDKDataSource{} } -func (p *servicePackage) SDKResources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{} +func (p *servicePackage) SDKResources(ctx context.Context) []*types.ServicePackageSDKResource { + return []*types.ServicePackageSDKResource{} } func (p *servicePackage) ServicePackageName() string { diff --git a/internal/service/configservice/service_package_gen.go b/internal/service/configservice/service_package_gen.go index 1d38360c877e..65dbd09ac0ae 100644 --- a/internal/service/configservice/service_package_gen.go +++ b/internal/service/configservice/service_package_gen.go @@ -5,39 +5,70 @@ package configservice import ( "context" - "github.com/hashicorp/terraform-plugin-framework/datasource" - "github.com/hashicorp/terraform-plugin-framework/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "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) []func(context.Context) (datasource.DataSourceWithConfigure, error) { - return []func(context.Context) (datasource.DataSourceWithConfigure, error){} +func (p *servicePackage) FrameworkDataSources(ctx context.Context) []*types.ServicePackageFrameworkDataSource { + return []*types.ServicePackageFrameworkDataSource{} } -func (p *servicePackage) FrameworkResources(ctx context.Context) []func(context.Context) (resource.ResourceWithConfigure, error) { - return []func(context.Context) (resource.ResourceWithConfigure, error){} +func (p *servicePackage) FrameworkResources(ctx context.Context) []*types.ServicePackageFrameworkResource { + return []*types.ServicePackageFrameworkResource{} } -func (p *servicePackage) SDKDataSources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{} +func (p *servicePackage) SDKDataSources(ctx context.Context) []*types.ServicePackageSDKDataSource { + return []*types.ServicePackageSDKDataSource{} } -func (p *servicePackage) SDKResources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{ - "aws_config_aggregate_authorization": ResourceAggregateAuthorization, - "aws_config_config_rule": ResourceConfigRule, - "aws_config_configuration_aggregator": ResourceConfigurationAggregator, - "aws_config_configuration_recorder": ResourceConfigurationRecorder, - "aws_config_configuration_recorder_status": ResourceConfigurationRecorderStatus, - "aws_config_conformance_pack": ResourceConformancePack, - "aws_config_delivery_channel": ResourceDeliveryChannel, - "aws_config_organization_conformance_pack": ResourceOrganizationConformancePack, - "aws_config_organization_custom_rule": ResourceOrganizationCustomRule, - "aws_config_organization_managed_rule": ResourceOrganizationManagedRule, - "aws_config_remediation_configuration": ResourceRemediationConfiguration, +func (p *servicePackage) SDKResources(ctx context.Context) []*types.ServicePackageSDKResource { + return []*types.ServicePackageSDKResource{ + { + Factory: ResourceAggregateAuthorization, + TypeName: "aws_config_aggregate_authorization", + }, + { + Factory: ResourceConfigRule, + TypeName: "aws_config_config_rule", + }, + { + Factory: ResourceConfigurationAggregator, + TypeName: "aws_config_configuration_aggregator", + }, + { + Factory: ResourceConfigurationRecorder, + TypeName: "aws_config_configuration_recorder", + }, + { + Factory: ResourceConfigurationRecorderStatus, + TypeName: "aws_config_configuration_recorder_status", + }, + { + Factory: ResourceConformancePack, + TypeName: "aws_config_conformance_pack", + }, + { + Factory: ResourceDeliveryChannel, + TypeName: "aws_config_delivery_channel", + }, + { + Factory: ResourceOrganizationConformancePack, + TypeName: "aws_config_organization_conformance_pack", + }, + { + Factory: ResourceOrganizationCustomRule, + TypeName: "aws_config_organization_custom_rule", + }, + { + Factory: ResourceOrganizationManagedRule, + TypeName: "aws_config_organization_managed_rule", + }, + { + Factory: ResourceRemediationConfiguration, + TypeName: "aws_config_remediation_configuration", + }, } } diff --git a/internal/service/connect/service_package_gen.go b/internal/service/connect/service_package_gen.go index aea05df244a7..d76c7cb195e6 100644 --- a/internal/service/connect/service_package_gen.go +++ b/internal/service/connect/service_package_gen.go @@ -5,59 +5,147 @@ package connect import ( "context" - "github.com/hashicorp/terraform-plugin-framework/datasource" - "github.com/hashicorp/terraform-plugin-framework/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "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) []func(context.Context) (datasource.DataSourceWithConfigure, error) { - return []func(context.Context) (datasource.DataSourceWithConfigure, error){} +func (p *servicePackage) FrameworkDataSources(ctx context.Context) []*types.ServicePackageFrameworkDataSource { + return []*types.ServicePackageFrameworkDataSource{} } -func (p *servicePackage) FrameworkResources(ctx context.Context) []func(context.Context) (resource.ResourceWithConfigure, error) { - return []func(context.Context) (resource.ResourceWithConfigure, error){} +func (p *servicePackage) FrameworkResources(ctx context.Context) []*types.ServicePackageFrameworkResource { + return []*types.ServicePackageFrameworkResource{} } -func (p *servicePackage) SDKDataSources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{ - "aws_connect_bot_association": DataSourceBotAssociation, - "aws_connect_contact_flow": DataSourceContactFlow, - "aws_connect_contact_flow_module": DataSourceContactFlowModule, - "aws_connect_hours_of_operation": DataSourceHoursOfOperation, - "aws_connect_instance": DataSourceInstance, - "aws_connect_instance_storage_config": DataSourceInstanceStorageConfig, - "aws_connect_lambda_function_association": DataSourceLambdaFunctionAssociation, - "aws_connect_prompt": DataSourcePrompt, - "aws_connect_queue": DataSourceQueue, - "aws_connect_quick_connect": DataSourceQuickConnect, - "aws_connect_routing_profile": DataSourceRoutingProfile, - "aws_connect_security_profile": DataSourceSecurityProfile, - "aws_connect_user_hierarchy_group": DataSourceUserHierarchyGroup, - "aws_connect_user_hierarchy_structure": DataSourceUserHierarchyStructure, +func (p *servicePackage) SDKDataSources(ctx context.Context) []*types.ServicePackageSDKDataSource { + return []*types.ServicePackageSDKDataSource{ + { + Factory: DataSourceBotAssociation, + TypeName: "aws_connect_bot_association", + }, + { + Factory: DataSourceContactFlow, + TypeName: "aws_connect_contact_flow", + }, + { + Factory: DataSourceContactFlowModule, + TypeName: "aws_connect_contact_flow_module", + }, + { + Factory: DataSourceHoursOfOperation, + TypeName: "aws_connect_hours_of_operation", + }, + { + Factory: DataSourceInstance, + TypeName: "aws_connect_instance", + }, + { + Factory: DataSourceInstanceStorageConfig, + TypeName: "aws_connect_instance_storage_config", + }, + { + Factory: DataSourceLambdaFunctionAssociation, + TypeName: "aws_connect_lambda_function_association", + }, + { + Factory: DataSourcePrompt, + TypeName: "aws_connect_prompt", + }, + { + Factory: DataSourceQueue, + TypeName: "aws_connect_queue", + }, + { + Factory: DataSourceQuickConnect, + TypeName: "aws_connect_quick_connect", + }, + { + Factory: DataSourceRoutingProfile, + TypeName: "aws_connect_routing_profile", + }, + { + Factory: DataSourceSecurityProfile, + TypeName: "aws_connect_security_profile", + }, + { + Factory: DataSourceUserHierarchyGroup, + TypeName: "aws_connect_user_hierarchy_group", + }, + { + Factory: DataSourceUserHierarchyStructure, + TypeName: "aws_connect_user_hierarchy_structure", + }, } } -func (p *servicePackage) SDKResources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{ - "aws_connect_bot_association": ResourceBotAssociation, - "aws_connect_contact_flow": ResourceContactFlow, - "aws_connect_contact_flow_module": ResourceContactFlowModule, - "aws_connect_hours_of_operation": ResourceHoursOfOperation, - "aws_connect_instance": ResourceInstance, - "aws_connect_instance_storage_config": ResourceInstanceStorageConfig, - "aws_connect_lambda_function_association": ResourceLambdaFunctionAssociation, - "aws_connect_phone_number": ResourcePhoneNumber, - "aws_connect_queue": ResourceQueue, - "aws_connect_quick_connect": ResourceQuickConnect, - "aws_connect_routing_profile": ResourceRoutingProfile, - "aws_connect_security_profile": ResourceSecurityProfile, - "aws_connect_user": ResourceUser, - "aws_connect_user_hierarchy_group": ResourceUserHierarchyGroup, - "aws_connect_user_hierarchy_structure": ResourceUserHierarchyStructure, - "aws_connect_vocabulary": ResourceVocabulary, +func (p *servicePackage) SDKResources(ctx context.Context) []*types.ServicePackageSDKResource { + return []*types.ServicePackageSDKResource{ + { + Factory: ResourceBotAssociation, + TypeName: "aws_connect_bot_association", + }, + { + Factory: ResourceContactFlow, + TypeName: "aws_connect_contact_flow", + }, + { + Factory: ResourceContactFlowModule, + TypeName: "aws_connect_contact_flow_module", + }, + { + Factory: ResourceHoursOfOperation, + TypeName: "aws_connect_hours_of_operation", + }, + { + Factory: ResourceInstance, + TypeName: "aws_connect_instance", + }, + { + Factory: ResourceInstanceStorageConfig, + TypeName: "aws_connect_instance_storage_config", + }, + { + Factory: ResourceLambdaFunctionAssociation, + TypeName: "aws_connect_lambda_function_association", + }, + { + Factory: ResourcePhoneNumber, + TypeName: "aws_connect_phone_number", + }, + { + Factory: ResourceQueue, + TypeName: "aws_connect_queue", + }, + { + Factory: ResourceQuickConnect, + TypeName: "aws_connect_quick_connect", + }, + { + Factory: ResourceRoutingProfile, + TypeName: "aws_connect_routing_profile", + }, + { + Factory: ResourceSecurityProfile, + TypeName: "aws_connect_security_profile", + }, + { + Factory: ResourceUser, + TypeName: "aws_connect_user", + }, + { + Factory: ResourceUserHierarchyGroup, + TypeName: "aws_connect_user_hierarchy_group", + }, + { + Factory: ResourceUserHierarchyStructure, + TypeName: "aws_connect_user_hierarchy_structure", + }, + { + Factory: ResourceVocabulary, + TypeName: "aws_connect_vocabulary", + }, } } diff --git a/internal/service/controltower/service_package_gen.go b/internal/service/controltower/service_package_gen.go index 6cb72ded059c..9838b167fe2b 100644 --- a/internal/service/controltower/service_package_gen.go +++ b/internal/service/controltower/service_package_gen.go @@ -5,31 +5,35 @@ package controltower import ( "context" - "github.com/hashicorp/terraform-plugin-framework/datasource" - "github.com/hashicorp/terraform-plugin-framework/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "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) []func(context.Context) (datasource.DataSourceWithConfigure, error) { - return []func(context.Context) (datasource.DataSourceWithConfigure, error){} +func (p *servicePackage) FrameworkDataSources(ctx context.Context) []*types.ServicePackageFrameworkDataSource { + return []*types.ServicePackageFrameworkDataSource{} } -func (p *servicePackage) FrameworkResources(ctx context.Context) []func(context.Context) (resource.ResourceWithConfigure, error) { - return []func(context.Context) (resource.ResourceWithConfigure, error){} +func (p *servicePackage) FrameworkResources(ctx context.Context) []*types.ServicePackageFrameworkResource { + return []*types.ServicePackageFrameworkResource{} } -func (p *servicePackage) SDKDataSources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{ - "aws_controltower_controls": DataSourceControls, +func (p *servicePackage) SDKDataSources(ctx context.Context) []*types.ServicePackageSDKDataSource { + return []*types.ServicePackageSDKDataSource{ + { + Factory: DataSourceControls, + TypeName: "aws_controltower_controls", + }, } } -func (p *servicePackage) SDKResources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{ - "aws_controltower_control": ResourceControl, +func (p *servicePackage) SDKResources(ctx context.Context) []*types.ServicePackageSDKResource { + return []*types.ServicePackageSDKResource{ + { + Factory: ResourceControl, + TypeName: "aws_controltower_control", + }, } } diff --git a/internal/service/cur/service_package_gen.go b/internal/service/cur/service_package_gen.go index 6b44cfc4cb4c..dd00b41a3dd8 100644 --- a/internal/service/cur/service_package_gen.go +++ b/internal/service/cur/service_package_gen.go @@ -5,31 +5,35 @@ package cur import ( "context" - "github.com/hashicorp/terraform-plugin-framework/datasource" - "github.com/hashicorp/terraform-plugin-framework/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "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) []func(context.Context) (datasource.DataSourceWithConfigure, error) { - return []func(context.Context) (datasource.DataSourceWithConfigure, error){} +func (p *servicePackage) FrameworkDataSources(ctx context.Context) []*types.ServicePackageFrameworkDataSource { + return []*types.ServicePackageFrameworkDataSource{} } -func (p *servicePackage) FrameworkResources(ctx context.Context) []func(context.Context) (resource.ResourceWithConfigure, error) { - return []func(context.Context) (resource.ResourceWithConfigure, error){} +func (p *servicePackage) FrameworkResources(ctx context.Context) []*types.ServicePackageFrameworkResource { + return []*types.ServicePackageFrameworkResource{} } -func (p *servicePackage) SDKDataSources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{ - "aws_cur_report_definition": DataSourceReportDefinition, +func (p *servicePackage) SDKDataSources(ctx context.Context) []*types.ServicePackageSDKDataSource { + return []*types.ServicePackageSDKDataSource{ + { + Factory: DataSourceReportDefinition, + TypeName: "aws_cur_report_definition", + }, } } -func (p *servicePackage) SDKResources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{ - "aws_cur_report_definition": ResourceReportDefinition, +func (p *servicePackage) SDKResources(ctx context.Context) []*types.ServicePackageSDKResource { + return []*types.ServicePackageSDKResource{ + { + Factory: ResourceReportDefinition, + TypeName: "aws_cur_report_definition", + }, } } diff --git a/internal/service/dataexchange/service_package_gen.go b/internal/service/dataexchange/service_package_gen.go index 569cd9af99d8..df3b2723584e 100644 --- a/internal/service/dataexchange/service_package_gen.go +++ b/internal/service/dataexchange/service_package_gen.go @@ -5,30 +5,34 @@ package dataexchange import ( "context" - "github.com/hashicorp/terraform-plugin-framework/datasource" - "github.com/hashicorp/terraform-plugin-framework/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "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) []func(context.Context) (datasource.DataSourceWithConfigure, error) { - return []func(context.Context) (datasource.DataSourceWithConfigure, error){} +func (p *servicePackage) FrameworkDataSources(ctx context.Context) []*types.ServicePackageFrameworkDataSource { + return []*types.ServicePackageFrameworkDataSource{} } -func (p *servicePackage) FrameworkResources(ctx context.Context) []func(context.Context) (resource.ResourceWithConfigure, error) { - return []func(context.Context) (resource.ResourceWithConfigure, error){} +func (p *servicePackage) FrameworkResources(ctx context.Context) []*types.ServicePackageFrameworkResource { + return []*types.ServicePackageFrameworkResource{} } -func (p *servicePackage) SDKDataSources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{} +func (p *servicePackage) SDKDataSources(ctx context.Context) []*types.ServicePackageSDKDataSource { + return []*types.ServicePackageSDKDataSource{} } -func (p *servicePackage) SDKResources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{ - "aws_dataexchange_data_set": ResourceDataSet, - "aws_dataexchange_revision": ResourceRevision, +func (p *servicePackage) SDKResources(ctx context.Context) []*types.ServicePackageSDKResource { + return []*types.ServicePackageSDKResource{ + { + Factory: ResourceDataSet, + TypeName: "aws_dataexchange_data_set", + }, + { + Factory: ResourceRevision, + TypeName: "aws_dataexchange_revision", + }, } } diff --git a/internal/service/datapipeline/service_package_gen.go b/internal/service/datapipeline/service_package_gen.go index eca848bbc96d..793cc3fcb00a 100644 --- a/internal/service/datapipeline/service_package_gen.go +++ b/internal/service/datapipeline/service_package_gen.go @@ -5,33 +5,43 @@ package datapipeline import ( "context" - "github.com/hashicorp/terraform-plugin-framework/datasource" - "github.com/hashicorp/terraform-plugin-framework/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "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) []func(context.Context) (datasource.DataSourceWithConfigure, error) { - return []func(context.Context) (datasource.DataSourceWithConfigure, error){} +func (p *servicePackage) FrameworkDataSources(ctx context.Context) []*types.ServicePackageFrameworkDataSource { + return []*types.ServicePackageFrameworkDataSource{} } -func (p *servicePackage) FrameworkResources(ctx context.Context) []func(context.Context) (resource.ResourceWithConfigure, error) { - return []func(context.Context) (resource.ResourceWithConfigure, error){} +func (p *servicePackage) FrameworkResources(ctx context.Context) []*types.ServicePackageFrameworkResource { + return []*types.ServicePackageFrameworkResource{} } -func (p *servicePackage) SDKDataSources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{ - "aws_datapipeline_pipeline": DataSourcePipeline, - "aws_datapipeline_pipeline_definition": DataSourcePipelineDefinition, +func (p *servicePackage) SDKDataSources(ctx context.Context) []*types.ServicePackageSDKDataSource { + return []*types.ServicePackageSDKDataSource{ + { + Factory: DataSourcePipeline, + TypeName: "aws_datapipeline_pipeline", + }, + { + Factory: DataSourcePipelineDefinition, + TypeName: "aws_datapipeline_pipeline_definition", + }, } } -func (p *servicePackage) SDKResources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{ - "aws_datapipeline_pipeline": ResourcePipeline, - "aws_datapipeline_pipeline_definition": ResourcePipelineDefinition, +func (p *servicePackage) SDKResources(ctx context.Context) []*types.ServicePackageSDKResource { + return []*types.ServicePackageSDKResource{ + { + Factory: ResourcePipeline, + TypeName: "aws_datapipeline_pipeline", + }, + { + Factory: ResourcePipelineDefinition, + TypeName: "aws_datapipeline_pipeline_definition", + }, } } diff --git a/internal/service/datasync/service_package_gen.go b/internal/service/datasync/service_package_gen.go index 76ea310d36c5..5eac26d4f7ca 100644 --- a/internal/service/datasync/service_package_gen.go +++ b/internal/service/datasync/service_package_gen.go @@ -5,39 +5,70 @@ package datasync import ( "context" - "github.com/hashicorp/terraform-plugin-framework/datasource" - "github.com/hashicorp/terraform-plugin-framework/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "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) []func(context.Context) (datasource.DataSourceWithConfigure, error) { - return []func(context.Context) (datasource.DataSourceWithConfigure, error){} +func (p *servicePackage) FrameworkDataSources(ctx context.Context) []*types.ServicePackageFrameworkDataSource { + return []*types.ServicePackageFrameworkDataSource{} } -func (p *servicePackage) FrameworkResources(ctx context.Context) []func(context.Context) (resource.ResourceWithConfigure, error) { - return []func(context.Context) (resource.ResourceWithConfigure, error){} +func (p *servicePackage) FrameworkResources(ctx context.Context) []*types.ServicePackageFrameworkResource { + return []*types.ServicePackageFrameworkResource{} } -func (p *servicePackage) SDKDataSources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{} +func (p *servicePackage) SDKDataSources(ctx context.Context) []*types.ServicePackageSDKDataSource { + return []*types.ServicePackageSDKDataSource{} } -func (p *servicePackage) SDKResources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{ - "aws_datasync_agent": ResourceAgent, - "aws_datasync_location_efs": ResourceLocationEFS, - "aws_datasync_location_fsx_lustre_file_system": ResourceLocationFSxLustreFileSystem, - "aws_datasync_location_fsx_openzfs_file_system": ResourceLocationFSxOpenZFSFileSystem, - "aws_datasync_location_fsx_windows_file_system": ResourceLocationFSxWindowsFileSystem, - "aws_datasync_location_hdfs": ResourceLocationHDFS, - "aws_datasync_location_nfs": ResourceLocationNFS, - "aws_datasync_location_object_storage": ResourceLocationObjectStorage, - "aws_datasync_location_s3": ResourceLocationS3, - "aws_datasync_location_smb": ResourceLocationSMB, - "aws_datasync_task": ResourceTask, +func (p *servicePackage) SDKResources(ctx context.Context) []*types.ServicePackageSDKResource { + return []*types.ServicePackageSDKResource{ + { + Factory: ResourceAgent, + TypeName: "aws_datasync_agent", + }, + { + Factory: ResourceLocationEFS, + TypeName: "aws_datasync_location_efs", + }, + { + Factory: ResourceLocationFSxLustreFileSystem, + TypeName: "aws_datasync_location_fsx_lustre_file_system", + }, + { + Factory: ResourceLocationFSxOpenZFSFileSystem, + TypeName: "aws_datasync_location_fsx_openzfs_file_system", + }, + { + Factory: ResourceLocationFSxWindowsFileSystem, + TypeName: "aws_datasync_location_fsx_windows_file_system", + }, + { + Factory: ResourceLocationHDFS, + TypeName: "aws_datasync_location_hdfs", + }, + { + Factory: ResourceLocationNFS, + TypeName: "aws_datasync_location_nfs", + }, + { + Factory: ResourceLocationObjectStorage, + TypeName: "aws_datasync_location_object_storage", + }, + { + Factory: ResourceLocationS3, + TypeName: "aws_datasync_location_s3", + }, + { + Factory: ResourceLocationSMB, + TypeName: "aws_datasync_location_smb", + }, + { + Factory: ResourceTask, + TypeName: "aws_datasync_task", + }, } } diff --git a/internal/service/dax/service_package_gen.go b/internal/service/dax/service_package_gen.go index 4422ebbb107a..6581220a7ab5 100644 --- a/internal/service/dax/service_package_gen.go +++ b/internal/service/dax/service_package_gen.go @@ -5,31 +5,38 @@ package dax import ( "context" - "github.com/hashicorp/terraform-plugin-framework/datasource" - "github.com/hashicorp/terraform-plugin-framework/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "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) []func(context.Context) (datasource.DataSourceWithConfigure, error) { - return []func(context.Context) (datasource.DataSourceWithConfigure, error){} +func (p *servicePackage) FrameworkDataSources(ctx context.Context) []*types.ServicePackageFrameworkDataSource { + return []*types.ServicePackageFrameworkDataSource{} } -func (p *servicePackage) FrameworkResources(ctx context.Context) []func(context.Context) (resource.ResourceWithConfigure, error) { - return []func(context.Context) (resource.ResourceWithConfigure, error){} +func (p *servicePackage) FrameworkResources(ctx context.Context) []*types.ServicePackageFrameworkResource { + return []*types.ServicePackageFrameworkResource{} } -func (p *servicePackage) SDKDataSources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{} +func (p *servicePackage) SDKDataSources(ctx context.Context) []*types.ServicePackageSDKDataSource { + return []*types.ServicePackageSDKDataSource{} } -func (p *servicePackage) SDKResources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{ - "aws_dax_cluster": ResourceCluster, - "aws_dax_parameter_group": ResourceParameterGroup, - "aws_dax_subnet_group": ResourceSubnetGroup, +func (p *servicePackage) SDKResources(ctx context.Context) []*types.ServicePackageSDKResource { + return []*types.ServicePackageSDKResource{ + { + Factory: ResourceCluster, + TypeName: "aws_dax_cluster", + }, + { + Factory: ResourceParameterGroup, + TypeName: "aws_dax_parameter_group", + }, + { + Factory: ResourceSubnetGroup, + TypeName: "aws_dax_subnet_group", + }, } } diff --git a/internal/service/deploy/service_package_gen.go b/internal/service/deploy/service_package_gen.go index 1184524d0c66..a9de11d7bf4f 100644 --- a/internal/service/deploy/service_package_gen.go +++ b/internal/service/deploy/service_package_gen.go @@ -5,31 +5,38 @@ package deploy import ( "context" - "github.com/hashicorp/terraform-plugin-framework/datasource" - "github.com/hashicorp/terraform-plugin-framework/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "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) []func(context.Context) (datasource.DataSourceWithConfigure, error) { - return []func(context.Context) (datasource.DataSourceWithConfigure, error){} +func (p *servicePackage) FrameworkDataSources(ctx context.Context) []*types.ServicePackageFrameworkDataSource { + return []*types.ServicePackageFrameworkDataSource{} } -func (p *servicePackage) FrameworkResources(ctx context.Context) []func(context.Context) (resource.ResourceWithConfigure, error) { - return []func(context.Context) (resource.ResourceWithConfigure, error){} +func (p *servicePackage) FrameworkResources(ctx context.Context) []*types.ServicePackageFrameworkResource { + return []*types.ServicePackageFrameworkResource{} } -func (p *servicePackage) SDKDataSources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{} +func (p *servicePackage) SDKDataSources(ctx context.Context) []*types.ServicePackageSDKDataSource { + return []*types.ServicePackageSDKDataSource{} } -func (p *servicePackage) SDKResources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{ - "aws_codedeploy_app": ResourceApp, - "aws_codedeploy_deployment_config": ResourceDeploymentConfig, - "aws_codedeploy_deployment_group": ResourceDeploymentGroup, +func (p *servicePackage) SDKResources(ctx context.Context) []*types.ServicePackageSDKResource { + return []*types.ServicePackageSDKResource{ + { + Factory: ResourceApp, + TypeName: "aws_codedeploy_app", + }, + { + Factory: ResourceDeploymentConfig, + TypeName: "aws_codedeploy_deployment_config", + }, + { + Factory: ResourceDeploymentGroup, + TypeName: "aws_codedeploy_deployment_group", + }, } } diff --git a/internal/service/detective/service_package_gen.go b/internal/service/detective/service_package_gen.go index 4c09ff2ae64f..376b613026c7 100644 --- a/internal/service/detective/service_package_gen.go +++ b/internal/service/detective/service_package_gen.go @@ -5,31 +5,38 @@ package detective import ( "context" - "github.com/hashicorp/terraform-plugin-framework/datasource" - "github.com/hashicorp/terraform-plugin-framework/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "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) []func(context.Context) (datasource.DataSourceWithConfigure, error) { - return []func(context.Context) (datasource.DataSourceWithConfigure, error){} +func (p *servicePackage) FrameworkDataSources(ctx context.Context) []*types.ServicePackageFrameworkDataSource { + return []*types.ServicePackageFrameworkDataSource{} } -func (p *servicePackage) FrameworkResources(ctx context.Context) []func(context.Context) (resource.ResourceWithConfigure, error) { - return []func(context.Context) (resource.ResourceWithConfigure, error){} +func (p *servicePackage) FrameworkResources(ctx context.Context) []*types.ServicePackageFrameworkResource { + return []*types.ServicePackageFrameworkResource{} } -func (p *servicePackage) SDKDataSources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{} +func (p *servicePackage) SDKDataSources(ctx context.Context) []*types.ServicePackageSDKDataSource { + return []*types.ServicePackageSDKDataSource{} } -func (p *servicePackage) SDKResources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{ - "aws_detective_graph": ResourceGraph, - "aws_detective_invitation_accepter": ResourceInvitationAccepter, - "aws_detective_member": ResourceMember, +func (p *servicePackage) SDKResources(ctx context.Context) []*types.ServicePackageSDKResource { + return []*types.ServicePackageSDKResource{ + { + Factory: ResourceGraph, + TypeName: "aws_detective_graph", + }, + { + Factory: ResourceInvitationAccepter, + TypeName: "aws_detective_invitation_accepter", + }, + { + Factory: ResourceMember, + TypeName: "aws_detective_member", + }, } } diff --git a/internal/service/devicefarm/service_package_gen.go b/internal/service/devicefarm/service_package_gen.go index 2183efbdeca2..546bef5f0c2b 100644 --- a/internal/service/devicefarm/service_package_gen.go +++ b/internal/service/devicefarm/service_package_gen.go @@ -5,34 +5,50 @@ package devicefarm import ( "context" - "github.com/hashicorp/terraform-plugin-framework/datasource" - "github.com/hashicorp/terraform-plugin-framework/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "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) []func(context.Context) (datasource.DataSourceWithConfigure, error) { - return []func(context.Context) (datasource.DataSourceWithConfigure, error){} +func (p *servicePackage) FrameworkDataSources(ctx context.Context) []*types.ServicePackageFrameworkDataSource { + return []*types.ServicePackageFrameworkDataSource{} } -func (p *servicePackage) FrameworkResources(ctx context.Context) []func(context.Context) (resource.ResourceWithConfigure, error) { - return []func(context.Context) (resource.ResourceWithConfigure, error){} +func (p *servicePackage) FrameworkResources(ctx context.Context) []*types.ServicePackageFrameworkResource { + return []*types.ServicePackageFrameworkResource{} } -func (p *servicePackage) SDKDataSources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{} +func (p *servicePackage) SDKDataSources(ctx context.Context) []*types.ServicePackageSDKDataSource { + return []*types.ServicePackageSDKDataSource{} } -func (p *servicePackage) SDKResources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{ - "aws_devicefarm_device_pool": ResourceDevicePool, - "aws_devicefarm_instance_profile": ResourceInstanceProfile, - "aws_devicefarm_network_profile": ResourceNetworkProfile, - "aws_devicefarm_project": ResourceProject, - "aws_devicefarm_test_grid_project": ResourceTestGridProject, - "aws_devicefarm_upload": ResourceUpload, +func (p *servicePackage) SDKResources(ctx context.Context) []*types.ServicePackageSDKResource { + return []*types.ServicePackageSDKResource{ + { + Factory: ResourceDevicePool, + TypeName: "aws_devicefarm_device_pool", + }, + { + Factory: ResourceInstanceProfile, + TypeName: "aws_devicefarm_instance_profile", + }, + { + Factory: ResourceNetworkProfile, + TypeName: "aws_devicefarm_network_profile", + }, + { + Factory: ResourceProject, + TypeName: "aws_devicefarm_project", + }, + { + Factory: ResourceTestGridProject, + TypeName: "aws_devicefarm_test_grid_project", + }, + { + Factory: ResourceUpload, + TypeName: "aws_devicefarm_upload", + }, } } diff --git a/internal/service/directconnect/service_package_gen.go b/internal/service/directconnect/service_package_gen.go index 3f6bb3ae1d5f..3a3e120eab1e 100644 --- a/internal/service/directconnect/service_package_gen.go +++ b/internal/service/directconnect/service_package_gen.go @@ -5,53 +5,123 @@ package directconnect import ( "context" - "github.com/hashicorp/terraform-plugin-framework/datasource" - "github.com/hashicorp/terraform-plugin-framework/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "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) []func(context.Context) (datasource.DataSourceWithConfigure, error) { - return []func(context.Context) (datasource.DataSourceWithConfigure, error){} +func (p *servicePackage) FrameworkDataSources(ctx context.Context) []*types.ServicePackageFrameworkDataSource { + return []*types.ServicePackageFrameworkDataSource{} } -func (p *servicePackage) FrameworkResources(ctx context.Context) []func(context.Context) (resource.ResourceWithConfigure, error) { - return []func(context.Context) (resource.ResourceWithConfigure, error){} +func (p *servicePackage) FrameworkResources(ctx context.Context) []*types.ServicePackageFrameworkResource { + return []*types.ServicePackageFrameworkResource{} } -func (p *servicePackage) SDKDataSources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{ - "aws_dx_connection": DataSourceConnection, - "aws_dx_gateway": DataSourceGateway, - "aws_dx_location": DataSourceLocation, - "aws_dx_locations": DataSourceLocations, - "aws_dx_router_configuration": DataSourceRouterConfiguration, +func (p *servicePackage) SDKDataSources(ctx context.Context) []*types.ServicePackageSDKDataSource { + return []*types.ServicePackageSDKDataSource{ + { + Factory: DataSourceConnection, + TypeName: "aws_dx_connection", + }, + { + Factory: DataSourceGateway, + TypeName: "aws_dx_gateway", + }, + { + Factory: DataSourceLocation, + TypeName: "aws_dx_location", + }, + { + Factory: DataSourceLocations, + TypeName: "aws_dx_locations", + }, + { + Factory: DataSourceRouterConfiguration, + TypeName: "aws_dx_router_configuration", + }, } } -func (p *servicePackage) SDKResources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{ - "aws_dx_bgp_peer": ResourceBGPPeer, - "aws_dx_connection": ResourceConnection, - "aws_dx_connection_association": ResourceConnectionAssociation, - "aws_dx_connection_confirmation": ResourceConnectionConfirmation, - "aws_dx_gateway": ResourceGateway, - "aws_dx_gateway_association": ResourceGatewayAssociation, - "aws_dx_gateway_association_proposal": ResourceGatewayAssociationProposal, - "aws_dx_hosted_connection": ResourceHostedConnection, - "aws_dx_hosted_private_virtual_interface": ResourceHostedPrivateVirtualInterface, - "aws_dx_hosted_private_virtual_interface_accepter": ResourceHostedPrivateVirtualInterfaceAccepter, - "aws_dx_hosted_public_virtual_interface": ResourceHostedPublicVirtualInterface, - "aws_dx_hosted_public_virtual_interface_accepter": ResourceHostedPublicVirtualInterfaceAccepter, - "aws_dx_hosted_transit_virtual_interface": ResourceHostedTransitVirtualInterface, - "aws_dx_hosted_transit_virtual_interface_accepter": ResourceHostedTransitVirtualInterfaceAccepter, - "aws_dx_lag": ResourceLag, - "aws_dx_macsec_key_association": ResourceMacSecKeyAssociation, - "aws_dx_private_virtual_interface": ResourcePrivateVirtualInterface, - "aws_dx_public_virtual_interface": ResourcePublicVirtualInterface, - "aws_dx_transit_virtual_interface": ResourceTransitVirtualInterface, +func (p *servicePackage) SDKResources(ctx context.Context) []*types.ServicePackageSDKResource { + return []*types.ServicePackageSDKResource{ + { + Factory: ResourceBGPPeer, + TypeName: "aws_dx_bgp_peer", + }, + { + Factory: ResourceConnection, + TypeName: "aws_dx_connection", + }, + { + Factory: ResourceConnectionAssociation, + TypeName: "aws_dx_connection_association", + }, + { + Factory: ResourceConnectionConfirmation, + TypeName: "aws_dx_connection_confirmation", + }, + { + Factory: ResourceGateway, + TypeName: "aws_dx_gateway", + }, + { + Factory: ResourceGatewayAssociation, + TypeName: "aws_dx_gateway_association", + }, + { + Factory: ResourceGatewayAssociationProposal, + TypeName: "aws_dx_gateway_association_proposal", + }, + { + Factory: ResourceHostedConnection, + TypeName: "aws_dx_hosted_connection", + }, + { + Factory: ResourceHostedPrivateVirtualInterface, + TypeName: "aws_dx_hosted_private_virtual_interface", + }, + { + Factory: ResourceHostedPrivateVirtualInterfaceAccepter, + TypeName: "aws_dx_hosted_private_virtual_interface_accepter", + }, + { + Factory: ResourceHostedPublicVirtualInterface, + TypeName: "aws_dx_hosted_public_virtual_interface", + }, + { + Factory: ResourceHostedPublicVirtualInterfaceAccepter, + TypeName: "aws_dx_hosted_public_virtual_interface_accepter", + }, + { + Factory: ResourceHostedTransitVirtualInterface, + TypeName: "aws_dx_hosted_transit_virtual_interface", + }, + { + Factory: ResourceHostedTransitVirtualInterfaceAccepter, + TypeName: "aws_dx_hosted_transit_virtual_interface_accepter", + }, + { + Factory: ResourceLag, + TypeName: "aws_dx_lag", + }, + { + Factory: ResourceMacSecKeyAssociation, + TypeName: "aws_dx_macsec_key_association", + }, + { + Factory: ResourcePrivateVirtualInterface, + TypeName: "aws_dx_private_virtual_interface", + }, + { + Factory: ResourcePublicVirtualInterface, + TypeName: "aws_dx_public_virtual_interface", + }, + { + Factory: ResourceTransitVirtualInterface, + TypeName: "aws_dx_transit_virtual_interface", + }, } } diff --git a/internal/service/dlm/service_package_gen.go b/internal/service/dlm/service_package_gen.go index 217bec0af16c..6654ad98c1b6 100644 --- a/internal/service/dlm/service_package_gen.go +++ b/internal/service/dlm/service_package_gen.go @@ -5,29 +5,30 @@ package dlm import ( "context" - "github.com/hashicorp/terraform-plugin-framework/datasource" - "github.com/hashicorp/terraform-plugin-framework/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "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) []func(context.Context) (datasource.DataSourceWithConfigure, error) { - return []func(context.Context) (datasource.DataSourceWithConfigure, error){} +func (p *servicePackage) FrameworkDataSources(ctx context.Context) []*types.ServicePackageFrameworkDataSource { + return []*types.ServicePackageFrameworkDataSource{} } -func (p *servicePackage) FrameworkResources(ctx context.Context) []func(context.Context) (resource.ResourceWithConfigure, error) { - return []func(context.Context) (resource.ResourceWithConfigure, error){} +func (p *servicePackage) FrameworkResources(ctx context.Context) []*types.ServicePackageFrameworkResource { + return []*types.ServicePackageFrameworkResource{} } -func (p *servicePackage) SDKDataSources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{} +func (p *servicePackage) SDKDataSources(ctx context.Context) []*types.ServicePackageSDKDataSource { + return []*types.ServicePackageSDKDataSource{} } -func (p *servicePackage) SDKResources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{ - "aws_dlm_lifecycle_policy": ResourceLifecyclePolicy, +func (p *servicePackage) SDKResources(ctx context.Context) []*types.ServicePackageSDKResource { + return []*types.ServicePackageSDKResource{ + { + Factory: ResourceLifecyclePolicy, + TypeName: "aws_dlm_lifecycle_policy", + }, } } diff --git a/internal/service/dms/service_package_gen.go b/internal/service/dms/service_package_gen.go index 26416c61db03..182d2bd260f7 100644 --- a/internal/service/dms/service_package_gen.go +++ b/internal/service/dms/service_package_gen.go @@ -5,35 +5,54 @@ package dms import ( "context" - "github.com/hashicorp/terraform-plugin-framework/datasource" - "github.com/hashicorp/terraform-plugin-framework/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "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) []func(context.Context) (datasource.DataSourceWithConfigure, error) { - return []func(context.Context) (datasource.DataSourceWithConfigure, error){} +func (p *servicePackage) FrameworkDataSources(ctx context.Context) []*types.ServicePackageFrameworkDataSource { + return []*types.ServicePackageFrameworkDataSource{} } -func (p *servicePackage) FrameworkResources(ctx context.Context) []func(context.Context) (resource.ResourceWithConfigure, error) { - return []func(context.Context) (resource.ResourceWithConfigure, error){} +func (p *servicePackage) FrameworkResources(ctx context.Context) []*types.ServicePackageFrameworkResource { + return []*types.ServicePackageFrameworkResource{} } -func (p *servicePackage) SDKDataSources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{} +func (p *servicePackage) SDKDataSources(ctx context.Context) []*types.ServicePackageSDKDataSource { + return []*types.ServicePackageSDKDataSource{} } -func (p *servicePackage) SDKResources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{ - "aws_dms_certificate": ResourceCertificate, - "aws_dms_endpoint": ResourceEndpoint, - "aws_dms_event_subscription": ResourceEventSubscription, - "aws_dms_replication_instance": ResourceReplicationInstance, - "aws_dms_replication_subnet_group": ResourceReplicationSubnetGroup, - "aws_dms_replication_task": ResourceReplicationTask, - "aws_dms_s3_endpoint": ResourceS3Endpoint, +func (p *servicePackage) SDKResources(ctx context.Context) []*types.ServicePackageSDKResource { + return []*types.ServicePackageSDKResource{ + { + Factory: ResourceCertificate, + TypeName: "aws_dms_certificate", + }, + { + Factory: ResourceEndpoint, + TypeName: "aws_dms_endpoint", + }, + { + Factory: ResourceEventSubscription, + TypeName: "aws_dms_event_subscription", + }, + { + Factory: ResourceReplicationInstance, + TypeName: "aws_dms_replication_instance", + }, + { + Factory: ResourceReplicationSubnetGroup, + TypeName: "aws_dms_replication_subnet_group", + }, + { + Factory: ResourceReplicationTask, + TypeName: "aws_dms_replication_task", + }, + { + Factory: ResourceS3Endpoint, + TypeName: "aws_dms_s3_endpoint", + }, } } diff --git a/internal/service/docdb/service_package_gen.go b/internal/service/docdb/service_package_gen.go index 782df16943c6..601df25a5c37 100644 --- a/internal/service/docdb/service_package_gen.go +++ b/internal/service/docdb/service_package_gen.go @@ -5,38 +5,63 @@ package docdb import ( "context" - "github.com/hashicorp/terraform-plugin-framework/datasource" - "github.com/hashicorp/terraform-plugin-framework/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "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) []func(context.Context) (datasource.DataSourceWithConfigure, error) { - return []func(context.Context) (datasource.DataSourceWithConfigure, error){} +func (p *servicePackage) FrameworkDataSources(ctx context.Context) []*types.ServicePackageFrameworkDataSource { + return []*types.ServicePackageFrameworkDataSource{} } -func (p *servicePackage) FrameworkResources(ctx context.Context) []func(context.Context) (resource.ResourceWithConfigure, error) { - return []func(context.Context) (resource.ResourceWithConfigure, error){} +func (p *servicePackage) FrameworkResources(ctx context.Context) []*types.ServicePackageFrameworkResource { + return []*types.ServicePackageFrameworkResource{} } -func (p *servicePackage) SDKDataSources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{ - "aws_docdb_engine_version": DataSourceEngineVersion, - "aws_docdb_orderable_db_instance": DataSourceOrderableDBInstance, +func (p *servicePackage) SDKDataSources(ctx context.Context) []*types.ServicePackageSDKDataSource { + return []*types.ServicePackageSDKDataSource{ + { + Factory: DataSourceEngineVersion, + TypeName: "aws_docdb_engine_version", + }, + { + Factory: DataSourceOrderableDBInstance, + TypeName: "aws_docdb_orderable_db_instance", + }, } } -func (p *servicePackage) SDKResources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{ - "aws_docdb_cluster": ResourceCluster, - "aws_docdb_cluster_instance": ResourceClusterInstance, - "aws_docdb_cluster_parameter_group": ResourceClusterParameterGroup, - "aws_docdb_cluster_snapshot": ResourceClusterSnapshot, - "aws_docdb_event_subscription": ResourceEventSubscription, - "aws_docdb_global_cluster": ResourceGlobalCluster, - "aws_docdb_subnet_group": ResourceSubnetGroup, +func (p *servicePackage) SDKResources(ctx context.Context) []*types.ServicePackageSDKResource { + return []*types.ServicePackageSDKResource{ + { + Factory: ResourceCluster, + TypeName: "aws_docdb_cluster", + }, + { + Factory: ResourceClusterInstance, + TypeName: "aws_docdb_cluster_instance", + }, + { + Factory: ResourceClusterParameterGroup, + TypeName: "aws_docdb_cluster_parameter_group", + }, + { + Factory: ResourceClusterSnapshot, + TypeName: "aws_docdb_cluster_snapshot", + }, + { + Factory: ResourceEventSubscription, + TypeName: "aws_docdb_event_subscription", + }, + { + Factory: ResourceGlobalCluster, + TypeName: "aws_docdb_global_cluster", + }, + { + Factory: ResourceSubnetGroup, + TypeName: "aws_docdb_subnet_group", + }, } } diff --git a/internal/service/ds/service_package_gen.go b/internal/service/ds/service_package_gen.go index adcc95b9c111..25af8a590e56 100644 --- a/internal/service/ds/service_package_gen.go +++ b/internal/service/ds/service_package_gen.go @@ -5,37 +5,59 @@ package ds import ( "context" - "github.com/hashicorp/terraform-plugin-framework/datasource" - "github.com/hashicorp/terraform-plugin-framework/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "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) []func(context.Context) (datasource.DataSourceWithConfigure, error) { - return []func(context.Context) (datasource.DataSourceWithConfigure, error){} +func (p *servicePackage) FrameworkDataSources(ctx context.Context) []*types.ServicePackageFrameworkDataSource { + return []*types.ServicePackageFrameworkDataSource{} } -func (p *servicePackage) FrameworkResources(ctx context.Context) []func(context.Context) (resource.ResourceWithConfigure, error) { - return []func(context.Context) (resource.ResourceWithConfigure, error){} +func (p *servicePackage) FrameworkResources(ctx context.Context) []*types.ServicePackageFrameworkResource { + return []*types.ServicePackageFrameworkResource{} } -func (p *servicePackage) SDKDataSources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{ - "aws_directory_service_directory": DataSourceDirectory, +func (p *servicePackage) SDKDataSources(ctx context.Context) []*types.ServicePackageSDKDataSource { + return []*types.ServicePackageSDKDataSource{ + { + Factory: DataSourceDirectory, + TypeName: "aws_directory_service_directory", + }, } } -func (p *servicePackage) SDKResources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{ - "aws_directory_service_conditional_forwarder": ResourceConditionalForwarder, - "aws_directory_service_directory": ResourceDirectory, - "aws_directory_service_log_subscription": ResourceLogSubscription, - "aws_directory_service_radius_settings": ResourceRadiusSettings, - "aws_directory_service_region": ResourceRegion, - "aws_directory_service_shared_directory": ResourceSharedDirectory, - "aws_directory_service_shared_directory_accepter": ResourceSharedDirectoryAccepter, +func (p *servicePackage) SDKResources(ctx context.Context) []*types.ServicePackageSDKResource { + return []*types.ServicePackageSDKResource{ + { + Factory: ResourceConditionalForwarder, + TypeName: "aws_directory_service_conditional_forwarder", + }, + { + Factory: ResourceDirectory, + TypeName: "aws_directory_service_directory", + }, + { + Factory: ResourceLogSubscription, + TypeName: "aws_directory_service_log_subscription", + }, + { + Factory: ResourceRadiusSettings, + TypeName: "aws_directory_service_radius_settings", + }, + { + Factory: ResourceRegion, + TypeName: "aws_directory_service_region", + }, + { + Factory: ResourceSharedDirectory, + TypeName: "aws_directory_service_shared_directory", + }, + { + Factory: ResourceSharedDirectoryAccepter, + TypeName: "aws_directory_service_shared_directory_accepter", + }, } } diff --git a/internal/service/dynamodb/service_package_gen.go b/internal/service/dynamodb/service_package_gen.go index 34cd30d1fe33..7c2cb56cf17c 100644 --- a/internal/service/dynamodb/service_package_gen.go +++ b/internal/service/dynamodb/service_package_gen.go @@ -5,38 +5,63 @@ package dynamodb import ( "context" - "github.com/hashicorp/terraform-plugin-framework/datasource" - "github.com/hashicorp/terraform-plugin-framework/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "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) []func(context.Context) (datasource.DataSourceWithConfigure, error) { - return []func(context.Context) (datasource.DataSourceWithConfigure, error){} +func (p *servicePackage) FrameworkDataSources(ctx context.Context) []*types.ServicePackageFrameworkDataSource { + return []*types.ServicePackageFrameworkDataSource{} } -func (p *servicePackage) FrameworkResources(ctx context.Context) []func(context.Context) (resource.ResourceWithConfigure, error) { - return []func(context.Context) (resource.ResourceWithConfigure, error){} +func (p *servicePackage) FrameworkResources(ctx context.Context) []*types.ServicePackageFrameworkResource { + return []*types.ServicePackageFrameworkResource{} } -func (p *servicePackage) SDKDataSources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{ - "aws_dynamodb_table": DataSourceTable, - "aws_dynamodb_table_item": DataSourceTableItem, +func (p *servicePackage) SDKDataSources(ctx context.Context) []*types.ServicePackageSDKDataSource { + return []*types.ServicePackageSDKDataSource{ + { + Factory: DataSourceTable, + TypeName: "aws_dynamodb_table", + }, + { + Factory: DataSourceTableItem, + TypeName: "aws_dynamodb_table_item", + }, } } -func (p *servicePackage) SDKResources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{ - "aws_dynamodb_contributor_insights": ResourceContributorInsights, - "aws_dynamodb_global_table": ResourceGlobalTable, - "aws_dynamodb_kinesis_streaming_destination": ResourceKinesisStreamingDestination, - "aws_dynamodb_table": ResourceTable, - "aws_dynamodb_table_item": ResourceTableItem, - "aws_dynamodb_table_replica": ResourceTableReplica, - "aws_dynamodb_tag": ResourceTag, +func (p *servicePackage) SDKResources(ctx context.Context) []*types.ServicePackageSDKResource { + return []*types.ServicePackageSDKResource{ + { + Factory: ResourceContributorInsights, + TypeName: "aws_dynamodb_contributor_insights", + }, + { + Factory: ResourceGlobalTable, + TypeName: "aws_dynamodb_global_table", + }, + { + Factory: ResourceKinesisStreamingDestination, + TypeName: "aws_dynamodb_kinesis_streaming_destination", + }, + { + Factory: ResourceTable, + TypeName: "aws_dynamodb_table", + }, + { + Factory: ResourceTableItem, + TypeName: "aws_dynamodb_table_item", + }, + { + Factory: ResourceTableReplica, + TypeName: "aws_dynamodb_table_replica", + }, + { + Factory: ResourceTag, + TypeName: "aws_dynamodb_tag", + }, } } diff --git a/internal/service/ec2/service_package_gen.go b/internal/service/ec2/service_package_gen.go index c14856bbde1d..ec2c9d412633 100644 --- a/internal/service/ec2/service_package_gen.go +++ b/internal/service/ec2/service_package_gen.go @@ -5,231 +5,825 @@ package ec2 import ( "context" - "github.com/hashicorp/terraform-plugin-framework/datasource" - "github.com/hashicorp/terraform-plugin-framework/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "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) []func(context.Context) (datasource.DataSourceWithConfigure, error) { - return []func(context.Context) (datasource.DataSourceWithConfigure, error){ - newDataSourceSecurityGroupRule, - newDataSourceSecurityGroupRules, +func (p *servicePackage) FrameworkDataSources(ctx context.Context) []*types.ServicePackageFrameworkDataSource { + return []*types.ServicePackageFrameworkDataSource{ + { + Factory: newDataSourceSecurityGroupRule, + }, + { + Factory: newDataSourceSecurityGroupRules, + }, } } -func (p *servicePackage) FrameworkResources(ctx context.Context) []func(context.Context) (resource.ResourceWithConfigure, error) { - return []func(context.Context) (resource.ResourceWithConfigure, error){ - newResourceSecurityGroupEgressRule, - newResourceSecurityGroupIngressRule, +func (p *servicePackage) FrameworkResources(ctx context.Context) []*types.ServicePackageFrameworkResource { + return []*types.ServicePackageFrameworkResource{ + { + Factory: newResourceSecurityGroupEgressRule, + }, + { + Factory: newResourceSecurityGroupIngressRule, + }, } } -func (p *servicePackage) SDKDataSources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{ - "aws_ami": DataSourceAMI, - "aws_ami_ids": DataSourceAMIIDs, - "aws_availability_zone": DataSourceAvailabilityZone, - "aws_availability_zones": DataSourceAvailabilityZones, - "aws_customer_gateway": DataSourceCustomerGateway, - "aws_ebs_default_kms_key": DataSourceEBSDefaultKMSKey, - "aws_ebs_encryption_by_default": DataSourceEBSEncryptionByDefault, - "aws_ebs_snapshot": DataSourceEBSSnapshot, - "aws_ebs_snapshot_ids": DataSourceEBSSnapshotIDs, - "aws_ebs_volume": DataSourceEBSVolume, - "aws_ebs_volumes": DataSourceEBSVolumes, - "aws_ec2_client_vpn_endpoint": DataSourceClientVPNEndpoint, - "aws_ec2_coip_pool": DataSourceCoIPPool, - "aws_ec2_coip_pools": DataSourceCoIPPools, - "aws_ec2_host": DataSourceHost, - "aws_ec2_instance_type": DataSourceInstanceType, - "aws_ec2_instance_type_offering": DataSourceInstanceTypeOffering, - "aws_ec2_instance_type_offerings": DataSourceInstanceTypeOfferings, - "aws_ec2_instance_types": DataSourceInstanceTypes, - "aws_ec2_local_gateway": DataSourceLocalGateway, - "aws_ec2_local_gateway_route_table": DataSourceLocalGatewayRouteTable, - "aws_ec2_local_gateway_route_tables": DataSourceLocalGatewayRouteTables, - "aws_ec2_local_gateway_virtual_interface": DataSourceLocalGatewayVirtualInterface, - "aws_ec2_local_gateway_virtual_interface_group": DataSourceLocalGatewayVirtualInterfaceGroup, - "aws_ec2_local_gateway_virtual_interface_groups": DataSourceLocalGatewayVirtualInterfaceGroups, - "aws_ec2_local_gateways": DataSourceLocalGateways, - "aws_ec2_managed_prefix_list": DataSourceManagedPrefixList, - "aws_ec2_managed_prefix_lists": DataSourceManagedPrefixLists, - "aws_ec2_network_insights_analysis": DataSourceNetworkInsightsAnalysis, - "aws_ec2_network_insights_path": DataSourceNetworkInsightsPath, - "aws_ec2_serial_console_access": DataSourceSerialConsoleAccess, - "aws_ec2_spot_price": DataSourceSpotPrice, - "aws_ec2_transit_gateway": DataSourceTransitGateway, - "aws_ec2_transit_gateway_attachment": DataSourceTransitGatewayAttachment, - "aws_ec2_transit_gateway_connect": DataSourceTransitGatewayConnect, - "aws_ec2_transit_gateway_connect_peer": DataSourceTransitGatewayConnectPeer, - "aws_ec2_transit_gateway_dx_gateway_attachment": DataSourceTransitGatewayDxGatewayAttachment, - "aws_ec2_transit_gateway_multicast_domain": DataSourceTransitGatewayMulticastDomain, - "aws_ec2_transit_gateway_peering_attachment": DataSourceTransitGatewayPeeringAttachment, - "aws_ec2_transit_gateway_route_table": DataSourceTransitGatewayRouteTable, - "aws_ec2_transit_gateway_route_tables": DataSourceTransitGatewayRouteTables, - "aws_ec2_transit_gateway_vpc_attachment": DataSourceTransitGatewayVPCAttachment, - "aws_ec2_transit_gateway_vpc_attachments": DataSourceTransitGatewayVPCAttachments, - "aws_ec2_transit_gateway_vpn_attachment": DataSourceTransitGatewayVPNAttachment, - "aws_eip": DataSourceEIP, - "aws_eips": DataSourceEIPs, - "aws_instance": DataSourceInstance, - "aws_instances": DataSourceInstances, - "aws_internet_gateway": DataSourceInternetGateway, - "aws_key_pair": DataSourceKeyPair, - "aws_launch_template": DataSourceLaunchTemplate, - "aws_nat_gateway": DataSourceNATGateway, - "aws_nat_gateways": DataSourceNATGateways, - "aws_network_acls": DataSourceNetworkACLs, - "aws_network_interface": DataSourceNetworkInterface, - "aws_network_interfaces": DataSourceNetworkInterfaces, - "aws_prefix_list": DataSourcePrefixList, - "aws_route": DataSourceRoute, - "aws_route_table": DataSourceRouteTable, - "aws_route_tables": DataSourceRouteTables, - "aws_security_group": DataSourceSecurityGroup, - "aws_security_groups": DataSourceSecurityGroups, - "aws_subnet": DataSourceSubnet, - "aws_subnet_ids": DataSourceSubnetIDs, - "aws_subnets": DataSourceSubnets, - "aws_vpc": DataSourceVPC, - "aws_vpc_dhcp_options": DataSourceVPCDHCPOptions, - "aws_vpc_endpoint": DataSourceVPCEndpoint, - "aws_vpc_endpoint_service": DataSourceVPCEndpointService, - "aws_vpc_ipam_pool": DataSourceIPAMPool, - "aws_vpc_ipam_pool_cidrs": DataSourceIPAMPoolCIDRs, - "aws_vpc_ipam_pools": DataSourceIPAMPools, - "aws_vpc_ipam_preview_next_cidr": DataSourceIPAMPreviewNextCIDR, - "aws_vpc_peering_connection": DataSourceVPCPeeringConnection, - "aws_vpc_peering_connections": DataSourceVPCPeeringConnections, - "aws_vpcs": DataSourceVPCs, - "aws_vpn_gateway": DataSourceVPNGateway, +func (p *servicePackage) SDKDataSources(ctx context.Context) []*types.ServicePackageSDKDataSource { + return []*types.ServicePackageSDKDataSource{ + { + Factory: DataSourceAMI, + TypeName: "aws_ami", + }, + { + Factory: DataSourceAMIIDs, + TypeName: "aws_ami_ids", + }, + { + Factory: DataSourceAvailabilityZone, + TypeName: "aws_availability_zone", + }, + { + Factory: DataSourceAvailabilityZones, + TypeName: "aws_availability_zones", + }, + { + Factory: DataSourceCustomerGateway, + TypeName: "aws_customer_gateway", + }, + { + Factory: DataSourceEBSDefaultKMSKey, + TypeName: "aws_ebs_default_kms_key", + }, + { + Factory: DataSourceEBSEncryptionByDefault, + TypeName: "aws_ebs_encryption_by_default", + }, + { + Factory: DataSourceEBSSnapshot, + TypeName: "aws_ebs_snapshot", + }, + { + Factory: DataSourceEBSSnapshotIDs, + TypeName: "aws_ebs_snapshot_ids", + }, + { + Factory: DataSourceEBSVolume, + TypeName: "aws_ebs_volume", + }, + { + Factory: DataSourceEBSVolumes, + TypeName: "aws_ebs_volumes", + }, + { + Factory: DataSourceClientVPNEndpoint, + TypeName: "aws_ec2_client_vpn_endpoint", + }, + { + Factory: DataSourceCoIPPool, + TypeName: "aws_ec2_coip_pool", + }, + { + Factory: DataSourceCoIPPools, + TypeName: "aws_ec2_coip_pools", + }, + { + Factory: DataSourceHost, + TypeName: "aws_ec2_host", + }, + { + Factory: DataSourceInstanceType, + TypeName: "aws_ec2_instance_type", + }, + { + Factory: DataSourceInstanceTypeOffering, + TypeName: "aws_ec2_instance_type_offering", + }, + { + Factory: DataSourceInstanceTypeOfferings, + TypeName: "aws_ec2_instance_type_offerings", + }, + { + Factory: DataSourceInstanceTypes, + TypeName: "aws_ec2_instance_types", + }, + { + Factory: DataSourceLocalGateway, + TypeName: "aws_ec2_local_gateway", + }, + { + Factory: DataSourceLocalGatewayRouteTable, + TypeName: "aws_ec2_local_gateway_route_table", + }, + { + Factory: DataSourceLocalGatewayRouteTables, + TypeName: "aws_ec2_local_gateway_route_tables", + }, + { + Factory: DataSourceLocalGatewayVirtualInterface, + TypeName: "aws_ec2_local_gateway_virtual_interface", + }, + { + Factory: DataSourceLocalGatewayVirtualInterfaceGroup, + TypeName: "aws_ec2_local_gateway_virtual_interface_group", + }, + { + Factory: DataSourceLocalGatewayVirtualInterfaceGroups, + TypeName: "aws_ec2_local_gateway_virtual_interface_groups", + }, + { + Factory: DataSourceLocalGateways, + TypeName: "aws_ec2_local_gateways", + }, + { + Factory: DataSourceManagedPrefixList, + TypeName: "aws_ec2_managed_prefix_list", + }, + { + Factory: DataSourceManagedPrefixLists, + TypeName: "aws_ec2_managed_prefix_lists", + }, + { + Factory: DataSourceNetworkInsightsAnalysis, + TypeName: "aws_ec2_network_insights_analysis", + }, + { + Factory: DataSourceNetworkInsightsPath, + TypeName: "aws_ec2_network_insights_path", + }, + { + Factory: DataSourceSerialConsoleAccess, + TypeName: "aws_ec2_serial_console_access", + }, + { + Factory: DataSourceSpotPrice, + TypeName: "aws_ec2_spot_price", + }, + { + Factory: DataSourceTransitGateway, + TypeName: "aws_ec2_transit_gateway", + }, + { + Factory: DataSourceTransitGatewayAttachment, + TypeName: "aws_ec2_transit_gateway_attachment", + }, + { + Factory: DataSourceTransitGatewayConnect, + TypeName: "aws_ec2_transit_gateway_connect", + }, + { + Factory: DataSourceTransitGatewayConnectPeer, + TypeName: "aws_ec2_transit_gateway_connect_peer", + }, + { + Factory: DataSourceTransitGatewayDxGatewayAttachment, + TypeName: "aws_ec2_transit_gateway_dx_gateway_attachment", + }, + { + Factory: DataSourceTransitGatewayMulticastDomain, + TypeName: "aws_ec2_transit_gateway_multicast_domain", + }, + { + Factory: DataSourceTransitGatewayPeeringAttachment, + TypeName: "aws_ec2_transit_gateway_peering_attachment", + }, + { + Factory: DataSourceTransitGatewayRouteTable, + TypeName: "aws_ec2_transit_gateway_route_table", + }, + { + Factory: DataSourceTransitGatewayRouteTables, + TypeName: "aws_ec2_transit_gateway_route_tables", + }, + { + Factory: DataSourceTransitGatewayVPCAttachment, + TypeName: "aws_ec2_transit_gateway_vpc_attachment", + }, + { + Factory: DataSourceTransitGatewayVPCAttachments, + TypeName: "aws_ec2_transit_gateway_vpc_attachments", + }, + { + Factory: DataSourceTransitGatewayVPNAttachment, + TypeName: "aws_ec2_transit_gateway_vpn_attachment", + }, + { + Factory: DataSourceEIP, + TypeName: "aws_eip", + }, + { + Factory: DataSourceEIPs, + TypeName: "aws_eips", + }, + { + Factory: DataSourceInstance, + TypeName: "aws_instance", + }, + { + Factory: DataSourceInstances, + TypeName: "aws_instances", + }, + { + Factory: DataSourceInternetGateway, + TypeName: "aws_internet_gateway", + }, + { + Factory: DataSourceKeyPair, + TypeName: "aws_key_pair", + }, + { + Factory: DataSourceLaunchTemplate, + TypeName: "aws_launch_template", + }, + { + Factory: DataSourceNATGateway, + TypeName: "aws_nat_gateway", + }, + { + Factory: DataSourceNATGateways, + TypeName: "aws_nat_gateways", + }, + { + Factory: DataSourceNetworkACLs, + TypeName: "aws_network_acls", + }, + { + Factory: DataSourceNetworkInterface, + TypeName: "aws_network_interface", + }, + { + Factory: DataSourceNetworkInterfaces, + TypeName: "aws_network_interfaces", + }, + { + Factory: DataSourcePrefixList, + TypeName: "aws_prefix_list", + }, + { + Factory: DataSourceRoute, + TypeName: "aws_route", + }, + { + Factory: DataSourceRouteTable, + TypeName: "aws_route_table", + }, + { + Factory: DataSourceRouteTables, + TypeName: "aws_route_tables", + }, + { + Factory: DataSourceSecurityGroup, + TypeName: "aws_security_group", + }, + { + Factory: DataSourceSecurityGroups, + TypeName: "aws_security_groups", + }, + { + Factory: DataSourceSubnet, + TypeName: "aws_subnet", + }, + { + Factory: DataSourceSubnetIDs, + TypeName: "aws_subnet_ids", + }, + { + Factory: DataSourceSubnets, + TypeName: "aws_subnets", + }, + { + Factory: DataSourceVPC, + TypeName: "aws_vpc", + }, + { + Factory: DataSourceVPCDHCPOptions, + TypeName: "aws_vpc_dhcp_options", + }, + { + Factory: DataSourceVPCEndpoint, + TypeName: "aws_vpc_endpoint", + }, + { + Factory: DataSourceVPCEndpointService, + TypeName: "aws_vpc_endpoint_service", + }, + { + Factory: DataSourceIPAMPool, + TypeName: "aws_vpc_ipam_pool", + }, + { + Factory: DataSourceIPAMPoolCIDRs, + TypeName: "aws_vpc_ipam_pool_cidrs", + }, + { + Factory: DataSourceIPAMPools, + TypeName: "aws_vpc_ipam_pools", + }, + { + Factory: DataSourceIPAMPreviewNextCIDR, + TypeName: "aws_vpc_ipam_preview_next_cidr", + }, + { + Factory: DataSourceVPCPeeringConnection, + TypeName: "aws_vpc_peering_connection", + }, + { + Factory: DataSourceVPCPeeringConnections, + TypeName: "aws_vpc_peering_connections", + }, + { + Factory: DataSourceVPCs, + TypeName: "aws_vpcs", + }, + { + Factory: DataSourceVPNGateway, + TypeName: "aws_vpn_gateway", + }, } } -func (p *servicePackage) SDKResources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{ - "aws_ami": ResourceAMI, - "aws_ami_copy": ResourceAMICopy, - "aws_ami_from_instance": ResourceAMIFromInstance, - "aws_ami_launch_permission": ResourceAMILaunchPermission, - "aws_customer_gateway": ResourceCustomerGateway, - "aws_default_network_acl": ResourceDefaultNetworkACL, - "aws_default_route_table": ResourceDefaultRouteTable, - "aws_default_security_group": ResourceDefaultSecurityGroup, - "aws_default_subnet": ResourceDefaultSubnet, - "aws_default_vpc": ResourceDefaultVPC, - "aws_default_vpc_dhcp_options": ResourceDefaultVPCDHCPOptions, - "aws_ebs_default_kms_key": ResourceEBSDefaultKMSKey, - "aws_ebs_encryption_by_default": ResourceEBSEncryptionByDefault, - "aws_ebs_snapshot": ResourceEBSSnapshot, - "aws_ebs_snapshot_copy": ResourceEBSSnapshotCopy, - "aws_ebs_snapshot_import": ResourceEBSSnapshotImport, - "aws_ebs_volume": ResourceEBSVolume, - "aws_ec2_availability_zone_group": ResourceAvailabilityZoneGroup, - "aws_ec2_capacity_reservation": ResourceCapacityReservation, - "aws_ec2_carrier_gateway": ResourceCarrierGateway, - "aws_ec2_client_vpn_authorization_rule": ResourceClientVPNAuthorizationRule, - "aws_ec2_client_vpn_endpoint": ResourceClientVPNEndpoint, - "aws_ec2_client_vpn_network_association": ResourceClientVPNNetworkAssociation, - "aws_ec2_client_vpn_route": ResourceClientVPNRoute, - "aws_ec2_fleet": ResourceFleet, - "aws_ec2_host": ResourceHost, - "aws_ec2_instance_state": ResourceInstanceState, - "aws_ec2_local_gateway_route": ResourceLocalGatewayRoute, - "aws_ec2_local_gateway_route_table_vpc_association": ResourceLocalGatewayRouteTableVPCAssociation, - "aws_ec2_managed_prefix_list": ResourceManagedPrefixList, - "aws_ec2_managed_prefix_list_entry": ResourceManagedPrefixListEntry, - "aws_ec2_network_insights_analysis": ResourceNetworkInsightsAnalysis, - "aws_ec2_network_insights_path": ResourceNetworkInsightsPath, - "aws_ec2_serial_console_access": ResourceSerialConsoleAccess, - "aws_ec2_subnet_cidr_reservation": ResourceSubnetCIDRReservation, - "aws_ec2_tag": ResourceTag, - "aws_ec2_traffic_mirror_filter": ResourceTrafficMirrorFilter, - "aws_ec2_traffic_mirror_filter_rule": ResourceTrafficMirrorFilterRule, - "aws_ec2_traffic_mirror_session": ResourceTrafficMirrorSession, - "aws_ec2_traffic_mirror_target": ResourceTrafficMirrorTarget, - "aws_ec2_transit_gateway": ResourceTransitGateway, - "aws_ec2_transit_gateway_connect": ResourceTransitGatewayConnect, - "aws_ec2_transit_gateway_connect_peer": ResourceTransitGatewayConnectPeer, - "aws_ec2_transit_gateway_multicast_domain": ResourceTransitGatewayMulticastDomain, - "aws_ec2_transit_gateway_multicast_domain_association": ResourceTransitGatewayMulticastDomainAssociation, - "aws_ec2_transit_gateway_multicast_group_member": ResourceTransitGatewayMulticastGroupMember, - "aws_ec2_transit_gateway_multicast_group_source": ResourceTransitGatewayMulticastGroupSource, - "aws_ec2_transit_gateway_peering_attachment": ResourceTransitGatewayPeeringAttachment, - "aws_ec2_transit_gateway_peering_attachment_accepter": ResourceTransitGatewayPeeringAttachmentAccepter, - "aws_ec2_transit_gateway_policy_table": ResourceTransitGatewayPolicyTable, - "aws_ec2_transit_gateway_policy_table_association": ResourceTransitGatewayPolicyTableAssociation, - "aws_ec2_transit_gateway_prefix_list_reference": ResourceTransitGatewayPrefixListReference, - "aws_ec2_transit_gateway_route": ResourceTransitGatewayRoute, - "aws_ec2_transit_gateway_route_table": ResourceTransitGatewayRouteTable, - "aws_ec2_transit_gateway_route_table_association": ResourceTransitGatewayRouteTableAssociation, - "aws_ec2_transit_gateway_route_table_propagation": ResourceTransitGatewayRouteTablePropagation, - "aws_ec2_transit_gateway_vpc_attachment": ResourceTransitGatewayVPCAttachment, - "aws_ec2_transit_gateway_vpc_attachment_accepter": ResourceTransitGatewayVPCAttachmentAccepter, - "aws_egress_only_internet_gateway": ResourceEgressOnlyInternetGateway, - "aws_eip": ResourceEIP, - "aws_eip_association": ResourceEIPAssociation, - "aws_flow_log": ResourceFlowLog, - "aws_instance": ResourceInstance, - "aws_internet_gateway": ResourceInternetGateway, - "aws_internet_gateway_attachment": ResourceInternetGatewayAttachment, - "aws_key_pair": ResourceKeyPair, - "aws_launch_template": ResourceLaunchTemplate, - "aws_main_route_table_association": ResourceMainRouteTableAssociation, - "aws_nat_gateway": ResourceNATGateway, - "aws_network_acl": ResourceNetworkACL, - "aws_network_acl_association": ResourceNetworkACLAssociation, - "aws_network_acl_rule": ResourceNetworkACLRule, - "aws_network_interface": ResourceNetworkInterface, - "aws_network_interface_attachment": ResourceNetworkInterfaceAttachment, - "aws_network_interface_sg_attachment": ResourceNetworkInterfaceSGAttachment, - "aws_placement_group": ResourcePlacementGroup, - "aws_route": ResourceRoute, - "aws_route_table": ResourceRouteTable, - "aws_route_table_association": ResourceRouteTableAssociation, - "aws_security_group": ResourceSecurityGroup, - "aws_security_group_rule": ResourceSecurityGroupRule, - "aws_snapshot_create_volume_permission": ResourceSnapshotCreateVolumePermission, - "aws_spot_datafeed_subscription": ResourceSpotDataFeedSubscription, - "aws_spot_fleet_request": ResourceSpotFleetRequest, - "aws_spot_instance_request": ResourceSpotInstanceRequest, - "aws_subnet": ResourceSubnet, - "aws_volume_attachment": ResourceVolumeAttachment, - "aws_vpc": ResourceVPC, - "aws_vpc_dhcp_options": ResourceVPCDHCPOptions, - "aws_vpc_dhcp_options_association": ResourceVPCDHCPOptionsAssociation, - "aws_vpc_endpoint": ResourceVPCEndpoint, - "aws_vpc_endpoint_connection_accepter": ResourceVPCEndpointConnectionAccepter, - "aws_vpc_endpoint_connection_notification": ResourceVPCEndpointConnectionNotification, - "aws_vpc_endpoint_policy": ResourceVPCEndpointPolicy, - "aws_vpc_endpoint_route_table_association": ResourceVPCEndpointRouteTableAssociation, - "aws_vpc_endpoint_security_group_association": ResourceVPCEndpointSecurityGroupAssociation, - "aws_vpc_endpoint_service": ResourceVPCEndpointService, - "aws_vpc_endpoint_service_allowed_principal": ResourceVPCEndpointServiceAllowedPrincipal, - "aws_vpc_endpoint_subnet_association": ResourceVPCEndpointSubnetAssociation, - "aws_vpc_ipam": ResourceIPAM, - "aws_vpc_ipam_organization_admin_account": ResourceIPAMOrganizationAdminAccount, - "aws_vpc_ipam_pool": ResourceIPAMPool, - "aws_vpc_ipam_pool_cidr": ResourceIPAMPoolCIDR, - "aws_vpc_ipam_pool_cidr_allocation": ResourceIPAMPoolCIDRAllocation, - "aws_vpc_ipam_preview_next_cidr": ResourceIPAMPreviewNextCIDR, - "aws_vpc_ipam_resource_discovery": ResourceIPAMResourceDiscovery, - "aws_vpc_ipam_resource_discovery_association": ResourceIPAMResourceDiscoveryAssociation, - "aws_vpc_ipam_scope": ResourceIPAMScope, - "aws_vpc_ipv4_cidr_block_association": ResourceVPCIPv4CIDRBlockAssociation, - "aws_vpc_ipv6_cidr_block_association": ResourceVPCIPv6CIDRBlockAssociation, - "aws_vpc_network_performance_metric_subscription": ResourceNetworkPerformanceMetricSubscription, - "aws_vpc_peering_connection": ResourceVPCPeeringConnection, - "aws_vpc_peering_connection_accepter": ResourceVPCPeeringConnectionAccepter, - "aws_vpc_peering_connection_options": ResourceVPCPeeringConnectionOptions, - "aws_vpn_connection": ResourceVPNConnection, - "aws_vpn_connection_route": ResourceVPNConnectionRoute, - "aws_vpn_gateway": ResourceVPNGateway, - "aws_vpn_gateway_attachment": ResourceVPNGatewayAttachment, - "aws_vpn_gateway_route_propagation": ResourceVPNGatewayRoutePropagation, +func (p *servicePackage) SDKResources(ctx context.Context) []*types.ServicePackageSDKResource { + return []*types.ServicePackageSDKResource{ + { + Factory: ResourceAMI, + TypeName: "aws_ami", + }, + { + Factory: ResourceAMICopy, + TypeName: "aws_ami_copy", + }, + { + Factory: ResourceAMIFromInstance, + TypeName: "aws_ami_from_instance", + }, + { + Factory: ResourceAMILaunchPermission, + TypeName: "aws_ami_launch_permission", + }, + { + Factory: ResourceCustomerGateway, + TypeName: "aws_customer_gateway", + }, + { + Factory: ResourceDefaultNetworkACL, + TypeName: "aws_default_network_acl", + }, + { + Factory: ResourceDefaultRouteTable, + TypeName: "aws_default_route_table", + }, + { + Factory: ResourceDefaultSecurityGroup, + TypeName: "aws_default_security_group", + }, + { + Factory: ResourceDefaultSubnet, + TypeName: "aws_default_subnet", + }, + { + Factory: ResourceDefaultVPC, + TypeName: "aws_default_vpc", + }, + { + Factory: ResourceDefaultVPCDHCPOptions, + TypeName: "aws_default_vpc_dhcp_options", + }, + { + Factory: ResourceEBSDefaultKMSKey, + TypeName: "aws_ebs_default_kms_key", + }, + { + Factory: ResourceEBSEncryptionByDefault, + TypeName: "aws_ebs_encryption_by_default", + }, + { + Factory: ResourceEBSSnapshot, + TypeName: "aws_ebs_snapshot", + }, + { + Factory: ResourceEBSSnapshotCopy, + TypeName: "aws_ebs_snapshot_copy", + }, + { + Factory: ResourceEBSSnapshotImport, + TypeName: "aws_ebs_snapshot_import", + }, + { + Factory: ResourceEBSVolume, + TypeName: "aws_ebs_volume", + }, + { + Factory: ResourceAvailabilityZoneGroup, + TypeName: "aws_ec2_availability_zone_group", + }, + { + Factory: ResourceCapacityReservation, + TypeName: "aws_ec2_capacity_reservation", + }, + { + Factory: ResourceCarrierGateway, + TypeName: "aws_ec2_carrier_gateway", + }, + { + Factory: ResourceClientVPNAuthorizationRule, + TypeName: "aws_ec2_client_vpn_authorization_rule", + }, + { + Factory: ResourceClientVPNEndpoint, + TypeName: "aws_ec2_client_vpn_endpoint", + }, + { + Factory: ResourceClientVPNNetworkAssociation, + TypeName: "aws_ec2_client_vpn_network_association", + }, + { + Factory: ResourceClientVPNRoute, + TypeName: "aws_ec2_client_vpn_route", + }, + { + Factory: ResourceFleet, + TypeName: "aws_ec2_fleet", + }, + { + Factory: ResourceHost, + TypeName: "aws_ec2_host", + }, + { + Factory: ResourceInstanceState, + TypeName: "aws_ec2_instance_state", + }, + { + Factory: ResourceLocalGatewayRoute, + TypeName: "aws_ec2_local_gateway_route", + }, + { + Factory: ResourceLocalGatewayRouteTableVPCAssociation, + TypeName: "aws_ec2_local_gateway_route_table_vpc_association", + }, + { + Factory: ResourceManagedPrefixList, + TypeName: "aws_ec2_managed_prefix_list", + }, + { + Factory: ResourceManagedPrefixListEntry, + TypeName: "aws_ec2_managed_prefix_list_entry", + }, + { + Factory: ResourceNetworkInsightsAnalysis, + TypeName: "aws_ec2_network_insights_analysis", + }, + { + Factory: ResourceNetworkInsightsPath, + TypeName: "aws_ec2_network_insights_path", + }, + { + Factory: ResourceSerialConsoleAccess, + TypeName: "aws_ec2_serial_console_access", + }, + { + Factory: ResourceSubnetCIDRReservation, + TypeName: "aws_ec2_subnet_cidr_reservation", + }, + { + Factory: ResourceTag, + TypeName: "aws_ec2_tag", + }, + { + Factory: ResourceTrafficMirrorFilter, + TypeName: "aws_ec2_traffic_mirror_filter", + }, + { + Factory: ResourceTrafficMirrorFilterRule, + TypeName: "aws_ec2_traffic_mirror_filter_rule", + }, + { + Factory: ResourceTrafficMirrorSession, + TypeName: "aws_ec2_traffic_mirror_session", + }, + { + Factory: ResourceTrafficMirrorTarget, + TypeName: "aws_ec2_traffic_mirror_target", + }, + { + Factory: ResourceTransitGateway, + TypeName: "aws_ec2_transit_gateway", + }, + { + Factory: ResourceTransitGatewayConnect, + TypeName: "aws_ec2_transit_gateway_connect", + }, + { + Factory: ResourceTransitGatewayConnectPeer, + TypeName: "aws_ec2_transit_gateway_connect_peer", + }, + { + Factory: ResourceTransitGatewayMulticastDomain, + TypeName: "aws_ec2_transit_gateway_multicast_domain", + }, + { + Factory: ResourceTransitGatewayMulticastDomainAssociation, + TypeName: "aws_ec2_transit_gateway_multicast_domain_association", + }, + { + Factory: ResourceTransitGatewayMulticastGroupMember, + TypeName: "aws_ec2_transit_gateway_multicast_group_member", + }, + { + Factory: ResourceTransitGatewayMulticastGroupSource, + TypeName: "aws_ec2_transit_gateway_multicast_group_source", + }, + { + Factory: ResourceTransitGatewayPeeringAttachment, + TypeName: "aws_ec2_transit_gateway_peering_attachment", + }, + { + Factory: ResourceTransitGatewayPeeringAttachmentAccepter, + TypeName: "aws_ec2_transit_gateway_peering_attachment_accepter", + }, + { + Factory: ResourceTransitGatewayPolicyTable, + TypeName: "aws_ec2_transit_gateway_policy_table", + }, + { + Factory: ResourceTransitGatewayPolicyTableAssociation, + TypeName: "aws_ec2_transit_gateway_policy_table_association", + }, + { + Factory: ResourceTransitGatewayPrefixListReference, + TypeName: "aws_ec2_transit_gateway_prefix_list_reference", + }, + { + Factory: ResourceTransitGatewayRoute, + TypeName: "aws_ec2_transit_gateway_route", + }, + { + Factory: ResourceTransitGatewayRouteTable, + TypeName: "aws_ec2_transit_gateway_route_table", + }, + { + Factory: ResourceTransitGatewayRouteTableAssociation, + TypeName: "aws_ec2_transit_gateway_route_table_association", + }, + { + Factory: ResourceTransitGatewayRouteTablePropagation, + TypeName: "aws_ec2_transit_gateway_route_table_propagation", + }, + { + Factory: ResourceTransitGatewayVPCAttachment, + TypeName: "aws_ec2_transit_gateway_vpc_attachment", + }, + { + Factory: ResourceTransitGatewayVPCAttachmentAccepter, + TypeName: "aws_ec2_transit_gateway_vpc_attachment_accepter", + }, + { + Factory: ResourceEgressOnlyInternetGateway, + TypeName: "aws_egress_only_internet_gateway", + }, + { + Factory: ResourceEIP, + TypeName: "aws_eip", + }, + { + Factory: ResourceEIPAssociation, + TypeName: "aws_eip_association", + }, + { + Factory: ResourceFlowLog, + TypeName: "aws_flow_log", + }, + { + Factory: ResourceInstance, + TypeName: "aws_instance", + }, + { + Factory: ResourceInternetGateway, + TypeName: "aws_internet_gateway", + }, + { + Factory: ResourceInternetGatewayAttachment, + TypeName: "aws_internet_gateway_attachment", + }, + { + Factory: ResourceKeyPair, + TypeName: "aws_key_pair", + }, + { + Factory: ResourceLaunchTemplate, + TypeName: "aws_launch_template", + }, + { + Factory: ResourceMainRouteTableAssociation, + TypeName: "aws_main_route_table_association", + }, + { + Factory: ResourceNATGateway, + TypeName: "aws_nat_gateway", + }, + { + Factory: ResourceNetworkACL, + TypeName: "aws_network_acl", + }, + { + Factory: ResourceNetworkACLAssociation, + TypeName: "aws_network_acl_association", + }, + { + Factory: ResourceNetworkACLRule, + TypeName: "aws_network_acl_rule", + }, + { + Factory: ResourceNetworkInterface, + TypeName: "aws_network_interface", + }, + { + Factory: ResourceNetworkInterfaceAttachment, + TypeName: "aws_network_interface_attachment", + }, + { + Factory: ResourceNetworkInterfaceSGAttachment, + TypeName: "aws_network_interface_sg_attachment", + }, + { + Factory: ResourcePlacementGroup, + TypeName: "aws_placement_group", + }, + { + Factory: ResourceRoute, + TypeName: "aws_route", + }, + { + Factory: ResourceRouteTable, + TypeName: "aws_route_table", + }, + { + Factory: ResourceRouteTableAssociation, + TypeName: "aws_route_table_association", + }, + { + Factory: ResourceSecurityGroup, + TypeName: "aws_security_group", + }, + { + Factory: ResourceSecurityGroupRule, + TypeName: "aws_security_group_rule", + }, + { + Factory: ResourceSnapshotCreateVolumePermission, + TypeName: "aws_snapshot_create_volume_permission", + }, + { + Factory: ResourceSpotDataFeedSubscription, + TypeName: "aws_spot_datafeed_subscription", + }, + { + Factory: ResourceSpotFleetRequest, + TypeName: "aws_spot_fleet_request", + }, + { + Factory: ResourceSpotInstanceRequest, + TypeName: "aws_spot_instance_request", + }, + { + Factory: ResourceSubnet, + TypeName: "aws_subnet", + }, + { + Factory: ResourceVolumeAttachment, + TypeName: "aws_volume_attachment", + }, + { + Factory: ResourceVPC, + TypeName: "aws_vpc", + }, + { + Factory: ResourceVPCDHCPOptions, + TypeName: "aws_vpc_dhcp_options", + }, + { + Factory: ResourceVPCDHCPOptionsAssociation, + TypeName: "aws_vpc_dhcp_options_association", + }, + { + Factory: ResourceVPCEndpoint, + TypeName: "aws_vpc_endpoint", + }, + { + Factory: ResourceVPCEndpointConnectionAccepter, + TypeName: "aws_vpc_endpoint_connection_accepter", + }, + { + Factory: ResourceVPCEndpointConnectionNotification, + TypeName: "aws_vpc_endpoint_connection_notification", + }, + { + Factory: ResourceVPCEndpointPolicy, + TypeName: "aws_vpc_endpoint_policy", + }, + { + Factory: ResourceVPCEndpointRouteTableAssociation, + TypeName: "aws_vpc_endpoint_route_table_association", + }, + { + Factory: ResourceVPCEndpointSecurityGroupAssociation, + TypeName: "aws_vpc_endpoint_security_group_association", + }, + { + Factory: ResourceVPCEndpointService, + TypeName: "aws_vpc_endpoint_service", + }, + { + Factory: ResourceVPCEndpointServiceAllowedPrincipal, + TypeName: "aws_vpc_endpoint_service_allowed_principal", + }, + { + Factory: ResourceVPCEndpointSubnetAssociation, + TypeName: "aws_vpc_endpoint_subnet_association", + }, + { + Factory: ResourceIPAM, + TypeName: "aws_vpc_ipam", + }, + { + Factory: ResourceIPAMOrganizationAdminAccount, + TypeName: "aws_vpc_ipam_organization_admin_account", + }, + { + Factory: ResourceIPAMPool, + TypeName: "aws_vpc_ipam_pool", + }, + { + Factory: ResourceIPAMPoolCIDR, + TypeName: "aws_vpc_ipam_pool_cidr", + }, + { + Factory: ResourceIPAMPoolCIDRAllocation, + TypeName: "aws_vpc_ipam_pool_cidr_allocation", + }, + { + Factory: ResourceIPAMPreviewNextCIDR, + TypeName: "aws_vpc_ipam_preview_next_cidr", + }, + { + Factory: ResourceIPAMResourceDiscovery, + TypeName: "aws_vpc_ipam_resource_discovery", + }, + { + Factory: ResourceIPAMResourceDiscoveryAssociation, + TypeName: "aws_vpc_ipam_resource_discovery_association", + }, + { + Factory: ResourceIPAMScope, + TypeName: "aws_vpc_ipam_scope", + }, + { + Factory: ResourceVPCIPv4CIDRBlockAssociation, + TypeName: "aws_vpc_ipv4_cidr_block_association", + }, + { + Factory: ResourceVPCIPv6CIDRBlockAssociation, + TypeName: "aws_vpc_ipv6_cidr_block_association", + }, + { + Factory: ResourceNetworkPerformanceMetricSubscription, + TypeName: "aws_vpc_network_performance_metric_subscription", + }, + { + Factory: ResourceVPCPeeringConnection, + TypeName: "aws_vpc_peering_connection", + }, + { + Factory: ResourceVPCPeeringConnectionAccepter, + TypeName: "aws_vpc_peering_connection_accepter", + }, + { + Factory: ResourceVPCPeeringConnectionOptions, + TypeName: "aws_vpc_peering_connection_options", + }, + { + Factory: ResourceVPNConnection, + TypeName: "aws_vpn_connection", + }, + { + Factory: ResourceVPNConnectionRoute, + TypeName: "aws_vpn_connection_route", + }, + { + Factory: ResourceVPNGateway, + TypeName: "aws_vpn_gateway", + }, + { + Factory: ResourceVPNGatewayAttachment, + TypeName: "aws_vpn_gateway_attachment", + }, + { + Factory: ResourceVPNGatewayRoutePropagation, + TypeName: "aws_vpn_gateway_route_propagation", + }, } } diff --git a/internal/service/ecr/service_package_gen.go b/internal/service/ecr/service_package_gen.go index 9725c4c4ca00..7c2549d45d56 100644 --- a/internal/service/ecr/service_package_gen.go +++ b/internal/service/ecr/service_package_gen.go @@ -5,39 +5,67 @@ package ecr import ( "context" - "github.com/hashicorp/terraform-plugin-framework/datasource" - "github.com/hashicorp/terraform-plugin-framework/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "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) []func(context.Context) (datasource.DataSourceWithConfigure, error) { - return []func(context.Context) (datasource.DataSourceWithConfigure, error){} +func (p *servicePackage) FrameworkDataSources(ctx context.Context) []*types.ServicePackageFrameworkDataSource { + return []*types.ServicePackageFrameworkDataSource{} } -func (p *servicePackage) FrameworkResources(ctx context.Context) []func(context.Context) (resource.ResourceWithConfigure, error) { - return []func(context.Context) (resource.ResourceWithConfigure, error){} +func (p *servicePackage) FrameworkResources(ctx context.Context) []*types.ServicePackageFrameworkResource { + return []*types.ServicePackageFrameworkResource{} } -func (p *servicePackage) SDKDataSources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{ - "aws_ecr_authorization_token": DataSourceAuthorizationToken, - "aws_ecr_image": DataSourceImage, - "aws_ecr_repository": DataSourceRepository, +func (p *servicePackage) SDKDataSources(ctx context.Context) []*types.ServicePackageSDKDataSource { + return []*types.ServicePackageSDKDataSource{ + { + Factory: DataSourceAuthorizationToken, + TypeName: "aws_ecr_authorization_token", + }, + { + Factory: DataSourceImage, + TypeName: "aws_ecr_image", + }, + { + Factory: DataSourceRepository, + TypeName: "aws_ecr_repository", + }, } } -func (p *servicePackage) SDKResources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{ - "aws_ecr_lifecycle_policy": ResourceLifecyclePolicy, - "aws_ecr_pull_through_cache_rule": ResourcePullThroughCacheRule, - "aws_ecr_registry_policy": ResourceRegistryPolicy, - "aws_ecr_registry_scanning_configuration": ResourceRegistryScanningConfiguration, - "aws_ecr_replication_configuration": ResourceReplicationConfiguration, - "aws_ecr_repository": ResourceRepository, - "aws_ecr_repository_policy": ResourceRepositoryPolicy, +func (p *servicePackage) SDKResources(ctx context.Context) []*types.ServicePackageSDKResource { + return []*types.ServicePackageSDKResource{ + { + Factory: ResourceLifecyclePolicy, + TypeName: "aws_ecr_lifecycle_policy", + }, + { + Factory: ResourcePullThroughCacheRule, + TypeName: "aws_ecr_pull_through_cache_rule", + }, + { + Factory: ResourceRegistryPolicy, + TypeName: "aws_ecr_registry_policy", + }, + { + Factory: ResourceRegistryScanningConfiguration, + TypeName: "aws_ecr_registry_scanning_configuration", + }, + { + Factory: ResourceReplicationConfiguration, + TypeName: "aws_ecr_replication_configuration", + }, + { + Factory: ResourceRepository, + TypeName: "aws_ecr_repository", + }, + { + Factory: ResourceRepositoryPolicy, + TypeName: "aws_ecr_repository_policy", + }, } } diff --git a/internal/service/ecrpublic/service_package_gen.go b/internal/service/ecrpublic/service_package_gen.go index a370df50cc7e..3978ba938559 100644 --- a/internal/service/ecrpublic/service_package_gen.go +++ b/internal/service/ecrpublic/service_package_gen.go @@ -5,32 +5,39 @@ package ecrpublic import ( "context" - "github.com/hashicorp/terraform-plugin-framework/datasource" - "github.com/hashicorp/terraform-plugin-framework/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "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) []func(context.Context) (datasource.DataSourceWithConfigure, error) { - return []func(context.Context) (datasource.DataSourceWithConfigure, error){} +func (p *servicePackage) FrameworkDataSources(ctx context.Context) []*types.ServicePackageFrameworkDataSource { + return []*types.ServicePackageFrameworkDataSource{} } -func (p *servicePackage) FrameworkResources(ctx context.Context) []func(context.Context) (resource.ResourceWithConfigure, error) { - return []func(context.Context) (resource.ResourceWithConfigure, error){} +func (p *servicePackage) FrameworkResources(ctx context.Context) []*types.ServicePackageFrameworkResource { + return []*types.ServicePackageFrameworkResource{} } -func (p *servicePackage) SDKDataSources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{ - "aws_ecrpublic_authorization_token": DataSourceAuthorizationToken, +func (p *servicePackage) SDKDataSources(ctx context.Context) []*types.ServicePackageSDKDataSource { + return []*types.ServicePackageSDKDataSource{ + { + Factory: DataSourceAuthorizationToken, + TypeName: "aws_ecrpublic_authorization_token", + }, } } -func (p *servicePackage) SDKResources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{ - "aws_ecrpublic_repository": ResourceRepository, - "aws_ecrpublic_repository_policy": ResourceRepositoryPolicy, +func (p *servicePackage) SDKResources(ctx context.Context) []*types.ServicePackageSDKResource { + return []*types.ServicePackageSDKResource{ + { + Factory: ResourceRepository, + TypeName: "aws_ecrpublic_repository", + }, + { + Factory: ResourceRepositoryPolicy, + TypeName: "aws_ecrpublic_repository_policy", + }, } } diff --git a/internal/service/ecs/service_package_gen.go b/internal/service/ecs/service_package_gen.go index 238a14617987..1afd55c88944 100644 --- a/internal/service/ecs/service_package_gen.go +++ b/internal/service/ecs/service_package_gen.go @@ -5,42 +5,79 @@ package ecs import ( "context" - "github.com/hashicorp/terraform-plugin-framework/datasource" - "github.com/hashicorp/terraform-plugin-framework/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "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) []func(context.Context) (datasource.DataSourceWithConfigure, error) { - return []func(context.Context) (datasource.DataSourceWithConfigure, error){} +func (p *servicePackage) FrameworkDataSources(ctx context.Context) []*types.ServicePackageFrameworkDataSource { + return []*types.ServicePackageFrameworkDataSource{} } -func (p *servicePackage) FrameworkResources(ctx context.Context) []func(context.Context) (resource.ResourceWithConfigure, error) { - return []func(context.Context) (resource.ResourceWithConfigure, error){} +func (p *servicePackage) FrameworkResources(ctx context.Context) []*types.ServicePackageFrameworkResource { + return []*types.ServicePackageFrameworkResource{} } -func (p *servicePackage) SDKDataSources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{ - "aws_ecs_cluster": DataSourceCluster, - "aws_ecs_container_definition": DataSourceContainerDefinition, - "aws_ecs_service": DataSourceService, - "aws_ecs_task_definition": DataSourceTaskDefinition, - "aws_ecs_task_execution": DataSourceTaskExecution, +func (p *servicePackage) SDKDataSources(ctx context.Context) []*types.ServicePackageSDKDataSource { + return []*types.ServicePackageSDKDataSource{ + { + Factory: DataSourceCluster, + TypeName: "aws_ecs_cluster", + }, + { + Factory: DataSourceContainerDefinition, + TypeName: "aws_ecs_container_definition", + }, + { + Factory: DataSourceService, + TypeName: "aws_ecs_service", + }, + { + Factory: DataSourceTaskDefinition, + TypeName: "aws_ecs_task_definition", + }, + { + Factory: DataSourceTaskExecution, + TypeName: "aws_ecs_task_execution", + }, } } -func (p *servicePackage) SDKResources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{ - "aws_ecs_account_setting_default": ResourceAccountSettingDefault, - "aws_ecs_capacity_provider": ResourceCapacityProvider, - "aws_ecs_cluster": ResourceCluster, - "aws_ecs_cluster_capacity_providers": ResourceClusterCapacityProviders, - "aws_ecs_service": ResourceService, - "aws_ecs_tag": ResourceTag, - "aws_ecs_task_definition": ResourceTaskDefinition, - "aws_ecs_task_set": ResourceTaskSet, +func (p *servicePackage) SDKResources(ctx context.Context) []*types.ServicePackageSDKResource { + return []*types.ServicePackageSDKResource{ + { + Factory: ResourceAccountSettingDefault, + TypeName: "aws_ecs_account_setting_default", + }, + { + Factory: ResourceCapacityProvider, + TypeName: "aws_ecs_capacity_provider", + }, + { + Factory: ResourceCluster, + TypeName: "aws_ecs_cluster", + }, + { + Factory: ResourceClusterCapacityProviders, + TypeName: "aws_ecs_cluster_capacity_providers", + }, + { + Factory: ResourceService, + TypeName: "aws_ecs_service", + }, + { + Factory: ResourceTag, + TypeName: "aws_ecs_tag", + }, + { + Factory: ResourceTaskDefinition, + TypeName: "aws_ecs_task_definition", + }, + { + Factory: ResourceTaskSet, + TypeName: "aws_ecs_task_set", + }, } } diff --git a/internal/service/efs/service_package_gen.go b/internal/service/efs/service_package_gen.go index ae8cb6c6434e..d92c04e6931a 100644 --- a/internal/service/efs/service_package_gen.go +++ b/internal/service/efs/service_package_gen.go @@ -5,39 +5,67 @@ package efs import ( "context" - "github.com/hashicorp/terraform-plugin-framework/datasource" - "github.com/hashicorp/terraform-plugin-framework/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "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) []func(context.Context) (datasource.DataSourceWithConfigure, error) { - return []func(context.Context) (datasource.DataSourceWithConfigure, error){} +func (p *servicePackage) FrameworkDataSources(ctx context.Context) []*types.ServicePackageFrameworkDataSource { + return []*types.ServicePackageFrameworkDataSource{} } -func (p *servicePackage) FrameworkResources(ctx context.Context) []func(context.Context) (resource.ResourceWithConfigure, error) { - return []func(context.Context) (resource.ResourceWithConfigure, error){} +func (p *servicePackage) FrameworkResources(ctx context.Context) []*types.ServicePackageFrameworkResource { + return []*types.ServicePackageFrameworkResource{} } -func (p *servicePackage) SDKDataSources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{ - "aws_efs_access_point": DataSourceAccessPoint, - "aws_efs_access_points": DataSourceAccessPoints, - "aws_efs_file_system": DataSourceFileSystem, - "aws_efs_mount_target": DataSourceMountTarget, +func (p *servicePackage) SDKDataSources(ctx context.Context) []*types.ServicePackageSDKDataSource { + return []*types.ServicePackageSDKDataSource{ + { + Factory: DataSourceAccessPoint, + TypeName: "aws_efs_access_point", + }, + { + Factory: DataSourceAccessPoints, + TypeName: "aws_efs_access_points", + }, + { + Factory: DataSourceFileSystem, + TypeName: "aws_efs_file_system", + }, + { + Factory: DataSourceMountTarget, + TypeName: "aws_efs_mount_target", + }, } } -func (p *servicePackage) SDKResources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{ - "aws_efs_access_point": ResourceAccessPoint, - "aws_efs_backup_policy": ResourceBackupPolicy, - "aws_efs_file_system": ResourceFileSystem, - "aws_efs_file_system_policy": ResourceFileSystemPolicy, - "aws_efs_mount_target": ResourceMountTarget, - "aws_efs_replication_configuration": ResourceReplicationConfiguration, +func (p *servicePackage) SDKResources(ctx context.Context) []*types.ServicePackageSDKResource { + return []*types.ServicePackageSDKResource{ + { + Factory: ResourceAccessPoint, + TypeName: "aws_efs_access_point", + }, + { + Factory: ResourceBackupPolicy, + TypeName: "aws_efs_backup_policy", + }, + { + Factory: ResourceFileSystem, + TypeName: "aws_efs_file_system", + }, + { + Factory: ResourceFileSystemPolicy, + TypeName: "aws_efs_file_system_policy", + }, + { + Factory: ResourceMountTarget, + TypeName: "aws_efs_mount_target", + }, + { + Factory: ResourceReplicationConfiguration, + TypeName: "aws_efs_replication_configuration", + }, } } diff --git a/internal/service/eks/service_package_gen.go b/internal/service/eks/service_package_gen.go index 4a7aa490fad6..ab6d163a2f7b 100644 --- a/internal/service/eks/service_package_gen.go +++ b/internal/service/eks/service_package_gen.go @@ -5,41 +5,75 @@ package eks import ( "context" - "github.com/hashicorp/terraform-plugin-framework/datasource" - "github.com/hashicorp/terraform-plugin-framework/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "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) []func(context.Context) (datasource.DataSourceWithConfigure, error) { - return []func(context.Context) (datasource.DataSourceWithConfigure, error){} +func (p *servicePackage) FrameworkDataSources(ctx context.Context) []*types.ServicePackageFrameworkDataSource { + return []*types.ServicePackageFrameworkDataSource{} } -func (p *servicePackage) FrameworkResources(ctx context.Context) []func(context.Context) (resource.ResourceWithConfigure, error) { - return []func(context.Context) (resource.ResourceWithConfigure, error){} +func (p *servicePackage) FrameworkResources(ctx context.Context) []*types.ServicePackageFrameworkResource { + return []*types.ServicePackageFrameworkResource{} } -func (p *servicePackage) SDKDataSources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{ - "aws_eks_addon": DataSourceAddon, - "aws_eks_addon_version": DataSourceAddonVersion, - "aws_eks_cluster": DataSourceCluster, - "aws_eks_cluster_auth": DataSourceClusterAuth, - "aws_eks_clusters": DataSourceClusters, - "aws_eks_node_group": DataSourceNodeGroup, - "aws_eks_node_groups": DataSourceNodeGroups, +func (p *servicePackage) SDKDataSources(ctx context.Context) []*types.ServicePackageSDKDataSource { + return []*types.ServicePackageSDKDataSource{ + { + Factory: DataSourceAddon, + TypeName: "aws_eks_addon", + }, + { + Factory: DataSourceAddonVersion, + TypeName: "aws_eks_addon_version", + }, + { + Factory: DataSourceCluster, + TypeName: "aws_eks_cluster", + }, + { + Factory: DataSourceClusterAuth, + TypeName: "aws_eks_cluster_auth", + }, + { + Factory: DataSourceClusters, + TypeName: "aws_eks_clusters", + }, + { + Factory: DataSourceNodeGroup, + TypeName: "aws_eks_node_group", + }, + { + Factory: DataSourceNodeGroups, + TypeName: "aws_eks_node_groups", + }, } } -func (p *servicePackage) SDKResources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{ - "aws_eks_addon": ResourceAddon, - "aws_eks_cluster": ResourceCluster, - "aws_eks_fargate_profile": ResourceFargateProfile, - "aws_eks_identity_provider_config": ResourceIdentityProviderConfig, - "aws_eks_node_group": ResourceNodeGroup, +func (p *servicePackage) SDKResources(ctx context.Context) []*types.ServicePackageSDKResource { + return []*types.ServicePackageSDKResource{ + { + Factory: ResourceAddon, + TypeName: "aws_eks_addon", + }, + { + Factory: ResourceCluster, + TypeName: "aws_eks_cluster", + }, + { + Factory: ResourceFargateProfile, + TypeName: "aws_eks_fargate_profile", + }, + { + Factory: ResourceIdentityProviderConfig, + TypeName: "aws_eks_identity_provider_config", + }, + { + Factory: ResourceNodeGroup, + TypeName: "aws_eks_node_group", + }, } } diff --git a/internal/service/elasticache/service_package_gen.go b/internal/service/elasticache/service_package_gen.go index 4dab4cceea3d..fbeb9f39314b 100644 --- a/internal/service/elasticache/service_package_gen.go +++ b/internal/service/elasticache/service_package_gen.go @@ -5,42 +5,79 @@ package elasticache import ( "context" - "github.com/hashicorp/terraform-plugin-framework/datasource" - "github.com/hashicorp/terraform-plugin-framework/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "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) []func(context.Context) (datasource.DataSourceWithConfigure, error) { - return []func(context.Context) (datasource.DataSourceWithConfigure, error){} +func (p *servicePackage) FrameworkDataSources(ctx context.Context) []*types.ServicePackageFrameworkDataSource { + return []*types.ServicePackageFrameworkDataSource{} } -func (p *servicePackage) FrameworkResources(ctx context.Context) []func(context.Context) (resource.ResourceWithConfigure, error) { - return []func(context.Context) (resource.ResourceWithConfigure, error){} +func (p *servicePackage) FrameworkResources(ctx context.Context) []*types.ServicePackageFrameworkResource { + return []*types.ServicePackageFrameworkResource{} } -func (p *servicePackage) SDKDataSources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{ - "aws_elasticache_cluster": DataSourceCluster, - "aws_elasticache_replication_group": DataSourceReplicationGroup, - "aws_elasticache_subnet_group": DataSourceSubnetGroup, - "aws_elasticache_user": DataSourceUser, +func (p *servicePackage) SDKDataSources(ctx context.Context) []*types.ServicePackageSDKDataSource { + return []*types.ServicePackageSDKDataSource{ + { + Factory: DataSourceCluster, + TypeName: "aws_elasticache_cluster", + }, + { + Factory: DataSourceReplicationGroup, + TypeName: "aws_elasticache_replication_group", + }, + { + Factory: DataSourceSubnetGroup, + TypeName: "aws_elasticache_subnet_group", + }, + { + Factory: DataSourceUser, + TypeName: "aws_elasticache_user", + }, } } -func (p *servicePackage) SDKResources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{ - "aws_elasticache_cluster": ResourceCluster, - "aws_elasticache_global_replication_group": ResourceGlobalReplicationGroup, - "aws_elasticache_parameter_group": ResourceParameterGroup, - "aws_elasticache_replication_group": ResourceReplicationGroup, - "aws_elasticache_security_group": ResourceSecurityGroup, - "aws_elasticache_subnet_group": ResourceSubnetGroup, - "aws_elasticache_user": ResourceUser, - "aws_elasticache_user_group": ResourceUserGroup, - "aws_elasticache_user_group_association": ResourceUserGroupAssociation, +func (p *servicePackage) SDKResources(ctx context.Context) []*types.ServicePackageSDKResource { + return []*types.ServicePackageSDKResource{ + { + Factory: ResourceCluster, + TypeName: "aws_elasticache_cluster", + }, + { + Factory: ResourceGlobalReplicationGroup, + TypeName: "aws_elasticache_global_replication_group", + }, + { + Factory: ResourceParameterGroup, + TypeName: "aws_elasticache_parameter_group", + }, + { + Factory: ResourceReplicationGroup, + TypeName: "aws_elasticache_replication_group", + }, + { + Factory: ResourceSecurityGroup, + TypeName: "aws_elasticache_security_group", + }, + { + Factory: ResourceSubnetGroup, + TypeName: "aws_elasticache_subnet_group", + }, + { + Factory: ResourceUser, + TypeName: "aws_elasticache_user", + }, + { + Factory: ResourceUserGroup, + TypeName: "aws_elasticache_user_group", + }, + { + Factory: ResourceUserGroupAssociation, + TypeName: "aws_elasticache_user_group_association", + }, } } diff --git a/internal/service/elasticbeanstalk/service_package_gen.go b/internal/service/elasticbeanstalk/service_package_gen.go index 6a776b507407..b11787de24a5 100644 --- a/internal/service/elasticbeanstalk/service_package_gen.go +++ b/internal/service/elasticbeanstalk/service_package_gen.go @@ -5,36 +5,55 @@ package elasticbeanstalk import ( "context" - "github.com/hashicorp/terraform-plugin-framework/datasource" - "github.com/hashicorp/terraform-plugin-framework/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "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) []func(context.Context) (datasource.DataSourceWithConfigure, error) { - return []func(context.Context) (datasource.DataSourceWithConfigure, error){} +func (p *servicePackage) FrameworkDataSources(ctx context.Context) []*types.ServicePackageFrameworkDataSource { + return []*types.ServicePackageFrameworkDataSource{} } -func (p *servicePackage) FrameworkResources(ctx context.Context) []func(context.Context) (resource.ResourceWithConfigure, error) { - return []func(context.Context) (resource.ResourceWithConfigure, error){} +func (p *servicePackage) FrameworkResources(ctx context.Context) []*types.ServicePackageFrameworkResource { + return []*types.ServicePackageFrameworkResource{} } -func (p *servicePackage) SDKDataSources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{ - "aws_elastic_beanstalk_application": DataSourceApplication, - "aws_elastic_beanstalk_hosted_zone": DataSourceHostedZone, - "aws_elastic_beanstalk_solution_stack": DataSourceSolutionStack, +func (p *servicePackage) SDKDataSources(ctx context.Context) []*types.ServicePackageSDKDataSource { + return []*types.ServicePackageSDKDataSource{ + { + Factory: DataSourceApplication, + TypeName: "aws_elastic_beanstalk_application", + }, + { + Factory: DataSourceHostedZone, + TypeName: "aws_elastic_beanstalk_hosted_zone", + }, + { + Factory: DataSourceSolutionStack, + TypeName: "aws_elastic_beanstalk_solution_stack", + }, } } -func (p *servicePackage) SDKResources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{ - "aws_elastic_beanstalk_application": ResourceApplication, - "aws_elastic_beanstalk_application_version": ResourceApplicationVersion, - "aws_elastic_beanstalk_configuration_template": ResourceConfigurationTemplate, - "aws_elastic_beanstalk_environment": ResourceEnvironment, +func (p *servicePackage) SDKResources(ctx context.Context) []*types.ServicePackageSDKResource { + return []*types.ServicePackageSDKResource{ + { + Factory: ResourceApplication, + TypeName: "aws_elastic_beanstalk_application", + }, + { + Factory: ResourceApplicationVersion, + TypeName: "aws_elastic_beanstalk_application_version", + }, + { + Factory: ResourceConfigurationTemplate, + TypeName: "aws_elastic_beanstalk_configuration_template", + }, + { + Factory: ResourceEnvironment, + TypeName: "aws_elastic_beanstalk_environment", + }, } } diff --git a/internal/service/elasticsearch/service_package_gen.go b/internal/service/elasticsearch/service_package_gen.go index 4750b3f94798..3883d8fdb9f7 100644 --- a/internal/service/elasticsearch/service_package_gen.go +++ b/internal/service/elasticsearch/service_package_gen.go @@ -5,33 +5,43 @@ package elasticsearch import ( "context" - "github.com/hashicorp/terraform-plugin-framework/datasource" - "github.com/hashicorp/terraform-plugin-framework/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "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) []func(context.Context) (datasource.DataSourceWithConfigure, error) { - return []func(context.Context) (datasource.DataSourceWithConfigure, error){} +func (p *servicePackage) FrameworkDataSources(ctx context.Context) []*types.ServicePackageFrameworkDataSource { + return []*types.ServicePackageFrameworkDataSource{} } -func (p *servicePackage) FrameworkResources(ctx context.Context) []func(context.Context) (resource.ResourceWithConfigure, error) { - return []func(context.Context) (resource.ResourceWithConfigure, error){} +func (p *servicePackage) FrameworkResources(ctx context.Context) []*types.ServicePackageFrameworkResource { + return []*types.ServicePackageFrameworkResource{} } -func (p *servicePackage) SDKDataSources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{ - "aws_elasticsearch_domain": DataSourceDomain, +func (p *servicePackage) SDKDataSources(ctx context.Context) []*types.ServicePackageSDKDataSource { + return []*types.ServicePackageSDKDataSource{ + { + Factory: DataSourceDomain, + TypeName: "aws_elasticsearch_domain", + }, } } -func (p *servicePackage) SDKResources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{ - "aws_elasticsearch_domain": ResourceDomain, - "aws_elasticsearch_domain_policy": ResourceDomainPolicy, - "aws_elasticsearch_domain_saml_options": ResourceDomainSAMLOptions, +func (p *servicePackage) SDKResources(ctx context.Context) []*types.ServicePackageSDKResource { + return []*types.ServicePackageSDKResource{ + { + Factory: ResourceDomain, + TypeName: "aws_elasticsearch_domain", + }, + { + Factory: ResourceDomainPolicy, + TypeName: "aws_elasticsearch_domain_policy", + }, + { + Factory: ResourceDomainSAMLOptions, + TypeName: "aws_elasticsearch_domain_saml_options", + }, } } diff --git a/internal/service/elastictranscoder/service_package_gen.go b/internal/service/elastictranscoder/service_package_gen.go index e8dee1c7ddf7..3532c5c2cbd2 100644 --- a/internal/service/elastictranscoder/service_package_gen.go +++ b/internal/service/elastictranscoder/service_package_gen.go @@ -5,30 +5,34 @@ package elastictranscoder import ( "context" - "github.com/hashicorp/terraform-plugin-framework/datasource" - "github.com/hashicorp/terraform-plugin-framework/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "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) []func(context.Context) (datasource.DataSourceWithConfigure, error) { - return []func(context.Context) (datasource.DataSourceWithConfigure, error){} +func (p *servicePackage) FrameworkDataSources(ctx context.Context) []*types.ServicePackageFrameworkDataSource { + return []*types.ServicePackageFrameworkDataSource{} } -func (p *servicePackage) FrameworkResources(ctx context.Context) []func(context.Context) (resource.ResourceWithConfigure, error) { - return []func(context.Context) (resource.ResourceWithConfigure, error){} +func (p *servicePackage) FrameworkResources(ctx context.Context) []*types.ServicePackageFrameworkResource { + return []*types.ServicePackageFrameworkResource{} } -func (p *servicePackage) SDKDataSources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{} +func (p *servicePackage) SDKDataSources(ctx context.Context) []*types.ServicePackageSDKDataSource { + return []*types.ServicePackageSDKDataSource{} } -func (p *servicePackage) SDKResources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{ - "aws_elastictranscoder_pipeline": ResourcePipeline, - "aws_elastictranscoder_preset": ResourcePreset, +func (p *servicePackage) SDKResources(ctx context.Context) []*types.ServicePackageSDKResource { + return []*types.ServicePackageSDKResource{ + { + Factory: ResourcePipeline, + TypeName: "aws_elastictranscoder_pipeline", + }, + { + Factory: ResourcePreset, + TypeName: "aws_elastictranscoder_preset", + }, } } diff --git a/internal/service/elb/service_package_gen.go b/internal/service/elb/service_package_gen.go index 275c7288beda..2c07c0f0d7b1 100644 --- a/internal/service/elb/service_package_gen.go +++ b/internal/service/elb/service_package_gen.go @@ -5,41 +5,75 @@ package elb import ( "context" - "github.com/hashicorp/terraform-plugin-framework/datasource" - "github.com/hashicorp/terraform-plugin-framework/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "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) []func(context.Context) (datasource.DataSourceWithConfigure, error) { - return []func(context.Context) (datasource.DataSourceWithConfigure, error){} +func (p *servicePackage) FrameworkDataSources(ctx context.Context) []*types.ServicePackageFrameworkDataSource { + return []*types.ServicePackageFrameworkDataSource{} } -func (p *servicePackage) FrameworkResources(ctx context.Context) []func(context.Context) (resource.ResourceWithConfigure, error) { - return []func(context.Context) (resource.ResourceWithConfigure, error){} +func (p *servicePackage) FrameworkResources(ctx context.Context) []*types.ServicePackageFrameworkResource { + return []*types.ServicePackageFrameworkResource{} } -func (p *servicePackage) SDKDataSources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{ - "aws_elb": DataSourceLoadBalancer, - "aws_elb_hosted_zone_id": DataSourceHostedZoneID, - "aws_elb_service_account": DataSourceServiceAccount, +func (p *servicePackage) SDKDataSources(ctx context.Context) []*types.ServicePackageSDKDataSource { + return []*types.ServicePackageSDKDataSource{ + { + Factory: DataSourceLoadBalancer, + TypeName: "aws_elb", + }, + { + Factory: DataSourceHostedZoneID, + TypeName: "aws_elb_hosted_zone_id", + }, + { + Factory: DataSourceServiceAccount, + TypeName: "aws_elb_service_account", + }, } } -func (p *servicePackage) SDKResources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{ - "aws_app_cookie_stickiness_policy": ResourceAppCookieStickinessPolicy, - "aws_elb": ResourceLoadBalancer, - "aws_elb_attachment": ResourceAttachment, - "aws_lb_cookie_stickiness_policy": ResourceCookieStickinessPolicy, - "aws_lb_ssl_negotiation_policy": ResourceSSLNegotiationPolicy, - "aws_load_balancer_backend_server_policy": ResourceBackendServerPolicy, - "aws_load_balancer_listener_policy": ResourceListenerPolicy, - "aws_load_balancer_policy": ResourcePolicy, - "aws_proxy_protocol_policy": ResourceProxyProtocolPolicy, +func (p *servicePackage) SDKResources(ctx context.Context) []*types.ServicePackageSDKResource { + return []*types.ServicePackageSDKResource{ + { + Factory: ResourceAppCookieStickinessPolicy, + TypeName: "aws_app_cookie_stickiness_policy", + }, + { + Factory: ResourceLoadBalancer, + TypeName: "aws_elb", + }, + { + Factory: ResourceAttachment, + TypeName: "aws_elb_attachment", + }, + { + Factory: ResourceCookieStickinessPolicy, + TypeName: "aws_lb_cookie_stickiness_policy", + }, + { + Factory: ResourceSSLNegotiationPolicy, + TypeName: "aws_lb_ssl_negotiation_policy", + }, + { + Factory: ResourceBackendServerPolicy, + TypeName: "aws_load_balancer_backend_server_policy", + }, + { + Factory: ResourceListenerPolicy, + TypeName: "aws_load_balancer_listener_policy", + }, + { + Factory: ResourcePolicy, + TypeName: "aws_load_balancer_policy", + }, + { + Factory: ResourceProxyProtocolPolicy, + TypeName: "aws_proxy_protocol_policy", + }, } } diff --git a/internal/service/elbv2/service_package_gen.go b/internal/service/elbv2/service_package_gen.go index ce68e449991c..ca610717995c 100644 --- a/internal/service/elbv2/service_package_gen.go +++ b/internal/service/elbv2/service_package_gen.go @@ -5,49 +5,107 @@ package elbv2 import ( "context" - "github.com/hashicorp/terraform-plugin-framework/datasource" - "github.com/hashicorp/terraform-plugin-framework/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "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) []func(context.Context) (datasource.DataSourceWithConfigure, error) { - return []func(context.Context) (datasource.DataSourceWithConfigure, error){} +func (p *servicePackage) FrameworkDataSources(ctx context.Context) []*types.ServicePackageFrameworkDataSource { + return []*types.ServicePackageFrameworkDataSource{} } -func (p *servicePackage) FrameworkResources(ctx context.Context) []func(context.Context) (resource.ResourceWithConfigure, error) { - return []func(context.Context) (resource.ResourceWithConfigure, error){} +func (p *servicePackage) FrameworkResources(ctx context.Context) []*types.ServicePackageFrameworkResource { + return []*types.ServicePackageFrameworkResource{} } -func (p *servicePackage) SDKDataSources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{ - "aws_alb": DataSourceLoadBalancer, - "aws_alb_listener": DataSourceListener, - "aws_alb_target_group": DataSourceTargetGroup, - "aws_lb": DataSourceLoadBalancer, - "aws_lb_hosted_zone_id": DataSourceHostedZoneID, - "aws_lb_listener": DataSourceListener, - "aws_lb_target_group": DataSourceTargetGroup, - "aws_lbs": DataSourceLoadBalancers, +func (p *servicePackage) SDKDataSources(ctx context.Context) []*types.ServicePackageSDKDataSource { + return []*types.ServicePackageSDKDataSource{ + { + Factory: DataSourceLoadBalancer, + TypeName: "aws_alb", + }, + { + Factory: DataSourceListener, + TypeName: "aws_alb_listener", + }, + { + Factory: DataSourceTargetGroup, + TypeName: "aws_alb_target_group", + }, + { + Factory: DataSourceLoadBalancer, + TypeName: "aws_lb", + }, + { + Factory: DataSourceHostedZoneID, + TypeName: "aws_lb_hosted_zone_id", + }, + { + Factory: DataSourceListener, + TypeName: "aws_lb_listener", + }, + { + Factory: DataSourceTargetGroup, + TypeName: "aws_lb_target_group", + }, + { + Factory: DataSourceLoadBalancers, + TypeName: "aws_lbs", + }, } } -func (p *servicePackage) SDKResources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{ - "aws_alb": ResourceLoadBalancer, - "aws_alb_listener": ResourceListener, - "aws_alb_listener_certificate": ResourceListenerCertificate, - "aws_alb_listener_rule": ResourceListenerRule, - "aws_alb_target_group": ResourceTargetGroup, - "aws_alb_target_group_attachment": ResourceTargetGroupAttachment, - "aws_lb": ResourceLoadBalancer, - "aws_lb_listener": ResourceListener, - "aws_lb_listener_certificate": ResourceListenerCertificate, - "aws_lb_listener_rule": ResourceListenerRule, - "aws_lb_target_group": ResourceTargetGroup, - "aws_lb_target_group_attachment": ResourceTargetGroupAttachment, +func (p *servicePackage) SDKResources(ctx context.Context) []*types.ServicePackageSDKResource { + return []*types.ServicePackageSDKResource{ + { + Factory: ResourceLoadBalancer, + TypeName: "aws_alb", + }, + { + Factory: ResourceListener, + TypeName: "aws_alb_listener", + }, + { + Factory: ResourceListenerCertificate, + TypeName: "aws_alb_listener_certificate", + }, + { + Factory: ResourceListenerRule, + TypeName: "aws_alb_listener_rule", + }, + { + Factory: ResourceTargetGroup, + TypeName: "aws_alb_target_group", + }, + { + Factory: ResourceTargetGroupAttachment, + TypeName: "aws_alb_target_group_attachment", + }, + { + Factory: ResourceLoadBalancer, + TypeName: "aws_lb", + }, + { + Factory: ResourceListener, + TypeName: "aws_lb_listener", + }, + { + Factory: ResourceListenerCertificate, + TypeName: "aws_lb_listener_certificate", + }, + { + Factory: ResourceListenerRule, + TypeName: "aws_lb_listener_rule", + }, + { + Factory: ResourceTargetGroup, + TypeName: "aws_lb_target_group", + }, + { + Factory: ResourceTargetGroupAttachment, + TypeName: "aws_lb_target_group_attachment", + }, } } diff --git a/internal/service/emr/service_package_gen.go b/internal/service/emr/service_package_gen.go index ee535f191505..5a4e07822231 100644 --- a/internal/service/emr/service_package_gen.go +++ b/internal/service/emr/service_package_gen.go @@ -5,37 +5,59 @@ package emr import ( "context" - "github.com/hashicorp/terraform-plugin-framework/datasource" - "github.com/hashicorp/terraform-plugin-framework/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "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) []func(context.Context) (datasource.DataSourceWithConfigure, error) { - return []func(context.Context) (datasource.DataSourceWithConfigure, error){} +func (p *servicePackage) FrameworkDataSources(ctx context.Context) []*types.ServicePackageFrameworkDataSource { + return []*types.ServicePackageFrameworkDataSource{} } -func (p *servicePackage) FrameworkResources(ctx context.Context) []func(context.Context) (resource.ResourceWithConfigure, error) { - return []func(context.Context) (resource.ResourceWithConfigure, error){} +func (p *servicePackage) FrameworkResources(ctx context.Context) []*types.ServicePackageFrameworkResource { + return []*types.ServicePackageFrameworkResource{} } -func (p *servicePackage) SDKDataSources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{ - "aws_emr_release_labels": DataSourceReleaseLabels, +func (p *servicePackage) SDKDataSources(ctx context.Context) []*types.ServicePackageSDKDataSource { + return []*types.ServicePackageSDKDataSource{ + { + Factory: DataSourceReleaseLabels, + TypeName: "aws_emr_release_labels", + }, } } -func (p *servicePackage) SDKResources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{ - "aws_emr_cluster": ResourceCluster, - "aws_emr_instance_fleet": ResourceInstanceFleet, - "aws_emr_instance_group": ResourceInstanceGroup, - "aws_emr_managed_scaling_policy": ResourceManagedScalingPolicy, - "aws_emr_security_configuration": ResourceSecurityConfiguration, - "aws_emr_studio": ResourceStudio, - "aws_emr_studio_session_mapping": ResourceStudioSessionMapping, +func (p *servicePackage) SDKResources(ctx context.Context) []*types.ServicePackageSDKResource { + return []*types.ServicePackageSDKResource{ + { + Factory: ResourceCluster, + TypeName: "aws_emr_cluster", + }, + { + Factory: ResourceInstanceFleet, + TypeName: "aws_emr_instance_fleet", + }, + { + Factory: ResourceInstanceGroup, + TypeName: "aws_emr_instance_group", + }, + { + Factory: ResourceManagedScalingPolicy, + TypeName: "aws_emr_managed_scaling_policy", + }, + { + Factory: ResourceSecurityConfiguration, + TypeName: "aws_emr_security_configuration", + }, + { + Factory: ResourceStudio, + TypeName: "aws_emr_studio", + }, + { + Factory: ResourceStudioSessionMapping, + TypeName: "aws_emr_studio_session_mapping", + }, } } diff --git a/internal/service/emrcontainers/service_package_gen.go b/internal/service/emrcontainers/service_package_gen.go index 503c526901e2..7d0cb6ab57b3 100644 --- a/internal/service/emrcontainers/service_package_gen.go +++ b/internal/service/emrcontainers/service_package_gen.go @@ -5,31 +5,35 @@ package emrcontainers import ( "context" - "github.com/hashicorp/terraform-plugin-framework/datasource" - "github.com/hashicorp/terraform-plugin-framework/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "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) []func(context.Context) (datasource.DataSourceWithConfigure, error) { - return []func(context.Context) (datasource.DataSourceWithConfigure, error){} +func (p *servicePackage) FrameworkDataSources(ctx context.Context) []*types.ServicePackageFrameworkDataSource { + return []*types.ServicePackageFrameworkDataSource{} } -func (p *servicePackage) FrameworkResources(ctx context.Context) []func(context.Context) (resource.ResourceWithConfigure, error) { - return []func(context.Context) (resource.ResourceWithConfigure, error){} +func (p *servicePackage) FrameworkResources(ctx context.Context) []*types.ServicePackageFrameworkResource { + return []*types.ServicePackageFrameworkResource{} } -func (p *servicePackage) SDKDataSources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{ - "aws_emrcontainers_virtual_cluster": DataSourceVirtualCluster, +func (p *servicePackage) SDKDataSources(ctx context.Context) []*types.ServicePackageSDKDataSource { + return []*types.ServicePackageSDKDataSource{ + { + Factory: DataSourceVirtualCluster, + TypeName: "aws_emrcontainers_virtual_cluster", + }, } } -func (p *servicePackage) SDKResources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{ - "aws_emrcontainers_virtual_cluster": ResourceVirtualCluster, +func (p *servicePackage) SDKResources(ctx context.Context) []*types.ServicePackageSDKResource { + return []*types.ServicePackageSDKResource{ + { + Factory: ResourceVirtualCluster, + TypeName: "aws_emrcontainers_virtual_cluster", + }, } } diff --git a/internal/service/emrserverless/service_package_gen.go b/internal/service/emrserverless/service_package_gen.go index a41679818b3c..83ca5def27a3 100644 --- a/internal/service/emrserverless/service_package_gen.go +++ b/internal/service/emrserverless/service_package_gen.go @@ -5,29 +5,30 @@ package emrserverless import ( "context" - "github.com/hashicorp/terraform-plugin-framework/datasource" - "github.com/hashicorp/terraform-plugin-framework/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "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) []func(context.Context) (datasource.DataSourceWithConfigure, error) { - return []func(context.Context) (datasource.DataSourceWithConfigure, error){} +func (p *servicePackage) FrameworkDataSources(ctx context.Context) []*types.ServicePackageFrameworkDataSource { + return []*types.ServicePackageFrameworkDataSource{} } -func (p *servicePackage) FrameworkResources(ctx context.Context) []func(context.Context) (resource.ResourceWithConfigure, error) { - return []func(context.Context) (resource.ResourceWithConfigure, error){} +func (p *servicePackage) FrameworkResources(ctx context.Context) []*types.ServicePackageFrameworkResource { + return []*types.ServicePackageFrameworkResource{} } -func (p *servicePackage) SDKDataSources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{} +func (p *servicePackage) SDKDataSources(ctx context.Context) []*types.ServicePackageSDKDataSource { + return []*types.ServicePackageSDKDataSource{} } -func (p *servicePackage) SDKResources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{ - "aws_emrserverless_application": ResourceApplication, +func (p *servicePackage) SDKResources(ctx context.Context) []*types.ServicePackageSDKResource { + return []*types.ServicePackageSDKResource{ + { + Factory: ResourceApplication, + TypeName: "aws_emrserverless_application", + }, } } diff --git a/internal/service/events/service_package_gen.go b/internal/service/events/service_package_gen.go index c8cb3afdc1a1..8d4135884bac 100644 --- a/internal/service/events/service_package_gen.go +++ b/internal/service/events/service_package_gen.go @@ -5,40 +5,71 @@ package events import ( "context" - "github.com/hashicorp/terraform-plugin-framework/datasource" - "github.com/hashicorp/terraform-plugin-framework/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "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) []func(context.Context) (datasource.DataSourceWithConfigure, error) { - return []func(context.Context) (datasource.DataSourceWithConfigure, error){} +func (p *servicePackage) FrameworkDataSources(ctx context.Context) []*types.ServicePackageFrameworkDataSource { + return []*types.ServicePackageFrameworkDataSource{} } -func (p *servicePackage) FrameworkResources(ctx context.Context) []func(context.Context) (resource.ResourceWithConfigure, error) { - return []func(context.Context) (resource.ResourceWithConfigure, error){} +func (p *servicePackage) FrameworkResources(ctx context.Context) []*types.ServicePackageFrameworkResource { + return []*types.ServicePackageFrameworkResource{} } -func (p *servicePackage) SDKDataSources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{ - "aws_cloudwatch_event_bus": DataSourceBus, - "aws_cloudwatch_event_connection": DataSourceConnection, - "aws_cloudwatch_event_source": DataSourceSource, +func (p *servicePackage) SDKDataSources(ctx context.Context) []*types.ServicePackageSDKDataSource { + return []*types.ServicePackageSDKDataSource{ + { + Factory: DataSourceBus, + TypeName: "aws_cloudwatch_event_bus", + }, + { + Factory: DataSourceConnection, + TypeName: "aws_cloudwatch_event_connection", + }, + { + Factory: DataSourceSource, + TypeName: "aws_cloudwatch_event_source", + }, } } -func (p *servicePackage) SDKResources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{ - "aws_cloudwatch_event_api_destination": ResourceAPIDestination, - "aws_cloudwatch_event_archive": ResourceArchive, - "aws_cloudwatch_event_bus": ResourceBus, - "aws_cloudwatch_event_bus_policy": ResourceBusPolicy, - "aws_cloudwatch_event_connection": ResourceConnection, - "aws_cloudwatch_event_permission": ResourcePermission, - "aws_cloudwatch_event_rule": ResourceRule, - "aws_cloudwatch_event_target": ResourceTarget, +func (p *servicePackage) SDKResources(ctx context.Context) []*types.ServicePackageSDKResource { + return []*types.ServicePackageSDKResource{ + { + Factory: ResourceAPIDestination, + TypeName: "aws_cloudwatch_event_api_destination", + }, + { + Factory: ResourceArchive, + TypeName: "aws_cloudwatch_event_archive", + }, + { + Factory: ResourceBus, + TypeName: "aws_cloudwatch_event_bus", + }, + { + Factory: ResourceBusPolicy, + TypeName: "aws_cloudwatch_event_bus_policy", + }, + { + Factory: ResourceConnection, + TypeName: "aws_cloudwatch_event_connection", + }, + { + Factory: ResourcePermission, + TypeName: "aws_cloudwatch_event_permission", + }, + { + Factory: ResourceRule, + TypeName: "aws_cloudwatch_event_rule", + }, + { + Factory: ResourceTarget, + TypeName: "aws_cloudwatch_event_target", + }, } } diff --git a/internal/service/evidently/service_package_gen.go b/internal/service/evidently/service_package_gen.go index 26537b2dd7ed..52d34a8b7a6f 100644 --- a/internal/service/evidently/service_package_gen.go +++ b/internal/service/evidently/service_package_gen.go @@ -5,32 +5,42 @@ package evidently import ( "context" - "github.com/hashicorp/terraform-plugin-framework/datasource" - "github.com/hashicorp/terraform-plugin-framework/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "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) []func(context.Context) (datasource.DataSourceWithConfigure, error) { - return []func(context.Context) (datasource.DataSourceWithConfigure, error){} +func (p *servicePackage) FrameworkDataSources(ctx context.Context) []*types.ServicePackageFrameworkDataSource { + return []*types.ServicePackageFrameworkDataSource{} } -func (p *servicePackage) FrameworkResources(ctx context.Context) []func(context.Context) (resource.ResourceWithConfigure, error) { - return []func(context.Context) (resource.ResourceWithConfigure, error){} +func (p *servicePackage) FrameworkResources(ctx context.Context) []*types.ServicePackageFrameworkResource { + return []*types.ServicePackageFrameworkResource{} } -func (p *servicePackage) SDKDataSources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{} +func (p *servicePackage) SDKDataSources(ctx context.Context) []*types.ServicePackageSDKDataSource { + return []*types.ServicePackageSDKDataSource{} } -func (p *servicePackage) SDKResources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{ - "aws_evidently_feature": ResourceFeature, - "aws_evidently_launch": ResourceLaunch, - "aws_evidently_project": ResourceProject, - "aws_evidently_segment": ResourceSegment, +func (p *servicePackage) SDKResources(ctx context.Context) []*types.ServicePackageSDKResource { + return []*types.ServicePackageSDKResource{ + { + Factory: ResourceFeature, + TypeName: "aws_evidently_feature", + }, + { + Factory: ResourceLaunch, + TypeName: "aws_evidently_launch", + }, + { + Factory: ResourceProject, + TypeName: "aws_evidently_project", + }, + { + Factory: ResourceSegment, + TypeName: "aws_evidently_segment", + }, } } diff --git a/internal/service/firehose/service_package_gen.go b/internal/service/firehose/service_package_gen.go index ee879af611ff..14415c4c4ac7 100644 --- a/internal/service/firehose/service_package_gen.go +++ b/internal/service/firehose/service_package_gen.go @@ -5,31 +5,35 @@ package firehose import ( "context" - "github.com/hashicorp/terraform-plugin-framework/datasource" - "github.com/hashicorp/terraform-plugin-framework/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "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) []func(context.Context) (datasource.DataSourceWithConfigure, error) { - return []func(context.Context) (datasource.DataSourceWithConfigure, error){} +func (p *servicePackage) FrameworkDataSources(ctx context.Context) []*types.ServicePackageFrameworkDataSource { + return []*types.ServicePackageFrameworkDataSource{} } -func (p *servicePackage) FrameworkResources(ctx context.Context) []func(context.Context) (resource.ResourceWithConfigure, error) { - return []func(context.Context) (resource.ResourceWithConfigure, error){} +func (p *servicePackage) FrameworkResources(ctx context.Context) []*types.ServicePackageFrameworkResource { + return []*types.ServicePackageFrameworkResource{} } -func (p *servicePackage) SDKDataSources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{ - "aws_kinesis_firehose_delivery_stream": DataSourceDeliveryStream, +func (p *servicePackage) SDKDataSources(ctx context.Context) []*types.ServicePackageSDKDataSource { + return []*types.ServicePackageSDKDataSource{ + { + Factory: DataSourceDeliveryStream, + TypeName: "aws_kinesis_firehose_delivery_stream", + }, } } -func (p *servicePackage) SDKResources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{ - "aws_kinesis_firehose_delivery_stream": ResourceDeliveryStream, +func (p *servicePackage) SDKResources(ctx context.Context) []*types.ServicePackageSDKResource { + return []*types.ServicePackageSDKResource{ + { + Factory: ResourceDeliveryStream, + TypeName: "aws_kinesis_firehose_delivery_stream", + }, } } diff --git a/internal/service/fis/service_package_gen.go b/internal/service/fis/service_package_gen.go index 75c489c7c456..4a00613fc6b9 100644 --- a/internal/service/fis/service_package_gen.go +++ b/internal/service/fis/service_package_gen.go @@ -5,29 +5,30 @@ package fis import ( "context" - "github.com/hashicorp/terraform-plugin-framework/datasource" - "github.com/hashicorp/terraform-plugin-framework/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "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) []func(context.Context) (datasource.DataSourceWithConfigure, error) { - return []func(context.Context) (datasource.DataSourceWithConfigure, error){} +func (p *servicePackage) FrameworkDataSources(ctx context.Context) []*types.ServicePackageFrameworkDataSource { + return []*types.ServicePackageFrameworkDataSource{} } -func (p *servicePackage) FrameworkResources(ctx context.Context) []func(context.Context) (resource.ResourceWithConfigure, error) { - return []func(context.Context) (resource.ResourceWithConfigure, error){} +func (p *servicePackage) FrameworkResources(ctx context.Context) []*types.ServicePackageFrameworkResource { + return []*types.ServicePackageFrameworkResource{} } -func (p *servicePackage) SDKDataSources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{} +func (p *servicePackage) SDKDataSources(ctx context.Context) []*types.ServicePackageSDKDataSource { + return []*types.ServicePackageSDKDataSource{} } -func (p *servicePackage) SDKResources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{ - "aws_fis_experiment_template": ResourceExperimentTemplate, +func (p *servicePackage) SDKResources(ctx context.Context) []*types.ServicePackageSDKResource { + return []*types.ServicePackageSDKResource{ + { + Factory: ResourceExperimentTemplate, + TypeName: "aws_fis_experiment_template", + }, } } diff --git a/internal/service/fms/service_package_gen.go b/internal/service/fms/service_package_gen.go index a47057180bfd..40bb39b6baf4 100644 --- a/internal/service/fms/service_package_gen.go +++ b/internal/service/fms/service_package_gen.go @@ -5,30 +5,34 @@ package fms import ( "context" - "github.com/hashicorp/terraform-plugin-framework/datasource" - "github.com/hashicorp/terraform-plugin-framework/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "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) []func(context.Context) (datasource.DataSourceWithConfigure, error) { - return []func(context.Context) (datasource.DataSourceWithConfigure, error){} +func (p *servicePackage) FrameworkDataSources(ctx context.Context) []*types.ServicePackageFrameworkDataSource { + return []*types.ServicePackageFrameworkDataSource{} } -func (p *servicePackage) FrameworkResources(ctx context.Context) []func(context.Context) (resource.ResourceWithConfigure, error) { - return []func(context.Context) (resource.ResourceWithConfigure, error){} +func (p *servicePackage) FrameworkResources(ctx context.Context) []*types.ServicePackageFrameworkResource { + return []*types.ServicePackageFrameworkResource{} } -func (p *servicePackage) SDKDataSources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{} +func (p *servicePackage) SDKDataSources(ctx context.Context) []*types.ServicePackageSDKDataSource { + return []*types.ServicePackageSDKDataSource{} } -func (p *servicePackage) SDKResources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{ - "aws_fms_admin_account": ResourceAdminAccount, - "aws_fms_policy": ResourcePolicy, +func (p *servicePackage) SDKResources(ctx context.Context) []*types.ServicePackageSDKResource { + return []*types.ServicePackageSDKResource{ + { + Factory: ResourceAdminAccount, + TypeName: "aws_fms_admin_account", + }, + { + Factory: ResourcePolicy, + TypeName: "aws_fms_policy", + }, } } diff --git a/internal/service/fsx/service_package_gen.go b/internal/service/fsx/service_package_gen.go index 4653889ae1be..fa5644aed918 100644 --- a/internal/service/fsx/service_package_gen.go +++ b/internal/service/fsx/service_package_gen.go @@ -5,41 +5,75 @@ package fsx import ( "context" - "github.com/hashicorp/terraform-plugin-framework/datasource" - "github.com/hashicorp/terraform-plugin-framework/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "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) []func(context.Context) (datasource.DataSourceWithConfigure, error) { - return []func(context.Context) (datasource.DataSourceWithConfigure, error){} +func (p *servicePackage) FrameworkDataSources(ctx context.Context) []*types.ServicePackageFrameworkDataSource { + return []*types.ServicePackageFrameworkDataSource{} } -func (p *servicePackage) FrameworkResources(ctx context.Context) []func(context.Context) (resource.ResourceWithConfigure, error) { - return []func(context.Context) (resource.ResourceWithConfigure, error){} +func (p *servicePackage) FrameworkResources(ctx context.Context) []*types.ServicePackageFrameworkResource { + return []*types.ServicePackageFrameworkResource{} } -func (p *servicePackage) SDKDataSources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{ - "aws_fsx_openzfs_snapshot": DataSourceOpenzfsSnapshot, +func (p *servicePackage) SDKDataSources(ctx context.Context) []*types.ServicePackageSDKDataSource { + return []*types.ServicePackageSDKDataSource{ + { + Factory: DataSourceOpenzfsSnapshot, + TypeName: "aws_fsx_openzfs_snapshot", + }, } } -func (p *servicePackage) SDKResources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{ - "aws_fsx_backup": ResourceBackup, - "aws_fsx_data_repository_association": ResourceDataRepositoryAssociation, - "aws_fsx_file_cache": ResourceFileCache, - "aws_fsx_lustre_file_system": ResourceLustreFileSystem, - "aws_fsx_ontap_file_system": ResourceOntapFileSystem, - "aws_fsx_ontap_storage_virtual_machine": ResourceOntapStorageVirtualMachine, - "aws_fsx_ontap_volume": ResourceOntapVolume, - "aws_fsx_openzfs_file_system": ResourceOpenzfsFileSystem, - "aws_fsx_openzfs_snapshot": ResourceOpenzfsSnapshot, - "aws_fsx_openzfs_volume": ResourceOpenzfsVolume, - "aws_fsx_windows_file_system": ResourceWindowsFileSystem, +func (p *servicePackage) SDKResources(ctx context.Context) []*types.ServicePackageSDKResource { + return []*types.ServicePackageSDKResource{ + { + Factory: ResourceBackup, + TypeName: "aws_fsx_backup", + }, + { + Factory: ResourceDataRepositoryAssociation, + TypeName: "aws_fsx_data_repository_association", + }, + { + Factory: ResourceFileCache, + TypeName: "aws_fsx_file_cache", + }, + { + Factory: ResourceLustreFileSystem, + TypeName: "aws_fsx_lustre_file_system", + }, + { + Factory: ResourceOntapFileSystem, + TypeName: "aws_fsx_ontap_file_system", + }, + { + Factory: ResourceOntapStorageVirtualMachine, + TypeName: "aws_fsx_ontap_storage_virtual_machine", + }, + { + Factory: ResourceOntapVolume, + TypeName: "aws_fsx_ontap_volume", + }, + { + Factory: ResourceOpenzfsFileSystem, + TypeName: "aws_fsx_openzfs_file_system", + }, + { + Factory: ResourceOpenzfsSnapshot, + TypeName: "aws_fsx_openzfs_snapshot", + }, + { + Factory: ResourceOpenzfsVolume, + TypeName: "aws_fsx_openzfs_volume", + }, + { + Factory: ResourceWindowsFileSystem, + TypeName: "aws_fsx_windows_file_system", + }, } } diff --git a/internal/service/gamelift/service_package_gen.go b/internal/service/gamelift/service_package_gen.go index cff6a33468e2..5873958f2b26 100644 --- a/internal/service/gamelift/service_package_gen.go +++ b/internal/service/gamelift/service_package_gen.go @@ -5,34 +5,50 @@ package gamelift import ( "context" - "github.com/hashicorp/terraform-plugin-framework/datasource" - "github.com/hashicorp/terraform-plugin-framework/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "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) []func(context.Context) (datasource.DataSourceWithConfigure, error) { - return []func(context.Context) (datasource.DataSourceWithConfigure, error){} +func (p *servicePackage) FrameworkDataSources(ctx context.Context) []*types.ServicePackageFrameworkDataSource { + return []*types.ServicePackageFrameworkDataSource{} } -func (p *servicePackage) FrameworkResources(ctx context.Context) []func(context.Context) (resource.ResourceWithConfigure, error) { - return []func(context.Context) (resource.ResourceWithConfigure, error){} +func (p *servicePackage) FrameworkResources(ctx context.Context) []*types.ServicePackageFrameworkResource { + return []*types.ServicePackageFrameworkResource{} } -func (p *servicePackage) SDKDataSources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{} +func (p *servicePackage) SDKDataSources(ctx context.Context) []*types.ServicePackageSDKDataSource { + return []*types.ServicePackageSDKDataSource{} } -func (p *servicePackage) SDKResources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{ - "aws_gamelift_alias": ResourceAlias, - "aws_gamelift_build": ResourceBuild, - "aws_gamelift_fleet": ResourceFleet, - "aws_gamelift_game_server_group": ResourceGameServerGroup, - "aws_gamelift_game_session_queue": ResourceGameSessionQueue, - "aws_gamelift_script": ResourceScript, +func (p *servicePackage) SDKResources(ctx context.Context) []*types.ServicePackageSDKResource { + return []*types.ServicePackageSDKResource{ + { + Factory: ResourceAlias, + TypeName: "aws_gamelift_alias", + }, + { + Factory: ResourceBuild, + TypeName: "aws_gamelift_build", + }, + { + Factory: ResourceFleet, + TypeName: "aws_gamelift_fleet", + }, + { + Factory: ResourceGameServerGroup, + TypeName: "aws_gamelift_game_server_group", + }, + { + Factory: ResourceGameSessionQueue, + TypeName: "aws_gamelift_game_session_queue", + }, + { + Factory: ResourceScript, + TypeName: "aws_gamelift_script", + }, } } diff --git a/internal/service/glacier/service_package_gen.go b/internal/service/glacier/service_package_gen.go index f558c68d2805..1d50ab67362b 100644 --- a/internal/service/glacier/service_package_gen.go +++ b/internal/service/glacier/service_package_gen.go @@ -5,30 +5,34 @@ package glacier import ( "context" - "github.com/hashicorp/terraform-plugin-framework/datasource" - "github.com/hashicorp/terraform-plugin-framework/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "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) []func(context.Context) (datasource.DataSourceWithConfigure, error) { - return []func(context.Context) (datasource.DataSourceWithConfigure, error){} +func (p *servicePackage) FrameworkDataSources(ctx context.Context) []*types.ServicePackageFrameworkDataSource { + return []*types.ServicePackageFrameworkDataSource{} } -func (p *servicePackage) FrameworkResources(ctx context.Context) []func(context.Context) (resource.ResourceWithConfigure, error) { - return []func(context.Context) (resource.ResourceWithConfigure, error){} +func (p *servicePackage) FrameworkResources(ctx context.Context) []*types.ServicePackageFrameworkResource { + return []*types.ServicePackageFrameworkResource{} } -func (p *servicePackage) SDKDataSources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{} +func (p *servicePackage) SDKDataSources(ctx context.Context) []*types.ServicePackageSDKDataSource { + return []*types.ServicePackageSDKDataSource{} } -func (p *servicePackage) SDKResources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{ - "aws_glacier_vault": ResourceVault, - "aws_glacier_vault_lock": ResourceVaultLock, +func (p *servicePackage) SDKResources(ctx context.Context) []*types.ServicePackageSDKResource { + return []*types.ServicePackageSDKResource{ + { + Factory: ResourceVault, + TypeName: "aws_glacier_vault", + }, + { + Factory: ResourceVaultLock, + TypeName: "aws_glacier_vault_lock", + }, } } diff --git a/internal/service/globalaccelerator/service_package_gen.go b/internal/service/globalaccelerator/service_package_gen.go index e1095259c301..b9335ba3bffb 100644 --- a/internal/service/globalaccelerator/service_package_gen.go +++ b/internal/service/globalaccelerator/service_package_gen.go @@ -5,33 +5,42 @@ package globalaccelerator import ( "context" - "github.com/hashicorp/terraform-plugin-framework/datasource" - "github.com/hashicorp/terraform-plugin-framework/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "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) []func(context.Context) (datasource.DataSourceWithConfigure, error) { - return []func(context.Context) (datasource.DataSourceWithConfigure, error){ - newDataSourceAccelerator, +func (p *servicePackage) FrameworkDataSources(ctx context.Context) []*types.ServicePackageFrameworkDataSource { + return []*types.ServicePackageFrameworkDataSource{ + { + Factory: newDataSourceAccelerator, + }, } } -func (p *servicePackage) FrameworkResources(ctx context.Context) []func(context.Context) (resource.ResourceWithConfigure, error) { - return []func(context.Context) (resource.ResourceWithConfigure, error){} +func (p *servicePackage) FrameworkResources(ctx context.Context) []*types.ServicePackageFrameworkResource { + return []*types.ServicePackageFrameworkResource{} } -func (p *servicePackage) SDKDataSources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{} +func (p *servicePackage) SDKDataSources(ctx context.Context) []*types.ServicePackageSDKDataSource { + return []*types.ServicePackageSDKDataSource{} } -func (p *servicePackage) SDKResources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{ - "aws_globalaccelerator_accelerator": ResourceAccelerator, - "aws_globalaccelerator_endpoint_group": ResourceEndpointGroup, - "aws_globalaccelerator_listener": ResourceListener, +func (p *servicePackage) SDKResources(ctx context.Context) []*types.ServicePackageSDKResource { + return []*types.ServicePackageSDKResource{ + { + Factory: ResourceAccelerator, + TypeName: "aws_globalaccelerator_accelerator", + }, + { + Factory: ResourceEndpointGroup, + TypeName: "aws_globalaccelerator_endpoint_group", + }, + { + Factory: ResourceListener, + TypeName: "aws_globalaccelerator_listener", + }, } } diff --git a/internal/service/glue/service_package_gen.go b/internal/service/glue/service_package_gen.go index 29b0d812b463..3221c11cb78b 100644 --- a/internal/service/glue/service_package_gen.go +++ b/internal/service/glue/service_package_gen.go @@ -5,51 +5,115 @@ package glue import ( "context" - "github.com/hashicorp/terraform-plugin-framework/datasource" - "github.com/hashicorp/terraform-plugin-framework/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "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) []func(context.Context) (datasource.DataSourceWithConfigure, error) { - return []func(context.Context) (datasource.DataSourceWithConfigure, error){} +func (p *servicePackage) FrameworkDataSources(ctx context.Context) []*types.ServicePackageFrameworkDataSource { + return []*types.ServicePackageFrameworkDataSource{} } -func (p *servicePackage) FrameworkResources(ctx context.Context) []func(context.Context) (resource.ResourceWithConfigure, error) { - return []func(context.Context) (resource.ResourceWithConfigure, error){} +func (p *servicePackage) FrameworkResources(ctx context.Context) []*types.ServicePackageFrameworkResource { + return []*types.ServicePackageFrameworkResource{} } -func (p *servicePackage) SDKDataSources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{ - "aws_glue_catalog_table": DataSourceCatalogTable, - "aws_glue_connection": DataSourceConnection, - "aws_glue_data_catalog_encryption_settings": DataSourceDataCatalogEncryptionSettings, - "aws_glue_script": DataSourceScript, +func (p *servicePackage) SDKDataSources(ctx context.Context) []*types.ServicePackageSDKDataSource { + return []*types.ServicePackageSDKDataSource{ + { + Factory: DataSourceCatalogTable, + TypeName: "aws_glue_catalog_table", + }, + { + Factory: DataSourceConnection, + TypeName: "aws_glue_connection", + }, + { + Factory: DataSourceDataCatalogEncryptionSettings, + TypeName: "aws_glue_data_catalog_encryption_settings", + }, + { + Factory: DataSourceScript, + TypeName: "aws_glue_script", + }, } } -func (p *servicePackage) SDKResources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{ - "aws_glue_catalog_database": ResourceCatalogDatabase, - "aws_glue_catalog_table": ResourceCatalogTable, - "aws_glue_classifier": ResourceClassifier, - "aws_glue_connection": ResourceConnection, - "aws_glue_crawler": ResourceCrawler, - "aws_glue_data_catalog_encryption_settings": ResourceDataCatalogEncryptionSettings, - "aws_glue_dev_endpoint": ResourceDevEndpoint, - "aws_glue_job": ResourceJob, - "aws_glue_ml_transform": ResourceMLTransform, - "aws_glue_partition": ResourcePartition, - "aws_glue_partition_index": ResourcePartitionIndex, - "aws_glue_registry": ResourceRegistry, - "aws_glue_resource_policy": ResourceResourcePolicy, - "aws_glue_schema": ResourceSchema, - "aws_glue_security_configuration": ResourceSecurityConfiguration, - "aws_glue_trigger": ResourceTrigger, - "aws_glue_user_defined_function": ResourceUserDefinedFunction, - "aws_glue_workflow": ResourceWorkflow, +func (p *servicePackage) SDKResources(ctx context.Context) []*types.ServicePackageSDKResource { + return []*types.ServicePackageSDKResource{ + { + Factory: ResourceCatalogDatabase, + TypeName: "aws_glue_catalog_database", + }, + { + Factory: ResourceCatalogTable, + TypeName: "aws_glue_catalog_table", + }, + { + Factory: ResourceClassifier, + TypeName: "aws_glue_classifier", + }, + { + Factory: ResourceConnection, + TypeName: "aws_glue_connection", + }, + { + Factory: ResourceCrawler, + TypeName: "aws_glue_crawler", + }, + { + Factory: ResourceDataCatalogEncryptionSettings, + TypeName: "aws_glue_data_catalog_encryption_settings", + }, + { + Factory: ResourceDevEndpoint, + TypeName: "aws_glue_dev_endpoint", + }, + { + Factory: ResourceJob, + TypeName: "aws_glue_job", + }, + { + Factory: ResourceMLTransform, + TypeName: "aws_glue_ml_transform", + }, + { + Factory: ResourcePartition, + TypeName: "aws_glue_partition", + }, + { + Factory: ResourcePartitionIndex, + TypeName: "aws_glue_partition_index", + }, + { + Factory: ResourceRegistry, + TypeName: "aws_glue_registry", + }, + { + Factory: ResourceResourcePolicy, + TypeName: "aws_glue_resource_policy", + }, + { + Factory: ResourceSchema, + TypeName: "aws_glue_schema", + }, + { + Factory: ResourceSecurityConfiguration, + TypeName: "aws_glue_security_configuration", + }, + { + Factory: ResourceTrigger, + TypeName: "aws_glue_trigger", + }, + { + Factory: ResourceUserDefinedFunction, + TypeName: "aws_glue_user_defined_function", + }, + { + Factory: ResourceWorkflow, + TypeName: "aws_glue_workflow", + }, } } diff --git a/internal/service/grafana/service_package_gen.go b/internal/service/grafana/service_package_gen.go index 840e9b8ef972..f89e1a380281 100644 --- a/internal/service/grafana/service_package_gen.go +++ b/internal/service/grafana/service_package_gen.go @@ -5,35 +5,51 @@ package grafana import ( "context" - "github.com/hashicorp/terraform-plugin-framework/datasource" - "github.com/hashicorp/terraform-plugin-framework/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "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) []func(context.Context) (datasource.DataSourceWithConfigure, error) { - return []func(context.Context) (datasource.DataSourceWithConfigure, error){} +func (p *servicePackage) FrameworkDataSources(ctx context.Context) []*types.ServicePackageFrameworkDataSource { + return []*types.ServicePackageFrameworkDataSource{} } -func (p *servicePackage) FrameworkResources(ctx context.Context) []func(context.Context) (resource.ResourceWithConfigure, error) { - return []func(context.Context) (resource.ResourceWithConfigure, error){} +func (p *servicePackage) FrameworkResources(ctx context.Context) []*types.ServicePackageFrameworkResource { + return []*types.ServicePackageFrameworkResource{} } -func (p *servicePackage) SDKDataSources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{ - "aws_grafana_workspace": DataSourceWorkspace, +func (p *servicePackage) SDKDataSources(ctx context.Context) []*types.ServicePackageSDKDataSource { + return []*types.ServicePackageSDKDataSource{ + { + Factory: DataSourceWorkspace, + TypeName: "aws_grafana_workspace", + }, } } -func (p *servicePackage) SDKResources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{ - "aws_grafana_license_association": ResourceLicenseAssociation, - "aws_grafana_role_association": ResourceRoleAssociation, - "aws_grafana_workspace": ResourceWorkspace, - "aws_grafana_workspace_api_key": ResourceWorkspaceAPIKey, - "aws_grafana_workspace_saml_configuration": ResourceWorkspaceSAMLConfiguration, +func (p *servicePackage) SDKResources(ctx context.Context) []*types.ServicePackageSDKResource { + return []*types.ServicePackageSDKResource{ + { + Factory: ResourceLicenseAssociation, + TypeName: "aws_grafana_license_association", + }, + { + Factory: ResourceRoleAssociation, + TypeName: "aws_grafana_role_association", + }, + { + Factory: ResourceWorkspace, + TypeName: "aws_grafana_workspace", + }, + { + Factory: ResourceWorkspaceAPIKey, + TypeName: "aws_grafana_workspace_api_key", + }, + { + Factory: ResourceWorkspaceSAMLConfiguration, + TypeName: "aws_grafana_workspace_saml_configuration", + }, } } diff --git a/internal/service/greengrass/service_package_gen.go b/internal/service/greengrass/service_package_gen.go index fb8b5db2800f..6c156ba3c23a 100644 --- a/internal/service/greengrass/service_package_gen.go +++ b/internal/service/greengrass/service_package_gen.go @@ -5,28 +5,26 @@ package greengrass import ( "context" - "github.com/hashicorp/terraform-plugin-framework/datasource" - "github.com/hashicorp/terraform-plugin-framework/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "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) []func(context.Context) (datasource.DataSourceWithConfigure, error) { - return []func(context.Context) (datasource.DataSourceWithConfigure, error){} +func (p *servicePackage) FrameworkDataSources(ctx context.Context) []*types.ServicePackageFrameworkDataSource { + return []*types.ServicePackageFrameworkDataSource{} } -func (p *servicePackage) FrameworkResources(ctx context.Context) []func(context.Context) (resource.ResourceWithConfigure, error) { - return []func(context.Context) (resource.ResourceWithConfigure, error){} +func (p *servicePackage) FrameworkResources(ctx context.Context) []*types.ServicePackageFrameworkResource { + return []*types.ServicePackageFrameworkResource{} } -func (p *servicePackage) SDKDataSources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{} +func (p *servicePackage) SDKDataSources(ctx context.Context) []*types.ServicePackageSDKDataSource { + return []*types.ServicePackageSDKDataSource{} } -func (p *servicePackage) SDKResources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{} +func (p *servicePackage) SDKResources(ctx context.Context) []*types.ServicePackageSDKResource { + return []*types.ServicePackageSDKResource{} } func (p *servicePackage) ServicePackageName() string { diff --git a/internal/service/guardduty/service_package_gen.go b/internal/service/guardduty/service_package_gen.go index 153db18ec030..1ca9f5537b9c 100644 --- a/internal/service/guardduty/service_package_gen.go +++ b/internal/service/guardduty/service_package_gen.go @@ -5,39 +5,67 @@ package guardduty import ( "context" - "github.com/hashicorp/terraform-plugin-framework/datasource" - "github.com/hashicorp/terraform-plugin-framework/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "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) []func(context.Context) (datasource.DataSourceWithConfigure, error) { - return []func(context.Context) (datasource.DataSourceWithConfigure, error){} +func (p *servicePackage) FrameworkDataSources(ctx context.Context) []*types.ServicePackageFrameworkDataSource { + return []*types.ServicePackageFrameworkDataSource{} } -func (p *servicePackage) FrameworkResources(ctx context.Context) []func(context.Context) (resource.ResourceWithConfigure, error) { - return []func(context.Context) (resource.ResourceWithConfigure, error){} +func (p *servicePackage) FrameworkResources(ctx context.Context) []*types.ServicePackageFrameworkResource { + return []*types.ServicePackageFrameworkResource{} } -func (p *servicePackage) SDKDataSources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{ - "aws_guardduty_detector": DataSourceDetector, +func (p *servicePackage) SDKDataSources(ctx context.Context) []*types.ServicePackageSDKDataSource { + return []*types.ServicePackageSDKDataSource{ + { + Factory: DataSourceDetector, + TypeName: "aws_guardduty_detector", + }, } } -func (p *servicePackage) SDKResources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{ - "aws_guardduty_detector": ResourceDetector, - "aws_guardduty_filter": ResourceFilter, - "aws_guardduty_invite_accepter": ResourceInviteAccepter, - "aws_guardduty_ipset": ResourceIPSet, - "aws_guardduty_member": ResourceMember, - "aws_guardduty_organization_admin_account": ResourceOrganizationAdminAccount, - "aws_guardduty_organization_configuration": ResourceOrganizationConfiguration, - "aws_guardduty_publishing_destination": ResourcePublishingDestination, - "aws_guardduty_threatintelset": ResourceThreatIntelSet, +func (p *servicePackage) SDKResources(ctx context.Context) []*types.ServicePackageSDKResource { + return []*types.ServicePackageSDKResource{ + { + Factory: ResourceDetector, + TypeName: "aws_guardduty_detector", + }, + { + Factory: ResourceFilter, + TypeName: "aws_guardduty_filter", + }, + { + Factory: ResourceInviteAccepter, + TypeName: "aws_guardduty_invite_accepter", + }, + { + Factory: ResourceIPSet, + TypeName: "aws_guardduty_ipset", + }, + { + Factory: ResourceMember, + TypeName: "aws_guardduty_member", + }, + { + Factory: ResourceOrganizationAdminAccount, + TypeName: "aws_guardduty_organization_admin_account", + }, + { + Factory: ResourceOrganizationConfiguration, + TypeName: "aws_guardduty_organization_configuration", + }, + { + Factory: ResourcePublishingDestination, + TypeName: "aws_guardduty_publishing_destination", + }, + { + Factory: ResourceThreatIntelSet, + TypeName: "aws_guardduty_threatintelset", + }, } } diff --git a/internal/service/healthlake/service_package_gen.go b/internal/service/healthlake/service_package_gen.go index 1c78237bb028..84b2d685fb48 100644 --- a/internal/service/healthlake/service_package_gen.go +++ b/internal/service/healthlake/service_package_gen.go @@ -5,28 +5,26 @@ package healthlake import ( "context" - "github.com/hashicorp/terraform-plugin-framework/datasource" - "github.com/hashicorp/terraform-plugin-framework/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "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) []func(context.Context) (datasource.DataSourceWithConfigure, error) { - return []func(context.Context) (datasource.DataSourceWithConfigure, error){} +func (p *servicePackage) FrameworkDataSources(ctx context.Context) []*types.ServicePackageFrameworkDataSource { + return []*types.ServicePackageFrameworkDataSource{} } -func (p *servicePackage) FrameworkResources(ctx context.Context) []func(context.Context) (resource.ResourceWithConfigure, error) { - return []func(context.Context) (resource.ResourceWithConfigure, error){} +func (p *servicePackage) FrameworkResources(ctx context.Context) []*types.ServicePackageFrameworkResource { + return []*types.ServicePackageFrameworkResource{} } -func (p *servicePackage) SDKDataSources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{} +func (p *servicePackage) SDKDataSources(ctx context.Context) []*types.ServicePackageSDKDataSource { + return []*types.ServicePackageSDKDataSource{} } -func (p *servicePackage) SDKResources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{} +func (p *servicePackage) SDKResources(ctx context.Context) []*types.ServicePackageSDKResource { + return []*types.ServicePackageSDKResource{} } func (p *servicePackage) ServicePackageName() string { diff --git a/internal/service/iam/service_package_gen.go b/internal/service/iam/service_package_gen.go index 503f4081f340..d3459395d59a 100644 --- a/internal/service/iam/service_package_gen.go +++ b/internal/service/iam/service_package_gen.go @@ -5,70 +5,191 @@ package iam import ( "context" - "github.com/hashicorp/terraform-plugin-framework/datasource" - "github.com/hashicorp/terraform-plugin-framework/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "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) []func(context.Context) (datasource.DataSourceWithConfigure, error) { - return []func(context.Context) (datasource.DataSourceWithConfigure, error){} +func (p *servicePackage) FrameworkDataSources(ctx context.Context) []*types.ServicePackageFrameworkDataSource { + return []*types.ServicePackageFrameworkDataSource{} } -func (p *servicePackage) FrameworkResources(ctx context.Context) []func(context.Context) (resource.ResourceWithConfigure, error) { - return []func(context.Context) (resource.ResourceWithConfigure, error){} +func (p *servicePackage) FrameworkResources(ctx context.Context) []*types.ServicePackageFrameworkResource { + return []*types.ServicePackageFrameworkResource{} } -func (p *servicePackage) SDKDataSources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{ - "aws_iam_account_alias": DataSourceAccountAlias, - "aws_iam_group": DataSourceGroup, - "aws_iam_instance_profile": DataSourceInstanceProfile, - "aws_iam_instance_profiles": DataSourceInstanceProfiles, - "aws_iam_openid_connect_provider": DataSourceOpenIDConnectProvider, - "aws_iam_policy": DataSourcePolicy, - "aws_iam_policy_document": DataSourcePolicyDocument, - "aws_iam_role": DataSourceRole, - "aws_iam_roles": DataSourceRoles, - "aws_iam_saml_provider": DataSourceSAMLProvider, - "aws_iam_server_certificate": DataSourceServerCertificate, - "aws_iam_session_context": DataSourceSessionContext, - "aws_iam_user": DataSourceUser, - "aws_iam_user_ssh_key": DataSourceUserSSHKey, - "aws_iam_users": DataSourceUsers, +func (p *servicePackage) SDKDataSources(ctx context.Context) []*types.ServicePackageSDKDataSource { + return []*types.ServicePackageSDKDataSource{ + { + Factory: DataSourceAccountAlias, + TypeName: "aws_iam_account_alias", + }, + { + Factory: DataSourceGroup, + TypeName: "aws_iam_group", + }, + { + Factory: DataSourceInstanceProfile, + TypeName: "aws_iam_instance_profile", + }, + { + Factory: DataSourceInstanceProfiles, + TypeName: "aws_iam_instance_profiles", + }, + { + Factory: DataSourceOpenIDConnectProvider, + TypeName: "aws_iam_openid_connect_provider", + }, + { + Factory: DataSourcePolicy, + TypeName: "aws_iam_policy", + }, + { + Factory: DataSourcePolicyDocument, + TypeName: "aws_iam_policy_document", + }, + { + Factory: DataSourceRole, + TypeName: "aws_iam_role", + }, + { + Factory: DataSourceRoles, + TypeName: "aws_iam_roles", + }, + { + Factory: DataSourceSAMLProvider, + TypeName: "aws_iam_saml_provider", + }, + { + Factory: DataSourceServerCertificate, + TypeName: "aws_iam_server_certificate", + }, + { + Factory: DataSourceSessionContext, + TypeName: "aws_iam_session_context", + }, + { + Factory: DataSourceUser, + TypeName: "aws_iam_user", + }, + { + Factory: DataSourceUserSSHKey, + TypeName: "aws_iam_user_ssh_key", + }, + { + Factory: DataSourceUsers, + TypeName: "aws_iam_users", + }, } } -func (p *servicePackage) SDKResources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{ - "aws_iam_access_key": ResourceAccessKey, - "aws_iam_account_alias": ResourceAccountAlias, - "aws_iam_account_password_policy": ResourceAccountPasswordPolicy, - "aws_iam_group": ResourceGroup, - "aws_iam_group_membership": ResourceGroupMembership, - "aws_iam_group_policy": ResourceGroupPolicy, - "aws_iam_group_policy_attachment": ResourceGroupPolicyAttachment, - "aws_iam_instance_profile": ResourceInstanceProfile, - "aws_iam_openid_connect_provider": ResourceOpenIDConnectProvider, - "aws_iam_policy": ResourcePolicy, - "aws_iam_policy_attachment": ResourcePolicyAttachment, - "aws_iam_role": ResourceRole, - "aws_iam_role_policy": ResourceRolePolicy, - "aws_iam_role_policy_attachment": ResourceRolePolicyAttachment, - "aws_iam_saml_provider": ResourceSAMLProvider, - "aws_iam_server_certificate": ResourceServerCertificate, - "aws_iam_service_linked_role": ResourceServiceLinkedRole, - "aws_iam_service_specific_credential": ResourceServiceSpecificCredential, - "aws_iam_signing_certificate": ResourceSigningCertificate, - "aws_iam_user": ResourceUser, - "aws_iam_user_group_membership": ResourceUserGroupMembership, - "aws_iam_user_login_profile": ResourceUserLoginProfile, - "aws_iam_user_policy": ResourceUserPolicy, - "aws_iam_user_policy_attachment": ResourceUserPolicyAttachment, - "aws_iam_user_ssh_key": ResourceUserSSHKey, - "aws_iam_virtual_mfa_device": ResourceVirtualMFADevice, +func (p *servicePackage) SDKResources(ctx context.Context) []*types.ServicePackageSDKResource { + return []*types.ServicePackageSDKResource{ + { + Factory: ResourceAccessKey, + TypeName: "aws_iam_access_key", + }, + { + Factory: ResourceAccountAlias, + TypeName: "aws_iam_account_alias", + }, + { + Factory: ResourceAccountPasswordPolicy, + TypeName: "aws_iam_account_password_policy", + }, + { + Factory: ResourceGroup, + TypeName: "aws_iam_group", + }, + { + Factory: ResourceGroupMembership, + TypeName: "aws_iam_group_membership", + }, + { + Factory: ResourceGroupPolicy, + TypeName: "aws_iam_group_policy", + }, + { + Factory: ResourceGroupPolicyAttachment, + TypeName: "aws_iam_group_policy_attachment", + }, + { + Factory: ResourceInstanceProfile, + TypeName: "aws_iam_instance_profile", + }, + { + Factory: ResourceOpenIDConnectProvider, + TypeName: "aws_iam_openid_connect_provider", + }, + { + Factory: ResourcePolicy, + TypeName: "aws_iam_policy", + }, + { + Factory: ResourcePolicyAttachment, + TypeName: "aws_iam_policy_attachment", + }, + { + Factory: ResourceRole, + TypeName: "aws_iam_role", + }, + { + Factory: ResourceRolePolicy, + TypeName: "aws_iam_role_policy", + }, + { + Factory: ResourceRolePolicyAttachment, + TypeName: "aws_iam_role_policy_attachment", + }, + { + Factory: ResourceSAMLProvider, + TypeName: "aws_iam_saml_provider", + }, + { + Factory: ResourceServerCertificate, + TypeName: "aws_iam_server_certificate", + }, + { + Factory: ResourceServiceLinkedRole, + TypeName: "aws_iam_service_linked_role", + }, + { + Factory: ResourceServiceSpecificCredential, + TypeName: "aws_iam_service_specific_credential", + }, + { + Factory: ResourceSigningCertificate, + TypeName: "aws_iam_signing_certificate", + }, + { + Factory: ResourceUser, + TypeName: "aws_iam_user", + }, + { + Factory: ResourceUserGroupMembership, + TypeName: "aws_iam_user_group_membership", + }, + { + Factory: ResourceUserLoginProfile, + TypeName: "aws_iam_user_login_profile", + }, + { + Factory: ResourceUserPolicy, + TypeName: "aws_iam_user_policy", + }, + { + Factory: ResourceUserPolicyAttachment, + TypeName: "aws_iam_user_policy_attachment", + }, + { + Factory: ResourceUserSSHKey, + TypeName: "aws_iam_user_ssh_key", + }, + { + Factory: ResourceVirtualMFADevice, + TypeName: "aws_iam_virtual_mfa_device", + }, } } diff --git a/internal/service/identitystore/service_package_gen.go b/internal/service/identitystore/service_package_gen.go index e70fb34cf691..6f1b905fcdee 100644 --- a/internal/service/identitystore/service_package_gen.go +++ b/internal/service/identitystore/service_package_gen.go @@ -5,34 +5,47 @@ package identitystore import ( "context" - "github.com/hashicorp/terraform-plugin-framework/datasource" - "github.com/hashicorp/terraform-plugin-framework/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "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) []func(context.Context) (datasource.DataSourceWithConfigure, error) { - return []func(context.Context) (datasource.DataSourceWithConfigure, error){} +func (p *servicePackage) FrameworkDataSources(ctx context.Context) []*types.ServicePackageFrameworkDataSource { + return []*types.ServicePackageFrameworkDataSource{} } -func (p *servicePackage) FrameworkResources(ctx context.Context) []func(context.Context) (resource.ResourceWithConfigure, error) { - return []func(context.Context) (resource.ResourceWithConfigure, error){} +func (p *servicePackage) FrameworkResources(ctx context.Context) []*types.ServicePackageFrameworkResource { + return []*types.ServicePackageFrameworkResource{} } -func (p *servicePackage) SDKDataSources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{ - "aws_identitystore_group": DataSourceGroup, - "aws_identitystore_user": DataSourceUser, +func (p *servicePackage) SDKDataSources(ctx context.Context) []*types.ServicePackageSDKDataSource { + return []*types.ServicePackageSDKDataSource{ + { + Factory: DataSourceGroup, + TypeName: "aws_identitystore_group", + }, + { + Factory: DataSourceUser, + TypeName: "aws_identitystore_user", + }, } } -func (p *servicePackage) SDKResources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{ - "aws_identitystore_group": ResourceGroup, - "aws_identitystore_group_membership": ResourceGroupMembership, - "aws_identitystore_user": ResourceUser, +func (p *servicePackage) SDKResources(ctx context.Context) []*types.ServicePackageSDKResource { + return []*types.ServicePackageSDKResource{ + { + Factory: ResourceGroup, + TypeName: "aws_identitystore_group", + }, + { + Factory: ResourceGroupMembership, + TypeName: "aws_identitystore_group_membership", + }, + { + Factory: ResourceUser, + TypeName: "aws_identitystore_user", + }, } } diff --git a/internal/service/imagebuilder/service_package_gen.go b/internal/service/imagebuilder/service_package_gen.go index e26b3883b4e6..8d3a4751b66c 100644 --- a/internal/service/imagebuilder/service_package_gen.go +++ b/internal/service/imagebuilder/service_package_gen.go @@ -5,49 +5,107 @@ package imagebuilder import ( "context" - "github.com/hashicorp/terraform-plugin-framework/datasource" - "github.com/hashicorp/terraform-plugin-framework/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "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) []func(context.Context) (datasource.DataSourceWithConfigure, error) { - return []func(context.Context) (datasource.DataSourceWithConfigure, error){} +func (p *servicePackage) FrameworkDataSources(ctx context.Context) []*types.ServicePackageFrameworkDataSource { + return []*types.ServicePackageFrameworkDataSource{} } -func (p *servicePackage) FrameworkResources(ctx context.Context) []func(context.Context) (resource.ResourceWithConfigure, error) { - return []func(context.Context) (resource.ResourceWithConfigure, error){} +func (p *servicePackage) FrameworkResources(ctx context.Context) []*types.ServicePackageFrameworkResource { + return []*types.ServicePackageFrameworkResource{} } -func (p *servicePackage) SDKDataSources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{ - "aws_imagebuilder_component": DataSourceComponent, - "aws_imagebuilder_components": DataSourceComponents, - "aws_imagebuilder_container_recipe": DataSourceContainerRecipe, - "aws_imagebuilder_container_recipes": DataSourceContainerRecipes, - "aws_imagebuilder_distribution_configuration": DataSourceDistributionConfiguration, - "aws_imagebuilder_distribution_configurations": DataSourceDistributionConfigurations, - "aws_imagebuilder_image": DataSourceImage, - "aws_imagebuilder_image_pipeline": DataSourceImagePipeline, - "aws_imagebuilder_image_pipelines": DataSourceImagePipelines, - "aws_imagebuilder_image_recipe": DataSourceImageRecipe, - "aws_imagebuilder_image_recipes": DataSourceImageRecipes, - "aws_imagebuilder_infrastructure_configuration": DataSourceInfrastructureConfiguration, - "aws_imagebuilder_infrastructure_configurations": DataSourceInfrastructureConfigurations, +func (p *servicePackage) SDKDataSources(ctx context.Context) []*types.ServicePackageSDKDataSource { + return []*types.ServicePackageSDKDataSource{ + { + Factory: DataSourceComponent, + TypeName: "aws_imagebuilder_component", + }, + { + Factory: DataSourceComponents, + TypeName: "aws_imagebuilder_components", + }, + { + Factory: DataSourceContainerRecipe, + TypeName: "aws_imagebuilder_container_recipe", + }, + { + Factory: DataSourceContainerRecipes, + TypeName: "aws_imagebuilder_container_recipes", + }, + { + Factory: DataSourceDistributionConfiguration, + TypeName: "aws_imagebuilder_distribution_configuration", + }, + { + Factory: DataSourceDistributionConfigurations, + TypeName: "aws_imagebuilder_distribution_configurations", + }, + { + Factory: DataSourceImage, + TypeName: "aws_imagebuilder_image", + }, + { + Factory: DataSourceImagePipeline, + TypeName: "aws_imagebuilder_image_pipeline", + }, + { + Factory: DataSourceImagePipelines, + TypeName: "aws_imagebuilder_image_pipelines", + }, + { + Factory: DataSourceImageRecipe, + TypeName: "aws_imagebuilder_image_recipe", + }, + { + Factory: DataSourceImageRecipes, + TypeName: "aws_imagebuilder_image_recipes", + }, + { + Factory: DataSourceInfrastructureConfiguration, + TypeName: "aws_imagebuilder_infrastructure_configuration", + }, + { + Factory: DataSourceInfrastructureConfigurations, + TypeName: "aws_imagebuilder_infrastructure_configurations", + }, } } -func (p *servicePackage) SDKResources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{ - "aws_imagebuilder_component": ResourceComponent, - "aws_imagebuilder_container_recipe": ResourceContainerRecipe, - "aws_imagebuilder_distribution_configuration": ResourceDistributionConfiguration, - "aws_imagebuilder_image": ResourceImage, - "aws_imagebuilder_image_pipeline": ResourceImagePipeline, - "aws_imagebuilder_image_recipe": ResourceImageRecipe, - "aws_imagebuilder_infrastructure_configuration": ResourceInfrastructureConfiguration, +func (p *servicePackage) SDKResources(ctx context.Context) []*types.ServicePackageSDKResource { + return []*types.ServicePackageSDKResource{ + { + Factory: ResourceComponent, + TypeName: "aws_imagebuilder_component", + }, + { + Factory: ResourceContainerRecipe, + TypeName: "aws_imagebuilder_container_recipe", + }, + { + Factory: ResourceDistributionConfiguration, + TypeName: "aws_imagebuilder_distribution_configuration", + }, + { + Factory: ResourceImage, + TypeName: "aws_imagebuilder_image", + }, + { + Factory: ResourceImagePipeline, + TypeName: "aws_imagebuilder_image_pipeline", + }, + { + Factory: ResourceImageRecipe, + TypeName: "aws_imagebuilder_image_recipe", + }, + { + Factory: ResourceInfrastructureConfiguration, + TypeName: "aws_imagebuilder_infrastructure_configuration", + }, } } diff --git a/internal/service/inspector/service_package_gen.go b/internal/service/inspector/service_package_gen.go index 6e982f9a16c7..ddfdcaba6457 100644 --- a/internal/service/inspector/service_package_gen.go +++ b/internal/service/inspector/service_package_gen.go @@ -5,33 +5,43 @@ package inspector import ( "context" - "github.com/hashicorp/terraform-plugin-framework/datasource" - "github.com/hashicorp/terraform-plugin-framework/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "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) []func(context.Context) (datasource.DataSourceWithConfigure, error) { - return []func(context.Context) (datasource.DataSourceWithConfigure, error){} +func (p *servicePackage) FrameworkDataSources(ctx context.Context) []*types.ServicePackageFrameworkDataSource { + return []*types.ServicePackageFrameworkDataSource{} } -func (p *servicePackage) FrameworkResources(ctx context.Context) []func(context.Context) (resource.ResourceWithConfigure, error) { - return []func(context.Context) (resource.ResourceWithConfigure, error){} +func (p *servicePackage) FrameworkResources(ctx context.Context) []*types.ServicePackageFrameworkResource { + return []*types.ServicePackageFrameworkResource{} } -func (p *servicePackage) SDKDataSources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{ - "aws_inspector_rules_packages": DataSourceRulesPackages, +func (p *servicePackage) SDKDataSources(ctx context.Context) []*types.ServicePackageSDKDataSource { + return []*types.ServicePackageSDKDataSource{ + { + Factory: DataSourceRulesPackages, + TypeName: "aws_inspector_rules_packages", + }, } } -func (p *servicePackage) SDKResources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{ - "aws_inspector_assessment_target": ResourceAssessmentTarget, - "aws_inspector_assessment_template": ResourceAssessmentTemplate, - "aws_inspector_resource_group": ResourceResourceGroup, +func (p *servicePackage) SDKResources(ctx context.Context) []*types.ServicePackageSDKResource { + return []*types.ServicePackageSDKResource{ + { + Factory: ResourceAssessmentTarget, + TypeName: "aws_inspector_assessment_target", + }, + { + Factory: ResourceAssessmentTemplate, + TypeName: "aws_inspector_assessment_template", + }, + { + Factory: ResourceResourceGroup, + TypeName: "aws_inspector_resource_group", + }, } } diff --git a/internal/service/inspector2/service_package_gen.go b/internal/service/inspector2/service_package_gen.go index 04f94ceea7d8..0f0033e01699 100644 --- a/internal/service/inspector2/service_package_gen.go +++ b/internal/service/inspector2/service_package_gen.go @@ -5,31 +5,38 @@ package inspector2 import ( "context" - "github.com/hashicorp/terraform-plugin-framework/datasource" - "github.com/hashicorp/terraform-plugin-framework/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "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) []func(context.Context) (datasource.DataSourceWithConfigure, error) { - return []func(context.Context) (datasource.DataSourceWithConfigure, error){} +func (p *servicePackage) FrameworkDataSources(ctx context.Context) []*types.ServicePackageFrameworkDataSource { + return []*types.ServicePackageFrameworkDataSource{} } -func (p *servicePackage) FrameworkResources(ctx context.Context) []func(context.Context) (resource.ResourceWithConfigure, error) { - return []func(context.Context) (resource.ResourceWithConfigure, error){} +func (p *servicePackage) FrameworkResources(ctx context.Context) []*types.ServicePackageFrameworkResource { + return []*types.ServicePackageFrameworkResource{} } -func (p *servicePackage) SDKDataSources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{} +func (p *servicePackage) SDKDataSources(ctx context.Context) []*types.ServicePackageSDKDataSource { + return []*types.ServicePackageSDKDataSource{} } -func (p *servicePackage) SDKResources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{ - "aws_inspector2_delegated_admin_account": ResourceDelegatedAdminAccount, - "aws_inspector2_enabler": ResourceEnabler, - "aws_inspector2_organization_configuration": ResourceOrganizationConfiguration, +func (p *servicePackage) SDKResources(ctx context.Context) []*types.ServicePackageSDKResource { + return []*types.ServicePackageSDKResource{ + { + Factory: ResourceDelegatedAdminAccount, + TypeName: "aws_inspector2_delegated_admin_account", + }, + { + Factory: ResourceEnabler, + TypeName: "aws_inspector2_enabler", + }, + { + Factory: ResourceOrganizationConfiguration, + TypeName: "aws_inspector2_organization_configuration", + }, } } diff --git a/internal/service/iot/service_package_gen.go b/internal/service/iot/service_package_gen.go index fb5d8e434707..b44bd098d9fb 100644 --- a/internal/service/iot/service_package_gen.go +++ b/internal/service/iot/service_package_gen.go @@ -5,45 +5,91 @@ package iot import ( "context" - "github.com/hashicorp/terraform-plugin-framework/datasource" - "github.com/hashicorp/terraform-plugin-framework/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "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) []func(context.Context) (datasource.DataSourceWithConfigure, error) { - return []func(context.Context) (datasource.DataSourceWithConfigure, error){} +func (p *servicePackage) FrameworkDataSources(ctx context.Context) []*types.ServicePackageFrameworkDataSource { + return []*types.ServicePackageFrameworkDataSource{} } -func (p *servicePackage) FrameworkResources(ctx context.Context) []func(context.Context) (resource.ResourceWithConfigure, error) { - return []func(context.Context) (resource.ResourceWithConfigure, error){} +func (p *servicePackage) FrameworkResources(ctx context.Context) []*types.ServicePackageFrameworkResource { + return []*types.ServicePackageFrameworkResource{} } -func (p *servicePackage) SDKDataSources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{ - "aws_iot_endpoint": DataSourceEndpoint, +func (p *servicePackage) SDKDataSources(ctx context.Context) []*types.ServicePackageSDKDataSource { + return []*types.ServicePackageSDKDataSource{ + { + Factory: DataSourceEndpoint, + TypeName: "aws_iot_endpoint", + }, } } -func (p *servicePackage) SDKResources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{ - "aws_iot_authorizer": ResourceAuthorizer, - "aws_iot_certificate": ResourceCertificate, - "aws_iot_indexing_configuration": ResourceIndexingConfiguration, - "aws_iot_logging_options": ResourceLoggingOptions, - "aws_iot_policy": ResourcePolicy, - "aws_iot_policy_attachment": ResourcePolicyAttachment, - "aws_iot_provisioning_template": ResourceProvisioningTemplate, - "aws_iot_role_alias": ResourceRoleAlias, - "aws_iot_thing": ResourceThing, - "aws_iot_thing_group": ResourceThingGroup, - "aws_iot_thing_group_membership": ResourceThingGroupMembership, - "aws_iot_thing_principal_attachment": ResourceThingPrincipalAttachment, - "aws_iot_thing_type": ResourceThingType, - "aws_iot_topic_rule": ResourceTopicRule, - "aws_iot_topic_rule_destination": ResourceTopicRuleDestination, +func (p *servicePackage) SDKResources(ctx context.Context) []*types.ServicePackageSDKResource { + return []*types.ServicePackageSDKResource{ + { + Factory: ResourceAuthorizer, + TypeName: "aws_iot_authorizer", + }, + { + Factory: ResourceCertificate, + TypeName: "aws_iot_certificate", + }, + { + Factory: ResourceIndexingConfiguration, + TypeName: "aws_iot_indexing_configuration", + }, + { + Factory: ResourceLoggingOptions, + TypeName: "aws_iot_logging_options", + }, + { + Factory: ResourcePolicy, + TypeName: "aws_iot_policy", + }, + { + Factory: ResourcePolicyAttachment, + TypeName: "aws_iot_policy_attachment", + }, + { + Factory: ResourceProvisioningTemplate, + TypeName: "aws_iot_provisioning_template", + }, + { + Factory: ResourceRoleAlias, + TypeName: "aws_iot_role_alias", + }, + { + Factory: ResourceThing, + TypeName: "aws_iot_thing", + }, + { + Factory: ResourceThingGroup, + TypeName: "aws_iot_thing_group", + }, + { + Factory: ResourceThingGroupMembership, + TypeName: "aws_iot_thing_group_membership", + }, + { + Factory: ResourceThingPrincipalAttachment, + TypeName: "aws_iot_thing_principal_attachment", + }, + { + Factory: ResourceThingType, + TypeName: "aws_iot_thing_type", + }, + { + Factory: ResourceTopicRule, + TypeName: "aws_iot_topic_rule", + }, + { + Factory: ResourceTopicRuleDestination, + TypeName: "aws_iot_topic_rule_destination", + }, } } diff --git a/internal/service/iotanalytics/service_package_gen.go b/internal/service/iotanalytics/service_package_gen.go index 4c80dcb573b9..7ec817167b67 100644 --- a/internal/service/iotanalytics/service_package_gen.go +++ b/internal/service/iotanalytics/service_package_gen.go @@ -5,28 +5,26 @@ package iotanalytics import ( "context" - "github.com/hashicorp/terraform-plugin-framework/datasource" - "github.com/hashicorp/terraform-plugin-framework/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "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) []func(context.Context) (datasource.DataSourceWithConfigure, error) { - return []func(context.Context) (datasource.DataSourceWithConfigure, error){} +func (p *servicePackage) FrameworkDataSources(ctx context.Context) []*types.ServicePackageFrameworkDataSource { + return []*types.ServicePackageFrameworkDataSource{} } -func (p *servicePackage) FrameworkResources(ctx context.Context) []func(context.Context) (resource.ResourceWithConfigure, error) { - return []func(context.Context) (resource.ResourceWithConfigure, error){} +func (p *servicePackage) FrameworkResources(ctx context.Context) []*types.ServicePackageFrameworkResource { + return []*types.ServicePackageFrameworkResource{} } -func (p *servicePackage) SDKDataSources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{} +func (p *servicePackage) SDKDataSources(ctx context.Context) []*types.ServicePackageSDKDataSource { + return []*types.ServicePackageSDKDataSource{} } -func (p *servicePackage) SDKResources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{} +func (p *servicePackage) SDKResources(ctx context.Context) []*types.ServicePackageSDKResource { + return []*types.ServicePackageSDKResource{} } func (p *servicePackage) ServicePackageName() string { diff --git a/internal/service/iotevents/service_package_gen.go b/internal/service/iotevents/service_package_gen.go index 955880691a1a..7c5a132a7369 100644 --- a/internal/service/iotevents/service_package_gen.go +++ b/internal/service/iotevents/service_package_gen.go @@ -5,28 +5,26 @@ package iotevents import ( "context" - "github.com/hashicorp/terraform-plugin-framework/datasource" - "github.com/hashicorp/terraform-plugin-framework/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "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) []func(context.Context) (datasource.DataSourceWithConfigure, error) { - return []func(context.Context) (datasource.DataSourceWithConfigure, error){} +func (p *servicePackage) FrameworkDataSources(ctx context.Context) []*types.ServicePackageFrameworkDataSource { + return []*types.ServicePackageFrameworkDataSource{} } -func (p *servicePackage) FrameworkResources(ctx context.Context) []func(context.Context) (resource.ResourceWithConfigure, error) { - return []func(context.Context) (resource.ResourceWithConfigure, error){} +func (p *servicePackage) FrameworkResources(ctx context.Context) []*types.ServicePackageFrameworkResource { + return []*types.ServicePackageFrameworkResource{} } -func (p *servicePackage) SDKDataSources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{} +func (p *servicePackage) SDKDataSources(ctx context.Context) []*types.ServicePackageSDKDataSource { + return []*types.ServicePackageSDKDataSource{} } -func (p *servicePackage) SDKResources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{} +func (p *servicePackage) SDKResources(ctx context.Context) []*types.ServicePackageSDKResource { + return []*types.ServicePackageSDKResource{} } func (p *servicePackage) ServicePackageName() string { diff --git a/internal/service/ivs/service_package_gen.go b/internal/service/ivs/service_package_gen.go index 2b99c1349bea..d230b7436589 100644 --- a/internal/service/ivs/service_package_gen.go +++ b/internal/service/ivs/service_package_gen.go @@ -5,33 +5,43 @@ package ivs import ( "context" - "github.com/hashicorp/terraform-plugin-framework/datasource" - "github.com/hashicorp/terraform-plugin-framework/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "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) []func(context.Context) (datasource.DataSourceWithConfigure, error) { - return []func(context.Context) (datasource.DataSourceWithConfigure, error){} +func (p *servicePackage) FrameworkDataSources(ctx context.Context) []*types.ServicePackageFrameworkDataSource { + return []*types.ServicePackageFrameworkDataSource{} } -func (p *servicePackage) FrameworkResources(ctx context.Context) []func(context.Context) (resource.ResourceWithConfigure, error) { - return []func(context.Context) (resource.ResourceWithConfigure, error){} +func (p *servicePackage) FrameworkResources(ctx context.Context) []*types.ServicePackageFrameworkResource { + return []*types.ServicePackageFrameworkResource{} } -func (p *servicePackage) SDKDataSources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{ - "aws_ivs_stream_key": DataSourceStreamKey, +func (p *servicePackage) SDKDataSources(ctx context.Context) []*types.ServicePackageSDKDataSource { + return []*types.ServicePackageSDKDataSource{ + { + Factory: DataSourceStreamKey, + TypeName: "aws_ivs_stream_key", + }, } } -func (p *servicePackage) SDKResources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{ - "aws_ivs_channel": ResourceChannel, - "aws_ivs_playback_key_pair": ResourcePlaybackKeyPair, - "aws_ivs_recording_configuration": ResourceRecordingConfiguration, +func (p *servicePackage) SDKResources(ctx context.Context) []*types.ServicePackageSDKResource { + return []*types.ServicePackageSDKResource{ + { + Factory: ResourceChannel, + TypeName: "aws_ivs_channel", + }, + { + Factory: ResourcePlaybackKeyPair, + TypeName: "aws_ivs_playback_key_pair", + }, + { + Factory: ResourceRecordingConfiguration, + TypeName: "aws_ivs_recording_configuration", + }, } } diff --git a/internal/service/ivschat/service_package_gen.go b/internal/service/ivschat/service_package_gen.go index 6d6fa53cb41e..af1f6d210b92 100644 --- a/internal/service/ivschat/service_package_gen.go +++ b/internal/service/ivschat/service_package_gen.go @@ -5,30 +5,34 @@ package ivschat import ( "context" - "github.com/hashicorp/terraform-plugin-framework/datasource" - "github.com/hashicorp/terraform-plugin-framework/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "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) []func(context.Context) (datasource.DataSourceWithConfigure, error) { - return []func(context.Context) (datasource.DataSourceWithConfigure, error){} +func (p *servicePackage) FrameworkDataSources(ctx context.Context) []*types.ServicePackageFrameworkDataSource { + return []*types.ServicePackageFrameworkDataSource{} } -func (p *servicePackage) FrameworkResources(ctx context.Context) []func(context.Context) (resource.ResourceWithConfigure, error) { - return []func(context.Context) (resource.ResourceWithConfigure, error){} +func (p *servicePackage) FrameworkResources(ctx context.Context) []*types.ServicePackageFrameworkResource { + return []*types.ServicePackageFrameworkResource{} } -func (p *servicePackage) SDKDataSources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{} +func (p *servicePackage) SDKDataSources(ctx context.Context) []*types.ServicePackageSDKDataSource { + return []*types.ServicePackageSDKDataSource{} } -func (p *servicePackage) SDKResources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{ - "aws_ivschat_logging_configuration": ResourceLoggingConfiguration, - "aws_ivschat_room": ResourceRoom, +func (p *servicePackage) SDKResources(ctx context.Context) []*types.ServicePackageSDKResource { + return []*types.ServicePackageSDKResource{ + { + Factory: ResourceLoggingConfiguration, + TypeName: "aws_ivschat_logging_configuration", + }, + { + Factory: ResourceRoom, + TypeName: "aws_ivschat_room", + }, } } diff --git a/internal/service/kafka/service_package_gen.go b/internal/service/kafka/service_package_gen.go index 9a1dbb01f717..2fef23cc612d 100644 --- a/internal/service/kafka/service_package_gen.go +++ b/internal/service/kafka/service_package_gen.go @@ -5,37 +5,59 @@ package kafka import ( "context" - "github.com/hashicorp/terraform-plugin-framework/datasource" - "github.com/hashicorp/terraform-plugin-framework/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "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) []func(context.Context) (datasource.DataSourceWithConfigure, error) { - return []func(context.Context) (datasource.DataSourceWithConfigure, error){} +func (p *servicePackage) FrameworkDataSources(ctx context.Context) []*types.ServicePackageFrameworkDataSource { + return []*types.ServicePackageFrameworkDataSource{} } -func (p *servicePackage) FrameworkResources(ctx context.Context) []func(context.Context) (resource.ResourceWithConfigure, error) { - return []func(context.Context) (resource.ResourceWithConfigure, error){} +func (p *servicePackage) FrameworkResources(ctx context.Context) []*types.ServicePackageFrameworkResource { + return []*types.ServicePackageFrameworkResource{} } -func (p *servicePackage) SDKDataSources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{ - "aws_msk_broker_nodes": DataSourceBrokerNodes, - "aws_msk_cluster": DataSourceCluster, - "aws_msk_configuration": DataSourceConfiguration, - "aws_msk_kafka_version": DataSourceVersion, +func (p *servicePackage) SDKDataSources(ctx context.Context) []*types.ServicePackageSDKDataSource { + return []*types.ServicePackageSDKDataSource{ + { + Factory: DataSourceBrokerNodes, + TypeName: "aws_msk_broker_nodes", + }, + { + Factory: DataSourceCluster, + TypeName: "aws_msk_cluster", + }, + { + Factory: DataSourceConfiguration, + TypeName: "aws_msk_configuration", + }, + { + Factory: DataSourceVersion, + TypeName: "aws_msk_kafka_version", + }, } } -func (p *servicePackage) SDKResources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{ - "aws_msk_cluster": ResourceCluster, - "aws_msk_configuration": ResourceConfiguration, - "aws_msk_scram_secret_association": ResourceScramSecretAssociation, - "aws_msk_serverless_cluster": ResourceServerlessCluster, +func (p *servicePackage) SDKResources(ctx context.Context) []*types.ServicePackageSDKResource { + return []*types.ServicePackageSDKResource{ + { + Factory: ResourceCluster, + TypeName: "aws_msk_cluster", + }, + { + Factory: ResourceConfiguration, + TypeName: "aws_msk_configuration", + }, + { + Factory: ResourceScramSecretAssociation, + TypeName: "aws_msk_scram_secret_association", + }, + { + Factory: ResourceServerlessCluster, + TypeName: "aws_msk_serverless_cluster", + }, } } diff --git a/internal/service/kafkaconnect/service_package_gen.go b/internal/service/kafkaconnect/service_package_gen.go index 7a6f503ec3dd..2d6bad664f17 100644 --- a/internal/service/kafkaconnect/service_package_gen.go +++ b/internal/service/kafkaconnect/service_package_gen.go @@ -5,35 +5,51 @@ package kafkaconnect import ( "context" - "github.com/hashicorp/terraform-plugin-framework/datasource" - "github.com/hashicorp/terraform-plugin-framework/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "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) []func(context.Context) (datasource.DataSourceWithConfigure, error) { - return []func(context.Context) (datasource.DataSourceWithConfigure, error){} +func (p *servicePackage) FrameworkDataSources(ctx context.Context) []*types.ServicePackageFrameworkDataSource { + return []*types.ServicePackageFrameworkDataSource{} } -func (p *servicePackage) FrameworkResources(ctx context.Context) []func(context.Context) (resource.ResourceWithConfigure, error) { - return []func(context.Context) (resource.ResourceWithConfigure, error){} +func (p *servicePackage) FrameworkResources(ctx context.Context) []*types.ServicePackageFrameworkResource { + return []*types.ServicePackageFrameworkResource{} } -func (p *servicePackage) SDKDataSources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{ - "aws_mskconnect_connector": DataSourceConnector, - "aws_mskconnect_custom_plugin": DataSourceCustomPlugin, - "aws_mskconnect_worker_configuration": DataSourceWorkerConfiguration, +func (p *servicePackage) SDKDataSources(ctx context.Context) []*types.ServicePackageSDKDataSource { + return []*types.ServicePackageSDKDataSource{ + { + Factory: DataSourceConnector, + TypeName: "aws_mskconnect_connector", + }, + { + Factory: DataSourceCustomPlugin, + TypeName: "aws_mskconnect_custom_plugin", + }, + { + Factory: DataSourceWorkerConfiguration, + TypeName: "aws_mskconnect_worker_configuration", + }, } } -func (p *servicePackage) SDKResources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{ - "aws_mskconnect_connector": ResourceConnector, - "aws_mskconnect_custom_plugin": ResourceCustomPlugin, - "aws_mskconnect_worker_configuration": ResourceWorkerConfiguration, +func (p *servicePackage) SDKResources(ctx context.Context) []*types.ServicePackageSDKResource { + return []*types.ServicePackageSDKResource{ + { + Factory: ResourceConnector, + TypeName: "aws_mskconnect_connector", + }, + { + Factory: ResourceCustomPlugin, + TypeName: "aws_mskconnect_custom_plugin", + }, + { + Factory: ResourceWorkerConfiguration, + TypeName: "aws_mskconnect_worker_configuration", + }, } } diff --git a/internal/service/kendra/service_package_gen.go b/internal/service/kendra/service_package_gen.go index 3b0ef9f8372e..0f4267a96dde 100644 --- a/internal/service/kendra/service_package_gen.go +++ b/internal/service/kendra/service_package_gen.go @@ -5,40 +5,71 @@ package kendra import ( "context" - "github.com/hashicorp/terraform-plugin-framework/datasource" - "github.com/hashicorp/terraform-plugin-framework/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "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) []func(context.Context) (datasource.DataSourceWithConfigure, error) { - return []func(context.Context) (datasource.DataSourceWithConfigure, error){} +func (p *servicePackage) FrameworkDataSources(ctx context.Context) []*types.ServicePackageFrameworkDataSource { + return []*types.ServicePackageFrameworkDataSource{} } -func (p *servicePackage) FrameworkResources(ctx context.Context) []func(context.Context) (resource.ResourceWithConfigure, error) { - return []func(context.Context) (resource.ResourceWithConfigure, error){} +func (p *servicePackage) FrameworkResources(ctx context.Context) []*types.ServicePackageFrameworkResource { + return []*types.ServicePackageFrameworkResource{} } -func (p *servicePackage) SDKDataSources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{ - "aws_kendra_experience": DataSourceExperience, - "aws_kendra_faq": DataSourceFaq, - "aws_kendra_index": DataSourceIndex, - "aws_kendra_query_suggestions_block_list": DataSourceQuerySuggestionsBlockList, - "aws_kendra_thesaurus": DataSourceThesaurus, +func (p *servicePackage) SDKDataSources(ctx context.Context) []*types.ServicePackageSDKDataSource { + return []*types.ServicePackageSDKDataSource{ + { + Factory: DataSourceExperience, + TypeName: "aws_kendra_experience", + }, + { + Factory: DataSourceFaq, + TypeName: "aws_kendra_faq", + }, + { + Factory: DataSourceIndex, + TypeName: "aws_kendra_index", + }, + { + Factory: DataSourceQuerySuggestionsBlockList, + TypeName: "aws_kendra_query_suggestions_block_list", + }, + { + Factory: DataSourceThesaurus, + TypeName: "aws_kendra_thesaurus", + }, } } -func (p *servicePackage) SDKResources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{ - "aws_kendra_data_source": ResourceDataSource, - "aws_kendra_experience": ResourceExperience, - "aws_kendra_faq": ResourceFaq, - "aws_kendra_index": ResourceIndex, - "aws_kendra_query_suggestions_block_list": ResourceQuerySuggestionsBlockList, - "aws_kendra_thesaurus": ResourceThesaurus, +func (p *servicePackage) SDKResources(ctx context.Context) []*types.ServicePackageSDKResource { + return []*types.ServicePackageSDKResource{ + { + Factory: ResourceDataSource, + TypeName: "aws_kendra_data_source", + }, + { + Factory: ResourceExperience, + TypeName: "aws_kendra_experience", + }, + { + Factory: ResourceFaq, + TypeName: "aws_kendra_faq", + }, + { + Factory: ResourceIndex, + TypeName: "aws_kendra_index", + }, + { + Factory: ResourceQuerySuggestionsBlockList, + TypeName: "aws_kendra_query_suggestions_block_list", + }, + { + Factory: ResourceThesaurus, + TypeName: "aws_kendra_thesaurus", + }, } } diff --git a/internal/service/keyspaces/service_package_gen.go b/internal/service/keyspaces/service_package_gen.go index 0360f91a5207..b8ff9d3d995c 100644 --- a/internal/service/keyspaces/service_package_gen.go +++ b/internal/service/keyspaces/service_package_gen.go @@ -5,30 +5,34 @@ package keyspaces import ( "context" - "github.com/hashicorp/terraform-plugin-framework/datasource" - "github.com/hashicorp/terraform-plugin-framework/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "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) []func(context.Context) (datasource.DataSourceWithConfigure, error) { - return []func(context.Context) (datasource.DataSourceWithConfigure, error){} +func (p *servicePackage) FrameworkDataSources(ctx context.Context) []*types.ServicePackageFrameworkDataSource { + return []*types.ServicePackageFrameworkDataSource{} } -func (p *servicePackage) FrameworkResources(ctx context.Context) []func(context.Context) (resource.ResourceWithConfigure, error) { - return []func(context.Context) (resource.ResourceWithConfigure, error){} +func (p *servicePackage) FrameworkResources(ctx context.Context) []*types.ServicePackageFrameworkResource { + return []*types.ServicePackageFrameworkResource{} } -func (p *servicePackage) SDKDataSources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{} +func (p *servicePackage) SDKDataSources(ctx context.Context) []*types.ServicePackageSDKDataSource { + return []*types.ServicePackageSDKDataSource{} } -func (p *servicePackage) SDKResources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{ - "aws_keyspaces_keyspace": ResourceKeyspace, - "aws_keyspaces_table": ResourceTable, +func (p *servicePackage) SDKResources(ctx context.Context) []*types.ServicePackageSDKResource { + return []*types.ServicePackageSDKResource{ + { + Factory: ResourceKeyspace, + TypeName: "aws_keyspaces_keyspace", + }, + { + Factory: ResourceTable, + TypeName: "aws_keyspaces_table", + }, } } diff --git a/internal/service/kinesis/service_package_gen.go b/internal/service/kinesis/service_package_gen.go index 3c85807215af..8e0458aa88b7 100644 --- a/internal/service/kinesis/service_package_gen.go +++ b/internal/service/kinesis/service_package_gen.go @@ -5,33 +5,43 @@ package kinesis import ( "context" - "github.com/hashicorp/terraform-plugin-framework/datasource" - "github.com/hashicorp/terraform-plugin-framework/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "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) []func(context.Context) (datasource.DataSourceWithConfigure, error) { - return []func(context.Context) (datasource.DataSourceWithConfigure, error){} +func (p *servicePackage) FrameworkDataSources(ctx context.Context) []*types.ServicePackageFrameworkDataSource { + return []*types.ServicePackageFrameworkDataSource{} } -func (p *servicePackage) FrameworkResources(ctx context.Context) []func(context.Context) (resource.ResourceWithConfigure, error) { - return []func(context.Context) (resource.ResourceWithConfigure, error){} +func (p *servicePackage) FrameworkResources(ctx context.Context) []*types.ServicePackageFrameworkResource { + return []*types.ServicePackageFrameworkResource{} } -func (p *servicePackage) SDKDataSources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{ - "aws_kinesis_stream": DataSourceStream, - "aws_kinesis_stream_consumer": DataSourceStreamConsumer, +func (p *servicePackage) SDKDataSources(ctx context.Context) []*types.ServicePackageSDKDataSource { + return []*types.ServicePackageSDKDataSource{ + { + Factory: DataSourceStream, + TypeName: "aws_kinesis_stream", + }, + { + Factory: DataSourceStreamConsumer, + TypeName: "aws_kinesis_stream_consumer", + }, } } -func (p *servicePackage) SDKResources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{ - "aws_kinesis_stream": ResourceStream, - "aws_kinesis_stream_consumer": ResourceStreamConsumer, +func (p *servicePackage) SDKResources(ctx context.Context) []*types.ServicePackageSDKResource { + return []*types.ServicePackageSDKResource{ + { + Factory: ResourceStream, + TypeName: "aws_kinesis_stream", + }, + { + Factory: ResourceStreamConsumer, + TypeName: "aws_kinesis_stream_consumer", + }, } } diff --git a/internal/service/kinesisanalytics/service_package_gen.go b/internal/service/kinesisanalytics/service_package_gen.go index 8d7d5a3f72ce..9d498271dac1 100644 --- a/internal/service/kinesisanalytics/service_package_gen.go +++ b/internal/service/kinesisanalytics/service_package_gen.go @@ -5,29 +5,30 @@ package kinesisanalytics import ( "context" - "github.com/hashicorp/terraform-plugin-framework/datasource" - "github.com/hashicorp/terraform-plugin-framework/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "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) []func(context.Context) (datasource.DataSourceWithConfigure, error) { - return []func(context.Context) (datasource.DataSourceWithConfigure, error){} +func (p *servicePackage) FrameworkDataSources(ctx context.Context) []*types.ServicePackageFrameworkDataSource { + return []*types.ServicePackageFrameworkDataSource{} } -func (p *servicePackage) FrameworkResources(ctx context.Context) []func(context.Context) (resource.ResourceWithConfigure, error) { - return []func(context.Context) (resource.ResourceWithConfigure, error){} +func (p *servicePackage) FrameworkResources(ctx context.Context) []*types.ServicePackageFrameworkResource { + return []*types.ServicePackageFrameworkResource{} } -func (p *servicePackage) SDKDataSources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{} +func (p *servicePackage) SDKDataSources(ctx context.Context) []*types.ServicePackageSDKDataSource { + return []*types.ServicePackageSDKDataSource{} } -func (p *servicePackage) SDKResources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{ - "aws_kinesis_analytics_application": ResourceApplication, +func (p *servicePackage) SDKResources(ctx context.Context) []*types.ServicePackageSDKResource { + return []*types.ServicePackageSDKResource{ + { + Factory: ResourceApplication, + TypeName: "aws_kinesis_analytics_application", + }, } } diff --git a/internal/service/kinesisanalyticsv2/service_package_gen.go b/internal/service/kinesisanalyticsv2/service_package_gen.go index 110c19c525c1..73b4ae5ea2cf 100644 --- a/internal/service/kinesisanalyticsv2/service_package_gen.go +++ b/internal/service/kinesisanalyticsv2/service_package_gen.go @@ -5,30 +5,34 @@ package kinesisanalyticsv2 import ( "context" - "github.com/hashicorp/terraform-plugin-framework/datasource" - "github.com/hashicorp/terraform-plugin-framework/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "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) []func(context.Context) (datasource.DataSourceWithConfigure, error) { - return []func(context.Context) (datasource.DataSourceWithConfigure, error){} +func (p *servicePackage) FrameworkDataSources(ctx context.Context) []*types.ServicePackageFrameworkDataSource { + return []*types.ServicePackageFrameworkDataSource{} } -func (p *servicePackage) FrameworkResources(ctx context.Context) []func(context.Context) (resource.ResourceWithConfigure, error) { - return []func(context.Context) (resource.ResourceWithConfigure, error){} +func (p *servicePackage) FrameworkResources(ctx context.Context) []*types.ServicePackageFrameworkResource { + return []*types.ServicePackageFrameworkResource{} } -func (p *servicePackage) SDKDataSources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{} +func (p *servicePackage) SDKDataSources(ctx context.Context) []*types.ServicePackageSDKDataSource { + return []*types.ServicePackageSDKDataSource{} } -func (p *servicePackage) SDKResources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{ - "aws_kinesisanalyticsv2_application": ResourceApplication, - "aws_kinesisanalyticsv2_application_snapshot": ResourceApplicationSnapshot, +func (p *servicePackage) SDKResources(ctx context.Context) []*types.ServicePackageSDKResource { + return []*types.ServicePackageSDKResource{ + { + Factory: ResourceApplication, + TypeName: "aws_kinesisanalyticsv2_application", + }, + { + Factory: ResourceApplicationSnapshot, + TypeName: "aws_kinesisanalyticsv2_application_snapshot", + }, } } diff --git a/internal/service/kinesisvideo/service_package_gen.go b/internal/service/kinesisvideo/service_package_gen.go index f6037bef0bb5..e96756b972af 100644 --- a/internal/service/kinesisvideo/service_package_gen.go +++ b/internal/service/kinesisvideo/service_package_gen.go @@ -5,29 +5,30 @@ package kinesisvideo import ( "context" - "github.com/hashicorp/terraform-plugin-framework/datasource" - "github.com/hashicorp/terraform-plugin-framework/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "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) []func(context.Context) (datasource.DataSourceWithConfigure, error) { - return []func(context.Context) (datasource.DataSourceWithConfigure, error){} +func (p *servicePackage) FrameworkDataSources(ctx context.Context) []*types.ServicePackageFrameworkDataSource { + return []*types.ServicePackageFrameworkDataSource{} } -func (p *servicePackage) FrameworkResources(ctx context.Context) []func(context.Context) (resource.ResourceWithConfigure, error) { - return []func(context.Context) (resource.ResourceWithConfigure, error){} +func (p *servicePackage) FrameworkResources(ctx context.Context) []*types.ServicePackageFrameworkResource { + return []*types.ServicePackageFrameworkResource{} } -func (p *servicePackage) SDKDataSources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{} +func (p *servicePackage) SDKDataSources(ctx context.Context) []*types.ServicePackageSDKDataSource { + return []*types.ServicePackageSDKDataSource{} } -func (p *servicePackage) SDKResources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{ - "aws_kinesis_video_stream": ResourceStream, +func (p *servicePackage) SDKResources(ctx context.Context) []*types.ServicePackageSDKResource { + return []*types.ServicePackageSDKResource{ + { + Factory: ResourceStream, + TypeName: "aws_kinesis_video_stream", + }, } } diff --git a/internal/service/kms/service_package_gen.go b/internal/service/kms/service_package_gen.go index d830feb821c7..c26457c2436f 100644 --- a/internal/service/kms/service_package_gen.go +++ b/internal/service/kms/service_package_gen.go @@ -5,44 +5,87 @@ package kms import ( "context" - "github.com/hashicorp/terraform-plugin-framework/datasource" - "github.com/hashicorp/terraform-plugin-framework/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "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) []func(context.Context) (datasource.DataSourceWithConfigure, error) { - return []func(context.Context) (datasource.DataSourceWithConfigure, error){} +func (p *servicePackage) FrameworkDataSources(ctx context.Context) []*types.ServicePackageFrameworkDataSource { + return []*types.ServicePackageFrameworkDataSource{} } -func (p *servicePackage) FrameworkResources(ctx context.Context) []func(context.Context) (resource.ResourceWithConfigure, error) { - return []func(context.Context) (resource.ResourceWithConfigure, error){} +func (p *servicePackage) FrameworkResources(ctx context.Context) []*types.ServicePackageFrameworkResource { + return []*types.ServicePackageFrameworkResource{} } -func (p *servicePackage) SDKDataSources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{ - "aws_kms_alias": DataSourceAlias, - "aws_kms_ciphertext": DataSourceCiphertext, - "aws_kms_custom_key_store": DataSourceCustomKeyStore, - "aws_kms_key": DataSourceKey, - "aws_kms_public_key": DataSourcePublicKey, - "aws_kms_secret": DataSourceSecret, - "aws_kms_secrets": DataSourceSecrets, +func (p *servicePackage) SDKDataSources(ctx context.Context) []*types.ServicePackageSDKDataSource { + return []*types.ServicePackageSDKDataSource{ + { + Factory: DataSourceAlias, + TypeName: "aws_kms_alias", + }, + { + Factory: DataSourceCiphertext, + TypeName: "aws_kms_ciphertext", + }, + { + Factory: DataSourceCustomKeyStore, + TypeName: "aws_kms_custom_key_store", + }, + { + Factory: DataSourceKey, + TypeName: "aws_kms_key", + }, + { + Factory: DataSourcePublicKey, + TypeName: "aws_kms_public_key", + }, + { + Factory: DataSourceSecret, + TypeName: "aws_kms_secret", + }, + { + Factory: DataSourceSecrets, + TypeName: "aws_kms_secrets", + }, } } -func (p *servicePackage) SDKResources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{ - "aws_kms_alias": ResourceAlias, - "aws_kms_ciphertext": ResourceCiphertext, - "aws_kms_custom_key_store": ResourceCustomKeyStore, - "aws_kms_external_key": ResourceExternalKey, - "aws_kms_grant": ResourceGrant, - "aws_kms_key": ResourceKey, - "aws_kms_replica_external_key": ResourceReplicaExternalKey, - "aws_kms_replica_key": ResourceReplicaKey, +func (p *servicePackage) SDKResources(ctx context.Context) []*types.ServicePackageSDKResource { + return []*types.ServicePackageSDKResource{ + { + Factory: ResourceAlias, + TypeName: "aws_kms_alias", + }, + { + Factory: ResourceCiphertext, + TypeName: "aws_kms_ciphertext", + }, + { + Factory: ResourceCustomKeyStore, + TypeName: "aws_kms_custom_key_store", + }, + { + Factory: ResourceExternalKey, + TypeName: "aws_kms_external_key", + }, + { + Factory: ResourceGrant, + TypeName: "aws_kms_grant", + }, + { + Factory: ResourceKey, + TypeName: "aws_kms_key", + }, + { + Factory: ResourceReplicaExternalKey, + TypeName: "aws_kms_replica_external_key", + }, + { + Factory: ResourceReplicaKey, + TypeName: "aws_kms_replica_key", + }, } } diff --git a/internal/service/lakeformation/service_package_gen.go b/internal/service/lakeformation/service_package_gen.go index 72c769e15de3..f1a44c62e1f9 100644 --- a/internal/service/lakeformation/service_package_gen.go +++ b/internal/service/lakeformation/service_package_gen.go @@ -5,37 +5,59 @@ package lakeformation import ( "context" - "github.com/hashicorp/terraform-plugin-framework/datasource" - "github.com/hashicorp/terraform-plugin-framework/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "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) []func(context.Context) (datasource.DataSourceWithConfigure, error) { - return []func(context.Context) (datasource.DataSourceWithConfigure, error){} +func (p *servicePackage) FrameworkDataSources(ctx context.Context) []*types.ServicePackageFrameworkDataSource { + return []*types.ServicePackageFrameworkDataSource{} } -func (p *servicePackage) FrameworkResources(ctx context.Context) []func(context.Context) (resource.ResourceWithConfigure, error) { - return []func(context.Context) (resource.ResourceWithConfigure, error){} +func (p *servicePackage) FrameworkResources(ctx context.Context) []*types.ServicePackageFrameworkResource { + return []*types.ServicePackageFrameworkResource{} } -func (p *servicePackage) SDKDataSources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{ - "aws_lakeformation_data_lake_settings": DataSourceDataLakeSettings, - "aws_lakeformation_permissions": DataSourcePermissions, - "aws_lakeformation_resource": DataSourceResource, +func (p *servicePackage) SDKDataSources(ctx context.Context) []*types.ServicePackageSDKDataSource { + return []*types.ServicePackageSDKDataSource{ + { + Factory: DataSourceDataLakeSettings, + TypeName: "aws_lakeformation_data_lake_settings", + }, + { + Factory: DataSourcePermissions, + TypeName: "aws_lakeformation_permissions", + }, + { + Factory: DataSourceResource, + TypeName: "aws_lakeformation_resource", + }, } } -func (p *servicePackage) SDKResources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{ - "aws_lakeformation_data_lake_settings": ResourceDataLakeSettings, - "aws_lakeformation_lf_tag": ResourceLFTag, - "aws_lakeformation_permissions": ResourcePermissions, - "aws_lakeformation_resource": ResourceResource, - "aws_lakeformation_resource_lf_tags": ResourceResourceLFTags, +func (p *servicePackage) SDKResources(ctx context.Context) []*types.ServicePackageSDKResource { + return []*types.ServicePackageSDKResource{ + { + Factory: ResourceDataLakeSettings, + TypeName: "aws_lakeformation_data_lake_settings", + }, + { + Factory: ResourceLFTag, + TypeName: "aws_lakeformation_lf_tag", + }, + { + Factory: ResourcePermissions, + TypeName: "aws_lakeformation_permissions", + }, + { + Factory: ResourceResource, + TypeName: "aws_lakeformation_resource", + }, + { + Factory: ResourceResourceLFTags, + TypeName: "aws_lakeformation_resource_lf_tags", + }, } } diff --git a/internal/service/lambda/service_package_gen.go b/internal/service/lambda/service_package_gen.go index 24343e78d57a..05d28a43212a 100644 --- a/internal/service/lambda/service_package_gen.go +++ b/internal/service/lambda/service_package_gen.go @@ -5,47 +5,99 @@ package lambda import ( "context" - "github.com/hashicorp/terraform-plugin-framework/datasource" - "github.com/hashicorp/terraform-plugin-framework/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "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) []func(context.Context) (datasource.DataSourceWithConfigure, error) { - return []func(context.Context) (datasource.DataSourceWithConfigure, error){} +func (p *servicePackage) FrameworkDataSources(ctx context.Context) []*types.ServicePackageFrameworkDataSource { + return []*types.ServicePackageFrameworkDataSource{} } -func (p *servicePackage) FrameworkResources(ctx context.Context) []func(context.Context) (resource.ResourceWithConfigure, error) { - return []func(context.Context) (resource.ResourceWithConfigure, error){} +func (p *servicePackage) FrameworkResources(ctx context.Context) []*types.ServicePackageFrameworkResource { + return []*types.ServicePackageFrameworkResource{} } -func (p *servicePackage) SDKDataSources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{ - "aws_lambda_alias": DataSourceAlias, - "aws_lambda_code_signing_config": DataSourceCodeSigningConfig, - "aws_lambda_function": DataSourceFunction, - "aws_lambda_function_url": DataSourceFunctionURL, - "aws_lambda_functions": DataSourceFunctions, - "aws_lambda_invocation": DataSourceInvocation, - "aws_lambda_layer_version": DataSourceLayerVersion, +func (p *servicePackage) SDKDataSources(ctx context.Context) []*types.ServicePackageSDKDataSource { + return []*types.ServicePackageSDKDataSource{ + { + Factory: DataSourceAlias, + TypeName: "aws_lambda_alias", + }, + { + Factory: DataSourceCodeSigningConfig, + TypeName: "aws_lambda_code_signing_config", + }, + { + Factory: DataSourceFunction, + TypeName: "aws_lambda_function", + }, + { + Factory: DataSourceFunctionURL, + TypeName: "aws_lambda_function_url", + }, + { + Factory: DataSourceFunctions, + TypeName: "aws_lambda_functions", + }, + { + Factory: DataSourceInvocation, + TypeName: "aws_lambda_invocation", + }, + { + Factory: DataSourceLayerVersion, + TypeName: "aws_lambda_layer_version", + }, } } -func (p *servicePackage) SDKResources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{ - "aws_lambda_alias": ResourceAlias, - "aws_lambda_code_signing_config": ResourceCodeSigningConfig, - "aws_lambda_event_source_mapping": ResourceEventSourceMapping, - "aws_lambda_function": ResourceFunction, - "aws_lambda_function_event_invoke_config": ResourceFunctionEventInvokeConfig, - "aws_lambda_function_url": ResourceFunctionURL, - "aws_lambda_invocation": ResourceInvocation, - "aws_lambda_layer_version": ResourceLayerVersion, - "aws_lambda_layer_version_permission": ResourceLayerVersionPermission, - "aws_lambda_permission": ResourcePermission, - "aws_lambda_provisioned_concurrency_config": ResourceProvisionedConcurrencyConfig, +func (p *servicePackage) SDKResources(ctx context.Context) []*types.ServicePackageSDKResource { + return []*types.ServicePackageSDKResource{ + { + Factory: ResourceAlias, + TypeName: "aws_lambda_alias", + }, + { + Factory: ResourceCodeSigningConfig, + TypeName: "aws_lambda_code_signing_config", + }, + { + Factory: ResourceEventSourceMapping, + TypeName: "aws_lambda_event_source_mapping", + }, + { + Factory: ResourceFunction, + TypeName: "aws_lambda_function", + }, + { + Factory: ResourceFunctionEventInvokeConfig, + TypeName: "aws_lambda_function_event_invoke_config", + }, + { + Factory: ResourceFunctionURL, + TypeName: "aws_lambda_function_url", + }, + { + Factory: ResourceInvocation, + TypeName: "aws_lambda_invocation", + }, + { + Factory: ResourceLayerVersion, + TypeName: "aws_lambda_layer_version", + }, + { + Factory: ResourceLayerVersionPermission, + TypeName: "aws_lambda_layer_version_permission", + }, + { + Factory: ResourcePermission, + TypeName: "aws_lambda_permission", + }, + { + Factory: ResourceProvisionedConcurrencyConfig, + TypeName: "aws_lambda_provisioned_concurrency_config", + }, } } diff --git a/internal/service/lexmodels/service_package_gen.go b/internal/service/lexmodels/service_package_gen.go index a6f357c2ec62..eeedb421009c 100644 --- a/internal/service/lexmodels/service_package_gen.go +++ b/internal/service/lexmodels/service_package_gen.go @@ -5,37 +5,59 @@ package lexmodels import ( "context" - "github.com/hashicorp/terraform-plugin-framework/datasource" - "github.com/hashicorp/terraform-plugin-framework/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "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) []func(context.Context) (datasource.DataSourceWithConfigure, error) { - return []func(context.Context) (datasource.DataSourceWithConfigure, error){} +func (p *servicePackage) FrameworkDataSources(ctx context.Context) []*types.ServicePackageFrameworkDataSource { + return []*types.ServicePackageFrameworkDataSource{} } -func (p *servicePackage) FrameworkResources(ctx context.Context) []func(context.Context) (resource.ResourceWithConfigure, error) { - return []func(context.Context) (resource.ResourceWithConfigure, error){} +func (p *servicePackage) FrameworkResources(ctx context.Context) []*types.ServicePackageFrameworkResource { + return []*types.ServicePackageFrameworkResource{} } -func (p *servicePackage) SDKDataSources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{ - "aws_lex_bot": DataSourceBot, - "aws_lex_bot_alias": DataSourceBotAlias, - "aws_lex_intent": DataSourceIntent, - "aws_lex_slot_type": DataSourceSlotType, +func (p *servicePackage) SDKDataSources(ctx context.Context) []*types.ServicePackageSDKDataSource { + return []*types.ServicePackageSDKDataSource{ + { + Factory: DataSourceBot, + TypeName: "aws_lex_bot", + }, + { + Factory: DataSourceBotAlias, + TypeName: "aws_lex_bot_alias", + }, + { + Factory: DataSourceIntent, + TypeName: "aws_lex_intent", + }, + { + Factory: DataSourceSlotType, + TypeName: "aws_lex_slot_type", + }, } } -func (p *servicePackage) SDKResources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{ - "aws_lex_bot": ResourceBot, - "aws_lex_bot_alias": ResourceBotAlias, - "aws_lex_intent": ResourceIntent, - "aws_lex_slot_type": ResourceSlotType, +func (p *servicePackage) SDKResources(ctx context.Context) []*types.ServicePackageSDKResource { + return []*types.ServicePackageSDKResource{ + { + Factory: ResourceBot, + TypeName: "aws_lex_bot", + }, + { + Factory: ResourceBotAlias, + TypeName: "aws_lex_bot_alias", + }, + { + Factory: ResourceIntent, + TypeName: "aws_lex_intent", + }, + { + Factory: ResourceSlotType, + TypeName: "aws_lex_slot_type", + }, } } diff --git a/internal/service/licensemanager/service_package_gen.go b/internal/service/licensemanager/service_package_gen.go index 5dac227cfbc0..95a597c48bf1 100644 --- a/internal/service/licensemanager/service_package_gen.go +++ b/internal/service/licensemanager/service_package_gen.go @@ -5,30 +5,34 @@ package licensemanager import ( "context" - "github.com/hashicorp/terraform-plugin-framework/datasource" - "github.com/hashicorp/terraform-plugin-framework/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "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) []func(context.Context) (datasource.DataSourceWithConfigure, error) { - return []func(context.Context) (datasource.DataSourceWithConfigure, error){} +func (p *servicePackage) FrameworkDataSources(ctx context.Context) []*types.ServicePackageFrameworkDataSource { + return []*types.ServicePackageFrameworkDataSource{} } -func (p *servicePackage) FrameworkResources(ctx context.Context) []func(context.Context) (resource.ResourceWithConfigure, error) { - return []func(context.Context) (resource.ResourceWithConfigure, error){} +func (p *servicePackage) FrameworkResources(ctx context.Context) []*types.ServicePackageFrameworkResource { + return []*types.ServicePackageFrameworkResource{} } -func (p *servicePackage) SDKDataSources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{} +func (p *servicePackage) SDKDataSources(ctx context.Context) []*types.ServicePackageSDKDataSource { + return []*types.ServicePackageSDKDataSource{} } -func (p *servicePackage) SDKResources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{ - "aws_licensemanager_association": ResourceAssociation, - "aws_licensemanager_license_configuration": ResourceLicenseConfiguration, +func (p *servicePackage) SDKResources(ctx context.Context) []*types.ServicePackageSDKResource { + return []*types.ServicePackageSDKResource{ + { + Factory: ResourceAssociation, + TypeName: "aws_licensemanager_association", + }, + { + Factory: ResourceLicenseConfiguration, + TypeName: "aws_licensemanager_license_configuration", + }, } } diff --git a/internal/service/lightsail/service_package_gen.go b/internal/service/lightsail/service_package_gen.go index 7ec010e9b7df..cd7f2917d275 100644 --- a/internal/service/lightsail/service_package_gen.go +++ b/internal/service/lightsail/service_package_gen.go @@ -5,50 +5,114 @@ package lightsail import ( "context" - "github.com/hashicorp/terraform-plugin-framework/datasource" - "github.com/hashicorp/terraform-plugin-framework/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "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) []func(context.Context) (datasource.DataSourceWithConfigure, error) { - return []func(context.Context) (datasource.DataSourceWithConfigure, error){} +func (p *servicePackage) FrameworkDataSources(ctx context.Context) []*types.ServicePackageFrameworkDataSource { + return []*types.ServicePackageFrameworkDataSource{} } -func (p *servicePackage) FrameworkResources(ctx context.Context) []func(context.Context) (resource.ResourceWithConfigure, error) { - return []func(context.Context) (resource.ResourceWithConfigure, error){} +func (p *servicePackage) FrameworkResources(ctx context.Context) []*types.ServicePackageFrameworkResource { + return []*types.ServicePackageFrameworkResource{} } -func (p *servicePackage) SDKDataSources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{} +func (p *servicePackage) SDKDataSources(ctx context.Context) []*types.ServicePackageSDKDataSource { + return []*types.ServicePackageSDKDataSource{} } -func (p *servicePackage) SDKResources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{ - "aws_lightsail_bucket": ResourceBucket, - "aws_lightsail_bucket_access_key": ResourceBucketAccessKey, - "aws_lightsail_bucket_resource_access": ResourceBucketResourceAccess, - "aws_lightsail_certificate": ResourceCertificate, - "aws_lightsail_container_service": ResourceContainerService, - "aws_lightsail_container_service_deployment_version": ResourceContainerServiceDeploymentVersion, - "aws_lightsail_database": ResourceDatabase, - "aws_lightsail_disk": ResourceDisk, - "aws_lightsail_disk_attachment": ResourceDiskAttachment, - "aws_lightsail_domain": ResourceDomain, - "aws_lightsail_domain_entry": ResourceDomainEntry, - "aws_lightsail_instance": ResourceInstance, - "aws_lightsail_instance_public_ports": ResourceInstancePublicPorts, - "aws_lightsail_key_pair": ResourceKeyPair, - "aws_lightsail_lb": ResourceLoadBalancer, - "aws_lightsail_lb_attachment": ResourceLoadBalancerAttachment, - "aws_lightsail_lb_certificate": ResourceLoadBalancerCertificate, - "aws_lightsail_lb_certificate_attachment": ResourceLoadBalancerCertificateAttachment, - "aws_lightsail_lb_https_redirection_policy": ResourceLoadBalancerHTTPSRedirectionPolicy, - "aws_lightsail_lb_stickiness_policy": ResourceLoadBalancerStickinessPolicy, - "aws_lightsail_static_ip": ResourceStaticIP, - "aws_lightsail_static_ip_attachment": ResourceStaticIPAttachment, +func (p *servicePackage) SDKResources(ctx context.Context) []*types.ServicePackageSDKResource { + return []*types.ServicePackageSDKResource{ + { + Factory: ResourceBucket, + TypeName: "aws_lightsail_bucket", + }, + { + Factory: ResourceBucketAccessKey, + TypeName: "aws_lightsail_bucket_access_key", + }, + { + Factory: ResourceBucketResourceAccess, + TypeName: "aws_lightsail_bucket_resource_access", + }, + { + Factory: ResourceCertificate, + TypeName: "aws_lightsail_certificate", + }, + { + Factory: ResourceContainerService, + TypeName: "aws_lightsail_container_service", + }, + { + Factory: ResourceContainerServiceDeploymentVersion, + TypeName: "aws_lightsail_container_service_deployment_version", + }, + { + Factory: ResourceDatabase, + TypeName: "aws_lightsail_database", + }, + { + Factory: ResourceDisk, + TypeName: "aws_lightsail_disk", + }, + { + Factory: ResourceDiskAttachment, + TypeName: "aws_lightsail_disk_attachment", + }, + { + Factory: ResourceDomain, + TypeName: "aws_lightsail_domain", + }, + { + Factory: ResourceDomainEntry, + TypeName: "aws_lightsail_domain_entry", + }, + { + Factory: ResourceInstance, + TypeName: "aws_lightsail_instance", + }, + { + Factory: ResourceInstancePublicPorts, + TypeName: "aws_lightsail_instance_public_ports", + }, + { + Factory: ResourceKeyPair, + TypeName: "aws_lightsail_key_pair", + }, + { + Factory: ResourceLoadBalancer, + TypeName: "aws_lightsail_lb", + }, + { + Factory: ResourceLoadBalancerAttachment, + TypeName: "aws_lightsail_lb_attachment", + }, + { + Factory: ResourceLoadBalancerCertificate, + TypeName: "aws_lightsail_lb_certificate", + }, + { + Factory: ResourceLoadBalancerCertificateAttachment, + TypeName: "aws_lightsail_lb_certificate_attachment", + }, + { + Factory: ResourceLoadBalancerHTTPSRedirectionPolicy, + TypeName: "aws_lightsail_lb_https_redirection_policy", + }, + { + Factory: ResourceLoadBalancerStickinessPolicy, + TypeName: "aws_lightsail_lb_stickiness_policy", + }, + { + Factory: ResourceStaticIP, + TypeName: "aws_lightsail_static_ip", + }, + { + Factory: ResourceStaticIPAttachment, + TypeName: "aws_lightsail_static_ip_attachment", + }, } } diff --git a/internal/service/location/service_package_gen.go b/internal/service/location/service_package_gen.go index 1993cae8fece..8588e39290e0 100644 --- a/internal/service/location/service_package_gen.go +++ b/internal/service/location/service_package_gen.go @@ -5,42 +5,79 @@ package location import ( "context" - "github.com/hashicorp/terraform-plugin-framework/datasource" - "github.com/hashicorp/terraform-plugin-framework/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "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) []func(context.Context) (datasource.DataSourceWithConfigure, error) { - return []func(context.Context) (datasource.DataSourceWithConfigure, error){} +func (p *servicePackage) FrameworkDataSources(ctx context.Context) []*types.ServicePackageFrameworkDataSource { + return []*types.ServicePackageFrameworkDataSource{} } -func (p *servicePackage) FrameworkResources(ctx context.Context) []func(context.Context) (resource.ResourceWithConfigure, error) { - return []func(context.Context) (resource.ResourceWithConfigure, error){} +func (p *servicePackage) FrameworkResources(ctx context.Context) []*types.ServicePackageFrameworkResource { + return []*types.ServicePackageFrameworkResource{} } -func (p *servicePackage) SDKDataSources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{ - "aws_location_geofence_collection": DataSourceGeofenceCollection, - "aws_location_map": DataSourceMap, - "aws_location_place_index": DataSourcePlaceIndex, - "aws_location_route_calculator": DataSourceRouteCalculator, - "aws_location_tracker": DataSourceTracker, - "aws_location_tracker_association": DataSourceTrackerAssociation, - "aws_location_tracker_associations": DataSourceTrackerAssociations, +func (p *servicePackage) SDKDataSources(ctx context.Context) []*types.ServicePackageSDKDataSource { + return []*types.ServicePackageSDKDataSource{ + { + Factory: DataSourceGeofenceCollection, + TypeName: "aws_location_geofence_collection", + }, + { + Factory: DataSourceMap, + TypeName: "aws_location_map", + }, + { + Factory: DataSourcePlaceIndex, + TypeName: "aws_location_place_index", + }, + { + Factory: DataSourceRouteCalculator, + TypeName: "aws_location_route_calculator", + }, + { + Factory: DataSourceTracker, + TypeName: "aws_location_tracker", + }, + { + Factory: DataSourceTrackerAssociation, + TypeName: "aws_location_tracker_association", + }, + { + Factory: DataSourceTrackerAssociations, + TypeName: "aws_location_tracker_associations", + }, } } -func (p *servicePackage) SDKResources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{ - "aws_location_geofence_collection": ResourceGeofenceCollection, - "aws_location_map": ResourceMap, - "aws_location_place_index": ResourcePlaceIndex, - "aws_location_route_calculator": ResourceRouteCalculator, - "aws_location_tracker": ResourceTracker, - "aws_location_tracker_association": ResourceTrackerAssociation, +func (p *servicePackage) SDKResources(ctx context.Context) []*types.ServicePackageSDKResource { + return []*types.ServicePackageSDKResource{ + { + Factory: ResourceGeofenceCollection, + TypeName: "aws_location_geofence_collection", + }, + { + Factory: ResourceMap, + TypeName: "aws_location_map", + }, + { + Factory: ResourcePlaceIndex, + TypeName: "aws_location_place_index", + }, + { + Factory: ResourceRouteCalculator, + TypeName: "aws_location_route_calculator", + }, + { + Factory: ResourceTracker, + TypeName: "aws_location_tracker", + }, + { + Factory: ResourceTrackerAssociation, + TypeName: "aws_location_tracker_association", + }, } } diff --git a/internal/service/logs/service_package_gen.go b/internal/service/logs/service_package_gen.go index 435513d206b2..c1db1539b119 100644 --- a/internal/service/logs/service_package_gen.go +++ b/internal/service/logs/service_package_gen.go @@ -5,41 +5,75 @@ package logs import ( "context" - "github.com/hashicorp/terraform-plugin-framework/datasource" - "github.com/hashicorp/terraform-plugin-framework/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "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) []func(context.Context) (datasource.DataSourceWithConfigure, error) { - return []func(context.Context) (datasource.DataSourceWithConfigure, error){} +func (p *servicePackage) FrameworkDataSources(ctx context.Context) []*types.ServicePackageFrameworkDataSource { + return []*types.ServicePackageFrameworkDataSource{} } -func (p *servicePackage) FrameworkResources(ctx context.Context) []func(context.Context) (resource.ResourceWithConfigure, error) { - return []func(context.Context) (resource.ResourceWithConfigure, error){} +func (p *servicePackage) FrameworkResources(ctx context.Context) []*types.ServicePackageFrameworkResource { + return []*types.ServicePackageFrameworkResource{} } -func (p *servicePackage) SDKDataSources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{ - "aws_cloudwatch_log_data_protection_policy_document": dataSourceDataProtectionPolicyDocument, - "aws_cloudwatch_log_group": dataSourceGroup, - "aws_cloudwatch_log_groups": dataSourceGroups, +func (p *servicePackage) SDKDataSources(ctx context.Context) []*types.ServicePackageSDKDataSource { + return []*types.ServicePackageSDKDataSource{ + { + Factory: dataSourceDataProtectionPolicyDocument, + TypeName: "aws_cloudwatch_log_data_protection_policy_document", + }, + { + Factory: dataSourceGroup, + TypeName: "aws_cloudwatch_log_group", + }, + { + Factory: dataSourceGroups, + TypeName: "aws_cloudwatch_log_groups", + }, } } -func (p *servicePackage) SDKResources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{ - "aws_cloudwatch_log_data_protection_policy": resourceDataProtectionPolicy, - "aws_cloudwatch_log_destination": resourceDestination, - "aws_cloudwatch_log_destination_policy": resourceDestinationPolicy, - "aws_cloudwatch_log_group": resourceGroup, - "aws_cloudwatch_log_metric_filter": resourceMetricFilter, - "aws_cloudwatch_log_resource_policy": resourceResourcePolicy, - "aws_cloudwatch_log_stream": resourceStream, - "aws_cloudwatch_log_subscription_filter": resourceSubscriptionFilter, - "aws_cloudwatch_query_definition": resourceQueryDefinition, +func (p *servicePackage) SDKResources(ctx context.Context) []*types.ServicePackageSDKResource { + return []*types.ServicePackageSDKResource{ + { + Factory: resourceDataProtectionPolicy, + TypeName: "aws_cloudwatch_log_data_protection_policy", + }, + { + Factory: resourceDestination, + TypeName: "aws_cloudwatch_log_destination", + }, + { + Factory: resourceDestinationPolicy, + TypeName: "aws_cloudwatch_log_destination_policy", + }, + { + Factory: resourceGroup, + TypeName: "aws_cloudwatch_log_group", + }, + { + Factory: resourceMetricFilter, + TypeName: "aws_cloudwatch_log_metric_filter", + }, + { + Factory: resourceResourcePolicy, + TypeName: "aws_cloudwatch_log_resource_policy", + }, + { + Factory: resourceStream, + TypeName: "aws_cloudwatch_log_stream", + }, + { + Factory: resourceSubscriptionFilter, + TypeName: "aws_cloudwatch_log_subscription_filter", + }, + { + Factory: resourceQueryDefinition, + TypeName: "aws_cloudwatch_query_definition", + }, } } diff --git a/internal/service/macie/service_package_gen.go b/internal/service/macie/service_package_gen.go index 2d398d81c28d..59aaae90a75e 100644 --- a/internal/service/macie/service_package_gen.go +++ b/internal/service/macie/service_package_gen.go @@ -5,30 +5,34 @@ package macie import ( "context" - "github.com/hashicorp/terraform-plugin-framework/datasource" - "github.com/hashicorp/terraform-plugin-framework/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "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) []func(context.Context) (datasource.DataSourceWithConfigure, error) { - return []func(context.Context) (datasource.DataSourceWithConfigure, error){} +func (p *servicePackage) FrameworkDataSources(ctx context.Context) []*types.ServicePackageFrameworkDataSource { + return []*types.ServicePackageFrameworkDataSource{} } -func (p *servicePackage) FrameworkResources(ctx context.Context) []func(context.Context) (resource.ResourceWithConfigure, error) { - return []func(context.Context) (resource.ResourceWithConfigure, error){} +func (p *servicePackage) FrameworkResources(ctx context.Context) []*types.ServicePackageFrameworkResource { + return []*types.ServicePackageFrameworkResource{} } -func (p *servicePackage) SDKDataSources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{} +func (p *servicePackage) SDKDataSources(ctx context.Context) []*types.ServicePackageSDKDataSource { + return []*types.ServicePackageSDKDataSource{} } -func (p *servicePackage) SDKResources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{ - "aws_macie_member_account_association": ResourceMemberAccountAssociation, - "aws_macie_s3_bucket_association": ResourceS3BucketAssociation, +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/internal/service/macie2/service_package_gen.go b/internal/service/macie2/service_package_gen.go index c9bd6e925885..dddead114999 100644 --- a/internal/service/macie2/service_package_gen.go +++ b/internal/service/macie2/service_package_gen.go @@ -5,36 +5,58 @@ package macie2 import ( "context" - "github.com/hashicorp/terraform-plugin-framework/datasource" - "github.com/hashicorp/terraform-plugin-framework/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "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) []func(context.Context) (datasource.DataSourceWithConfigure, error) { - return []func(context.Context) (datasource.DataSourceWithConfigure, error){} +func (p *servicePackage) FrameworkDataSources(ctx context.Context) []*types.ServicePackageFrameworkDataSource { + return []*types.ServicePackageFrameworkDataSource{} } -func (p *servicePackage) FrameworkResources(ctx context.Context) []func(context.Context) (resource.ResourceWithConfigure, error) { - return []func(context.Context) (resource.ResourceWithConfigure, error){} +func (p *servicePackage) FrameworkResources(ctx context.Context) []*types.ServicePackageFrameworkResource { + return []*types.ServicePackageFrameworkResource{} } -func (p *servicePackage) SDKDataSources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{} +func (p *servicePackage) SDKDataSources(ctx context.Context) []*types.ServicePackageSDKDataSource { + return []*types.ServicePackageSDKDataSource{} } -func (p *servicePackage) SDKResources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{ - "aws_macie2_account": ResourceAccount, - "aws_macie2_classification_export_configuration": ResourceClassificationExportConfiguration, - "aws_macie2_classification_job": ResourceClassificationJob, - "aws_macie2_custom_data_identifier": ResourceCustomDataIdentifier, - "aws_macie2_findings_filter": ResourceFindingsFilter, - "aws_macie2_invitation_accepter": ResourceInvitationAccepter, - "aws_macie2_member": ResourceMember, - "aws_macie2_organization_admin_account": ResourceOrganizationAdminAccount, +func (p *servicePackage) SDKResources(ctx context.Context) []*types.ServicePackageSDKResource { + return []*types.ServicePackageSDKResource{ + { + Factory: ResourceAccount, + TypeName: "aws_macie2_account", + }, + { + Factory: ResourceClassificationExportConfiguration, + TypeName: "aws_macie2_classification_export_configuration", + }, + { + Factory: ResourceClassificationJob, + TypeName: "aws_macie2_classification_job", + }, + { + Factory: ResourceCustomDataIdentifier, + TypeName: "aws_macie2_custom_data_identifier", + }, + { + Factory: ResourceFindingsFilter, + TypeName: "aws_macie2_findings_filter", + }, + { + Factory: ResourceInvitationAccepter, + TypeName: "aws_macie2_invitation_accepter", + }, + { + Factory: ResourceMember, + TypeName: "aws_macie2_member", + }, + { + Factory: ResourceOrganizationAdminAccount, + TypeName: "aws_macie2_organization_admin_account", + }, } } diff --git a/internal/service/mediaconnect/service_package_gen.go b/internal/service/mediaconnect/service_package_gen.go index 1468013ade0e..a1e539ff867c 100644 --- a/internal/service/mediaconnect/service_package_gen.go +++ b/internal/service/mediaconnect/service_package_gen.go @@ -5,28 +5,26 @@ package mediaconnect import ( "context" - "github.com/hashicorp/terraform-plugin-framework/datasource" - "github.com/hashicorp/terraform-plugin-framework/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "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) []func(context.Context) (datasource.DataSourceWithConfigure, error) { - return []func(context.Context) (datasource.DataSourceWithConfigure, error){} +func (p *servicePackage) FrameworkDataSources(ctx context.Context) []*types.ServicePackageFrameworkDataSource { + return []*types.ServicePackageFrameworkDataSource{} } -func (p *servicePackage) FrameworkResources(ctx context.Context) []func(context.Context) (resource.ResourceWithConfigure, error) { - return []func(context.Context) (resource.ResourceWithConfigure, error){} +func (p *servicePackage) FrameworkResources(ctx context.Context) []*types.ServicePackageFrameworkResource { + return []*types.ServicePackageFrameworkResource{} } -func (p *servicePackage) SDKDataSources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{} +func (p *servicePackage) SDKDataSources(ctx context.Context) []*types.ServicePackageSDKDataSource { + return []*types.ServicePackageSDKDataSource{} } -func (p *servicePackage) SDKResources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{} +func (p *servicePackage) SDKResources(ctx context.Context) []*types.ServicePackageSDKResource { + return []*types.ServicePackageSDKResource{} } func (p *servicePackage) ServicePackageName() string { diff --git a/internal/service/mediaconvert/service_package_gen.go b/internal/service/mediaconvert/service_package_gen.go index 574bf90e12ca..76f7d245b41f 100644 --- a/internal/service/mediaconvert/service_package_gen.go +++ b/internal/service/mediaconvert/service_package_gen.go @@ -5,29 +5,30 @@ package mediaconvert import ( "context" - "github.com/hashicorp/terraform-plugin-framework/datasource" - "github.com/hashicorp/terraform-plugin-framework/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "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) []func(context.Context) (datasource.DataSourceWithConfigure, error) { - return []func(context.Context) (datasource.DataSourceWithConfigure, error){} +func (p *servicePackage) FrameworkDataSources(ctx context.Context) []*types.ServicePackageFrameworkDataSource { + return []*types.ServicePackageFrameworkDataSource{} } -func (p *servicePackage) FrameworkResources(ctx context.Context) []func(context.Context) (resource.ResourceWithConfigure, error) { - return []func(context.Context) (resource.ResourceWithConfigure, error){} +func (p *servicePackage) FrameworkResources(ctx context.Context) []*types.ServicePackageFrameworkResource { + return []*types.ServicePackageFrameworkResource{} } -func (p *servicePackage) SDKDataSources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{} +func (p *servicePackage) SDKDataSources(ctx context.Context) []*types.ServicePackageSDKDataSource { + return []*types.ServicePackageSDKDataSource{} } -func (p *servicePackage) SDKResources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{ - "aws_media_convert_queue": ResourceQueue, +func (p *servicePackage) SDKResources(ctx context.Context) []*types.ServicePackageSDKResource { + return []*types.ServicePackageSDKResource{ + { + Factory: ResourceQueue, + TypeName: "aws_media_convert_queue", + }, } } diff --git a/internal/service/medialive/service_package_gen.go b/internal/service/medialive/service_package_gen.go index 09cf1eafec83..cf1cf877f410 100644 --- a/internal/service/medialive/service_package_gen.go +++ b/internal/service/medialive/service_package_gen.go @@ -5,34 +5,46 @@ package medialive import ( "context" - "github.com/hashicorp/terraform-plugin-framework/datasource" - "github.com/hashicorp/terraform-plugin-framework/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "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) []func(context.Context) (datasource.DataSourceWithConfigure, error) { - return []func(context.Context) (datasource.DataSourceWithConfigure, error){} +func (p *servicePackage) FrameworkDataSources(ctx context.Context) []*types.ServicePackageFrameworkDataSource { + return []*types.ServicePackageFrameworkDataSource{} } -func (p *servicePackage) FrameworkResources(ctx context.Context) []func(context.Context) (resource.ResourceWithConfigure, error) { - return []func(context.Context) (resource.ResourceWithConfigure, error){ - newResourceMultiplexProgram, +func (p *servicePackage) FrameworkResources(ctx context.Context) []*types.ServicePackageFrameworkResource { + return []*types.ServicePackageFrameworkResource{ + { + Factory: newResourceMultiplexProgram, + }, } } -func (p *servicePackage) SDKDataSources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{} +func (p *servicePackage) SDKDataSources(ctx context.Context) []*types.ServicePackageSDKDataSource { + return []*types.ServicePackageSDKDataSource{} } -func (p *servicePackage) SDKResources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{ - "aws_medialive_channel": ResourceChannel, - "aws_medialive_input": ResourceInput, - "aws_medialive_input_security_group": ResourceInputSecurityGroup, - "aws_medialive_multiplex": ResourceMultiplex, +func (p *servicePackage) SDKResources(ctx context.Context) []*types.ServicePackageSDKResource { + return []*types.ServicePackageSDKResource{ + { + Factory: ResourceChannel, + TypeName: "aws_medialive_channel", + }, + { + Factory: ResourceInput, + TypeName: "aws_medialive_input", + }, + { + Factory: ResourceInputSecurityGroup, + TypeName: "aws_medialive_input_security_group", + }, + { + Factory: ResourceMultiplex, + TypeName: "aws_medialive_multiplex", + }, } } diff --git a/internal/service/mediapackage/service_package_gen.go b/internal/service/mediapackage/service_package_gen.go index 11c86d14255c..0be54f1561e8 100644 --- a/internal/service/mediapackage/service_package_gen.go +++ b/internal/service/mediapackage/service_package_gen.go @@ -5,29 +5,30 @@ package mediapackage import ( "context" - "github.com/hashicorp/terraform-plugin-framework/datasource" - "github.com/hashicorp/terraform-plugin-framework/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "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) []func(context.Context) (datasource.DataSourceWithConfigure, error) { - return []func(context.Context) (datasource.DataSourceWithConfigure, error){} +func (p *servicePackage) FrameworkDataSources(ctx context.Context) []*types.ServicePackageFrameworkDataSource { + return []*types.ServicePackageFrameworkDataSource{} } -func (p *servicePackage) FrameworkResources(ctx context.Context) []func(context.Context) (resource.ResourceWithConfigure, error) { - return []func(context.Context) (resource.ResourceWithConfigure, error){} +func (p *servicePackage) FrameworkResources(ctx context.Context) []*types.ServicePackageFrameworkResource { + return []*types.ServicePackageFrameworkResource{} } -func (p *servicePackage) SDKDataSources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{} +func (p *servicePackage) SDKDataSources(ctx context.Context) []*types.ServicePackageSDKDataSource { + return []*types.ServicePackageSDKDataSource{} } -func (p *servicePackage) SDKResources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{ - "aws_media_package_channel": ResourceChannel, +func (p *servicePackage) SDKResources(ctx context.Context) []*types.ServicePackageSDKResource { + return []*types.ServicePackageSDKResource{ + { + Factory: ResourceChannel, + TypeName: "aws_media_package_channel", + }, } } diff --git a/internal/service/mediastore/service_package_gen.go b/internal/service/mediastore/service_package_gen.go index 24435b253ac3..0fefe9df898e 100644 --- a/internal/service/mediastore/service_package_gen.go +++ b/internal/service/mediastore/service_package_gen.go @@ -5,30 +5,34 @@ package mediastore import ( "context" - "github.com/hashicorp/terraform-plugin-framework/datasource" - "github.com/hashicorp/terraform-plugin-framework/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "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) []func(context.Context) (datasource.DataSourceWithConfigure, error) { - return []func(context.Context) (datasource.DataSourceWithConfigure, error){} +func (p *servicePackage) FrameworkDataSources(ctx context.Context) []*types.ServicePackageFrameworkDataSource { + return []*types.ServicePackageFrameworkDataSource{} } -func (p *servicePackage) FrameworkResources(ctx context.Context) []func(context.Context) (resource.ResourceWithConfigure, error) { - return []func(context.Context) (resource.ResourceWithConfigure, error){} +func (p *servicePackage) FrameworkResources(ctx context.Context) []*types.ServicePackageFrameworkResource { + return []*types.ServicePackageFrameworkResource{} } -func (p *servicePackage) SDKDataSources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{} +func (p *servicePackage) SDKDataSources(ctx context.Context) []*types.ServicePackageSDKDataSource { + return []*types.ServicePackageSDKDataSource{} } -func (p *servicePackage) SDKResources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{ - "aws_media_store_container": ResourceContainer, - "aws_media_store_container_policy": ResourceContainerPolicy, +func (p *servicePackage) SDKResources(ctx context.Context) []*types.ServicePackageSDKResource { + return []*types.ServicePackageSDKResource{ + { + Factory: ResourceContainer, + TypeName: "aws_media_store_container", + }, + { + Factory: ResourceContainerPolicy, + TypeName: "aws_media_store_container_policy", + }, } } diff --git a/internal/service/memorydb/service_package_gen.go b/internal/service/memorydb/service_package_gen.go index 309eaa78aa57..42825ac48f0f 100644 --- a/internal/service/memorydb/service_package_gen.go +++ b/internal/service/memorydb/service_package_gen.go @@ -5,41 +5,75 @@ package memorydb import ( "context" - "github.com/hashicorp/terraform-plugin-framework/datasource" - "github.com/hashicorp/terraform-plugin-framework/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "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) []func(context.Context) (datasource.DataSourceWithConfigure, error) { - return []func(context.Context) (datasource.DataSourceWithConfigure, error){} +func (p *servicePackage) FrameworkDataSources(ctx context.Context) []*types.ServicePackageFrameworkDataSource { + return []*types.ServicePackageFrameworkDataSource{} } -func (p *servicePackage) FrameworkResources(ctx context.Context) []func(context.Context) (resource.ResourceWithConfigure, error) { - return []func(context.Context) (resource.ResourceWithConfigure, error){} +func (p *servicePackage) FrameworkResources(ctx context.Context) []*types.ServicePackageFrameworkResource { + return []*types.ServicePackageFrameworkResource{} } -func (p *servicePackage) SDKDataSources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{ - "aws_memorydb_acl": DataSourceACL, - "aws_memorydb_cluster": DataSourceCluster, - "aws_memorydb_parameter_group": DataSourceParameterGroup, - "aws_memorydb_snapshot": DataSourceSnapshot, - "aws_memorydb_subnet_group": DataSourceSubnetGroup, - "aws_memorydb_user": DataSourceUser, +func (p *servicePackage) SDKDataSources(ctx context.Context) []*types.ServicePackageSDKDataSource { + return []*types.ServicePackageSDKDataSource{ + { + Factory: DataSourceACL, + TypeName: "aws_memorydb_acl", + }, + { + Factory: DataSourceCluster, + TypeName: "aws_memorydb_cluster", + }, + { + Factory: DataSourceParameterGroup, + TypeName: "aws_memorydb_parameter_group", + }, + { + Factory: DataSourceSnapshot, + TypeName: "aws_memorydb_snapshot", + }, + { + Factory: DataSourceSubnetGroup, + TypeName: "aws_memorydb_subnet_group", + }, + { + Factory: DataSourceUser, + TypeName: "aws_memorydb_user", + }, } } -func (p *servicePackage) SDKResources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{ - "aws_memorydb_acl": ResourceACL, - "aws_memorydb_cluster": ResourceCluster, - "aws_memorydb_parameter_group": ResourceParameterGroup, - "aws_memorydb_snapshot": ResourceSnapshot, - "aws_memorydb_subnet_group": ResourceSubnetGroup, - "aws_memorydb_user": ResourceUser, +func (p *servicePackage) SDKResources(ctx context.Context) []*types.ServicePackageSDKResource { + return []*types.ServicePackageSDKResource{ + { + Factory: ResourceACL, + TypeName: "aws_memorydb_acl", + }, + { + Factory: ResourceCluster, + TypeName: "aws_memorydb_cluster", + }, + { + Factory: ResourceParameterGroup, + TypeName: "aws_memorydb_parameter_group", + }, + { + Factory: ResourceSnapshot, + TypeName: "aws_memorydb_snapshot", + }, + { + Factory: ResourceSubnetGroup, + TypeName: "aws_memorydb_subnet_group", + }, + { + Factory: ResourceUser, + TypeName: "aws_memorydb_user", + }, } } diff --git a/internal/service/meta/service_package_gen.go b/internal/service/meta/service_package_gen.go index 7eb5d21f0360..6bbd72b1a5b4 100644 --- a/internal/service/meta/service_package_gen.go +++ b/internal/service/meta/service_package_gen.go @@ -5,36 +5,50 @@ package meta import ( "context" - "github.com/hashicorp/terraform-plugin-framework/datasource" - "github.com/hashicorp/terraform-plugin-framework/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "github.com/hashicorp/terraform-provider-aws/internal/types" ) type servicePackage struct{} -func (p *servicePackage) FrameworkDataSources(ctx context.Context) []func(context.Context) (datasource.DataSourceWithConfigure, error) { - return []func(context.Context) (datasource.DataSourceWithConfigure, error){ - newDataSourceARN, - newDataSourceBillingServiceAccount, - newDataSourceDefaultTags, - newDataSourceIPRanges, - newDataSourcePartition, - newDataSourceRegion, - newDataSourceRegions, - newDataSourceService, +func (p *servicePackage) FrameworkDataSources(ctx context.Context) []*types.ServicePackageFrameworkDataSource { + return []*types.ServicePackageFrameworkDataSource{ + { + Factory: newDataSourceARN, + }, + { + Factory: newDataSourceBillingServiceAccount, + }, + { + Factory: newDataSourceDefaultTags, + }, + { + Factory: newDataSourceIPRanges, + }, + { + Factory: newDataSourcePartition, + }, + { + Factory: newDataSourceRegion, + }, + { + Factory: newDataSourceRegions, + }, + { + Factory: newDataSourceService, + }, } } -func (p *servicePackage) FrameworkResources(ctx context.Context) []func(context.Context) (resource.ResourceWithConfigure, error) { - return []func(context.Context) (resource.ResourceWithConfigure, error){} +func (p *servicePackage) FrameworkResources(ctx context.Context) []*types.ServicePackageFrameworkResource { + return []*types.ServicePackageFrameworkResource{} } -func (p *servicePackage) SDKDataSources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{} +func (p *servicePackage) SDKDataSources(ctx context.Context) []*types.ServicePackageSDKDataSource { + return []*types.ServicePackageSDKDataSource{} } -func (p *servicePackage) SDKResources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{} +func (p *servicePackage) SDKResources(ctx context.Context) []*types.ServicePackageSDKResource { + return []*types.ServicePackageSDKResource{} } func (p *servicePackage) ServicePackageName() string { diff --git a/internal/service/mq/service_package_gen.go b/internal/service/mq/service_package_gen.go index a4f10df883a5..103c22549df9 100644 --- a/internal/service/mq/service_package_gen.go +++ b/internal/service/mq/service_package_gen.go @@ -5,33 +5,43 @@ package mq import ( "context" - "github.com/hashicorp/terraform-plugin-framework/datasource" - "github.com/hashicorp/terraform-plugin-framework/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "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) []func(context.Context) (datasource.DataSourceWithConfigure, error) { - return []func(context.Context) (datasource.DataSourceWithConfigure, error){} +func (p *servicePackage) FrameworkDataSources(ctx context.Context) []*types.ServicePackageFrameworkDataSource { + return []*types.ServicePackageFrameworkDataSource{} } -func (p *servicePackage) FrameworkResources(ctx context.Context) []func(context.Context) (resource.ResourceWithConfigure, error) { - return []func(context.Context) (resource.ResourceWithConfigure, error){} +func (p *servicePackage) FrameworkResources(ctx context.Context) []*types.ServicePackageFrameworkResource { + return []*types.ServicePackageFrameworkResource{} } -func (p *servicePackage) SDKDataSources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{ - "aws_mq_broker": DataSourceBroker, - "aws_mq_broker_instance_type_offerings": DataSourceBrokerInstanceTypeOfferings, +func (p *servicePackage) SDKDataSources(ctx context.Context) []*types.ServicePackageSDKDataSource { + return []*types.ServicePackageSDKDataSource{ + { + Factory: DataSourceBroker, + TypeName: "aws_mq_broker", + }, + { + Factory: DataSourceBrokerInstanceTypeOfferings, + TypeName: "aws_mq_broker_instance_type_offerings", + }, } } -func (p *servicePackage) SDKResources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{ - "aws_mq_broker": ResourceBroker, - "aws_mq_configuration": ResourceConfiguration, +func (p *servicePackage) SDKResources(ctx context.Context) []*types.ServicePackageSDKResource { + return []*types.ServicePackageSDKResource{ + { + Factory: ResourceBroker, + TypeName: "aws_mq_broker", + }, + { + Factory: ResourceConfiguration, + TypeName: "aws_mq_configuration", + }, } } diff --git a/internal/service/mwaa/service_package_gen.go b/internal/service/mwaa/service_package_gen.go index b815c3846904..c3fd13e988cb 100644 --- a/internal/service/mwaa/service_package_gen.go +++ b/internal/service/mwaa/service_package_gen.go @@ -5,29 +5,30 @@ package mwaa import ( "context" - "github.com/hashicorp/terraform-plugin-framework/datasource" - "github.com/hashicorp/terraform-plugin-framework/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "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) []func(context.Context) (datasource.DataSourceWithConfigure, error) { - return []func(context.Context) (datasource.DataSourceWithConfigure, error){} +func (p *servicePackage) FrameworkDataSources(ctx context.Context) []*types.ServicePackageFrameworkDataSource { + return []*types.ServicePackageFrameworkDataSource{} } -func (p *servicePackage) FrameworkResources(ctx context.Context) []func(context.Context) (resource.ResourceWithConfigure, error) { - return []func(context.Context) (resource.ResourceWithConfigure, error){} +func (p *servicePackage) FrameworkResources(ctx context.Context) []*types.ServicePackageFrameworkResource { + return []*types.ServicePackageFrameworkResource{} } -func (p *servicePackage) SDKDataSources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{} +func (p *servicePackage) SDKDataSources(ctx context.Context) []*types.ServicePackageSDKDataSource { + return []*types.ServicePackageSDKDataSource{} } -func (p *servicePackage) SDKResources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{ - "aws_mwaa_environment": ResourceEnvironment, +func (p *servicePackage) SDKResources(ctx context.Context) []*types.ServicePackageSDKResource { + return []*types.ServicePackageSDKResource{ + { + Factory: ResourceEnvironment, + TypeName: "aws_mwaa_environment", + }, } } diff --git a/internal/service/neptune/service_package_gen.go b/internal/service/neptune/service_package_gen.go index fc2ee1012f45..3423f8cb80f1 100644 --- a/internal/service/neptune/service_package_gen.go +++ b/internal/service/neptune/service_package_gen.go @@ -5,40 +5,71 @@ package neptune import ( "context" - "github.com/hashicorp/terraform-plugin-framework/datasource" - "github.com/hashicorp/terraform-plugin-framework/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "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) []func(context.Context) (datasource.DataSourceWithConfigure, error) { - return []func(context.Context) (datasource.DataSourceWithConfigure, error){} +func (p *servicePackage) FrameworkDataSources(ctx context.Context) []*types.ServicePackageFrameworkDataSource { + return []*types.ServicePackageFrameworkDataSource{} } -func (p *servicePackage) FrameworkResources(ctx context.Context) []func(context.Context) (resource.ResourceWithConfigure, error) { - return []func(context.Context) (resource.ResourceWithConfigure, error){} +func (p *servicePackage) FrameworkResources(ctx context.Context) []*types.ServicePackageFrameworkResource { + return []*types.ServicePackageFrameworkResource{} } -func (p *servicePackage) SDKDataSources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{ - "aws_neptune_engine_version": DataSourceEngineVersion, - "aws_neptune_orderable_db_instance": DataSourceOrderableDBInstance, +func (p *servicePackage) SDKDataSources(ctx context.Context) []*types.ServicePackageSDKDataSource { + return []*types.ServicePackageSDKDataSource{ + { + Factory: DataSourceEngineVersion, + TypeName: "aws_neptune_engine_version", + }, + { + Factory: DataSourceOrderableDBInstance, + TypeName: "aws_neptune_orderable_db_instance", + }, } } -func (p *servicePackage) SDKResources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{ - "aws_neptune_cluster": ResourceCluster, - "aws_neptune_cluster_endpoint": ResourceClusterEndpoint, - "aws_neptune_cluster_instance": ResourceClusterInstance, - "aws_neptune_cluster_parameter_group": ResourceClusterParameterGroup, - "aws_neptune_cluster_snapshot": ResourceClusterSnapshot, - "aws_neptune_event_subscription": ResourceEventSubscription, - "aws_neptune_global_cluster": ResourceGlobalCluster, - "aws_neptune_parameter_group": ResourceParameterGroup, - "aws_neptune_subnet_group": ResourceSubnetGroup, +func (p *servicePackage) SDKResources(ctx context.Context) []*types.ServicePackageSDKResource { + return []*types.ServicePackageSDKResource{ + { + Factory: ResourceCluster, + TypeName: "aws_neptune_cluster", + }, + { + Factory: ResourceClusterEndpoint, + TypeName: "aws_neptune_cluster_endpoint", + }, + { + Factory: ResourceClusterInstance, + TypeName: "aws_neptune_cluster_instance", + }, + { + Factory: ResourceClusterParameterGroup, + TypeName: "aws_neptune_cluster_parameter_group", + }, + { + Factory: ResourceClusterSnapshot, + TypeName: "aws_neptune_cluster_snapshot", + }, + { + Factory: ResourceEventSubscription, + TypeName: "aws_neptune_event_subscription", + }, + { + Factory: ResourceGlobalCluster, + TypeName: "aws_neptune_global_cluster", + }, + { + Factory: ResourceParameterGroup, + TypeName: "aws_neptune_parameter_group", + }, + { + Factory: ResourceSubnetGroup, + TypeName: "aws_neptune_subnet_group", + }, } } diff --git a/internal/service/networkfirewall/service_package_gen.go b/internal/service/networkfirewall/service_package_gen.go index a91b851d6ab0..3e1f6f86b4d6 100644 --- a/internal/service/networkfirewall/service_package_gen.go +++ b/internal/service/networkfirewall/service_package_gen.go @@ -5,36 +5,55 @@ package networkfirewall import ( "context" - "github.com/hashicorp/terraform-plugin-framework/datasource" - "github.com/hashicorp/terraform-plugin-framework/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "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) []func(context.Context) (datasource.DataSourceWithConfigure, error) { - return []func(context.Context) (datasource.DataSourceWithConfigure, error){} +func (p *servicePackage) FrameworkDataSources(ctx context.Context) []*types.ServicePackageFrameworkDataSource { + return []*types.ServicePackageFrameworkDataSource{} } -func (p *servicePackage) FrameworkResources(ctx context.Context) []func(context.Context) (resource.ResourceWithConfigure, error) { - return []func(context.Context) (resource.ResourceWithConfigure, error){} +func (p *servicePackage) FrameworkResources(ctx context.Context) []*types.ServicePackageFrameworkResource { + return []*types.ServicePackageFrameworkResource{} } -func (p *servicePackage) SDKDataSources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{ - "aws_networkfirewall_firewall": DataSourceFirewall, - "aws_networkfirewall_firewall_policy": DataSourceFirewallPolicy, +func (p *servicePackage) SDKDataSources(ctx context.Context) []*types.ServicePackageSDKDataSource { + return []*types.ServicePackageSDKDataSource{ + { + Factory: DataSourceFirewall, + TypeName: "aws_networkfirewall_firewall", + }, + { + Factory: DataSourceFirewallPolicy, + TypeName: "aws_networkfirewall_firewall_policy", + }, } } -func (p *servicePackage) SDKResources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{ - "aws_networkfirewall_firewall": ResourceFirewall, - "aws_networkfirewall_firewall_policy": ResourceFirewallPolicy, - "aws_networkfirewall_logging_configuration": ResourceLoggingConfiguration, - "aws_networkfirewall_resource_policy": ResourceResourcePolicy, - "aws_networkfirewall_rule_group": ResourceRuleGroup, +func (p *servicePackage) SDKResources(ctx context.Context) []*types.ServicePackageSDKResource { + return []*types.ServicePackageSDKResource{ + { + Factory: ResourceFirewall, + TypeName: "aws_networkfirewall_firewall", + }, + { + Factory: ResourceFirewallPolicy, + TypeName: "aws_networkfirewall_firewall_policy", + }, + { + Factory: ResourceLoggingConfiguration, + TypeName: "aws_networkfirewall_logging_configuration", + }, + { + Factory: ResourceResourcePolicy, + TypeName: "aws_networkfirewall_resource_policy", + }, + { + Factory: ResourceRuleGroup, + TypeName: "aws_networkfirewall_rule_group", + }, } } diff --git a/internal/service/networkmanager/service_package_gen.go b/internal/service/networkmanager/service_package_gen.go index 1ac8caec5457..293c10378f31 100644 --- a/internal/service/networkmanager/service_package_gen.go +++ b/internal/service/networkmanager/service_package_gen.go @@ -5,58 +5,143 @@ package networkmanager import ( "context" - "github.com/hashicorp/terraform-plugin-framework/datasource" - "github.com/hashicorp/terraform-plugin-framework/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "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) []func(context.Context) (datasource.DataSourceWithConfigure, error) { - return []func(context.Context) (datasource.DataSourceWithConfigure, error){} +func (p *servicePackage) FrameworkDataSources(ctx context.Context) []*types.ServicePackageFrameworkDataSource { + return []*types.ServicePackageFrameworkDataSource{} } -func (p *servicePackage) FrameworkResources(ctx context.Context) []func(context.Context) (resource.ResourceWithConfigure, error) { - return []func(context.Context) (resource.ResourceWithConfigure, error){} +func (p *servicePackage) FrameworkResources(ctx context.Context) []*types.ServicePackageFrameworkResource { + return []*types.ServicePackageFrameworkResource{} } -func (p *servicePackage) SDKDataSources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{ - "aws_networkmanager_connection": DataSourceConnection, - "aws_networkmanager_connections": DataSourceConnections, - "aws_networkmanager_core_network_policy_document": DataSourceCoreNetworkPolicyDocument, - "aws_networkmanager_device": DataSourceDevice, - "aws_networkmanager_devices": DataSourceDevices, - "aws_networkmanager_global_network": DataSourceGlobalNetwork, - "aws_networkmanager_global_networks": DataSourceGlobalNetworks, - "aws_networkmanager_link": DataSourceLink, - "aws_networkmanager_links": DataSourceLinks, - "aws_networkmanager_site": DataSourceSite, - "aws_networkmanager_sites": DataSourceSites, +func (p *servicePackage) SDKDataSources(ctx context.Context) []*types.ServicePackageSDKDataSource { + return []*types.ServicePackageSDKDataSource{ + { + Factory: DataSourceConnection, + TypeName: "aws_networkmanager_connection", + }, + { + Factory: DataSourceConnections, + TypeName: "aws_networkmanager_connections", + }, + { + Factory: DataSourceCoreNetworkPolicyDocument, + TypeName: "aws_networkmanager_core_network_policy_document", + }, + { + Factory: DataSourceDevice, + TypeName: "aws_networkmanager_device", + }, + { + Factory: DataSourceDevices, + TypeName: "aws_networkmanager_devices", + }, + { + Factory: DataSourceGlobalNetwork, + TypeName: "aws_networkmanager_global_network", + }, + { + Factory: DataSourceGlobalNetworks, + TypeName: "aws_networkmanager_global_networks", + }, + { + Factory: DataSourceLink, + TypeName: "aws_networkmanager_link", + }, + { + Factory: DataSourceLinks, + TypeName: "aws_networkmanager_links", + }, + { + Factory: DataSourceSite, + TypeName: "aws_networkmanager_site", + }, + { + Factory: DataSourceSites, + TypeName: "aws_networkmanager_sites", + }, } } -func (p *servicePackage) SDKResources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{ - "aws_networkmanager_attachment_accepter": ResourceAttachmentAccepter, - "aws_networkmanager_connect_attachment": ResourceConnectAttachment, - "aws_networkmanager_connect_peer": ResourceConnectPeer, - "aws_networkmanager_connection": ResourceConnection, - "aws_networkmanager_core_network": ResourceCoreNetwork, - "aws_networkmanager_core_network_policy_attachment": ResourceCoreNetworkPolicyAttachment, - "aws_networkmanager_customer_gateway_association": ResourceCustomerGatewayAssociation, - "aws_networkmanager_device": ResourceDevice, - "aws_networkmanager_global_network": ResourceGlobalNetwork, - "aws_networkmanager_link": ResourceLink, - "aws_networkmanager_link_association": ResourceLinkAssociation, - "aws_networkmanager_site": ResourceSite, - "aws_networkmanager_site_to_site_vpn_attachment": ResourceSiteToSiteVPNAttachment, - "aws_networkmanager_transit_gateway_connect_peer_association": ResourceTransitGatewayConnectPeerAssociation, - "aws_networkmanager_transit_gateway_peering": ResourceTransitGatewayPeering, - "aws_networkmanager_transit_gateway_registration": ResourceTransitGatewayRegistration, - "aws_networkmanager_transit_gateway_route_table_attachment": ResourceTransitGatewayRouteTableAttachment, - "aws_networkmanager_vpc_attachment": ResourceVPCAttachment, +func (p *servicePackage) SDKResources(ctx context.Context) []*types.ServicePackageSDKResource { + return []*types.ServicePackageSDKResource{ + { + Factory: ResourceAttachmentAccepter, + TypeName: "aws_networkmanager_attachment_accepter", + }, + { + Factory: ResourceConnectAttachment, + TypeName: "aws_networkmanager_connect_attachment", + }, + { + Factory: ResourceConnectPeer, + TypeName: "aws_networkmanager_connect_peer", + }, + { + Factory: ResourceConnection, + TypeName: "aws_networkmanager_connection", + }, + { + Factory: ResourceCoreNetwork, + TypeName: "aws_networkmanager_core_network", + }, + { + Factory: ResourceCoreNetworkPolicyAttachment, + TypeName: "aws_networkmanager_core_network_policy_attachment", + }, + { + Factory: ResourceCustomerGatewayAssociation, + TypeName: "aws_networkmanager_customer_gateway_association", + }, + { + Factory: ResourceDevice, + TypeName: "aws_networkmanager_device", + }, + { + Factory: ResourceGlobalNetwork, + TypeName: "aws_networkmanager_global_network", + }, + { + Factory: ResourceLink, + TypeName: "aws_networkmanager_link", + }, + { + Factory: ResourceLinkAssociation, + TypeName: "aws_networkmanager_link_association", + }, + { + Factory: ResourceSite, + TypeName: "aws_networkmanager_site", + }, + { + Factory: ResourceSiteToSiteVPNAttachment, + TypeName: "aws_networkmanager_site_to_site_vpn_attachment", + }, + { + Factory: ResourceTransitGatewayConnectPeerAssociation, + TypeName: "aws_networkmanager_transit_gateway_connect_peer_association", + }, + { + Factory: ResourceTransitGatewayPeering, + TypeName: "aws_networkmanager_transit_gateway_peering", + }, + { + Factory: ResourceTransitGatewayRegistration, + TypeName: "aws_networkmanager_transit_gateway_registration", + }, + { + Factory: ResourceTransitGatewayRouteTableAttachment, + TypeName: "aws_networkmanager_transit_gateway_route_table_attachment", + }, + { + Factory: ResourceVPCAttachment, + TypeName: "aws_networkmanager_vpc_attachment", + }, } } diff --git a/internal/service/oam/service_package_gen.go b/internal/service/oam/service_package_gen.go index b60358fb5561..f3131dd5d5bd 100644 --- a/internal/service/oam/service_package_gen.go +++ b/internal/service/oam/service_package_gen.go @@ -5,28 +5,26 @@ package oam import ( "context" - "github.com/hashicorp/terraform-plugin-framework/datasource" - "github.com/hashicorp/terraform-plugin-framework/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "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) []func(context.Context) (datasource.DataSourceWithConfigure, error) { - return []func(context.Context) (datasource.DataSourceWithConfigure, error){} +func (p *servicePackage) FrameworkDataSources(ctx context.Context) []*types.ServicePackageFrameworkDataSource { + return []*types.ServicePackageFrameworkDataSource{} } -func (p *servicePackage) FrameworkResources(ctx context.Context) []func(context.Context) (resource.ResourceWithConfigure, error) { - return []func(context.Context) (resource.ResourceWithConfigure, error){} +func (p *servicePackage) FrameworkResources(ctx context.Context) []*types.ServicePackageFrameworkResource { + return []*types.ServicePackageFrameworkResource{} } -func (p *servicePackage) SDKDataSources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{} +func (p *servicePackage) SDKDataSources(ctx context.Context) []*types.ServicePackageSDKDataSource { + return []*types.ServicePackageSDKDataSource{} } -func (p *servicePackage) SDKResources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{} +func (p *servicePackage) SDKResources(ctx context.Context) []*types.ServicePackageSDKResource { + return []*types.ServicePackageSDKResource{} } func (p *servicePackage) ServicePackageName() string { diff --git a/internal/service/opensearch/service_package_gen.go b/internal/service/opensearch/service_package_gen.go index dba44f1826f1..ffa9860dc8ad 100644 --- a/internal/service/opensearch/service_package_gen.go +++ b/internal/service/opensearch/service_package_gen.go @@ -5,35 +5,51 @@ package opensearch import ( "context" - "github.com/hashicorp/terraform-plugin-framework/datasource" - "github.com/hashicorp/terraform-plugin-framework/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "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) []func(context.Context) (datasource.DataSourceWithConfigure, error) { - return []func(context.Context) (datasource.DataSourceWithConfigure, error){} +func (p *servicePackage) FrameworkDataSources(ctx context.Context) []*types.ServicePackageFrameworkDataSource { + return []*types.ServicePackageFrameworkDataSource{} } -func (p *servicePackage) FrameworkResources(ctx context.Context) []func(context.Context) (resource.ResourceWithConfigure, error) { - return []func(context.Context) (resource.ResourceWithConfigure, error){} +func (p *servicePackage) FrameworkResources(ctx context.Context) []*types.ServicePackageFrameworkResource { + return []*types.ServicePackageFrameworkResource{} } -func (p *servicePackage) SDKDataSources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{ - "aws_opensearch_domain": DataSourceDomain, +func (p *servicePackage) SDKDataSources(ctx context.Context) []*types.ServicePackageSDKDataSource { + return []*types.ServicePackageSDKDataSource{ + { + Factory: DataSourceDomain, + TypeName: "aws_opensearch_domain", + }, } } -func (p *servicePackage) SDKResources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{ - "aws_opensearch_domain": ResourceDomain, - "aws_opensearch_domain_policy": ResourceDomainPolicy, - "aws_opensearch_domain_saml_options": ResourceDomainSAMLOptions, - "aws_opensearch_inbound_connection_accepter": ResourceInboundConnectionAccepter, - "aws_opensearch_outbound_connection": ResourceOutboundConnection, +func (p *servicePackage) SDKResources(ctx context.Context) []*types.ServicePackageSDKResource { + return []*types.ServicePackageSDKResource{ + { + Factory: ResourceDomain, + TypeName: "aws_opensearch_domain", + }, + { + Factory: ResourceDomainPolicy, + TypeName: "aws_opensearch_domain_policy", + }, + { + Factory: ResourceDomainSAMLOptions, + TypeName: "aws_opensearch_domain_saml_options", + }, + { + Factory: ResourceInboundConnectionAccepter, + TypeName: "aws_opensearch_inbound_connection_accepter", + }, + { + Factory: ResourceOutboundConnection, + TypeName: "aws_opensearch_outbound_connection", + }, } } diff --git a/internal/service/opensearchserverless/service_package_gen.go b/internal/service/opensearchserverless/service_package_gen.go index fa2f8dc749e8..669a35f103b1 100644 --- a/internal/service/opensearchserverless/service_package_gen.go +++ b/internal/service/opensearchserverless/service_package_gen.go @@ -5,28 +5,26 @@ package opensearchserverless import ( "context" - "github.com/hashicorp/terraform-plugin-framework/datasource" - "github.com/hashicorp/terraform-plugin-framework/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "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) []func(context.Context) (datasource.DataSourceWithConfigure, error) { - return []func(context.Context) (datasource.DataSourceWithConfigure, error){} +func (p *servicePackage) FrameworkDataSources(ctx context.Context) []*types.ServicePackageFrameworkDataSource { + return []*types.ServicePackageFrameworkDataSource{} } -func (p *servicePackage) FrameworkResources(ctx context.Context) []func(context.Context) (resource.ResourceWithConfigure, error) { - return []func(context.Context) (resource.ResourceWithConfigure, error){} +func (p *servicePackage) FrameworkResources(ctx context.Context) []*types.ServicePackageFrameworkResource { + return []*types.ServicePackageFrameworkResource{} } -func (p *servicePackage) SDKDataSources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{} +func (p *servicePackage) SDKDataSources(ctx context.Context) []*types.ServicePackageSDKDataSource { + return []*types.ServicePackageSDKDataSource{} } -func (p *servicePackage) SDKResources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{} +func (p *servicePackage) SDKResources(ctx context.Context) []*types.ServicePackageSDKResource { + return []*types.ServicePackageSDKResource{} } func (p *servicePackage) ServicePackageName() string { diff --git a/internal/service/opsworks/service_package_gen.go b/internal/service/opsworks/service_package_gen.go index b234c01aeebf..e168bada2458 100644 --- a/internal/service/opsworks/service_package_gen.go +++ b/internal/service/opsworks/service_package_gen.go @@ -5,45 +5,94 @@ package opsworks import ( "context" - "github.com/hashicorp/terraform-plugin-framework/datasource" - "github.com/hashicorp/terraform-plugin-framework/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "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) []func(context.Context) (datasource.DataSourceWithConfigure, error) { - return []func(context.Context) (datasource.DataSourceWithConfigure, error){} +func (p *servicePackage) FrameworkDataSources(ctx context.Context) []*types.ServicePackageFrameworkDataSource { + return []*types.ServicePackageFrameworkDataSource{} } -func (p *servicePackage) FrameworkResources(ctx context.Context) []func(context.Context) (resource.ResourceWithConfigure, error) { - return []func(context.Context) (resource.ResourceWithConfigure, error){} +func (p *servicePackage) FrameworkResources(ctx context.Context) []*types.ServicePackageFrameworkResource { + return []*types.ServicePackageFrameworkResource{} } -func (p *servicePackage) SDKDataSources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{} +func (p *servicePackage) SDKDataSources(ctx context.Context) []*types.ServicePackageSDKDataSource { + return []*types.ServicePackageSDKDataSource{} } -func (p *servicePackage) SDKResources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{ - "aws_opsworks_application": ResourceApplication, - "aws_opsworks_custom_layer": ResourceCustomLayer, - "aws_opsworks_ecs_cluster_layer": ResourceECSClusterLayer, - "aws_opsworks_ganglia_layer": ResourceGangliaLayer, - "aws_opsworks_haproxy_layer": ResourceHAProxyLayer, - "aws_opsworks_instance": ResourceInstance, - "aws_opsworks_java_app_layer": ResourceJavaAppLayer, - "aws_opsworks_memcached_layer": ResourceMemcachedLayer, - "aws_opsworks_mysql_layer": ResourceMySQLLayer, - "aws_opsworks_nodejs_app_layer": ResourceNodejsAppLayer, - "aws_opsworks_permission": ResourcePermission, - "aws_opsworks_php_app_layer": ResourcePHPAppLayer, - "aws_opsworks_rails_app_layer": ResourceRailsAppLayer, - "aws_opsworks_rds_db_instance": ResourceRDSDBInstance, - "aws_opsworks_stack": ResourceStack, - "aws_opsworks_static_web_layer": ResourceStaticWebLayer, - "aws_opsworks_user_profile": ResourceUserProfile, +func (p *servicePackage) SDKResources(ctx context.Context) []*types.ServicePackageSDKResource { + return []*types.ServicePackageSDKResource{ + { + Factory: ResourceApplication, + TypeName: "aws_opsworks_application", + }, + { + Factory: ResourceCustomLayer, + TypeName: "aws_opsworks_custom_layer", + }, + { + Factory: ResourceECSClusterLayer, + TypeName: "aws_opsworks_ecs_cluster_layer", + }, + { + Factory: ResourceGangliaLayer, + TypeName: "aws_opsworks_ganglia_layer", + }, + { + Factory: ResourceHAProxyLayer, + TypeName: "aws_opsworks_haproxy_layer", + }, + { + Factory: ResourceInstance, + TypeName: "aws_opsworks_instance", + }, + { + Factory: ResourceJavaAppLayer, + TypeName: "aws_opsworks_java_app_layer", + }, + { + Factory: ResourceMemcachedLayer, + TypeName: "aws_opsworks_memcached_layer", + }, + { + Factory: ResourceMySQLLayer, + TypeName: "aws_opsworks_mysql_layer", + }, + { + Factory: ResourceNodejsAppLayer, + TypeName: "aws_opsworks_nodejs_app_layer", + }, + { + Factory: ResourcePermission, + TypeName: "aws_opsworks_permission", + }, + { + Factory: ResourcePHPAppLayer, + TypeName: "aws_opsworks_php_app_layer", + }, + { + Factory: ResourceRailsAppLayer, + TypeName: "aws_opsworks_rails_app_layer", + }, + { + Factory: ResourceRDSDBInstance, + TypeName: "aws_opsworks_rds_db_instance", + }, + { + Factory: ResourceStack, + TypeName: "aws_opsworks_stack", + }, + { + Factory: ResourceStaticWebLayer, + TypeName: "aws_opsworks_static_web_layer", + }, + { + Factory: ResourceUserProfile, + TypeName: "aws_opsworks_user_profile", + }, } } diff --git a/internal/service/organizations/service_package_gen.go b/internal/service/organizations/service_package_gen.go index 22a8dc43d3c8..645b7832e716 100644 --- a/internal/service/organizations/service_package_gen.go +++ b/internal/service/organizations/service_package_gen.go @@ -5,42 +5,79 @@ package organizations import ( "context" - "github.com/hashicorp/terraform-plugin-framework/datasource" - "github.com/hashicorp/terraform-plugin-framework/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "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) []func(context.Context) (datasource.DataSourceWithConfigure, error) { - return []func(context.Context) (datasource.DataSourceWithConfigure, error){} +func (p *servicePackage) FrameworkDataSources(ctx context.Context) []*types.ServicePackageFrameworkDataSource { + return []*types.ServicePackageFrameworkDataSource{} } -func (p *servicePackage) FrameworkResources(ctx context.Context) []func(context.Context) (resource.ResourceWithConfigure, error) { - return []func(context.Context) (resource.ResourceWithConfigure, error){} +func (p *servicePackage) FrameworkResources(ctx context.Context) []*types.ServicePackageFrameworkResource { + return []*types.ServicePackageFrameworkResource{} } -func (p *servicePackage) SDKDataSources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{ - "aws_organizations_delegated_administrators": DataSourceDelegatedAdministrators, - "aws_organizations_delegated_services": DataSourceDelegatedServices, - "aws_organizations_organization": DataSourceOrganization, - "aws_organizations_organizational_unit_child_accounts": DataSourceOrganizationalUnitChildAccounts, - "aws_organizations_organizational_unit_descendant_accounts": DataSourceOrganizationalUnitDescendantAccounts, - "aws_organizations_organizational_units": DataSourceOrganizationalUnits, - "aws_organizations_resource_tags": DataSourceResourceTags, +func (p *servicePackage) SDKDataSources(ctx context.Context) []*types.ServicePackageSDKDataSource { + return []*types.ServicePackageSDKDataSource{ + { + Factory: DataSourceDelegatedAdministrators, + TypeName: "aws_organizations_delegated_administrators", + }, + { + Factory: DataSourceDelegatedServices, + TypeName: "aws_organizations_delegated_services", + }, + { + Factory: DataSourceOrganization, + TypeName: "aws_organizations_organization", + }, + { + Factory: DataSourceOrganizationalUnitChildAccounts, + TypeName: "aws_organizations_organizational_unit_child_accounts", + }, + { + Factory: DataSourceOrganizationalUnitDescendantAccounts, + TypeName: "aws_organizations_organizational_unit_descendant_accounts", + }, + { + Factory: DataSourceOrganizationalUnits, + TypeName: "aws_organizations_organizational_units", + }, + { + Factory: DataSourceResourceTags, + TypeName: "aws_organizations_resource_tags", + }, } } -func (p *servicePackage) SDKResources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{ - "aws_organizations_account": ResourceAccount, - "aws_organizations_delegated_administrator": ResourceDelegatedAdministrator, - "aws_organizations_organization": ResourceOrganization, - "aws_organizations_organizational_unit": ResourceOrganizationalUnit, - "aws_organizations_policy": ResourcePolicy, - "aws_organizations_policy_attachment": ResourcePolicyAttachment, +func (p *servicePackage) SDKResources(ctx context.Context) []*types.ServicePackageSDKResource { + return []*types.ServicePackageSDKResource{ + { + Factory: ResourceAccount, + TypeName: "aws_organizations_account", + }, + { + Factory: ResourceDelegatedAdministrator, + TypeName: "aws_organizations_delegated_administrator", + }, + { + Factory: ResourceOrganization, + TypeName: "aws_organizations_organization", + }, + { + Factory: ResourceOrganizationalUnit, + TypeName: "aws_organizations_organizational_unit", + }, + { + Factory: ResourcePolicy, + TypeName: "aws_organizations_policy", + }, + { + Factory: ResourcePolicyAttachment, + TypeName: "aws_organizations_policy_attachment", + }, } } diff --git a/internal/service/outposts/service_package_gen.go b/internal/service/outposts/service_package_gen.go index 08e58afc1693..49fec891493f 100644 --- a/internal/service/outposts/service_package_gen.go +++ b/internal/service/outposts/service_package_gen.go @@ -5,37 +5,59 @@ package outposts import ( "context" - "github.com/hashicorp/terraform-plugin-framework/datasource" - "github.com/hashicorp/terraform-plugin-framework/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "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) []func(context.Context) (datasource.DataSourceWithConfigure, error) { - return []func(context.Context) (datasource.DataSourceWithConfigure, error){} +func (p *servicePackage) FrameworkDataSources(ctx context.Context) []*types.ServicePackageFrameworkDataSource { + return []*types.ServicePackageFrameworkDataSource{} } -func (p *servicePackage) FrameworkResources(ctx context.Context) []func(context.Context) (resource.ResourceWithConfigure, error) { - return []func(context.Context) (resource.ResourceWithConfigure, error){} +func (p *servicePackage) FrameworkResources(ctx context.Context) []*types.ServicePackageFrameworkResource { + return []*types.ServicePackageFrameworkResource{} } -func (p *servicePackage) SDKDataSources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{ - "aws_outposts_asset": DataSourceOutpostAsset, - "aws_outposts_assets": DataSourceOutpostAssets, - "aws_outposts_outpost": DataSourceOutpost, - "aws_outposts_outpost_instance_type": DataSourceOutpostInstanceType, - "aws_outposts_outpost_instance_types": DataSourceOutpostInstanceTypes, - "aws_outposts_outposts": DataSourceOutposts, - "aws_outposts_site": DataSourceSite, - "aws_outposts_sites": DataSourceSites, +func (p *servicePackage) SDKDataSources(ctx context.Context) []*types.ServicePackageSDKDataSource { + return []*types.ServicePackageSDKDataSource{ + { + Factory: DataSourceOutpostAsset, + TypeName: "aws_outposts_asset", + }, + { + Factory: DataSourceOutpostAssets, + TypeName: "aws_outposts_assets", + }, + { + Factory: DataSourceOutpost, + TypeName: "aws_outposts_outpost", + }, + { + Factory: DataSourceOutpostInstanceType, + TypeName: "aws_outposts_outpost_instance_type", + }, + { + Factory: DataSourceOutpostInstanceTypes, + TypeName: "aws_outposts_outpost_instance_types", + }, + { + Factory: DataSourceOutposts, + TypeName: "aws_outposts_outposts", + }, + { + Factory: DataSourceSite, + TypeName: "aws_outposts_site", + }, + { + Factory: DataSourceSites, + TypeName: "aws_outposts_sites", + }, } } -func (p *servicePackage) SDKResources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{} +func (p *servicePackage) SDKResources(ctx context.Context) []*types.ServicePackageSDKResource { + return []*types.ServicePackageSDKResource{} } func (p *servicePackage) ServicePackageName() string { diff --git a/internal/service/pinpoint/service_package_gen.go b/internal/service/pinpoint/service_package_gen.go index 70a62b58b569..6beb21eff6d8 100644 --- a/internal/service/pinpoint/service_package_gen.go +++ b/internal/service/pinpoint/service_package_gen.go @@ -5,39 +5,70 @@ package pinpoint import ( "context" - "github.com/hashicorp/terraform-plugin-framework/datasource" - "github.com/hashicorp/terraform-plugin-framework/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "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) []func(context.Context) (datasource.DataSourceWithConfigure, error) { - return []func(context.Context) (datasource.DataSourceWithConfigure, error){} +func (p *servicePackage) FrameworkDataSources(ctx context.Context) []*types.ServicePackageFrameworkDataSource { + return []*types.ServicePackageFrameworkDataSource{} } -func (p *servicePackage) FrameworkResources(ctx context.Context) []func(context.Context) (resource.ResourceWithConfigure, error) { - return []func(context.Context) (resource.ResourceWithConfigure, error){} +func (p *servicePackage) FrameworkResources(ctx context.Context) []*types.ServicePackageFrameworkResource { + return []*types.ServicePackageFrameworkResource{} } -func (p *servicePackage) SDKDataSources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{} +func (p *servicePackage) SDKDataSources(ctx context.Context) []*types.ServicePackageSDKDataSource { + return []*types.ServicePackageSDKDataSource{} } -func (p *servicePackage) SDKResources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{ - "aws_pinpoint_adm_channel": ResourceADMChannel, - "aws_pinpoint_apns_channel": ResourceAPNSChannel, - "aws_pinpoint_apns_sandbox_channel": ResourceAPNSSandboxChannel, - "aws_pinpoint_apns_voip_channel": ResourceAPNSVoIPChannel, - "aws_pinpoint_apns_voip_sandbox_channel": ResourceAPNSVoIPSandboxChannel, - "aws_pinpoint_app": ResourceApp, - "aws_pinpoint_baidu_channel": ResourceBaiduChannel, - "aws_pinpoint_email_channel": ResourceEmailChannel, - "aws_pinpoint_event_stream": ResourceEventStream, - "aws_pinpoint_gcm_channel": ResourceGCMChannel, - "aws_pinpoint_sms_channel": ResourceSMSChannel, +func (p *servicePackage) SDKResources(ctx context.Context) []*types.ServicePackageSDKResource { + return []*types.ServicePackageSDKResource{ + { + Factory: ResourceADMChannel, + TypeName: "aws_pinpoint_adm_channel", + }, + { + Factory: ResourceAPNSChannel, + TypeName: "aws_pinpoint_apns_channel", + }, + { + Factory: ResourceAPNSSandboxChannel, + TypeName: "aws_pinpoint_apns_sandbox_channel", + }, + { + Factory: ResourceAPNSVoIPChannel, + TypeName: "aws_pinpoint_apns_voip_channel", + }, + { + Factory: ResourceAPNSVoIPSandboxChannel, + TypeName: "aws_pinpoint_apns_voip_sandbox_channel", + }, + { + Factory: ResourceApp, + TypeName: "aws_pinpoint_app", + }, + { + Factory: ResourceBaiduChannel, + TypeName: "aws_pinpoint_baidu_channel", + }, + { + Factory: ResourceEmailChannel, + TypeName: "aws_pinpoint_email_channel", + }, + { + Factory: ResourceEventStream, + TypeName: "aws_pinpoint_event_stream", + }, + { + Factory: ResourceGCMChannel, + TypeName: "aws_pinpoint_gcm_channel", + }, + { + Factory: ResourceSMSChannel, + TypeName: "aws_pinpoint_sms_channel", + }, } } diff --git a/internal/service/pipes/service_package_gen.go b/internal/service/pipes/service_package_gen.go index 7955f5250485..413f6529f65c 100644 --- a/internal/service/pipes/service_package_gen.go +++ b/internal/service/pipes/service_package_gen.go @@ -5,28 +5,26 @@ package pipes import ( "context" - "github.com/hashicorp/terraform-plugin-framework/datasource" - "github.com/hashicorp/terraform-plugin-framework/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "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) []func(context.Context) (datasource.DataSourceWithConfigure, error) { - return []func(context.Context) (datasource.DataSourceWithConfigure, error){} +func (p *servicePackage) FrameworkDataSources(ctx context.Context) []*types.ServicePackageFrameworkDataSource { + return []*types.ServicePackageFrameworkDataSource{} } -func (p *servicePackage) FrameworkResources(ctx context.Context) []func(context.Context) (resource.ResourceWithConfigure, error) { - return []func(context.Context) (resource.ResourceWithConfigure, error){} +func (p *servicePackage) FrameworkResources(ctx context.Context) []*types.ServicePackageFrameworkResource { + return []*types.ServicePackageFrameworkResource{} } -func (p *servicePackage) SDKDataSources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{} +func (p *servicePackage) SDKDataSources(ctx context.Context) []*types.ServicePackageSDKDataSource { + return []*types.ServicePackageSDKDataSource{} } -func (p *servicePackage) SDKResources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{} +func (p *servicePackage) SDKResources(ctx context.Context) []*types.ServicePackageSDKResource { + return []*types.ServicePackageSDKResource{} } func (p *servicePackage) ServicePackageName() string { diff --git a/internal/service/pricing/service_package_gen.go b/internal/service/pricing/service_package_gen.go index 4fb8fef3ce97..6cf077d3184e 100644 --- a/internal/service/pricing/service_package_gen.go +++ b/internal/service/pricing/service_package_gen.go @@ -5,30 +5,31 @@ package pricing import ( "context" - "github.com/hashicorp/terraform-plugin-framework/datasource" - "github.com/hashicorp/terraform-plugin-framework/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "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) []func(context.Context) (datasource.DataSourceWithConfigure, error) { - return []func(context.Context) (datasource.DataSourceWithConfigure, error){} +func (p *servicePackage) FrameworkDataSources(ctx context.Context) []*types.ServicePackageFrameworkDataSource { + return []*types.ServicePackageFrameworkDataSource{} } -func (p *servicePackage) FrameworkResources(ctx context.Context) []func(context.Context) (resource.ResourceWithConfigure, error) { - return []func(context.Context) (resource.ResourceWithConfigure, error){} +func (p *servicePackage) FrameworkResources(ctx context.Context) []*types.ServicePackageFrameworkResource { + return []*types.ServicePackageFrameworkResource{} } -func (p *servicePackage) SDKDataSources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{ - "aws_pricing_product": DataSourceProduct, +func (p *servicePackage) SDKDataSources(ctx context.Context) []*types.ServicePackageSDKDataSource { + return []*types.ServicePackageSDKDataSource{ + { + Factory: DataSourceProduct, + TypeName: "aws_pricing_product", + }, } } -func (p *servicePackage) SDKResources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{} +func (p *servicePackage) SDKResources(ctx context.Context) []*types.ServicePackageSDKResource { + return []*types.ServicePackageSDKResource{} } func (p *servicePackage) ServicePackageName() string { diff --git a/internal/service/qldb/service_package_gen.go b/internal/service/qldb/service_package_gen.go index 6a631bdeddd1..43de46f3356a 100644 --- a/internal/service/qldb/service_package_gen.go +++ b/internal/service/qldb/service_package_gen.go @@ -5,32 +5,39 @@ package qldb import ( "context" - "github.com/hashicorp/terraform-plugin-framework/datasource" - "github.com/hashicorp/terraform-plugin-framework/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "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) []func(context.Context) (datasource.DataSourceWithConfigure, error) { - return []func(context.Context) (datasource.DataSourceWithConfigure, error){} +func (p *servicePackage) FrameworkDataSources(ctx context.Context) []*types.ServicePackageFrameworkDataSource { + return []*types.ServicePackageFrameworkDataSource{} } -func (p *servicePackage) FrameworkResources(ctx context.Context) []func(context.Context) (resource.ResourceWithConfigure, error) { - return []func(context.Context) (resource.ResourceWithConfigure, error){} +func (p *servicePackage) FrameworkResources(ctx context.Context) []*types.ServicePackageFrameworkResource { + return []*types.ServicePackageFrameworkResource{} } -func (p *servicePackage) SDKDataSources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{ - "aws_qldb_ledger": DataSourceLedger, +func (p *servicePackage) SDKDataSources(ctx context.Context) []*types.ServicePackageSDKDataSource { + return []*types.ServicePackageSDKDataSource{ + { + Factory: DataSourceLedger, + TypeName: "aws_qldb_ledger", + }, } } -func (p *servicePackage) SDKResources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{ - "aws_qldb_ledger": ResourceLedger, - "aws_qldb_stream": ResourceStream, +func (p *servicePackage) SDKResources(ctx context.Context) []*types.ServicePackageSDKResource { + return []*types.ServicePackageSDKResource{ + { + Factory: ResourceLedger, + TypeName: "aws_qldb_ledger", + }, + { + Factory: ResourceStream, + TypeName: "aws_qldb_stream", + }, } } diff --git a/internal/service/quicksight/service_package_gen.go b/internal/service/quicksight/service_package_gen.go index 12e8f7eede8c..7a581956d28e 100644 --- a/internal/service/quicksight/service_package_gen.go +++ b/internal/service/quicksight/service_package_gen.go @@ -5,32 +5,42 @@ package quicksight import ( "context" - "github.com/hashicorp/terraform-plugin-framework/datasource" - "github.com/hashicorp/terraform-plugin-framework/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "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) []func(context.Context) (datasource.DataSourceWithConfigure, error) { - return []func(context.Context) (datasource.DataSourceWithConfigure, error){} +func (p *servicePackage) FrameworkDataSources(ctx context.Context) []*types.ServicePackageFrameworkDataSource { + return []*types.ServicePackageFrameworkDataSource{} } -func (p *servicePackage) FrameworkResources(ctx context.Context) []func(context.Context) (resource.ResourceWithConfigure, error) { - return []func(context.Context) (resource.ResourceWithConfigure, error){} +func (p *servicePackage) FrameworkResources(ctx context.Context) []*types.ServicePackageFrameworkResource { + return []*types.ServicePackageFrameworkResource{} } -func (p *servicePackage) SDKDataSources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{} +func (p *servicePackage) SDKDataSources(ctx context.Context) []*types.ServicePackageSDKDataSource { + return []*types.ServicePackageSDKDataSource{} } -func (p *servicePackage) SDKResources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{ - "aws_quicksight_data_source": ResourceDataSource, - "aws_quicksight_group": ResourceGroup, - "aws_quicksight_group_membership": ResourceGroupMembership, - "aws_quicksight_user": ResourceUser, +func (p *servicePackage) SDKResources(ctx context.Context) []*types.ServicePackageSDKResource { + return []*types.ServicePackageSDKResource{ + { + Factory: ResourceDataSource, + TypeName: "aws_quicksight_data_source", + }, + { + Factory: ResourceGroup, + TypeName: "aws_quicksight_group", + }, + { + Factory: ResourceGroupMembership, + TypeName: "aws_quicksight_group_membership", + }, + { + Factory: ResourceUser, + TypeName: "aws_quicksight_user", + }, } } diff --git a/internal/service/ram/service_package_gen.go b/internal/service/ram/service_package_gen.go index 65d68c1508e4..72bad2676f34 100644 --- a/internal/service/ram/service_package_gen.go +++ b/internal/service/ram/service_package_gen.go @@ -5,34 +5,47 @@ package ram import ( "context" - "github.com/hashicorp/terraform-plugin-framework/datasource" - "github.com/hashicorp/terraform-plugin-framework/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "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) []func(context.Context) (datasource.DataSourceWithConfigure, error) { - return []func(context.Context) (datasource.DataSourceWithConfigure, error){} +func (p *servicePackage) FrameworkDataSources(ctx context.Context) []*types.ServicePackageFrameworkDataSource { + return []*types.ServicePackageFrameworkDataSource{} } -func (p *servicePackage) FrameworkResources(ctx context.Context) []func(context.Context) (resource.ResourceWithConfigure, error) { - return []func(context.Context) (resource.ResourceWithConfigure, error){} +func (p *servicePackage) FrameworkResources(ctx context.Context) []*types.ServicePackageFrameworkResource { + return []*types.ServicePackageFrameworkResource{} } -func (p *servicePackage) SDKDataSources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{ - "aws_ram_resource_share": DataSourceResourceShare, +func (p *servicePackage) SDKDataSources(ctx context.Context) []*types.ServicePackageSDKDataSource { + return []*types.ServicePackageSDKDataSource{ + { + Factory: DataSourceResourceShare, + TypeName: "aws_ram_resource_share", + }, } } -func (p *servicePackage) SDKResources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{ - "aws_ram_principal_association": ResourcePrincipalAssociation, - "aws_ram_resource_association": ResourceResourceAssociation, - "aws_ram_resource_share": ResourceResourceShare, - "aws_ram_resource_share_accepter": ResourceResourceShareAccepter, +func (p *servicePackage) SDKResources(ctx context.Context) []*types.ServicePackageSDKResource { + return []*types.ServicePackageSDKResource{ + { + Factory: ResourcePrincipalAssociation, + TypeName: "aws_ram_principal_association", + }, + { + Factory: ResourceResourceAssociation, + TypeName: "aws_ram_resource_association", + }, + { + Factory: ResourceResourceShare, + TypeName: "aws_ram_resource_share", + }, + { + Factory: ResourceResourceShareAccepter, + TypeName: "aws_ram_resource_share_accepter", + }, } } diff --git a/internal/service/rds/service_package_gen.go b/internal/service/rds/service_package_gen.go index 1b9d593f4a48..103c82271fe8 100644 --- a/internal/service/rds/service_package_gen.go +++ b/internal/service/rds/service_package_gen.go @@ -5,67 +5,175 @@ package rds import ( "context" - "github.com/hashicorp/terraform-plugin-framework/datasource" - "github.com/hashicorp/terraform-plugin-framework/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "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) []func(context.Context) (datasource.DataSourceWithConfigure, error) { - return []func(context.Context) (datasource.DataSourceWithConfigure, error){} +func (p *servicePackage) FrameworkDataSources(ctx context.Context) []*types.ServicePackageFrameworkDataSource { + return []*types.ServicePackageFrameworkDataSource{} } -func (p *servicePackage) FrameworkResources(ctx context.Context) []func(context.Context) (resource.ResourceWithConfigure, error) { - return []func(context.Context) (resource.ResourceWithConfigure, error){ - newResourceExportTask, +func (p *servicePackage) FrameworkResources(ctx context.Context) []*types.ServicePackageFrameworkResource { + return []*types.ServicePackageFrameworkResource{ + { + Factory: newResourceExportTask, + }, } } -func (p *servicePackage) SDKDataSources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{ - "aws_db_cluster_snapshot": DataSourceClusterSnapshot, - "aws_db_event_categories": DataSourceEventCategories, - "aws_db_instance": DataSourceInstance, - "aws_db_instances": DataSourceInstances, - "aws_db_proxy": DataSourceProxy, - "aws_db_snapshot": DataSourceSnapshot, - "aws_db_subnet_group": DataSourceSubnetGroup, - "aws_rds_certificate": DataSourceCertificate, - "aws_rds_cluster": DataSourceCluster, - "aws_rds_clusters": DataSourceClusters, - "aws_rds_engine_version": DataSourceEngineVersion, - "aws_rds_orderable_db_instance": DataSourceOrderableInstance, - "aws_rds_reserved_instance_offering": DataSourceReservedOffering, +func (p *servicePackage) SDKDataSources(ctx context.Context) []*types.ServicePackageSDKDataSource { + return []*types.ServicePackageSDKDataSource{ + { + Factory: DataSourceClusterSnapshot, + TypeName: "aws_db_cluster_snapshot", + }, + { + Factory: DataSourceEventCategories, + TypeName: "aws_db_event_categories", + }, + { + Factory: DataSourceInstance, + TypeName: "aws_db_instance", + }, + { + Factory: DataSourceInstances, + TypeName: "aws_db_instances", + }, + { + Factory: DataSourceProxy, + TypeName: "aws_db_proxy", + }, + { + Factory: DataSourceSnapshot, + TypeName: "aws_db_snapshot", + }, + { + Factory: DataSourceSubnetGroup, + TypeName: "aws_db_subnet_group", + }, + { + Factory: DataSourceCertificate, + TypeName: "aws_rds_certificate", + }, + { + Factory: DataSourceCluster, + TypeName: "aws_rds_cluster", + }, + { + Factory: DataSourceClusters, + TypeName: "aws_rds_clusters", + }, + { + Factory: DataSourceEngineVersion, + TypeName: "aws_rds_engine_version", + }, + { + Factory: DataSourceOrderableInstance, + TypeName: "aws_rds_orderable_db_instance", + }, + { + Factory: DataSourceReservedOffering, + TypeName: "aws_rds_reserved_instance_offering", + }, } } -func (p *servicePackage) SDKResources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{ - "aws_db_cluster_snapshot": ResourceClusterSnapshot, - "aws_db_event_subscription": ResourceEventSubscription, - "aws_db_instance": ResourceInstance, - "aws_db_instance_automated_backups_replication": ResourceInstanceAutomatedBackupsReplication, - "aws_db_instance_role_association": ResourceInstanceRoleAssociation, - "aws_db_option_group": ResourceOptionGroup, - "aws_db_parameter_group": ResourceParameterGroup, - "aws_db_proxy": ResourceProxy, - "aws_db_proxy_default_target_group": ResourceProxyDefaultTargetGroup, - "aws_db_proxy_endpoint": ResourceProxyEndpoint, - "aws_db_proxy_target": ResourceProxyTarget, - "aws_db_security_group": ResourceSecurityGroup, - "aws_db_snapshot": ResourceSnapshot, - "aws_db_snapshot_copy": ResourceSnapshotCopy, - "aws_db_subnet_group": ResourceSubnetGroup, - "aws_rds_cluster": ResourceCluster, - "aws_rds_cluster_activity_stream": ResourceClusterActivityStream, - "aws_rds_cluster_endpoint": ResourceClusterEndpoint, - "aws_rds_cluster_instance": ResourceClusterInstance, - "aws_rds_cluster_parameter_group": ResourceClusterParameterGroup, - "aws_rds_cluster_role_association": ResourceClusterRoleAssociation, - "aws_rds_global_cluster": ResourceGlobalCluster, - "aws_rds_reserved_instance": ResourceReservedInstance, +func (p *servicePackage) SDKResources(ctx context.Context) []*types.ServicePackageSDKResource { + return []*types.ServicePackageSDKResource{ + { + Factory: ResourceClusterSnapshot, + TypeName: "aws_db_cluster_snapshot", + }, + { + Factory: ResourceEventSubscription, + TypeName: "aws_db_event_subscription", + }, + { + Factory: ResourceInstance, + TypeName: "aws_db_instance", + }, + { + Factory: ResourceInstanceAutomatedBackupsReplication, + TypeName: "aws_db_instance_automated_backups_replication", + }, + { + Factory: ResourceInstanceRoleAssociation, + TypeName: "aws_db_instance_role_association", + }, + { + Factory: ResourceOptionGroup, + TypeName: "aws_db_option_group", + }, + { + Factory: ResourceParameterGroup, + TypeName: "aws_db_parameter_group", + }, + { + Factory: ResourceProxy, + TypeName: "aws_db_proxy", + }, + { + Factory: ResourceProxyDefaultTargetGroup, + TypeName: "aws_db_proxy_default_target_group", + }, + { + Factory: ResourceProxyEndpoint, + TypeName: "aws_db_proxy_endpoint", + }, + { + Factory: ResourceProxyTarget, + TypeName: "aws_db_proxy_target", + }, + { + Factory: ResourceSecurityGroup, + TypeName: "aws_db_security_group", + }, + { + Factory: ResourceSnapshot, + TypeName: "aws_db_snapshot", + }, + { + Factory: ResourceSnapshotCopy, + TypeName: "aws_db_snapshot_copy", + }, + { + Factory: ResourceSubnetGroup, + TypeName: "aws_db_subnet_group", + }, + { + Factory: ResourceCluster, + TypeName: "aws_rds_cluster", + }, + { + Factory: ResourceClusterActivityStream, + TypeName: "aws_rds_cluster_activity_stream", + }, + { + Factory: ResourceClusterEndpoint, + TypeName: "aws_rds_cluster_endpoint", + }, + { + Factory: ResourceClusterInstance, + TypeName: "aws_rds_cluster_instance", + }, + { + Factory: ResourceClusterParameterGroup, + TypeName: "aws_rds_cluster_parameter_group", + }, + { + Factory: ResourceClusterRoleAssociation, + TypeName: "aws_rds_cluster_role_association", + }, + { + Factory: ResourceGlobalCluster, + TypeName: "aws_rds_global_cluster", + }, + { + Factory: ResourceReservedInstance, + TypeName: "aws_rds_reserved_instance", + }, } } diff --git a/internal/service/redshift/service_package_gen.go b/internal/service/redshift/service_package_gen.go index 95d9feac23ef..e6d117d4bbc7 100644 --- a/internal/service/redshift/service_package_gen.go +++ b/internal/service/redshift/service_package_gen.go @@ -5,52 +5,119 @@ package redshift import ( "context" - "github.com/hashicorp/terraform-plugin-framework/datasource" - "github.com/hashicorp/terraform-plugin-framework/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "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) []func(context.Context) (datasource.DataSourceWithConfigure, error) { - return []func(context.Context) (datasource.DataSourceWithConfigure, error){} +func (p *servicePackage) FrameworkDataSources(ctx context.Context) []*types.ServicePackageFrameworkDataSource { + return []*types.ServicePackageFrameworkDataSource{} } -func (p *servicePackage) FrameworkResources(ctx context.Context) []func(context.Context) (resource.ResourceWithConfigure, error) { - return []func(context.Context) (resource.ResourceWithConfigure, error){} +func (p *servicePackage) FrameworkResources(ctx context.Context) []*types.ServicePackageFrameworkResource { + return []*types.ServicePackageFrameworkResource{} } -func (p *servicePackage) SDKDataSources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{ - "aws_redshift_cluster": DataSourceCluster, - "aws_redshift_cluster_credentials": DataSourceClusterCredentials, - "aws_redshift_orderable_cluster": DataSourceOrderableCluster, - "aws_redshift_service_account": DataSourceServiceAccount, - "aws_redshift_subnet_group": DataSourceSubnetGroup, +func (p *servicePackage) SDKDataSources(ctx context.Context) []*types.ServicePackageSDKDataSource { + return []*types.ServicePackageSDKDataSource{ + { + Factory: DataSourceCluster, + TypeName: "aws_redshift_cluster", + }, + { + Factory: DataSourceClusterCredentials, + TypeName: "aws_redshift_cluster_credentials", + }, + { + Factory: DataSourceOrderableCluster, + TypeName: "aws_redshift_orderable_cluster", + }, + { + Factory: DataSourceServiceAccount, + TypeName: "aws_redshift_service_account", + }, + { + Factory: DataSourceSubnetGroup, + TypeName: "aws_redshift_subnet_group", + }, } } -func (p *servicePackage) SDKResources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{ - "aws_redshift_authentication_profile": ResourceAuthenticationProfile, - "aws_redshift_cluster": ResourceCluster, - "aws_redshift_cluster_iam_roles": ResourceClusterIAMRoles, - "aws_redshift_cluster_snapshot": ResourceClusterSnapshot, - "aws_redshift_endpoint_access": ResourceEndpointAccess, - "aws_redshift_endpoint_authorization": ResourceEndpointAuthorization, - "aws_redshift_event_subscription": ResourceEventSubscription, - "aws_redshift_hsm_client_certificate": ResourceHSMClientCertificate, - "aws_redshift_hsm_configuration": ResourceHSMConfiguration, - "aws_redshift_parameter_group": ResourceParameterGroup, - "aws_redshift_partner": ResourcePartner, - "aws_redshift_scheduled_action": ResourceScheduledAction, - "aws_redshift_security_group": ResourceSecurityGroup, - "aws_redshift_snapshot_copy_grant": ResourceSnapshotCopyGrant, - "aws_redshift_snapshot_schedule": ResourceSnapshotSchedule, - "aws_redshift_snapshot_schedule_association": ResourceSnapshotScheduleAssociation, - "aws_redshift_subnet_group": ResourceSubnetGroup, - "aws_redshift_usage_limit": ResourceUsageLimit, +func (p *servicePackage) SDKResources(ctx context.Context) []*types.ServicePackageSDKResource { + return []*types.ServicePackageSDKResource{ + { + Factory: ResourceAuthenticationProfile, + TypeName: "aws_redshift_authentication_profile", + }, + { + Factory: ResourceCluster, + TypeName: "aws_redshift_cluster", + }, + { + Factory: ResourceClusterIAMRoles, + TypeName: "aws_redshift_cluster_iam_roles", + }, + { + Factory: ResourceClusterSnapshot, + TypeName: "aws_redshift_cluster_snapshot", + }, + { + Factory: ResourceEndpointAccess, + TypeName: "aws_redshift_endpoint_access", + }, + { + Factory: ResourceEndpointAuthorization, + TypeName: "aws_redshift_endpoint_authorization", + }, + { + Factory: ResourceEventSubscription, + TypeName: "aws_redshift_event_subscription", + }, + { + Factory: ResourceHSMClientCertificate, + TypeName: "aws_redshift_hsm_client_certificate", + }, + { + Factory: ResourceHSMConfiguration, + TypeName: "aws_redshift_hsm_configuration", + }, + { + Factory: ResourceParameterGroup, + TypeName: "aws_redshift_parameter_group", + }, + { + Factory: ResourcePartner, + TypeName: "aws_redshift_partner", + }, + { + Factory: ResourceScheduledAction, + TypeName: "aws_redshift_scheduled_action", + }, + { + Factory: ResourceSecurityGroup, + TypeName: "aws_redshift_security_group", + }, + { + Factory: ResourceSnapshotCopyGrant, + TypeName: "aws_redshift_snapshot_copy_grant", + }, + { + Factory: ResourceSnapshotSchedule, + TypeName: "aws_redshift_snapshot_schedule", + }, + { + Factory: ResourceSnapshotScheduleAssociation, + TypeName: "aws_redshift_snapshot_schedule_association", + }, + { + Factory: ResourceSubnetGroup, + TypeName: "aws_redshift_subnet_group", + }, + { + Factory: ResourceUsageLimit, + TypeName: "aws_redshift_usage_limit", + }, } } diff --git a/internal/service/redshiftdata/service_package_gen.go b/internal/service/redshiftdata/service_package_gen.go index 1b5f3051bed3..45dc6d420bf0 100644 --- a/internal/service/redshiftdata/service_package_gen.go +++ b/internal/service/redshiftdata/service_package_gen.go @@ -5,29 +5,30 @@ package redshiftdata import ( "context" - "github.com/hashicorp/terraform-plugin-framework/datasource" - "github.com/hashicorp/terraform-plugin-framework/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "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) []func(context.Context) (datasource.DataSourceWithConfigure, error) { - return []func(context.Context) (datasource.DataSourceWithConfigure, error){} +func (p *servicePackage) FrameworkDataSources(ctx context.Context) []*types.ServicePackageFrameworkDataSource { + return []*types.ServicePackageFrameworkDataSource{} } -func (p *servicePackage) FrameworkResources(ctx context.Context) []func(context.Context) (resource.ResourceWithConfigure, error) { - return []func(context.Context) (resource.ResourceWithConfigure, error){} +func (p *servicePackage) FrameworkResources(ctx context.Context) []*types.ServicePackageFrameworkResource { + return []*types.ServicePackageFrameworkResource{} } -func (p *servicePackage) SDKDataSources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{} +func (p *servicePackage) SDKDataSources(ctx context.Context) []*types.ServicePackageSDKDataSource { + return []*types.ServicePackageSDKDataSource{} } -func (p *servicePackage) SDKResources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{ - "aws_redshiftdata_statement": ResourceStatement, +func (p *servicePackage) SDKResources(ctx context.Context) []*types.ServicePackageSDKResource { + return []*types.ServicePackageSDKResource{ + { + Factory: ResourceStatement, + TypeName: "aws_redshiftdata_statement", + }, } } diff --git a/internal/service/redshiftserverless/service_package_gen.go b/internal/service/redshiftserverless/service_package_gen.go index c19d776186d6..374bae3d859c 100644 --- a/internal/service/redshiftserverless/service_package_gen.go +++ b/internal/service/redshiftserverless/service_package_gen.go @@ -5,36 +5,55 @@ package redshiftserverless import ( "context" - "github.com/hashicorp/terraform-plugin-framework/datasource" - "github.com/hashicorp/terraform-plugin-framework/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "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) []func(context.Context) (datasource.DataSourceWithConfigure, error) { - return []func(context.Context) (datasource.DataSourceWithConfigure, error){} +func (p *servicePackage) FrameworkDataSources(ctx context.Context) []*types.ServicePackageFrameworkDataSource { + return []*types.ServicePackageFrameworkDataSource{} } -func (p *servicePackage) FrameworkResources(ctx context.Context) []func(context.Context) (resource.ResourceWithConfigure, error) { - return []func(context.Context) (resource.ResourceWithConfigure, error){} +func (p *servicePackage) FrameworkResources(ctx context.Context) []*types.ServicePackageFrameworkResource { + return []*types.ServicePackageFrameworkResource{} } -func (p *servicePackage) SDKDataSources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{ - "aws_redshiftserverless_credentials": DataSourceCredentials, +func (p *servicePackage) SDKDataSources(ctx context.Context) []*types.ServicePackageSDKDataSource { + return []*types.ServicePackageSDKDataSource{ + { + Factory: DataSourceCredentials, + TypeName: "aws_redshiftserverless_credentials", + }, } } -func (p *servicePackage) SDKResources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{ - "aws_redshiftserverless_endpoint_access": ResourceEndpointAccess, - "aws_redshiftserverless_namespace": ResourceNamespace, - "aws_redshiftserverless_resource_policy": ResourceResourcePolicy, - "aws_redshiftserverless_snapshot": ResourceSnapshot, - "aws_redshiftserverless_usage_limit": ResourceUsageLimit, - "aws_redshiftserverless_workgroup": ResourceWorkgroup, +func (p *servicePackage) SDKResources(ctx context.Context) []*types.ServicePackageSDKResource { + return []*types.ServicePackageSDKResource{ + { + Factory: ResourceEndpointAccess, + TypeName: "aws_redshiftserverless_endpoint_access", + }, + { + Factory: ResourceNamespace, + TypeName: "aws_redshiftserverless_namespace", + }, + { + Factory: ResourceResourcePolicy, + TypeName: "aws_redshiftserverless_resource_policy", + }, + { + Factory: ResourceSnapshot, + TypeName: "aws_redshiftserverless_snapshot", + }, + { + Factory: ResourceUsageLimit, + TypeName: "aws_redshiftserverless_usage_limit", + }, + { + Factory: ResourceWorkgroup, + TypeName: "aws_redshiftserverless_workgroup", + }, } } diff --git a/internal/service/resourceexplorer2/service_package_gen.go b/internal/service/resourceexplorer2/service_package_gen.go index f41a88b6f759..9562954f740b 100644 --- a/internal/service/resourceexplorer2/service_package_gen.go +++ b/internal/service/resourceexplorer2/service_package_gen.go @@ -5,31 +5,33 @@ package resourceexplorer2 import ( "context" - "github.com/hashicorp/terraform-plugin-framework/datasource" - "github.com/hashicorp/terraform-plugin-framework/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "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) []func(context.Context) (datasource.DataSourceWithConfigure, error) { - return []func(context.Context) (datasource.DataSourceWithConfigure, error){} +func (p *servicePackage) FrameworkDataSources(ctx context.Context) []*types.ServicePackageFrameworkDataSource { + return []*types.ServicePackageFrameworkDataSource{} } -func (p *servicePackage) FrameworkResources(ctx context.Context) []func(context.Context) (resource.ResourceWithConfigure, error) { - return []func(context.Context) (resource.ResourceWithConfigure, error){ - newResourceIndex, - newResourceView, +func (p *servicePackage) FrameworkResources(ctx context.Context) []*types.ServicePackageFrameworkResource { + return []*types.ServicePackageFrameworkResource{ + { + Factory: newResourceIndex, + }, + { + Factory: newResourceView, + }, } } -func (p *servicePackage) SDKDataSources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{} +func (p *servicePackage) SDKDataSources(ctx context.Context) []*types.ServicePackageSDKDataSource { + return []*types.ServicePackageSDKDataSource{} } -func (p *servicePackage) SDKResources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{} +func (p *servicePackage) SDKResources(ctx context.Context) []*types.ServicePackageSDKResource { + return []*types.ServicePackageSDKResource{} } func (p *servicePackage) ServicePackageName() string { diff --git a/internal/service/resourcegroups/service_package_gen.go b/internal/service/resourcegroups/service_package_gen.go index aedf8d157933..42a03d6c417a 100644 --- a/internal/service/resourcegroups/service_package_gen.go +++ b/internal/service/resourcegroups/service_package_gen.go @@ -5,29 +5,30 @@ package resourcegroups import ( "context" - "github.com/hashicorp/terraform-plugin-framework/datasource" - "github.com/hashicorp/terraform-plugin-framework/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "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) []func(context.Context) (datasource.DataSourceWithConfigure, error) { - return []func(context.Context) (datasource.DataSourceWithConfigure, error){} +func (p *servicePackage) FrameworkDataSources(ctx context.Context) []*types.ServicePackageFrameworkDataSource { + return []*types.ServicePackageFrameworkDataSource{} } -func (p *servicePackage) FrameworkResources(ctx context.Context) []func(context.Context) (resource.ResourceWithConfigure, error) { - return []func(context.Context) (resource.ResourceWithConfigure, error){} +func (p *servicePackage) FrameworkResources(ctx context.Context) []*types.ServicePackageFrameworkResource { + return []*types.ServicePackageFrameworkResource{} } -func (p *servicePackage) SDKDataSources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{} +func (p *servicePackage) SDKDataSources(ctx context.Context) []*types.ServicePackageSDKDataSource { + return []*types.ServicePackageSDKDataSource{} } -func (p *servicePackage) SDKResources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{ - "aws_resourcegroups_group": ResourceGroup, +func (p *servicePackage) SDKResources(ctx context.Context) []*types.ServicePackageSDKResource { + return []*types.ServicePackageSDKResource{ + { + Factory: ResourceGroup, + TypeName: "aws_resourcegroups_group", + }, } } diff --git a/internal/service/resourcegroupstaggingapi/service_package_gen.go b/internal/service/resourcegroupstaggingapi/service_package_gen.go index f30ed204b7c3..83612ec13394 100644 --- a/internal/service/resourcegroupstaggingapi/service_package_gen.go +++ b/internal/service/resourcegroupstaggingapi/service_package_gen.go @@ -5,30 +5,31 @@ package resourcegroupstaggingapi import ( "context" - "github.com/hashicorp/terraform-plugin-framework/datasource" - "github.com/hashicorp/terraform-plugin-framework/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "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) []func(context.Context) (datasource.DataSourceWithConfigure, error) { - return []func(context.Context) (datasource.DataSourceWithConfigure, error){} +func (p *servicePackage) FrameworkDataSources(ctx context.Context) []*types.ServicePackageFrameworkDataSource { + return []*types.ServicePackageFrameworkDataSource{} } -func (p *servicePackage) FrameworkResources(ctx context.Context) []func(context.Context) (resource.ResourceWithConfigure, error) { - return []func(context.Context) (resource.ResourceWithConfigure, error){} +func (p *servicePackage) FrameworkResources(ctx context.Context) []*types.ServicePackageFrameworkResource { + return []*types.ServicePackageFrameworkResource{} } -func (p *servicePackage) SDKDataSources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{ - "aws_resourcegroupstaggingapi_resources": DataSourceResources, +func (p *servicePackage) SDKDataSources(ctx context.Context) []*types.ServicePackageSDKDataSource { + return []*types.ServicePackageSDKDataSource{ + { + Factory: DataSourceResources, + TypeName: "aws_resourcegroupstaggingapi_resources", + }, } } -func (p *servicePackage) SDKResources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{} +func (p *servicePackage) SDKResources(ctx context.Context) []*types.ServicePackageSDKResource { + return []*types.ServicePackageSDKResource{} } func (p *servicePackage) ServicePackageName() string { diff --git a/internal/service/rolesanywhere/service_package_gen.go b/internal/service/rolesanywhere/service_package_gen.go index 39318ae0eb2e..a7ccbae03850 100644 --- a/internal/service/rolesanywhere/service_package_gen.go +++ b/internal/service/rolesanywhere/service_package_gen.go @@ -5,30 +5,34 @@ package rolesanywhere import ( "context" - "github.com/hashicorp/terraform-plugin-framework/datasource" - "github.com/hashicorp/terraform-plugin-framework/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "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) []func(context.Context) (datasource.DataSourceWithConfigure, error) { - return []func(context.Context) (datasource.DataSourceWithConfigure, error){} +func (p *servicePackage) FrameworkDataSources(ctx context.Context) []*types.ServicePackageFrameworkDataSource { + return []*types.ServicePackageFrameworkDataSource{} } -func (p *servicePackage) FrameworkResources(ctx context.Context) []func(context.Context) (resource.ResourceWithConfigure, error) { - return []func(context.Context) (resource.ResourceWithConfigure, error){} +func (p *servicePackage) FrameworkResources(ctx context.Context) []*types.ServicePackageFrameworkResource { + return []*types.ServicePackageFrameworkResource{} } -func (p *servicePackage) SDKDataSources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{} +func (p *servicePackage) SDKDataSources(ctx context.Context) []*types.ServicePackageSDKDataSource { + return []*types.ServicePackageSDKDataSource{} } -func (p *servicePackage) SDKResources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{ - "aws_rolesanywhere_profile": ResourceProfile, - "aws_rolesanywhere_trust_anchor": ResourceTrustAnchor, +func (p *servicePackage) SDKResources(ctx context.Context) []*types.ServicePackageSDKResource { + return []*types.ServicePackageSDKResource{ + { + Factory: ResourceProfile, + TypeName: "aws_rolesanywhere_profile", + }, + { + Factory: ResourceTrustAnchor, + TypeName: "aws_rolesanywhere_trust_anchor", + }, } } diff --git a/internal/service/route53/service_package_gen.go b/internal/service/route53/service_package_gen.go index d253451476b5..aeb1c581af02 100644 --- a/internal/service/route53/service_package_gen.go +++ b/internal/service/route53/service_package_gen.go @@ -5,46 +5,90 @@ package route53 import ( "context" - "github.com/hashicorp/terraform-plugin-framework/datasource" - "github.com/hashicorp/terraform-plugin-framework/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "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) []func(context.Context) (datasource.DataSourceWithConfigure, error) { - return []func(context.Context) (datasource.DataSourceWithConfigure, error){} +func (p *servicePackage) FrameworkDataSources(ctx context.Context) []*types.ServicePackageFrameworkDataSource { + return []*types.ServicePackageFrameworkDataSource{} } -func (p *servicePackage) FrameworkResources(ctx context.Context) []func(context.Context) (resource.ResourceWithConfigure, error) { - return []func(context.Context) (resource.ResourceWithConfigure, error){ - newResourceCIDRCollection, - newResourceCIDRLocation, +func (p *servicePackage) FrameworkResources(ctx context.Context) []*types.ServicePackageFrameworkResource { + return []*types.ServicePackageFrameworkResource{ + { + Factory: newResourceCIDRCollection, + }, + { + Factory: newResourceCIDRLocation, + }, } } -func (p *servicePackage) SDKDataSources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{ - "aws_route53_delegation_set": DataSourceDelegationSet, - "aws_route53_traffic_policy_document": DataSourceTrafficPolicyDocument, - "aws_route53_zone": DataSourceZone, +func (p *servicePackage) SDKDataSources(ctx context.Context) []*types.ServicePackageSDKDataSource { + return []*types.ServicePackageSDKDataSource{ + { + Factory: DataSourceDelegationSet, + TypeName: "aws_route53_delegation_set", + }, + { + Factory: DataSourceTrafficPolicyDocument, + TypeName: "aws_route53_traffic_policy_document", + }, + { + Factory: DataSourceZone, + TypeName: "aws_route53_zone", + }, } } -func (p *servicePackage) SDKResources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{ - "aws_route53_delegation_set": ResourceDelegationSet, - "aws_route53_health_check": ResourceHealthCheck, - "aws_route53_hosted_zone_dnssec": ResourceHostedZoneDNSSEC, - "aws_route53_key_signing_key": ResourceKeySigningKey, - "aws_route53_query_log": ResourceQueryLog, - "aws_route53_record": ResourceRecord, - "aws_route53_traffic_policy": ResourceTrafficPolicy, - "aws_route53_traffic_policy_instance": ResourceTrafficPolicyInstance, - "aws_route53_vpc_association_authorization": ResourceVPCAssociationAuthorization, - "aws_route53_zone": ResourceZone, - "aws_route53_zone_association": ResourceZoneAssociation, +func (p *servicePackage) SDKResources(ctx context.Context) []*types.ServicePackageSDKResource { + return []*types.ServicePackageSDKResource{ + { + Factory: ResourceDelegationSet, + TypeName: "aws_route53_delegation_set", + }, + { + Factory: ResourceHealthCheck, + TypeName: "aws_route53_health_check", + }, + { + Factory: ResourceHostedZoneDNSSEC, + TypeName: "aws_route53_hosted_zone_dnssec", + }, + { + Factory: ResourceKeySigningKey, + TypeName: "aws_route53_key_signing_key", + }, + { + Factory: ResourceQueryLog, + TypeName: "aws_route53_query_log", + }, + { + Factory: ResourceRecord, + TypeName: "aws_route53_record", + }, + { + Factory: ResourceTrafficPolicy, + TypeName: "aws_route53_traffic_policy", + }, + { + Factory: ResourceTrafficPolicyInstance, + TypeName: "aws_route53_traffic_policy_instance", + }, + { + Factory: ResourceVPCAssociationAuthorization, + TypeName: "aws_route53_vpc_association_authorization", + }, + { + Factory: ResourceZone, + TypeName: "aws_route53_zone", + }, + { + Factory: ResourceZoneAssociation, + TypeName: "aws_route53_zone_association", + }, } } diff --git a/internal/service/route53domains/service_package_gen.go b/internal/service/route53domains/service_package_gen.go index fb749c21ab66..22deac6dd8a0 100644 --- a/internal/service/route53domains/service_package_gen.go +++ b/internal/service/route53domains/service_package_gen.go @@ -5,29 +5,30 @@ package route53domains import ( "context" - "github.com/hashicorp/terraform-plugin-framework/datasource" - "github.com/hashicorp/terraform-plugin-framework/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "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) []func(context.Context) (datasource.DataSourceWithConfigure, error) { - return []func(context.Context) (datasource.DataSourceWithConfigure, error){} +func (p *servicePackage) FrameworkDataSources(ctx context.Context) []*types.ServicePackageFrameworkDataSource { + return []*types.ServicePackageFrameworkDataSource{} } -func (p *servicePackage) FrameworkResources(ctx context.Context) []func(context.Context) (resource.ResourceWithConfigure, error) { - return []func(context.Context) (resource.ResourceWithConfigure, error){} +func (p *servicePackage) FrameworkResources(ctx context.Context) []*types.ServicePackageFrameworkResource { + return []*types.ServicePackageFrameworkResource{} } -func (p *servicePackage) SDKDataSources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{} +func (p *servicePackage) SDKDataSources(ctx context.Context) []*types.ServicePackageSDKDataSource { + return []*types.ServicePackageSDKDataSource{} } -func (p *servicePackage) SDKResources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{ - "aws_route53domains_registered_domain": ResourceRegisteredDomain, +func (p *servicePackage) SDKResources(ctx context.Context) []*types.ServicePackageSDKResource { + return []*types.ServicePackageSDKResource{ + { + Factory: ResourceRegisteredDomain, + TypeName: "aws_route53domains_registered_domain", + }, } } diff --git a/internal/service/route53recoverycontrolconfig/service_package_gen.go b/internal/service/route53recoverycontrolconfig/service_package_gen.go index a8e81aaa9d41..3cadff05d460 100644 --- a/internal/service/route53recoverycontrolconfig/service_package_gen.go +++ b/internal/service/route53recoverycontrolconfig/service_package_gen.go @@ -5,32 +5,42 @@ package route53recoverycontrolconfig import ( "context" - "github.com/hashicorp/terraform-plugin-framework/datasource" - "github.com/hashicorp/terraform-plugin-framework/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "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) []func(context.Context) (datasource.DataSourceWithConfigure, error) { - return []func(context.Context) (datasource.DataSourceWithConfigure, error){} +func (p *servicePackage) FrameworkDataSources(ctx context.Context) []*types.ServicePackageFrameworkDataSource { + return []*types.ServicePackageFrameworkDataSource{} } -func (p *servicePackage) FrameworkResources(ctx context.Context) []func(context.Context) (resource.ResourceWithConfigure, error) { - return []func(context.Context) (resource.ResourceWithConfigure, error){} +func (p *servicePackage) FrameworkResources(ctx context.Context) []*types.ServicePackageFrameworkResource { + return []*types.ServicePackageFrameworkResource{} } -func (p *servicePackage) SDKDataSources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{} +func (p *servicePackage) SDKDataSources(ctx context.Context) []*types.ServicePackageSDKDataSource { + return []*types.ServicePackageSDKDataSource{} } -func (p *servicePackage) SDKResources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{ - "aws_route53recoverycontrolconfig_cluster": ResourceCluster, - "aws_route53recoverycontrolconfig_control_panel": ResourceControlPanel, - "aws_route53recoverycontrolconfig_routing_control": ResourceRoutingControl, - "aws_route53recoverycontrolconfig_safety_rule": ResourceSafetyRule, +func (p *servicePackage) SDKResources(ctx context.Context) []*types.ServicePackageSDKResource { + return []*types.ServicePackageSDKResource{ + { + Factory: ResourceCluster, + TypeName: "aws_route53recoverycontrolconfig_cluster", + }, + { + Factory: ResourceControlPanel, + TypeName: "aws_route53recoverycontrolconfig_control_panel", + }, + { + Factory: ResourceRoutingControl, + TypeName: "aws_route53recoverycontrolconfig_routing_control", + }, + { + Factory: ResourceSafetyRule, + TypeName: "aws_route53recoverycontrolconfig_safety_rule", + }, } } diff --git a/internal/service/route53recoveryreadiness/service_package_gen.go b/internal/service/route53recoveryreadiness/service_package_gen.go index b8aaa960bd8d..5cb5e327f642 100644 --- a/internal/service/route53recoveryreadiness/service_package_gen.go +++ b/internal/service/route53recoveryreadiness/service_package_gen.go @@ -5,32 +5,42 @@ package route53recoveryreadiness import ( "context" - "github.com/hashicorp/terraform-plugin-framework/datasource" - "github.com/hashicorp/terraform-plugin-framework/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "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) []func(context.Context) (datasource.DataSourceWithConfigure, error) { - return []func(context.Context) (datasource.DataSourceWithConfigure, error){} +func (p *servicePackage) FrameworkDataSources(ctx context.Context) []*types.ServicePackageFrameworkDataSource { + return []*types.ServicePackageFrameworkDataSource{} } -func (p *servicePackage) FrameworkResources(ctx context.Context) []func(context.Context) (resource.ResourceWithConfigure, error) { - return []func(context.Context) (resource.ResourceWithConfigure, error){} +func (p *servicePackage) FrameworkResources(ctx context.Context) []*types.ServicePackageFrameworkResource { + return []*types.ServicePackageFrameworkResource{} } -func (p *servicePackage) SDKDataSources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{} +func (p *servicePackage) SDKDataSources(ctx context.Context) []*types.ServicePackageSDKDataSource { + return []*types.ServicePackageSDKDataSource{} } -func (p *servicePackage) SDKResources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{ - "aws_route53recoveryreadiness_cell": ResourceCell, - "aws_route53recoveryreadiness_readiness_check": ResourceReadinessCheck, - "aws_route53recoveryreadiness_recovery_group": ResourceRecoveryGroup, - "aws_route53recoveryreadiness_resource_set": ResourceResourceSet, +func (p *servicePackage) SDKResources(ctx context.Context) []*types.ServicePackageSDKResource { + return []*types.ServicePackageSDKResource{ + { + Factory: ResourceCell, + TypeName: "aws_route53recoveryreadiness_cell", + }, + { + Factory: ResourceReadinessCheck, + TypeName: "aws_route53recoveryreadiness_readiness_check", + }, + { + Factory: ResourceRecoveryGroup, + TypeName: "aws_route53recoveryreadiness_recovery_group", + }, + { + Factory: ResourceResourceSet, + TypeName: "aws_route53recoveryreadiness_resource_set", + }, } } diff --git a/internal/service/route53resolver/service_package_gen.go b/internal/service/route53resolver/service_package_gen.go index 7298d2aeb60f..eeaeaa21e36d 100644 --- a/internal/service/route53resolver/service_package_gen.go +++ b/internal/service/route53resolver/service_package_gen.go @@ -5,49 +5,107 @@ package route53resolver import ( "context" - "github.com/hashicorp/terraform-plugin-framework/datasource" - "github.com/hashicorp/terraform-plugin-framework/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "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) []func(context.Context) (datasource.DataSourceWithConfigure, error) { - return []func(context.Context) (datasource.DataSourceWithConfigure, error){} +func (p *servicePackage) FrameworkDataSources(ctx context.Context) []*types.ServicePackageFrameworkDataSource { + return []*types.ServicePackageFrameworkDataSource{} } -func (p *servicePackage) FrameworkResources(ctx context.Context) []func(context.Context) (resource.ResourceWithConfigure, error) { - return []func(context.Context) (resource.ResourceWithConfigure, error){} +func (p *servicePackage) FrameworkResources(ctx context.Context) []*types.ServicePackageFrameworkResource { + return []*types.ServicePackageFrameworkResource{} } -func (p *servicePackage) SDKDataSources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{ - "aws_route53_resolver_endpoint": DataSourceEndpoint, - "aws_route53_resolver_firewall_config": DataSourceFirewallConfig, - "aws_route53_resolver_firewall_domain_list": DataSourceFirewallDomainList, - "aws_route53_resolver_firewall_rule_group": DataSourceFirewallRuleGroup, - "aws_route53_resolver_firewall_rule_group_association": DataSourceFirewallRuleGroupAssociation, - "aws_route53_resolver_firewall_rules": DataSourceResolverFirewallRules, - "aws_route53_resolver_rule": DataSourceRule, - "aws_route53_resolver_rules": DataSourceRules, +func (p *servicePackage) SDKDataSources(ctx context.Context) []*types.ServicePackageSDKDataSource { + return []*types.ServicePackageSDKDataSource{ + { + Factory: DataSourceEndpoint, + TypeName: "aws_route53_resolver_endpoint", + }, + { + Factory: DataSourceFirewallConfig, + TypeName: "aws_route53_resolver_firewall_config", + }, + { + Factory: DataSourceFirewallDomainList, + TypeName: "aws_route53_resolver_firewall_domain_list", + }, + { + Factory: DataSourceFirewallRuleGroup, + TypeName: "aws_route53_resolver_firewall_rule_group", + }, + { + Factory: DataSourceFirewallRuleGroupAssociation, + TypeName: "aws_route53_resolver_firewall_rule_group_association", + }, + { + Factory: DataSourceResolverFirewallRules, + TypeName: "aws_route53_resolver_firewall_rules", + }, + { + Factory: DataSourceRule, + TypeName: "aws_route53_resolver_rule", + }, + { + Factory: DataSourceRules, + TypeName: "aws_route53_resolver_rules", + }, } } -func (p *servicePackage) SDKResources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{ - "aws_route53_resolver_config": ResourceConfig, - "aws_route53_resolver_dnssec_config": ResourceDNSSECConfig, - "aws_route53_resolver_endpoint": ResourceEndpoint, - "aws_route53_resolver_firewall_config": ResourceFirewallConfig, - "aws_route53_resolver_firewall_domain_list": ResourceFirewallDomainList, - "aws_route53_resolver_firewall_rule": ResourceFirewallRule, - "aws_route53_resolver_firewall_rule_group": ResourceFirewallRuleGroup, - "aws_route53_resolver_firewall_rule_group_association": ResourceFirewallRuleGroupAssociation, - "aws_route53_resolver_query_log_config": ResourceQueryLogConfig, - "aws_route53_resolver_query_log_config_association": ResourceQueryLogConfigAssociation, - "aws_route53_resolver_rule": ResourceRule, - "aws_route53_resolver_rule_association": ResourceRuleAssociation, +func (p *servicePackage) SDKResources(ctx context.Context) []*types.ServicePackageSDKResource { + return []*types.ServicePackageSDKResource{ + { + Factory: ResourceConfig, + TypeName: "aws_route53_resolver_config", + }, + { + Factory: ResourceDNSSECConfig, + TypeName: "aws_route53_resolver_dnssec_config", + }, + { + Factory: ResourceEndpoint, + TypeName: "aws_route53_resolver_endpoint", + }, + { + Factory: ResourceFirewallConfig, + TypeName: "aws_route53_resolver_firewall_config", + }, + { + Factory: ResourceFirewallDomainList, + TypeName: "aws_route53_resolver_firewall_domain_list", + }, + { + Factory: ResourceFirewallRule, + TypeName: "aws_route53_resolver_firewall_rule", + }, + { + Factory: ResourceFirewallRuleGroup, + TypeName: "aws_route53_resolver_firewall_rule_group", + }, + { + Factory: ResourceFirewallRuleGroupAssociation, + TypeName: "aws_route53_resolver_firewall_rule_group_association", + }, + { + Factory: ResourceQueryLogConfig, + TypeName: "aws_route53_resolver_query_log_config", + }, + { + Factory: ResourceQueryLogConfigAssociation, + TypeName: "aws_route53_resolver_query_log_config_association", + }, + { + Factory: ResourceRule, + TypeName: "aws_route53_resolver_rule", + }, + { + Factory: ResourceRuleAssociation, + TypeName: "aws_route53_resolver_rule_association", + }, } } diff --git a/internal/service/rum/service_package_gen.go b/internal/service/rum/service_package_gen.go index 6f29be802376..db3ba32ff899 100644 --- a/internal/service/rum/service_package_gen.go +++ b/internal/service/rum/service_package_gen.go @@ -5,30 +5,34 @@ package rum import ( "context" - "github.com/hashicorp/terraform-plugin-framework/datasource" - "github.com/hashicorp/terraform-plugin-framework/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "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) []func(context.Context) (datasource.DataSourceWithConfigure, error) { - return []func(context.Context) (datasource.DataSourceWithConfigure, error){} +func (p *servicePackage) FrameworkDataSources(ctx context.Context) []*types.ServicePackageFrameworkDataSource { + return []*types.ServicePackageFrameworkDataSource{} } -func (p *servicePackage) FrameworkResources(ctx context.Context) []func(context.Context) (resource.ResourceWithConfigure, error) { - return []func(context.Context) (resource.ResourceWithConfigure, error){} +func (p *servicePackage) FrameworkResources(ctx context.Context) []*types.ServicePackageFrameworkResource { + return []*types.ServicePackageFrameworkResource{} } -func (p *servicePackage) SDKDataSources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{} +func (p *servicePackage) SDKDataSources(ctx context.Context) []*types.ServicePackageSDKDataSource { + return []*types.ServicePackageSDKDataSource{} } -func (p *servicePackage) SDKResources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{ - "aws_rum_app_monitor": ResourceAppMonitor, - "aws_rum_metrics_destination": ResourceMetricsDestination, +func (p *servicePackage) SDKResources(ctx context.Context) []*types.ServicePackageSDKResource { + return []*types.ServicePackageSDKResource{ + { + Factory: ResourceAppMonitor, + TypeName: "aws_rum_app_monitor", + }, + { + Factory: ResourceMetricsDestination, + TypeName: "aws_rum_metrics_destination", + }, } } diff --git a/internal/service/s3/service_package_gen.go b/internal/service/s3/service_package_gen.go index 22c8d2eee1e4..6e9f88a0dae3 100644 --- a/internal/service/s3/service_package_gen.go +++ b/internal/service/s3/service_package_gen.go @@ -5,59 +5,147 @@ package s3 import ( "context" - "github.com/hashicorp/terraform-plugin-framework/datasource" - "github.com/hashicorp/terraform-plugin-framework/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "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) []func(context.Context) (datasource.DataSourceWithConfigure, error) { - return []func(context.Context) (datasource.DataSourceWithConfigure, error){} +func (p *servicePackage) FrameworkDataSources(ctx context.Context) []*types.ServicePackageFrameworkDataSource { + return []*types.ServicePackageFrameworkDataSource{} } -func (p *servicePackage) FrameworkResources(ctx context.Context) []func(context.Context) (resource.ResourceWithConfigure, error) { - return []func(context.Context) (resource.ResourceWithConfigure, error){} +func (p *servicePackage) FrameworkResources(ctx context.Context) []*types.ServicePackageFrameworkResource { + return []*types.ServicePackageFrameworkResource{} } -func (p *servicePackage) SDKDataSources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{ - "aws_canonical_user_id": DataSourceCanonicalUserID, - "aws_s3_bucket": DataSourceBucket, - "aws_s3_bucket_object": DataSourceBucketObject, - "aws_s3_bucket_objects": DataSourceBucketObjects, - "aws_s3_bucket_policy": DataSourceBucketPolicy, - "aws_s3_object": DataSourceObject, - "aws_s3_objects": DataSourceObjects, +func (p *servicePackage) SDKDataSources(ctx context.Context) []*types.ServicePackageSDKDataSource { + return []*types.ServicePackageSDKDataSource{ + { + Factory: DataSourceCanonicalUserID, + TypeName: "aws_canonical_user_id", + }, + { + Factory: DataSourceBucket, + TypeName: "aws_s3_bucket", + }, + { + Factory: DataSourceBucketObject, + TypeName: "aws_s3_bucket_object", + }, + { + Factory: DataSourceBucketObjects, + TypeName: "aws_s3_bucket_objects", + }, + { + Factory: DataSourceBucketPolicy, + TypeName: "aws_s3_bucket_policy", + }, + { + Factory: DataSourceObject, + TypeName: "aws_s3_object", + }, + { + Factory: DataSourceObjects, + TypeName: "aws_s3_objects", + }, } } -func (p *servicePackage) SDKResources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{ - "aws_s3_bucket": ResourceBucket, - "aws_s3_bucket_accelerate_configuration": ResourceBucketAccelerateConfiguration, - "aws_s3_bucket_acl": ResourceBucketACL, - "aws_s3_bucket_analytics_configuration": ResourceBucketAnalyticsConfiguration, - "aws_s3_bucket_cors_configuration": ResourceBucketCorsConfiguration, - "aws_s3_bucket_intelligent_tiering_configuration": ResourceBucketIntelligentTieringConfiguration, - "aws_s3_bucket_inventory": ResourceBucketInventory, - "aws_s3_bucket_lifecycle_configuration": ResourceBucketLifecycleConfiguration, - "aws_s3_bucket_logging": ResourceBucketLogging, - "aws_s3_bucket_metric": ResourceBucketMetric, - "aws_s3_bucket_notification": ResourceBucketNotification, - "aws_s3_bucket_object": ResourceBucketObject, - "aws_s3_bucket_object_lock_configuration": ResourceBucketObjectLockConfiguration, - "aws_s3_bucket_ownership_controls": ResourceBucketOwnershipControls, - "aws_s3_bucket_policy": ResourceBucketPolicy, - "aws_s3_bucket_public_access_block": ResourceBucketPublicAccessBlock, - "aws_s3_bucket_replication_configuration": ResourceBucketReplicationConfiguration, - "aws_s3_bucket_request_payment_configuration": ResourceBucketRequestPaymentConfiguration, - "aws_s3_bucket_server_side_encryption_configuration": ResourceBucketServerSideEncryptionConfiguration, - "aws_s3_bucket_versioning": ResourceBucketVersioning, - "aws_s3_bucket_website_configuration": ResourceBucketWebsiteConfiguration, - "aws_s3_object": ResourceObject, - "aws_s3_object_copy": ResourceObjectCopy, +func (p *servicePackage) SDKResources(ctx context.Context) []*types.ServicePackageSDKResource { + return []*types.ServicePackageSDKResource{ + { + Factory: ResourceBucket, + TypeName: "aws_s3_bucket", + }, + { + Factory: ResourceBucketAccelerateConfiguration, + TypeName: "aws_s3_bucket_accelerate_configuration", + }, + { + Factory: ResourceBucketACL, + TypeName: "aws_s3_bucket_acl", + }, + { + Factory: ResourceBucketAnalyticsConfiguration, + TypeName: "aws_s3_bucket_analytics_configuration", + }, + { + Factory: ResourceBucketCorsConfiguration, + TypeName: "aws_s3_bucket_cors_configuration", + }, + { + Factory: ResourceBucketIntelligentTieringConfiguration, + TypeName: "aws_s3_bucket_intelligent_tiering_configuration", + }, + { + Factory: ResourceBucketInventory, + TypeName: "aws_s3_bucket_inventory", + }, + { + Factory: ResourceBucketLifecycleConfiguration, + TypeName: "aws_s3_bucket_lifecycle_configuration", + }, + { + Factory: ResourceBucketLogging, + TypeName: "aws_s3_bucket_logging", + }, + { + Factory: ResourceBucketMetric, + TypeName: "aws_s3_bucket_metric", + }, + { + Factory: ResourceBucketNotification, + TypeName: "aws_s3_bucket_notification", + }, + { + Factory: ResourceBucketObject, + TypeName: "aws_s3_bucket_object", + }, + { + Factory: ResourceBucketObjectLockConfiguration, + TypeName: "aws_s3_bucket_object_lock_configuration", + }, + { + Factory: ResourceBucketOwnershipControls, + TypeName: "aws_s3_bucket_ownership_controls", + }, + { + Factory: ResourceBucketPolicy, + TypeName: "aws_s3_bucket_policy", + }, + { + Factory: ResourceBucketPublicAccessBlock, + TypeName: "aws_s3_bucket_public_access_block", + }, + { + Factory: ResourceBucketReplicationConfiguration, + TypeName: "aws_s3_bucket_replication_configuration", + }, + { + Factory: ResourceBucketRequestPaymentConfiguration, + TypeName: "aws_s3_bucket_request_payment_configuration", + }, + { + Factory: ResourceBucketServerSideEncryptionConfiguration, + TypeName: "aws_s3_bucket_server_side_encryption_configuration", + }, + { + Factory: ResourceBucketVersioning, + TypeName: "aws_s3_bucket_versioning", + }, + { + Factory: ResourceBucketWebsiteConfiguration, + TypeName: "aws_s3_bucket_website_configuration", + }, + { + Factory: ResourceObject, + TypeName: "aws_s3_object", + }, + { + Factory: ResourceObjectCopy, + TypeName: "aws_s3_object_copy", + }, } } diff --git a/internal/service/s3control/service_package_gen.go b/internal/service/s3control/service_package_gen.go index 7cab449d2391..c7ff38a1a74e 100644 --- a/internal/service/s3control/service_package_gen.go +++ b/internal/service/s3control/service_package_gen.go @@ -5,42 +5,79 @@ package s3control import ( "context" - "github.com/hashicorp/terraform-plugin-framework/datasource" - "github.com/hashicorp/terraform-plugin-framework/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "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) []func(context.Context) (datasource.DataSourceWithConfigure, error) { - return []func(context.Context) (datasource.DataSourceWithConfigure, error){} +func (p *servicePackage) FrameworkDataSources(ctx context.Context) []*types.ServicePackageFrameworkDataSource { + return []*types.ServicePackageFrameworkDataSource{} } -func (p *servicePackage) FrameworkResources(ctx context.Context) []func(context.Context) (resource.ResourceWithConfigure, error) { - return []func(context.Context) (resource.ResourceWithConfigure, error){} +func (p *servicePackage) FrameworkResources(ctx context.Context) []*types.ServicePackageFrameworkResource { + return []*types.ServicePackageFrameworkResource{} } -func (p *servicePackage) SDKDataSources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{ - "aws_s3_account_public_access_block": dataSourceAccountPublicAccessBlock, - "aws_s3control_multi_region_access_point": dataSourceMultiRegionAccessPoint, +func (p *servicePackage) SDKDataSources(ctx context.Context) []*types.ServicePackageSDKDataSource { + return []*types.ServicePackageSDKDataSource{ + { + Factory: dataSourceAccountPublicAccessBlock, + TypeName: "aws_s3_account_public_access_block", + }, + { + Factory: dataSourceMultiRegionAccessPoint, + TypeName: "aws_s3control_multi_region_access_point", + }, } } -func (p *servicePackage) SDKResources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{ - "aws_s3_access_point": resourceAccessPoint, - "aws_s3_account_public_access_block": resourceAccountPublicAccessBlock, - "aws_s3control_access_point_policy": resourceAccessPointPolicy, - "aws_s3control_bucket": resourceBucket, - "aws_s3control_bucket_lifecycle_configuration": resourceBucketLifecycleConfiguration, - "aws_s3control_bucket_policy": resourceBucketPolicy, - "aws_s3control_multi_region_access_point": resourceMultiRegionAccessPoint, - "aws_s3control_multi_region_access_point_policy": resourceMultiRegionAccessPointPolicy, - "aws_s3control_object_lambda_access_point": resourceObjectLambdaAccessPoint, - "aws_s3control_object_lambda_access_point_policy": resourceObjectLambdaAccessPointPolicy, - "aws_s3control_storage_lens_configuration": resourceStorageLensConfiguration, +func (p *servicePackage) SDKResources(ctx context.Context) []*types.ServicePackageSDKResource { + return []*types.ServicePackageSDKResource{ + { + Factory: resourceAccessPoint, + TypeName: "aws_s3_access_point", + }, + { + Factory: resourceAccountPublicAccessBlock, + TypeName: "aws_s3_account_public_access_block", + }, + { + Factory: resourceAccessPointPolicy, + TypeName: "aws_s3control_access_point_policy", + }, + { + Factory: resourceBucket, + TypeName: "aws_s3control_bucket", + }, + { + Factory: resourceBucketLifecycleConfiguration, + TypeName: "aws_s3control_bucket_lifecycle_configuration", + }, + { + Factory: resourceBucketPolicy, + TypeName: "aws_s3control_bucket_policy", + }, + { + Factory: resourceMultiRegionAccessPoint, + TypeName: "aws_s3control_multi_region_access_point", + }, + { + Factory: resourceMultiRegionAccessPointPolicy, + TypeName: "aws_s3control_multi_region_access_point_policy", + }, + { + Factory: resourceObjectLambdaAccessPoint, + TypeName: "aws_s3control_object_lambda_access_point", + }, + { + Factory: resourceObjectLambdaAccessPointPolicy, + TypeName: "aws_s3control_object_lambda_access_point_policy", + }, + { + Factory: resourceStorageLensConfiguration, + TypeName: "aws_s3control_storage_lens_configuration", + }, } } diff --git a/internal/service/s3outposts/service_package_gen.go b/internal/service/s3outposts/service_package_gen.go index bc108b25020f..5ae8dc6e551f 100644 --- a/internal/service/s3outposts/service_package_gen.go +++ b/internal/service/s3outposts/service_package_gen.go @@ -5,29 +5,30 @@ package s3outposts import ( "context" - "github.com/hashicorp/terraform-plugin-framework/datasource" - "github.com/hashicorp/terraform-plugin-framework/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "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) []func(context.Context) (datasource.DataSourceWithConfigure, error) { - return []func(context.Context) (datasource.DataSourceWithConfigure, error){} +func (p *servicePackage) FrameworkDataSources(ctx context.Context) []*types.ServicePackageFrameworkDataSource { + return []*types.ServicePackageFrameworkDataSource{} } -func (p *servicePackage) FrameworkResources(ctx context.Context) []func(context.Context) (resource.ResourceWithConfigure, error) { - return []func(context.Context) (resource.ResourceWithConfigure, error){} +func (p *servicePackage) FrameworkResources(ctx context.Context) []*types.ServicePackageFrameworkResource { + return []*types.ServicePackageFrameworkResource{} } -func (p *servicePackage) SDKDataSources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{} +func (p *servicePackage) SDKDataSources(ctx context.Context) []*types.ServicePackageSDKDataSource { + return []*types.ServicePackageSDKDataSource{} } -func (p *servicePackage) SDKResources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{ - "aws_s3outposts_endpoint": ResourceEndpoint, +func (p *servicePackage) SDKResources(ctx context.Context) []*types.ServicePackageSDKResource { + return []*types.ServicePackageSDKResource{ + { + Factory: ResourceEndpoint, + TypeName: "aws_s3outposts_endpoint", + }, } } diff --git a/internal/service/sagemaker/service_package_gen.go b/internal/service/sagemaker/service_package_gen.go index 6666a6c93960..4b98471153d8 100644 --- a/internal/service/sagemaker/service_package_gen.go +++ b/internal/service/sagemaker/service_package_gen.go @@ -5,55 +5,131 @@ package sagemaker import ( "context" - "github.com/hashicorp/terraform-plugin-framework/datasource" - "github.com/hashicorp/terraform-plugin-framework/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "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) []func(context.Context) (datasource.DataSourceWithConfigure, error) { - return []func(context.Context) (datasource.DataSourceWithConfigure, error){} +func (p *servicePackage) FrameworkDataSources(ctx context.Context) []*types.ServicePackageFrameworkDataSource { + return []*types.ServicePackageFrameworkDataSource{} } -func (p *servicePackage) FrameworkResources(ctx context.Context) []func(context.Context) (resource.ResourceWithConfigure, error) { - return []func(context.Context) (resource.ResourceWithConfigure, error){} +func (p *servicePackage) FrameworkResources(ctx context.Context) []*types.ServicePackageFrameworkResource { + return []*types.ServicePackageFrameworkResource{} } -func (p *servicePackage) SDKDataSources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{ - "aws_sagemaker_prebuilt_ecr_image": DataSourcePrebuiltECRImage, +func (p *servicePackage) SDKDataSources(ctx context.Context) []*types.ServicePackageSDKDataSource { + return []*types.ServicePackageSDKDataSource{ + { + Factory: DataSourcePrebuiltECRImage, + TypeName: "aws_sagemaker_prebuilt_ecr_image", + }, } } -func (p *servicePackage) SDKResources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{ - "aws_sagemaker_app": ResourceApp, - "aws_sagemaker_app_image_config": ResourceAppImageConfig, - "aws_sagemaker_code_repository": ResourceCodeRepository, - "aws_sagemaker_device": ResourceDevice, - "aws_sagemaker_device_fleet": ResourceDeviceFleet, - "aws_sagemaker_domain": ResourceDomain, - "aws_sagemaker_endpoint": ResourceEndpoint, - "aws_sagemaker_endpoint_configuration": ResourceEndpointConfiguration, - "aws_sagemaker_feature_group": ResourceFeatureGroup, - "aws_sagemaker_flow_definition": ResourceFlowDefinition, - "aws_sagemaker_human_task_ui": ResourceHumanTaskUI, - "aws_sagemaker_image": ResourceImage, - "aws_sagemaker_image_version": ResourceImageVersion, - "aws_sagemaker_model": ResourceModel, - "aws_sagemaker_model_package_group": ResourceModelPackageGroup, - "aws_sagemaker_model_package_group_policy": ResourceModelPackageGroupPolicy, - "aws_sagemaker_notebook_instance": ResourceNotebookInstance, - "aws_sagemaker_notebook_instance_lifecycle_configuration": ResourceNotebookInstanceLifeCycleConfiguration, - "aws_sagemaker_project": ResourceProject, - "aws_sagemaker_servicecatalog_portfolio_status": ResourceServicecatalogPortfolioStatus, - "aws_sagemaker_space": ResourceSpace, - "aws_sagemaker_studio_lifecycle_config": ResourceStudioLifecycleConfig, - "aws_sagemaker_user_profile": ResourceUserProfile, - "aws_sagemaker_workforce": ResourceWorkforce, - "aws_sagemaker_workteam": ResourceWorkteam, +func (p *servicePackage) SDKResources(ctx context.Context) []*types.ServicePackageSDKResource { + return []*types.ServicePackageSDKResource{ + { + Factory: ResourceApp, + TypeName: "aws_sagemaker_app", + }, + { + Factory: ResourceAppImageConfig, + TypeName: "aws_sagemaker_app_image_config", + }, + { + Factory: ResourceCodeRepository, + TypeName: "aws_sagemaker_code_repository", + }, + { + Factory: ResourceDevice, + TypeName: "aws_sagemaker_device", + }, + { + Factory: ResourceDeviceFleet, + TypeName: "aws_sagemaker_device_fleet", + }, + { + Factory: ResourceDomain, + TypeName: "aws_sagemaker_domain", + }, + { + Factory: ResourceEndpoint, + TypeName: "aws_sagemaker_endpoint", + }, + { + Factory: ResourceEndpointConfiguration, + TypeName: "aws_sagemaker_endpoint_configuration", + }, + { + Factory: ResourceFeatureGroup, + TypeName: "aws_sagemaker_feature_group", + }, + { + Factory: ResourceFlowDefinition, + TypeName: "aws_sagemaker_flow_definition", + }, + { + Factory: ResourceHumanTaskUI, + TypeName: "aws_sagemaker_human_task_ui", + }, + { + Factory: ResourceImage, + TypeName: "aws_sagemaker_image", + }, + { + Factory: ResourceImageVersion, + TypeName: "aws_sagemaker_image_version", + }, + { + Factory: ResourceModel, + TypeName: "aws_sagemaker_model", + }, + { + Factory: ResourceModelPackageGroup, + TypeName: "aws_sagemaker_model_package_group", + }, + { + Factory: ResourceModelPackageGroupPolicy, + TypeName: "aws_sagemaker_model_package_group_policy", + }, + { + Factory: ResourceNotebookInstance, + TypeName: "aws_sagemaker_notebook_instance", + }, + { + Factory: ResourceNotebookInstanceLifeCycleConfiguration, + TypeName: "aws_sagemaker_notebook_instance_lifecycle_configuration", + }, + { + Factory: ResourceProject, + TypeName: "aws_sagemaker_project", + }, + { + Factory: ResourceServicecatalogPortfolioStatus, + TypeName: "aws_sagemaker_servicecatalog_portfolio_status", + }, + { + Factory: ResourceSpace, + TypeName: "aws_sagemaker_space", + }, + { + Factory: ResourceStudioLifecycleConfig, + TypeName: "aws_sagemaker_studio_lifecycle_config", + }, + { + Factory: ResourceUserProfile, + TypeName: "aws_sagemaker_user_profile", + }, + { + Factory: ResourceWorkforce, + TypeName: "aws_sagemaker_workforce", + }, + { + Factory: ResourceWorkteam, + TypeName: "aws_sagemaker_workteam", + }, } } diff --git a/internal/service/scheduler/service_package_gen.go b/internal/service/scheduler/service_package_gen.go index fc3bb44c7ff1..ed090aa2b584 100644 --- a/internal/service/scheduler/service_package_gen.go +++ b/internal/service/scheduler/service_package_gen.go @@ -5,30 +5,34 @@ package scheduler import ( "context" - "github.com/hashicorp/terraform-plugin-framework/datasource" - "github.com/hashicorp/terraform-plugin-framework/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "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) []func(context.Context) (datasource.DataSourceWithConfigure, error) { - return []func(context.Context) (datasource.DataSourceWithConfigure, error){} +func (p *servicePackage) FrameworkDataSources(ctx context.Context) []*types.ServicePackageFrameworkDataSource { + return []*types.ServicePackageFrameworkDataSource{} } -func (p *servicePackage) FrameworkResources(ctx context.Context) []func(context.Context) (resource.ResourceWithConfigure, error) { - return []func(context.Context) (resource.ResourceWithConfigure, error){} +func (p *servicePackage) FrameworkResources(ctx context.Context) []*types.ServicePackageFrameworkResource { + return []*types.ServicePackageFrameworkResource{} } -func (p *servicePackage) SDKDataSources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{} +func (p *servicePackage) SDKDataSources(ctx context.Context) []*types.ServicePackageSDKDataSource { + return []*types.ServicePackageSDKDataSource{} } -func (p *servicePackage) SDKResources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{ - "aws_scheduler_schedule": resourceSchedule, - "aws_scheduler_schedule_group": ResourceScheduleGroup, +func (p *servicePackage) SDKResources(ctx context.Context) []*types.ServicePackageSDKResource { + return []*types.ServicePackageSDKResource{ + { + Factory: resourceSchedule, + TypeName: "aws_scheduler_schedule", + }, + { + Factory: ResourceScheduleGroup, + TypeName: "aws_scheduler_schedule_group", + }, } } diff --git a/internal/service/schemas/service_package_gen.go b/internal/service/schemas/service_package_gen.go index 677ab55a5095..40825aa6dec7 100644 --- a/internal/service/schemas/service_package_gen.go +++ b/internal/service/schemas/service_package_gen.go @@ -5,32 +5,42 @@ package schemas import ( "context" - "github.com/hashicorp/terraform-plugin-framework/datasource" - "github.com/hashicorp/terraform-plugin-framework/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "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) []func(context.Context) (datasource.DataSourceWithConfigure, error) { - return []func(context.Context) (datasource.DataSourceWithConfigure, error){} +func (p *servicePackage) FrameworkDataSources(ctx context.Context) []*types.ServicePackageFrameworkDataSource { + return []*types.ServicePackageFrameworkDataSource{} } -func (p *servicePackage) FrameworkResources(ctx context.Context) []func(context.Context) (resource.ResourceWithConfigure, error) { - return []func(context.Context) (resource.ResourceWithConfigure, error){} +func (p *servicePackage) FrameworkResources(ctx context.Context) []*types.ServicePackageFrameworkResource { + return []*types.ServicePackageFrameworkResource{} } -func (p *servicePackage) SDKDataSources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{} +func (p *servicePackage) SDKDataSources(ctx context.Context) []*types.ServicePackageSDKDataSource { + return []*types.ServicePackageSDKDataSource{} } -func (p *servicePackage) SDKResources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{ - "aws_schemas_discoverer": ResourceDiscoverer, - "aws_schemas_registry": ResourceRegistry, - "aws_schemas_registry_policy": ResourceRegistryPolicy, - "aws_schemas_schema": ResourceSchema, +func (p *servicePackage) SDKResources(ctx context.Context) []*types.ServicePackageSDKResource { + return []*types.ServicePackageSDKResource{ + { + Factory: ResourceDiscoverer, + TypeName: "aws_schemas_discoverer", + }, + { + Factory: ResourceRegistry, + TypeName: "aws_schemas_registry", + }, + { + Factory: ResourceRegistryPolicy, + TypeName: "aws_schemas_registry_policy", + }, + { + Factory: ResourceSchema, + TypeName: "aws_schemas_schema", + }, } } diff --git a/internal/service/secretsmanager/service_package_gen.go b/internal/service/secretsmanager/service_package_gen.go index f1cb449cf2a7..6b4d680457a5 100644 --- a/internal/service/secretsmanager/service_package_gen.go +++ b/internal/service/secretsmanager/service_package_gen.go @@ -5,38 +5,63 @@ package secretsmanager import ( "context" - "github.com/hashicorp/terraform-plugin-framework/datasource" - "github.com/hashicorp/terraform-plugin-framework/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "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) []func(context.Context) (datasource.DataSourceWithConfigure, error) { - return []func(context.Context) (datasource.DataSourceWithConfigure, error){} +func (p *servicePackage) FrameworkDataSources(ctx context.Context) []*types.ServicePackageFrameworkDataSource { + return []*types.ServicePackageFrameworkDataSource{} } -func (p *servicePackage) FrameworkResources(ctx context.Context) []func(context.Context) (resource.ResourceWithConfigure, error) { - return []func(context.Context) (resource.ResourceWithConfigure, error){} +func (p *servicePackage) FrameworkResources(ctx context.Context) []*types.ServicePackageFrameworkResource { + return []*types.ServicePackageFrameworkResource{} } -func (p *servicePackage) SDKDataSources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{ - "aws_secretsmanager_random_password": DataSourceRandomPassword, - "aws_secretsmanager_secret": DataSourceSecret, - "aws_secretsmanager_secret_rotation": DataSourceSecretRotation, - "aws_secretsmanager_secret_version": DataSourceSecretVersion, - "aws_secretsmanager_secrets": DataSourceSecrets, +func (p *servicePackage) SDKDataSources(ctx context.Context) []*types.ServicePackageSDKDataSource { + return []*types.ServicePackageSDKDataSource{ + { + Factory: DataSourceRandomPassword, + TypeName: "aws_secretsmanager_random_password", + }, + { + Factory: DataSourceSecret, + TypeName: "aws_secretsmanager_secret", + }, + { + Factory: DataSourceSecretRotation, + TypeName: "aws_secretsmanager_secret_rotation", + }, + { + Factory: DataSourceSecretVersion, + TypeName: "aws_secretsmanager_secret_version", + }, + { + Factory: DataSourceSecrets, + TypeName: "aws_secretsmanager_secrets", + }, } } -func (p *servicePackage) SDKResources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{ - "aws_secretsmanager_secret": ResourceSecret, - "aws_secretsmanager_secret_policy": ResourceSecretPolicy, - "aws_secretsmanager_secret_rotation": ResourceSecretRotation, - "aws_secretsmanager_secret_version": ResourceSecretVersion, +func (p *servicePackage) SDKResources(ctx context.Context) []*types.ServicePackageSDKResource { + return []*types.ServicePackageSDKResource{ + { + Factory: ResourceSecret, + TypeName: "aws_secretsmanager_secret", + }, + { + Factory: ResourceSecretPolicy, + TypeName: "aws_secretsmanager_secret_policy", + }, + { + Factory: ResourceSecretRotation, + TypeName: "aws_secretsmanager_secret_rotation", + }, + { + Factory: ResourceSecretVersion, + TypeName: "aws_secretsmanager_secret_version", + }, } } diff --git a/internal/service/securityhub/service_package_gen.go b/internal/service/securityhub/service_package_gen.go index f64d4d62812a..08f689746419 100644 --- a/internal/service/securityhub/service_package_gen.go +++ b/internal/service/securityhub/service_package_gen.go @@ -5,39 +5,70 @@ package securityhub import ( "context" - "github.com/hashicorp/terraform-plugin-framework/datasource" - "github.com/hashicorp/terraform-plugin-framework/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "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) []func(context.Context) (datasource.DataSourceWithConfigure, error) { - return []func(context.Context) (datasource.DataSourceWithConfigure, error){} +func (p *servicePackage) FrameworkDataSources(ctx context.Context) []*types.ServicePackageFrameworkDataSource { + return []*types.ServicePackageFrameworkDataSource{} } -func (p *servicePackage) FrameworkResources(ctx context.Context) []func(context.Context) (resource.ResourceWithConfigure, error) { - return []func(context.Context) (resource.ResourceWithConfigure, error){} +func (p *servicePackage) FrameworkResources(ctx context.Context) []*types.ServicePackageFrameworkResource { + return []*types.ServicePackageFrameworkResource{} } -func (p *servicePackage) SDKDataSources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{} +func (p *servicePackage) SDKDataSources(ctx context.Context) []*types.ServicePackageSDKDataSource { + return []*types.ServicePackageSDKDataSource{} } -func (p *servicePackage) SDKResources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{ - "aws_securityhub_account": ResourceAccount, - "aws_securityhub_action_target": ResourceActionTarget, - "aws_securityhub_finding_aggregator": ResourceFindingAggregator, - "aws_securityhub_insight": ResourceInsight, - "aws_securityhub_invite_accepter": ResourceInviteAccepter, - "aws_securityhub_member": ResourceMember, - "aws_securityhub_organization_admin_account": ResourceOrganizationAdminAccount, - "aws_securityhub_organization_configuration": ResourceOrganizationConfiguration, - "aws_securityhub_product_subscription": ResourceProductSubscription, - "aws_securityhub_standards_control": ResourceStandardsControl, - "aws_securityhub_standards_subscription": ResourceStandardsSubscription, +func (p *servicePackage) SDKResources(ctx context.Context) []*types.ServicePackageSDKResource { + return []*types.ServicePackageSDKResource{ + { + Factory: ResourceAccount, + TypeName: "aws_securityhub_account", + }, + { + Factory: ResourceActionTarget, + TypeName: "aws_securityhub_action_target", + }, + { + Factory: ResourceFindingAggregator, + TypeName: "aws_securityhub_finding_aggregator", + }, + { + Factory: ResourceInsight, + TypeName: "aws_securityhub_insight", + }, + { + Factory: ResourceInviteAccepter, + TypeName: "aws_securityhub_invite_accepter", + }, + { + Factory: ResourceMember, + TypeName: "aws_securityhub_member", + }, + { + Factory: ResourceOrganizationAdminAccount, + TypeName: "aws_securityhub_organization_admin_account", + }, + { + Factory: ResourceOrganizationConfiguration, + TypeName: "aws_securityhub_organization_configuration", + }, + { + Factory: ResourceProductSubscription, + TypeName: "aws_securityhub_product_subscription", + }, + { + Factory: ResourceStandardsControl, + TypeName: "aws_securityhub_standards_control", + }, + { + Factory: ResourceStandardsSubscription, + TypeName: "aws_securityhub_standards_subscription", + }, } } diff --git a/internal/service/serverlessrepo/service_package_gen.go b/internal/service/serverlessrepo/service_package_gen.go index 52b3c51383ef..121362cf02bb 100644 --- a/internal/service/serverlessrepo/service_package_gen.go +++ b/internal/service/serverlessrepo/service_package_gen.go @@ -5,31 +5,35 @@ package serverlessrepo import ( "context" - "github.com/hashicorp/terraform-plugin-framework/datasource" - "github.com/hashicorp/terraform-plugin-framework/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "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) []func(context.Context) (datasource.DataSourceWithConfigure, error) { - return []func(context.Context) (datasource.DataSourceWithConfigure, error){} +func (p *servicePackage) FrameworkDataSources(ctx context.Context) []*types.ServicePackageFrameworkDataSource { + return []*types.ServicePackageFrameworkDataSource{} } -func (p *servicePackage) FrameworkResources(ctx context.Context) []func(context.Context) (resource.ResourceWithConfigure, error) { - return []func(context.Context) (resource.ResourceWithConfigure, error){} +func (p *servicePackage) FrameworkResources(ctx context.Context) []*types.ServicePackageFrameworkResource { + return []*types.ServicePackageFrameworkResource{} } -func (p *servicePackage) SDKDataSources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{ - "aws_serverlessapplicationrepository_application": DataSourceApplication, +func (p *servicePackage) SDKDataSources(ctx context.Context) []*types.ServicePackageSDKDataSource { + return []*types.ServicePackageSDKDataSource{ + { + Factory: DataSourceApplication, + TypeName: "aws_serverlessapplicationrepository_application", + }, } } -func (p *servicePackage) SDKResources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{ - "aws_serverlessapplicationrepository_cloudformation_stack": ResourceCloudFormationStack, +func (p *servicePackage) SDKResources(ctx context.Context) []*types.ServicePackageSDKResource { + return []*types.ServicePackageSDKResource{ + { + Factory: ResourceCloudFormationStack, + TypeName: "aws_serverlessapplicationrepository_cloudformation_stack", + }, } } diff --git a/internal/service/servicecatalog/service_package_gen.go b/internal/service/servicecatalog/service_package_gen.go index 72748c1806ac..f9ebd2907307 100644 --- a/internal/service/servicecatalog/service_package_gen.go +++ b/internal/service/servicecatalog/service_package_gen.go @@ -5,47 +5,99 @@ package servicecatalog import ( "context" - "github.com/hashicorp/terraform-plugin-framework/datasource" - "github.com/hashicorp/terraform-plugin-framework/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "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) []func(context.Context) (datasource.DataSourceWithConfigure, error) { - return []func(context.Context) (datasource.DataSourceWithConfigure, error){} +func (p *servicePackage) FrameworkDataSources(ctx context.Context) []*types.ServicePackageFrameworkDataSource { + return []*types.ServicePackageFrameworkDataSource{} } -func (p *servicePackage) FrameworkResources(ctx context.Context) []func(context.Context) (resource.ResourceWithConfigure, error) { - return []func(context.Context) (resource.ResourceWithConfigure, error){} +func (p *servicePackage) FrameworkResources(ctx context.Context) []*types.ServicePackageFrameworkResource { + return []*types.ServicePackageFrameworkResource{} } -func (p *servicePackage) SDKDataSources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{ - "aws_servicecatalog_constraint": DataSourceConstraint, - "aws_servicecatalog_launch_paths": DataSourceLaunchPaths, - "aws_servicecatalog_portfolio": DataSourcePortfolio, - "aws_servicecatalog_portfolio_constraints": DataSourcePortfolioConstraints, - "aws_servicecatalog_product": DataSourceProduct, +func (p *servicePackage) SDKDataSources(ctx context.Context) []*types.ServicePackageSDKDataSource { + return []*types.ServicePackageSDKDataSource{ + { + Factory: DataSourceConstraint, + TypeName: "aws_servicecatalog_constraint", + }, + { + Factory: DataSourceLaunchPaths, + TypeName: "aws_servicecatalog_launch_paths", + }, + { + Factory: DataSourcePortfolio, + TypeName: "aws_servicecatalog_portfolio", + }, + { + Factory: DataSourcePortfolioConstraints, + TypeName: "aws_servicecatalog_portfolio_constraints", + }, + { + Factory: DataSourceProduct, + TypeName: "aws_servicecatalog_product", + }, } } -func (p *servicePackage) SDKResources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{ - "aws_servicecatalog_budget_resource_association": ResourceBudgetResourceAssociation, - "aws_servicecatalog_constraint": ResourceConstraint, - "aws_servicecatalog_organizations_access": ResourceOrganizationsAccess, - "aws_servicecatalog_portfolio": ResourcePortfolio, - "aws_servicecatalog_portfolio_share": ResourcePortfolioShare, - "aws_servicecatalog_principal_portfolio_association": ResourcePrincipalPortfolioAssociation, - "aws_servicecatalog_product": ResourceProduct, - "aws_servicecatalog_product_portfolio_association": ResourceProductPortfolioAssociation, - "aws_servicecatalog_provisioned_product": ResourceProvisionedProduct, - "aws_servicecatalog_provisioning_artifact": ResourceProvisioningArtifact, - "aws_servicecatalog_service_action": ResourceServiceAction, - "aws_servicecatalog_tag_option": ResourceTagOption, - "aws_servicecatalog_tag_option_resource_association": ResourceTagOptionResourceAssociation, +func (p *servicePackage) SDKResources(ctx context.Context) []*types.ServicePackageSDKResource { + return []*types.ServicePackageSDKResource{ + { + Factory: ResourceBudgetResourceAssociation, + TypeName: "aws_servicecatalog_budget_resource_association", + }, + { + Factory: ResourceConstraint, + TypeName: "aws_servicecatalog_constraint", + }, + { + Factory: ResourceOrganizationsAccess, + TypeName: "aws_servicecatalog_organizations_access", + }, + { + Factory: ResourcePortfolio, + TypeName: "aws_servicecatalog_portfolio", + }, + { + Factory: ResourcePortfolioShare, + TypeName: "aws_servicecatalog_portfolio_share", + }, + { + Factory: ResourcePrincipalPortfolioAssociation, + TypeName: "aws_servicecatalog_principal_portfolio_association", + }, + { + Factory: ResourceProduct, + TypeName: "aws_servicecatalog_product", + }, + { + Factory: ResourceProductPortfolioAssociation, + TypeName: "aws_servicecatalog_product_portfolio_association", + }, + { + Factory: ResourceProvisionedProduct, + TypeName: "aws_servicecatalog_provisioned_product", + }, + { + Factory: ResourceProvisioningArtifact, + TypeName: "aws_servicecatalog_provisioning_artifact", + }, + { + Factory: ResourceServiceAction, + TypeName: "aws_servicecatalog_service_action", + }, + { + Factory: ResourceTagOption, + TypeName: "aws_servicecatalog_tag_option", + }, + { + Factory: ResourceTagOptionResourceAssociation, + TypeName: "aws_servicecatalog_tag_option_resource_association", + }, } } diff --git a/internal/service/servicediscovery/service_package_gen.go b/internal/service/servicediscovery/service_package_gen.go index 5b337e57b943..c8465eb99ddb 100644 --- a/internal/service/servicediscovery/service_package_gen.go +++ b/internal/service/servicediscovery/service_package_gen.go @@ -5,37 +5,59 @@ package servicediscovery import ( "context" - "github.com/hashicorp/terraform-plugin-framework/datasource" - "github.com/hashicorp/terraform-plugin-framework/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "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) []func(context.Context) (datasource.DataSourceWithConfigure, error) { - return []func(context.Context) (datasource.DataSourceWithConfigure, error){} +func (p *servicePackage) FrameworkDataSources(ctx context.Context) []*types.ServicePackageFrameworkDataSource { + return []*types.ServicePackageFrameworkDataSource{} } -func (p *servicePackage) FrameworkResources(ctx context.Context) []func(context.Context) (resource.ResourceWithConfigure, error) { - return []func(context.Context) (resource.ResourceWithConfigure, error){} +func (p *servicePackage) FrameworkResources(ctx context.Context) []*types.ServicePackageFrameworkResource { + return []*types.ServicePackageFrameworkResource{} } -func (p *servicePackage) SDKDataSources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{ - "aws_service_discovery_dns_namespace": DataSourceDNSNamespace, - "aws_service_discovery_http_namespace": DataSourceHTTPNamespace, - "aws_service_discovery_service": DataSourceService, +func (p *servicePackage) SDKDataSources(ctx context.Context) []*types.ServicePackageSDKDataSource { + return []*types.ServicePackageSDKDataSource{ + { + Factory: DataSourceDNSNamespace, + TypeName: "aws_service_discovery_dns_namespace", + }, + { + Factory: DataSourceHTTPNamespace, + TypeName: "aws_service_discovery_http_namespace", + }, + { + Factory: DataSourceService, + TypeName: "aws_service_discovery_service", + }, } } -func (p *servicePackage) SDKResources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{ - "aws_service_discovery_http_namespace": ResourceHTTPNamespace, - "aws_service_discovery_instance": ResourceInstance, - "aws_service_discovery_private_dns_namespace": ResourcePrivateDNSNamespace, - "aws_service_discovery_public_dns_namespace": ResourcePublicDNSNamespace, - "aws_service_discovery_service": ResourceService, +func (p *servicePackage) SDKResources(ctx context.Context) []*types.ServicePackageSDKResource { + return []*types.ServicePackageSDKResource{ + { + Factory: ResourceHTTPNamespace, + TypeName: "aws_service_discovery_http_namespace", + }, + { + Factory: ResourceInstance, + TypeName: "aws_service_discovery_instance", + }, + { + Factory: ResourcePrivateDNSNamespace, + TypeName: "aws_service_discovery_private_dns_namespace", + }, + { + Factory: ResourcePublicDNSNamespace, + TypeName: "aws_service_discovery_public_dns_namespace", + }, + { + Factory: ResourceService, + TypeName: "aws_service_discovery_service", + }, } } diff --git a/internal/service/servicequotas/service_package_gen.go b/internal/service/servicequotas/service_package_gen.go index e54f60f4f91b..3816ba05da23 100644 --- a/internal/service/servicequotas/service_package_gen.go +++ b/internal/service/servicequotas/service_package_gen.go @@ -5,32 +5,39 @@ package servicequotas import ( "context" - "github.com/hashicorp/terraform-plugin-framework/datasource" - "github.com/hashicorp/terraform-plugin-framework/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "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) []func(context.Context) (datasource.DataSourceWithConfigure, error) { - return []func(context.Context) (datasource.DataSourceWithConfigure, error){} +func (p *servicePackage) FrameworkDataSources(ctx context.Context) []*types.ServicePackageFrameworkDataSource { + return []*types.ServicePackageFrameworkDataSource{} } -func (p *servicePackage) FrameworkResources(ctx context.Context) []func(context.Context) (resource.ResourceWithConfigure, error) { - return []func(context.Context) (resource.ResourceWithConfigure, error){} +func (p *servicePackage) FrameworkResources(ctx context.Context) []*types.ServicePackageFrameworkResource { + return []*types.ServicePackageFrameworkResource{} } -func (p *servicePackage) SDKDataSources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{ - "aws_servicequotas_service": DataSourceService, - "aws_servicequotas_service_quota": DataSourceServiceQuota, +func (p *servicePackage) SDKDataSources(ctx context.Context) []*types.ServicePackageSDKDataSource { + return []*types.ServicePackageSDKDataSource{ + { + Factory: DataSourceService, + TypeName: "aws_servicequotas_service", + }, + { + Factory: DataSourceServiceQuota, + TypeName: "aws_servicequotas_service_quota", + }, } } -func (p *servicePackage) SDKResources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{ - "aws_servicequotas_service_quota": ResourceServiceQuota, +func (p *servicePackage) SDKResources(ctx context.Context) []*types.ServicePackageSDKResource { + return []*types.ServicePackageSDKResource{ + { + Factory: ResourceServiceQuota, + TypeName: "aws_servicequotas_service_quota", + }, } } diff --git a/internal/service/ses/service_package_gen.go b/internal/service/ses/service_package_gen.go index a232c0426184..7f98247ac514 100644 --- a/internal/service/ses/service_package_gen.go +++ b/internal/service/ses/service_package_gen.go @@ -5,46 +5,95 @@ package ses import ( "context" - "github.com/hashicorp/terraform-plugin-framework/datasource" - "github.com/hashicorp/terraform-plugin-framework/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "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) []func(context.Context) (datasource.DataSourceWithConfigure, error) { - return []func(context.Context) (datasource.DataSourceWithConfigure, error){} +func (p *servicePackage) FrameworkDataSources(ctx context.Context) []*types.ServicePackageFrameworkDataSource { + return []*types.ServicePackageFrameworkDataSource{} } -func (p *servicePackage) FrameworkResources(ctx context.Context) []func(context.Context) (resource.ResourceWithConfigure, error) { - return []func(context.Context) (resource.ResourceWithConfigure, error){} +func (p *servicePackage) FrameworkResources(ctx context.Context) []*types.ServicePackageFrameworkResource { + return []*types.ServicePackageFrameworkResource{} } -func (p *servicePackage) SDKDataSources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{ - "aws_ses_active_receipt_rule_set": DataSourceActiveReceiptRuleSet, - "aws_ses_domain_identity": DataSourceDomainIdentity, - "aws_ses_email_identity": DataSourceEmailIdentity, +func (p *servicePackage) SDKDataSources(ctx context.Context) []*types.ServicePackageSDKDataSource { + return []*types.ServicePackageSDKDataSource{ + { + Factory: DataSourceActiveReceiptRuleSet, + TypeName: "aws_ses_active_receipt_rule_set", + }, + { + Factory: DataSourceDomainIdentity, + TypeName: "aws_ses_domain_identity", + }, + { + Factory: DataSourceEmailIdentity, + TypeName: "aws_ses_email_identity", + }, } } -func (p *servicePackage) SDKResources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{ - "aws_ses_active_receipt_rule_set": ResourceActiveReceiptRuleSet, - "aws_ses_configuration_set": ResourceConfigurationSet, - "aws_ses_domain_dkim": ResourceDomainDKIM, - "aws_ses_domain_identity": ResourceDomainIdentity, - "aws_ses_domain_identity_verification": ResourceDomainIdentityVerification, - "aws_ses_domain_mail_from": ResourceDomainMailFrom, - "aws_ses_email_identity": ResourceEmailIdentity, - "aws_ses_event_destination": ResourceEventDestination, - "aws_ses_identity_notification_topic": ResourceIdentityNotificationTopic, - "aws_ses_identity_policy": ResourceIdentityPolicy, - "aws_ses_receipt_filter": ResourceReceiptFilter, - "aws_ses_receipt_rule": ResourceReceiptRule, - "aws_ses_receipt_rule_set": ResourceReceiptRuleSet, - "aws_ses_template": ResourceTemplate, +func (p *servicePackage) SDKResources(ctx context.Context) []*types.ServicePackageSDKResource { + return []*types.ServicePackageSDKResource{ + { + Factory: ResourceActiveReceiptRuleSet, + TypeName: "aws_ses_active_receipt_rule_set", + }, + { + Factory: ResourceConfigurationSet, + TypeName: "aws_ses_configuration_set", + }, + { + Factory: ResourceDomainDKIM, + TypeName: "aws_ses_domain_dkim", + }, + { + Factory: ResourceDomainIdentity, + TypeName: "aws_ses_domain_identity", + }, + { + Factory: ResourceDomainIdentityVerification, + TypeName: "aws_ses_domain_identity_verification", + }, + { + Factory: ResourceDomainMailFrom, + TypeName: "aws_ses_domain_mail_from", + }, + { + Factory: ResourceEmailIdentity, + TypeName: "aws_ses_email_identity", + }, + { + Factory: ResourceEventDestination, + TypeName: "aws_ses_event_destination", + }, + { + Factory: ResourceIdentityNotificationTopic, + TypeName: "aws_ses_identity_notification_topic", + }, + { + Factory: ResourceIdentityPolicy, + TypeName: "aws_ses_identity_policy", + }, + { + Factory: ResourceReceiptFilter, + TypeName: "aws_ses_receipt_filter", + }, + { + Factory: ResourceReceiptRule, + TypeName: "aws_ses_receipt_rule", + }, + { + Factory: ResourceReceiptRuleSet, + TypeName: "aws_ses_receipt_rule_set", + }, + { + Factory: ResourceTemplate, + TypeName: "aws_ses_template", + }, } } diff --git a/internal/service/sesv2/service_package_gen.go b/internal/service/sesv2/service_package_gen.go index 506efd9839cd..990222d51a91 100644 --- a/internal/service/sesv2/service_package_gen.go +++ b/internal/service/sesv2/service_package_gen.go @@ -5,37 +5,59 @@ package sesv2 import ( "context" - "github.com/hashicorp/terraform-plugin-framework/datasource" - "github.com/hashicorp/terraform-plugin-framework/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "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) []func(context.Context) (datasource.DataSourceWithConfigure, error) { - return []func(context.Context) (datasource.DataSourceWithConfigure, error){} +func (p *servicePackage) FrameworkDataSources(ctx context.Context) []*types.ServicePackageFrameworkDataSource { + return []*types.ServicePackageFrameworkDataSource{} } -func (p *servicePackage) FrameworkResources(ctx context.Context) []func(context.Context) (resource.ResourceWithConfigure, error) { - return []func(context.Context) (resource.ResourceWithConfigure, error){} +func (p *servicePackage) FrameworkResources(ctx context.Context) []*types.ServicePackageFrameworkResource { + return []*types.ServicePackageFrameworkResource{} } -func (p *servicePackage) SDKDataSources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{ - "aws_sesv2_dedicated_ip_pool": DataSourceDedicatedIPPool, +func (p *servicePackage) SDKDataSources(ctx context.Context) []*types.ServicePackageSDKDataSource { + return []*types.ServicePackageSDKDataSource{ + { + Factory: DataSourceDedicatedIPPool, + TypeName: "aws_sesv2_dedicated_ip_pool", + }, } } -func (p *servicePackage) SDKResources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{ - "aws_sesv2_configuration_set": ResourceConfigurationSet, - "aws_sesv2_configuration_set_event_destination": ResourceConfigurationSetEventDestination, - "aws_sesv2_dedicated_ip_assignment": ResourceDedicatedIPAssignment, - "aws_sesv2_dedicated_ip_pool": ResourceDedicatedIPPool, - "aws_sesv2_email_identity": ResourceEmailIdentity, - "aws_sesv2_email_identity_feedback_attributes": ResourceEmailIdentityFeedbackAttributes, - "aws_sesv2_email_identity_mail_from_attributes": ResourceEmailIdentityMailFromAttributes, +func (p *servicePackage) SDKResources(ctx context.Context) []*types.ServicePackageSDKResource { + return []*types.ServicePackageSDKResource{ + { + Factory: ResourceConfigurationSet, + TypeName: "aws_sesv2_configuration_set", + }, + { + Factory: ResourceConfigurationSetEventDestination, + TypeName: "aws_sesv2_configuration_set_event_destination", + }, + { + Factory: ResourceDedicatedIPAssignment, + TypeName: "aws_sesv2_dedicated_ip_assignment", + }, + { + Factory: ResourceDedicatedIPPool, + TypeName: "aws_sesv2_dedicated_ip_pool", + }, + { + Factory: ResourceEmailIdentity, + TypeName: "aws_sesv2_email_identity", + }, + { + Factory: ResourceEmailIdentityFeedbackAttributes, + TypeName: "aws_sesv2_email_identity_feedback_attributes", + }, + { + Factory: ResourceEmailIdentityMailFromAttributes, + TypeName: "aws_sesv2_email_identity_mail_from_attributes", + }, } } diff --git a/internal/service/sfn/service_package_gen.go b/internal/service/sfn/service_package_gen.go index e6dcc358e05f..9581f0c2941c 100644 --- a/internal/service/sfn/service_package_gen.go +++ b/internal/service/sfn/service_package_gen.go @@ -5,33 +5,43 @@ package sfn import ( "context" - "github.com/hashicorp/terraform-plugin-framework/datasource" - "github.com/hashicorp/terraform-plugin-framework/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "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) []func(context.Context) (datasource.DataSourceWithConfigure, error) { - return []func(context.Context) (datasource.DataSourceWithConfigure, error){} +func (p *servicePackage) FrameworkDataSources(ctx context.Context) []*types.ServicePackageFrameworkDataSource { + return []*types.ServicePackageFrameworkDataSource{} } -func (p *servicePackage) FrameworkResources(ctx context.Context) []func(context.Context) (resource.ResourceWithConfigure, error) { - return []func(context.Context) (resource.ResourceWithConfigure, error){} +func (p *servicePackage) FrameworkResources(ctx context.Context) []*types.ServicePackageFrameworkResource { + return []*types.ServicePackageFrameworkResource{} } -func (p *servicePackage) SDKDataSources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{ - "aws_sfn_activity": DataSourceActivity, - "aws_sfn_state_machine": DataSourceStateMachine, +func (p *servicePackage) SDKDataSources(ctx context.Context) []*types.ServicePackageSDKDataSource { + return []*types.ServicePackageSDKDataSource{ + { + Factory: DataSourceActivity, + TypeName: "aws_sfn_activity", + }, + { + Factory: DataSourceStateMachine, + TypeName: "aws_sfn_state_machine", + }, } } -func (p *servicePackage) SDKResources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{ - "aws_sfn_activity": ResourceActivity, - "aws_sfn_state_machine": ResourceStateMachine, +func (p *servicePackage) SDKResources(ctx context.Context) []*types.ServicePackageSDKResource { + return []*types.ServicePackageSDKResource{ + { + Factory: ResourceActivity, + TypeName: "aws_sfn_activity", + }, + { + Factory: ResourceStateMachine, + TypeName: "aws_sfn_state_machine", + }, } } diff --git a/internal/service/shield/service_package_gen.go b/internal/service/shield/service_package_gen.go index 89cfc0279aaa..3bdb759c4d4c 100644 --- a/internal/service/shield/service_package_gen.go +++ b/internal/service/shield/service_package_gen.go @@ -5,31 +5,38 @@ package shield import ( "context" - "github.com/hashicorp/terraform-plugin-framework/datasource" - "github.com/hashicorp/terraform-plugin-framework/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "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) []func(context.Context) (datasource.DataSourceWithConfigure, error) { - return []func(context.Context) (datasource.DataSourceWithConfigure, error){} +func (p *servicePackage) FrameworkDataSources(ctx context.Context) []*types.ServicePackageFrameworkDataSource { + return []*types.ServicePackageFrameworkDataSource{} } -func (p *servicePackage) FrameworkResources(ctx context.Context) []func(context.Context) (resource.ResourceWithConfigure, error) { - return []func(context.Context) (resource.ResourceWithConfigure, error){} +func (p *servicePackage) FrameworkResources(ctx context.Context) []*types.ServicePackageFrameworkResource { + return []*types.ServicePackageFrameworkResource{} } -func (p *servicePackage) SDKDataSources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{} +func (p *servicePackage) SDKDataSources(ctx context.Context) []*types.ServicePackageSDKDataSource { + return []*types.ServicePackageSDKDataSource{} } -func (p *servicePackage) SDKResources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{ - "aws_shield_protection": ResourceProtection, - "aws_shield_protection_group": ResourceProtectionGroup, - "aws_shield_protection_health_check_association": ResourceProtectionHealthCheckAssociation, +func (p *servicePackage) SDKResources(ctx context.Context) []*types.ServicePackageSDKResource { + return []*types.ServicePackageSDKResource{ + { + Factory: ResourceProtection, + TypeName: "aws_shield_protection", + }, + { + Factory: ResourceProtectionGroup, + TypeName: "aws_shield_protection_group", + }, + { + Factory: ResourceProtectionHealthCheckAssociation, + TypeName: "aws_shield_protection_health_check_association", + }, } } diff --git a/internal/service/signer/service_package_gen.go b/internal/service/signer/service_package_gen.go index 6eefb1e97835..e6b0501560be 100644 --- a/internal/service/signer/service_package_gen.go +++ b/internal/service/signer/service_package_gen.go @@ -5,34 +5,47 @@ package signer import ( "context" - "github.com/hashicorp/terraform-plugin-framework/datasource" - "github.com/hashicorp/terraform-plugin-framework/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "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) []func(context.Context) (datasource.DataSourceWithConfigure, error) { - return []func(context.Context) (datasource.DataSourceWithConfigure, error){} +func (p *servicePackage) FrameworkDataSources(ctx context.Context) []*types.ServicePackageFrameworkDataSource { + return []*types.ServicePackageFrameworkDataSource{} } -func (p *servicePackage) FrameworkResources(ctx context.Context) []func(context.Context) (resource.ResourceWithConfigure, error) { - return []func(context.Context) (resource.ResourceWithConfigure, error){} +func (p *servicePackage) FrameworkResources(ctx context.Context) []*types.ServicePackageFrameworkResource { + return []*types.ServicePackageFrameworkResource{} } -func (p *servicePackage) SDKDataSources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{ - "aws_signer_signing_job": DataSourceSigningJob, - "aws_signer_signing_profile": DataSourceSigningProfile, +func (p *servicePackage) SDKDataSources(ctx context.Context) []*types.ServicePackageSDKDataSource { + return []*types.ServicePackageSDKDataSource{ + { + Factory: DataSourceSigningJob, + TypeName: "aws_signer_signing_job", + }, + { + Factory: DataSourceSigningProfile, + TypeName: "aws_signer_signing_profile", + }, } } -func (p *servicePackage) SDKResources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{ - "aws_signer_signing_job": ResourceSigningJob, - "aws_signer_signing_profile": ResourceSigningProfile, - "aws_signer_signing_profile_permission": ResourceSigningProfilePermission, +func (p *servicePackage) SDKResources(ctx context.Context) []*types.ServicePackageSDKResource { + return []*types.ServicePackageSDKResource{ + { + Factory: ResourceSigningJob, + TypeName: "aws_signer_signing_job", + }, + { + Factory: ResourceSigningProfile, + TypeName: "aws_signer_signing_profile", + }, + { + Factory: ResourceSigningProfilePermission, + TypeName: "aws_signer_signing_profile_permission", + }, } } diff --git a/internal/service/simpledb/service_package_gen.go b/internal/service/simpledb/service_package_gen.go index 38eaf55e1e3d..78faa16465de 100644 --- a/internal/service/simpledb/service_package_gen.go +++ b/internal/service/simpledb/service_package_gen.go @@ -5,30 +5,30 @@ package simpledb import ( "context" - "github.com/hashicorp/terraform-plugin-framework/datasource" - "github.com/hashicorp/terraform-plugin-framework/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "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) []func(context.Context) (datasource.DataSourceWithConfigure, error) { - return []func(context.Context) (datasource.DataSourceWithConfigure, error){} +func (p *servicePackage) FrameworkDataSources(ctx context.Context) []*types.ServicePackageFrameworkDataSource { + return []*types.ServicePackageFrameworkDataSource{} } -func (p *servicePackage) FrameworkResources(ctx context.Context) []func(context.Context) (resource.ResourceWithConfigure, error) { - return []func(context.Context) (resource.ResourceWithConfigure, error){ - newResourceDomain, +func (p *servicePackage) FrameworkResources(ctx context.Context) []*types.ServicePackageFrameworkResource { + return []*types.ServicePackageFrameworkResource{ + { + Factory: newResourceDomain, + }, } } -func (p *servicePackage) SDKDataSources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{} +func (p *servicePackage) SDKDataSources(ctx context.Context) []*types.ServicePackageSDKDataSource { + return []*types.ServicePackageSDKDataSource{} } -func (p *servicePackage) SDKResources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{} +func (p *servicePackage) SDKResources(ctx context.Context) []*types.ServicePackageSDKResource { + return []*types.ServicePackageSDKResource{} } func (p *servicePackage) ServicePackageName() string { diff --git a/internal/service/sns/service_package_gen.go b/internal/service/sns/service_package_gen.go index 732a4d5388ee..d84a0c23c828 100644 --- a/internal/service/sns/service_package_gen.go +++ b/internal/service/sns/service_package_gen.go @@ -5,35 +5,51 @@ package sns import ( "context" - "github.com/hashicorp/terraform-plugin-framework/datasource" - "github.com/hashicorp/terraform-plugin-framework/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "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) []func(context.Context) (datasource.DataSourceWithConfigure, error) { - return []func(context.Context) (datasource.DataSourceWithConfigure, error){} +func (p *servicePackage) FrameworkDataSources(ctx context.Context) []*types.ServicePackageFrameworkDataSource { + return []*types.ServicePackageFrameworkDataSource{} } -func (p *servicePackage) FrameworkResources(ctx context.Context) []func(context.Context) (resource.ResourceWithConfigure, error) { - return []func(context.Context) (resource.ResourceWithConfigure, error){} +func (p *servicePackage) FrameworkResources(ctx context.Context) []*types.ServicePackageFrameworkResource { + return []*types.ServicePackageFrameworkResource{} } -func (p *servicePackage) SDKDataSources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{ - "aws_sns_topic": DataSourceTopic, +func (p *servicePackage) SDKDataSources(ctx context.Context) []*types.ServicePackageSDKDataSource { + return []*types.ServicePackageSDKDataSource{ + { + Factory: DataSourceTopic, + TypeName: "aws_sns_topic", + }, } } -func (p *servicePackage) SDKResources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{ - "aws_sns_platform_application": ResourcePlatformApplication, - "aws_sns_sms_preferences": ResourceSMSPreferences, - "aws_sns_topic": ResourceTopic, - "aws_sns_topic_policy": ResourceTopicPolicy, - "aws_sns_topic_subscription": ResourceTopicSubscription, +func (p *servicePackage) SDKResources(ctx context.Context) []*types.ServicePackageSDKResource { + return []*types.ServicePackageSDKResource{ + { + Factory: ResourcePlatformApplication, + TypeName: "aws_sns_platform_application", + }, + { + Factory: ResourceSMSPreferences, + TypeName: "aws_sns_sms_preferences", + }, + { + Factory: ResourceTopic, + TypeName: "aws_sns_topic", + }, + { + Factory: ResourceTopicPolicy, + TypeName: "aws_sns_topic_policy", + }, + { + Factory: ResourceTopicSubscription, + TypeName: "aws_sns_topic_subscription", + }, } } diff --git a/internal/service/sqs/service_package_gen.go b/internal/service/sqs/service_package_gen.go index 25e97622b1b7..e20d7dc37983 100644 --- a/internal/service/sqs/service_package_gen.go +++ b/internal/service/sqs/service_package_gen.go @@ -5,35 +5,51 @@ package sqs import ( "context" - "github.com/hashicorp/terraform-plugin-framework/datasource" - "github.com/hashicorp/terraform-plugin-framework/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "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) []func(context.Context) (datasource.DataSourceWithConfigure, error) { - return []func(context.Context) (datasource.DataSourceWithConfigure, error){} +func (p *servicePackage) FrameworkDataSources(ctx context.Context) []*types.ServicePackageFrameworkDataSource { + return []*types.ServicePackageFrameworkDataSource{} } -func (p *servicePackage) FrameworkResources(ctx context.Context) []func(context.Context) (resource.ResourceWithConfigure, error) { - return []func(context.Context) (resource.ResourceWithConfigure, error){} +func (p *servicePackage) FrameworkResources(ctx context.Context) []*types.ServicePackageFrameworkResource { + return []*types.ServicePackageFrameworkResource{} } -func (p *servicePackage) SDKDataSources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{ - "aws_sqs_queue": DataSourceQueue, - "aws_sqs_queues": DataSourceQueues, +func (p *servicePackage) SDKDataSources(ctx context.Context) []*types.ServicePackageSDKDataSource { + return []*types.ServicePackageSDKDataSource{ + { + Factory: DataSourceQueue, + TypeName: "aws_sqs_queue", + }, + { + Factory: DataSourceQueues, + TypeName: "aws_sqs_queues", + }, } } -func (p *servicePackage) SDKResources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{ - "aws_sqs_queue": ResourceQueue, - "aws_sqs_queue_policy": ResourceQueuePolicy, - "aws_sqs_queue_redrive_allow_policy": ResourceQueueRedriveAllowPolicy, - "aws_sqs_queue_redrive_policy": ResourceQueueRedrivePolicy, +func (p *servicePackage) SDKResources(ctx context.Context) []*types.ServicePackageSDKResource { + return []*types.ServicePackageSDKResource{ + { + Factory: ResourceQueue, + TypeName: "aws_sqs_queue", + }, + { + Factory: ResourceQueuePolicy, + TypeName: "aws_sqs_queue_policy", + }, + { + Factory: ResourceQueueRedriveAllowPolicy, + TypeName: "aws_sqs_queue_redrive_allow_policy", + }, + { + Factory: ResourceQueueRedrivePolicy, + TypeName: "aws_sqs_queue_redrive_policy", + }, } } diff --git a/internal/service/ssm/service_package_gen.go b/internal/service/ssm/service_package_gen.go index 170faaa754f5..e0571f97e76e 100644 --- a/internal/service/ssm/service_package_gen.go +++ b/internal/service/ssm/service_package_gen.go @@ -5,47 +5,99 @@ package ssm import ( "context" - "github.com/hashicorp/terraform-plugin-framework/datasource" - "github.com/hashicorp/terraform-plugin-framework/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "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) []func(context.Context) (datasource.DataSourceWithConfigure, error) { - return []func(context.Context) (datasource.DataSourceWithConfigure, error){} +func (p *servicePackage) FrameworkDataSources(ctx context.Context) []*types.ServicePackageFrameworkDataSource { + return []*types.ServicePackageFrameworkDataSource{} } -func (p *servicePackage) FrameworkResources(ctx context.Context) []func(context.Context) (resource.ResourceWithConfigure, error) { - return []func(context.Context) (resource.ResourceWithConfigure, error){} +func (p *servicePackage) FrameworkResources(ctx context.Context) []*types.ServicePackageFrameworkResource { + return []*types.ServicePackageFrameworkResource{} } -func (p *servicePackage) SDKDataSources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{ - "aws_ssm_document": DataSourceDocument, - "aws_ssm_instances": DataSourceInstances, - "aws_ssm_maintenance_windows": DataSourceMaintenanceWindows, - "aws_ssm_parameter": DataSourceParameter, - "aws_ssm_parameters_by_path": DataSourceParametersByPath, - "aws_ssm_patch_baseline": DataSourcePatchBaseline, +func (p *servicePackage) SDKDataSources(ctx context.Context) []*types.ServicePackageSDKDataSource { + return []*types.ServicePackageSDKDataSource{ + { + Factory: DataSourceDocument, + TypeName: "aws_ssm_document", + }, + { + Factory: DataSourceInstances, + TypeName: "aws_ssm_instances", + }, + { + Factory: DataSourceMaintenanceWindows, + TypeName: "aws_ssm_maintenance_windows", + }, + { + Factory: DataSourceParameter, + TypeName: "aws_ssm_parameter", + }, + { + Factory: DataSourceParametersByPath, + TypeName: "aws_ssm_parameters_by_path", + }, + { + Factory: DataSourcePatchBaseline, + TypeName: "aws_ssm_patch_baseline", + }, } } -func (p *servicePackage) SDKResources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{ - "aws_ssm_activation": ResourceActivation, - "aws_ssm_association": ResourceAssociation, - "aws_ssm_default_patch_baseline": ResourceDefaultPatchBaseline, - "aws_ssm_document": ResourceDocument, - "aws_ssm_maintenance_window": ResourceMaintenanceWindow, - "aws_ssm_maintenance_window_target": ResourceMaintenanceWindowTarget, - "aws_ssm_maintenance_window_task": ResourceMaintenanceWindowTask, - "aws_ssm_parameter": ResourceParameter, - "aws_ssm_patch_baseline": ResourcePatchBaseline, - "aws_ssm_patch_group": ResourcePatchGroup, - "aws_ssm_resource_data_sync": ResourceResourceDataSync, - "aws_ssm_service_setting": ResourceServiceSetting, +func (p *servicePackage) SDKResources(ctx context.Context) []*types.ServicePackageSDKResource { + return []*types.ServicePackageSDKResource{ + { + Factory: ResourceActivation, + TypeName: "aws_ssm_activation", + }, + { + Factory: ResourceAssociation, + TypeName: "aws_ssm_association", + }, + { + Factory: ResourceDefaultPatchBaseline, + TypeName: "aws_ssm_default_patch_baseline", + }, + { + Factory: ResourceDocument, + TypeName: "aws_ssm_document", + }, + { + Factory: ResourceMaintenanceWindow, + TypeName: "aws_ssm_maintenance_window", + }, + { + Factory: ResourceMaintenanceWindowTarget, + TypeName: "aws_ssm_maintenance_window_target", + }, + { + Factory: ResourceMaintenanceWindowTask, + TypeName: "aws_ssm_maintenance_window_task", + }, + { + Factory: ResourceParameter, + TypeName: "aws_ssm_parameter", + }, + { + Factory: ResourcePatchBaseline, + TypeName: "aws_ssm_patch_baseline", + }, + { + Factory: ResourcePatchGroup, + TypeName: "aws_ssm_patch_group", + }, + { + Factory: ResourceResourceDataSync, + TypeName: "aws_ssm_resource_data_sync", + }, + { + Factory: ResourceServiceSetting, + TypeName: "aws_ssm_service_setting", + }, } } diff --git a/internal/service/ssoadmin/service_package_gen.go b/internal/service/ssoadmin/service_package_gen.go index 6f52fe2c5b59..cd5a874016ad 100644 --- a/internal/service/ssoadmin/service_package_gen.go +++ b/internal/service/ssoadmin/service_package_gen.go @@ -5,38 +5,63 @@ package ssoadmin import ( "context" - "github.com/hashicorp/terraform-plugin-framework/datasource" - "github.com/hashicorp/terraform-plugin-framework/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "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) []func(context.Context) (datasource.DataSourceWithConfigure, error) { - return []func(context.Context) (datasource.DataSourceWithConfigure, error){} +func (p *servicePackage) FrameworkDataSources(ctx context.Context) []*types.ServicePackageFrameworkDataSource { + return []*types.ServicePackageFrameworkDataSource{} } -func (p *servicePackage) FrameworkResources(ctx context.Context) []func(context.Context) (resource.ResourceWithConfigure, error) { - return []func(context.Context) (resource.ResourceWithConfigure, error){} +func (p *servicePackage) FrameworkResources(ctx context.Context) []*types.ServicePackageFrameworkResource { + return []*types.ServicePackageFrameworkResource{} } -func (p *servicePackage) SDKDataSources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{ - "aws_ssoadmin_instances": DataSourceInstances, - "aws_ssoadmin_permission_set": DataSourcePermissionSet, +func (p *servicePackage) SDKDataSources(ctx context.Context) []*types.ServicePackageSDKDataSource { + return []*types.ServicePackageSDKDataSource{ + { + Factory: DataSourceInstances, + TypeName: "aws_ssoadmin_instances", + }, + { + Factory: DataSourcePermissionSet, + TypeName: "aws_ssoadmin_permission_set", + }, } } -func (p *servicePackage) SDKResources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{ - "aws_ssoadmin_account_assignment": ResourceAccountAssignment, - "aws_ssoadmin_customer_managed_policy_attachment": ResourceCustomerManagedPolicyAttachment, - "aws_ssoadmin_instance_access_control_attributes": ResourceAccessControlAttributes, - "aws_ssoadmin_managed_policy_attachment": ResourceManagedPolicyAttachment, - "aws_ssoadmin_permission_set": ResourcePermissionSet, - "aws_ssoadmin_permission_set_inline_policy": ResourcePermissionSetInlinePolicy, - "aws_ssoadmin_permissions_boundary_attachment": ResourcePermissionsBoundaryAttachment, +func (p *servicePackage) SDKResources(ctx context.Context) []*types.ServicePackageSDKResource { + return []*types.ServicePackageSDKResource{ + { + Factory: ResourceAccountAssignment, + TypeName: "aws_ssoadmin_account_assignment", + }, + { + Factory: ResourceCustomerManagedPolicyAttachment, + TypeName: "aws_ssoadmin_customer_managed_policy_attachment", + }, + { + Factory: ResourceAccessControlAttributes, + TypeName: "aws_ssoadmin_instance_access_control_attributes", + }, + { + Factory: ResourceManagedPolicyAttachment, + TypeName: "aws_ssoadmin_managed_policy_attachment", + }, + { + Factory: ResourcePermissionSet, + TypeName: "aws_ssoadmin_permission_set", + }, + { + Factory: ResourcePermissionSetInlinePolicy, + TypeName: "aws_ssoadmin_permission_set_inline_policy", + }, + { + Factory: ResourcePermissionsBoundaryAttachment, + TypeName: "aws_ssoadmin_permissions_boundary_attachment", + }, } } diff --git a/internal/service/storagegateway/service_package_gen.go b/internal/service/storagegateway/service_package_gen.go index 4718b9836806..aafa71df4dd1 100644 --- a/internal/service/storagegateway/service_package_gen.go +++ b/internal/service/storagegateway/service_package_gen.go @@ -5,40 +5,71 @@ package storagegateway import ( "context" - "github.com/hashicorp/terraform-plugin-framework/datasource" - "github.com/hashicorp/terraform-plugin-framework/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "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) []func(context.Context) (datasource.DataSourceWithConfigure, error) { - return []func(context.Context) (datasource.DataSourceWithConfigure, error){} +func (p *servicePackage) FrameworkDataSources(ctx context.Context) []*types.ServicePackageFrameworkDataSource { + return []*types.ServicePackageFrameworkDataSource{} } -func (p *servicePackage) FrameworkResources(ctx context.Context) []func(context.Context) (resource.ResourceWithConfigure, error) { - return []func(context.Context) (resource.ResourceWithConfigure, error){} +func (p *servicePackage) FrameworkResources(ctx context.Context) []*types.ServicePackageFrameworkResource { + return []*types.ServicePackageFrameworkResource{} } -func (p *servicePackage) SDKDataSources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{ - "aws_storagegateway_local_disk": DataSourceLocalDisk, +func (p *servicePackage) SDKDataSources(ctx context.Context) []*types.ServicePackageSDKDataSource { + return []*types.ServicePackageSDKDataSource{ + { + Factory: DataSourceLocalDisk, + TypeName: "aws_storagegateway_local_disk", + }, } } -func (p *servicePackage) SDKResources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{ - "aws_storagegateway_cache": ResourceCache, - "aws_storagegateway_cached_iscsi_volume": ResourceCachediSCSIVolume, - "aws_storagegateway_file_system_association": ResourceFileSystemAssociation, - "aws_storagegateway_gateway": ResourceGateway, - "aws_storagegateway_nfs_file_share": ResourceNFSFileShare, - "aws_storagegateway_smb_file_share": ResourceSMBFileShare, - "aws_storagegateway_stored_iscsi_volume": ResourceStorediSCSIVolume, - "aws_storagegateway_tape_pool": ResourceTapePool, - "aws_storagegateway_upload_buffer": ResourceUploadBuffer, - "aws_storagegateway_working_storage": ResourceWorkingStorage, +func (p *servicePackage) SDKResources(ctx context.Context) []*types.ServicePackageSDKResource { + return []*types.ServicePackageSDKResource{ + { + Factory: ResourceCache, + TypeName: "aws_storagegateway_cache", + }, + { + Factory: ResourceCachediSCSIVolume, + TypeName: "aws_storagegateway_cached_iscsi_volume", + }, + { + Factory: ResourceFileSystemAssociation, + TypeName: "aws_storagegateway_file_system_association", + }, + { + Factory: ResourceGateway, + TypeName: "aws_storagegateway_gateway", + }, + { + Factory: ResourceNFSFileShare, + TypeName: "aws_storagegateway_nfs_file_share", + }, + { + Factory: ResourceSMBFileShare, + TypeName: "aws_storagegateway_smb_file_share", + }, + { + Factory: ResourceStorediSCSIVolume, + TypeName: "aws_storagegateway_stored_iscsi_volume", + }, + { + Factory: ResourceTapePool, + TypeName: "aws_storagegateway_tape_pool", + }, + { + Factory: ResourceUploadBuffer, + TypeName: "aws_storagegateway_upload_buffer", + }, + { + Factory: ResourceWorkingStorage, + TypeName: "aws_storagegateway_working_storage", + }, } } diff --git a/internal/service/sts/service_package_gen.go b/internal/service/sts/service_package_gen.go index 42614de816a1..295656d10f86 100644 --- a/internal/service/sts/service_package_gen.go +++ b/internal/service/sts/service_package_gen.go @@ -5,30 +5,30 @@ package sts import ( "context" - "github.com/hashicorp/terraform-plugin-framework/datasource" - "github.com/hashicorp/terraform-plugin-framework/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "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) []func(context.Context) (datasource.DataSourceWithConfigure, error) { - return []func(context.Context) (datasource.DataSourceWithConfigure, error){ - newDataSourceCallerIdentity, +func (p *servicePackage) FrameworkDataSources(ctx context.Context) []*types.ServicePackageFrameworkDataSource { + return []*types.ServicePackageFrameworkDataSource{ + { + Factory: newDataSourceCallerIdentity, + }, } } -func (p *servicePackage) FrameworkResources(ctx context.Context) []func(context.Context) (resource.ResourceWithConfigure, error) { - return []func(context.Context) (resource.ResourceWithConfigure, error){} +func (p *servicePackage) FrameworkResources(ctx context.Context) []*types.ServicePackageFrameworkResource { + return []*types.ServicePackageFrameworkResource{} } -func (p *servicePackage) SDKDataSources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{} +func (p *servicePackage) SDKDataSources(ctx context.Context) []*types.ServicePackageSDKDataSource { + return []*types.ServicePackageSDKDataSource{} } -func (p *servicePackage) SDKResources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{} +func (p *servicePackage) SDKResources(ctx context.Context) []*types.ServicePackageSDKResource { + return []*types.ServicePackageSDKResource{} } func (p *servicePackage) ServicePackageName() string { diff --git a/internal/service/swf/service_package_gen.go b/internal/service/swf/service_package_gen.go index 382bfa8567f3..ba3986201be1 100644 --- a/internal/service/swf/service_package_gen.go +++ b/internal/service/swf/service_package_gen.go @@ -5,29 +5,30 @@ package swf import ( "context" - "github.com/hashicorp/terraform-plugin-framework/datasource" - "github.com/hashicorp/terraform-plugin-framework/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "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) []func(context.Context) (datasource.DataSourceWithConfigure, error) { - return []func(context.Context) (datasource.DataSourceWithConfigure, error){} +func (p *servicePackage) FrameworkDataSources(ctx context.Context) []*types.ServicePackageFrameworkDataSource { + return []*types.ServicePackageFrameworkDataSource{} } -func (p *servicePackage) FrameworkResources(ctx context.Context) []func(context.Context) (resource.ResourceWithConfigure, error) { - return []func(context.Context) (resource.ResourceWithConfigure, error){} +func (p *servicePackage) FrameworkResources(ctx context.Context) []*types.ServicePackageFrameworkResource { + return []*types.ServicePackageFrameworkResource{} } -func (p *servicePackage) SDKDataSources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{} +func (p *servicePackage) SDKDataSources(ctx context.Context) []*types.ServicePackageSDKDataSource { + return []*types.ServicePackageSDKDataSource{} } -func (p *servicePackage) SDKResources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{ - "aws_swf_domain": ResourceDomain, +func (p *servicePackage) SDKResources(ctx context.Context) []*types.ServicePackageSDKResource { + return []*types.ServicePackageSDKResource{ + { + Factory: ResourceDomain, + TypeName: "aws_swf_domain", + }, } } diff --git a/internal/service/synthetics/service_package_gen.go b/internal/service/synthetics/service_package_gen.go index a0e5fa4c5218..4a51afa566ae 100644 --- a/internal/service/synthetics/service_package_gen.go +++ b/internal/service/synthetics/service_package_gen.go @@ -5,29 +5,30 @@ package synthetics import ( "context" - "github.com/hashicorp/terraform-plugin-framework/datasource" - "github.com/hashicorp/terraform-plugin-framework/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "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) []func(context.Context) (datasource.DataSourceWithConfigure, error) { - return []func(context.Context) (datasource.DataSourceWithConfigure, error){} +func (p *servicePackage) FrameworkDataSources(ctx context.Context) []*types.ServicePackageFrameworkDataSource { + return []*types.ServicePackageFrameworkDataSource{} } -func (p *servicePackage) FrameworkResources(ctx context.Context) []func(context.Context) (resource.ResourceWithConfigure, error) { - return []func(context.Context) (resource.ResourceWithConfigure, error){} +func (p *servicePackage) FrameworkResources(ctx context.Context) []*types.ServicePackageFrameworkResource { + return []*types.ServicePackageFrameworkResource{} } -func (p *servicePackage) SDKDataSources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{} +func (p *servicePackage) SDKDataSources(ctx context.Context) []*types.ServicePackageSDKDataSource { + return []*types.ServicePackageSDKDataSource{} } -func (p *servicePackage) SDKResources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{ - "aws_synthetics_canary": ResourceCanary, +func (p *servicePackage) SDKResources(ctx context.Context) []*types.ServicePackageSDKResource { + return []*types.ServicePackageSDKResource{ + { + Factory: ResourceCanary, + TypeName: "aws_synthetics_canary", + }, } } diff --git a/internal/service/timestreamwrite/service_package_gen.go b/internal/service/timestreamwrite/service_package_gen.go index 07ed704296c4..1c7be83bca08 100644 --- a/internal/service/timestreamwrite/service_package_gen.go +++ b/internal/service/timestreamwrite/service_package_gen.go @@ -5,30 +5,34 @@ package timestreamwrite import ( "context" - "github.com/hashicorp/terraform-plugin-framework/datasource" - "github.com/hashicorp/terraform-plugin-framework/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "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) []func(context.Context) (datasource.DataSourceWithConfigure, error) { - return []func(context.Context) (datasource.DataSourceWithConfigure, error){} +func (p *servicePackage) FrameworkDataSources(ctx context.Context) []*types.ServicePackageFrameworkDataSource { + return []*types.ServicePackageFrameworkDataSource{} } -func (p *servicePackage) FrameworkResources(ctx context.Context) []func(context.Context) (resource.ResourceWithConfigure, error) { - return []func(context.Context) (resource.ResourceWithConfigure, error){} +func (p *servicePackage) FrameworkResources(ctx context.Context) []*types.ServicePackageFrameworkResource { + return []*types.ServicePackageFrameworkResource{} } -func (p *servicePackage) SDKDataSources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{} +func (p *servicePackage) SDKDataSources(ctx context.Context) []*types.ServicePackageSDKDataSource { + return []*types.ServicePackageSDKDataSource{} } -func (p *servicePackage) SDKResources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{ - "aws_timestreamwrite_database": ResourceDatabase, - "aws_timestreamwrite_table": ResourceTable, +func (p *servicePackage) SDKResources(ctx context.Context) []*types.ServicePackageSDKResource { + return []*types.ServicePackageSDKResource{ + { + Factory: ResourceDatabase, + TypeName: "aws_timestreamwrite_database", + }, + { + Factory: ResourceTable, + TypeName: "aws_timestreamwrite_table", + }, } } diff --git a/internal/service/transcribe/service_package_gen.go b/internal/service/transcribe/service_package_gen.go index 994aad116846..63917a063bf3 100644 --- a/internal/service/transcribe/service_package_gen.go +++ b/internal/service/transcribe/service_package_gen.go @@ -5,32 +5,42 @@ package transcribe import ( "context" - "github.com/hashicorp/terraform-plugin-framework/datasource" - "github.com/hashicorp/terraform-plugin-framework/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "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) []func(context.Context) (datasource.DataSourceWithConfigure, error) { - return []func(context.Context) (datasource.DataSourceWithConfigure, error){} +func (p *servicePackage) FrameworkDataSources(ctx context.Context) []*types.ServicePackageFrameworkDataSource { + return []*types.ServicePackageFrameworkDataSource{} } -func (p *servicePackage) FrameworkResources(ctx context.Context) []func(context.Context) (resource.ResourceWithConfigure, error) { - return []func(context.Context) (resource.ResourceWithConfigure, error){} +func (p *servicePackage) FrameworkResources(ctx context.Context) []*types.ServicePackageFrameworkResource { + return []*types.ServicePackageFrameworkResource{} } -func (p *servicePackage) SDKDataSources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{} +func (p *servicePackage) SDKDataSources(ctx context.Context) []*types.ServicePackageSDKDataSource { + return []*types.ServicePackageSDKDataSource{} } -func (p *servicePackage) SDKResources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{ - "aws_transcribe_language_model": ResourceLanguageModel, - "aws_transcribe_medical_vocabulary": ResourceMedicalVocabulary, - "aws_transcribe_vocabulary": ResourceVocabulary, - "aws_transcribe_vocabulary_filter": ResourceVocabularyFilter, +func (p *servicePackage) SDKResources(ctx context.Context) []*types.ServicePackageSDKResource { + return []*types.ServicePackageSDKResource{ + { + Factory: ResourceLanguageModel, + TypeName: "aws_transcribe_language_model", + }, + { + Factory: ResourceMedicalVocabulary, + TypeName: "aws_transcribe_medical_vocabulary", + }, + { + Factory: ResourceVocabulary, + TypeName: "aws_transcribe_vocabulary", + }, + { + Factory: ResourceVocabularyFilter, + TypeName: "aws_transcribe_vocabulary_filter", + }, } } diff --git a/internal/service/transfer/service_package_gen.go b/internal/service/transfer/service_package_gen.go index a87994482f84..768d4c04d9d4 100644 --- a/internal/service/transfer/service_package_gen.go +++ b/internal/service/transfer/service_package_gen.go @@ -5,36 +5,55 @@ package transfer import ( "context" - "github.com/hashicorp/terraform-plugin-framework/datasource" - "github.com/hashicorp/terraform-plugin-framework/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "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) []func(context.Context) (datasource.DataSourceWithConfigure, error) { - return []func(context.Context) (datasource.DataSourceWithConfigure, error){} +func (p *servicePackage) FrameworkDataSources(ctx context.Context) []*types.ServicePackageFrameworkDataSource { + return []*types.ServicePackageFrameworkDataSource{} } -func (p *servicePackage) FrameworkResources(ctx context.Context) []func(context.Context) (resource.ResourceWithConfigure, error) { - return []func(context.Context) (resource.ResourceWithConfigure, error){} +func (p *servicePackage) FrameworkResources(ctx context.Context) []*types.ServicePackageFrameworkResource { + return []*types.ServicePackageFrameworkResource{} } -func (p *servicePackage) SDKDataSources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{ - "aws_transfer_server": DataSourceServer, +func (p *servicePackage) SDKDataSources(ctx context.Context) []*types.ServicePackageSDKDataSource { + return []*types.ServicePackageSDKDataSource{ + { + Factory: DataSourceServer, + TypeName: "aws_transfer_server", + }, } } -func (p *servicePackage) SDKResources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{ - "aws_transfer_access": ResourceAccess, - "aws_transfer_server": ResourceServer, - "aws_transfer_ssh_key": ResourceSSHKey, - "aws_transfer_tag": ResourceTag, - "aws_transfer_user": ResourceUser, - "aws_transfer_workflow": ResourceWorkflow, +func (p *servicePackage) SDKResources(ctx context.Context) []*types.ServicePackageSDKResource { + return []*types.ServicePackageSDKResource{ + { + Factory: ResourceAccess, + TypeName: "aws_transfer_access", + }, + { + Factory: ResourceServer, + TypeName: "aws_transfer_server", + }, + { + Factory: ResourceSSHKey, + TypeName: "aws_transfer_ssh_key", + }, + { + Factory: ResourceTag, + TypeName: "aws_transfer_tag", + }, + { + Factory: ResourceUser, + TypeName: "aws_transfer_user", + }, + { + Factory: ResourceWorkflow, + TypeName: "aws_transfer_workflow", + }, } } diff --git a/internal/service/waf/service_package_gen.go b/internal/service/waf/service_package_gen.go index f6d371d167e6..a259b2e571af 100644 --- a/internal/service/waf/service_package_gen.go +++ b/internal/service/waf/service_package_gen.go @@ -5,46 +5,95 @@ package waf import ( "context" - "github.com/hashicorp/terraform-plugin-framework/datasource" - "github.com/hashicorp/terraform-plugin-framework/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "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) []func(context.Context) (datasource.DataSourceWithConfigure, error) { - return []func(context.Context) (datasource.DataSourceWithConfigure, error){} +func (p *servicePackage) FrameworkDataSources(ctx context.Context) []*types.ServicePackageFrameworkDataSource { + return []*types.ServicePackageFrameworkDataSource{} } -func (p *servicePackage) FrameworkResources(ctx context.Context) []func(context.Context) (resource.ResourceWithConfigure, error) { - return []func(context.Context) (resource.ResourceWithConfigure, error){} +func (p *servicePackage) FrameworkResources(ctx context.Context) []*types.ServicePackageFrameworkResource { + return []*types.ServicePackageFrameworkResource{} } -func (p *servicePackage) SDKDataSources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{ - "aws_waf_ipset": DataSourceIPSet, - "aws_waf_rate_based_rule": DataSourceRateBasedRule, - "aws_waf_rule": DataSourceRule, - "aws_waf_subscribed_rule_group": DataSourceSubscribedRuleGroup, - "aws_waf_web_acl": DataSourceWebACL, +func (p *servicePackage) SDKDataSources(ctx context.Context) []*types.ServicePackageSDKDataSource { + return []*types.ServicePackageSDKDataSource{ + { + Factory: DataSourceIPSet, + TypeName: "aws_waf_ipset", + }, + { + Factory: DataSourceRateBasedRule, + TypeName: "aws_waf_rate_based_rule", + }, + { + Factory: DataSourceRule, + TypeName: "aws_waf_rule", + }, + { + Factory: DataSourceSubscribedRuleGroup, + TypeName: "aws_waf_subscribed_rule_group", + }, + { + Factory: DataSourceWebACL, + TypeName: "aws_waf_web_acl", + }, } } -func (p *servicePackage) SDKResources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{ - "aws_waf_byte_match_set": ResourceByteMatchSet, - "aws_waf_geo_match_set": ResourceGeoMatchSet, - "aws_waf_ipset": ResourceIPSet, - "aws_waf_rate_based_rule": ResourceRateBasedRule, - "aws_waf_regex_match_set": ResourceRegexMatchSet, - "aws_waf_regex_pattern_set": ResourceRegexPatternSet, - "aws_waf_rule": ResourceRule, - "aws_waf_rule_group": ResourceRuleGroup, - "aws_waf_size_constraint_set": ResourceSizeConstraintSet, - "aws_waf_sql_injection_match_set": ResourceSQLInjectionMatchSet, - "aws_waf_web_acl": ResourceWebACL, - "aws_waf_xss_match_set": ResourceXSSMatchSet, +func (p *servicePackage) SDKResources(ctx context.Context) []*types.ServicePackageSDKResource { + return []*types.ServicePackageSDKResource{ + { + Factory: ResourceByteMatchSet, + TypeName: "aws_waf_byte_match_set", + }, + { + Factory: ResourceGeoMatchSet, + TypeName: "aws_waf_geo_match_set", + }, + { + Factory: ResourceIPSet, + TypeName: "aws_waf_ipset", + }, + { + Factory: ResourceRateBasedRule, + TypeName: "aws_waf_rate_based_rule", + }, + { + Factory: ResourceRegexMatchSet, + TypeName: "aws_waf_regex_match_set", + }, + { + Factory: ResourceRegexPatternSet, + TypeName: "aws_waf_regex_pattern_set", + }, + { + Factory: ResourceRule, + TypeName: "aws_waf_rule", + }, + { + Factory: ResourceRuleGroup, + TypeName: "aws_waf_rule_group", + }, + { + Factory: ResourceSizeConstraintSet, + TypeName: "aws_waf_size_constraint_set", + }, + { + Factory: ResourceSQLInjectionMatchSet, + TypeName: "aws_waf_sql_injection_match_set", + }, + { + Factory: ResourceWebACL, + TypeName: "aws_waf_web_acl", + }, + { + Factory: ResourceXSSMatchSet, + TypeName: "aws_waf_xss_match_set", + }, } } diff --git a/internal/service/wafregional/service_package_gen.go b/internal/service/wafregional/service_package_gen.go index d2f6a8951337..c9c51aafb487 100644 --- a/internal/service/wafregional/service_package_gen.go +++ b/internal/service/wafregional/service_package_gen.go @@ -5,47 +5,99 @@ package wafregional import ( "context" - "github.com/hashicorp/terraform-plugin-framework/datasource" - "github.com/hashicorp/terraform-plugin-framework/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "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) []func(context.Context) (datasource.DataSourceWithConfigure, error) { - return []func(context.Context) (datasource.DataSourceWithConfigure, error){} +func (p *servicePackage) FrameworkDataSources(ctx context.Context) []*types.ServicePackageFrameworkDataSource { + return []*types.ServicePackageFrameworkDataSource{} } -func (p *servicePackage) FrameworkResources(ctx context.Context) []func(context.Context) (resource.ResourceWithConfigure, error) { - return []func(context.Context) (resource.ResourceWithConfigure, error){} +func (p *servicePackage) FrameworkResources(ctx context.Context) []*types.ServicePackageFrameworkResource { + return []*types.ServicePackageFrameworkResource{} } -func (p *servicePackage) SDKDataSources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{ - "aws_wafregional_ipset": DataSourceIPSet, - "aws_wafregional_rate_based_rule": DataSourceRateBasedRule, - "aws_wafregional_rule": DataSourceRule, - "aws_wafregional_subscribed_rule_group": DataSourceSubscribedRuleGroup, - "aws_wafregional_web_acl": DataSourceWebACL, +func (p *servicePackage) SDKDataSources(ctx context.Context) []*types.ServicePackageSDKDataSource { + return []*types.ServicePackageSDKDataSource{ + { + Factory: DataSourceIPSet, + TypeName: "aws_wafregional_ipset", + }, + { + Factory: DataSourceRateBasedRule, + TypeName: "aws_wafregional_rate_based_rule", + }, + { + Factory: DataSourceRule, + TypeName: "aws_wafregional_rule", + }, + { + Factory: DataSourceSubscribedRuleGroup, + TypeName: "aws_wafregional_subscribed_rule_group", + }, + { + Factory: DataSourceWebACL, + TypeName: "aws_wafregional_web_acl", + }, } } -func (p *servicePackage) SDKResources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{ - "aws_wafregional_byte_match_set": ResourceByteMatchSet, - "aws_wafregional_geo_match_set": ResourceGeoMatchSet, - "aws_wafregional_ipset": ResourceIPSet, - "aws_wafregional_rate_based_rule": ResourceRateBasedRule, - "aws_wafregional_regex_match_set": ResourceRegexMatchSet, - "aws_wafregional_regex_pattern_set": ResourceRegexPatternSet, - "aws_wafregional_rule": ResourceRule, - "aws_wafregional_rule_group": ResourceRuleGroup, - "aws_wafregional_size_constraint_set": ResourceSizeConstraintSet, - "aws_wafregional_sql_injection_match_set": ResourceSQLInjectionMatchSet, - "aws_wafregional_web_acl": ResourceWebACL, - "aws_wafregional_web_acl_association": ResourceWebACLAssociation, - "aws_wafregional_xss_match_set": ResourceXSSMatchSet, +func (p *servicePackage) SDKResources(ctx context.Context) []*types.ServicePackageSDKResource { + return []*types.ServicePackageSDKResource{ + { + Factory: ResourceByteMatchSet, + TypeName: "aws_wafregional_byte_match_set", + }, + { + Factory: ResourceGeoMatchSet, + TypeName: "aws_wafregional_geo_match_set", + }, + { + Factory: ResourceIPSet, + TypeName: "aws_wafregional_ipset", + }, + { + Factory: ResourceRateBasedRule, + TypeName: "aws_wafregional_rate_based_rule", + }, + { + Factory: ResourceRegexMatchSet, + TypeName: "aws_wafregional_regex_match_set", + }, + { + Factory: ResourceRegexPatternSet, + TypeName: "aws_wafregional_regex_pattern_set", + }, + { + Factory: ResourceRule, + TypeName: "aws_wafregional_rule", + }, + { + Factory: ResourceRuleGroup, + TypeName: "aws_wafregional_rule_group", + }, + { + Factory: ResourceSizeConstraintSet, + TypeName: "aws_wafregional_size_constraint_set", + }, + { + Factory: ResourceSQLInjectionMatchSet, + TypeName: "aws_wafregional_sql_injection_match_set", + }, + { + Factory: ResourceWebACL, + TypeName: "aws_wafregional_web_acl", + }, + { + Factory: ResourceWebACLAssociation, + TypeName: "aws_wafregional_web_acl_association", + }, + { + Factory: ResourceXSSMatchSet, + TypeName: "aws_wafregional_xss_match_set", + }, } } diff --git a/internal/service/wafv2/service_package_gen.go b/internal/service/wafv2/service_package_gen.go index f914fa6d2bec..fef8613eff2d 100644 --- a/internal/service/wafv2/service_package_gen.go +++ b/internal/service/wafv2/service_package_gen.go @@ -5,39 +5,67 @@ package wafv2 import ( "context" - "github.com/hashicorp/terraform-plugin-framework/datasource" - "github.com/hashicorp/terraform-plugin-framework/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "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) []func(context.Context) (datasource.DataSourceWithConfigure, error) { - return []func(context.Context) (datasource.DataSourceWithConfigure, error){} +func (p *servicePackage) FrameworkDataSources(ctx context.Context) []*types.ServicePackageFrameworkDataSource { + return []*types.ServicePackageFrameworkDataSource{} } -func (p *servicePackage) FrameworkResources(ctx context.Context) []func(context.Context) (resource.ResourceWithConfigure, error) { - return []func(context.Context) (resource.ResourceWithConfigure, error){} +func (p *servicePackage) FrameworkResources(ctx context.Context) []*types.ServicePackageFrameworkResource { + return []*types.ServicePackageFrameworkResource{} } -func (p *servicePackage) SDKDataSources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{ - "aws_wafv2_ip_set": DataSourceIPSet, - "aws_wafv2_regex_pattern_set": DataSourceRegexPatternSet, - "aws_wafv2_rule_group": DataSourceRuleGroup, - "aws_wafv2_web_acl": DataSourceWebACL, +func (p *servicePackage) SDKDataSources(ctx context.Context) []*types.ServicePackageSDKDataSource { + return []*types.ServicePackageSDKDataSource{ + { + Factory: DataSourceIPSet, + TypeName: "aws_wafv2_ip_set", + }, + { + Factory: DataSourceRegexPatternSet, + TypeName: "aws_wafv2_regex_pattern_set", + }, + { + Factory: DataSourceRuleGroup, + TypeName: "aws_wafv2_rule_group", + }, + { + Factory: DataSourceWebACL, + TypeName: "aws_wafv2_web_acl", + }, } } -func (p *servicePackage) SDKResources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{ - "aws_wafv2_ip_set": ResourceIPSet, - "aws_wafv2_regex_pattern_set": ResourceRegexPatternSet, - "aws_wafv2_rule_group": ResourceRuleGroup, - "aws_wafv2_web_acl": ResourceWebACL, - "aws_wafv2_web_acl_association": ResourceWebACLAssociation, - "aws_wafv2_web_acl_logging_configuration": ResourceWebACLLoggingConfiguration, +func (p *servicePackage) SDKResources(ctx context.Context) []*types.ServicePackageSDKResource { + return []*types.ServicePackageSDKResource{ + { + Factory: ResourceIPSet, + TypeName: "aws_wafv2_ip_set", + }, + { + Factory: ResourceRegexPatternSet, + TypeName: "aws_wafv2_regex_pattern_set", + }, + { + Factory: ResourceRuleGroup, + TypeName: "aws_wafv2_rule_group", + }, + { + Factory: ResourceWebACL, + TypeName: "aws_wafv2_web_acl", + }, + { + Factory: ResourceWebACLAssociation, + TypeName: "aws_wafv2_web_acl_association", + }, + { + Factory: ResourceWebACLLoggingConfiguration, + TypeName: "aws_wafv2_web_acl_logging_configuration", + }, } } diff --git a/internal/service/worklink/service_package_gen.go b/internal/service/worklink/service_package_gen.go index 3cd03ab020c6..c6d14af358aa 100644 --- a/internal/service/worklink/service_package_gen.go +++ b/internal/service/worklink/service_package_gen.go @@ -5,30 +5,34 @@ package worklink import ( "context" - "github.com/hashicorp/terraform-plugin-framework/datasource" - "github.com/hashicorp/terraform-plugin-framework/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "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) []func(context.Context) (datasource.DataSourceWithConfigure, error) { - return []func(context.Context) (datasource.DataSourceWithConfigure, error){} +func (p *servicePackage) FrameworkDataSources(ctx context.Context) []*types.ServicePackageFrameworkDataSource { + return []*types.ServicePackageFrameworkDataSource{} } -func (p *servicePackage) FrameworkResources(ctx context.Context) []func(context.Context) (resource.ResourceWithConfigure, error) { - return []func(context.Context) (resource.ResourceWithConfigure, error){} +func (p *servicePackage) FrameworkResources(ctx context.Context) []*types.ServicePackageFrameworkResource { + return []*types.ServicePackageFrameworkResource{} } -func (p *servicePackage) SDKDataSources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{} +func (p *servicePackage) SDKDataSources(ctx context.Context) []*types.ServicePackageSDKDataSource { + return []*types.ServicePackageSDKDataSource{} } -func (p *servicePackage) SDKResources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{ - "aws_worklink_fleet": ResourceFleet, - "aws_worklink_website_certificate_authority_association": ResourceWebsiteCertificateAuthorityAssociation, +func (p *servicePackage) SDKResources(ctx context.Context) []*types.ServicePackageSDKResource { + return []*types.ServicePackageSDKResource{ + { + Factory: ResourceFleet, + TypeName: "aws_worklink_fleet", + }, + { + Factory: ResourceWebsiteCertificateAuthorityAssociation, + TypeName: "aws_worklink_website_certificate_authority_association", + }, } } diff --git a/internal/service/workspaces/service_package_gen.go b/internal/service/workspaces/service_package_gen.go index 8be30ca73014..9b901b243afc 100644 --- a/internal/service/workspaces/service_package_gen.go +++ b/internal/service/workspaces/service_package_gen.go @@ -5,36 +5,55 @@ package workspaces import ( "context" - "github.com/hashicorp/terraform-plugin-framework/datasource" - "github.com/hashicorp/terraform-plugin-framework/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "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) []func(context.Context) (datasource.DataSourceWithConfigure, error) { - return []func(context.Context) (datasource.DataSourceWithConfigure, error){} +func (p *servicePackage) FrameworkDataSources(ctx context.Context) []*types.ServicePackageFrameworkDataSource { + return []*types.ServicePackageFrameworkDataSource{} } -func (p *servicePackage) FrameworkResources(ctx context.Context) []func(context.Context) (resource.ResourceWithConfigure, error) { - return []func(context.Context) (resource.ResourceWithConfigure, error){} +func (p *servicePackage) FrameworkResources(ctx context.Context) []*types.ServicePackageFrameworkResource { + return []*types.ServicePackageFrameworkResource{} } -func (p *servicePackage) SDKDataSources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{ - "aws_workspaces_bundle": DataSourceBundle, - "aws_workspaces_directory": DataSourceDirectory, - "aws_workspaces_image": DataSourceImage, - "aws_workspaces_workspace": DataSourceWorkspace, +func (p *servicePackage) SDKDataSources(ctx context.Context) []*types.ServicePackageSDKDataSource { + return []*types.ServicePackageSDKDataSource{ + { + Factory: DataSourceBundle, + TypeName: "aws_workspaces_bundle", + }, + { + Factory: DataSourceDirectory, + TypeName: "aws_workspaces_directory", + }, + { + Factory: DataSourceImage, + TypeName: "aws_workspaces_image", + }, + { + Factory: DataSourceWorkspace, + TypeName: "aws_workspaces_workspace", + }, } } -func (p *servicePackage) SDKResources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{ - "aws_workspaces_directory": ResourceDirectory, - "aws_workspaces_ip_group": ResourceIPGroup, - "aws_workspaces_workspace": ResourceWorkspace, +func (p *servicePackage) SDKResources(ctx context.Context) []*types.ServicePackageSDKResource { + return []*types.ServicePackageSDKResource{ + { + Factory: ResourceDirectory, + TypeName: "aws_workspaces_directory", + }, + { + Factory: ResourceIPGroup, + TypeName: "aws_workspaces_ip_group", + }, + { + Factory: ResourceWorkspace, + TypeName: "aws_workspaces_workspace", + }, } } diff --git a/internal/service/xray/service_package_gen.go b/internal/service/xray/service_package_gen.go index 757cb9bf0fbd..894406268ba4 100644 --- a/internal/service/xray/service_package_gen.go +++ b/internal/service/xray/service_package_gen.go @@ -5,31 +5,38 @@ package xray import ( "context" - "github.com/hashicorp/terraform-plugin-framework/datasource" - "github.com/hashicorp/terraform-plugin-framework/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "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) []func(context.Context) (datasource.DataSourceWithConfigure, error) { - return []func(context.Context) (datasource.DataSourceWithConfigure, error){} +func (p *servicePackage) FrameworkDataSources(ctx context.Context) []*types.ServicePackageFrameworkDataSource { + return []*types.ServicePackageFrameworkDataSource{} } -func (p *servicePackage) FrameworkResources(ctx context.Context) []func(context.Context) (resource.ResourceWithConfigure, error) { - return []func(context.Context) (resource.ResourceWithConfigure, error){} +func (p *servicePackage) FrameworkResources(ctx context.Context) []*types.ServicePackageFrameworkResource { + return []*types.ServicePackageFrameworkResource{} } -func (p *servicePackage) SDKDataSources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{} +func (p *servicePackage) SDKDataSources(ctx context.Context) []*types.ServicePackageSDKDataSource { + return []*types.ServicePackageSDKDataSource{} } -func (p *servicePackage) SDKResources(ctx context.Context) map[string]func() *schema.Resource { - return map[string]func() *schema.Resource{ - "aws_xray_encryption_config": ResourceEncryptionConfig, - "aws_xray_group": ResourceGroup, - "aws_xray_sampling_rule": ResourceSamplingRule, +func (p *servicePackage) SDKResources(ctx context.Context) []*types.ServicePackageSDKResource { + return []*types.ServicePackageSDKResource{ + { + Factory: ResourceEncryptionConfig, + TypeName: "aws_xray_encryption_config", + }, + { + Factory: ResourceGroup, + TypeName: "aws_xray_group", + }, + { + Factory: ResourceSamplingRule, + TypeName: "aws_xray_sampling_rule", + }, } } From dbc71a335b0fed02f991da0a5219dffd87d6dd18 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Wed, 1 Mar 2023 13:39:36 -0500 Subject: [PATCH 488/763] Generate 'servicePackage.UpdateTags'. --- internal/generate/tags/main.go | 10 ++++++++++ internal/generate/tags/templates/v1/header_body.tmpl | 3 +++ .../generate/tags/templates/v1/update_tags_body.tmpl | 4 ++++ 3 files changed, 17 insertions(+) diff --git a/internal/generate/tags/main.go b/internal/generate/tags/main.go index 048c3e578272..d8d8451873f0 100644 --- a/internal/generate/tags/main.go +++ b/internal/generate/tags/main.go @@ -120,6 +120,7 @@ type TemplateData struct { AWSService string AWSServiceIfacePackage string ClientType string + ProviderNameUpper string ServicePackage string GetTagFunc string @@ -158,6 +159,7 @@ type TemplateData struct { // The following are specific to writing import paths in the `headerBody`; // to include the package, set the corresponding field's value to true + ConnsPkg bool ContextPkg bool FmtPkg bool HelperSchemaPkg bool @@ -199,6 +201,12 @@ func main() { g.Fatalf("encountered: %s", err) } + providerNameUpper, err := names.ProviderNameUpper(servicePackage) + + if err != nil { + g.Fatalf("encountered: %s", err) + } + var clientType string if *sdkVersion == sdkV1 { clientType = fmt.Sprintf("%siface.%sAPI", awsPkg, clientTypeName) @@ -219,8 +227,10 @@ func main() { AWSService: awsPkg, AWSServiceIfacePackage: awsIntfPkg, ClientType: clientType, + ProviderNameUpper: providerNameUpper, ServicePackage: servicePackage, + ConnsPkg: *sdkVersion == sdkV1 && *updateTags, ContextPkg: *sdkVersion == sdkV2 || (*getTag || *listTags || *serviceTagsMap || *serviceTagsSlice || *updateTags), FmtPkg: *updateTags, HelperSchemaPkg: awsPkg == "autoscaling", diff --git a/internal/generate/tags/templates/v1/header_body.tmpl b/internal/generate/tags/templates/v1/header_body.tmpl index 9640d56ff4b7..def21e56b04f 100644 --- a/internal/generate/tags/templates/v1/header_body.tmpl +++ b/internal/generate/tags/templates/v1/header_body.tmpl @@ -30,6 +30,9 @@ import ( "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" {{- end }} + {{- if .ConnsPkg }} + "github.com/hashicorp/terraform-provider-aws/internal/conns" + {{- end }} {{- if .TfResourcePkg }} "github.com/hashicorp/terraform-provider-aws/internal/tfresource" {{- end }} diff --git a/internal/generate/tags/templates/v1/update_tags_body.tmpl b/internal/generate/tags/templates/v1/update_tags_body.tmpl index 6138b5382607..998222c810d8 100644 --- a/internal/generate/tags/templates/v1/update_tags_body.tmpl +++ b/internal/generate/tags/templates/v1/update_tags_body.tmpl @@ -134,3 +134,7 @@ oldTagsMap interface{}, newTagsMap interface{}) error { return nil } + +func (p *servicePackage) {{ .UpdateTagsFunc }}(ctx context.Context, meta any, identifier string{{ if .TagResTypeElem }}, resourceType string{{ end }}, oldTags interface{}, newTags interface{}) error { + return {{ .UpdateTagsFunc }}(ctx, meta.(*conns.AWSClient).{{ .ProviderNameUpper }}Conn(), identifier{{ if .TagResTypeElem }}, resourceType{{ end }}, oldTags, newTags) +} From 7d8246ebedb83ef321eb63be6865f158118c4b6e Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Tue, 7 Mar 2023 14:32:06 -0500 Subject: [PATCH 489/763] Run 'make gen'. --- internal/service/accessanalyzer/tags_gen.go | 5 +++++ internal/service/acm/tags_gen.go | 5 +++++ internal/service/acmpca/tags_gen.go | 5 +++++ internal/service/amp/tags_gen.go | 5 +++++ internal/service/amplify/tags_gen.go | 5 +++++ internal/service/apigateway/tags_gen.go | 5 +++++ internal/service/apigatewayv2/tags_gen.go | 5 +++++ internal/service/appconfig/tags_gen.go | 5 +++++ internal/service/appflow/tags_gen.go | 5 +++++ internal/service/appintegrations/tags_gen.go | 5 +++++ internal/service/applicationinsights/tags_gen.go | 5 +++++ internal/service/appmesh/tags_gen.go | 5 +++++ internal/service/apprunner/tags_gen.go | 5 +++++ internal/service/appstream/tags_gen.go | 5 +++++ internal/service/appsync/tags_gen.go | 5 +++++ internal/service/athena/tags_gen.go | 5 +++++ internal/service/autoscaling/tags_gen.go | 5 +++++ internal/service/backup/tags_gen.go | 5 +++++ internal/service/batch/tags_gen.go | 5 +++++ internal/service/ce/tags_gen.go | 5 +++++ internal/service/cloud9/tags_gen.go | 5 +++++ internal/service/cloudfront/tags_gen.go | 5 +++++ internal/service/cloudhsmv2/tags_gen.go | 5 +++++ internal/service/cloudtrail/tags_gen.go | 5 +++++ internal/service/cloudwatch/tags_gen.go | 5 +++++ internal/service/codeartifact/tags_gen.go | 5 +++++ internal/service/codecommit/tags_gen.go | 5 +++++ internal/service/codepipeline/tags_gen.go | 5 +++++ internal/service/codestarconnections/tags_gen.go | 5 +++++ internal/service/codestarnotifications/tags_gen.go | 5 +++++ internal/service/cognitoidentity/tags_gen.go | 5 +++++ internal/service/cognitoidp/tags_gen.go | 5 +++++ internal/service/configservice/tags_gen.go | 5 +++++ internal/service/connect/tags_gen.go | 5 +++++ internal/service/dataexchange/tags_gen.go | 5 +++++ internal/service/datapipeline/tags_gen.go | 5 +++++ internal/service/datasync/tags_gen.go | 5 +++++ internal/service/dax/tags_gen.go | 5 +++++ internal/service/deploy/tags_gen.go | 5 +++++ internal/service/detective/tags_gen.go | 5 +++++ internal/service/devicefarm/tags_gen.go | 5 +++++ internal/service/directconnect/tags_gen.go | 5 +++++ internal/service/dlm/tags_gen.go | 5 +++++ internal/service/dms/tags_gen.go | 5 +++++ internal/service/docdb/tags_gen.go | 5 +++++ internal/service/ds/tags_gen.go | 5 +++++ internal/service/dynamodb/tags_gen.go | 5 +++++ internal/service/ec2/tags_gen.go | 5 +++++ internal/service/ecr/tags_gen.go | 5 +++++ internal/service/ecrpublic/tags_gen.go | 5 +++++ internal/service/ecs/tags_gen.go | 5 +++++ internal/service/efs/tags_gen.go | 5 +++++ internal/service/eks/tags_gen.go | 5 +++++ internal/service/elasticache/tags_gen.go | 5 +++++ internal/service/elasticbeanstalk/tags_gen.go | 5 +++++ internal/service/elasticsearch/tags_gen.go | 5 +++++ internal/service/elb/tags_gen.go | 5 +++++ internal/service/elbv2/tags_gen.go | 5 +++++ internal/service/emr/tags_gen.go | 5 +++++ internal/service/emrcontainers/tags_gen.go | 5 +++++ internal/service/emrserverless/tags_gen.go | 5 +++++ internal/service/events/tags_gen.go | 5 +++++ internal/service/evidently/tags_gen.go | 5 +++++ internal/service/firehose/tags_gen.go | 5 +++++ internal/service/fms/tags_gen.go | 5 +++++ internal/service/fsx/tags_gen.go | 5 +++++ internal/service/gamelift/tags_gen.go | 5 +++++ internal/service/glacier/tags_gen.go | 5 +++++ internal/service/globalaccelerator/tags_gen.go | 5 +++++ internal/service/glue/tags_gen.go | 5 +++++ internal/service/grafana/tags_gen.go | 5 +++++ internal/service/greengrass/tags_gen.go | 5 +++++ internal/service/guardduty/tags_gen.go | 5 +++++ internal/service/imagebuilder/tags_gen.go | 5 +++++ internal/service/iot/tags_gen.go | 5 +++++ internal/service/iotanalytics/tags_gen.go | 5 +++++ internal/service/iotevents/tags_gen.go | 5 +++++ internal/service/ivs/tags_gen.go | 5 +++++ internal/service/kafka/tags_gen.go | 5 +++++ internal/service/keyspaces/tags_gen.go | 5 +++++ internal/service/kinesis/tags_gen.go | 5 +++++ internal/service/kinesisanalytics/tags_gen.go | 5 +++++ internal/service/kinesisanalyticsv2/tags_gen.go | 5 +++++ internal/service/kinesisvideo/tags_gen.go | 5 +++++ internal/service/kms/tags_gen.go | 5 +++++ internal/service/licensemanager/tags_gen.go | 5 +++++ internal/service/lightsail/tags_gen.go | 5 +++++ internal/service/location/tags_gen.go | 5 +++++ internal/service/logs/log_group_tags_gen.go | 5 +++++ internal/service/logs/tags_gen.go | 5 +++++ internal/service/mediaconnect/tags_gen.go | 5 +++++ internal/service/mediaconvert/tags_gen.go | 5 +++++ internal/service/mediapackage/tags_gen.go | 5 +++++ internal/service/mediastore/tags_gen.go | 5 +++++ internal/service/memorydb/tags_gen.go | 5 +++++ internal/service/mq/tags_gen.go | 5 +++++ internal/service/mwaa/tags_gen.go | 5 +++++ internal/service/neptune/tags_gen.go | 5 +++++ internal/service/networkfirewall/tags_gen.go | 5 +++++ internal/service/networkmanager/tags_gen.go | 5 +++++ internal/service/opensearch/tags_gen.go | 5 +++++ internal/service/opsworks/tags_gen.go | 5 +++++ internal/service/organizations/tags_gen.go | 5 +++++ internal/service/pinpoint/tags_gen.go | 5 +++++ internal/service/qldb/tags_gen.go | 5 +++++ internal/service/quicksight/tags_gen.go | 5 +++++ internal/service/ram/tags_gen.go | 5 +++++ internal/service/rds/tags_gen.go | 5 +++++ internal/service/redshift/tags_gen.go | 5 +++++ internal/service/redshiftserverless/tags_gen.go | 5 +++++ internal/service/resourcegroups/tags_gen.go | 5 +++++ internal/service/route53/tags_gen.go | 5 +++++ internal/service/route53recoveryreadiness/tags_gen.go | 5 +++++ internal/service/route53resolver/tags_gen.go | 5 +++++ internal/service/rum/tags_gen.go | 5 +++++ internal/service/sagemaker/tags_gen.go | 5 +++++ internal/service/schemas/tags_gen.go | 5 +++++ internal/service/secretsmanager/tags_gen.go | 5 +++++ internal/service/securityhub/tags_gen.go | 5 +++++ internal/service/servicediscovery/tags_gen.go | 5 +++++ internal/service/sfn/tags_gen.go | 5 +++++ internal/service/shield/tags_gen.go | 5 +++++ internal/service/signer/tags_gen.go | 5 +++++ internal/service/sns/tags_gen.go | 5 +++++ internal/service/sqs/tags_gen.go | 5 +++++ internal/service/ssm/tags_gen.go | 5 +++++ internal/service/ssoadmin/tags_gen.go | 5 +++++ internal/service/storagegateway/tags_gen.go | 5 +++++ internal/service/swf/tags_gen.go | 5 +++++ internal/service/synthetics/tags_gen.go | 5 +++++ internal/service/timestreamwrite/tags_gen.go | 5 +++++ internal/service/transfer/tags_gen.go | 5 +++++ .../service/transfer/update_tags_no_system_ignore_gen.go | 5 +++++ internal/service/waf/tags_gen.go | 5 +++++ internal/service/wafregional/tags_gen.go | 5 +++++ internal/service/wafv2/tags_gen.go | 5 +++++ internal/service/worklink/tags_gen.go | 5 +++++ internal/service/workspaces/tags_gen.go | 5 +++++ internal/service/xray/tags_gen.go | 5 +++++ 139 files changed, 695 insertions(+) diff --git a/internal/service/accessanalyzer/tags_gen.go b/internal/service/accessanalyzer/tags_gen.go index f0636c6a2979..ac3a936871ae 100644 --- a/internal/service/accessanalyzer/tags_gen.go +++ b/internal/service/accessanalyzer/tags_gen.go @@ -8,6 +8,7 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/accessanalyzer" "github.com/aws/aws-sdk-go/service/accessanalyzer/accessanalyzeriface" + "github.com/hashicorp/terraform-provider-aws/internal/conns" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" ) @@ -75,3 +76,7 @@ func UpdateTags(ctx context.Context, conn accessanalyzeriface.AccessAnalyzerAPI, return nil } + +func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags interface{}, newTags interface{}) error { + return UpdateTags(ctx, meta.(*conns.AWSClient).AccessAnalyzerConn(), identifier, oldTags, newTags) +} diff --git a/internal/service/acm/tags_gen.go b/internal/service/acm/tags_gen.go index 425fcca1a445..ad7411edadad 100644 --- a/internal/service/acm/tags_gen.go +++ b/internal/service/acm/tags_gen.go @@ -8,6 +8,7 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/acm" "github.com/aws/aws-sdk-go/service/acm/acmiface" + "github.com/hashicorp/terraform-provider-aws/internal/conns" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" ) @@ -92,3 +93,7 @@ func UpdateTags(ctx context.Context, conn acmiface.ACMAPI, identifier string, ol return nil } + +func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags interface{}, newTags interface{}) error { + return UpdateTags(ctx, meta.(*conns.AWSClient).ACMConn(), identifier, oldTags, newTags) +} diff --git a/internal/service/acmpca/tags_gen.go b/internal/service/acmpca/tags_gen.go index 7d017b763335..c72170c9adca 100644 --- a/internal/service/acmpca/tags_gen.go +++ b/internal/service/acmpca/tags_gen.go @@ -8,6 +8,7 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/acmpca" "github.com/aws/aws-sdk-go/service/acmpca/acmpcaiface" + "github.com/hashicorp/terraform-provider-aws/internal/conns" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" ) @@ -92,3 +93,7 @@ func UpdateTags(ctx context.Context, conn acmpcaiface.ACMPCAAPI, identifier stri return nil } + +func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags interface{}, newTags interface{}) error { + return UpdateTags(ctx, meta.(*conns.AWSClient).ACMPCAConn(), identifier, oldTags, newTags) +} diff --git a/internal/service/amp/tags_gen.go b/internal/service/amp/tags_gen.go index 0a78f37d8fc0..cd7dfbcbb3f9 100644 --- a/internal/service/amp/tags_gen.go +++ b/internal/service/amp/tags_gen.go @@ -8,6 +8,7 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/prometheusservice" "github.com/aws/aws-sdk-go/service/prometheusservice/prometheusserviceiface" + "github.com/hashicorp/terraform-provider-aws/internal/conns" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" ) @@ -75,3 +76,7 @@ func UpdateTags(ctx context.Context, conn prometheusserviceiface.PrometheusServi return nil } + +func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags interface{}, newTags interface{}) error { + return UpdateTags(ctx, meta.(*conns.AWSClient).AMPConn(), identifier, oldTags, newTags) +} diff --git a/internal/service/amplify/tags_gen.go b/internal/service/amplify/tags_gen.go index a79c85dee579..db7b40dda745 100644 --- a/internal/service/amplify/tags_gen.go +++ b/internal/service/amplify/tags_gen.go @@ -8,6 +8,7 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/amplify" "github.com/aws/aws-sdk-go/service/amplify/amplifyiface" + "github.com/hashicorp/terraform-provider-aws/internal/conns" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" ) @@ -75,3 +76,7 @@ func UpdateTags(ctx context.Context, conn amplifyiface.AmplifyAPI, identifier st return nil } + +func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags interface{}, newTags interface{}) error { + return UpdateTags(ctx, meta.(*conns.AWSClient).AmplifyConn(), identifier, oldTags, newTags) +} diff --git a/internal/service/apigateway/tags_gen.go b/internal/service/apigateway/tags_gen.go index 1c3413545a00..e4a4e51d8e0e 100644 --- a/internal/service/apigateway/tags_gen.go +++ b/internal/service/apigateway/tags_gen.go @@ -8,6 +8,7 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/apigateway" "github.com/aws/aws-sdk-go/service/apigateway/apigatewayiface" + "github.com/hashicorp/terraform-provider-aws/internal/conns" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" ) @@ -58,3 +59,7 @@ func UpdateTags(ctx context.Context, conn apigatewayiface.APIGatewayAPI, identif return nil } + +func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags interface{}, newTags interface{}) error { + return UpdateTags(ctx, meta.(*conns.AWSClient).APIGatewayConn(), identifier, oldTags, newTags) +} diff --git a/internal/service/apigatewayv2/tags_gen.go b/internal/service/apigatewayv2/tags_gen.go index 2c204fc1261c..2f8f76e2ceb8 100644 --- a/internal/service/apigatewayv2/tags_gen.go +++ b/internal/service/apigatewayv2/tags_gen.go @@ -8,6 +8,7 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/apigatewayv2" "github.com/aws/aws-sdk-go/service/apigatewayv2/apigatewayv2iface" + "github.com/hashicorp/terraform-provider-aws/internal/conns" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" ) @@ -75,3 +76,7 @@ func UpdateTags(ctx context.Context, conn apigatewayv2iface.ApiGatewayV2API, ide return nil } + +func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags interface{}, newTags interface{}) error { + return UpdateTags(ctx, meta.(*conns.AWSClient).APIGatewayV2Conn(), identifier, oldTags, newTags) +} diff --git a/internal/service/appconfig/tags_gen.go b/internal/service/appconfig/tags_gen.go index 6e63f1478835..f97eefe64a7b 100644 --- a/internal/service/appconfig/tags_gen.go +++ b/internal/service/appconfig/tags_gen.go @@ -8,6 +8,7 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/appconfig" "github.com/aws/aws-sdk-go/service/appconfig/appconfigiface" + "github.com/hashicorp/terraform-provider-aws/internal/conns" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" ) @@ -75,3 +76,7 @@ func UpdateTags(ctx context.Context, conn appconfigiface.AppConfigAPI, identifie return nil } + +func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags interface{}, newTags interface{}) error { + return UpdateTags(ctx, meta.(*conns.AWSClient).AppConfigConn(), identifier, oldTags, newTags) +} diff --git a/internal/service/appflow/tags_gen.go b/internal/service/appflow/tags_gen.go index 0d3e1805909d..b93a495e6475 100644 --- a/internal/service/appflow/tags_gen.go +++ b/internal/service/appflow/tags_gen.go @@ -8,6 +8,7 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/appflow" "github.com/aws/aws-sdk-go/service/appflow/appflowiface" + "github.com/hashicorp/terraform-provider-aws/internal/conns" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" ) @@ -75,3 +76,7 @@ func UpdateTags(ctx context.Context, conn appflowiface.AppflowAPI, identifier st return nil } + +func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags interface{}, newTags interface{}) error { + return UpdateTags(ctx, meta.(*conns.AWSClient).AppFlowConn(), identifier, oldTags, newTags) +} diff --git a/internal/service/appintegrations/tags_gen.go b/internal/service/appintegrations/tags_gen.go index 3eed37c49349..abc54c6f513d 100644 --- a/internal/service/appintegrations/tags_gen.go +++ b/internal/service/appintegrations/tags_gen.go @@ -8,6 +8,7 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/appintegrationsservice" "github.com/aws/aws-sdk-go/service/appintegrationsservice/appintegrationsserviceiface" + "github.com/hashicorp/terraform-provider-aws/internal/conns" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" ) @@ -58,3 +59,7 @@ func UpdateTags(ctx context.Context, conn appintegrationsserviceiface.AppIntegra return nil } + +func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags interface{}, newTags interface{}) error { + return UpdateTags(ctx, meta.(*conns.AWSClient).AppIntegrationsConn(), identifier, oldTags, newTags) +} diff --git a/internal/service/applicationinsights/tags_gen.go b/internal/service/applicationinsights/tags_gen.go index e92ea6523c6c..1001286dcecf 100644 --- a/internal/service/applicationinsights/tags_gen.go +++ b/internal/service/applicationinsights/tags_gen.go @@ -8,6 +8,7 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/applicationinsights" "github.com/aws/aws-sdk-go/service/applicationinsights/applicationinsightsiface" + "github.com/hashicorp/terraform-provider-aws/internal/conns" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" ) @@ -92,3 +93,7 @@ func UpdateTags(ctx context.Context, conn applicationinsightsiface.ApplicationIn return nil } + +func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags interface{}, newTags interface{}) error { + return UpdateTags(ctx, meta.(*conns.AWSClient).ApplicationInsightsConn(), identifier, oldTags, newTags) +} diff --git a/internal/service/appmesh/tags_gen.go b/internal/service/appmesh/tags_gen.go index 48a43718f70a..1917664739d6 100644 --- a/internal/service/appmesh/tags_gen.go +++ b/internal/service/appmesh/tags_gen.go @@ -8,6 +8,7 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/appmesh" "github.com/aws/aws-sdk-go/service/appmesh/appmeshiface" + "github.com/hashicorp/terraform-provider-aws/internal/conns" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" ) @@ -92,3 +93,7 @@ func UpdateTags(ctx context.Context, conn appmeshiface.AppMeshAPI, identifier st return nil } + +func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags interface{}, newTags interface{}) error { + return UpdateTags(ctx, meta.(*conns.AWSClient).AppMeshConn(), identifier, oldTags, newTags) +} diff --git a/internal/service/apprunner/tags_gen.go b/internal/service/apprunner/tags_gen.go index efc5194ecc9c..f5608aa2f1b1 100644 --- a/internal/service/apprunner/tags_gen.go +++ b/internal/service/apprunner/tags_gen.go @@ -8,6 +8,7 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/apprunner" "github.com/aws/aws-sdk-go/service/apprunner/apprunneriface" + "github.com/hashicorp/terraform-provider-aws/internal/conns" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" ) @@ -92,3 +93,7 @@ func UpdateTags(ctx context.Context, conn apprunneriface.AppRunnerAPI, identifie return nil } + +func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags interface{}, newTags interface{}) error { + return UpdateTags(ctx, meta.(*conns.AWSClient).AppRunnerConn(), identifier, oldTags, newTags) +} diff --git a/internal/service/appstream/tags_gen.go b/internal/service/appstream/tags_gen.go index 4a62b995f47a..24c979d21aff 100644 --- a/internal/service/appstream/tags_gen.go +++ b/internal/service/appstream/tags_gen.go @@ -8,6 +8,7 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/appstream" "github.com/aws/aws-sdk-go/service/appstream/appstreamiface" + "github.com/hashicorp/terraform-provider-aws/internal/conns" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" ) @@ -75,3 +76,7 @@ func UpdateTags(ctx context.Context, conn appstreamiface.AppStreamAPI, identifie return nil } + +func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags interface{}, newTags interface{}) error { + return UpdateTags(ctx, meta.(*conns.AWSClient).AppStreamConn(), identifier, oldTags, newTags) +} diff --git a/internal/service/appsync/tags_gen.go b/internal/service/appsync/tags_gen.go index 2b97b0528d13..a590c54e3919 100644 --- a/internal/service/appsync/tags_gen.go +++ b/internal/service/appsync/tags_gen.go @@ -8,6 +8,7 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/appsync" "github.com/aws/aws-sdk-go/service/appsync/appsynciface" + "github.com/hashicorp/terraform-provider-aws/internal/conns" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" ) @@ -75,3 +76,7 @@ func UpdateTags(ctx context.Context, conn appsynciface.AppSyncAPI, identifier st return nil } + +func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags interface{}, newTags interface{}) error { + return UpdateTags(ctx, meta.(*conns.AWSClient).AppSyncConn(), identifier, oldTags, newTags) +} diff --git a/internal/service/athena/tags_gen.go b/internal/service/athena/tags_gen.go index f1d8977ad43a..96279b7c71e9 100644 --- a/internal/service/athena/tags_gen.go +++ b/internal/service/athena/tags_gen.go @@ -8,6 +8,7 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/athena" "github.com/aws/aws-sdk-go/service/athena/athenaiface" + "github.com/hashicorp/terraform-provider-aws/internal/conns" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" ) @@ -92,3 +93,7 @@ func UpdateTags(ctx context.Context, conn athenaiface.AthenaAPI, identifier stri return nil } + +func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags interface{}, newTags interface{}) error { + return UpdateTags(ctx, meta.(*conns.AWSClient).AthenaConn(), identifier, oldTags, newTags) +} diff --git a/internal/service/autoscaling/tags_gen.go b/internal/service/autoscaling/tags_gen.go index 32c498dfbbcc..f2fbb17bf447 100644 --- a/internal/service/autoscaling/tags_gen.go +++ b/internal/service/autoscaling/tags_gen.go @@ -10,6 +10,7 @@ import ( "github.com/aws/aws-sdk-go/service/autoscaling" "github.com/aws/aws-sdk-go/service/autoscaling/autoscalingiface" "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/tfresource" ) @@ -261,3 +262,7 @@ func UpdateTags(ctx context.Context, conn autoscalingiface.AutoScalingAPI, ident return nil } + +func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, resourceType string, oldTags interface{}, newTags interface{}) error { + return UpdateTags(ctx, meta.(*conns.AWSClient).AutoScalingConn(), identifier, resourceType, oldTags, newTags) +} diff --git a/internal/service/backup/tags_gen.go b/internal/service/backup/tags_gen.go index 534110ce32cd..59c41e84e8e8 100644 --- a/internal/service/backup/tags_gen.go +++ b/internal/service/backup/tags_gen.go @@ -8,6 +8,7 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/backup" "github.com/aws/aws-sdk-go/service/backup/backupiface" + "github.com/hashicorp/terraform-provider-aws/internal/conns" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" ) @@ -75,3 +76,7 @@ func UpdateTags(ctx context.Context, conn backupiface.BackupAPI, identifier stri return nil } + +func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags interface{}, newTags interface{}) error { + return UpdateTags(ctx, meta.(*conns.AWSClient).BackupConn(), identifier, oldTags, newTags) +} diff --git a/internal/service/batch/tags_gen.go b/internal/service/batch/tags_gen.go index 3537cd6fddc9..bad37c0ec5fa 100644 --- a/internal/service/batch/tags_gen.go +++ b/internal/service/batch/tags_gen.go @@ -8,6 +8,7 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/batch" "github.com/aws/aws-sdk-go/service/batch/batchiface" + "github.com/hashicorp/terraform-provider-aws/internal/conns" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" ) @@ -95,3 +96,7 @@ func UpdateTags(ctx context.Context, conn batchiface.BatchAPI, identifier string return nil } + +func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags interface{}, newTags interface{}) error { + return UpdateTags(ctx, meta.(*conns.AWSClient).BatchConn(), identifier, oldTags, newTags) +} diff --git a/internal/service/ce/tags_gen.go b/internal/service/ce/tags_gen.go index 7db339edb98f..69ce0de98254 100644 --- a/internal/service/ce/tags_gen.go +++ b/internal/service/ce/tags_gen.go @@ -8,6 +8,7 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/costexplorer" "github.com/aws/aws-sdk-go/service/costexplorer/costexploreriface" + "github.com/hashicorp/terraform-provider-aws/internal/conns" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" ) @@ -92,3 +93,7 @@ func UpdateTags(ctx context.Context, conn costexploreriface.CostExplorerAPI, ide return nil } + +func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags interface{}, newTags interface{}) error { + return UpdateTags(ctx, meta.(*conns.AWSClient).CEConn(), identifier, oldTags, newTags) +} diff --git a/internal/service/cloud9/tags_gen.go b/internal/service/cloud9/tags_gen.go index b9060d42ede2..150f3a17d089 100644 --- a/internal/service/cloud9/tags_gen.go +++ b/internal/service/cloud9/tags_gen.go @@ -8,6 +8,7 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/cloud9" "github.com/aws/aws-sdk-go/service/cloud9/cloud9iface" + "github.com/hashicorp/terraform-provider-aws/internal/conns" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" ) @@ -92,3 +93,7 @@ func UpdateTags(ctx context.Context, conn cloud9iface.Cloud9API, identifier stri return nil } + +func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags interface{}, newTags interface{}) error { + return UpdateTags(ctx, meta.(*conns.AWSClient).Cloud9Conn(), identifier, oldTags, newTags) +} diff --git a/internal/service/cloudfront/tags_gen.go b/internal/service/cloudfront/tags_gen.go index c724df0e4eaa..c1cc6b364904 100644 --- a/internal/service/cloudfront/tags_gen.go +++ b/internal/service/cloudfront/tags_gen.go @@ -8,6 +8,7 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/cloudfront" "github.com/aws/aws-sdk-go/service/cloudfront/cloudfrontiface" + "github.com/hashicorp/terraform-provider-aws/internal/conns" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" ) @@ -92,3 +93,7 @@ func UpdateTags(ctx context.Context, conn cloudfrontiface.CloudFrontAPI, identif return nil } + +func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags interface{}, newTags interface{}) error { + return UpdateTags(ctx, meta.(*conns.AWSClient).CloudFrontConn(), identifier, oldTags, newTags) +} diff --git a/internal/service/cloudhsmv2/tags_gen.go b/internal/service/cloudhsmv2/tags_gen.go index 64ca0786e361..ca2d822483eb 100644 --- a/internal/service/cloudhsmv2/tags_gen.go +++ b/internal/service/cloudhsmv2/tags_gen.go @@ -8,6 +8,7 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/cloudhsmv2" "github.com/aws/aws-sdk-go/service/cloudhsmv2/cloudhsmv2iface" + "github.com/hashicorp/terraform-provider-aws/internal/conns" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" ) @@ -92,3 +93,7 @@ func UpdateTags(ctx context.Context, conn cloudhsmv2iface.CloudHSMV2API, identif return nil } + +func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags interface{}, newTags interface{}) error { + return UpdateTags(ctx, meta.(*conns.AWSClient).CloudHSMV2Conn(), identifier, oldTags, newTags) +} diff --git a/internal/service/cloudtrail/tags_gen.go b/internal/service/cloudtrail/tags_gen.go index dd6b77dbeaf2..24f6040170b0 100644 --- a/internal/service/cloudtrail/tags_gen.go +++ b/internal/service/cloudtrail/tags_gen.go @@ -8,6 +8,7 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/cloudtrail" "github.com/aws/aws-sdk-go/service/cloudtrail/cloudtrailiface" + "github.com/hashicorp/terraform-provider-aws/internal/conns" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" ) @@ -92,3 +93,7 @@ func UpdateTags(ctx context.Context, conn cloudtrailiface.CloudTrailAPI, identif return nil } + +func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags interface{}, newTags interface{}) error { + return UpdateTags(ctx, meta.(*conns.AWSClient).CloudTrailConn(), identifier, oldTags, newTags) +} diff --git a/internal/service/cloudwatch/tags_gen.go b/internal/service/cloudwatch/tags_gen.go index 04ee5db0f721..e8f73ed9ce67 100644 --- a/internal/service/cloudwatch/tags_gen.go +++ b/internal/service/cloudwatch/tags_gen.go @@ -8,6 +8,7 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/cloudwatch" "github.com/aws/aws-sdk-go/service/cloudwatch/cloudwatchiface" + "github.com/hashicorp/terraform-provider-aws/internal/conns" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" ) @@ -92,3 +93,7 @@ func UpdateTags(ctx context.Context, conn cloudwatchiface.CloudWatchAPI, identif return nil } + +func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags interface{}, newTags interface{}) error { + return UpdateTags(ctx, meta.(*conns.AWSClient).CloudWatchConn(), identifier, oldTags, newTags) +} diff --git a/internal/service/codeartifact/tags_gen.go b/internal/service/codeartifact/tags_gen.go index 5fe21a2efec7..07711705f530 100644 --- a/internal/service/codeartifact/tags_gen.go +++ b/internal/service/codeartifact/tags_gen.go @@ -8,6 +8,7 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/codeartifact" "github.com/aws/aws-sdk-go/service/codeartifact/codeartifactiface" + "github.com/hashicorp/terraform-provider-aws/internal/conns" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" ) @@ -92,3 +93,7 @@ func UpdateTags(ctx context.Context, conn codeartifactiface.CodeArtifactAPI, ide return nil } + +func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags interface{}, newTags interface{}) error { + return UpdateTags(ctx, meta.(*conns.AWSClient).CodeArtifactConn(), identifier, oldTags, newTags) +} diff --git a/internal/service/codecommit/tags_gen.go b/internal/service/codecommit/tags_gen.go index cdb47479758c..33a49e2f84de 100644 --- a/internal/service/codecommit/tags_gen.go +++ b/internal/service/codecommit/tags_gen.go @@ -8,6 +8,7 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/codecommit" "github.com/aws/aws-sdk-go/service/codecommit/codecommitiface" + "github.com/hashicorp/terraform-provider-aws/internal/conns" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" ) @@ -75,3 +76,7 @@ func UpdateTags(ctx context.Context, conn codecommitiface.CodeCommitAPI, identif return nil } + +func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags interface{}, newTags interface{}) error { + return UpdateTags(ctx, meta.(*conns.AWSClient).CodeCommitConn(), identifier, oldTags, newTags) +} diff --git a/internal/service/codepipeline/tags_gen.go b/internal/service/codepipeline/tags_gen.go index c7638333ef1a..30adc24e2934 100644 --- a/internal/service/codepipeline/tags_gen.go +++ b/internal/service/codepipeline/tags_gen.go @@ -8,6 +8,7 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/codepipeline" "github.com/aws/aws-sdk-go/service/codepipeline/codepipelineiface" + "github.com/hashicorp/terraform-provider-aws/internal/conns" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" ) @@ -92,3 +93,7 @@ func UpdateTags(ctx context.Context, conn codepipelineiface.CodePipelineAPI, ide return nil } + +func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags interface{}, newTags interface{}) error { + return UpdateTags(ctx, meta.(*conns.AWSClient).CodePipelineConn(), identifier, oldTags, newTags) +} diff --git a/internal/service/codestarconnections/tags_gen.go b/internal/service/codestarconnections/tags_gen.go index f78bef1a0824..8a465d1a29c8 100644 --- a/internal/service/codestarconnections/tags_gen.go +++ b/internal/service/codestarconnections/tags_gen.go @@ -8,6 +8,7 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/codestarconnections" "github.com/aws/aws-sdk-go/service/codestarconnections/codestarconnectionsiface" + "github.com/hashicorp/terraform-provider-aws/internal/conns" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" ) @@ -92,3 +93,7 @@ func UpdateTags(ctx context.Context, conn codestarconnectionsiface.CodeStarConne return nil } + +func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags interface{}, newTags interface{}) error { + return UpdateTags(ctx, meta.(*conns.AWSClient).CodeStarConnectionsConn(), identifier, oldTags, newTags) +} diff --git a/internal/service/codestarnotifications/tags_gen.go b/internal/service/codestarnotifications/tags_gen.go index 937f106fa43b..b8eaa20b92d8 100644 --- a/internal/service/codestarnotifications/tags_gen.go +++ b/internal/service/codestarnotifications/tags_gen.go @@ -8,6 +8,7 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/codestarnotifications" "github.com/aws/aws-sdk-go/service/codestarnotifications/codestarnotificationsiface" + "github.com/hashicorp/terraform-provider-aws/internal/conns" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" ) @@ -75,3 +76,7 @@ func UpdateTags(ctx context.Context, conn codestarnotificationsiface.CodeStarNot return nil } + +func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags interface{}, newTags interface{}) error { + return UpdateTags(ctx, meta.(*conns.AWSClient).CodeStarNotificationsConn(), identifier, oldTags, newTags) +} diff --git a/internal/service/cognitoidentity/tags_gen.go b/internal/service/cognitoidentity/tags_gen.go index 4d3047f4dddc..d75f21e58a53 100644 --- a/internal/service/cognitoidentity/tags_gen.go +++ b/internal/service/cognitoidentity/tags_gen.go @@ -8,6 +8,7 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/cognitoidentity" "github.com/aws/aws-sdk-go/service/cognitoidentity/cognitoidentityiface" + "github.com/hashicorp/terraform-provider-aws/internal/conns" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" ) @@ -75,3 +76,7 @@ func UpdateTags(ctx context.Context, conn cognitoidentityiface.CognitoIdentityAP return nil } + +func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags interface{}, newTags interface{}) error { + return UpdateTags(ctx, meta.(*conns.AWSClient).CognitoIdentityConn(), identifier, oldTags, newTags) +} diff --git a/internal/service/cognitoidp/tags_gen.go b/internal/service/cognitoidp/tags_gen.go index 5cf444c7aed9..e2481279bcb9 100644 --- a/internal/service/cognitoidp/tags_gen.go +++ b/internal/service/cognitoidp/tags_gen.go @@ -8,6 +8,7 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/cognitoidentityprovider" "github.com/aws/aws-sdk-go/service/cognitoidentityprovider/cognitoidentityprovideriface" + "github.com/hashicorp/terraform-provider-aws/internal/conns" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" ) @@ -75,3 +76,7 @@ func UpdateTags(ctx context.Context, conn cognitoidentityprovideriface.CognitoId return nil } + +func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags interface{}, newTags interface{}) error { + return UpdateTags(ctx, meta.(*conns.AWSClient).CognitoIDPConn(), identifier, oldTags, newTags) +} diff --git a/internal/service/configservice/tags_gen.go b/internal/service/configservice/tags_gen.go index b0f380296854..23b01552b159 100644 --- a/internal/service/configservice/tags_gen.go +++ b/internal/service/configservice/tags_gen.go @@ -8,6 +8,7 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/configservice" "github.com/aws/aws-sdk-go/service/configservice/configserviceiface" + "github.com/hashicorp/terraform-provider-aws/internal/conns" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" ) @@ -92,3 +93,7 @@ func UpdateTags(ctx context.Context, conn configserviceiface.ConfigServiceAPI, i return nil } + +func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags interface{}, newTags interface{}) error { + return UpdateTags(ctx, meta.(*conns.AWSClient).ConfigServiceConn(), identifier, oldTags, newTags) +} diff --git a/internal/service/connect/tags_gen.go b/internal/service/connect/tags_gen.go index fdbd7f1d2b09..69c9f709bd3f 100644 --- a/internal/service/connect/tags_gen.go +++ b/internal/service/connect/tags_gen.go @@ -8,6 +8,7 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/connect" "github.com/aws/aws-sdk-go/service/connect/connectiface" + "github.com/hashicorp/terraform-provider-aws/internal/conns" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" ) @@ -58,3 +59,7 @@ func UpdateTags(ctx context.Context, conn connectiface.ConnectAPI, identifier st return nil } + +func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags interface{}, newTags interface{}) error { + return UpdateTags(ctx, meta.(*conns.AWSClient).ConnectConn(), identifier, oldTags, newTags) +} diff --git a/internal/service/dataexchange/tags_gen.go b/internal/service/dataexchange/tags_gen.go index d44c3fd62552..90daf88db35d 100644 --- a/internal/service/dataexchange/tags_gen.go +++ b/internal/service/dataexchange/tags_gen.go @@ -8,6 +8,7 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/dataexchange" "github.com/aws/aws-sdk-go/service/dataexchange/dataexchangeiface" + "github.com/hashicorp/terraform-provider-aws/internal/conns" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" ) @@ -75,3 +76,7 @@ func UpdateTags(ctx context.Context, conn dataexchangeiface.DataExchangeAPI, ide return nil } + +func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags interface{}, newTags interface{}) error { + return UpdateTags(ctx, meta.(*conns.AWSClient).DataExchangeConn(), identifier, oldTags, newTags) +} diff --git a/internal/service/datapipeline/tags_gen.go b/internal/service/datapipeline/tags_gen.go index 4fa7a43d3f18..609c93752d4b 100644 --- a/internal/service/datapipeline/tags_gen.go +++ b/internal/service/datapipeline/tags_gen.go @@ -8,6 +8,7 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/datapipeline" "github.com/aws/aws-sdk-go/service/datapipeline/datapipelineiface" + "github.com/hashicorp/terraform-provider-aws/internal/conns" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" ) @@ -75,3 +76,7 @@ func UpdateTags(ctx context.Context, conn datapipelineiface.DataPipelineAPI, ide return nil } + +func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags interface{}, newTags interface{}) error { + return UpdateTags(ctx, meta.(*conns.AWSClient).DataPipelineConn(), identifier, oldTags, newTags) +} diff --git a/internal/service/datasync/tags_gen.go b/internal/service/datasync/tags_gen.go index 086a48c275b2..1b71f0a6eba4 100644 --- a/internal/service/datasync/tags_gen.go +++ b/internal/service/datasync/tags_gen.go @@ -8,6 +8,7 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/datasync" "github.com/aws/aws-sdk-go/service/datasync/datasynciface" + "github.com/hashicorp/terraform-provider-aws/internal/conns" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" ) @@ -92,3 +93,7 @@ func UpdateTags(ctx context.Context, conn datasynciface.DataSyncAPI, identifier return nil } + +func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags interface{}, newTags interface{}) error { + return UpdateTags(ctx, meta.(*conns.AWSClient).DataSyncConn(), identifier, oldTags, newTags) +} diff --git a/internal/service/dax/tags_gen.go b/internal/service/dax/tags_gen.go index d539155ac5e4..6780ad94c30f 100644 --- a/internal/service/dax/tags_gen.go +++ b/internal/service/dax/tags_gen.go @@ -8,6 +8,7 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/dax" "github.com/aws/aws-sdk-go/service/dax/daxiface" + "github.com/hashicorp/terraform-provider-aws/internal/conns" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" ) @@ -92,3 +93,7 @@ func UpdateTags(ctx context.Context, conn daxiface.DAXAPI, identifier string, ol return nil } + +func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags interface{}, newTags interface{}) error { + return UpdateTags(ctx, meta.(*conns.AWSClient).DAXConn(), identifier, oldTags, newTags) +} diff --git a/internal/service/deploy/tags_gen.go b/internal/service/deploy/tags_gen.go index 8957137f8451..40daedeb9cd3 100644 --- a/internal/service/deploy/tags_gen.go +++ b/internal/service/deploy/tags_gen.go @@ -8,6 +8,7 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/codedeploy" "github.com/aws/aws-sdk-go/service/codedeploy/codedeployiface" + "github.com/hashicorp/terraform-provider-aws/internal/conns" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" ) @@ -92,3 +93,7 @@ func UpdateTags(ctx context.Context, conn codedeployiface.CodeDeployAPI, identif return nil } + +func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags interface{}, newTags interface{}) error { + return UpdateTags(ctx, meta.(*conns.AWSClient).DeployConn(), identifier, oldTags, newTags) +} diff --git a/internal/service/detective/tags_gen.go b/internal/service/detective/tags_gen.go index 4ed417be3bb2..7dead3b25721 100644 --- a/internal/service/detective/tags_gen.go +++ b/internal/service/detective/tags_gen.go @@ -8,6 +8,7 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/detective" "github.com/aws/aws-sdk-go/service/detective/detectiveiface" + "github.com/hashicorp/terraform-provider-aws/internal/conns" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" ) @@ -75,3 +76,7 @@ func UpdateTags(ctx context.Context, conn detectiveiface.DetectiveAPI, identifie return nil } + +func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags interface{}, newTags interface{}) error { + return UpdateTags(ctx, meta.(*conns.AWSClient).DetectiveConn(), identifier, oldTags, newTags) +} diff --git a/internal/service/devicefarm/tags_gen.go b/internal/service/devicefarm/tags_gen.go index d41c0aa88a8a..057294c5b5f8 100644 --- a/internal/service/devicefarm/tags_gen.go +++ b/internal/service/devicefarm/tags_gen.go @@ -8,6 +8,7 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/devicefarm" "github.com/aws/aws-sdk-go/service/devicefarm/devicefarmiface" + "github.com/hashicorp/terraform-provider-aws/internal/conns" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" ) @@ -92,3 +93,7 @@ func UpdateTags(ctx context.Context, conn devicefarmiface.DeviceFarmAPI, identif return nil } + +func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags interface{}, newTags interface{}) error { + return UpdateTags(ctx, meta.(*conns.AWSClient).DeviceFarmConn(), identifier, oldTags, newTags) +} diff --git a/internal/service/directconnect/tags_gen.go b/internal/service/directconnect/tags_gen.go index 22606f922825..7b234a0989a4 100644 --- a/internal/service/directconnect/tags_gen.go +++ b/internal/service/directconnect/tags_gen.go @@ -8,6 +8,7 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/directconnect" "github.com/aws/aws-sdk-go/service/directconnect/directconnectiface" + "github.com/hashicorp/terraform-provider-aws/internal/conns" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" ) @@ -92,3 +93,7 @@ func UpdateTags(ctx context.Context, conn directconnectiface.DirectConnectAPI, i return nil } + +func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags interface{}, newTags interface{}) error { + return UpdateTags(ctx, meta.(*conns.AWSClient).DirectConnectConn(), identifier, oldTags, newTags) +} diff --git a/internal/service/dlm/tags_gen.go b/internal/service/dlm/tags_gen.go index 85a517873378..ac648fb7e742 100644 --- a/internal/service/dlm/tags_gen.go +++ b/internal/service/dlm/tags_gen.go @@ -8,6 +8,7 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/dlm" "github.com/aws/aws-sdk-go/service/dlm/dlmiface" + "github.com/hashicorp/terraform-provider-aws/internal/conns" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" ) @@ -75,3 +76,7 @@ func UpdateTags(ctx context.Context, conn dlmiface.DLMAPI, identifier string, ol return nil } + +func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags interface{}, newTags interface{}) error { + return UpdateTags(ctx, meta.(*conns.AWSClient).DLMConn(), identifier, oldTags, newTags) +} diff --git a/internal/service/dms/tags_gen.go b/internal/service/dms/tags_gen.go index c231e003b014..a2c610b489b8 100644 --- a/internal/service/dms/tags_gen.go +++ b/internal/service/dms/tags_gen.go @@ -8,6 +8,7 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/databasemigrationservice" "github.com/aws/aws-sdk-go/service/databasemigrationservice/databasemigrationserviceiface" + "github.com/hashicorp/terraform-provider-aws/internal/conns" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" ) @@ -92,3 +93,7 @@ func UpdateTags(ctx context.Context, conn databasemigrationserviceiface.Database return nil } + +func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags interface{}, newTags interface{}) error { + return UpdateTags(ctx, meta.(*conns.AWSClient).DMSConn(), identifier, oldTags, newTags) +} diff --git a/internal/service/docdb/tags_gen.go b/internal/service/docdb/tags_gen.go index fd68afe29008..9b96ccbfdfd7 100644 --- a/internal/service/docdb/tags_gen.go +++ b/internal/service/docdb/tags_gen.go @@ -8,6 +8,7 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/docdb" "github.com/aws/aws-sdk-go/service/docdb/docdbiface" + "github.com/hashicorp/terraform-provider-aws/internal/conns" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" ) @@ -92,3 +93,7 @@ func UpdateTags(ctx context.Context, conn docdbiface.DocDBAPI, identifier string return nil } + +func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags interface{}, newTags interface{}) error { + return UpdateTags(ctx, meta.(*conns.AWSClient).DocDBConn(), identifier, oldTags, newTags) +} diff --git a/internal/service/ds/tags_gen.go b/internal/service/ds/tags_gen.go index 3461c22ae008..a207fa83a525 100644 --- a/internal/service/ds/tags_gen.go +++ b/internal/service/ds/tags_gen.go @@ -8,6 +8,7 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/directoryservice" "github.com/aws/aws-sdk-go/service/directoryservice/directoryserviceiface" + "github.com/hashicorp/terraform-provider-aws/internal/conns" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" ) @@ -92,3 +93,7 @@ func UpdateTags(ctx context.Context, conn directoryserviceiface.DirectoryService return nil } + +func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags interface{}, newTags interface{}) error { + return UpdateTags(ctx, meta.(*conns.AWSClient).DSConn(), identifier, oldTags, newTags) +} diff --git a/internal/service/dynamodb/tags_gen.go b/internal/service/dynamodb/tags_gen.go index e8f79786d200..fc2383ac74fa 100644 --- a/internal/service/dynamodb/tags_gen.go +++ b/internal/service/dynamodb/tags_gen.go @@ -10,6 +10,7 @@ import ( "github.com/aws/aws-sdk-go/service/dynamodb/dynamodbiface" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-provider-aws/internal/conns" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" ) @@ -121,3 +122,7 @@ func UpdateTags(ctx context.Context, conn dynamodbiface.DynamoDBAPI, identifier return nil } + +func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags interface{}, newTags interface{}) error { + return UpdateTags(ctx, meta.(*conns.AWSClient).DynamoDBConn(), identifier, oldTags, newTags) +} diff --git a/internal/service/ec2/tags_gen.go b/internal/service/ec2/tags_gen.go index 4deecbd3fa46..0a13547d9ef8 100644 --- a/internal/service/ec2/tags_gen.go +++ b/internal/service/ec2/tags_gen.go @@ -8,6 +8,7 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/ec2" "github.com/aws/aws-sdk-go/service/ec2/ec2iface" + "github.com/hashicorp/terraform-provider-aws/internal/conns" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" ) @@ -149,3 +150,7 @@ func UpdateTags(ctx context.Context, conn ec2iface.EC2API, identifier string, ol return nil } + +func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags interface{}, newTags interface{}) error { + return UpdateTags(ctx, meta.(*conns.AWSClient).EC2Conn(), identifier, oldTags, newTags) +} diff --git a/internal/service/ecr/tags_gen.go b/internal/service/ecr/tags_gen.go index 048d58e70046..ed90f35efed4 100644 --- a/internal/service/ecr/tags_gen.go +++ b/internal/service/ecr/tags_gen.go @@ -8,6 +8,7 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/ecr" "github.com/aws/aws-sdk-go/service/ecr/ecriface" + "github.com/hashicorp/terraform-provider-aws/internal/conns" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" ) @@ -92,3 +93,7 @@ func UpdateTags(ctx context.Context, conn ecriface.ECRAPI, identifier string, ol return nil } + +func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags interface{}, newTags interface{}) error { + return UpdateTags(ctx, meta.(*conns.AWSClient).ECRConn(), identifier, oldTags, newTags) +} diff --git a/internal/service/ecrpublic/tags_gen.go b/internal/service/ecrpublic/tags_gen.go index 37493d8abd51..e9a9caed5ea0 100644 --- a/internal/service/ecrpublic/tags_gen.go +++ b/internal/service/ecrpublic/tags_gen.go @@ -8,6 +8,7 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/ecrpublic" "github.com/aws/aws-sdk-go/service/ecrpublic/ecrpubliciface" + "github.com/hashicorp/terraform-provider-aws/internal/conns" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" ) @@ -92,3 +93,7 @@ func UpdateTags(ctx context.Context, conn ecrpubliciface.ECRPublicAPI, identifie return nil } + +func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags interface{}, newTags interface{}) error { + return UpdateTags(ctx, meta.(*conns.AWSClient).ECRPublicConn(), identifier, oldTags, newTags) +} diff --git a/internal/service/ecs/tags_gen.go b/internal/service/ecs/tags_gen.go index e0532b9b1bf2..dd51107af12f 100644 --- a/internal/service/ecs/tags_gen.go +++ b/internal/service/ecs/tags_gen.go @@ -10,6 +10,7 @@ import ( "github.com/aws/aws-sdk-go/service/ecs/ecsiface" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-provider-aws/internal/conns" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" ) @@ -121,3 +122,7 @@ func UpdateTags(ctx context.Context, conn ecsiface.ECSAPI, identifier string, ol return nil } + +func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags interface{}, newTags interface{}) error { + return UpdateTags(ctx, meta.(*conns.AWSClient).ECSConn(), identifier, oldTags, newTags) +} diff --git a/internal/service/efs/tags_gen.go b/internal/service/efs/tags_gen.go index 478e6751ddb2..f02df228d4f9 100644 --- a/internal/service/efs/tags_gen.go +++ b/internal/service/efs/tags_gen.go @@ -8,6 +8,7 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/efs" "github.com/aws/aws-sdk-go/service/efs/efsiface" + "github.com/hashicorp/terraform-provider-aws/internal/conns" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" ) @@ -92,3 +93,7 @@ func UpdateTags(ctx context.Context, conn efsiface.EFSAPI, identifier string, ol return nil } + +func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags interface{}, newTags interface{}) error { + return UpdateTags(ctx, meta.(*conns.AWSClient).EFSConn(), identifier, oldTags, newTags) +} diff --git a/internal/service/eks/tags_gen.go b/internal/service/eks/tags_gen.go index 6a2799d7fef1..28d0296b9d24 100644 --- a/internal/service/eks/tags_gen.go +++ b/internal/service/eks/tags_gen.go @@ -8,6 +8,7 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/eks" "github.com/aws/aws-sdk-go/service/eks/eksiface" + "github.com/hashicorp/terraform-provider-aws/internal/conns" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" ) @@ -75,3 +76,7 @@ func UpdateTags(ctx context.Context, conn eksiface.EKSAPI, identifier string, ol return nil } + +func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags interface{}, newTags interface{}) error { + return UpdateTags(ctx, meta.(*conns.AWSClient).EKSConn(), identifier, oldTags, newTags) +} diff --git a/internal/service/elasticache/tags_gen.go b/internal/service/elasticache/tags_gen.go index fdd323453d68..9b312baec12e 100644 --- a/internal/service/elasticache/tags_gen.go +++ b/internal/service/elasticache/tags_gen.go @@ -8,6 +8,7 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/elasticache" "github.com/aws/aws-sdk-go/service/elasticache/elasticacheiface" + "github.com/hashicorp/terraform-provider-aws/internal/conns" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" ) @@ -92,3 +93,7 @@ func UpdateTags(ctx context.Context, conn elasticacheiface.ElastiCacheAPI, ident return nil } + +func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags interface{}, newTags interface{}) error { + return UpdateTags(ctx, meta.(*conns.AWSClient).ElastiCacheConn(), identifier, oldTags, newTags) +} diff --git a/internal/service/elasticbeanstalk/tags_gen.go b/internal/service/elasticbeanstalk/tags_gen.go index 2ee0bb59dbcb..5a182327721b 100644 --- a/internal/service/elasticbeanstalk/tags_gen.go +++ b/internal/service/elasticbeanstalk/tags_gen.go @@ -8,6 +8,7 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/elasticbeanstalk" "github.com/aws/aws-sdk-go/service/elasticbeanstalk/elasticbeanstalkiface" + "github.com/hashicorp/terraform-provider-aws/internal/conns" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" ) @@ -91,3 +92,7 @@ func UpdateTags(ctx context.Context, conn elasticbeanstalkiface.ElasticBeanstalk return nil } + +func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags interface{}, newTags interface{}) error { + return UpdateTags(ctx, meta.(*conns.AWSClient).ElasticBeanstalkConn(), identifier, oldTags, newTags) +} diff --git a/internal/service/elasticsearch/tags_gen.go b/internal/service/elasticsearch/tags_gen.go index aed1647146fb..5ae1f77920d6 100644 --- a/internal/service/elasticsearch/tags_gen.go +++ b/internal/service/elasticsearch/tags_gen.go @@ -8,6 +8,7 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/elasticsearchservice" "github.com/aws/aws-sdk-go/service/elasticsearchservice/elasticsearchserviceiface" + "github.com/hashicorp/terraform-provider-aws/internal/conns" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" ) @@ -92,3 +93,7 @@ func UpdateTags(ctx context.Context, conn elasticsearchserviceiface.Elasticsearc return nil } + +func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags interface{}, newTags interface{}) error { + return UpdateTags(ctx, meta.(*conns.AWSClient).ElasticsearchConn(), identifier, oldTags, newTags) +} diff --git a/internal/service/elb/tags_gen.go b/internal/service/elb/tags_gen.go index faa00dfca33b..6b5d6aaea02e 100644 --- a/internal/service/elb/tags_gen.go +++ b/internal/service/elb/tags_gen.go @@ -8,6 +8,7 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/elb" "github.com/aws/aws-sdk-go/service/elb/elbiface" + "github.com/hashicorp/terraform-provider-aws/internal/conns" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" ) @@ -107,3 +108,7 @@ func UpdateTags(ctx context.Context, conn elbiface.ELBAPI, identifier string, ol return nil } + +func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags interface{}, newTags interface{}) error { + return UpdateTags(ctx, meta.(*conns.AWSClient).ELBConn(), identifier, oldTags, newTags) +} diff --git a/internal/service/elbv2/tags_gen.go b/internal/service/elbv2/tags_gen.go index 8ae46c400fd9..21a9559d0807 100644 --- a/internal/service/elbv2/tags_gen.go +++ b/internal/service/elbv2/tags_gen.go @@ -8,6 +8,7 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/elbv2" "github.com/aws/aws-sdk-go/service/elbv2/elbv2iface" + "github.com/hashicorp/terraform-provider-aws/internal/conns" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" ) @@ -92,3 +93,7 @@ func UpdateTags(ctx context.Context, conn elbv2iface.ELBV2API, identifier string return nil } + +func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags interface{}, newTags interface{}) error { + return UpdateTags(ctx, meta.(*conns.AWSClient).ELBV2Conn(), identifier, oldTags, newTags) +} diff --git a/internal/service/emr/tags_gen.go b/internal/service/emr/tags_gen.go index a5bd214f0aa9..a5a24bcaa10c 100644 --- a/internal/service/emr/tags_gen.go +++ b/internal/service/emr/tags_gen.go @@ -8,6 +8,7 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/emr" "github.com/aws/aws-sdk-go/service/emr/emriface" + "github.com/hashicorp/terraform-provider-aws/internal/conns" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" ) @@ -75,3 +76,7 @@ func UpdateTags(ctx context.Context, conn emriface.EMRAPI, identifier string, ol return nil } + +func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags interface{}, newTags interface{}) error { + return UpdateTags(ctx, meta.(*conns.AWSClient).EMRConn(), identifier, oldTags, newTags) +} diff --git a/internal/service/emrcontainers/tags_gen.go b/internal/service/emrcontainers/tags_gen.go index 927312bde510..ae8ff347d512 100644 --- a/internal/service/emrcontainers/tags_gen.go +++ b/internal/service/emrcontainers/tags_gen.go @@ -8,6 +8,7 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/emrcontainers" "github.com/aws/aws-sdk-go/service/emrcontainers/emrcontainersiface" + "github.com/hashicorp/terraform-provider-aws/internal/conns" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" ) @@ -75,3 +76,7 @@ func UpdateTags(ctx context.Context, conn emrcontainersiface.EMRContainersAPI, i return nil } + +func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags interface{}, newTags interface{}) error { + return UpdateTags(ctx, meta.(*conns.AWSClient).EMRContainersConn(), identifier, oldTags, newTags) +} diff --git a/internal/service/emrserverless/tags_gen.go b/internal/service/emrserverless/tags_gen.go index c6783e7bbe66..dfe5f50634a1 100644 --- a/internal/service/emrserverless/tags_gen.go +++ b/internal/service/emrserverless/tags_gen.go @@ -8,6 +8,7 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/emrserverless" "github.com/aws/aws-sdk-go/service/emrserverless/emrserverlessiface" + "github.com/hashicorp/terraform-provider-aws/internal/conns" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" ) @@ -75,3 +76,7 @@ func UpdateTags(ctx context.Context, conn emrserverlessiface.EMRServerlessAPI, i return nil } + +func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags interface{}, newTags interface{}) error { + return UpdateTags(ctx, meta.(*conns.AWSClient).EMRServerlessConn(), identifier, oldTags, newTags) +} diff --git a/internal/service/events/tags_gen.go b/internal/service/events/tags_gen.go index a52bd182e4ba..e464509643d6 100644 --- a/internal/service/events/tags_gen.go +++ b/internal/service/events/tags_gen.go @@ -8,6 +8,7 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/eventbridge" "github.com/aws/aws-sdk-go/service/eventbridge/eventbridgeiface" + "github.com/hashicorp/terraform-provider-aws/internal/conns" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" ) @@ -92,3 +93,7 @@ func UpdateTags(ctx context.Context, conn eventbridgeiface.EventBridgeAPI, ident return nil } + +func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags interface{}, newTags interface{}) error { + return UpdateTags(ctx, meta.(*conns.AWSClient).EventsConn(), identifier, oldTags, newTags) +} diff --git a/internal/service/evidently/tags_gen.go b/internal/service/evidently/tags_gen.go index 087f088af8d7..ea57d76ac48d 100644 --- a/internal/service/evidently/tags_gen.go +++ b/internal/service/evidently/tags_gen.go @@ -8,6 +8,7 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/cloudwatchevidently" "github.com/aws/aws-sdk-go/service/cloudwatchevidently/cloudwatchevidentlyiface" + "github.com/hashicorp/terraform-provider-aws/internal/conns" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" ) @@ -58,3 +59,7 @@ func UpdateTags(ctx context.Context, conn cloudwatchevidentlyiface.CloudWatchEvi return nil } + +func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags interface{}, newTags interface{}) error { + return UpdateTags(ctx, meta.(*conns.AWSClient).EvidentlyConn(), identifier, oldTags, newTags) +} diff --git a/internal/service/firehose/tags_gen.go b/internal/service/firehose/tags_gen.go index c443e3ac75f4..ff6dd6436d55 100644 --- a/internal/service/firehose/tags_gen.go +++ b/internal/service/firehose/tags_gen.go @@ -8,6 +8,7 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/firehose" "github.com/aws/aws-sdk-go/service/firehose/firehoseiface" + "github.com/hashicorp/terraform-provider-aws/internal/conns" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" ) @@ -92,3 +93,7 @@ func UpdateTags(ctx context.Context, conn firehoseiface.FirehoseAPI, identifier return nil } + +func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags interface{}, newTags interface{}) error { + return UpdateTags(ctx, meta.(*conns.AWSClient).FirehoseConn(), identifier, oldTags, newTags) +} diff --git a/internal/service/fms/tags_gen.go b/internal/service/fms/tags_gen.go index b3c9e7617dd9..05c21b7e528f 100644 --- a/internal/service/fms/tags_gen.go +++ b/internal/service/fms/tags_gen.go @@ -8,6 +8,7 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/fms" "github.com/aws/aws-sdk-go/service/fms/fmsiface" + "github.com/hashicorp/terraform-provider-aws/internal/conns" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" ) @@ -92,3 +93,7 @@ func UpdateTags(ctx context.Context, conn fmsiface.FMSAPI, identifier string, ol return nil } + +func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags interface{}, newTags interface{}) error { + return UpdateTags(ctx, meta.(*conns.AWSClient).FMSConn(), identifier, oldTags, newTags) +} diff --git a/internal/service/fsx/tags_gen.go b/internal/service/fsx/tags_gen.go index 329fbbe75d9d..e70adef4ea33 100644 --- a/internal/service/fsx/tags_gen.go +++ b/internal/service/fsx/tags_gen.go @@ -8,6 +8,7 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/fsx" "github.com/aws/aws-sdk-go/service/fsx/fsxiface" + "github.com/hashicorp/terraform-provider-aws/internal/conns" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" ) @@ -92,3 +93,7 @@ func UpdateTags(ctx context.Context, conn fsxiface.FSxAPI, identifier string, ol return nil } + +func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags interface{}, newTags interface{}) error { + return UpdateTags(ctx, meta.(*conns.AWSClient).FSxConn(), identifier, oldTags, newTags) +} diff --git a/internal/service/gamelift/tags_gen.go b/internal/service/gamelift/tags_gen.go index 87b8a2b9e65d..8a06aaa27d5a 100644 --- a/internal/service/gamelift/tags_gen.go +++ b/internal/service/gamelift/tags_gen.go @@ -8,6 +8,7 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/gamelift" "github.com/aws/aws-sdk-go/service/gamelift/gameliftiface" + "github.com/hashicorp/terraform-provider-aws/internal/conns" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" ) @@ -92,3 +93,7 @@ func UpdateTags(ctx context.Context, conn gameliftiface.GameLiftAPI, identifier return nil } + +func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags interface{}, newTags interface{}) error { + return UpdateTags(ctx, meta.(*conns.AWSClient).GameLiftConn(), identifier, oldTags, newTags) +} diff --git a/internal/service/glacier/tags_gen.go b/internal/service/glacier/tags_gen.go index 6a6f463b9e33..c66dc3ebb5ce 100644 --- a/internal/service/glacier/tags_gen.go +++ b/internal/service/glacier/tags_gen.go @@ -8,6 +8,7 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/glacier" "github.com/aws/aws-sdk-go/service/glacier/glacieriface" + "github.com/hashicorp/terraform-provider-aws/internal/conns" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" ) @@ -75,3 +76,7 @@ func UpdateTags(ctx context.Context, conn glacieriface.GlacierAPI, identifier st return nil } + +func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags interface{}, newTags interface{}) error { + return UpdateTags(ctx, meta.(*conns.AWSClient).GlacierConn(), identifier, oldTags, newTags) +} diff --git a/internal/service/globalaccelerator/tags_gen.go b/internal/service/globalaccelerator/tags_gen.go index 332a2d69e646..164a50bc43b6 100644 --- a/internal/service/globalaccelerator/tags_gen.go +++ b/internal/service/globalaccelerator/tags_gen.go @@ -8,6 +8,7 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/globalaccelerator" "github.com/aws/aws-sdk-go/service/globalaccelerator/globalacceleratoriface" + "github.com/hashicorp/terraform-provider-aws/internal/conns" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" ) @@ -92,3 +93,7 @@ func UpdateTags(ctx context.Context, conn globalacceleratoriface.GlobalAccelerat return nil } + +func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags interface{}, newTags interface{}) error { + return UpdateTags(ctx, meta.(*conns.AWSClient).GlobalAcceleratorConn(), identifier, oldTags, newTags) +} diff --git a/internal/service/glue/tags_gen.go b/internal/service/glue/tags_gen.go index 592f6c17f2fc..722f17584f75 100644 --- a/internal/service/glue/tags_gen.go +++ b/internal/service/glue/tags_gen.go @@ -8,6 +8,7 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/glue" "github.com/aws/aws-sdk-go/service/glue/glueiface" + "github.com/hashicorp/terraform-provider-aws/internal/conns" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" ) @@ -75,3 +76,7 @@ func UpdateTags(ctx context.Context, conn glueiface.GlueAPI, identifier string, return nil } + +func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags interface{}, newTags interface{}) error { + return UpdateTags(ctx, meta.(*conns.AWSClient).GlueConn(), identifier, oldTags, newTags) +} diff --git a/internal/service/grafana/tags_gen.go b/internal/service/grafana/tags_gen.go index 352ddb1f26eb..78d84c60af91 100644 --- a/internal/service/grafana/tags_gen.go +++ b/internal/service/grafana/tags_gen.go @@ -8,6 +8,7 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/managedgrafana" "github.com/aws/aws-sdk-go/service/managedgrafana/managedgrafanaiface" + "github.com/hashicorp/terraform-provider-aws/internal/conns" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" ) @@ -75,3 +76,7 @@ func UpdateTags(ctx context.Context, conn managedgrafanaiface.ManagedGrafanaAPI, return nil } + +func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags interface{}, newTags interface{}) error { + return UpdateTags(ctx, meta.(*conns.AWSClient).GrafanaConn(), identifier, oldTags, newTags) +} diff --git a/internal/service/greengrass/tags_gen.go b/internal/service/greengrass/tags_gen.go index 0b6f77a9821a..44446c421f39 100644 --- a/internal/service/greengrass/tags_gen.go +++ b/internal/service/greengrass/tags_gen.go @@ -8,6 +8,7 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/greengrass" "github.com/aws/aws-sdk-go/service/greengrass/greengrassiface" + "github.com/hashicorp/terraform-provider-aws/internal/conns" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" ) @@ -75,3 +76,7 @@ func UpdateTags(ctx context.Context, conn greengrassiface.GreengrassAPI, identif return nil } + +func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags interface{}, newTags interface{}) error { + return UpdateTags(ctx, meta.(*conns.AWSClient).GreengrassConn(), identifier, oldTags, newTags) +} diff --git a/internal/service/guardduty/tags_gen.go b/internal/service/guardduty/tags_gen.go index f94bfc8baba8..11f042ef01cd 100644 --- a/internal/service/guardduty/tags_gen.go +++ b/internal/service/guardduty/tags_gen.go @@ -8,6 +8,7 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/guardduty" "github.com/aws/aws-sdk-go/service/guardduty/guarddutyiface" + "github.com/hashicorp/terraform-provider-aws/internal/conns" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" ) @@ -75,3 +76,7 @@ func UpdateTags(ctx context.Context, conn guarddutyiface.GuardDutyAPI, identifie return nil } + +func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags interface{}, newTags interface{}) error { + return UpdateTags(ctx, meta.(*conns.AWSClient).GuardDutyConn(), identifier, oldTags, newTags) +} diff --git a/internal/service/imagebuilder/tags_gen.go b/internal/service/imagebuilder/tags_gen.go index c6971d777c53..c69495d63bcd 100644 --- a/internal/service/imagebuilder/tags_gen.go +++ b/internal/service/imagebuilder/tags_gen.go @@ -8,6 +8,7 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/imagebuilder" "github.com/aws/aws-sdk-go/service/imagebuilder/imagebuilderiface" + "github.com/hashicorp/terraform-provider-aws/internal/conns" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" ) @@ -75,3 +76,7 @@ func UpdateTags(ctx context.Context, conn imagebuilderiface.ImagebuilderAPI, ide return nil } + +func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags interface{}, newTags interface{}) error { + return UpdateTags(ctx, meta.(*conns.AWSClient).ImageBuilderConn(), identifier, oldTags, newTags) +} diff --git a/internal/service/iot/tags_gen.go b/internal/service/iot/tags_gen.go index 1f9287283791..4f95c81790b8 100644 --- a/internal/service/iot/tags_gen.go +++ b/internal/service/iot/tags_gen.go @@ -8,6 +8,7 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/iot" "github.com/aws/aws-sdk-go/service/iot/iotiface" + "github.com/hashicorp/terraform-provider-aws/internal/conns" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" ) @@ -92,3 +93,7 @@ func UpdateTags(ctx context.Context, conn iotiface.IoTAPI, identifier string, ol return nil } + +func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags interface{}, newTags interface{}) error { + return UpdateTags(ctx, meta.(*conns.AWSClient).IoTConn(), identifier, oldTags, newTags) +} diff --git a/internal/service/iotanalytics/tags_gen.go b/internal/service/iotanalytics/tags_gen.go index 20b3f112147e..198814a1eba4 100644 --- a/internal/service/iotanalytics/tags_gen.go +++ b/internal/service/iotanalytics/tags_gen.go @@ -8,6 +8,7 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/iotanalytics" "github.com/aws/aws-sdk-go/service/iotanalytics/iotanalyticsiface" + "github.com/hashicorp/terraform-provider-aws/internal/conns" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" ) @@ -92,3 +93,7 @@ func UpdateTags(ctx context.Context, conn iotanalyticsiface.IoTAnalyticsAPI, ide return nil } + +func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags interface{}, newTags interface{}) error { + return UpdateTags(ctx, meta.(*conns.AWSClient).IoTAnalyticsConn(), identifier, oldTags, newTags) +} diff --git a/internal/service/iotevents/tags_gen.go b/internal/service/iotevents/tags_gen.go index 630a89b8f25e..7949f0b8a2e8 100644 --- a/internal/service/iotevents/tags_gen.go +++ b/internal/service/iotevents/tags_gen.go @@ -8,6 +8,7 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/iotevents" "github.com/aws/aws-sdk-go/service/iotevents/ioteventsiface" + "github.com/hashicorp/terraform-provider-aws/internal/conns" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" ) @@ -92,3 +93,7 @@ func UpdateTags(ctx context.Context, conn ioteventsiface.IoTEventsAPI, identifie return nil } + +func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags interface{}, newTags interface{}) error { + return UpdateTags(ctx, meta.(*conns.AWSClient).IoTEventsConn(), identifier, oldTags, newTags) +} diff --git a/internal/service/ivs/tags_gen.go b/internal/service/ivs/tags_gen.go index bfccc63a135f..12b124c8d122 100644 --- a/internal/service/ivs/tags_gen.go +++ b/internal/service/ivs/tags_gen.go @@ -8,6 +8,7 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/ivs" "github.com/aws/aws-sdk-go/service/ivs/ivsiface" + "github.com/hashicorp/terraform-provider-aws/internal/conns" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" ) @@ -75,3 +76,7 @@ func UpdateTags(ctx context.Context, conn ivsiface.IVSAPI, identifier string, ol return nil } + +func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags interface{}, newTags interface{}) error { + return UpdateTags(ctx, meta.(*conns.AWSClient).IVSConn(), identifier, oldTags, newTags) +} diff --git a/internal/service/kafka/tags_gen.go b/internal/service/kafka/tags_gen.go index 4fc1099c7e19..5bdf70b11704 100644 --- a/internal/service/kafka/tags_gen.go +++ b/internal/service/kafka/tags_gen.go @@ -8,6 +8,7 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/kafka" "github.com/aws/aws-sdk-go/service/kafka/kafkaiface" + "github.com/hashicorp/terraform-provider-aws/internal/conns" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" ) @@ -58,3 +59,7 @@ func UpdateTags(ctx context.Context, conn kafkaiface.KafkaAPI, identifier string return nil } + +func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags interface{}, newTags interface{}) error { + return UpdateTags(ctx, meta.(*conns.AWSClient).KafkaConn(), identifier, oldTags, newTags) +} diff --git a/internal/service/keyspaces/tags_gen.go b/internal/service/keyspaces/tags_gen.go index 93a979c5458a..3568dae2f877 100644 --- a/internal/service/keyspaces/tags_gen.go +++ b/internal/service/keyspaces/tags_gen.go @@ -8,6 +8,7 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/keyspaces" "github.com/aws/aws-sdk-go/service/keyspaces/keyspacesiface" + "github.com/hashicorp/terraform-provider-aws/internal/conns" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" ) @@ -92,3 +93,7 @@ func UpdateTags(ctx context.Context, conn keyspacesiface.KeyspacesAPI, identifie return nil } + +func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags interface{}, newTags interface{}) error { + return UpdateTags(ctx, meta.(*conns.AWSClient).KeyspacesConn(), identifier, oldTags, newTags) +} diff --git a/internal/service/kinesis/tags_gen.go b/internal/service/kinesis/tags_gen.go index bf7d416ff79d..495b59976df2 100644 --- a/internal/service/kinesis/tags_gen.go +++ b/internal/service/kinesis/tags_gen.go @@ -8,6 +8,7 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/kinesis" "github.com/aws/aws-sdk-go/service/kinesis/kinesisiface" + "github.com/hashicorp/terraform-provider-aws/internal/conns" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" ) @@ -96,3 +97,7 @@ func UpdateTags(ctx context.Context, conn kinesisiface.KinesisAPI, identifier st return nil } + +func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags interface{}, newTags interface{}) error { + return UpdateTags(ctx, meta.(*conns.AWSClient).KinesisConn(), identifier, oldTags, newTags) +} diff --git a/internal/service/kinesisanalytics/tags_gen.go b/internal/service/kinesisanalytics/tags_gen.go index 5eb720baf900..1ec822881d17 100644 --- a/internal/service/kinesisanalytics/tags_gen.go +++ b/internal/service/kinesisanalytics/tags_gen.go @@ -8,6 +8,7 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/kinesisanalytics" "github.com/aws/aws-sdk-go/service/kinesisanalytics/kinesisanalyticsiface" + "github.com/hashicorp/terraform-provider-aws/internal/conns" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" ) @@ -92,3 +93,7 @@ func UpdateTags(ctx context.Context, conn kinesisanalyticsiface.KinesisAnalytics return nil } + +func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags interface{}, newTags interface{}) error { + return UpdateTags(ctx, meta.(*conns.AWSClient).KinesisAnalyticsConn(), identifier, oldTags, newTags) +} diff --git a/internal/service/kinesisanalyticsv2/tags_gen.go b/internal/service/kinesisanalyticsv2/tags_gen.go index 0adcd5508887..d758b2a9b547 100644 --- a/internal/service/kinesisanalyticsv2/tags_gen.go +++ b/internal/service/kinesisanalyticsv2/tags_gen.go @@ -8,6 +8,7 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/kinesisanalyticsv2" "github.com/aws/aws-sdk-go/service/kinesisanalyticsv2/kinesisanalyticsv2iface" + "github.com/hashicorp/terraform-provider-aws/internal/conns" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" ) @@ -92,3 +93,7 @@ func UpdateTags(ctx context.Context, conn kinesisanalyticsv2iface.KinesisAnalyti return nil } + +func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags interface{}, newTags interface{}) error { + return UpdateTags(ctx, meta.(*conns.AWSClient).KinesisAnalyticsV2Conn(), identifier, oldTags, newTags) +} diff --git a/internal/service/kinesisvideo/tags_gen.go b/internal/service/kinesisvideo/tags_gen.go index 119b861774e5..00b54bc92d36 100644 --- a/internal/service/kinesisvideo/tags_gen.go +++ b/internal/service/kinesisvideo/tags_gen.go @@ -8,6 +8,7 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/kinesisvideo" "github.com/aws/aws-sdk-go/service/kinesisvideo/kinesisvideoiface" + "github.com/hashicorp/terraform-provider-aws/internal/conns" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" ) @@ -75,3 +76,7 @@ func UpdateTags(ctx context.Context, conn kinesisvideoiface.KinesisVideoAPI, ide return nil } + +func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags interface{}, newTags interface{}) error { + return UpdateTags(ctx, meta.(*conns.AWSClient).KinesisVideoConn(), identifier, oldTags, newTags) +} diff --git a/internal/service/kms/tags_gen.go b/internal/service/kms/tags_gen.go index c56f2c31edba..4a200444f769 100644 --- a/internal/service/kms/tags_gen.go +++ b/internal/service/kms/tags_gen.go @@ -8,6 +8,7 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/kms" "github.com/aws/aws-sdk-go/service/kms/kmsiface" + "github.com/hashicorp/terraform-provider-aws/internal/conns" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" ) @@ -92,3 +93,7 @@ func UpdateTags(ctx context.Context, conn kmsiface.KMSAPI, identifier string, ol return nil } + +func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags interface{}, newTags interface{}) error { + return UpdateTags(ctx, meta.(*conns.AWSClient).KMSConn(), identifier, oldTags, newTags) +} diff --git a/internal/service/licensemanager/tags_gen.go b/internal/service/licensemanager/tags_gen.go index c821bbf3f371..31f7eaeb8523 100644 --- a/internal/service/licensemanager/tags_gen.go +++ b/internal/service/licensemanager/tags_gen.go @@ -8,6 +8,7 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/licensemanager" "github.com/aws/aws-sdk-go/service/licensemanager/licensemanageriface" + "github.com/hashicorp/terraform-provider-aws/internal/conns" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" ) @@ -75,3 +76,7 @@ func UpdateTags(ctx context.Context, conn licensemanageriface.LicenseManagerAPI, return nil } + +func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags interface{}, newTags interface{}) error { + return UpdateTags(ctx, meta.(*conns.AWSClient).LicenseManagerConn(), identifier, oldTags, newTags) +} diff --git a/internal/service/lightsail/tags_gen.go b/internal/service/lightsail/tags_gen.go index 7df9dc949472..738dd168824d 100644 --- a/internal/service/lightsail/tags_gen.go +++ b/internal/service/lightsail/tags_gen.go @@ -8,6 +8,7 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/lightsail" "github.com/aws/aws-sdk-go/service/lightsail/lightsailiface" + "github.com/hashicorp/terraform-provider-aws/internal/conns" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" ) @@ -75,3 +76,7 @@ func UpdateTags(ctx context.Context, conn lightsailiface.LightsailAPI, identifie return nil } + +func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags interface{}, newTags interface{}) error { + return UpdateTags(ctx, meta.(*conns.AWSClient).LightsailConn(), identifier, oldTags, newTags) +} diff --git a/internal/service/location/tags_gen.go b/internal/service/location/tags_gen.go index a19dd12bc789..9794b43c1db4 100644 --- a/internal/service/location/tags_gen.go +++ b/internal/service/location/tags_gen.go @@ -8,6 +8,7 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/locationservice" "github.com/aws/aws-sdk-go/service/locationservice/locationserviceiface" + "github.com/hashicorp/terraform-provider-aws/internal/conns" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" ) @@ -75,3 +76,7 @@ func UpdateTags(ctx context.Context, conn locationserviceiface.LocationServiceAP return nil } + +func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags interface{}, newTags interface{}) error { + return UpdateTags(ctx, meta.(*conns.AWSClient).LocationConn(), identifier, oldTags, newTags) +} diff --git a/internal/service/logs/log_group_tags_gen.go b/internal/service/logs/log_group_tags_gen.go index 93414b8292cd..8084b90c767e 100644 --- a/internal/service/logs/log_group_tags_gen.go +++ b/internal/service/logs/log_group_tags_gen.go @@ -8,6 +8,7 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/cloudwatchlogs" "github.com/aws/aws-sdk-go/service/cloudwatchlogs/cloudwatchlogsiface" + "github.com/hashicorp/terraform-provider-aws/internal/conns" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" ) @@ -63,3 +64,7 @@ func UpdateLogGroupTags(ctx context.Context, conn cloudwatchlogsiface.CloudWatch return nil } + +func (p *servicePackage) UpdateLogGroupTags(ctx context.Context, meta any, identifier string, oldTags interface{}, newTags interface{}) error { + return UpdateLogGroupTags(ctx, meta.(*conns.AWSClient).LogsConn(), identifier, oldTags, newTags) +} diff --git a/internal/service/logs/tags_gen.go b/internal/service/logs/tags_gen.go index fb91fc97310e..c09f3ac86fb8 100644 --- a/internal/service/logs/tags_gen.go +++ b/internal/service/logs/tags_gen.go @@ -8,6 +8,7 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/cloudwatchlogs" "github.com/aws/aws-sdk-go/service/cloudwatchlogs/cloudwatchlogsiface" + "github.com/hashicorp/terraform-provider-aws/internal/conns" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" ) @@ -75,3 +76,7 @@ func UpdateTags(ctx context.Context, conn cloudwatchlogsiface.CloudWatchLogsAPI, return nil } + +func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags interface{}, newTags interface{}) error { + return UpdateTags(ctx, meta.(*conns.AWSClient).LogsConn(), identifier, oldTags, newTags) +} diff --git a/internal/service/mediaconnect/tags_gen.go b/internal/service/mediaconnect/tags_gen.go index 28b9cf748c2e..364ef7531536 100644 --- a/internal/service/mediaconnect/tags_gen.go +++ b/internal/service/mediaconnect/tags_gen.go @@ -8,6 +8,7 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/mediaconnect" "github.com/aws/aws-sdk-go/service/mediaconnect/mediaconnectiface" + "github.com/hashicorp/terraform-provider-aws/internal/conns" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" ) @@ -75,3 +76,7 @@ func UpdateTags(ctx context.Context, conn mediaconnectiface.MediaConnectAPI, ide return nil } + +func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags interface{}, newTags interface{}) error { + return UpdateTags(ctx, meta.(*conns.AWSClient).MediaConnectConn(), identifier, oldTags, newTags) +} diff --git a/internal/service/mediaconvert/tags_gen.go b/internal/service/mediaconvert/tags_gen.go index a2651ff0aeeb..41d8473f3924 100644 --- a/internal/service/mediaconvert/tags_gen.go +++ b/internal/service/mediaconvert/tags_gen.go @@ -8,6 +8,7 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/mediaconvert" "github.com/aws/aws-sdk-go/service/mediaconvert/mediaconvertiface" + "github.com/hashicorp/terraform-provider-aws/internal/conns" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" ) @@ -75,3 +76,7 @@ func UpdateTags(ctx context.Context, conn mediaconvertiface.MediaConvertAPI, ide return nil } + +func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags interface{}, newTags interface{}) error { + return UpdateTags(ctx, meta.(*conns.AWSClient).MediaConvertConn(), identifier, oldTags, newTags) +} diff --git a/internal/service/mediapackage/tags_gen.go b/internal/service/mediapackage/tags_gen.go index 098816a7edb0..70105b56818d 100644 --- a/internal/service/mediapackage/tags_gen.go +++ b/internal/service/mediapackage/tags_gen.go @@ -8,6 +8,7 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/mediapackage" "github.com/aws/aws-sdk-go/service/mediapackage/mediapackageiface" + "github.com/hashicorp/terraform-provider-aws/internal/conns" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" ) @@ -75,3 +76,7 @@ func UpdateTags(ctx context.Context, conn mediapackageiface.MediaPackageAPI, ide return nil } + +func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags interface{}, newTags interface{}) error { + return UpdateTags(ctx, meta.(*conns.AWSClient).MediaPackageConn(), identifier, oldTags, newTags) +} diff --git a/internal/service/mediastore/tags_gen.go b/internal/service/mediastore/tags_gen.go index d1617369bc12..04c9802d5f95 100644 --- a/internal/service/mediastore/tags_gen.go +++ b/internal/service/mediastore/tags_gen.go @@ -8,6 +8,7 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/mediastore" "github.com/aws/aws-sdk-go/service/mediastore/mediastoreiface" + "github.com/hashicorp/terraform-provider-aws/internal/conns" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" ) @@ -92,3 +93,7 @@ func UpdateTags(ctx context.Context, conn mediastoreiface.MediaStoreAPI, identif return nil } + +func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags interface{}, newTags interface{}) error { + return UpdateTags(ctx, meta.(*conns.AWSClient).MediaStoreConn(), identifier, oldTags, newTags) +} diff --git a/internal/service/memorydb/tags_gen.go b/internal/service/memorydb/tags_gen.go index 9526402b24c3..0c3afec43431 100644 --- a/internal/service/memorydb/tags_gen.go +++ b/internal/service/memorydb/tags_gen.go @@ -8,6 +8,7 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/memorydb" "github.com/aws/aws-sdk-go/service/memorydb/memorydbiface" + "github.com/hashicorp/terraform-provider-aws/internal/conns" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" ) @@ -92,3 +93,7 @@ func UpdateTags(ctx context.Context, conn memorydbiface.MemoryDBAPI, identifier return nil } + +func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags interface{}, newTags interface{}) error { + return UpdateTags(ctx, meta.(*conns.AWSClient).MemoryDBConn(), identifier, oldTags, newTags) +} diff --git a/internal/service/mq/tags_gen.go b/internal/service/mq/tags_gen.go index 6512d7c3cf30..af6d9a793bd2 100644 --- a/internal/service/mq/tags_gen.go +++ b/internal/service/mq/tags_gen.go @@ -8,6 +8,7 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/mq" "github.com/aws/aws-sdk-go/service/mq/mqiface" + "github.com/hashicorp/terraform-provider-aws/internal/conns" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" ) @@ -75,3 +76,7 @@ func UpdateTags(ctx context.Context, conn mqiface.MQAPI, identifier string, oldT return nil } + +func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags interface{}, newTags interface{}) error { + return UpdateTags(ctx, meta.(*conns.AWSClient).MQConn(), identifier, oldTags, newTags) +} diff --git a/internal/service/mwaa/tags_gen.go b/internal/service/mwaa/tags_gen.go index f0a8b0ae66f4..b658806e6b69 100644 --- a/internal/service/mwaa/tags_gen.go +++ b/internal/service/mwaa/tags_gen.go @@ -8,6 +8,7 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/mwaa" "github.com/aws/aws-sdk-go/service/mwaa/mwaaiface" + "github.com/hashicorp/terraform-provider-aws/internal/conns" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" ) @@ -58,3 +59,7 @@ func UpdateTags(ctx context.Context, conn mwaaiface.MWAAAPI, identifier string, return nil } + +func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags interface{}, newTags interface{}) error { + return UpdateTags(ctx, meta.(*conns.AWSClient).MWAAConn(), identifier, oldTags, newTags) +} diff --git a/internal/service/neptune/tags_gen.go b/internal/service/neptune/tags_gen.go index 732798928719..86dfad23fa76 100644 --- a/internal/service/neptune/tags_gen.go +++ b/internal/service/neptune/tags_gen.go @@ -8,6 +8,7 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/neptune" "github.com/aws/aws-sdk-go/service/neptune/neptuneiface" + "github.com/hashicorp/terraform-provider-aws/internal/conns" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" ) @@ -92,3 +93,7 @@ func UpdateTags(ctx context.Context, conn neptuneiface.NeptuneAPI, identifier st return nil } + +func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags interface{}, newTags interface{}) error { + return UpdateTags(ctx, meta.(*conns.AWSClient).NeptuneConn(), identifier, oldTags, newTags) +} diff --git a/internal/service/networkfirewall/tags_gen.go b/internal/service/networkfirewall/tags_gen.go index 3abc250d3d94..41c95257730f 100644 --- a/internal/service/networkfirewall/tags_gen.go +++ b/internal/service/networkfirewall/tags_gen.go @@ -8,6 +8,7 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/networkfirewall" "github.com/aws/aws-sdk-go/service/networkfirewall/networkfirewalliface" + "github.com/hashicorp/terraform-provider-aws/internal/conns" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" ) @@ -92,3 +93,7 @@ func UpdateTags(ctx context.Context, conn networkfirewalliface.NetworkFirewallAP return nil } + +func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags interface{}, newTags interface{}) error { + return UpdateTags(ctx, meta.(*conns.AWSClient).NetworkFirewallConn(), identifier, oldTags, newTags) +} diff --git a/internal/service/networkmanager/tags_gen.go b/internal/service/networkmanager/tags_gen.go index 15cc9dfe1a22..672666bc7108 100644 --- a/internal/service/networkmanager/tags_gen.go +++ b/internal/service/networkmanager/tags_gen.go @@ -8,6 +8,7 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/networkmanager" "github.com/aws/aws-sdk-go/service/networkmanager/networkmanageriface" + "github.com/hashicorp/terraform-provider-aws/internal/conns" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" ) @@ -75,3 +76,7 @@ func UpdateTags(ctx context.Context, conn networkmanageriface.NetworkManagerAPI, return nil } + +func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags interface{}, newTags interface{}) error { + return UpdateTags(ctx, meta.(*conns.AWSClient).NetworkManagerConn(), identifier, oldTags, newTags) +} diff --git a/internal/service/opensearch/tags_gen.go b/internal/service/opensearch/tags_gen.go index 6636cba0ea75..5f2c3812aa30 100644 --- a/internal/service/opensearch/tags_gen.go +++ b/internal/service/opensearch/tags_gen.go @@ -8,6 +8,7 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/opensearchservice" "github.com/aws/aws-sdk-go/service/opensearchservice/opensearchserviceiface" + "github.com/hashicorp/terraform-provider-aws/internal/conns" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" ) @@ -92,3 +93,7 @@ func UpdateTags(ctx context.Context, conn opensearchserviceiface.OpenSearchServi return nil } + +func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags interface{}, newTags interface{}) error { + return UpdateTags(ctx, meta.(*conns.AWSClient).OpenSearchConn(), identifier, oldTags, newTags) +} diff --git a/internal/service/opsworks/tags_gen.go b/internal/service/opsworks/tags_gen.go index 40871296b3a3..29c9cc1a8396 100644 --- a/internal/service/opsworks/tags_gen.go +++ b/internal/service/opsworks/tags_gen.go @@ -8,6 +8,7 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/opsworks" "github.com/aws/aws-sdk-go/service/opsworks/opsworksiface" + "github.com/hashicorp/terraform-provider-aws/internal/conns" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" ) @@ -75,3 +76,7 @@ func UpdateTags(ctx context.Context, conn opsworksiface.OpsWorksAPI, identifier return nil } + +func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags interface{}, newTags interface{}) error { + return UpdateTags(ctx, meta.(*conns.AWSClient).OpsWorksConn(), identifier, oldTags, newTags) +} diff --git a/internal/service/organizations/tags_gen.go b/internal/service/organizations/tags_gen.go index b4fdbbb09fd1..a18988225e5d 100644 --- a/internal/service/organizations/tags_gen.go +++ b/internal/service/organizations/tags_gen.go @@ -8,6 +8,7 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/organizations" "github.com/aws/aws-sdk-go/service/organizations/organizationsiface" + "github.com/hashicorp/terraform-provider-aws/internal/conns" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" ) @@ -92,3 +93,7 @@ func UpdateTags(ctx context.Context, conn organizationsiface.OrganizationsAPI, i return nil } + +func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags interface{}, newTags interface{}) error { + return UpdateTags(ctx, meta.(*conns.AWSClient).OrganizationsConn(), identifier, oldTags, newTags) +} diff --git a/internal/service/pinpoint/tags_gen.go b/internal/service/pinpoint/tags_gen.go index 44eb70336a2d..45d4e458ca4d 100644 --- a/internal/service/pinpoint/tags_gen.go +++ b/internal/service/pinpoint/tags_gen.go @@ -8,6 +8,7 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/pinpoint" "github.com/aws/aws-sdk-go/service/pinpoint/pinpointiface" + "github.com/hashicorp/terraform-provider-aws/internal/conns" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" ) @@ -75,3 +76,7 @@ func UpdateTags(ctx context.Context, conn pinpointiface.PinpointAPI, identifier return nil } + +func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags interface{}, newTags interface{}) error { + return UpdateTags(ctx, meta.(*conns.AWSClient).PinpointConn(), identifier, oldTags, newTags) +} diff --git a/internal/service/qldb/tags_gen.go b/internal/service/qldb/tags_gen.go index 48ecbce3f77a..7265f601db0a 100644 --- a/internal/service/qldb/tags_gen.go +++ b/internal/service/qldb/tags_gen.go @@ -8,6 +8,7 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/qldb" "github.com/aws/aws-sdk-go/service/qldb/qldbiface" + "github.com/hashicorp/terraform-provider-aws/internal/conns" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" ) @@ -75,3 +76,7 @@ func UpdateTags(ctx context.Context, conn qldbiface.QLDBAPI, identifier string, return nil } + +func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags interface{}, newTags interface{}) error { + return UpdateTags(ctx, meta.(*conns.AWSClient).QLDBConn(), identifier, oldTags, newTags) +} diff --git a/internal/service/quicksight/tags_gen.go b/internal/service/quicksight/tags_gen.go index 36d885e620e7..9ce98a17f78e 100644 --- a/internal/service/quicksight/tags_gen.go +++ b/internal/service/quicksight/tags_gen.go @@ -8,6 +8,7 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/quicksight" "github.com/aws/aws-sdk-go/service/quicksight/quicksightiface" + "github.com/hashicorp/terraform-provider-aws/internal/conns" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" ) @@ -92,3 +93,7 @@ func UpdateTags(ctx context.Context, conn quicksightiface.QuickSightAPI, identif return nil } + +func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags interface{}, newTags interface{}) error { + return UpdateTags(ctx, meta.(*conns.AWSClient).QuickSightConn(), identifier, oldTags, newTags) +} diff --git a/internal/service/ram/tags_gen.go b/internal/service/ram/tags_gen.go index 0d489ceb2c74..e15d02ca9bb4 100644 --- a/internal/service/ram/tags_gen.go +++ b/internal/service/ram/tags_gen.go @@ -8,6 +8,7 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/ram" "github.com/aws/aws-sdk-go/service/ram/ramiface" + "github.com/hashicorp/terraform-provider-aws/internal/conns" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" ) @@ -75,3 +76,7 @@ func UpdateTags(ctx context.Context, conn ramiface.RAMAPI, identifier string, ol return nil } + +func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags interface{}, newTags interface{}) error { + return UpdateTags(ctx, meta.(*conns.AWSClient).RAMConn(), identifier, oldTags, newTags) +} diff --git a/internal/service/rds/tags_gen.go b/internal/service/rds/tags_gen.go index 1b5d3689afd7..1cc6326a7471 100644 --- a/internal/service/rds/tags_gen.go +++ b/internal/service/rds/tags_gen.go @@ -8,6 +8,7 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/rds" "github.com/aws/aws-sdk-go/service/rds/rdsiface" + "github.com/hashicorp/terraform-provider-aws/internal/conns" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" ) @@ -92,3 +93,7 @@ func UpdateTags(ctx context.Context, conn rdsiface.RDSAPI, identifier string, ol return nil } + +func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags interface{}, newTags interface{}) error { + return UpdateTags(ctx, meta.(*conns.AWSClient).RDSConn(), identifier, oldTags, newTags) +} diff --git a/internal/service/redshift/tags_gen.go b/internal/service/redshift/tags_gen.go index fb9536ba9f73..9baf5808c415 100644 --- a/internal/service/redshift/tags_gen.go +++ b/internal/service/redshift/tags_gen.go @@ -8,6 +8,7 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/redshift" "github.com/aws/aws-sdk-go/service/redshift/redshiftiface" + "github.com/hashicorp/terraform-provider-aws/internal/conns" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" ) @@ -75,3 +76,7 @@ func UpdateTags(ctx context.Context, conn redshiftiface.RedshiftAPI, identifier return nil } + +func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags interface{}, newTags interface{}) error { + return UpdateTags(ctx, meta.(*conns.AWSClient).RedshiftConn(), identifier, oldTags, newTags) +} diff --git a/internal/service/redshiftserverless/tags_gen.go b/internal/service/redshiftserverless/tags_gen.go index 9fe1d957ca5b..7c624e5734f7 100644 --- a/internal/service/redshiftserverless/tags_gen.go +++ b/internal/service/redshiftserverless/tags_gen.go @@ -8,6 +8,7 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/redshiftserverless" "github.com/aws/aws-sdk-go/service/redshiftserverless/redshiftserverlessiface" + "github.com/hashicorp/terraform-provider-aws/internal/conns" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" ) @@ -92,3 +93,7 @@ func UpdateTags(ctx context.Context, conn redshiftserverlessiface.RedshiftServer return nil } + +func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags interface{}, newTags interface{}) error { + return UpdateTags(ctx, meta.(*conns.AWSClient).RedshiftServerlessConn(), identifier, oldTags, newTags) +} diff --git a/internal/service/resourcegroups/tags_gen.go b/internal/service/resourcegroups/tags_gen.go index 11e7ea88967d..9a1807978af3 100644 --- a/internal/service/resourcegroups/tags_gen.go +++ b/internal/service/resourcegroups/tags_gen.go @@ -8,6 +8,7 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/resourcegroups" "github.com/aws/aws-sdk-go/service/resourcegroups/resourcegroupsiface" + "github.com/hashicorp/terraform-provider-aws/internal/conns" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" ) @@ -75,3 +76,7 @@ func UpdateTags(ctx context.Context, conn resourcegroupsiface.ResourceGroupsAPI, return nil } + +func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags interface{}, newTags interface{}) error { + return UpdateTags(ctx, meta.(*conns.AWSClient).ResourceGroupsConn(), identifier, oldTags, newTags) +} diff --git a/internal/service/route53/tags_gen.go b/internal/service/route53/tags_gen.go index 23a0ec33d1ab..e3ef3c0ab931 100644 --- a/internal/service/route53/tags_gen.go +++ b/internal/service/route53/tags_gen.go @@ -8,6 +8,7 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/route53" "github.com/aws/aws-sdk-go/service/route53/route53iface" + "github.com/hashicorp/terraform-provider-aws/internal/conns" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" ) @@ -93,3 +94,7 @@ func UpdateTags(ctx context.Context, conn route53iface.Route53API, identifier st return nil } + +func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, resourceType string, oldTags interface{}, newTags interface{}) error { + return UpdateTags(ctx, meta.(*conns.AWSClient).Route53Conn(), identifier, resourceType, oldTags, newTags) +} diff --git a/internal/service/route53recoveryreadiness/tags_gen.go b/internal/service/route53recoveryreadiness/tags_gen.go index 48791ec5a0d3..e01112225726 100644 --- a/internal/service/route53recoveryreadiness/tags_gen.go +++ b/internal/service/route53recoveryreadiness/tags_gen.go @@ -8,6 +8,7 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/route53recoveryreadiness" "github.com/aws/aws-sdk-go/service/route53recoveryreadiness/route53recoveryreadinessiface" + "github.com/hashicorp/terraform-provider-aws/internal/conns" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" ) @@ -75,3 +76,7 @@ func UpdateTags(ctx context.Context, conn route53recoveryreadinessiface.Route53R return nil } + +func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags interface{}, newTags interface{}) error { + return UpdateTags(ctx, meta.(*conns.AWSClient).Route53RecoveryReadinessConn(), identifier, oldTags, newTags) +} diff --git a/internal/service/route53resolver/tags_gen.go b/internal/service/route53resolver/tags_gen.go index 5a911159f6df..d7f2645a392c 100644 --- a/internal/service/route53resolver/tags_gen.go +++ b/internal/service/route53resolver/tags_gen.go @@ -8,6 +8,7 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/route53resolver" "github.com/aws/aws-sdk-go/service/route53resolver/route53resolveriface" + "github.com/hashicorp/terraform-provider-aws/internal/conns" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" ) @@ -112,3 +113,7 @@ func UpdateTags(ctx context.Context, conn route53resolveriface.Route53ResolverAP return nil } + +func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags interface{}, newTags interface{}) error { + return UpdateTags(ctx, meta.(*conns.AWSClient).Route53ResolverConn(), identifier, oldTags, newTags) +} diff --git a/internal/service/rum/tags_gen.go b/internal/service/rum/tags_gen.go index 28835009dfad..5eafac2f18fe 100644 --- a/internal/service/rum/tags_gen.go +++ b/internal/service/rum/tags_gen.go @@ -8,6 +8,7 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/cloudwatchrum" "github.com/aws/aws-sdk-go/service/cloudwatchrum/cloudwatchrumiface" + "github.com/hashicorp/terraform-provider-aws/internal/conns" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" ) @@ -58,3 +59,7 @@ func UpdateTags(ctx context.Context, conn cloudwatchrumiface.CloudWatchRUMAPI, i return nil } + +func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags interface{}, newTags interface{}) error { + return UpdateTags(ctx, meta.(*conns.AWSClient).RUMConn(), identifier, oldTags, newTags) +} diff --git a/internal/service/sagemaker/tags_gen.go b/internal/service/sagemaker/tags_gen.go index 51b09fe9223d..d435bd9f079e 100644 --- a/internal/service/sagemaker/tags_gen.go +++ b/internal/service/sagemaker/tags_gen.go @@ -8,6 +8,7 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/sagemaker" "github.com/aws/aws-sdk-go/service/sagemaker/sagemakeriface" + "github.com/hashicorp/terraform-provider-aws/internal/conns" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" ) @@ -92,3 +93,7 @@ func UpdateTags(ctx context.Context, conn sagemakeriface.SageMakerAPI, identifie return nil } + +func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags interface{}, newTags interface{}) error { + return UpdateTags(ctx, meta.(*conns.AWSClient).SageMakerConn(), identifier, oldTags, newTags) +} diff --git a/internal/service/schemas/tags_gen.go b/internal/service/schemas/tags_gen.go index db460898b030..91f34eb9da5b 100644 --- a/internal/service/schemas/tags_gen.go +++ b/internal/service/schemas/tags_gen.go @@ -8,6 +8,7 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/schemas" "github.com/aws/aws-sdk-go/service/schemas/schemasiface" + "github.com/hashicorp/terraform-provider-aws/internal/conns" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" ) @@ -75,3 +76,7 @@ func UpdateTags(ctx context.Context, conn schemasiface.SchemasAPI, identifier st return nil } + +func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags interface{}, newTags interface{}) error { + return UpdateTags(ctx, meta.(*conns.AWSClient).SchemasConn(), identifier, oldTags, newTags) +} diff --git a/internal/service/secretsmanager/tags_gen.go b/internal/service/secretsmanager/tags_gen.go index 4d17359f32ce..060966486ead 100644 --- a/internal/service/secretsmanager/tags_gen.go +++ b/internal/service/secretsmanager/tags_gen.go @@ -8,6 +8,7 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/secretsmanager" "github.com/aws/aws-sdk-go/service/secretsmanager/secretsmanageriface" + "github.com/hashicorp/terraform-provider-aws/internal/conns" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" ) @@ -75,3 +76,7 @@ func UpdateTags(ctx context.Context, conn secretsmanageriface.SecretsManagerAPI, return nil } + +func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags interface{}, newTags interface{}) error { + return UpdateTags(ctx, meta.(*conns.AWSClient).SecretsManagerConn(), identifier, oldTags, newTags) +} diff --git a/internal/service/securityhub/tags_gen.go b/internal/service/securityhub/tags_gen.go index 5cc27d0e3b9e..c7a9046ccf0b 100644 --- a/internal/service/securityhub/tags_gen.go +++ b/internal/service/securityhub/tags_gen.go @@ -8,6 +8,7 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/securityhub" "github.com/aws/aws-sdk-go/service/securityhub/securityhubiface" + "github.com/hashicorp/terraform-provider-aws/internal/conns" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" ) @@ -75,3 +76,7 @@ func UpdateTags(ctx context.Context, conn securityhubiface.SecurityHubAPI, ident return nil } + +func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags interface{}, newTags interface{}) error { + return UpdateTags(ctx, meta.(*conns.AWSClient).SecurityHubConn(), identifier, oldTags, newTags) +} diff --git a/internal/service/servicediscovery/tags_gen.go b/internal/service/servicediscovery/tags_gen.go index c2bbe2384051..d5e9b738b4b6 100644 --- a/internal/service/servicediscovery/tags_gen.go +++ b/internal/service/servicediscovery/tags_gen.go @@ -8,6 +8,7 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/servicediscovery" "github.com/aws/aws-sdk-go/service/servicediscovery/servicediscoveryiface" + "github.com/hashicorp/terraform-provider-aws/internal/conns" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" ) @@ -92,3 +93,7 @@ func UpdateTags(ctx context.Context, conn servicediscoveryiface.ServiceDiscovery return nil } + +func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags interface{}, newTags interface{}) error { + return UpdateTags(ctx, meta.(*conns.AWSClient).ServiceDiscoveryConn(), identifier, oldTags, newTags) +} diff --git a/internal/service/sfn/tags_gen.go b/internal/service/sfn/tags_gen.go index 944f3926b941..e6f3568b6643 100644 --- a/internal/service/sfn/tags_gen.go +++ b/internal/service/sfn/tags_gen.go @@ -8,6 +8,7 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/sfn" "github.com/aws/aws-sdk-go/service/sfn/sfniface" + "github.com/hashicorp/terraform-provider-aws/internal/conns" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" ) @@ -92,3 +93,7 @@ func UpdateTags(ctx context.Context, conn sfniface.SFNAPI, identifier string, ol return nil } + +func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags interface{}, newTags interface{}) error { + return UpdateTags(ctx, meta.(*conns.AWSClient).SFNConn(), identifier, oldTags, newTags) +} diff --git a/internal/service/shield/tags_gen.go b/internal/service/shield/tags_gen.go index b085ce3bb9cd..875851e93f58 100644 --- a/internal/service/shield/tags_gen.go +++ b/internal/service/shield/tags_gen.go @@ -8,6 +8,7 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/shield" "github.com/aws/aws-sdk-go/service/shield/shieldiface" + "github.com/hashicorp/terraform-provider-aws/internal/conns" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" ) @@ -92,3 +93,7 @@ func UpdateTags(ctx context.Context, conn shieldiface.ShieldAPI, identifier stri return nil } + +func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags interface{}, newTags interface{}) error { + return UpdateTags(ctx, meta.(*conns.AWSClient).ShieldConn(), identifier, oldTags, newTags) +} diff --git a/internal/service/signer/tags_gen.go b/internal/service/signer/tags_gen.go index d1a8be1130ca..01fbc20b6fea 100644 --- a/internal/service/signer/tags_gen.go +++ b/internal/service/signer/tags_gen.go @@ -8,6 +8,7 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/signer" "github.com/aws/aws-sdk-go/service/signer/signeriface" + "github.com/hashicorp/terraform-provider-aws/internal/conns" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" ) @@ -75,3 +76,7 @@ func UpdateTags(ctx context.Context, conn signeriface.SignerAPI, identifier stri return nil } + +func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags interface{}, newTags interface{}) error { + return UpdateTags(ctx, meta.(*conns.AWSClient).SignerConn(), identifier, oldTags, newTags) +} diff --git a/internal/service/sns/tags_gen.go b/internal/service/sns/tags_gen.go index ca0c900c174e..c8fbe83558f8 100644 --- a/internal/service/sns/tags_gen.go +++ b/internal/service/sns/tags_gen.go @@ -8,6 +8,7 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/sns" "github.com/aws/aws-sdk-go/service/sns/snsiface" + "github.com/hashicorp/terraform-provider-aws/internal/conns" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" ) @@ -92,3 +93,7 @@ func UpdateTags(ctx context.Context, conn snsiface.SNSAPI, identifier string, ol return nil } + +func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags interface{}, newTags interface{}) error { + return UpdateTags(ctx, meta.(*conns.AWSClient).SNSConn(), identifier, oldTags, newTags) +} diff --git a/internal/service/sqs/tags_gen.go b/internal/service/sqs/tags_gen.go index 92b7a218d036..13a768c9ee39 100644 --- a/internal/service/sqs/tags_gen.go +++ b/internal/service/sqs/tags_gen.go @@ -8,6 +8,7 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/sqs" "github.com/aws/aws-sdk-go/service/sqs/sqsiface" + "github.com/hashicorp/terraform-provider-aws/internal/conns" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" ) @@ -75,3 +76,7 @@ func UpdateTags(ctx context.Context, conn sqsiface.SQSAPI, identifier string, ol return nil } + +func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags interface{}, newTags interface{}) error { + return UpdateTags(ctx, meta.(*conns.AWSClient).SQSConn(), identifier, oldTags, newTags) +} diff --git a/internal/service/ssm/tags_gen.go b/internal/service/ssm/tags_gen.go index c07e7327f4b7..a12b059477f5 100644 --- a/internal/service/ssm/tags_gen.go +++ b/internal/service/ssm/tags_gen.go @@ -8,6 +8,7 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/ssm" "github.com/aws/aws-sdk-go/service/ssm/ssmiface" + "github.com/hashicorp/terraform-provider-aws/internal/conns" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" ) @@ -95,3 +96,7 @@ func UpdateTags(ctx context.Context, conn ssmiface.SSMAPI, identifier string, re return nil } + +func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, resourceType string, oldTags interface{}, newTags interface{}) error { + return UpdateTags(ctx, meta.(*conns.AWSClient).SSMConn(), identifier, resourceType, oldTags, newTags) +} diff --git a/internal/service/ssoadmin/tags_gen.go b/internal/service/ssoadmin/tags_gen.go index df15986e8ceb..43ab5845fcbc 100644 --- a/internal/service/ssoadmin/tags_gen.go +++ b/internal/service/ssoadmin/tags_gen.go @@ -8,6 +8,7 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/ssoadmin" "github.com/aws/aws-sdk-go/service/ssoadmin/ssoadminiface" + "github.com/hashicorp/terraform-provider-aws/internal/conns" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" ) @@ -95,3 +96,7 @@ func UpdateTags(ctx context.Context, conn ssoadminiface.SSOAdminAPI, identifier return nil } + +func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, resourceType string, oldTags interface{}, newTags interface{}) error { + return UpdateTags(ctx, meta.(*conns.AWSClient).SSOAdminConn(), identifier, resourceType, oldTags, newTags) +} diff --git a/internal/service/storagegateway/tags_gen.go b/internal/service/storagegateway/tags_gen.go index cc0fe3f4d0fb..a3794a914edf 100644 --- a/internal/service/storagegateway/tags_gen.go +++ b/internal/service/storagegateway/tags_gen.go @@ -8,6 +8,7 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/storagegateway" "github.com/aws/aws-sdk-go/service/storagegateway/storagegatewayiface" + "github.com/hashicorp/terraform-provider-aws/internal/conns" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" ) @@ -92,3 +93,7 @@ func UpdateTags(ctx context.Context, conn storagegatewayiface.StorageGatewayAPI, return nil } + +func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags interface{}, newTags interface{}) error { + return UpdateTags(ctx, meta.(*conns.AWSClient).StorageGatewayConn(), identifier, oldTags, newTags) +} diff --git a/internal/service/swf/tags_gen.go b/internal/service/swf/tags_gen.go index ee50d32eb220..4e3d683ba981 100644 --- a/internal/service/swf/tags_gen.go +++ b/internal/service/swf/tags_gen.go @@ -8,6 +8,7 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/swf" "github.com/aws/aws-sdk-go/service/swf/swfiface" + "github.com/hashicorp/terraform-provider-aws/internal/conns" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" ) @@ -92,3 +93,7 @@ func UpdateTags(ctx context.Context, conn swfiface.SWFAPI, identifier string, ol return nil } + +func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags interface{}, newTags interface{}) error { + return UpdateTags(ctx, meta.(*conns.AWSClient).SWFConn(), identifier, oldTags, newTags) +} diff --git a/internal/service/synthetics/tags_gen.go b/internal/service/synthetics/tags_gen.go index b6d5a85945da..1c1d333c2895 100644 --- a/internal/service/synthetics/tags_gen.go +++ b/internal/service/synthetics/tags_gen.go @@ -8,6 +8,7 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/synthetics" "github.com/aws/aws-sdk-go/service/synthetics/syntheticsiface" + "github.com/hashicorp/terraform-provider-aws/internal/conns" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" ) @@ -58,3 +59,7 @@ func UpdateTags(ctx context.Context, conn syntheticsiface.SyntheticsAPI, identif return nil } + +func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags interface{}, newTags interface{}) error { + return UpdateTags(ctx, meta.(*conns.AWSClient).SyntheticsConn(), identifier, oldTags, newTags) +} diff --git a/internal/service/timestreamwrite/tags_gen.go b/internal/service/timestreamwrite/tags_gen.go index 4977b79ddce2..d4218ea7eb7f 100644 --- a/internal/service/timestreamwrite/tags_gen.go +++ b/internal/service/timestreamwrite/tags_gen.go @@ -8,6 +8,7 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/timestreamwrite" "github.com/aws/aws-sdk-go/service/timestreamwrite/timestreamwriteiface" + "github.com/hashicorp/terraform-provider-aws/internal/conns" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" ) @@ -92,3 +93,7 @@ func UpdateTags(ctx context.Context, conn timestreamwriteiface.TimestreamWriteAP return nil } + +func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags interface{}, newTags interface{}) error { + return UpdateTags(ctx, meta.(*conns.AWSClient).TimestreamWriteConn(), identifier, oldTags, newTags) +} diff --git a/internal/service/transfer/tags_gen.go b/internal/service/transfer/tags_gen.go index e6ddcf5ae539..be371e4ee597 100644 --- a/internal/service/transfer/tags_gen.go +++ b/internal/service/transfer/tags_gen.go @@ -8,6 +8,7 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/transfer" "github.com/aws/aws-sdk-go/service/transfer/transferiface" + "github.com/hashicorp/terraform-provider-aws/internal/conns" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" ) @@ -112,3 +113,7 @@ func UpdateTags(ctx context.Context, conn transferiface.TransferAPI, identifier return nil } + +func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags interface{}, newTags interface{}) error { + return UpdateTags(ctx, meta.(*conns.AWSClient).TransferConn(), identifier, oldTags, newTags) +} diff --git a/internal/service/transfer/update_tags_no_system_ignore_gen.go b/internal/service/transfer/update_tags_no_system_ignore_gen.go index 218920161c65..26300b3734ea 100644 --- a/internal/service/transfer/update_tags_no_system_ignore_gen.go +++ b/internal/service/transfer/update_tags_no_system_ignore_gen.go @@ -8,6 +8,7 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/transfer" "github.com/aws/aws-sdk-go/service/transfer/transferiface" + "github.com/hashicorp/terraform-provider-aws/internal/conns" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" ) @@ -46,3 +47,7 @@ func UpdateTagsNoIgnoreSystem(ctx context.Context, conn transferiface.TransferAP return nil } + +func (p *servicePackage) UpdateTagsNoIgnoreSystem(ctx context.Context, meta any, identifier string, oldTags interface{}, newTags interface{}) error { + return UpdateTagsNoIgnoreSystem(ctx, meta.(*conns.AWSClient).TransferConn(), identifier, oldTags, newTags) +} diff --git a/internal/service/waf/tags_gen.go b/internal/service/waf/tags_gen.go index c7de32ff2ffc..b0044e5904ab 100644 --- a/internal/service/waf/tags_gen.go +++ b/internal/service/waf/tags_gen.go @@ -8,6 +8,7 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/waf" "github.com/aws/aws-sdk-go/service/waf/wafiface" + "github.com/hashicorp/terraform-provider-aws/internal/conns" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" ) @@ -92,3 +93,7 @@ func UpdateTags(ctx context.Context, conn wafiface.WAFAPI, identifier string, ol return nil } + +func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags interface{}, newTags interface{}) error { + return UpdateTags(ctx, meta.(*conns.AWSClient).WAFConn(), identifier, oldTags, newTags) +} diff --git a/internal/service/wafregional/tags_gen.go b/internal/service/wafregional/tags_gen.go index 867fd5fdfe98..cba6fd7f89bd 100644 --- a/internal/service/wafregional/tags_gen.go +++ b/internal/service/wafregional/tags_gen.go @@ -8,6 +8,7 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/waf" "github.com/aws/aws-sdk-go/service/wafregional/wafregionaliface" + "github.com/hashicorp/terraform-provider-aws/internal/conns" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" ) @@ -92,3 +93,7 @@ func UpdateTags(ctx context.Context, conn wafregionaliface.WAFRegionalAPI, ident return nil } + +func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags interface{}, newTags interface{}) error { + return UpdateTags(ctx, meta.(*conns.AWSClient).WAFRegionalConn(), identifier, oldTags, newTags) +} diff --git a/internal/service/wafv2/tags_gen.go b/internal/service/wafv2/tags_gen.go index 2f1e16699012..f3da736a0bfe 100644 --- a/internal/service/wafv2/tags_gen.go +++ b/internal/service/wafv2/tags_gen.go @@ -8,6 +8,7 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/wafv2" "github.com/aws/aws-sdk-go/service/wafv2/wafv2iface" + "github.com/hashicorp/terraform-provider-aws/internal/conns" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" ) @@ -92,3 +93,7 @@ func UpdateTags(ctx context.Context, conn wafv2iface.WAFV2API, identifier string return nil } + +func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags interface{}, newTags interface{}) error { + return UpdateTags(ctx, meta.(*conns.AWSClient).WAFV2Conn(), identifier, oldTags, newTags) +} diff --git a/internal/service/worklink/tags_gen.go b/internal/service/worklink/tags_gen.go index 058734d9e646..4b6a3bef6fe7 100644 --- a/internal/service/worklink/tags_gen.go +++ b/internal/service/worklink/tags_gen.go @@ -8,6 +8,7 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/worklink" "github.com/aws/aws-sdk-go/service/worklink/worklinkiface" + "github.com/hashicorp/terraform-provider-aws/internal/conns" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" ) @@ -75,3 +76,7 @@ func UpdateTags(ctx context.Context, conn worklinkiface.WorkLinkAPI, identifier return nil } + +func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags interface{}, newTags interface{}) error { + return UpdateTags(ctx, meta.(*conns.AWSClient).WorkLinkConn(), identifier, oldTags, newTags) +} diff --git a/internal/service/workspaces/tags_gen.go b/internal/service/workspaces/tags_gen.go index fd536d98b740..1bb6e939a10f 100644 --- a/internal/service/workspaces/tags_gen.go +++ b/internal/service/workspaces/tags_gen.go @@ -8,6 +8,7 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/workspaces" "github.com/aws/aws-sdk-go/service/workspaces/workspacesiface" + "github.com/hashicorp/terraform-provider-aws/internal/conns" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" ) @@ -92,3 +93,7 @@ func UpdateTags(ctx context.Context, conn workspacesiface.WorkSpacesAPI, identif return nil } + +func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags interface{}, newTags interface{}) error { + return UpdateTags(ctx, meta.(*conns.AWSClient).WorkSpacesConn(), identifier, oldTags, newTags) +} diff --git a/internal/service/xray/tags_gen.go b/internal/service/xray/tags_gen.go index 338f4366f4d3..d422a386bde5 100644 --- a/internal/service/xray/tags_gen.go +++ b/internal/service/xray/tags_gen.go @@ -8,6 +8,7 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/xray" "github.com/aws/aws-sdk-go/service/xray/xrayiface" + "github.com/hashicorp/terraform-provider-aws/internal/conns" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" ) @@ -92,3 +93,7 @@ func UpdateTags(ctx context.Context, conn xrayiface.XRayAPI, identifier string, return nil } + +func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags interface{}, newTags interface{}) error { + return UpdateTags(ctx, meta.(*conns.AWSClient).XRayConn(), identifier, oldTags, newTags) +} From 6a36158d6955eb839e77f19a87b162686b1f1cad Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Wed, 1 Mar 2023 14:48:45 -0500 Subject: [PATCH 490/763] Add code to parse annotation arguments. --- internal/generate/common/args.go | 38 ++++++++++ internal/generate/common/args_test.go | 104 ++++++++++++++++++++++++++ 2 files changed, 142 insertions(+) create mode 100644 internal/generate/common/args.go create mode 100644 internal/generate/common/args_test.go diff --git a/internal/generate/common/args.go b/internal/generate/common/args.go new file mode 100644 index 000000000000..dfc2f502b2e8 --- /dev/null +++ b/internal/generate/common/args.go @@ -0,0 +1,38 @@ +package common + +import ( + "strings" +) + +// Args represents an argument list of the form: +// postional0, keywordA=valueA, positional1, keywordB=valueB +type Args struct { + Positional []string + Keyword map[string]string +} + +func ParseArgs(s string) Args { + args := Args{ + Keyword: make(map[string]string), + } + var key string + + for s != "" { + key, s, _ = strings.Cut(s, ",") + key = strings.TrimSpace(key) + if key == "" { + continue + } + key, value, _ := strings.Cut(key, "=") + // Unquote. + key = strings.Trim(key, `"`) + value = strings.Trim(value, `"`) + if value == "" { + args.Positional = append(args.Positional, key) + } else { + args.Keyword[key] = value + } + } + + return args +} diff --git a/internal/generate/common/args_test.go b/internal/generate/common/args_test.go new file mode 100644 index 000000000000..3a0eabe128b3 --- /dev/null +++ b/internal/generate/common/args_test.go @@ -0,0 +1,104 @@ +package common + +import ( + "testing" +) + +func TestArgsEmptyString(t *testing.T) { + input := `` + args := ParseArgs(input) + + if got, want := len(args.Positional), 0; got != want { + t.Errorf("length of Positional = %v, want %v", got, want) + } + if got, want := len(args.Keyword), 0; got != want { + t.Errorf("length of Keyword = %v, want %v", got, want) + } +} + +func TestArgsSinglePositional(t *testing.T) { + input := `aws_instance` + args := ParseArgs(input) + + if got, want := len(args.Positional), 1; got != want { + t.Errorf("length of Positional = %v, want %v", got, want) + } + if got, want := args.Positional[0], "aws_instance"; got != want { + t.Errorf("Positional[0] = %v, want %v", got, want) + } + if got, want := len(args.Keyword), 0; got != want { + t.Errorf("length of Keyword = %v, want %v", got, want) + } +} + +func TestArgsSingleQuotedPositional(t *testing.T) { + input := `"aws_instance"` + args := ParseArgs(input) + + if got, want := len(args.Positional), 1; got != want { + t.Errorf("length of Positional = %v, want %v", got, want) + } + if got, want := args.Positional[0], "aws_instance"; got != want { + t.Errorf("Positional[0] = %v, want %v", got, want) + } + if got, want := len(args.Keyword), 0; got != want { + t.Errorf("length of Keyword = %v, want %v", got, want) + } +} + +func TestArgsSingleKeyword(t *testing.T) { + input := `vv=42` + args := ParseArgs(input) + + if got, want := len(args.Positional), 0; got != want { + t.Errorf("length of Positional = %v, want %v", got, want) + } + if got, want := len(args.Keyword), 1; got != want { + t.Errorf("length of Keyword = %v, want %v", got, want) + } + if got, want := args.Keyword["vv"], "42"; got != want { + t.Errorf("Keyword[vv] = %v, want %v", got, want) + } +} + +func TestArgsMultipleKeywords(t *testing.T) { + input := `vv=42,type=aws_instance` + args := ParseArgs(input) + + if got, want := len(args.Positional), 0; got != want { + t.Errorf("length of Positional = %v, want %v", got, want) + } + if got, want := len(args.Keyword), 2; got != want { + t.Errorf("length of Keyword = %v, want %v", got, want) + } + if got, want := args.Keyword["vv"], "42"; got != want { + t.Errorf("Keyword[vv] = %v, want %v", got, want) + } + if got, want := args.Keyword["type"], "aws_instance"; got != want { + t.Errorf("Keyword[type] = %v, want %v", got, want) + } +} + +func TestArgsPostionalAndKeywords(t *testing.T) { + input := `first, vv=42 ,type=aws_instance,2` + args := ParseArgs(input) + + if got, want := len(args.Positional), 2; got != want { + t.Errorf("length of Positional = %v, want %v", got, want) + } + if got, want := args.Positional[0], "first"; got != want { + t.Errorf("Positional[0] = %v, want %v", got, want) + } + if got, want := args.Positional[1], "2"; got != want { + t.Errorf("Positional[1] = %v, want %v", got, want) + } + if got, want := len(args.Keyword), 2; got != want { + t.Errorf("length of Keyword = %v, want %v", got, want) + } + if got, want := args.Keyword["vv"], "42"; got != want { + t.Errorf("Keyword[vv] = %v, want %v", got, want) + } + if got, want := args.Keyword["type"], "aws_instance"; got != want { + t.Errorf("Keyword[type] = %v, want %v", got, want) + } +} From 72c6aed0367107c2fabb213dae99cb647d650f94 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Wed, 1 Mar 2023 14:54:44 -0500 Subject: [PATCH 491/763] Use ParseArgs in servicepackage generator. --- internal/generate/servicepackages/main.go | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/internal/generate/servicepackages/main.go b/internal/generate/servicepackages/main.go index 10d1cf2ece0c..510520985ea2 100644 --- a/internal/generate/servicepackages/main.go +++ b/internal/generate/servicepackages/main.go @@ -153,8 +153,8 @@ var spsTmpl string var ( frameworkDataSourceAnnotation = regexp.MustCompile(`^//\s*@FrameworkDataSource\s*$`) frameworkResourceAnnotation = regexp.MustCompile(`^//\s*@FrameworkResource\s*$`) - sdkDataSourceAnnotation = regexp.MustCompile(`^//\s*@SDKDataSource\(\s*"([a-z0-9_]+)"\s*\)\s*$`) - sdkResourceAnnotation = regexp.MustCompile(`^//\s*@SDKResource\(\s*"([a-z0-9_]+)"\s*\)\s*$`) + sdkDataSourceAnnotation = regexp.MustCompile(`^//\s*@SDKDataSource\(([^)]+)\)\s*$`) + sdkResourceAnnotation = regexp.MustCompile(`^//\s*@SDKResource\(([^)]+)\)\s*$`) ) type visitor struct { @@ -226,7 +226,8 @@ func (v *visitor) processFuncDecl(funcDecl *ast.FuncDecl) { v.frameworkResources = append(v.frameworkResources, v.functionName) } } else if m := sdkDataSourceAnnotation.FindStringSubmatch(line); len(m) > 0 { - name := m[1] + args := common.ParseArgs(m[1]) + name := args.Positional[0] if _, ok := v.sdkDataSources[name]; ok { v.err = multierror.Append(v.err, fmt.Errorf("duplicate SDK Data Source (%s): %s", name, fmt.Sprintf("%s.%s", v.packageName, v.functionName))) @@ -234,7 +235,8 @@ func (v *visitor) processFuncDecl(funcDecl *ast.FuncDecl) { v.sdkDataSources[name] = v.functionName } } else if m := sdkResourceAnnotation.FindStringSubmatch(line); len(m) > 0 { - name := m[1] + args := common.ParseArgs(m[1]) + name := args.Positional[0] if _, ok := v.sdkResources[name]; ok { v.err = multierror.Append(v.err, fmt.Errorf("duplicate SDK Resource (%s): %s", name, fmt.Sprintf("%s.%s", v.packageName, v.functionName))) From 55a243dff404ecfe54c411c7ca3e55b67e6cdca8 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Wed, 1 Mar 2023 15:09:19 -0500 Subject: [PATCH 492/763] Add ResourceDatum to generate/servicepackages. --- internal/generate/servicepackages/main.go | 56 ++++++++++++++-------- internal/generate/servicepackages/spd.tmpl | 8 ++-- 2 files changed, 40 insertions(+), 24 deletions(-) diff --git a/internal/generate/servicepackages/main.go b/internal/generate/servicepackages/main.go index 510520985ea2..55d68e7b4a86 100644 --- a/internal/generate/servicepackages/main.go +++ b/internal/generate/servicepackages/main.go @@ -71,10 +71,10 @@ func main() { v := &visitor{ g: g, - frameworkDataSources: make([]string, 0), - frameworkResources: make([]string, 0), - sdkDataSources: make(map[string]string), - sdkResources: make(map[string]string), + frameworkDataSources: make([]ResourceDatum, 0), + frameworkResources: make([]ResourceDatum, 0), + sdkDataSources: make(map[string]ResourceDatum), + sdkResources: make(map[string]ResourceDatum), } v.processDir(dir) @@ -93,10 +93,10 @@ func main() { } sort.SliceStable(s.FrameworkDataSources, func(i, j int) bool { - return s.FrameworkDataSources[i] < s.FrameworkDataSources[j] + return s.FrameworkDataSources[i].FactoryName < s.FrameworkDataSources[j].FactoryName }) sort.SliceStable(s.FrameworkResources, func(i, j int) bool { - return s.FrameworkResources[i] < s.FrameworkResources[j] + return s.FrameworkResources[i].FactoryName < s.FrameworkResources[j].FactoryName }) filename := fmt.Sprintf("../../service/%s/%s", p, spdFile) @@ -130,13 +130,17 @@ func main() { } } +type ResourceDatum struct { + FactoryName string +} + type ServiceDatum struct { ProviderPackage string ProviderNameUpper string - FrameworkDataSources []string - FrameworkResources []string - SDKDataSources map[string]string - SDKResources map[string]string + FrameworkDataSources []ResourceDatum + FrameworkResources []ResourceDatum + SDKDataSources map[string]ResourceDatum + SDKResources map[string]ResourceDatum } type TemplateData struct { @@ -165,10 +169,10 @@ type visitor struct { functionName string packageName string - frameworkDataSources []string - frameworkResources []string - sdkDataSources map[string]string - sdkResources map[string]string + frameworkDataSources []ResourceDatum + frameworkResources []ResourceDatum + sdkDataSources map[string]ResourceDatum + sdkResources map[string]ResourceDatum } // processDir scans a single service package directory and processes contained Go sources files. @@ -214,16 +218,22 @@ func (v *visitor) processFuncDecl(funcDecl *ast.FuncDecl) { line := line.Text if m := frameworkDataSourceAnnotation.FindStringSubmatch(line); len(m) > 0 { - if slices.Contains(v.frameworkDataSources, v.functionName) { + if slices.ContainsFunc(v.frameworkDataSources, func(d ResourceDatum) bool { return d.FactoryName == v.functionName }) { v.err = multierror.Append(v.err, fmt.Errorf("duplicate Framework Data Source: %s", fmt.Sprintf("%s.%s", v.packageName, v.functionName))) } else { - v.frameworkDataSources = append(v.frameworkDataSources, v.functionName) + d := ResourceDatum{ + FactoryName: v.functionName, + } + v.frameworkDataSources = append(v.frameworkDataSources, d) } } else if m := frameworkResourceAnnotation.FindStringSubmatch(line); len(m) > 0 { - if slices.Contains(v.frameworkResources, v.functionName) { + if slices.ContainsFunc(v.frameworkResources, func(d ResourceDatum) bool { return d.FactoryName == v.functionName }) { v.err = multierror.Append(v.err, fmt.Errorf("duplicate Framework Resource: %s", fmt.Sprintf("%s.%s", v.packageName, v.functionName))) } else { - v.frameworkResources = append(v.frameworkResources, v.functionName) + d := ResourceDatum{ + FactoryName: v.functionName, + } + v.frameworkResources = append(v.frameworkResources, d) } } else if m := sdkDataSourceAnnotation.FindStringSubmatch(line); len(m) > 0 { args := common.ParseArgs(m[1]) @@ -232,7 +242,10 @@ func (v *visitor) processFuncDecl(funcDecl *ast.FuncDecl) { if _, ok := v.sdkDataSources[name]; ok { v.err = multierror.Append(v.err, fmt.Errorf("duplicate SDK Data Source (%s): %s", name, fmt.Sprintf("%s.%s", v.packageName, v.functionName))) } else { - v.sdkDataSources[name] = v.functionName + d := ResourceDatum{ + FactoryName: v.functionName, + } + v.sdkDataSources[name] = d } } else if m := sdkResourceAnnotation.FindStringSubmatch(line); len(m) > 0 { args := common.ParseArgs(m[1]) @@ -241,7 +254,10 @@ func (v *visitor) processFuncDecl(funcDecl *ast.FuncDecl) { if _, ok := v.sdkResources[name]; ok { v.err = multierror.Append(v.err, fmt.Errorf("duplicate SDK Resource (%s): %s", name, fmt.Sprintf("%s.%s", v.packageName, v.functionName))) } else { - v.sdkResources[name] = v.functionName + d := ResourceDatum{ + FactoryName: v.functionName, + } + v.sdkResources[name] = d } } } diff --git a/internal/generate/servicepackages/spd.tmpl b/internal/generate/servicepackages/spd.tmpl index 73f0ae67a768..540c01115756 100644 --- a/internal/generate/servicepackages/spd.tmpl +++ b/internal/generate/servicepackages/spd.tmpl @@ -17,7 +17,7 @@ func (p *servicePackage) FrameworkDataSources(ctx context.Context) []*types.Serv return []*types.ServicePackageFrameworkDataSource { {{- range .FrameworkDataSources }} { - Factory: {{ . }}, + Factory: {{ .FactoryName }}, }, {{- end }} } @@ -27,7 +27,7 @@ func (p *servicePackage) FrameworkResources(ctx context.Context) []*types.Servic return []*types.ServicePackageFrameworkResource { {{- range .FrameworkResources }} { - Factory: {{ . }}, + Factory: {{ .FactoryName }}, }, {{- end }} } @@ -37,7 +37,7 @@ func (p *servicePackage) SDKDataSources(ctx context.Context) []*types.ServicePac return []*types.ServicePackageSDKDataSource { {{- range $key, $value := .SDKDataSources }} { - Factory: {{ $value }}, + Factory: {{ $value.FactoryName }}, TypeName: "{{ $key }}", }, {{- end }} @@ -48,7 +48,7 @@ func (p *servicePackage) SDKResources(ctx context.Context) []*types.ServicePacka return []*types.ServicePackageSDKResource { {{- range $key, $value := .SDKResources }} { - Factory: {{ $value }}, + Factory: {{ $value.FactoryName }}, TypeName: "{{ $key }}", }, {{- end }} From 7a85bbfd0abf037026115e56041c07fef53ff09d Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Thu, 2 Mar 2023 14:55:33 -0500 Subject: [PATCH 493/763] generate/tags: Use 'any' instead of 'interface{}' in generated code. --- .../tags/templates/v1/get_tag_body.tmpl | 4 ++-- .../tags/templates/v1/list_tags_body.tmpl | 4 ++-- .../templates/v1/service_tags_slice_body.tmpl | 18 +++++++++--------- .../tags/templates/v1/update_tags_body.tmpl | 14 +++++++------- .../tags/templates/v2/get_tag_body.tmpl | 4 ++-- .../tags/templates/v2/list_tags_body.tmpl | 2 +- .../templates/v2/service_tags_slice_body.tmpl | 18 +++++++++--------- .../tags/templates/v2/update_tags_body.tmpl | 4 ++-- 8 files changed, 34 insertions(+), 34 deletions(-) diff --git a/internal/generate/tags/templates/v1/get_tag_body.tmpl b/internal/generate/tags/templates/v1/get_tag_body.tmpl index 6df8d85d2326..f06280190141 100644 --- a/internal/generate/tags/templates/v1/get_tag_body.tmpl +++ b/internal/generate/tags/templates/v1/get_tag_body.tmpl @@ -4,7 +4,7 @@ // The identifier is typically the Amazon Resource Name (ARN), although // it may also be a different identifier depending on the service. {{- if not ( .ContextOnly ) }} -func {{ .GetTagFunc }}(conn {{ .ClientType }}, identifier string{{ if .TagResTypeElem }}, resourceType string{{ end }}, key string) +func {{ .GetTagFunc }}(conn {{ .ClientType }}, identifier{{ if .TagResTypeElem }}, resourceType{{ end }}, key string) {{- if or ( .TagTypeIDElem ) ( .TagTypeAddBoolElem ) -}} (*tftags.TagData, error) { {{- else -}} @@ -13,7 +13,7 @@ func {{ .GetTagFunc }}(conn {{ .ClientType }}, identifier string{{ if .TagResTyp return {{ .GetTagFunc }}WithContext(context.Background(), conn, identifier{{ if .TagResTypeElem }}, resourceType{{ end }}, key) } {{- end }} -func {{ if .ContextOnly }}{{ .GetTagFunc }}{{ else }}{{ .GetTagFunc }}WithContext{{ end }}(ctx context.Context, conn {{ .ClientType }}, identifier string{{ if .TagResTypeElem }}, resourceType string{{ end }}, key string) +func {{ if .ContextOnly }}{{ .GetTagFunc }}{{ else }}{{ .GetTagFunc }}WithContext{{ end }}(ctx context.Context, conn {{ .ClientType }}, identifier{{ if .TagResTypeElem }}, resourceType{{ end }}, key string) {{- if or ( .TagTypeIDElem ) ( .TagTypeAddBoolElem ) -}} (*tftags.TagData, error) { {{- else -}} diff --git a/internal/generate/tags/templates/v1/list_tags_body.tmpl b/internal/generate/tags/templates/v1/list_tags_body.tmpl index 7456d1c3a9f5..f6bd30b31eaf 100644 --- a/internal/generate/tags/templates/v1/list_tags_body.tmpl +++ b/internal/generate/tags/templates/v1/list_tags_body.tmpl @@ -2,12 +2,12 @@ // The identifier is typically the Amazon Resource Name (ARN), although // it may also be a different identifier depending on the service. {{- if not ( .ContextOnly ) }} -func {{ .ListTagsFunc }}(conn {{ .ClientType }}, identifier string{{ if .TagResTypeElem }}, resourceType string{{ end }}) (tftags.KeyValueTags, error) { +func {{ .ListTagsFunc }}(conn {{ .ClientType }}, identifier{{ if .TagResTypeElem }}, resourceType{{ end }} string) (tftags.KeyValueTags, error) { return {{ .ListTagsFunc }}WithContext(context.Background(), conn, identifier{{ if .TagResTypeElem }}, resourceType{{ end }}) } {{ end }} -func {{ if .ContextOnly }}{{ .ListTagsFunc }}{{ else }}{{ .ListTagsFunc }}WithContext{{ end }}(ctx context.Context, conn {{ .ClientType }}, identifier string{{ if .TagResTypeElem }}, resourceType string{{ end }}) (tftags.KeyValueTags, error) { +func {{ if .ContextOnly }}{{ .ListTagsFunc }}{{ else }}{{ .ListTagsFunc }}WithContext{{ end }}(ctx context.Context, conn {{ .ClientType }}, identifier{{ if .TagResTypeElem }}, resourceType{{ end }} string) (tftags.KeyValueTags, error) { input := &{{ .TagPackage }}.{{ .ListTagsOp }}Input{ {{- if .ListTagsInFiltIDName }} Filters: []*{{ .TagPackage }}.Filter{ 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 c7ddc35090a3..07cc2b0d8475 100644 --- a/internal/generate/tags/templates/v1/service_tags_slice_body.tmpl +++ b/internal/generate/tags/templates/v1/service_tags_slice_body.tmpl @@ -8,11 +8,11 @@ // This function strips tag resource identifier and type. Generally, this is // the desired behavior so the tag schema does not require those attributes. // Use (tftags.KeyValueTags).ListOfMap() for full tag information. -func ListOfMap(tags tftags.KeyValueTags) []interface{} { - var result []interface{} +func ListOfMap(tags tftags.KeyValueTags) []any { + var result []any for _, key := range tags.Keys() { - m := map[string]interface{}{ + m := map[string]any{ "key": key, "value": aws.StringValue(tags.KeyValue(key)), {{ if .TagTypeAddBoolElem }} @@ -32,8 +32,8 @@ func ListOfMap(tags tftags.KeyValueTags) []interface{} { // // 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) []interface{} { - var result []interface{} +func ListOfStringMap(tags tftags.KeyValueTags) []any { + var result []any for _, key := range tags.Keys() { m := map[string]string{ @@ -115,10 +115,10 @@ func Tags(tags tftags.KeyValueTags) []*{{ .TagPackage }}.{{ .TagType }} { // - []*{{ .TagPackage }}.{{ .TagType2 }} {{- end }} {{- if .TagTypeAddBoolElem }} -// - []interface{} (Terraform TypeList configuration block compatible) +// - []any (Terraform TypeList configuration block compatible) // - *schema.Set (Terraform TypeSet configuration block compatible) {{- end }} -func KeyValueTags(ctx context.Context, tags interface{}{{ if .TagTypeIDElem }}, identifier string{{ if .TagResTypeElem }}, resourceType string{{ end }}{{ end }}) tftags.KeyValueTags { +func KeyValueTags(ctx context.Context, tags any{{ if .TagTypeIDElem }}, identifier string{{ if .TagResTypeElem }}, resourceType string{{ end }}{{ end }}) tftags.KeyValueTags { switch tags := tags.(type) { case []*{{ .TagPackage }}.{{ .TagType }}: {{- if or ( .TagTypeIDElem ) ( .TagTypeAddBoolElem) }} @@ -189,11 +189,11 @@ func KeyValueTags(ctx context.Context, tags interface{}{{ if .TagTypeIDElem }}, {{- if .TagTypeAddBoolElem }} case *schema.Set: return KeyValueTags(ctx, tags.List(){{ if .TagTypeIDElem }}, identifier{{ if .TagResTypeElem }}, resourceType{{ end }}{{ end }}) - case []interface{}: + case []any: result := make(map[string]*tftags.TagData) for _, tfMapRaw := range tags { - tfMap, ok := tfMapRaw.(map[string]interface{}) + tfMap, ok := tfMapRaw.(map[string]any) if !ok { continue diff --git a/internal/generate/tags/templates/v1/update_tags_body.tmpl b/internal/generate/tags/templates/v1/update_tags_body.tmpl index 998222c810d8..c374c2376a72 100644 --- a/internal/generate/tags/templates/v1/update_tags_body.tmpl +++ b/internal/generate/tags/templates/v1/update_tags_body.tmpl @@ -2,17 +2,17 @@ // The identifier is typically the Amazon Resource Name (ARN), although // it may also be a different identifier depending on the service. {{- if not ( .ContextOnly ) }} -func {{ .UpdateTagsFunc }}(conn {{ .ClientType }}, identifier string{{ if .TagResTypeElem }}, resourceType string{{ end }}, oldTags interface{}, newTags interface{}) error { +func {{ .UpdateTagsFunc }}(conn {{ .ClientType }}, identifier string{{ if .TagResTypeElem }}, resourceType string{{ end }}, oldTags, newTags any) error { return {{ .UpdateTagsFunc }}WithContext(context.Background(), conn, identifier{{ if .TagResTypeElem }}, resourceType{{ end }}, oldTags, newTags) } {{- end }} -func {{ if .ContextOnly }}{{ .UpdateTagsFunc }}{{ else }}{{ .UpdateTagsFunc }}WithContext{{ end }}(ctx context.Context, conn {{ .ClientType }}, identifier string{{ if .TagResTypeElem }}, resourceType string{{ end }}, -{{- if .TagTypeAddBoolElem -}} -oldTagsSet interface{}, newTagsSet interface{}) error { + +{{if .TagTypeAddBoolElem -}} +func {{ if .ContextOnly }}{{ .UpdateTagsFunc }}{{ else }}{{ .UpdateTagsFunc }}WithContext{{ end }}(ctx context.Context, conn {{ .ClientType }}, identifier{{ if .TagResTypeElem }}, resourceType{{ end }} string, oldTagsSet, newTagsSet any) error { oldTags := KeyValueTags(ctx, oldTagsSet, identifier{{ if .TagResTypeElem }}, resourceType{{ end }}) newTags := KeyValueTags(ctx, newTagsSet, identifier{{ if .TagResTypeElem }}, resourceType{{ end }}) -{{- else -}} -oldTagsMap interface{}, newTagsMap interface{}) error { +{{- else }} +func {{ if .ContextOnly }}{{ .UpdateTagsFunc }}{{ else }}{{ .UpdateTagsFunc }}WithContext{{ end }}(ctx context.Context, conn {{ .ClientType }}, identifier{{ if .TagResTypeElem }}, resourceType{{ end }} string, oldTagsMap, newTagsMap any) error { oldTags := tftags.New(ctx, oldTagsMap) newTags := tftags.New(ctx, newTagsMap) {{- end }} @@ -135,6 +135,6 @@ oldTagsMap interface{}, newTagsMap interface{}) error { return nil } -func (p *servicePackage) {{ .UpdateTagsFunc }}(ctx context.Context, meta any, identifier string{{ if .TagResTypeElem }}, resourceType string{{ end }}, oldTags interface{}, newTags interface{}) error { +func (p *servicePackage) {{ .UpdateTagsFunc }}(ctx context.Context, meta any, identifier string{{ if .TagResTypeElem }}, resourceType string{{ end }}, oldTags, newTags any) error { return {{ .UpdateTagsFunc }}(ctx, meta.(*conns.AWSClient).{{ .ProviderNameUpper }}Conn(), identifier{{ if .TagResTypeElem }}, resourceType{{ end }}, oldTags, newTags) } diff --git a/internal/generate/tags/templates/v2/get_tag_body.tmpl b/internal/generate/tags/templates/v2/get_tag_body.tmpl index a2feb09ec8e8..d2f9042c98fc 100644 --- a/internal/generate/tags/templates/v2/get_tag_body.tmpl +++ b/internal/generate/tags/templates/v2/get_tag_body.tmpl @@ -4,9 +4,9 @@ // The identifier is typically the Amazon Resource Name (ARN), although // it may also be a different identifier depending on the service. {{- if or ( .TagTypeIDElem ) ( .TagTypeAddBoolElem ) }} -func {{ .GetTagFunc }}(ctx context.Context, conn {{ .ClientType }}, identifier string{{ if .TagResTypeElem }}, resourceType string{{ end }}, key string) (*tftags.TagData, error) { +func {{ .GetTagFunc }}(ctx context.Context, conn {{ .ClientType }}, identifier{{ if .TagResTypeElem }}, resourceType{{ end }}, key string) (*tftags.TagData, error) { {{- else }} -func {{ .GetTagFunc }}(ctx context.Context, conn {{ .ClientType }}, identifier string{{ if .TagResTypeElem }}, resourceType string{{ end }}, key string) (*string, error) { +func {{ .GetTagFunc }}(ctx context.Context, conn {{ .ClientType }}, identifier{{ if .TagResTypeElem }}, resourceType{{ end }}, key string) (*string, error) { {{- end }} {{- if .ListTagsInFiltIDName }} input := &{{ .AWSService }}.{{ .ListTagsOp }}Input{ diff --git a/internal/generate/tags/templates/v2/list_tags_body.tmpl b/internal/generate/tags/templates/v2/list_tags_body.tmpl index 38b042db3250..c14e618a5baf 100644 --- a/internal/generate/tags/templates/v2/list_tags_body.tmpl +++ b/internal/generate/tags/templates/v2/list_tags_body.tmpl @@ -1,7 +1,7 @@ // {{ .ListTagsFunc }} lists {{ .ServicePackage }} service tags. // The identifier is typically the Amazon Resource Name (ARN), although // it may also be a different identifier depending on the service. -func {{ .ListTagsFunc }}(ctx context.Context, conn {{ .ClientType }}, identifier string{{ if .TagResTypeElem }}, resourceType string{{ end }}) (tftags.KeyValueTags, error) { +func {{ .ListTagsFunc }}(ctx context.Context, conn {{ .ClientType }}, identifier{{ if .TagResTypeElem }}, resourceType{{ end }} string) (tftags.KeyValueTags, error) { input := &{{ .TagPackage }}.{{ .ListTagsOp }}Input{ {{- if .ListTagsInFiltIDName }} Filters: []*{{ .AWSService }}.Filter{ 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 b30524d1450e..32eb9d7c7a71 100644 --- a/internal/generate/tags/templates/v2/service_tags_slice_body.tmpl +++ b/internal/generate/tags/templates/v2/service_tags_slice_body.tmpl @@ -8,11 +8,11 @@ // This function strips tag resource identifier and type. Generally, this is // the desired behavior so the tag schema does not require those attributes. // Use (tftags.KeyValueTags).ListOfMap() for full tag information. -func ListOfMap(tags tftags.KeyValueTags) []interface{} { - var result []interface{} +func ListOfMap(tags tftags.KeyValueTags) []any { + var result []any for _, key := range tags.Keys() { - m := map[string]interface{}{ + m := map[string]any{ "key": key, "value": aws.ToString(tags.KeyValue(key)), {{ if .TagTypeAddBoolElem }} @@ -32,8 +32,8 @@ func ListOfMap(tags tftags.KeyValueTags) []interface{} { // // 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) []interface{} { - var result []interface{} +func ListOfStringMap(tags tftags.KeyValueTags) []any { + var result []any for _, key := range tags.Keys() { m := map[string]string{ @@ -115,10 +115,10 @@ func Tags(tags tftags.KeyValueTags) []types.{{ .TagType }} { // - []types.{{ .TagType2 }} {{- end }} {{- if .TagTypeAddBoolElem }} -// - []interface{} (Terraform TypeList configuration block compatible) +// - []any (Terraform TypeList configuration block compatible) // - *schema.Set (Terraform TypeSet configuration block compatible) {{- end }} -func KeyValueTags(ctx context.Context, tags interface{}{{ if .TagTypeIDElem }}, identifier string{{ if .TagResTypeElem }}, resourceType string{{ end }}{{ end }}) tftags.KeyValueTags { +func KeyValueTags(ctx context.Context, tags any{{ if .TagTypeIDElem }}, identifier string{{ if .TagResTypeElem }}, resourceType string{{ end }}{{ end }}) tftags.KeyValueTags { switch tags := tags.(type) { case []types.{{ .TagType }}: {{- if or ( .TagTypeIDElem ) ( .TagTypeAddBoolElem) }} @@ -189,11 +189,11 @@ func KeyValueTags(ctx context.Context, tags interface{}{{ if .TagTypeIDElem }}, {{- if .TagTypeAddBoolElem }} case *schema.Set: return KeyValueTags(tags.List(){{ if .TagTypeIDElem }}, identifier{{ if .TagResTypeElem }}, resourceType{{ end }}{{ end }}) - case []interface{}: + case []any: result := make(map[string]*tftags.TagData) for _, tfMapRaw := range tags { - tfMap, ok := tfMapRaw.(map[string]interface{}) + tfMap, ok := tfMapRaw.(map[string]any) if !ok { continue diff --git a/internal/generate/tags/templates/v2/update_tags_body.tmpl b/internal/generate/tags/templates/v2/update_tags_body.tmpl index d6e8c342996f..be4c3e9cb5ed 100644 --- a/internal/generate/tags/templates/v2/update_tags_body.tmpl +++ b/internal/generate/tags/templates/v2/update_tags_body.tmpl @@ -2,11 +2,11 @@ // The identifier is typically the Amazon Resource Name (ARN), although // it may also be a different identifier depending on the service. {{- if .TagTypeAddBoolElem }} -func {{ .UpdateTagsFunc }}(ctx context.Context, conn {{ .ClientType }}, identifier string{{ if .TagResTypeElem }}, resourceType string{{ end }}, oldTagsSet interface{}, newTagsSet interface{}) error { +func {{ .UpdateTagsFunc }}(ctx context.Context, conn {{ .ClientType }}, identifier{{ if .TagResTypeElem }}, resourceType{{ end }} string, oldTagsSet, newTagsSet any) error { oldTags := KeyValueTags(ctx, oldTagsSet, identifier{{ if .TagResTypeElem }}, resourceType{{ end }}) newTags := KeyValueTags(ctx, newTagsSet, identifier{{ if .TagResTypeElem }}, resourceType{{ end }}) {{- else }} -func {{ .UpdateTagsFunc }}(ctx context.Context, conn {{ .ClientType }}, identifier string{{ if .TagResTypeElem }}, resourceType string{{ end }}, oldTagsMap interface{}, newTagsMap interface{}) error { +func {{ .UpdateTagsFunc }}(ctx context.Context, conn {{ .ClientType }}, identifier{{ if .TagResTypeElem }}, resourceType{{ end }} string, oldTagsMap, newTagsMap any) error { oldTags := tftags.New(ctx, oldTagsMap) newTags := tftags.New(ctx, newTagsMap) {{- end }} From 600798d3a8d184dc8e839f4b0092dc108391aaf8 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Thu, 2 Mar 2023 15:36:46 -0500 Subject: [PATCH 494/763] Generate 'servicePackage.ListTags'. --- internal/generate/tags/main.go | 2 +- internal/generate/tags/templates/v1/list_tags_body.tmpl | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/internal/generate/tags/main.go b/internal/generate/tags/main.go index d8d8451873f0..955192356bc0 100644 --- a/internal/generate/tags/main.go +++ b/internal/generate/tags/main.go @@ -230,7 +230,7 @@ func main() { ProviderNameUpper: providerNameUpper, ServicePackage: servicePackage, - ConnsPkg: *sdkVersion == sdkV1 && *updateTags, + ConnsPkg: *sdkVersion == sdkV1 && (*listTags || *updateTags), ContextPkg: *sdkVersion == sdkV2 || (*getTag || *listTags || *serviceTagsMap || *serviceTagsSlice || *updateTags), FmtPkg: *updateTags, HelperSchemaPkg: awsPkg == "autoscaling", diff --git a/internal/generate/tags/templates/v1/list_tags_body.tmpl b/internal/generate/tags/templates/v1/list_tags_body.tmpl index f6bd30b31eaf..6eb07a54b369 100644 --- a/internal/generate/tags/templates/v1/list_tags_body.tmpl +++ b/internal/generate/tags/templates/v1/list_tags_body.tmpl @@ -52,3 +52,7 @@ func {{ if .ContextOnly }}{{ .ListTagsFunc }}{{ else }}{{ .ListTagsFunc }}WithCo return KeyValueTags(ctx, output.{{ .ListTagsOutTagsElem }}{{ if .TagTypeIDElem }}, identifier{{ if .TagResTypeElem }}, resourceType{{ end }}{{ end }}), nil } + +func (p *servicePackage) {{ .ListTagsFunc }}(ctx context.Context, meta any, identifier{{ if .TagResTypeElem }}, resourceType{{ end }} string) (tftags.KeyValueTags, error) { + return {{ .ListTagsFunc }}(ctx, meta.(*conns.AWSClient).{{ .ProviderNameUpper }}Conn(), identifier{{ if .TagResTypeElem }}, resourceType{{ end }}) +} From 373b8edadaf61c25129e0815ff9d68e010e9c307 Mon Sep 17 00:00:00 2001 From: Brittan DeYoung <32572259+brittandeyoung@users.noreply.github.com> Date: Tue, 7 Mar 2023 14:52:40 -0500 Subject: [PATCH 495/763] licensemanager: Add received_license_data_source --- .../received_license_data_source.go | 456 ++++++++++++++++++ 1 file changed, 456 insertions(+) create mode 100644 internal/service/licensemanager/received_license_data_source.go diff --git a/internal/service/licensemanager/received_license_data_source.go b/internal/service/licensemanager/received_license_data_source.go new file mode 100644 index 000000000000..ec555ead2995 --- /dev/null +++ b/internal/service/licensemanager/received_license_data_source.go @@ -0,0 +1,456 @@ +package licensemanager + +import ( + "context" + "errors" + + "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/service/licensemanager" + "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-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" + "github.com/hashicorp/terraform-provider-aws/internal/verify" + "github.com/hashicorp/terraform-provider-aws/names" +) + +const ( + ResReceivedLicense = "Received License" +) + +// @SDKDataSource("aws_licensemanager_received_license") +func DataSourceReceivedLicense() *schema.Resource { + return &schema.Resource{ + ReadWithoutTimeout: dataSourceReceivedLicenseRead, + Schema: map[string]*schema.Schema{ + "beneficiary": { + Computed: true, + Type: schema.TypeString, + }, + "consumption_configuration": { + Computed: true, + Type: schema.TypeList, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "borrow_configuration": { + Type: schema.TypeList, + Computed: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "allow_early_check_in": { + Computed: true, + Type: schema.TypeBool, + }, + "max_time_to_live_in_minutes": { + Computed: true, + Type: schema.TypeInt, + }, + }, + }, + }, + "provisional_configuration": { + Type: schema.TypeList, + Computed: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "max_time_to_live_in_minutes": { + Computed: true, + Type: schema.TypeInt, + }, + }, + }, + }, + "renew_type": { + Type: schema.TypeString, + Computed: true, + }, + }, + }, + }, + "create_time": { + Computed: true, + Type: schema.TypeString, + }, + "entitlements": { + Computed: true, + Type: schema.TypeSet, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "allow_check_in": { + Type: schema.TypeBool, + Computed: true, + }, + "max_count": { + Type: schema.TypeInt, + Computed: true, + }, + "name": { + Type: schema.TypeString, + Computed: true, + }, + "unit": { + Type: schema.TypeString, + Computed: true, + }, + "value": { + Type: schema.TypeString, + Computed: true, + }, + }, + }, + }, + "home_region": { + Computed: true, + Type: schema.TypeString, + }, + "issuer": { + Computed: true, + Type: schema.TypeList, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "key_fingerprint": { + Type: schema.TypeString, + Computed: true, + }, + "name": { + Type: schema.TypeString, + Computed: true, + }, + "sign_key": { + Type: schema.TypeString, + Computed: true, + }, + }, + }, + }, + "license_arn": { + Required: true, + Type: schema.TypeString, + ValidateFunc: verify.ValidARN, + }, + "license_metadata": { + Computed: true, + Type: schema.TypeList, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "name": { + Type: schema.TypeString, + Computed: true, + }, + "value": { + Type: schema.TypeString, + Computed: true, + }, + }, + }, + }, + "license_name": { + Computed: true, + Type: schema.TypeString, + }, + "product_name": { + Computed: true, + Type: schema.TypeString, + }, + "product_sku": { + Computed: true, + Type: schema.TypeString, + }, + "received_metadata": { + Computed: true, + Type: schema.TypeList, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "allowed_operations": { + Type: schema.TypeSet, + Computed: true, + Elem: &schema.Schema{ + Type: schema.TypeString, + }, + }, + "received_status": { + Type: schema.TypeString, + Computed: true, + }, + "received_status_reason": { + Type: schema.TypeString, + Computed: true, + }, + }, + }, + }, + "status": { + Computed: true, + Type: schema.TypeString, + }, + "validity": { + Computed: true, + Type: schema.TypeSet, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "begin": { + Type: schema.TypeString, + Computed: true, + }, + "end": { + Type: schema.TypeString, + Computed: true, + }, + }, + }, + }, + "version": { + Computed: true, + Type: schema.TypeString, + }, + }, + } +} + +func dataSourceReceivedLicenseRead(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { + var diags diag.Diagnostics + conn := meta.(*conns.AWSClient).LicenseManagerConn() + + in := &licensemanager.ListReceivedLicensesInput{ + LicenseArns: aws.StringSlice([]string{d.Get("license_arn").(string)}), + } + + out, err := FindReceivedLicenseByARN(ctx, conn, in) + + if err != nil { + return sdkdiag.AppendErrorf(diags, "reading Received Licenses: %s", err) + } + + d.SetId(*out.LicenseArn) + d.Set("beneficiary", out.Beneficiary) + d.Set("consumption_configuration", []interface{}{flattenConsumptionConfiguration(out.ConsumptionConfiguration)}) + d.Set("create_time", out.CreateTime) + d.Set("entitlements", flattenEntitlements(out.Entitlements)) + d.Set("home_region", out.HomeRegion) + d.Set("issuer", []interface{}{flattenIssuer(out.Issuer)}) + d.Set("license_arn", out.LicenseArn) + d.Set("license_metadata", flattenMetadatas(out.LicenseMetadata)) + d.Set("license_name", out.LicenseName) + d.Set("product_name", out.ProductName) + d.Set("product_sku", out.ProductSKU) + d.Set("received_metadata", []interface{}{flattenReceivedMetadata(out.ReceivedMetadata)}) + d.Set("status", out.Status) + d.Set("validity", []interface{}{flattenDateTimeRange(out.Validity)}) + d.Set("version", out.Version) + + return diags +} + +func FindReceivedLicenseByARN(ctx context.Context, conn *licensemanager.LicenseManager, in *licensemanager.ListReceivedLicensesInput) (*licensemanager.GrantedLicense, error) { + out, err := conn.ListReceivedLicensesWithContext(ctx, in) + + if tfawserr.ErrCodeEquals(err, licensemanager.ErrCodeResourceNotFoundException) { + return nil, &resource.NotFoundError{ + LastError: err, + LastRequest: in, + } + } + + if err != nil { + return nil, err + } + + if len(out.Licenses) == 0 { + return nil, tfresource.NewEmptyResultError(in) + } + + if len(out.Licenses) > 1 { + return nil, create.Error(names.LicenseManager, create.ErrActionReading, ResReceivedLicense, *in.LicenseArns[0], errors.New("More than one License Returned by the API.")) + } + + return out.Licenses[0], nil +} + +func flattenConsumptionConfiguration(apiObject *licensemanager.ConsumptionConfiguration) map[string]interface{} { + if apiObject == nil { + return nil + } + + tfMap := map[string]interface{}{} + + if v := apiObject.BorrowConfiguration; v != nil { + tfMap["borrow_configuration"] = map[string]interface{}{ + "max_time_to_live_in_minutes": v.MaxTimeToLiveInMinutes, + "allow_early_check_in": v.AllowEarlyCheckIn, + } + } + + if v := apiObject.ProvisionalConfiguration.MaxTimeToLiveInMinutes; v != nil { + tfMap["provisional_configuration"] = []interface{}{map[string]interface{}{ + "max_time_to_live_in_minutes": int(aws.Int64Value(v)), + }} + } + + if v := apiObject.RenewType; v != nil { + tfMap["renew_type"] = v + } + + return tfMap +} + +func flattenEntitlements(apiObjects []*licensemanager.Entitlement) []interface{} { + if len(apiObjects) == 0 { + return nil + } + + var tfList []interface{} + + for _, apiObject := range apiObjects { + if apiObject == nil { + continue + } + + out := flattenEntitlement(apiObject) + + if len(out) > 0 { + tfList = append(tfList, out) + } + } + + return tfList +} + +func flattenEntitlement(apiObject *licensemanager.Entitlement) map[string]interface{} { + if apiObject == nil { + return nil + } + + tfMap := map[string]interface{}{} + + if v := apiObject.AllowCheckIn; v != nil { + tfMap["allow_check_in"] = v + } + + if v := apiObject.MaxCount; v != nil { + tfMap["max_count"] = v + } + + if v := apiObject.Name; v != nil { + tfMap["name"] = v + } + + if v := apiObject.Overage; v != nil { + tfMap["overage"] = v + } + + if v := apiObject.Unit; v != nil { + tfMap["unit"] = v + } + + if v := apiObject.Value; v != nil { + tfMap["value"] = v + } + + return tfMap +} + +func flattenIssuer(apiObject *licensemanager.IssuerDetails) map[string]interface{} { + if apiObject == nil { + return nil + } + + tfMap := map[string]interface{}{} + + if v := apiObject.KeyFingerprint; v != nil { + tfMap["key_fingerprint"] = v + } + + if v := apiObject.Name; v != nil { + tfMap["name"] = v + } + + if v := apiObject.SignKey; v != nil { + tfMap["sign_key"] = v + } + + return tfMap +} + +func flattenMetadatas(apiObjects []*licensemanager.Metadata) []interface{} { + if len(apiObjects) == 0 { + return nil + } + + var tfList []interface{} + + for _, apiObject := range apiObjects { + if apiObject == nil { + continue + } + + out := flattenLicenseMetadata(apiObject) + + if len(out) > 0 { + tfList = append(tfList, out) + } + } + + return tfList +} + +func flattenLicenseMetadata(apiObject *licensemanager.Metadata) map[string]interface{} { + if apiObject == nil { + return nil + } + + tfMap := map[string]interface{}{} + + if v := apiObject.Name; v != nil { + tfMap["name"] = v + } + + if v := apiObject.Value; v != nil { + tfMap["value"] = v + } + + return tfMap +} + +func flattenReceivedMetadata(apiObject *licensemanager.ReceivedMetadata) map[string]interface{} { + if apiObject == nil { + return nil + } + + tfMap := map[string]interface{}{} + + if v := apiObject.AllowedOperations; v != nil { + tfMap["allowed_operations"] = v + } + + if v := apiObject.ReceivedStatus; v != nil { + tfMap["received_status"] = v + } + + if v := apiObject.ReceivedStatusReason; v != nil { + tfMap["received_status_reason"] = v + } + + return tfMap +} + +func flattenDateTimeRange(apiObject *licensemanager.DatetimeRange) map[string]interface{} { + if apiObject == nil { + return nil + } + + tfMap := map[string]interface{}{} + + if v := apiObject.Begin; v != nil { + tfMap["begin"] = v + } + + if v := apiObject.End; v != nil { + tfMap["end"] = v + } + + return tfMap +} From 891ea41dc2635aa57d43d0c8590a37e64619a87d Mon Sep 17 00:00:00 2001 From: Brittan DeYoung <32572259+brittandeyoung@users.noreply.github.com> Date: Tue, 7 Mar 2023 14:52:59 -0500 Subject: [PATCH 496/763] licensemanager: Add received_license_data_source_test --- .../received_license_data_source_test.go | 56 +++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 internal/service/licensemanager/received_license_data_source_test.go diff --git a/internal/service/licensemanager/received_license_data_source_test.go b/internal/service/licensemanager/received_license_data_source_test.go new file mode 100644 index 000000000000..77c759e0a3cd --- /dev/null +++ b/internal/service/licensemanager/received_license_data_source_test.go @@ -0,0 +1,56 @@ +package licensemanager_test + +import ( + "fmt" + "os" + "testing" + + "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" +) + +func TestAccLicenseManagerReceivedLicenseDataSource_basic(t *testing.T) { + datasourceName := "data.aws_licensemanager_received_license.test" + licenseARNKey := "LICENSE_MANAGER_LICENSE_ARN" + licenseARN := os.Getenv(licenseARNKey) + if licenseARN == "" { + t.Skipf("Environment variable %s is not set", licenseARNKey) + } + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { acctest.PreCheck(t) }, + ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + Steps: []resource.TestStep{ + { + Config: testAccReceivedLicenseDataSourceConfig_arn(licenseARN), + Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttrSet(datasourceName, "beneficiary"), + resource.TestCheckResourceAttr(datasourceName, "consumption_configuration.#", "1"), + resource.TestCheckResourceAttrSet(datasourceName, "create_time"), + resource.TestCheckResourceAttr(datasourceName, "entitlements.#", "1"), + resource.TestCheckResourceAttrSet(datasourceName, "home_region"), + resource.TestCheckResourceAttr(datasourceName, "issuer.#", "1"), + resource.TestCheckResourceAttrSet(datasourceName, "license_arn"), + resource.TestCheckResourceAttrSet(datasourceName, "license_metadata.0.%"), + resource.TestCheckResourceAttrSet(datasourceName, "license_name"), + resource.TestCheckResourceAttrSet(datasourceName, "product_name"), + resource.TestCheckResourceAttrSet(datasourceName, "product_sku"), + resource.TestCheckResourceAttr(datasourceName, "received_metadata.#", "1"), + resource.TestCheckResourceAttrSet(datasourceName, "status"), + resource.TestCheckResourceAttr(datasourceName, "validity.#", "1"), + resource.TestCheckResourceAttrSet(datasourceName, "version"), + ), + }, + }, + }) +} + +func testAccReceivedLicenseDataSourceConfig_arn(licenseARN string) string { + return fmt.Sprintf(` +data "aws_licensemanager_received_license" "test" { + license_arn = %[1]q +} +`, licenseARN) +} From b4df8f65d8a8f04682bf906ca53c23f00b7a5d99 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Tue, 7 Mar 2023 14:53:00 -0500 Subject: [PATCH 497/763] Run 'make gen'. --- internal/service/accessanalyzer/tags_gen.go | 9 ++++-- internal/service/acm/tags_gen.go | 9 ++++-- internal/service/acmpca/tags_gen.go | 9 ++++-- internal/service/amp/tags_gen.go | 9 ++++-- internal/service/amplify/tags_gen.go | 9 ++++-- internal/service/apigateway/tags_gen.go | 5 +-- internal/service/apigatewayv2/tags_gen.go | 9 ++++-- internal/service/appconfig/tags_gen.go | 9 ++++-- internal/service/appflow/tags_gen.go | 9 ++++-- internal/service/appintegrations/tags_gen.go | 5 +-- .../service/applicationinsights/tags_gen.go | 9 ++++-- internal/service/appmesh/tags_gen.go | 9 ++++-- internal/service/apprunner/tags_gen.go | 9 ++++-- internal/service/appstream/tags_gen.go | 9 ++++-- internal/service/appsync/tags_gen.go | 9 ++++-- internal/service/athena/tags_gen.go | 9 ++++-- internal/service/auditmanager/tags_gen.go | 2 +- internal/service/autoscaling/tags_gen.go | 31 +++++++++++-------- internal/service/backup/tags_gen.go | 9 ++++-- internal/service/batch/tags_gen.go | 11 +++++-- internal/service/ce/tags_gen.go | 9 ++++-- internal/service/cloud9/tags_gen.go | 9 ++++-- internal/service/cloudfront/tags_gen.go | 9 ++++-- internal/service/cloudhsmv2/tags_gen.go | 9 ++++-- internal/service/cloudtrail/tags_gen.go | 9 ++++-- internal/service/cloudwatch/tags_gen.go | 9 ++++-- internal/service/codeartifact/tags_gen.go | 9 ++++-- internal/service/codecommit/tags_gen.go | 9 ++++-- internal/service/codepipeline/tags_gen.go | 9 ++++-- .../service/codestarconnections/tags_gen.go | 9 ++++-- .../service/codestarnotifications/tags_gen.go | 9 ++++-- internal/service/cognitoidentity/tags_gen.go | 9 ++++-- internal/service/cognitoidp/tags_gen.go | 9 ++++-- internal/service/comprehend/tags_gen.go | 2 +- internal/service/configservice/tags_gen.go | 9 ++++-- internal/service/connect/tags_gen.go | 5 +-- internal/service/dataexchange/tags_gen.go | 9 ++++-- internal/service/datapipeline/tags_gen.go | 5 +-- internal/service/datasync/tags_gen.go | 9 ++++-- internal/service/dax/tags_gen.go | 9 ++++-- internal/service/deploy/tags_gen.go | 9 ++++-- internal/service/detective/tags_gen.go | 9 ++++-- internal/service/devicefarm/tags_gen.go | 9 ++++-- internal/service/directconnect/tags_gen.go | 9 ++++-- internal/service/dlm/tags_gen.go | 9 ++++-- internal/service/dms/tags_gen.go | 9 ++++-- internal/service/docdb/tags_gen.go | 9 ++++-- internal/service/ds/tags_gen.go | 9 ++++-- internal/service/dynamodb/tags_gen.go | 11 +++++-- internal/service/ec2/tags_gen.go | 13 +++++--- internal/service/ecr/tags_gen.go | 9 ++++-- internal/service/ecrpublic/tags_gen.go | 9 ++++-- internal/service/ecs/tags_gen.go | 11 +++++-- internal/service/efs/tags_gen.go | 9 ++++-- internal/service/eks/tags_gen.go | 9 ++++-- internal/service/elasticache/tags_gen.go | 9 ++++-- internal/service/elasticbeanstalk/tags_gen.go | 9 ++++-- internal/service/elasticsearch/tags_gen.go | 9 ++++-- internal/service/elb/tags_gen.go | 9 ++++-- internal/service/elbv2/tags_gen.go | 9 ++++-- internal/service/emr/tags_gen.go | 5 +-- internal/service/emrcontainers/tags_gen.go | 9 ++++-- internal/service/emrserverless/tags_gen.go | 9 ++++-- internal/service/events/tags_gen.go | 9 ++++-- internal/service/evidently/tags_gen.go | 5 +-- internal/service/firehose/tags_gen.go | 9 ++++-- internal/service/fis/tags_gen.go | 2 +- internal/service/fms/tags_gen.go | 9 ++++-- internal/service/fsx/tags_gen.go | 9 ++++-- internal/service/gamelift/tags_gen.go | 9 ++++-- internal/service/glacier/tags_gen.go | 9 ++++-- .../service/globalaccelerator/tags_gen.go | 9 ++++-- internal/service/glue/tags_gen.go | 9 ++++-- internal/service/grafana/tags_gen.go | 9 ++++-- internal/service/greengrass/tags_gen.go | 9 ++++-- internal/service/guardduty/tags_gen.go | 9 ++++-- internal/service/healthlake/tags_gen.go | 2 +- internal/service/imagebuilder/tags_gen.go | 9 ++++-- internal/service/inspector/tags_gen.go | 5 +++ internal/service/iot/tags_gen.go | 9 ++++-- internal/service/iotanalytics/tags_gen.go | 9 ++++-- internal/service/iotevents/tags_gen.go | 9 ++++-- internal/service/ivs/tags_gen.go | 9 ++++-- internal/service/ivschat/tags_gen.go | 2 +- internal/service/kafka/tags_gen.go | 5 +-- internal/service/kendra/tags_gen.go | 2 +- internal/service/keyspaces/tags_gen.go | 9 ++++-- internal/service/kinesis/tags_gen.go | 9 ++++-- internal/service/kinesisanalytics/tags_gen.go | 9 ++++-- .../service/kinesisanalyticsv2/tags_gen.go | 9 ++++-- internal/service/kinesisvideo/tags_gen.go | 9 ++++-- internal/service/kms/tags_gen.go | 9 ++++-- internal/service/lambda/tags_gen.go | 2 +- internal/service/licensemanager/tags_gen.go | 5 +-- internal/service/lightsail/tags_gen.go | 5 +-- internal/service/location/tags_gen.go | 9 ++++-- internal/service/logs/log_group_tags_gen.go | 9 ++++-- internal/service/logs/tags_gen.go | 9 ++++-- internal/service/mediaconnect/tags_gen.go | 9 ++++-- internal/service/mediaconvert/tags_gen.go | 9 ++++-- internal/service/medialive/tags_gen.go | 2 +- internal/service/mediapackage/tags_gen.go | 9 ++++-- internal/service/mediastore/tags_gen.go | 9 ++++-- internal/service/memorydb/tags_gen.go | 9 ++++-- internal/service/mq/tags_gen.go | 9 ++++-- internal/service/mwaa/tags_gen.go | 5 +-- internal/service/neptune/tags_gen.go | 9 ++++-- internal/service/networkfirewall/tags_gen.go | 9 ++++-- internal/service/networkmanager/tags_gen.go | 5 +-- internal/service/oam/tags_gen.go | 2 +- internal/service/opensearch/tags_gen.go | 9 ++++-- .../service/opensearchserverless/tags_gen.go | 2 +- internal/service/opsworks/tags_gen.go | 9 ++++-- internal/service/organizations/tags_gen.go | 9 ++++-- internal/service/pinpoint/tags_gen.go | 9 ++++-- internal/service/qldb/tags_gen.go | 9 ++++-- internal/service/quicksight/tags_gen.go | 9 ++++-- internal/service/ram/tags_gen.go | 5 +-- internal/service/rds/tags_gen.go | 9 ++++-- internal/service/redshift/tags_gen.go | 5 +-- .../service/redshiftserverless/tags_gen.go | 9 ++++-- .../service/resourceexplorer2/tags_gen.go | 2 +- internal/service/resourcegroups/tags_gen.go | 9 ++++-- internal/service/rolesanywhere/tags_gen.go | 2 +- internal/service/route53/tags_gen.go | 11 +++++-- internal/service/route53domains/tags_gen.go | 4 +-- .../route53recoveryreadiness/tags_gen.go | 9 ++++-- internal/service/route53resolver/tags_gen.go | 11 +++++-- internal/service/rum/tags_gen.go | 5 +-- internal/service/sagemaker/tags_gen.go | 9 ++++-- internal/service/scheduler/tags_gen.go | 2 +- internal/service/schemas/tags_gen.go | 9 ++++-- internal/service/secretsmanager/tags_gen.go | 5 +-- internal/service/securityhub/tags_gen.go | 9 ++++-- internal/service/servicediscovery/tags_gen.go | 9 ++++-- internal/service/sesv2/tags_gen.go | 2 +- internal/service/sfn/tags_gen.go | 9 ++++-- internal/service/shield/tags_gen.go | 9 ++++-- internal/service/signer/tags_gen.go | 9 ++++-- internal/service/sns/tags_gen.go | 9 ++++-- internal/service/sqs/tags_gen.go | 9 ++++-- internal/service/ssm/tags_gen.go | 11 +++++-- internal/service/ssoadmin/tags_gen.go | 11 +++++-- internal/service/storagegateway/tags_gen.go | 9 ++++-- internal/service/swf/tags_gen.go | 9 ++++-- internal/service/synthetics/tags_gen.go | 5 +-- internal/service/timestreamwrite/tags_gen.go | 9 ++++-- internal/service/transcribe/tags_gen.go | 2 +- internal/service/transfer/tags_gen.go | 11 +++++-- .../update_tags_no_system_ignore_gen.go | 5 +-- internal/service/waf/tags_gen.go | 9 ++++-- internal/service/wafregional/tags_gen.go | 9 ++++-- internal/service/wafv2/tags_gen.go | 9 ++++-- internal/service/worklink/tags_gen.go | 9 ++++-- internal/service/workspaces/tags_gen.go | 9 ++++-- internal/service/xray/tags_gen.go | 9 ++++-- 156 files changed, 948 insertions(+), 316 deletions(-) diff --git a/internal/service/accessanalyzer/tags_gen.go b/internal/service/accessanalyzer/tags_gen.go index ac3a936871ae..77099b6158d7 100644 --- a/internal/service/accessanalyzer/tags_gen.go +++ b/internal/service/accessanalyzer/tags_gen.go @@ -29,6 +29,10 @@ func ListTags(ctx context.Context, conn accessanalyzeriface.AccessAnalyzerAPI, i return KeyValueTags(ctx, output.Tags), nil } +func (p *servicePackage) ListTags(ctx context.Context, meta any, identifier string) (tftags.KeyValueTags, error) { + return ListTags(ctx, meta.(*conns.AWSClient).AccessAnalyzerConn(), identifier) +} + // map[string]*string handling // Tags returns accessanalyzer service tags. @@ -44,7 +48,8 @@ func KeyValueTags(ctx context.Context, tags map[string]*string) tftags.KeyValueT // UpdateTags updates accessanalyzer 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 accessanalyzeriface.AccessAnalyzerAPI, identifier string, oldTagsMap interface{}, newTagsMap interface{}) error { + +func UpdateTags(ctx context.Context, conn accessanalyzeriface.AccessAnalyzerAPI, identifier string, oldTagsMap, newTagsMap any) error { oldTags := tftags.New(ctx, oldTagsMap) newTags := tftags.New(ctx, newTagsMap) @@ -77,6 +82,6 @@ func UpdateTags(ctx context.Context, conn accessanalyzeriface.AccessAnalyzerAPI, return nil } -func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags interface{}, newTags interface{}) error { +func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags, newTags any) error { return UpdateTags(ctx, meta.(*conns.AWSClient).AccessAnalyzerConn(), identifier, oldTags, newTags) } diff --git a/internal/service/acm/tags_gen.go b/internal/service/acm/tags_gen.go index ad7411edadad..f4c0b596a2af 100644 --- a/internal/service/acm/tags_gen.go +++ b/internal/service/acm/tags_gen.go @@ -29,6 +29,10 @@ func ListTags(ctx context.Context, conn acmiface.ACMAPI, identifier string) (tft return KeyValueTags(ctx, output.Tags), nil } +func (p *servicePackage) ListTags(ctx context.Context, meta any, identifier string) (tftags.KeyValueTags, error) { + return ListTags(ctx, meta.(*conns.AWSClient).ACMConn(), identifier) +} + // []*SERVICE.Tag handling // Tags returns acm service tags. @@ -61,7 +65,8 @@ func KeyValueTags(ctx context.Context, tags []*acm.Tag) tftags.KeyValueTags { // UpdateTags updates acm 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 acmiface.ACMAPI, identifier string, oldTagsMap interface{}, newTagsMap interface{}) error { + +func UpdateTags(ctx context.Context, conn acmiface.ACMAPI, identifier string, oldTagsMap, newTagsMap any) error { oldTags := tftags.New(ctx, oldTagsMap) newTags := tftags.New(ctx, newTagsMap) @@ -94,6 +99,6 @@ func UpdateTags(ctx context.Context, conn acmiface.ACMAPI, identifier string, ol return nil } -func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags interface{}, newTags interface{}) error { +func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags, newTags any) error { return UpdateTags(ctx, meta.(*conns.AWSClient).ACMConn(), identifier, oldTags, newTags) } diff --git a/internal/service/acmpca/tags_gen.go b/internal/service/acmpca/tags_gen.go index c72170c9adca..bb1ca69ac555 100644 --- a/internal/service/acmpca/tags_gen.go +++ b/internal/service/acmpca/tags_gen.go @@ -29,6 +29,10 @@ func ListTags(ctx context.Context, conn acmpcaiface.ACMPCAAPI, identifier string return KeyValueTags(ctx, output.Tags), nil } +func (p *servicePackage) ListTags(ctx context.Context, meta any, identifier string) (tftags.KeyValueTags, error) { + return ListTags(ctx, meta.(*conns.AWSClient).ACMPCAConn(), identifier) +} + // []*SERVICE.Tag handling // Tags returns acmpca service tags. @@ -61,7 +65,8 @@ func KeyValueTags(ctx context.Context, tags []*acmpca.Tag) tftags.KeyValueTags { // UpdateTags updates acmpca 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 acmpcaiface.ACMPCAAPI, identifier string, oldTagsMap interface{}, newTagsMap interface{}) error { + +func UpdateTags(ctx context.Context, conn acmpcaiface.ACMPCAAPI, identifier string, oldTagsMap, newTagsMap any) error { oldTags := tftags.New(ctx, oldTagsMap) newTags := tftags.New(ctx, newTagsMap) @@ -94,6 +99,6 @@ func UpdateTags(ctx context.Context, conn acmpcaiface.ACMPCAAPI, identifier stri return nil } -func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags interface{}, newTags interface{}) error { +func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags, newTags any) error { return UpdateTags(ctx, meta.(*conns.AWSClient).ACMPCAConn(), identifier, oldTags, newTags) } diff --git a/internal/service/amp/tags_gen.go b/internal/service/amp/tags_gen.go index cd7dfbcbb3f9..b3b0749e67c2 100644 --- a/internal/service/amp/tags_gen.go +++ b/internal/service/amp/tags_gen.go @@ -29,6 +29,10 @@ func ListTags(ctx context.Context, conn prometheusserviceiface.PrometheusService return KeyValueTags(ctx, output.Tags), nil } +func (p *servicePackage) ListTags(ctx context.Context, meta any, identifier string) (tftags.KeyValueTags, error) { + return ListTags(ctx, meta.(*conns.AWSClient).AMPConn(), identifier) +} + // map[string]*string handling // Tags returns amp service tags. @@ -44,7 +48,8 @@ func KeyValueTags(ctx context.Context, tags map[string]*string) tftags.KeyValueT // UpdateTags updates amp 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 prometheusserviceiface.PrometheusServiceAPI, identifier string, oldTagsMap interface{}, newTagsMap interface{}) error { + +func UpdateTags(ctx context.Context, conn prometheusserviceiface.PrometheusServiceAPI, identifier string, oldTagsMap, newTagsMap any) error { oldTags := tftags.New(ctx, oldTagsMap) newTags := tftags.New(ctx, newTagsMap) @@ -77,6 +82,6 @@ func UpdateTags(ctx context.Context, conn prometheusserviceiface.PrometheusServi return nil } -func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags interface{}, newTags interface{}) error { +func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags, newTags any) error { return UpdateTags(ctx, meta.(*conns.AWSClient).AMPConn(), identifier, oldTags, newTags) } diff --git a/internal/service/amplify/tags_gen.go b/internal/service/amplify/tags_gen.go index db7b40dda745..f7d533777868 100644 --- a/internal/service/amplify/tags_gen.go +++ b/internal/service/amplify/tags_gen.go @@ -29,6 +29,10 @@ func ListTags(ctx context.Context, conn amplifyiface.AmplifyAPI, identifier stri return KeyValueTags(ctx, output.Tags), nil } +func (p *servicePackage) ListTags(ctx context.Context, meta any, identifier string) (tftags.KeyValueTags, error) { + return ListTags(ctx, meta.(*conns.AWSClient).AmplifyConn(), identifier) +} + // map[string]*string handling // Tags returns amplify service tags. @@ -44,7 +48,8 @@ func KeyValueTags(ctx context.Context, tags map[string]*string) tftags.KeyValueT // UpdateTags updates amplify 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 amplifyiface.AmplifyAPI, identifier string, oldTagsMap interface{}, newTagsMap interface{}) error { + +func UpdateTags(ctx context.Context, conn amplifyiface.AmplifyAPI, identifier string, oldTagsMap, newTagsMap any) error { oldTags := tftags.New(ctx, oldTagsMap) newTags := tftags.New(ctx, newTagsMap) @@ -77,6 +82,6 @@ func UpdateTags(ctx context.Context, conn amplifyiface.AmplifyAPI, identifier st return nil } -func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags interface{}, newTags interface{}) error { +func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags, newTags any) error { return UpdateTags(ctx, meta.(*conns.AWSClient).AmplifyConn(), identifier, oldTags, newTags) } diff --git a/internal/service/apigateway/tags_gen.go b/internal/service/apigateway/tags_gen.go index e4a4e51d8e0e..a40c6f1a779b 100644 --- a/internal/service/apigateway/tags_gen.go +++ b/internal/service/apigateway/tags_gen.go @@ -27,7 +27,8 @@ func KeyValueTags(ctx context.Context, tags map[string]*string) tftags.KeyValueT // UpdateTags updates apigateway 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 apigatewayiface.APIGatewayAPI, identifier string, oldTagsMap interface{}, newTagsMap interface{}) error { + +func UpdateTags(ctx context.Context, conn apigatewayiface.APIGatewayAPI, identifier string, oldTagsMap, newTagsMap any) error { oldTags := tftags.New(ctx, oldTagsMap) newTags := tftags.New(ctx, newTagsMap) @@ -60,6 +61,6 @@ func UpdateTags(ctx context.Context, conn apigatewayiface.APIGatewayAPI, identif return nil } -func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags interface{}, newTags interface{}) error { +func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags, newTags any) error { return UpdateTags(ctx, meta.(*conns.AWSClient).APIGatewayConn(), identifier, oldTags, newTags) } diff --git a/internal/service/apigatewayv2/tags_gen.go b/internal/service/apigatewayv2/tags_gen.go index 2f8f76e2ceb8..420cfc665ece 100644 --- a/internal/service/apigatewayv2/tags_gen.go +++ b/internal/service/apigatewayv2/tags_gen.go @@ -29,6 +29,10 @@ func ListTags(ctx context.Context, conn apigatewayv2iface.ApiGatewayV2API, ident return KeyValueTags(ctx, output.Tags), nil } +func (p *servicePackage) ListTags(ctx context.Context, meta any, identifier string) (tftags.KeyValueTags, error) { + return ListTags(ctx, meta.(*conns.AWSClient).APIGatewayV2Conn(), identifier) +} + // map[string]*string handling // Tags returns apigatewayv2 service tags. @@ -44,7 +48,8 @@ func KeyValueTags(ctx context.Context, tags map[string]*string) tftags.KeyValueT // UpdateTags updates apigatewayv2 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 apigatewayv2iface.ApiGatewayV2API, identifier string, oldTagsMap interface{}, newTagsMap interface{}) error { + +func UpdateTags(ctx context.Context, conn apigatewayv2iface.ApiGatewayV2API, identifier string, oldTagsMap, newTagsMap any) error { oldTags := tftags.New(ctx, oldTagsMap) newTags := tftags.New(ctx, newTagsMap) @@ -77,6 +82,6 @@ func UpdateTags(ctx context.Context, conn apigatewayv2iface.ApiGatewayV2API, ide return nil } -func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags interface{}, newTags interface{}) error { +func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags, newTags any) error { return UpdateTags(ctx, meta.(*conns.AWSClient).APIGatewayV2Conn(), identifier, oldTags, newTags) } diff --git a/internal/service/appconfig/tags_gen.go b/internal/service/appconfig/tags_gen.go index f97eefe64a7b..99f69d22fb72 100644 --- a/internal/service/appconfig/tags_gen.go +++ b/internal/service/appconfig/tags_gen.go @@ -29,6 +29,10 @@ func ListTags(ctx context.Context, conn appconfigiface.AppConfigAPI, identifier return KeyValueTags(ctx, output.Tags), nil } +func (p *servicePackage) ListTags(ctx context.Context, meta any, identifier string) (tftags.KeyValueTags, error) { + return ListTags(ctx, meta.(*conns.AWSClient).AppConfigConn(), identifier) +} + // map[string]*string handling // Tags returns appconfig service tags. @@ -44,7 +48,8 @@ func KeyValueTags(ctx context.Context, tags map[string]*string) tftags.KeyValueT // UpdateTags updates appconfig 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 appconfigiface.AppConfigAPI, identifier string, oldTagsMap interface{}, newTagsMap interface{}) error { + +func UpdateTags(ctx context.Context, conn appconfigiface.AppConfigAPI, identifier string, oldTagsMap, newTagsMap any) error { oldTags := tftags.New(ctx, oldTagsMap) newTags := tftags.New(ctx, newTagsMap) @@ -77,6 +82,6 @@ func UpdateTags(ctx context.Context, conn appconfigiface.AppConfigAPI, identifie return nil } -func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags interface{}, newTags interface{}) error { +func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags, newTags any) error { return UpdateTags(ctx, meta.(*conns.AWSClient).AppConfigConn(), identifier, oldTags, newTags) } diff --git a/internal/service/appflow/tags_gen.go b/internal/service/appflow/tags_gen.go index b93a495e6475..a5a619444035 100644 --- a/internal/service/appflow/tags_gen.go +++ b/internal/service/appflow/tags_gen.go @@ -29,6 +29,10 @@ func ListTags(ctx context.Context, conn appflowiface.AppflowAPI, identifier stri return KeyValueTags(ctx, output.Tags), nil } +func (p *servicePackage) ListTags(ctx context.Context, meta any, identifier string) (tftags.KeyValueTags, error) { + return ListTags(ctx, meta.(*conns.AWSClient).AppFlowConn(), identifier) +} + // map[string]*string handling // Tags returns appflow service tags. @@ -44,7 +48,8 @@ func KeyValueTags(ctx context.Context, tags map[string]*string) tftags.KeyValueT // UpdateTags updates appflow 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 appflowiface.AppflowAPI, identifier string, oldTagsMap interface{}, newTagsMap interface{}) error { + +func UpdateTags(ctx context.Context, conn appflowiface.AppflowAPI, identifier string, oldTagsMap, newTagsMap any) error { oldTags := tftags.New(ctx, oldTagsMap) newTags := tftags.New(ctx, newTagsMap) @@ -77,6 +82,6 @@ func UpdateTags(ctx context.Context, conn appflowiface.AppflowAPI, identifier st return nil } -func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags interface{}, newTags interface{}) error { +func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags, newTags any) error { return UpdateTags(ctx, meta.(*conns.AWSClient).AppFlowConn(), identifier, oldTags, newTags) } diff --git a/internal/service/appintegrations/tags_gen.go b/internal/service/appintegrations/tags_gen.go index abc54c6f513d..70ded7d6bb04 100644 --- a/internal/service/appintegrations/tags_gen.go +++ b/internal/service/appintegrations/tags_gen.go @@ -27,7 +27,8 @@ func KeyValueTags(ctx context.Context, tags map[string]*string) tftags.KeyValueT // UpdateTags updates appintegrations 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 appintegrationsserviceiface.AppIntegrationsServiceAPI, identifier string, oldTagsMap interface{}, newTagsMap interface{}) error { + +func UpdateTags(ctx context.Context, conn appintegrationsserviceiface.AppIntegrationsServiceAPI, identifier string, oldTagsMap, newTagsMap any) error { oldTags := tftags.New(ctx, oldTagsMap) newTags := tftags.New(ctx, newTagsMap) @@ -60,6 +61,6 @@ func UpdateTags(ctx context.Context, conn appintegrationsserviceiface.AppIntegra return nil } -func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags interface{}, newTags interface{}) error { +func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags, newTags any) error { return UpdateTags(ctx, meta.(*conns.AWSClient).AppIntegrationsConn(), identifier, oldTags, newTags) } diff --git a/internal/service/applicationinsights/tags_gen.go b/internal/service/applicationinsights/tags_gen.go index 1001286dcecf..29d7101d6a7e 100644 --- a/internal/service/applicationinsights/tags_gen.go +++ b/internal/service/applicationinsights/tags_gen.go @@ -29,6 +29,10 @@ func ListTags(ctx context.Context, conn applicationinsightsiface.ApplicationInsi return KeyValueTags(ctx, output.Tags), nil } +func (p *servicePackage) ListTags(ctx context.Context, meta any, identifier string) (tftags.KeyValueTags, error) { + return ListTags(ctx, meta.(*conns.AWSClient).ApplicationInsightsConn(), identifier) +} + // []*SERVICE.Tag handling // Tags returns applicationinsights service tags. @@ -61,7 +65,8 @@ func KeyValueTags(ctx context.Context, tags []*applicationinsights.Tag) tftags.K // UpdateTags updates applicationinsights 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 applicationinsightsiface.ApplicationInsightsAPI, identifier string, oldTagsMap interface{}, newTagsMap interface{}) error { + +func UpdateTags(ctx context.Context, conn applicationinsightsiface.ApplicationInsightsAPI, identifier string, oldTagsMap, newTagsMap any) error { oldTags := tftags.New(ctx, oldTagsMap) newTags := tftags.New(ctx, newTagsMap) @@ -94,6 +99,6 @@ func UpdateTags(ctx context.Context, conn applicationinsightsiface.ApplicationIn return nil } -func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags interface{}, newTags interface{}) error { +func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags, newTags any) error { return UpdateTags(ctx, meta.(*conns.AWSClient).ApplicationInsightsConn(), identifier, oldTags, newTags) } diff --git a/internal/service/appmesh/tags_gen.go b/internal/service/appmesh/tags_gen.go index 1917664739d6..4c5f17c5e709 100644 --- a/internal/service/appmesh/tags_gen.go +++ b/internal/service/appmesh/tags_gen.go @@ -29,6 +29,10 @@ func ListTags(ctx context.Context, conn appmeshiface.AppMeshAPI, identifier stri return KeyValueTags(ctx, output.Tags), nil } +func (p *servicePackage) ListTags(ctx context.Context, meta any, identifier string) (tftags.KeyValueTags, error) { + return ListTags(ctx, meta.(*conns.AWSClient).AppMeshConn(), identifier) +} + // []*SERVICE.Tag handling // Tags returns appmesh service tags. @@ -61,7 +65,8 @@ func KeyValueTags(ctx context.Context, tags []*appmesh.TagRef) tftags.KeyValueTa // UpdateTags updates appmesh 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 appmeshiface.AppMeshAPI, identifier string, oldTagsMap interface{}, newTagsMap interface{}) error { + +func UpdateTags(ctx context.Context, conn appmeshiface.AppMeshAPI, identifier string, oldTagsMap, newTagsMap any) error { oldTags := tftags.New(ctx, oldTagsMap) newTags := tftags.New(ctx, newTagsMap) @@ -94,6 +99,6 @@ func UpdateTags(ctx context.Context, conn appmeshiface.AppMeshAPI, identifier st return nil } -func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags interface{}, newTags interface{}) error { +func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags, newTags any) error { return UpdateTags(ctx, meta.(*conns.AWSClient).AppMeshConn(), identifier, oldTags, newTags) } diff --git a/internal/service/apprunner/tags_gen.go b/internal/service/apprunner/tags_gen.go index f5608aa2f1b1..f89430d86fa6 100644 --- a/internal/service/apprunner/tags_gen.go +++ b/internal/service/apprunner/tags_gen.go @@ -29,6 +29,10 @@ func ListTags(ctx context.Context, conn apprunneriface.AppRunnerAPI, identifier return KeyValueTags(ctx, output.Tags), nil } +func (p *servicePackage) ListTags(ctx context.Context, meta any, identifier string) (tftags.KeyValueTags, error) { + return ListTags(ctx, meta.(*conns.AWSClient).AppRunnerConn(), identifier) +} + // []*SERVICE.Tag handling // Tags returns apprunner service tags. @@ -61,7 +65,8 @@ func KeyValueTags(ctx context.Context, tags []*apprunner.Tag) tftags.KeyValueTag // UpdateTags updates apprunner 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 apprunneriface.AppRunnerAPI, identifier string, oldTagsMap interface{}, newTagsMap interface{}) error { + +func UpdateTags(ctx context.Context, conn apprunneriface.AppRunnerAPI, identifier string, oldTagsMap, newTagsMap any) error { oldTags := tftags.New(ctx, oldTagsMap) newTags := tftags.New(ctx, newTagsMap) @@ -94,6 +99,6 @@ func UpdateTags(ctx context.Context, conn apprunneriface.AppRunnerAPI, identifie return nil } -func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags interface{}, newTags interface{}) error { +func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags, newTags any) error { return UpdateTags(ctx, meta.(*conns.AWSClient).AppRunnerConn(), identifier, oldTags, newTags) } diff --git a/internal/service/appstream/tags_gen.go b/internal/service/appstream/tags_gen.go index 24c979d21aff..5250a2889b4b 100644 --- a/internal/service/appstream/tags_gen.go +++ b/internal/service/appstream/tags_gen.go @@ -29,6 +29,10 @@ func ListTags(ctx context.Context, conn appstreamiface.AppStreamAPI, identifier return KeyValueTags(ctx, output.Tags), nil } +func (p *servicePackage) ListTags(ctx context.Context, meta any, identifier string) (tftags.KeyValueTags, error) { + return ListTags(ctx, meta.(*conns.AWSClient).AppStreamConn(), identifier) +} + // map[string]*string handling // Tags returns appstream service tags. @@ -44,7 +48,8 @@ func KeyValueTags(ctx context.Context, tags map[string]*string) tftags.KeyValueT // UpdateTags updates appstream 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 appstreamiface.AppStreamAPI, identifier string, oldTagsMap interface{}, newTagsMap interface{}) error { + +func UpdateTags(ctx context.Context, conn appstreamiface.AppStreamAPI, identifier string, oldTagsMap, newTagsMap any) error { oldTags := tftags.New(ctx, oldTagsMap) newTags := tftags.New(ctx, newTagsMap) @@ -77,6 +82,6 @@ func UpdateTags(ctx context.Context, conn appstreamiface.AppStreamAPI, identifie return nil } -func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags interface{}, newTags interface{}) error { +func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags, newTags any) error { return UpdateTags(ctx, meta.(*conns.AWSClient).AppStreamConn(), identifier, oldTags, newTags) } diff --git a/internal/service/appsync/tags_gen.go b/internal/service/appsync/tags_gen.go index a590c54e3919..6c9f6e54460c 100644 --- a/internal/service/appsync/tags_gen.go +++ b/internal/service/appsync/tags_gen.go @@ -29,6 +29,10 @@ func ListTags(ctx context.Context, conn appsynciface.AppSyncAPI, identifier stri return KeyValueTags(ctx, output.Tags), nil } +func (p *servicePackage) ListTags(ctx context.Context, meta any, identifier string) (tftags.KeyValueTags, error) { + return ListTags(ctx, meta.(*conns.AWSClient).AppSyncConn(), identifier) +} + // map[string]*string handling // Tags returns appsync service tags. @@ -44,7 +48,8 @@ func KeyValueTags(ctx context.Context, tags map[string]*string) tftags.KeyValueT // UpdateTags updates appsync 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 appsynciface.AppSyncAPI, identifier string, oldTagsMap interface{}, newTagsMap interface{}) error { + +func UpdateTags(ctx context.Context, conn appsynciface.AppSyncAPI, identifier string, oldTagsMap, newTagsMap any) error { oldTags := tftags.New(ctx, oldTagsMap) newTags := tftags.New(ctx, newTagsMap) @@ -77,6 +82,6 @@ func UpdateTags(ctx context.Context, conn appsynciface.AppSyncAPI, identifier st return nil } -func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags interface{}, newTags interface{}) error { +func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags, newTags any) error { return UpdateTags(ctx, meta.(*conns.AWSClient).AppSyncConn(), identifier, oldTags, newTags) } diff --git a/internal/service/athena/tags_gen.go b/internal/service/athena/tags_gen.go index 96279b7c71e9..384c683970b2 100644 --- a/internal/service/athena/tags_gen.go +++ b/internal/service/athena/tags_gen.go @@ -29,6 +29,10 @@ func ListTags(ctx context.Context, conn athenaiface.AthenaAPI, identifier string return KeyValueTags(ctx, output.Tags), nil } +func (p *servicePackage) ListTags(ctx context.Context, meta any, identifier string) (tftags.KeyValueTags, error) { + return ListTags(ctx, meta.(*conns.AWSClient).AthenaConn(), identifier) +} + // []*SERVICE.Tag handling // Tags returns athena service tags. @@ -61,7 +65,8 @@ func KeyValueTags(ctx context.Context, tags []*athena.Tag) tftags.KeyValueTags { // UpdateTags updates athena 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 athenaiface.AthenaAPI, identifier string, oldTagsMap interface{}, newTagsMap interface{}) error { + +func UpdateTags(ctx context.Context, conn athenaiface.AthenaAPI, identifier string, oldTagsMap, newTagsMap any) error { oldTags := tftags.New(ctx, oldTagsMap) newTags := tftags.New(ctx, newTagsMap) @@ -94,6 +99,6 @@ func UpdateTags(ctx context.Context, conn athenaiface.AthenaAPI, identifier stri return nil } -func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags interface{}, newTags interface{}) error { +func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags, newTags any) error { return UpdateTags(ctx, meta.(*conns.AWSClient).AthenaConn(), identifier, oldTags, newTags) } diff --git a/internal/service/auditmanager/tags_gen.go b/internal/service/auditmanager/tags_gen.go index 0a786c3cfdc6..261fbbf6f7b3 100644 --- a/internal/service/auditmanager/tags_gen.go +++ b/internal/service/auditmanager/tags_gen.go @@ -42,7 +42,7 @@ func KeyValueTags(ctx context.Context, tags map[string]string) tftags.KeyValueTa // UpdateTags updates auditmanager 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 *auditmanager.Client, identifier string, oldTagsMap interface{}, newTagsMap interface{}) error { +func UpdateTags(ctx context.Context, conn *auditmanager.Client, identifier string, oldTagsMap, newTagsMap any) error { oldTags := tftags.New(ctx, oldTagsMap) newTags := tftags.New(ctx, newTagsMap) diff --git a/internal/service/autoscaling/tags_gen.go b/internal/service/autoscaling/tags_gen.go index f2fbb17bf447..99125675a878 100644 --- a/internal/service/autoscaling/tags_gen.go +++ b/internal/service/autoscaling/tags_gen.go @@ -20,7 +20,7 @@ import ( // This function will optimise the handling over ListTags, if possible. // The identifier is typically the Amazon Resource Name (ARN), although // it may also be a different identifier depending on the service. -func GetTag(ctx context.Context, conn autoscalingiface.AutoScalingAPI, identifier string, resourceType string, key string) (*tftags.TagData, error) { +func GetTag(ctx context.Context, conn autoscalingiface.AutoScalingAPI, identifier, resourceType, key string) (*tftags.TagData, error) { input := &autoscaling.DescribeTagsInput{ Filters: []*autoscaling.Filter{ { @@ -52,7 +52,7 @@ func GetTag(ctx context.Context, conn autoscalingiface.AutoScalingAPI, identifie // ListTags lists autoscaling service tags. // The identifier is typically the Amazon Resource Name (ARN), although // it may also be a different identifier depending on the service. -func ListTags(ctx context.Context, conn autoscalingiface.AutoScalingAPI, identifier string, resourceType string) (tftags.KeyValueTags, error) { +func ListTags(ctx context.Context, conn autoscalingiface.AutoScalingAPI, identifier, resourceType string) (tftags.KeyValueTags, error) { input := &autoscaling.DescribeTagsInput{ Filters: []*autoscaling.Filter{ { @@ -71,6 +71,10 @@ func ListTags(ctx context.Context, conn autoscalingiface.AutoScalingAPI, identif return KeyValueTags(ctx, output.Tags, identifier, resourceType), nil } +func (p *servicePackage) ListTags(ctx context.Context, meta any, identifier, resourceType string) (tftags.KeyValueTags, error) { + return ListTags(ctx, meta.(*conns.AWSClient).AutoScalingConn(), identifier, resourceType) +} + // []*SERVICE.Tag handling // ListOfMap returns a list of autoscaling in flattened map. @@ -80,11 +84,11 @@ func ListTags(ctx context.Context, conn autoscalingiface.AutoScalingAPI, identif // This function strips tag resource identifier and type. Generally, this is // the desired behavior so the tag schema does not require those attributes. // Use (tftags.KeyValueTags).ListOfMap() for full tag information. -func ListOfMap(tags tftags.KeyValueTags) []interface{} { - var result []interface{} +func ListOfMap(tags tftags.KeyValueTags) []any { + var result []any for _, key := range tags.Keys() { - m := map[string]interface{}{ + m := map[string]any{ "key": key, "value": aws.StringValue(tags.KeyValue(key)), @@ -101,8 +105,8 @@ func ListOfMap(tags tftags.KeyValueTags) []interface{} { // // 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) []interface{} { - var result []interface{} +func ListOfStringMap(tags tftags.KeyValueTags) []any { + var result []any for _, key := range tags.Keys() { m := map[string]string{ @@ -142,9 +146,9 @@ func Tags(tags tftags.KeyValueTags) []*autoscaling.Tag { // Accepts the following types: // - []*autoscaling.Tag // - []*autoscaling.TagDescription -// - []interface{} (Terraform TypeList configuration block compatible) +// - []any (Terraform TypeList configuration block compatible) // - *schema.Set (Terraform TypeSet configuration block compatible) -func KeyValueTags(ctx context.Context, tags interface{}, identifier string, resourceType string) tftags.KeyValueTags { +func KeyValueTags(ctx context.Context, tags any, identifier string, resourceType string) tftags.KeyValueTags { switch tags := tags.(type) { case []*autoscaling.Tag: m := make(map[string]*tftags.TagData, len(tags)) @@ -183,11 +187,11 @@ func KeyValueTags(ctx context.Context, tags interface{}, identifier string, reso return tftags.New(ctx, m) case *schema.Set: return KeyValueTags(ctx, tags.List(), identifier, resourceType) - case []interface{}: + case []any: result := make(map[string]*tftags.TagData) for _, tfMapRaw := range tags { - tfMap, ok := tfMapRaw.(map[string]interface{}) + tfMap, ok := tfMapRaw.(map[string]any) if !ok { continue @@ -232,7 +236,8 @@ func KeyValueTags(ctx context.Context, tags interface{}, identifier string, reso // UpdateTags updates autoscaling 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 autoscalingiface.AutoScalingAPI, identifier string, resourceType string, oldTagsSet interface{}, newTagsSet interface{}) error { + +func UpdateTags(ctx context.Context, conn autoscalingiface.AutoScalingAPI, identifier, resourceType string, oldTagsSet, newTagsSet any) error { oldTags := KeyValueTags(ctx, oldTagsSet, identifier, resourceType) newTags := KeyValueTags(ctx, newTagsSet, identifier, resourceType) @@ -263,6 +268,6 @@ func UpdateTags(ctx context.Context, conn autoscalingiface.AutoScalingAPI, ident return nil } -func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, resourceType string, oldTags interface{}, newTags interface{}) error { +func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, resourceType string, oldTags, newTags any) error { return UpdateTags(ctx, meta.(*conns.AWSClient).AutoScalingConn(), identifier, resourceType, oldTags, newTags) } diff --git a/internal/service/backup/tags_gen.go b/internal/service/backup/tags_gen.go index 59c41e84e8e8..603c45c7d315 100644 --- a/internal/service/backup/tags_gen.go +++ b/internal/service/backup/tags_gen.go @@ -29,6 +29,10 @@ func ListTags(ctx context.Context, conn backupiface.BackupAPI, identifier string return KeyValueTags(ctx, output.Tags), nil } +func (p *servicePackage) ListTags(ctx context.Context, meta any, identifier string) (tftags.KeyValueTags, error) { + return ListTags(ctx, meta.(*conns.AWSClient).BackupConn(), identifier) +} + // map[string]*string handling // Tags returns backup service tags. @@ -44,7 +48,8 @@ func KeyValueTags(ctx context.Context, tags map[string]*string) tftags.KeyValueT // UpdateTags updates backup 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 backupiface.BackupAPI, identifier string, oldTagsMap interface{}, newTagsMap interface{}) error { + +func UpdateTags(ctx context.Context, conn backupiface.BackupAPI, identifier string, oldTagsMap, newTagsMap any) error { oldTags := tftags.New(ctx, oldTagsMap) newTags := tftags.New(ctx, newTagsMap) @@ -77,6 +82,6 @@ func UpdateTags(ctx context.Context, conn backupiface.BackupAPI, identifier stri return nil } -func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags interface{}, newTags interface{}) error { +func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags, newTags any) error { return UpdateTags(ctx, meta.(*conns.AWSClient).BackupConn(), identifier, oldTags, newTags) } diff --git a/internal/service/batch/tags_gen.go b/internal/service/batch/tags_gen.go index bad37c0ec5fa..d1f82b45f05f 100644 --- a/internal/service/batch/tags_gen.go +++ b/internal/service/batch/tags_gen.go @@ -18,7 +18,7 @@ import ( // This function will optimise the handling over ListTags, if possible. // The identifier is typically the Amazon Resource Name (ARN), although // it may also be a different identifier depending on the service. -func GetTag(ctx context.Context, conn batchiface.BatchAPI, identifier string, key string) (*string, error) { +func GetTag(ctx context.Context, conn batchiface.BatchAPI, identifier, key string) (*string, error) { listTags, err := ListTags(ctx, conn, identifier) if err != nil { @@ -49,6 +49,10 @@ func ListTags(ctx context.Context, conn batchiface.BatchAPI, identifier string) return KeyValueTags(ctx, output.Tags), nil } +func (p *servicePackage) ListTags(ctx context.Context, meta any, identifier string) (tftags.KeyValueTags, error) { + return ListTags(ctx, meta.(*conns.AWSClient).BatchConn(), identifier) +} + // map[string]*string handling // Tags returns batch service tags. @@ -64,7 +68,8 @@ func KeyValueTags(ctx context.Context, tags map[string]*string) tftags.KeyValueT // UpdateTags updates batch 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 batchiface.BatchAPI, identifier string, oldTagsMap interface{}, newTagsMap interface{}) error { + +func UpdateTags(ctx context.Context, conn batchiface.BatchAPI, identifier string, oldTagsMap, newTagsMap any) error { oldTags := tftags.New(ctx, oldTagsMap) newTags := tftags.New(ctx, newTagsMap) @@ -97,6 +102,6 @@ func UpdateTags(ctx context.Context, conn batchiface.BatchAPI, identifier string return nil } -func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags interface{}, newTags interface{}) error { +func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags, newTags any) error { return UpdateTags(ctx, meta.(*conns.AWSClient).BatchConn(), identifier, oldTags, newTags) } diff --git a/internal/service/ce/tags_gen.go b/internal/service/ce/tags_gen.go index 69ce0de98254..84064e5e8d0b 100644 --- a/internal/service/ce/tags_gen.go +++ b/internal/service/ce/tags_gen.go @@ -29,6 +29,10 @@ func ListTags(ctx context.Context, conn costexploreriface.CostExplorerAPI, ident return KeyValueTags(ctx, output.ResourceTags), nil } +func (p *servicePackage) ListTags(ctx context.Context, meta any, identifier string) (tftags.KeyValueTags, error) { + return ListTags(ctx, meta.(*conns.AWSClient).CEConn(), identifier) +} + // []*SERVICE.Tag handling // Tags returns ce service tags. @@ -61,7 +65,8 @@ func KeyValueTags(ctx context.Context, tags []*costexplorer.ResourceTag) tftags. // UpdateTags updates ce 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 costexploreriface.CostExplorerAPI, identifier string, oldTagsMap interface{}, newTagsMap interface{}) error { + +func UpdateTags(ctx context.Context, conn costexploreriface.CostExplorerAPI, identifier string, oldTagsMap, newTagsMap any) error { oldTags := tftags.New(ctx, oldTagsMap) newTags := tftags.New(ctx, newTagsMap) @@ -94,6 +99,6 @@ func UpdateTags(ctx context.Context, conn costexploreriface.CostExplorerAPI, ide return nil } -func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags interface{}, newTags interface{}) error { +func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags, newTags any) error { return UpdateTags(ctx, meta.(*conns.AWSClient).CEConn(), identifier, oldTags, newTags) } diff --git a/internal/service/cloud9/tags_gen.go b/internal/service/cloud9/tags_gen.go index 150f3a17d089..c5688bd79b02 100644 --- a/internal/service/cloud9/tags_gen.go +++ b/internal/service/cloud9/tags_gen.go @@ -29,6 +29,10 @@ func ListTags(ctx context.Context, conn cloud9iface.Cloud9API, identifier string return KeyValueTags(ctx, output.Tags), nil } +func (p *servicePackage) ListTags(ctx context.Context, meta any, identifier string) (tftags.KeyValueTags, error) { + return ListTags(ctx, meta.(*conns.AWSClient).Cloud9Conn(), identifier) +} + // []*SERVICE.Tag handling // Tags returns cloud9 service tags. @@ -61,7 +65,8 @@ func KeyValueTags(ctx context.Context, tags []*cloud9.Tag) tftags.KeyValueTags { // UpdateTags updates cloud9 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 cloud9iface.Cloud9API, identifier string, oldTagsMap interface{}, newTagsMap interface{}) error { + +func UpdateTags(ctx context.Context, conn cloud9iface.Cloud9API, identifier string, oldTagsMap, newTagsMap any) error { oldTags := tftags.New(ctx, oldTagsMap) newTags := tftags.New(ctx, newTagsMap) @@ -94,6 +99,6 @@ func UpdateTags(ctx context.Context, conn cloud9iface.Cloud9API, identifier stri return nil } -func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags interface{}, newTags interface{}) error { +func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags, newTags any) error { return UpdateTags(ctx, meta.(*conns.AWSClient).Cloud9Conn(), identifier, oldTags, newTags) } diff --git a/internal/service/cloudfront/tags_gen.go b/internal/service/cloudfront/tags_gen.go index c1cc6b364904..f8e3466ead81 100644 --- a/internal/service/cloudfront/tags_gen.go +++ b/internal/service/cloudfront/tags_gen.go @@ -29,6 +29,10 @@ func ListTags(ctx context.Context, conn cloudfrontiface.CloudFrontAPI, identifie return KeyValueTags(ctx, output.Tags.Items), nil } +func (p *servicePackage) ListTags(ctx context.Context, meta any, identifier string) (tftags.KeyValueTags, error) { + return ListTags(ctx, meta.(*conns.AWSClient).CloudFrontConn(), identifier) +} + // []*SERVICE.Tag handling // Tags returns cloudfront service tags. @@ -61,7 +65,8 @@ func KeyValueTags(ctx context.Context, tags []*cloudfront.Tag) tftags.KeyValueTa // UpdateTags updates cloudfront 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 cloudfrontiface.CloudFrontAPI, identifier string, oldTagsMap interface{}, newTagsMap interface{}) error { + +func UpdateTags(ctx context.Context, conn cloudfrontiface.CloudFrontAPI, identifier string, oldTagsMap, newTagsMap any) error { oldTags := tftags.New(ctx, oldTagsMap) newTags := tftags.New(ctx, newTagsMap) @@ -94,6 +99,6 @@ func UpdateTags(ctx context.Context, conn cloudfrontiface.CloudFrontAPI, identif return nil } -func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags interface{}, newTags interface{}) error { +func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags, newTags any) error { return UpdateTags(ctx, meta.(*conns.AWSClient).CloudFrontConn(), identifier, oldTags, newTags) } diff --git a/internal/service/cloudhsmv2/tags_gen.go b/internal/service/cloudhsmv2/tags_gen.go index ca2d822483eb..fc7b18263c77 100644 --- a/internal/service/cloudhsmv2/tags_gen.go +++ b/internal/service/cloudhsmv2/tags_gen.go @@ -29,6 +29,10 @@ func ListTags(ctx context.Context, conn cloudhsmv2iface.CloudHSMV2API, identifie return KeyValueTags(ctx, output.TagList), nil } +func (p *servicePackage) ListTags(ctx context.Context, meta any, identifier string) (tftags.KeyValueTags, error) { + return ListTags(ctx, meta.(*conns.AWSClient).CloudHSMV2Conn(), identifier) +} + // []*SERVICE.Tag handling // Tags returns cloudhsmv2 service tags. @@ -61,7 +65,8 @@ func KeyValueTags(ctx context.Context, tags []*cloudhsmv2.Tag) tftags.KeyValueTa // UpdateTags updates cloudhsmv2 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 cloudhsmv2iface.CloudHSMV2API, identifier string, oldTagsMap interface{}, newTagsMap interface{}) error { + +func UpdateTags(ctx context.Context, conn cloudhsmv2iface.CloudHSMV2API, identifier string, oldTagsMap, newTagsMap any) error { oldTags := tftags.New(ctx, oldTagsMap) newTags := tftags.New(ctx, newTagsMap) @@ -94,6 +99,6 @@ func UpdateTags(ctx context.Context, conn cloudhsmv2iface.CloudHSMV2API, identif return nil } -func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags interface{}, newTags interface{}) error { +func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags, newTags any) error { return UpdateTags(ctx, meta.(*conns.AWSClient).CloudHSMV2Conn(), identifier, oldTags, newTags) } diff --git a/internal/service/cloudtrail/tags_gen.go b/internal/service/cloudtrail/tags_gen.go index 24f6040170b0..1a2dc1ba5329 100644 --- a/internal/service/cloudtrail/tags_gen.go +++ b/internal/service/cloudtrail/tags_gen.go @@ -29,6 +29,10 @@ func ListTags(ctx context.Context, conn cloudtrailiface.CloudTrailAPI, identifie return KeyValueTags(ctx, output.ResourceTagList[0].TagsList), nil } +func (p *servicePackage) ListTags(ctx context.Context, meta any, identifier string) (tftags.KeyValueTags, error) { + return ListTags(ctx, meta.(*conns.AWSClient).CloudTrailConn(), identifier) +} + // []*SERVICE.Tag handling // Tags returns cloudtrail service tags. @@ -61,7 +65,8 @@ func KeyValueTags(ctx context.Context, tags []*cloudtrail.Tag) tftags.KeyValueTa // UpdateTags updates cloudtrail 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 cloudtrailiface.CloudTrailAPI, identifier string, oldTagsMap interface{}, newTagsMap interface{}) error { + +func UpdateTags(ctx context.Context, conn cloudtrailiface.CloudTrailAPI, identifier string, oldTagsMap, newTagsMap any) error { oldTags := tftags.New(ctx, oldTagsMap) newTags := tftags.New(ctx, newTagsMap) @@ -94,6 +99,6 @@ func UpdateTags(ctx context.Context, conn cloudtrailiface.CloudTrailAPI, identif return nil } -func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags interface{}, newTags interface{}) error { +func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags, newTags any) error { return UpdateTags(ctx, meta.(*conns.AWSClient).CloudTrailConn(), identifier, oldTags, newTags) } diff --git a/internal/service/cloudwatch/tags_gen.go b/internal/service/cloudwatch/tags_gen.go index e8f73ed9ce67..bef5d08cbbd6 100644 --- a/internal/service/cloudwatch/tags_gen.go +++ b/internal/service/cloudwatch/tags_gen.go @@ -29,6 +29,10 @@ func ListTags(ctx context.Context, conn cloudwatchiface.CloudWatchAPI, identifie return KeyValueTags(ctx, output.Tags), nil } +func (p *servicePackage) ListTags(ctx context.Context, meta any, identifier string) (tftags.KeyValueTags, error) { + return ListTags(ctx, meta.(*conns.AWSClient).CloudWatchConn(), identifier) +} + // []*SERVICE.Tag handling // Tags returns cloudwatch service tags. @@ -61,7 +65,8 @@ func KeyValueTags(ctx context.Context, tags []*cloudwatch.Tag) tftags.KeyValueTa // UpdateTags updates cloudwatch 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 cloudwatchiface.CloudWatchAPI, identifier string, oldTagsMap interface{}, newTagsMap interface{}) error { + +func UpdateTags(ctx context.Context, conn cloudwatchiface.CloudWatchAPI, identifier string, oldTagsMap, newTagsMap any) error { oldTags := tftags.New(ctx, oldTagsMap) newTags := tftags.New(ctx, newTagsMap) @@ -94,6 +99,6 @@ func UpdateTags(ctx context.Context, conn cloudwatchiface.CloudWatchAPI, identif return nil } -func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags interface{}, newTags interface{}) error { +func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags, newTags any) error { return UpdateTags(ctx, meta.(*conns.AWSClient).CloudWatchConn(), identifier, oldTags, newTags) } diff --git a/internal/service/codeartifact/tags_gen.go b/internal/service/codeartifact/tags_gen.go index 07711705f530..3f40ac5ee86d 100644 --- a/internal/service/codeartifact/tags_gen.go +++ b/internal/service/codeartifact/tags_gen.go @@ -29,6 +29,10 @@ func ListTags(ctx context.Context, conn codeartifactiface.CodeArtifactAPI, ident return KeyValueTags(ctx, output.Tags), nil } +func (p *servicePackage) ListTags(ctx context.Context, meta any, identifier string) (tftags.KeyValueTags, error) { + return ListTags(ctx, meta.(*conns.AWSClient).CodeArtifactConn(), identifier) +} + // []*SERVICE.Tag handling // Tags returns codeartifact service tags. @@ -61,7 +65,8 @@ func KeyValueTags(ctx context.Context, tags []*codeartifact.Tag) tftags.KeyValue // UpdateTags updates codeartifact 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 codeartifactiface.CodeArtifactAPI, identifier string, oldTagsMap interface{}, newTagsMap interface{}) error { + +func UpdateTags(ctx context.Context, conn codeartifactiface.CodeArtifactAPI, identifier string, oldTagsMap, newTagsMap any) error { oldTags := tftags.New(ctx, oldTagsMap) newTags := tftags.New(ctx, newTagsMap) @@ -94,6 +99,6 @@ func UpdateTags(ctx context.Context, conn codeartifactiface.CodeArtifactAPI, ide return nil } -func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags interface{}, newTags interface{}) error { +func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags, newTags any) error { return UpdateTags(ctx, meta.(*conns.AWSClient).CodeArtifactConn(), identifier, oldTags, newTags) } diff --git a/internal/service/codecommit/tags_gen.go b/internal/service/codecommit/tags_gen.go index 33a49e2f84de..204d3266429f 100644 --- a/internal/service/codecommit/tags_gen.go +++ b/internal/service/codecommit/tags_gen.go @@ -29,6 +29,10 @@ func ListTags(ctx context.Context, conn codecommitiface.CodeCommitAPI, identifie return KeyValueTags(ctx, output.Tags), nil } +func (p *servicePackage) ListTags(ctx context.Context, meta any, identifier string) (tftags.KeyValueTags, error) { + return ListTags(ctx, meta.(*conns.AWSClient).CodeCommitConn(), identifier) +} + // map[string]*string handling // Tags returns codecommit service tags. @@ -44,7 +48,8 @@ func KeyValueTags(ctx context.Context, tags map[string]*string) tftags.KeyValueT // UpdateTags updates codecommit 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 codecommitiface.CodeCommitAPI, identifier string, oldTagsMap interface{}, newTagsMap interface{}) error { + +func UpdateTags(ctx context.Context, conn codecommitiface.CodeCommitAPI, identifier string, oldTagsMap, newTagsMap any) error { oldTags := tftags.New(ctx, oldTagsMap) newTags := tftags.New(ctx, newTagsMap) @@ -77,6 +82,6 @@ func UpdateTags(ctx context.Context, conn codecommitiface.CodeCommitAPI, identif return nil } -func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags interface{}, newTags interface{}) error { +func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags, newTags any) error { return UpdateTags(ctx, meta.(*conns.AWSClient).CodeCommitConn(), identifier, oldTags, newTags) } diff --git a/internal/service/codepipeline/tags_gen.go b/internal/service/codepipeline/tags_gen.go index 30adc24e2934..97ebfcb2a40a 100644 --- a/internal/service/codepipeline/tags_gen.go +++ b/internal/service/codepipeline/tags_gen.go @@ -29,6 +29,10 @@ func ListTags(ctx context.Context, conn codepipelineiface.CodePipelineAPI, ident return KeyValueTags(ctx, output.Tags), nil } +func (p *servicePackage) ListTags(ctx context.Context, meta any, identifier string) (tftags.KeyValueTags, error) { + return ListTags(ctx, meta.(*conns.AWSClient).CodePipelineConn(), identifier) +} + // []*SERVICE.Tag handling // Tags returns codepipeline service tags. @@ -61,7 +65,8 @@ func KeyValueTags(ctx context.Context, tags []*codepipeline.Tag) tftags.KeyValue // UpdateTags updates codepipeline 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 codepipelineiface.CodePipelineAPI, identifier string, oldTagsMap interface{}, newTagsMap interface{}) error { + +func UpdateTags(ctx context.Context, conn codepipelineiface.CodePipelineAPI, identifier string, oldTagsMap, newTagsMap any) error { oldTags := tftags.New(ctx, oldTagsMap) newTags := tftags.New(ctx, newTagsMap) @@ -94,6 +99,6 @@ func UpdateTags(ctx context.Context, conn codepipelineiface.CodePipelineAPI, ide return nil } -func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags interface{}, newTags interface{}) error { +func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags, newTags any) error { return UpdateTags(ctx, meta.(*conns.AWSClient).CodePipelineConn(), identifier, oldTags, newTags) } diff --git a/internal/service/codestarconnections/tags_gen.go b/internal/service/codestarconnections/tags_gen.go index 8a465d1a29c8..c80f5d307852 100644 --- a/internal/service/codestarconnections/tags_gen.go +++ b/internal/service/codestarconnections/tags_gen.go @@ -29,6 +29,10 @@ func ListTags(ctx context.Context, conn codestarconnectionsiface.CodeStarConnect return KeyValueTags(ctx, output.Tags), nil } +func (p *servicePackage) ListTags(ctx context.Context, meta any, identifier string) (tftags.KeyValueTags, error) { + return ListTags(ctx, meta.(*conns.AWSClient).CodeStarConnectionsConn(), identifier) +} + // []*SERVICE.Tag handling // Tags returns codestarconnections service tags. @@ -61,7 +65,8 @@ func KeyValueTags(ctx context.Context, tags []*codestarconnections.Tag) tftags.K // UpdateTags updates codestarconnections 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 codestarconnectionsiface.CodeStarConnectionsAPI, identifier string, oldTagsMap interface{}, newTagsMap interface{}) error { + +func UpdateTags(ctx context.Context, conn codestarconnectionsiface.CodeStarConnectionsAPI, identifier string, oldTagsMap, newTagsMap any) error { oldTags := tftags.New(ctx, oldTagsMap) newTags := tftags.New(ctx, newTagsMap) @@ -94,6 +99,6 @@ func UpdateTags(ctx context.Context, conn codestarconnectionsiface.CodeStarConne return nil } -func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags interface{}, newTags interface{}) error { +func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags, newTags any) error { return UpdateTags(ctx, meta.(*conns.AWSClient).CodeStarConnectionsConn(), identifier, oldTags, newTags) } diff --git a/internal/service/codestarnotifications/tags_gen.go b/internal/service/codestarnotifications/tags_gen.go index b8eaa20b92d8..006fba1335ff 100644 --- a/internal/service/codestarnotifications/tags_gen.go +++ b/internal/service/codestarnotifications/tags_gen.go @@ -29,6 +29,10 @@ func ListTags(ctx context.Context, conn codestarnotificationsiface.CodeStarNotif return KeyValueTags(ctx, output.Tags), nil } +func (p *servicePackage) ListTags(ctx context.Context, meta any, identifier string) (tftags.KeyValueTags, error) { + return ListTags(ctx, meta.(*conns.AWSClient).CodeStarNotificationsConn(), identifier) +} + // map[string]*string handling // Tags returns codestarnotifications service tags. @@ -44,7 +48,8 @@ func KeyValueTags(ctx context.Context, tags map[string]*string) tftags.KeyValueT // UpdateTags updates codestarnotifications 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 codestarnotificationsiface.CodeStarNotificationsAPI, identifier string, oldTagsMap interface{}, newTagsMap interface{}) error { + +func UpdateTags(ctx context.Context, conn codestarnotificationsiface.CodeStarNotificationsAPI, identifier string, oldTagsMap, newTagsMap any) error { oldTags := tftags.New(ctx, oldTagsMap) newTags := tftags.New(ctx, newTagsMap) @@ -77,6 +82,6 @@ func UpdateTags(ctx context.Context, conn codestarnotificationsiface.CodeStarNot return nil } -func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags interface{}, newTags interface{}) error { +func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags, newTags any) error { return UpdateTags(ctx, meta.(*conns.AWSClient).CodeStarNotificationsConn(), identifier, oldTags, newTags) } diff --git a/internal/service/cognitoidentity/tags_gen.go b/internal/service/cognitoidentity/tags_gen.go index d75f21e58a53..ac3190610356 100644 --- a/internal/service/cognitoidentity/tags_gen.go +++ b/internal/service/cognitoidentity/tags_gen.go @@ -29,6 +29,10 @@ func ListTags(ctx context.Context, conn cognitoidentityiface.CognitoIdentityAPI, return KeyValueTags(ctx, output.Tags), nil } +func (p *servicePackage) ListTags(ctx context.Context, meta any, identifier string) (tftags.KeyValueTags, error) { + return ListTags(ctx, meta.(*conns.AWSClient).CognitoIdentityConn(), identifier) +} + // map[string]*string handling // Tags returns cognitoidentity service tags. @@ -44,7 +48,8 @@ func KeyValueTags(ctx context.Context, tags map[string]*string) tftags.KeyValueT // UpdateTags updates cognitoidentity 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 cognitoidentityiface.CognitoIdentityAPI, identifier string, oldTagsMap interface{}, newTagsMap interface{}) error { + +func UpdateTags(ctx context.Context, conn cognitoidentityiface.CognitoIdentityAPI, identifier string, oldTagsMap, newTagsMap any) error { oldTags := tftags.New(ctx, oldTagsMap) newTags := tftags.New(ctx, newTagsMap) @@ -77,6 +82,6 @@ func UpdateTags(ctx context.Context, conn cognitoidentityiface.CognitoIdentityAP return nil } -func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags interface{}, newTags interface{}) error { +func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags, newTags any) error { return UpdateTags(ctx, meta.(*conns.AWSClient).CognitoIdentityConn(), identifier, oldTags, newTags) } diff --git a/internal/service/cognitoidp/tags_gen.go b/internal/service/cognitoidp/tags_gen.go index e2481279bcb9..488c47af1314 100644 --- a/internal/service/cognitoidp/tags_gen.go +++ b/internal/service/cognitoidp/tags_gen.go @@ -29,6 +29,10 @@ func ListTags(ctx context.Context, conn cognitoidentityprovideriface.CognitoIden return KeyValueTags(ctx, output.Tags), nil } +func (p *servicePackage) ListTags(ctx context.Context, meta any, identifier string) (tftags.KeyValueTags, error) { + return ListTags(ctx, meta.(*conns.AWSClient).CognitoIDPConn(), identifier) +} + // map[string]*string handling // Tags returns cognitoidp service tags. @@ -44,7 +48,8 @@ func KeyValueTags(ctx context.Context, tags map[string]*string) tftags.KeyValueT // UpdateTags updates cognitoidp 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 cognitoidentityprovideriface.CognitoIdentityProviderAPI, identifier string, oldTagsMap interface{}, newTagsMap interface{}) error { + +func UpdateTags(ctx context.Context, conn cognitoidentityprovideriface.CognitoIdentityProviderAPI, identifier string, oldTagsMap, newTagsMap any) error { oldTags := tftags.New(ctx, oldTagsMap) newTags := tftags.New(ctx, newTagsMap) @@ -77,6 +82,6 @@ func UpdateTags(ctx context.Context, conn cognitoidentityprovideriface.CognitoId return nil } -func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags interface{}, newTags interface{}) error { +func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags, newTags any) error { return UpdateTags(ctx, meta.(*conns.AWSClient).CognitoIDPConn(), identifier, oldTags, newTags) } diff --git a/internal/service/comprehend/tags_gen.go b/internal/service/comprehend/tags_gen.go index a357a8564796..19b161c0609a 100644 --- a/internal/service/comprehend/tags_gen.go +++ b/internal/service/comprehend/tags_gen.go @@ -60,7 +60,7 @@ func KeyValueTags(ctx context.Context, tags []types.Tag) tftags.KeyValueTags { // UpdateTags updates comprehend 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 *comprehend.Client, identifier string, oldTagsMap interface{}, newTagsMap interface{}) error { +func UpdateTags(ctx context.Context, conn *comprehend.Client, identifier string, oldTagsMap, newTagsMap any) error { oldTags := tftags.New(ctx, oldTagsMap) newTags := tftags.New(ctx, newTagsMap) diff --git a/internal/service/configservice/tags_gen.go b/internal/service/configservice/tags_gen.go index 23b01552b159..cd63bbba5d9f 100644 --- a/internal/service/configservice/tags_gen.go +++ b/internal/service/configservice/tags_gen.go @@ -29,6 +29,10 @@ func ListTags(ctx context.Context, conn configserviceiface.ConfigServiceAPI, ide return KeyValueTags(ctx, output.Tags), nil } +func (p *servicePackage) ListTags(ctx context.Context, meta any, identifier string) (tftags.KeyValueTags, error) { + return ListTags(ctx, meta.(*conns.AWSClient).ConfigServiceConn(), identifier) +} + // []*SERVICE.Tag handling // Tags returns configservice service tags. @@ -61,7 +65,8 @@ func KeyValueTags(ctx context.Context, tags []*configservice.Tag) tftags.KeyValu // UpdateTags updates configservice 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 configserviceiface.ConfigServiceAPI, identifier string, oldTagsMap interface{}, newTagsMap interface{}) error { + +func UpdateTags(ctx context.Context, conn configserviceiface.ConfigServiceAPI, identifier string, oldTagsMap, newTagsMap any) error { oldTags := tftags.New(ctx, oldTagsMap) newTags := tftags.New(ctx, newTagsMap) @@ -94,6 +99,6 @@ func UpdateTags(ctx context.Context, conn configserviceiface.ConfigServiceAPI, i return nil } -func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags interface{}, newTags interface{}) error { +func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags, newTags any) error { return UpdateTags(ctx, meta.(*conns.AWSClient).ConfigServiceConn(), identifier, oldTags, newTags) } diff --git a/internal/service/connect/tags_gen.go b/internal/service/connect/tags_gen.go index 69c9f709bd3f..c7b2baf32a7f 100644 --- a/internal/service/connect/tags_gen.go +++ b/internal/service/connect/tags_gen.go @@ -27,7 +27,8 @@ func KeyValueTags(ctx context.Context, tags map[string]*string) tftags.KeyValueT // UpdateTags updates connect 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 connectiface.ConnectAPI, identifier string, oldTagsMap interface{}, newTagsMap interface{}) error { + +func UpdateTags(ctx context.Context, conn connectiface.ConnectAPI, identifier string, oldTagsMap, newTagsMap any) error { oldTags := tftags.New(ctx, oldTagsMap) newTags := tftags.New(ctx, newTagsMap) @@ -60,6 +61,6 @@ func UpdateTags(ctx context.Context, conn connectiface.ConnectAPI, identifier st return nil } -func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags interface{}, newTags interface{}) error { +func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags, newTags any) error { return UpdateTags(ctx, meta.(*conns.AWSClient).ConnectConn(), identifier, oldTags, newTags) } diff --git a/internal/service/dataexchange/tags_gen.go b/internal/service/dataexchange/tags_gen.go index 90daf88db35d..1e64e0be9cf4 100644 --- a/internal/service/dataexchange/tags_gen.go +++ b/internal/service/dataexchange/tags_gen.go @@ -29,6 +29,10 @@ func ListTags(ctx context.Context, conn dataexchangeiface.DataExchangeAPI, ident return KeyValueTags(ctx, output.Tags), nil } +func (p *servicePackage) ListTags(ctx context.Context, meta any, identifier string) (tftags.KeyValueTags, error) { + return ListTags(ctx, meta.(*conns.AWSClient).DataExchangeConn(), identifier) +} + // map[string]*string handling // Tags returns dataexchange service tags. @@ -44,7 +48,8 @@ func KeyValueTags(ctx context.Context, tags map[string]*string) tftags.KeyValueT // UpdateTags updates dataexchange 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 dataexchangeiface.DataExchangeAPI, identifier string, oldTagsMap interface{}, newTagsMap interface{}) error { + +func UpdateTags(ctx context.Context, conn dataexchangeiface.DataExchangeAPI, identifier string, oldTagsMap, newTagsMap any) error { oldTags := tftags.New(ctx, oldTagsMap) newTags := tftags.New(ctx, newTagsMap) @@ -77,6 +82,6 @@ func UpdateTags(ctx context.Context, conn dataexchangeiface.DataExchangeAPI, ide return nil } -func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags interface{}, newTags interface{}) error { +func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags, newTags any) error { return UpdateTags(ctx, meta.(*conns.AWSClient).DataExchangeConn(), identifier, oldTags, newTags) } diff --git a/internal/service/datapipeline/tags_gen.go b/internal/service/datapipeline/tags_gen.go index 609c93752d4b..3840fda18e04 100644 --- a/internal/service/datapipeline/tags_gen.go +++ b/internal/service/datapipeline/tags_gen.go @@ -44,7 +44,8 @@ func KeyValueTags(ctx context.Context, tags []*datapipeline.Tag) tftags.KeyValue // UpdateTags updates datapipeline 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 datapipelineiface.DataPipelineAPI, identifier string, oldTagsMap interface{}, newTagsMap interface{}) error { + +func UpdateTags(ctx context.Context, conn datapipelineiface.DataPipelineAPI, identifier string, oldTagsMap, newTagsMap any) error { oldTags := tftags.New(ctx, oldTagsMap) newTags := tftags.New(ctx, newTagsMap) @@ -77,6 +78,6 @@ func UpdateTags(ctx context.Context, conn datapipelineiface.DataPipelineAPI, ide return nil } -func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags interface{}, newTags interface{}) error { +func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags, newTags any) error { return UpdateTags(ctx, meta.(*conns.AWSClient).DataPipelineConn(), identifier, oldTags, newTags) } diff --git a/internal/service/datasync/tags_gen.go b/internal/service/datasync/tags_gen.go index 1b71f0a6eba4..01659e25a47d 100644 --- a/internal/service/datasync/tags_gen.go +++ b/internal/service/datasync/tags_gen.go @@ -29,6 +29,10 @@ func ListTags(ctx context.Context, conn datasynciface.DataSyncAPI, identifier st return KeyValueTags(ctx, output.Tags), nil } +func (p *servicePackage) ListTags(ctx context.Context, meta any, identifier string) (tftags.KeyValueTags, error) { + return ListTags(ctx, meta.(*conns.AWSClient).DataSyncConn(), identifier) +} + // []*SERVICE.Tag handling // Tags returns datasync service tags. @@ -61,7 +65,8 @@ func KeyValueTags(ctx context.Context, tags []*datasync.TagListEntry) tftags.Key // UpdateTags updates datasync 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 datasynciface.DataSyncAPI, identifier string, oldTagsMap interface{}, newTagsMap interface{}) error { + +func UpdateTags(ctx context.Context, conn datasynciface.DataSyncAPI, identifier string, oldTagsMap, newTagsMap any) error { oldTags := tftags.New(ctx, oldTagsMap) newTags := tftags.New(ctx, newTagsMap) @@ -94,6 +99,6 @@ func UpdateTags(ctx context.Context, conn datasynciface.DataSyncAPI, identifier return nil } -func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags interface{}, newTags interface{}) error { +func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags, newTags any) error { return UpdateTags(ctx, meta.(*conns.AWSClient).DataSyncConn(), identifier, oldTags, newTags) } diff --git a/internal/service/dax/tags_gen.go b/internal/service/dax/tags_gen.go index 6780ad94c30f..ae227efe4fc6 100644 --- a/internal/service/dax/tags_gen.go +++ b/internal/service/dax/tags_gen.go @@ -29,6 +29,10 @@ func ListTags(ctx context.Context, conn daxiface.DAXAPI, identifier string) (tft return KeyValueTags(ctx, output.Tags), nil } +func (p *servicePackage) ListTags(ctx context.Context, meta any, identifier string) (tftags.KeyValueTags, error) { + return ListTags(ctx, meta.(*conns.AWSClient).DAXConn(), identifier) +} + // []*SERVICE.Tag handling // Tags returns dax service tags. @@ -61,7 +65,8 @@ func KeyValueTags(ctx context.Context, tags []*dax.Tag) tftags.KeyValueTags { // UpdateTags updates dax 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 daxiface.DAXAPI, identifier string, oldTagsMap interface{}, newTagsMap interface{}) error { + +func UpdateTags(ctx context.Context, conn daxiface.DAXAPI, identifier string, oldTagsMap, newTagsMap any) error { oldTags := tftags.New(ctx, oldTagsMap) newTags := tftags.New(ctx, newTagsMap) @@ -94,6 +99,6 @@ func UpdateTags(ctx context.Context, conn daxiface.DAXAPI, identifier string, ol return nil } -func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags interface{}, newTags interface{}) error { +func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags, newTags any) error { return UpdateTags(ctx, meta.(*conns.AWSClient).DAXConn(), identifier, oldTags, newTags) } diff --git a/internal/service/deploy/tags_gen.go b/internal/service/deploy/tags_gen.go index 40daedeb9cd3..bbad58182f9d 100644 --- a/internal/service/deploy/tags_gen.go +++ b/internal/service/deploy/tags_gen.go @@ -29,6 +29,10 @@ func ListTags(ctx context.Context, conn codedeployiface.CodeDeployAPI, identifie return KeyValueTags(ctx, output.Tags), nil } +func (p *servicePackage) ListTags(ctx context.Context, meta any, identifier string) (tftags.KeyValueTags, error) { + return ListTags(ctx, meta.(*conns.AWSClient).DeployConn(), identifier) +} + // []*SERVICE.Tag handling // Tags returns deploy service tags. @@ -61,7 +65,8 @@ func KeyValueTags(ctx context.Context, tags []*codedeploy.Tag) tftags.KeyValueTa // UpdateTags updates deploy 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 codedeployiface.CodeDeployAPI, identifier string, oldTagsMap interface{}, newTagsMap interface{}) error { + +func UpdateTags(ctx context.Context, conn codedeployiface.CodeDeployAPI, identifier string, oldTagsMap, newTagsMap any) error { oldTags := tftags.New(ctx, oldTagsMap) newTags := tftags.New(ctx, newTagsMap) @@ -94,6 +99,6 @@ func UpdateTags(ctx context.Context, conn codedeployiface.CodeDeployAPI, identif return nil } -func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags interface{}, newTags interface{}) error { +func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags, newTags any) error { return UpdateTags(ctx, meta.(*conns.AWSClient).DeployConn(), identifier, oldTags, newTags) } diff --git a/internal/service/detective/tags_gen.go b/internal/service/detective/tags_gen.go index 7dead3b25721..058cef6f471d 100644 --- a/internal/service/detective/tags_gen.go +++ b/internal/service/detective/tags_gen.go @@ -29,6 +29,10 @@ func ListTags(ctx context.Context, conn detectiveiface.DetectiveAPI, identifier return KeyValueTags(ctx, output.Tags), nil } +func (p *servicePackage) ListTags(ctx context.Context, meta any, identifier string) (tftags.KeyValueTags, error) { + return ListTags(ctx, meta.(*conns.AWSClient).DetectiveConn(), identifier) +} + // map[string]*string handling // Tags returns detective service tags. @@ -44,7 +48,8 @@ func KeyValueTags(ctx context.Context, tags map[string]*string) tftags.KeyValueT // UpdateTags updates detective 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 detectiveiface.DetectiveAPI, identifier string, oldTagsMap interface{}, newTagsMap interface{}) error { + +func UpdateTags(ctx context.Context, conn detectiveiface.DetectiveAPI, identifier string, oldTagsMap, newTagsMap any) error { oldTags := tftags.New(ctx, oldTagsMap) newTags := tftags.New(ctx, newTagsMap) @@ -77,6 +82,6 @@ func UpdateTags(ctx context.Context, conn detectiveiface.DetectiveAPI, identifie return nil } -func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags interface{}, newTags interface{}) error { +func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags, newTags any) error { return UpdateTags(ctx, meta.(*conns.AWSClient).DetectiveConn(), identifier, oldTags, newTags) } diff --git a/internal/service/devicefarm/tags_gen.go b/internal/service/devicefarm/tags_gen.go index 057294c5b5f8..1d530deae2ca 100644 --- a/internal/service/devicefarm/tags_gen.go +++ b/internal/service/devicefarm/tags_gen.go @@ -29,6 +29,10 @@ func ListTags(ctx context.Context, conn devicefarmiface.DeviceFarmAPI, identifie return KeyValueTags(ctx, output.Tags), nil } +func (p *servicePackage) ListTags(ctx context.Context, meta any, identifier string) (tftags.KeyValueTags, error) { + return ListTags(ctx, meta.(*conns.AWSClient).DeviceFarmConn(), identifier) +} + // []*SERVICE.Tag handling // Tags returns devicefarm service tags. @@ -61,7 +65,8 @@ func KeyValueTags(ctx context.Context, tags []*devicefarm.Tag) tftags.KeyValueTa // UpdateTags updates devicefarm 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 devicefarmiface.DeviceFarmAPI, identifier string, oldTagsMap interface{}, newTagsMap interface{}) error { + +func UpdateTags(ctx context.Context, conn devicefarmiface.DeviceFarmAPI, identifier string, oldTagsMap, newTagsMap any) error { oldTags := tftags.New(ctx, oldTagsMap) newTags := tftags.New(ctx, newTagsMap) @@ -94,6 +99,6 @@ func UpdateTags(ctx context.Context, conn devicefarmiface.DeviceFarmAPI, identif return nil } -func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags interface{}, newTags interface{}) error { +func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags, newTags any) error { return UpdateTags(ctx, meta.(*conns.AWSClient).DeviceFarmConn(), identifier, oldTags, newTags) } diff --git a/internal/service/directconnect/tags_gen.go b/internal/service/directconnect/tags_gen.go index 7b234a0989a4..6f8c9823ab26 100644 --- a/internal/service/directconnect/tags_gen.go +++ b/internal/service/directconnect/tags_gen.go @@ -29,6 +29,10 @@ func ListTags(ctx context.Context, conn directconnectiface.DirectConnectAPI, ide return KeyValueTags(ctx, output.ResourceTags[0].Tags), nil } +func (p *servicePackage) ListTags(ctx context.Context, meta any, identifier string) (tftags.KeyValueTags, error) { + return ListTags(ctx, meta.(*conns.AWSClient).DirectConnectConn(), identifier) +} + // []*SERVICE.Tag handling // Tags returns directconnect service tags. @@ -61,7 +65,8 @@ func KeyValueTags(ctx context.Context, tags []*directconnect.Tag) tftags.KeyValu // UpdateTags updates directconnect 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 directconnectiface.DirectConnectAPI, identifier string, oldTagsMap interface{}, newTagsMap interface{}) error { + +func UpdateTags(ctx context.Context, conn directconnectiface.DirectConnectAPI, identifier string, oldTagsMap, newTagsMap any) error { oldTags := tftags.New(ctx, oldTagsMap) newTags := tftags.New(ctx, newTagsMap) @@ -94,6 +99,6 @@ func UpdateTags(ctx context.Context, conn directconnectiface.DirectConnectAPI, i return nil } -func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags interface{}, newTags interface{}) error { +func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags, newTags any) error { return UpdateTags(ctx, meta.(*conns.AWSClient).DirectConnectConn(), identifier, oldTags, newTags) } diff --git a/internal/service/dlm/tags_gen.go b/internal/service/dlm/tags_gen.go index ac648fb7e742..8ad9b986f3f6 100644 --- a/internal/service/dlm/tags_gen.go +++ b/internal/service/dlm/tags_gen.go @@ -29,6 +29,10 @@ func ListTags(ctx context.Context, conn dlmiface.DLMAPI, identifier string) (tft return KeyValueTags(ctx, output.Tags), nil } +func (p *servicePackage) ListTags(ctx context.Context, meta any, identifier string) (tftags.KeyValueTags, error) { + return ListTags(ctx, meta.(*conns.AWSClient).DLMConn(), identifier) +} + // map[string]*string handling // Tags returns dlm service tags. @@ -44,7 +48,8 @@ func KeyValueTags(ctx context.Context, tags map[string]*string) tftags.KeyValueT // UpdateTags updates dlm 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 dlmiface.DLMAPI, identifier string, oldTagsMap interface{}, newTagsMap interface{}) error { + +func UpdateTags(ctx context.Context, conn dlmiface.DLMAPI, identifier string, oldTagsMap, newTagsMap any) error { oldTags := tftags.New(ctx, oldTagsMap) newTags := tftags.New(ctx, newTagsMap) @@ -77,6 +82,6 @@ func UpdateTags(ctx context.Context, conn dlmiface.DLMAPI, identifier string, ol return nil } -func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags interface{}, newTags interface{}) error { +func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags, newTags any) error { return UpdateTags(ctx, meta.(*conns.AWSClient).DLMConn(), identifier, oldTags, newTags) } diff --git a/internal/service/dms/tags_gen.go b/internal/service/dms/tags_gen.go index a2c610b489b8..1396255a6d87 100644 --- a/internal/service/dms/tags_gen.go +++ b/internal/service/dms/tags_gen.go @@ -29,6 +29,10 @@ func ListTags(ctx context.Context, conn databasemigrationserviceiface.DatabaseMi return KeyValueTags(ctx, output.TagList), nil } +func (p *servicePackage) ListTags(ctx context.Context, meta any, identifier string) (tftags.KeyValueTags, error) { + return ListTags(ctx, meta.(*conns.AWSClient).DMSConn(), identifier) +} + // []*SERVICE.Tag handling // Tags returns dms service tags. @@ -61,7 +65,8 @@ func KeyValueTags(ctx context.Context, tags []*databasemigrationservice.Tag) tft // UpdateTags updates dms 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 databasemigrationserviceiface.DatabaseMigrationServiceAPI, identifier string, oldTagsMap interface{}, newTagsMap interface{}) error { + +func UpdateTags(ctx context.Context, conn databasemigrationserviceiface.DatabaseMigrationServiceAPI, identifier string, oldTagsMap, newTagsMap any) error { oldTags := tftags.New(ctx, oldTagsMap) newTags := tftags.New(ctx, newTagsMap) @@ -94,6 +99,6 @@ func UpdateTags(ctx context.Context, conn databasemigrationserviceiface.Database return nil } -func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags interface{}, newTags interface{}) error { +func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags, newTags any) error { return UpdateTags(ctx, meta.(*conns.AWSClient).DMSConn(), identifier, oldTags, newTags) } diff --git a/internal/service/docdb/tags_gen.go b/internal/service/docdb/tags_gen.go index 9b96ccbfdfd7..3c83b43599a8 100644 --- a/internal/service/docdb/tags_gen.go +++ b/internal/service/docdb/tags_gen.go @@ -29,6 +29,10 @@ func ListTags(ctx context.Context, conn docdbiface.DocDBAPI, identifier string) return KeyValueTags(ctx, output.TagList), nil } +func (p *servicePackage) ListTags(ctx context.Context, meta any, identifier string) (tftags.KeyValueTags, error) { + return ListTags(ctx, meta.(*conns.AWSClient).DocDBConn(), identifier) +} + // []*SERVICE.Tag handling // Tags returns docdb service tags. @@ -61,7 +65,8 @@ func KeyValueTags(ctx context.Context, tags []*docdb.Tag) tftags.KeyValueTags { // UpdateTags updates docdb 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 docdbiface.DocDBAPI, identifier string, oldTagsMap interface{}, newTagsMap interface{}) error { + +func UpdateTags(ctx context.Context, conn docdbiface.DocDBAPI, identifier string, oldTagsMap, newTagsMap any) error { oldTags := tftags.New(ctx, oldTagsMap) newTags := tftags.New(ctx, newTagsMap) @@ -94,6 +99,6 @@ func UpdateTags(ctx context.Context, conn docdbiface.DocDBAPI, identifier string return nil } -func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags interface{}, newTags interface{}) error { +func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags, newTags any) error { return UpdateTags(ctx, meta.(*conns.AWSClient).DocDBConn(), identifier, oldTags, newTags) } diff --git a/internal/service/ds/tags_gen.go b/internal/service/ds/tags_gen.go index a207fa83a525..0a7be2904ad2 100644 --- a/internal/service/ds/tags_gen.go +++ b/internal/service/ds/tags_gen.go @@ -29,6 +29,10 @@ func ListTags(ctx context.Context, conn directoryserviceiface.DirectoryServiceAP return KeyValueTags(ctx, output.Tags), nil } +func (p *servicePackage) ListTags(ctx context.Context, meta any, identifier string) (tftags.KeyValueTags, error) { + return ListTags(ctx, meta.(*conns.AWSClient).DSConn(), identifier) +} + // []*SERVICE.Tag handling // Tags returns ds service tags. @@ -61,7 +65,8 @@ func KeyValueTags(ctx context.Context, tags []*directoryservice.Tag) tftags.KeyV // UpdateTags updates ds 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 directoryserviceiface.DirectoryServiceAPI, identifier string, oldTagsMap interface{}, newTagsMap interface{}) error { + +func UpdateTags(ctx context.Context, conn directoryserviceiface.DirectoryServiceAPI, identifier string, oldTagsMap, newTagsMap any) error { oldTags := tftags.New(ctx, oldTagsMap) newTags := tftags.New(ctx, newTagsMap) @@ -94,6 +99,6 @@ func UpdateTags(ctx context.Context, conn directoryserviceiface.DirectoryService return nil } -func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags interface{}, newTags interface{}) error { +func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags, newTags any) error { return UpdateTags(ctx, meta.(*conns.AWSClient).DSConn(), identifier, oldTags, newTags) } diff --git a/internal/service/dynamodb/tags_gen.go b/internal/service/dynamodb/tags_gen.go index fc2383ac74fa..f8230b88d807 100644 --- a/internal/service/dynamodb/tags_gen.go +++ b/internal/service/dynamodb/tags_gen.go @@ -20,7 +20,7 @@ import ( // This function will optimise the handling over ListTags, if possible. // The identifier is typically the Amazon Resource Name (ARN), although // it may also be a different identifier depending on the service. -func GetTag(ctx context.Context, conn dynamodbiface.DynamoDBAPI, identifier string, key string) (*string, error) { +func GetTag(ctx context.Context, conn dynamodbiface.DynamoDBAPI, identifier, key string) (*string, error) { listTags, err := ListTags(ctx, conn, identifier) if err != nil { @@ -58,6 +58,10 @@ func ListTags(ctx context.Context, conn dynamodbiface.DynamoDBAPI, identifier st return KeyValueTags(ctx, output.Tags), nil } +func (p *servicePackage) ListTags(ctx context.Context, meta any, identifier string) (tftags.KeyValueTags, error) { + return ListTags(ctx, meta.(*conns.AWSClient).DynamoDBConn(), identifier) +} + // []*SERVICE.Tag handling // Tags returns dynamodb service tags. @@ -90,7 +94,8 @@ func KeyValueTags(ctx context.Context, tags []*dynamodb.Tag) tftags.KeyValueTags // UpdateTags updates dynamodb 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 dynamodbiface.DynamoDBAPI, identifier string, oldTagsMap interface{}, newTagsMap interface{}) error { + +func UpdateTags(ctx context.Context, conn dynamodbiface.DynamoDBAPI, identifier string, oldTagsMap, newTagsMap any) error { oldTags := tftags.New(ctx, oldTagsMap) newTags := tftags.New(ctx, newTagsMap) @@ -123,6 +128,6 @@ func UpdateTags(ctx context.Context, conn dynamodbiface.DynamoDBAPI, identifier return nil } -func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags interface{}, newTags interface{}) error { +func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags, newTags any) error { return UpdateTags(ctx, meta.(*conns.AWSClient).DynamoDBConn(), identifier, oldTags, newTags) } diff --git a/internal/service/ec2/tags_gen.go b/internal/service/ec2/tags_gen.go index 0a13547d9ef8..5a242e6c0c10 100644 --- a/internal/service/ec2/tags_gen.go +++ b/internal/service/ec2/tags_gen.go @@ -18,7 +18,7 @@ import ( // This function will optimise the handling over ListTags, if possible. // The identifier is typically the Amazon Resource Name (ARN), although // it may also be a different identifier depending on the service. -func GetTag(ctx context.Context, conn ec2iface.EC2API, identifier string, key string) (*string, error) { +func GetTag(ctx context.Context, conn ec2iface.EC2API, identifier, key string) (*string, error) { input := &ec2.DescribeTagsInput{ Filters: []*ec2.Filter{ { @@ -69,6 +69,10 @@ func ListTags(ctx context.Context, conn ec2iface.EC2API, identifier string) (tft return KeyValueTags(ctx, output.Tags), nil } +func (p *servicePackage) ListTags(ctx context.Context, meta any, identifier string) (tftags.KeyValueTags, error) { + return ListTags(ctx, meta.(*conns.AWSClient).EC2Conn(), identifier) +} + // []*SERVICE.Tag handling // Tags returns ec2 service tags. @@ -92,7 +96,7 @@ func Tags(tags tftags.KeyValueTags) []*ec2.Tag { // Accepts the following types: // - []*ec2.Tag // - []*ec2.TagDescription -func KeyValueTags(ctx context.Context, tags interface{}) tftags.KeyValueTags { +func KeyValueTags(ctx context.Context, tags any) tftags.KeyValueTags { switch tags := tags.(type) { case []*ec2.Tag: m := make(map[string]*string, len(tags)) @@ -118,7 +122,8 @@ func KeyValueTags(ctx context.Context, tags interface{}) tftags.KeyValueTags { // UpdateTags updates ec2 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 ec2iface.EC2API, identifier string, oldTagsMap interface{}, newTagsMap interface{}) error { + +func UpdateTags(ctx context.Context, conn ec2iface.EC2API, identifier string, oldTagsMap, newTagsMap any) error { oldTags := tftags.New(ctx, oldTagsMap) newTags := tftags.New(ctx, newTagsMap) @@ -151,6 +156,6 @@ func UpdateTags(ctx context.Context, conn ec2iface.EC2API, identifier string, ol return nil } -func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags interface{}, newTags interface{}) error { +func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags, newTags any) error { return UpdateTags(ctx, meta.(*conns.AWSClient).EC2Conn(), identifier, oldTags, newTags) } diff --git a/internal/service/ecr/tags_gen.go b/internal/service/ecr/tags_gen.go index ed90f35efed4..2083b2269ccf 100644 --- a/internal/service/ecr/tags_gen.go +++ b/internal/service/ecr/tags_gen.go @@ -29,6 +29,10 @@ func ListTags(ctx context.Context, conn ecriface.ECRAPI, identifier string) (tft return KeyValueTags(ctx, output.Tags), nil } +func (p *servicePackage) ListTags(ctx context.Context, meta any, identifier string) (tftags.KeyValueTags, error) { + return ListTags(ctx, meta.(*conns.AWSClient).ECRConn(), identifier) +} + // []*SERVICE.Tag handling // Tags returns ecr service tags. @@ -61,7 +65,8 @@ func KeyValueTags(ctx context.Context, tags []*ecr.Tag) tftags.KeyValueTags { // UpdateTags updates ecr 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 ecriface.ECRAPI, identifier string, oldTagsMap interface{}, newTagsMap interface{}) error { + +func UpdateTags(ctx context.Context, conn ecriface.ECRAPI, identifier string, oldTagsMap, newTagsMap any) error { oldTags := tftags.New(ctx, oldTagsMap) newTags := tftags.New(ctx, newTagsMap) @@ -94,6 +99,6 @@ func UpdateTags(ctx context.Context, conn ecriface.ECRAPI, identifier string, ol return nil } -func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags interface{}, newTags interface{}) error { +func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags, newTags any) error { return UpdateTags(ctx, meta.(*conns.AWSClient).ECRConn(), identifier, oldTags, newTags) } diff --git a/internal/service/ecrpublic/tags_gen.go b/internal/service/ecrpublic/tags_gen.go index e9a9caed5ea0..4bd3690f2521 100644 --- a/internal/service/ecrpublic/tags_gen.go +++ b/internal/service/ecrpublic/tags_gen.go @@ -29,6 +29,10 @@ func ListTags(ctx context.Context, conn ecrpubliciface.ECRPublicAPI, identifier return KeyValueTags(ctx, output.Tags), nil } +func (p *servicePackage) ListTags(ctx context.Context, meta any, identifier string) (tftags.KeyValueTags, error) { + return ListTags(ctx, meta.(*conns.AWSClient).ECRPublicConn(), identifier) +} + // []*SERVICE.Tag handling // Tags returns ecrpublic service tags. @@ -61,7 +65,8 @@ func KeyValueTags(ctx context.Context, tags []*ecrpublic.Tag) tftags.KeyValueTag // UpdateTags updates ecrpublic 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 ecrpubliciface.ECRPublicAPI, identifier string, oldTagsMap interface{}, newTagsMap interface{}) error { + +func UpdateTags(ctx context.Context, conn ecrpubliciface.ECRPublicAPI, identifier string, oldTagsMap, newTagsMap any) error { oldTags := tftags.New(ctx, oldTagsMap) newTags := tftags.New(ctx, newTagsMap) @@ -94,6 +99,6 @@ func UpdateTags(ctx context.Context, conn ecrpubliciface.ECRPublicAPI, identifie return nil } -func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags interface{}, newTags interface{}) error { +func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags, newTags any) error { return UpdateTags(ctx, meta.(*conns.AWSClient).ECRPublicConn(), identifier, oldTags, newTags) } diff --git a/internal/service/ecs/tags_gen.go b/internal/service/ecs/tags_gen.go index dd51107af12f..27b758736443 100644 --- a/internal/service/ecs/tags_gen.go +++ b/internal/service/ecs/tags_gen.go @@ -20,7 +20,7 @@ import ( // This function will optimise the handling over ListTags, if possible. // The identifier is typically the Amazon Resource Name (ARN), although // it may also be a different identifier depending on the service. -func GetTag(ctx context.Context, conn ecsiface.ECSAPI, identifier string, key string) (*string, error) { +func GetTag(ctx context.Context, conn ecsiface.ECSAPI, identifier, key string) (*string, error) { listTags, err := ListTags(ctx, conn, identifier) if err != nil { @@ -58,6 +58,10 @@ func ListTags(ctx context.Context, conn ecsiface.ECSAPI, identifier string) (tft return KeyValueTags(ctx, output.Tags), nil } +func (p *servicePackage) ListTags(ctx context.Context, meta any, identifier string) (tftags.KeyValueTags, error) { + return ListTags(ctx, meta.(*conns.AWSClient).ECSConn(), identifier) +} + // []*SERVICE.Tag handling // Tags returns ecs service tags. @@ -90,7 +94,8 @@ func KeyValueTags(ctx context.Context, tags []*ecs.Tag) tftags.KeyValueTags { // UpdateTags updates ecs 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 ecsiface.ECSAPI, identifier string, oldTagsMap interface{}, newTagsMap interface{}) error { + +func UpdateTags(ctx context.Context, conn ecsiface.ECSAPI, identifier string, oldTagsMap, newTagsMap any) error { oldTags := tftags.New(ctx, oldTagsMap) newTags := tftags.New(ctx, newTagsMap) @@ -123,6 +128,6 @@ func UpdateTags(ctx context.Context, conn ecsiface.ECSAPI, identifier string, ol return nil } -func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags interface{}, newTags interface{}) error { +func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags, newTags any) error { return UpdateTags(ctx, meta.(*conns.AWSClient).ECSConn(), identifier, oldTags, newTags) } diff --git a/internal/service/efs/tags_gen.go b/internal/service/efs/tags_gen.go index f02df228d4f9..e5b19e37759b 100644 --- a/internal/service/efs/tags_gen.go +++ b/internal/service/efs/tags_gen.go @@ -29,6 +29,10 @@ func ListTags(ctx context.Context, conn efsiface.EFSAPI, identifier string) (tft return KeyValueTags(ctx, output.Tags), nil } +func (p *servicePackage) ListTags(ctx context.Context, meta any, identifier string) (tftags.KeyValueTags, error) { + return ListTags(ctx, meta.(*conns.AWSClient).EFSConn(), identifier) +} + // []*SERVICE.Tag handling // Tags returns efs service tags. @@ -61,7 +65,8 @@ func KeyValueTags(ctx context.Context, tags []*efs.Tag) tftags.KeyValueTags { // UpdateTags updates efs 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 efsiface.EFSAPI, identifier string, oldTagsMap interface{}, newTagsMap interface{}) error { + +func UpdateTags(ctx context.Context, conn efsiface.EFSAPI, identifier string, oldTagsMap, newTagsMap any) error { oldTags := tftags.New(ctx, oldTagsMap) newTags := tftags.New(ctx, newTagsMap) @@ -94,6 +99,6 @@ func UpdateTags(ctx context.Context, conn efsiface.EFSAPI, identifier string, ol return nil } -func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags interface{}, newTags interface{}) error { +func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags, newTags any) error { return UpdateTags(ctx, meta.(*conns.AWSClient).EFSConn(), identifier, oldTags, newTags) } diff --git a/internal/service/eks/tags_gen.go b/internal/service/eks/tags_gen.go index 28d0296b9d24..787a21ec90bf 100644 --- a/internal/service/eks/tags_gen.go +++ b/internal/service/eks/tags_gen.go @@ -29,6 +29,10 @@ func ListTags(ctx context.Context, conn eksiface.EKSAPI, identifier string) (tft return KeyValueTags(ctx, output.Tags), nil } +func (p *servicePackage) ListTags(ctx context.Context, meta any, identifier string) (tftags.KeyValueTags, error) { + return ListTags(ctx, meta.(*conns.AWSClient).EKSConn(), identifier) +} + // map[string]*string handling // Tags returns eks service tags. @@ -44,7 +48,8 @@ func KeyValueTags(ctx context.Context, tags map[string]*string) tftags.KeyValueT // UpdateTags updates eks 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 eksiface.EKSAPI, identifier string, oldTagsMap interface{}, newTagsMap interface{}) error { + +func UpdateTags(ctx context.Context, conn eksiface.EKSAPI, identifier string, oldTagsMap, newTagsMap any) error { oldTags := tftags.New(ctx, oldTagsMap) newTags := tftags.New(ctx, newTagsMap) @@ -77,6 +82,6 @@ func UpdateTags(ctx context.Context, conn eksiface.EKSAPI, identifier string, ol return nil } -func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags interface{}, newTags interface{}) error { +func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags, newTags any) error { return UpdateTags(ctx, meta.(*conns.AWSClient).EKSConn(), identifier, oldTags, newTags) } diff --git a/internal/service/elasticache/tags_gen.go b/internal/service/elasticache/tags_gen.go index 9b312baec12e..b99a584786b3 100644 --- a/internal/service/elasticache/tags_gen.go +++ b/internal/service/elasticache/tags_gen.go @@ -29,6 +29,10 @@ func ListTags(ctx context.Context, conn elasticacheiface.ElastiCacheAPI, identif return KeyValueTags(ctx, output.TagList), nil } +func (p *servicePackage) ListTags(ctx context.Context, meta any, identifier string) (tftags.KeyValueTags, error) { + return ListTags(ctx, meta.(*conns.AWSClient).ElastiCacheConn(), identifier) +} + // []*SERVICE.Tag handling // Tags returns elasticache service tags. @@ -61,7 +65,8 @@ func KeyValueTags(ctx context.Context, tags []*elasticache.Tag) tftags.KeyValueT // UpdateTags updates elasticache 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 elasticacheiface.ElastiCacheAPI, identifier string, oldTagsMap interface{}, newTagsMap interface{}) error { + +func UpdateTags(ctx context.Context, conn elasticacheiface.ElastiCacheAPI, identifier string, oldTagsMap, newTagsMap any) error { oldTags := tftags.New(ctx, oldTagsMap) newTags := tftags.New(ctx, newTagsMap) @@ -94,6 +99,6 @@ func UpdateTags(ctx context.Context, conn elasticacheiface.ElastiCacheAPI, ident return nil } -func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags interface{}, newTags interface{}) error { +func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags, newTags any) error { return UpdateTags(ctx, meta.(*conns.AWSClient).ElastiCacheConn(), identifier, oldTags, newTags) } diff --git a/internal/service/elasticbeanstalk/tags_gen.go b/internal/service/elasticbeanstalk/tags_gen.go index 5a182327721b..15eb8d45b950 100644 --- a/internal/service/elasticbeanstalk/tags_gen.go +++ b/internal/service/elasticbeanstalk/tags_gen.go @@ -29,6 +29,10 @@ func ListTags(ctx context.Context, conn elasticbeanstalkiface.ElasticBeanstalkAP return KeyValueTags(ctx, output.ResourceTags), nil } +func (p *servicePackage) ListTags(ctx context.Context, meta any, identifier string) (tftags.KeyValueTags, error) { + return ListTags(ctx, meta.(*conns.AWSClient).ElasticBeanstalkConn(), identifier) +} + // []*SERVICE.Tag handling // Tags returns elasticbeanstalk service tags. @@ -61,7 +65,8 @@ func KeyValueTags(ctx context.Context, tags []*elasticbeanstalk.Tag) tftags.KeyV // UpdateTags updates elasticbeanstalk 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 elasticbeanstalkiface.ElasticBeanstalkAPI, identifier string, oldTagsMap interface{}, newTagsMap interface{}) error { + +func UpdateTags(ctx context.Context, conn elasticbeanstalkiface.ElasticBeanstalkAPI, identifier string, oldTagsMap, newTagsMap any) error { oldTags := tftags.New(ctx, oldTagsMap) newTags := tftags.New(ctx, newTagsMap) removedTags := oldTags.Removed(newTags) @@ -93,6 +98,6 @@ func UpdateTags(ctx context.Context, conn elasticbeanstalkiface.ElasticBeanstalk return nil } -func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags interface{}, newTags interface{}) error { +func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags, newTags any) error { return UpdateTags(ctx, meta.(*conns.AWSClient).ElasticBeanstalkConn(), identifier, oldTags, newTags) } diff --git a/internal/service/elasticsearch/tags_gen.go b/internal/service/elasticsearch/tags_gen.go index 5ae1f77920d6..6ebe58f3913a 100644 --- a/internal/service/elasticsearch/tags_gen.go +++ b/internal/service/elasticsearch/tags_gen.go @@ -29,6 +29,10 @@ func ListTags(ctx context.Context, conn elasticsearchserviceiface.ElasticsearchS return KeyValueTags(ctx, output.TagList), nil } +func (p *servicePackage) ListTags(ctx context.Context, meta any, identifier string) (tftags.KeyValueTags, error) { + return ListTags(ctx, meta.(*conns.AWSClient).ElasticsearchConn(), identifier) +} + // []*SERVICE.Tag handling // Tags returns elasticsearch service tags. @@ -61,7 +65,8 @@ func KeyValueTags(ctx context.Context, tags []*elasticsearchservice.Tag) tftags. // UpdateTags updates elasticsearch 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 elasticsearchserviceiface.ElasticsearchServiceAPI, identifier string, oldTagsMap interface{}, newTagsMap interface{}) error { + +func UpdateTags(ctx context.Context, conn elasticsearchserviceiface.ElasticsearchServiceAPI, identifier string, oldTagsMap, newTagsMap any) error { oldTags := tftags.New(ctx, oldTagsMap) newTags := tftags.New(ctx, newTagsMap) @@ -94,6 +99,6 @@ func UpdateTags(ctx context.Context, conn elasticsearchserviceiface.Elasticsearc return nil } -func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags interface{}, newTags interface{}) error { +func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags, newTags any) error { return UpdateTags(ctx, meta.(*conns.AWSClient).ElasticsearchConn(), identifier, oldTags, newTags) } diff --git a/internal/service/elb/tags_gen.go b/internal/service/elb/tags_gen.go index 6b5d6aaea02e..3887dc956354 100644 --- a/internal/service/elb/tags_gen.go +++ b/internal/service/elb/tags_gen.go @@ -29,6 +29,10 @@ func ListTags(ctx context.Context, conn elbiface.ELBAPI, identifier string) (tft return KeyValueTags(ctx, output.TagDescriptions[0].Tags), nil } +func (p *servicePackage) ListTags(ctx context.Context, meta any, identifier string) (tftags.KeyValueTags, error) { + return ListTags(ctx, meta.(*conns.AWSClient).ELBConn(), identifier) +} + // []*SERVICE.Tag handling // TagKeys returns elb service tag keys. @@ -76,7 +80,8 @@ func KeyValueTags(ctx context.Context, tags []*elb.Tag) tftags.KeyValueTags { // UpdateTags updates elb 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 elbiface.ELBAPI, identifier string, oldTagsMap interface{}, newTagsMap interface{}) error { + +func UpdateTags(ctx context.Context, conn elbiface.ELBAPI, identifier string, oldTagsMap, newTagsMap any) error { oldTags := tftags.New(ctx, oldTagsMap) newTags := tftags.New(ctx, newTagsMap) @@ -109,6 +114,6 @@ func UpdateTags(ctx context.Context, conn elbiface.ELBAPI, identifier string, ol return nil } -func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags interface{}, newTags interface{}) error { +func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags, newTags any) error { return UpdateTags(ctx, meta.(*conns.AWSClient).ELBConn(), identifier, oldTags, newTags) } diff --git a/internal/service/elbv2/tags_gen.go b/internal/service/elbv2/tags_gen.go index 21a9559d0807..f588e86a273f 100644 --- a/internal/service/elbv2/tags_gen.go +++ b/internal/service/elbv2/tags_gen.go @@ -29,6 +29,10 @@ func ListTags(ctx context.Context, conn elbv2iface.ELBV2API, identifier string) return KeyValueTags(ctx, output.TagDescriptions[0].Tags), nil } +func (p *servicePackage) ListTags(ctx context.Context, meta any, identifier string) (tftags.KeyValueTags, error) { + return ListTags(ctx, meta.(*conns.AWSClient).ELBV2Conn(), identifier) +} + // []*SERVICE.Tag handling // Tags returns elbv2 service tags. @@ -61,7 +65,8 @@ func KeyValueTags(ctx context.Context, tags []*elbv2.Tag) tftags.KeyValueTags { // UpdateTags updates elbv2 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 elbv2iface.ELBV2API, identifier string, oldTagsMap interface{}, newTagsMap interface{}) error { + +func UpdateTags(ctx context.Context, conn elbv2iface.ELBV2API, identifier string, oldTagsMap, newTagsMap any) error { oldTags := tftags.New(ctx, oldTagsMap) newTags := tftags.New(ctx, newTagsMap) @@ -94,6 +99,6 @@ func UpdateTags(ctx context.Context, conn elbv2iface.ELBV2API, identifier string return nil } -func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags interface{}, newTags interface{}) error { +func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags, newTags any) error { return UpdateTags(ctx, meta.(*conns.AWSClient).ELBV2Conn(), identifier, oldTags, newTags) } diff --git a/internal/service/emr/tags_gen.go b/internal/service/emr/tags_gen.go index a5a24bcaa10c..d71162063551 100644 --- a/internal/service/emr/tags_gen.go +++ b/internal/service/emr/tags_gen.go @@ -44,7 +44,8 @@ func KeyValueTags(ctx context.Context, tags []*emr.Tag) tftags.KeyValueTags { // UpdateTags updates emr 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 emriface.EMRAPI, identifier string, oldTagsMap interface{}, newTagsMap interface{}) error { + +func UpdateTags(ctx context.Context, conn emriface.EMRAPI, identifier string, oldTagsMap, newTagsMap any) error { oldTags := tftags.New(ctx, oldTagsMap) newTags := tftags.New(ctx, newTagsMap) @@ -77,6 +78,6 @@ func UpdateTags(ctx context.Context, conn emriface.EMRAPI, identifier string, ol return nil } -func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags interface{}, newTags interface{}) error { +func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags, newTags any) error { return UpdateTags(ctx, meta.(*conns.AWSClient).EMRConn(), identifier, oldTags, newTags) } diff --git a/internal/service/emrcontainers/tags_gen.go b/internal/service/emrcontainers/tags_gen.go index ae8ff347d512..384c5ef9d826 100644 --- a/internal/service/emrcontainers/tags_gen.go +++ b/internal/service/emrcontainers/tags_gen.go @@ -29,6 +29,10 @@ func ListTags(ctx context.Context, conn emrcontainersiface.EMRContainersAPI, ide return KeyValueTags(ctx, output.Tags), nil } +func (p *servicePackage) ListTags(ctx context.Context, meta any, identifier string) (tftags.KeyValueTags, error) { + return ListTags(ctx, meta.(*conns.AWSClient).EMRContainersConn(), identifier) +} + // map[string]*string handling // Tags returns emrcontainers service tags. @@ -44,7 +48,8 @@ func KeyValueTags(ctx context.Context, tags map[string]*string) tftags.KeyValueT // UpdateTags updates emrcontainers 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 emrcontainersiface.EMRContainersAPI, identifier string, oldTagsMap interface{}, newTagsMap interface{}) error { + +func UpdateTags(ctx context.Context, conn emrcontainersiface.EMRContainersAPI, identifier string, oldTagsMap, newTagsMap any) error { oldTags := tftags.New(ctx, oldTagsMap) newTags := tftags.New(ctx, newTagsMap) @@ -77,6 +82,6 @@ func UpdateTags(ctx context.Context, conn emrcontainersiface.EMRContainersAPI, i return nil } -func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags interface{}, newTags interface{}) error { +func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags, newTags any) error { return UpdateTags(ctx, meta.(*conns.AWSClient).EMRContainersConn(), identifier, oldTags, newTags) } diff --git a/internal/service/emrserverless/tags_gen.go b/internal/service/emrserverless/tags_gen.go index dfe5f50634a1..51ae37af76a8 100644 --- a/internal/service/emrserverless/tags_gen.go +++ b/internal/service/emrserverless/tags_gen.go @@ -29,6 +29,10 @@ func ListTags(ctx context.Context, conn emrserverlessiface.EMRServerlessAPI, ide return KeyValueTags(ctx, output.Tags), nil } +func (p *servicePackage) ListTags(ctx context.Context, meta any, identifier string) (tftags.KeyValueTags, error) { + return ListTags(ctx, meta.(*conns.AWSClient).EMRServerlessConn(), identifier) +} + // map[string]*string handling // Tags returns emrserverless service tags. @@ -44,7 +48,8 @@ func KeyValueTags(ctx context.Context, tags map[string]*string) tftags.KeyValueT // UpdateTags updates emrserverless 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 emrserverlessiface.EMRServerlessAPI, identifier string, oldTagsMap interface{}, newTagsMap interface{}) error { + +func UpdateTags(ctx context.Context, conn emrserverlessiface.EMRServerlessAPI, identifier string, oldTagsMap, newTagsMap any) error { oldTags := tftags.New(ctx, oldTagsMap) newTags := tftags.New(ctx, newTagsMap) @@ -77,6 +82,6 @@ func UpdateTags(ctx context.Context, conn emrserverlessiface.EMRServerlessAPI, i return nil } -func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags interface{}, newTags interface{}) error { +func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags, newTags any) error { return UpdateTags(ctx, meta.(*conns.AWSClient).EMRServerlessConn(), identifier, oldTags, newTags) } diff --git a/internal/service/events/tags_gen.go b/internal/service/events/tags_gen.go index e464509643d6..82ce21a44788 100644 --- a/internal/service/events/tags_gen.go +++ b/internal/service/events/tags_gen.go @@ -29,6 +29,10 @@ func ListTags(ctx context.Context, conn eventbridgeiface.EventBridgeAPI, identif return KeyValueTags(ctx, output.Tags), nil } +func (p *servicePackage) ListTags(ctx context.Context, meta any, identifier string) (tftags.KeyValueTags, error) { + return ListTags(ctx, meta.(*conns.AWSClient).EventsConn(), identifier) +} + // []*SERVICE.Tag handling // Tags returns events service tags. @@ -61,7 +65,8 @@ func KeyValueTags(ctx context.Context, tags []*eventbridge.Tag) tftags.KeyValueT // UpdateTags updates events 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 eventbridgeiface.EventBridgeAPI, identifier string, oldTagsMap interface{}, newTagsMap interface{}) error { + +func UpdateTags(ctx context.Context, conn eventbridgeiface.EventBridgeAPI, identifier string, oldTagsMap, newTagsMap any) error { oldTags := tftags.New(ctx, oldTagsMap) newTags := tftags.New(ctx, newTagsMap) @@ -94,6 +99,6 @@ func UpdateTags(ctx context.Context, conn eventbridgeiface.EventBridgeAPI, ident return nil } -func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags interface{}, newTags interface{}) error { +func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags, newTags any) error { return UpdateTags(ctx, meta.(*conns.AWSClient).EventsConn(), identifier, oldTags, newTags) } diff --git a/internal/service/evidently/tags_gen.go b/internal/service/evidently/tags_gen.go index ea57d76ac48d..c6018d2a331e 100644 --- a/internal/service/evidently/tags_gen.go +++ b/internal/service/evidently/tags_gen.go @@ -27,7 +27,8 @@ func KeyValueTags(ctx context.Context, tags map[string]*string) tftags.KeyValueT // UpdateTags updates evidently 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 cloudwatchevidentlyiface.CloudWatchEvidentlyAPI, identifier string, oldTagsMap interface{}, newTagsMap interface{}) error { + +func UpdateTags(ctx context.Context, conn cloudwatchevidentlyiface.CloudWatchEvidentlyAPI, identifier string, oldTagsMap, newTagsMap any) error { oldTags := tftags.New(ctx, oldTagsMap) newTags := tftags.New(ctx, newTagsMap) @@ -60,6 +61,6 @@ func UpdateTags(ctx context.Context, conn cloudwatchevidentlyiface.CloudWatchEvi return nil } -func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags interface{}, newTags interface{}) error { +func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags, newTags any) error { return UpdateTags(ctx, meta.(*conns.AWSClient).EvidentlyConn(), identifier, oldTags, newTags) } diff --git a/internal/service/firehose/tags_gen.go b/internal/service/firehose/tags_gen.go index ff6dd6436d55..1ed25f4d41bc 100644 --- a/internal/service/firehose/tags_gen.go +++ b/internal/service/firehose/tags_gen.go @@ -29,6 +29,10 @@ func ListTags(ctx context.Context, conn firehoseiface.FirehoseAPI, identifier st return KeyValueTags(ctx, output.Tags), nil } +func (p *servicePackage) ListTags(ctx context.Context, meta any, identifier string) (tftags.KeyValueTags, error) { + return ListTags(ctx, meta.(*conns.AWSClient).FirehoseConn(), identifier) +} + // []*SERVICE.Tag handling // Tags returns firehose service tags. @@ -61,7 +65,8 @@ func KeyValueTags(ctx context.Context, tags []*firehose.Tag) tftags.KeyValueTags // UpdateTags updates firehose 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 firehoseiface.FirehoseAPI, identifier string, oldTagsMap interface{}, newTagsMap interface{}) error { + +func UpdateTags(ctx context.Context, conn firehoseiface.FirehoseAPI, identifier string, oldTagsMap, newTagsMap any) error { oldTags := tftags.New(ctx, oldTagsMap) newTags := tftags.New(ctx, newTagsMap) @@ -94,6 +99,6 @@ func UpdateTags(ctx context.Context, conn firehoseiface.FirehoseAPI, identifier return nil } -func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags interface{}, newTags interface{}) error { +func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags, newTags any) error { return UpdateTags(ctx, meta.(*conns.AWSClient).FirehoseConn(), identifier, oldTags, newTags) } diff --git a/internal/service/fis/tags_gen.go b/internal/service/fis/tags_gen.go index 6b3669cd3c6b..663e334128ee 100644 --- a/internal/service/fis/tags_gen.go +++ b/internal/service/fis/tags_gen.go @@ -42,7 +42,7 @@ func KeyValueTags(ctx context.Context, tags map[string]string) tftags.KeyValueTa // UpdateTags updates fis 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 *fis.Client, identifier string, oldTagsMap interface{}, newTagsMap interface{}) error { +func UpdateTags(ctx context.Context, conn *fis.Client, identifier string, oldTagsMap, newTagsMap any) error { oldTags := tftags.New(ctx, oldTagsMap) newTags := tftags.New(ctx, newTagsMap) diff --git a/internal/service/fms/tags_gen.go b/internal/service/fms/tags_gen.go index 05c21b7e528f..a653c1c7d732 100644 --- a/internal/service/fms/tags_gen.go +++ b/internal/service/fms/tags_gen.go @@ -29,6 +29,10 @@ func ListTags(ctx context.Context, conn fmsiface.FMSAPI, identifier string) (tft return KeyValueTags(ctx, output.TagList), nil } +func (p *servicePackage) ListTags(ctx context.Context, meta any, identifier string) (tftags.KeyValueTags, error) { + return ListTags(ctx, meta.(*conns.AWSClient).FMSConn(), identifier) +} + // []*SERVICE.Tag handling // Tags returns fms service tags. @@ -61,7 +65,8 @@ func KeyValueTags(ctx context.Context, tags []*fms.Tag) tftags.KeyValueTags { // UpdateTags updates fms 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 fmsiface.FMSAPI, identifier string, oldTagsMap interface{}, newTagsMap interface{}) error { + +func UpdateTags(ctx context.Context, conn fmsiface.FMSAPI, identifier string, oldTagsMap, newTagsMap any) error { oldTags := tftags.New(ctx, oldTagsMap) newTags := tftags.New(ctx, newTagsMap) @@ -94,6 +99,6 @@ func UpdateTags(ctx context.Context, conn fmsiface.FMSAPI, identifier string, ol return nil } -func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags interface{}, newTags interface{}) error { +func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags, newTags any) error { return UpdateTags(ctx, meta.(*conns.AWSClient).FMSConn(), identifier, oldTags, newTags) } diff --git a/internal/service/fsx/tags_gen.go b/internal/service/fsx/tags_gen.go index e70adef4ea33..4e6f05cea051 100644 --- a/internal/service/fsx/tags_gen.go +++ b/internal/service/fsx/tags_gen.go @@ -29,6 +29,10 @@ func ListTags(ctx context.Context, conn fsxiface.FSxAPI, identifier string) (tft return KeyValueTags(ctx, output.Tags), nil } +func (p *servicePackage) ListTags(ctx context.Context, meta any, identifier string) (tftags.KeyValueTags, error) { + return ListTags(ctx, meta.(*conns.AWSClient).FSxConn(), identifier) +} + // []*SERVICE.Tag handling // Tags returns fsx service tags. @@ -61,7 +65,8 @@ func KeyValueTags(ctx context.Context, tags []*fsx.Tag) tftags.KeyValueTags { // UpdateTags updates fsx 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 fsxiface.FSxAPI, identifier string, oldTagsMap interface{}, newTagsMap interface{}) error { + +func UpdateTags(ctx context.Context, conn fsxiface.FSxAPI, identifier string, oldTagsMap, newTagsMap any) error { oldTags := tftags.New(ctx, oldTagsMap) newTags := tftags.New(ctx, newTagsMap) @@ -94,6 +99,6 @@ func UpdateTags(ctx context.Context, conn fsxiface.FSxAPI, identifier string, ol return nil } -func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags interface{}, newTags interface{}) error { +func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags, newTags any) error { return UpdateTags(ctx, meta.(*conns.AWSClient).FSxConn(), identifier, oldTags, newTags) } diff --git a/internal/service/gamelift/tags_gen.go b/internal/service/gamelift/tags_gen.go index 8a06aaa27d5a..20d04a660173 100644 --- a/internal/service/gamelift/tags_gen.go +++ b/internal/service/gamelift/tags_gen.go @@ -29,6 +29,10 @@ func ListTags(ctx context.Context, conn gameliftiface.GameLiftAPI, identifier st return KeyValueTags(ctx, output.Tags), nil } +func (p *servicePackage) ListTags(ctx context.Context, meta any, identifier string) (tftags.KeyValueTags, error) { + return ListTags(ctx, meta.(*conns.AWSClient).GameLiftConn(), identifier) +} + // []*SERVICE.Tag handling // Tags returns gamelift service tags. @@ -61,7 +65,8 @@ func KeyValueTags(ctx context.Context, tags []*gamelift.Tag) tftags.KeyValueTags // UpdateTags updates gamelift 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 gameliftiface.GameLiftAPI, identifier string, oldTagsMap interface{}, newTagsMap interface{}) error { + +func UpdateTags(ctx context.Context, conn gameliftiface.GameLiftAPI, identifier string, oldTagsMap, newTagsMap any) error { oldTags := tftags.New(ctx, oldTagsMap) newTags := tftags.New(ctx, newTagsMap) @@ -94,6 +99,6 @@ func UpdateTags(ctx context.Context, conn gameliftiface.GameLiftAPI, identifier return nil } -func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags interface{}, newTags interface{}) error { +func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags, newTags any) error { return UpdateTags(ctx, meta.(*conns.AWSClient).GameLiftConn(), identifier, oldTags, newTags) } diff --git a/internal/service/glacier/tags_gen.go b/internal/service/glacier/tags_gen.go index c66dc3ebb5ce..a88d1936e30c 100644 --- a/internal/service/glacier/tags_gen.go +++ b/internal/service/glacier/tags_gen.go @@ -29,6 +29,10 @@ func ListTags(ctx context.Context, conn glacieriface.GlacierAPI, identifier stri return KeyValueTags(ctx, output.Tags), nil } +func (p *servicePackage) ListTags(ctx context.Context, meta any, identifier string) (tftags.KeyValueTags, error) { + return ListTags(ctx, meta.(*conns.AWSClient).GlacierConn(), identifier) +} + // map[string]*string handling // Tags returns glacier service tags. @@ -44,7 +48,8 @@ func KeyValueTags(ctx context.Context, tags map[string]*string) tftags.KeyValueT // UpdateTags updates glacier 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 glacieriface.GlacierAPI, identifier string, oldTagsMap interface{}, newTagsMap interface{}) error { + +func UpdateTags(ctx context.Context, conn glacieriface.GlacierAPI, identifier string, oldTagsMap, newTagsMap any) error { oldTags := tftags.New(ctx, oldTagsMap) newTags := tftags.New(ctx, newTagsMap) @@ -77,6 +82,6 @@ func UpdateTags(ctx context.Context, conn glacieriface.GlacierAPI, identifier st return nil } -func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags interface{}, newTags interface{}) error { +func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags, newTags any) error { return UpdateTags(ctx, meta.(*conns.AWSClient).GlacierConn(), identifier, oldTags, newTags) } diff --git a/internal/service/globalaccelerator/tags_gen.go b/internal/service/globalaccelerator/tags_gen.go index 164a50bc43b6..8c0817630345 100644 --- a/internal/service/globalaccelerator/tags_gen.go +++ b/internal/service/globalaccelerator/tags_gen.go @@ -29,6 +29,10 @@ func ListTags(ctx context.Context, conn globalacceleratoriface.GlobalAccelerator return KeyValueTags(ctx, output.Tags), nil } +func (p *servicePackage) ListTags(ctx context.Context, meta any, identifier string) (tftags.KeyValueTags, error) { + return ListTags(ctx, meta.(*conns.AWSClient).GlobalAcceleratorConn(), identifier) +} + // []*SERVICE.Tag handling // Tags returns globalaccelerator service tags. @@ -61,7 +65,8 @@ func KeyValueTags(ctx context.Context, tags []*globalaccelerator.Tag) tftags.Key // UpdateTags updates globalaccelerator 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 globalacceleratoriface.GlobalAcceleratorAPI, identifier string, oldTagsMap interface{}, newTagsMap interface{}) error { + +func UpdateTags(ctx context.Context, conn globalacceleratoriface.GlobalAcceleratorAPI, identifier string, oldTagsMap, newTagsMap any) error { oldTags := tftags.New(ctx, oldTagsMap) newTags := tftags.New(ctx, newTagsMap) @@ -94,6 +99,6 @@ func UpdateTags(ctx context.Context, conn globalacceleratoriface.GlobalAccelerat return nil } -func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags interface{}, newTags interface{}) error { +func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags, newTags any) error { return UpdateTags(ctx, meta.(*conns.AWSClient).GlobalAcceleratorConn(), identifier, oldTags, newTags) } diff --git a/internal/service/glue/tags_gen.go b/internal/service/glue/tags_gen.go index 722f17584f75..946172c4deee 100644 --- a/internal/service/glue/tags_gen.go +++ b/internal/service/glue/tags_gen.go @@ -29,6 +29,10 @@ func ListTags(ctx context.Context, conn glueiface.GlueAPI, identifier string) (t return KeyValueTags(ctx, output.Tags), nil } +func (p *servicePackage) ListTags(ctx context.Context, meta any, identifier string) (tftags.KeyValueTags, error) { + return ListTags(ctx, meta.(*conns.AWSClient).GlueConn(), identifier) +} + // map[string]*string handling // Tags returns glue service tags. @@ -44,7 +48,8 @@ func KeyValueTags(ctx context.Context, tags map[string]*string) tftags.KeyValueT // UpdateTags updates glue 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 glueiface.GlueAPI, identifier string, oldTagsMap interface{}, newTagsMap interface{}) error { + +func UpdateTags(ctx context.Context, conn glueiface.GlueAPI, identifier string, oldTagsMap, newTagsMap any) error { oldTags := tftags.New(ctx, oldTagsMap) newTags := tftags.New(ctx, newTagsMap) @@ -77,6 +82,6 @@ func UpdateTags(ctx context.Context, conn glueiface.GlueAPI, identifier string, return nil } -func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags interface{}, newTags interface{}) error { +func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags, newTags any) error { return UpdateTags(ctx, meta.(*conns.AWSClient).GlueConn(), identifier, oldTags, newTags) } diff --git a/internal/service/grafana/tags_gen.go b/internal/service/grafana/tags_gen.go index 78d84c60af91..07175a949cd1 100644 --- a/internal/service/grafana/tags_gen.go +++ b/internal/service/grafana/tags_gen.go @@ -29,6 +29,10 @@ func ListTags(ctx context.Context, conn managedgrafanaiface.ManagedGrafanaAPI, i return KeyValueTags(ctx, output.Tags), nil } +func (p *servicePackage) ListTags(ctx context.Context, meta any, identifier string) (tftags.KeyValueTags, error) { + return ListTags(ctx, meta.(*conns.AWSClient).GrafanaConn(), identifier) +} + // map[string]*string handling // Tags returns grafana service tags. @@ -44,7 +48,8 @@ func KeyValueTags(ctx context.Context, tags map[string]*string) tftags.KeyValueT // UpdateTags updates grafana 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 managedgrafanaiface.ManagedGrafanaAPI, identifier string, oldTagsMap interface{}, newTagsMap interface{}) error { + +func UpdateTags(ctx context.Context, conn managedgrafanaiface.ManagedGrafanaAPI, identifier string, oldTagsMap, newTagsMap any) error { oldTags := tftags.New(ctx, oldTagsMap) newTags := tftags.New(ctx, newTagsMap) @@ -77,6 +82,6 @@ func UpdateTags(ctx context.Context, conn managedgrafanaiface.ManagedGrafanaAPI, return nil } -func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags interface{}, newTags interface{}) error { +func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags, newTags any) error { return UpdateTags(ctx, meta.(*conns.AWSClient).GrafanaConn(), identifier, oldTags, newTags) } diff --git a/internal/service/greengrass/tags_gen.go b/internal/service/greengrass/tags_gen.go index 44446c421f39..2b97f6eaec91 100644 --- a/internal/service/greengrass/tags_gen.go +++ b/internal/service/greengrass/tags_gen.go @@ -29,6 +29,10 @@ func ListTags(ctx context.Context, conn greengrassiface.GreengrassAPI, identifie return KeyValueTags(ctx, output.Tags), nil } +func (p *servicePackage) ListTags(ctx context.Context, meta any, identifier string) (tftags.KeyValueTags, error) { + return ListTags(ctx, meta.(*conns.AWSClient).GreengrassConn(), identifier) +} + // map[string]*string handling // Tags returns greengrass service tags. @@ -44,7 +48,8 @@ func KeyValueTags(ctx context.Context, tags map[string]*string) tftags.KeyValueT // UpdateTags updates greengrass 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 greengrassiface.GreengrassAPI, identifier string, oldTagsMap interface{}, newTagsMap interface{}) error { + +func UpdateTags(ctx context.Context, conn greengrassiface.GreengrassAPI, identifier string, oldTagsMap, newTagsMap any) error { oldTags := tftags.New(ctx, oldTagsMap) newTags := tftags.New(ctx, newTagsMap) @@ -77,6 +82,6 @@ func UpdateTags(ctx context.Context, conn greengrassiface.GreengrassAPI, identif return nil } -func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags interface{}, newTags interface{}) error { +func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags, newTags any) error { return UpdateTags(ctx, meta.(*conns.AWSClient).GreengrassConn(), identifier, oldTags, newTags) } diff --git a/internal/service/guardduty/tags_gen.go b/internal/service/guardduty/tags_gen.go index 11f042ef01cd..addcef7fd83b 100644 --- a/internal/service/guardduty/tags_gen.go +++ b/internal/service/guardduty/tags_gen.go @@ -29,6 +29,10 @@ func ListTags(ctx context.Context, conn guarddutyiface.GuardDutyAPI, identifier return KeyValueTags(ctx, output.Tags), nil } +func (p *servicePackage) ListTags(ctx context.Context, meta any, identifier string) (tftags.KeyValueTags, error) { + return ListTags(ctx, meta.(*conns.AWSClient).GuardDutyConn(), identifier) +} + // map[string]*string handling // Tags returns guardduty service tags. @@ -44,7 +48,8 @@ func KeyValueTags(ctx context.Context, tags map[string]*string) tftags.KeyValueT // UpdateTags updates guardduty 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 guarddutyiface.GuardDutyAPI, identifier string, oldTagsMap interface{}, newTagsMap interface{}) error { + +func UpdateTags(ctx context.Context, conn guarddutyiface.GuardDutyAPI, identifier string, oldTagsMap, newTagsMap any) error { oldTags := tftags.New(ctx, oldTagsMap) newTags := tftags.New(ctx, newTagsMap) @@ -77,6 +82,6 @@ func UpdateTags(ctx context.Context, conn guarddutyiface.GuardDutyAPI, identifie return nil } -func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags interface{}, newTags interface{}) error { +func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags, newTags any) error { return UpdateTags(ctx, meta.(*conns.AWSClient).GuardDutyConn(), identifier, oldTags, newTags) } diff --git a/internal/service/healthlake/tags_gen.go b/internal/service/healthlake/tags_gen.go index a11fbf8efa16..3b323ab54314 100644 --- a/internal/service/healthlake/tags_gen.go +++ b/internal/service/healthlake/tags_gen.go @@ -60,7 +60,7 @@ func KeyValueTags(ctx context.Context, tags []types.Tag) tftags.KeyValueTags { // UpdateTags updates healthlake 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 *healthlake.Client, identifier string, oldTagsMap interface{}, newTagsMap interface{}) error { +func UpdateTags(ctx context.Context, conn *healthlake.Client, identifier string, oldTagsMap, newTagsMap any) error { oldTags := tftags.New(ctx, oldTagsMap) newTags := tftags.New(ctx, newTagsMap) diff --git a/internal/service/imagebuilder/tags_gen.go b/internal/service/imagebuilder/tags_gen.go index c69495d63bcd..9c3f15cfabcd 100644 --- a/internal/service/imagebuilder/tags_gen.go +++ b/internal/service/imagebuilder/tags_gen.go @@ -29,6 +29,10 @@ func ListTags(ctx context.Context, conn imagebuilderiface.ImagebuilderAPI, ident return KeyValueTags(ctx, output.Tags), nil } +func (p *servicePackage) ListTags(ctx context.Context, meta any, identifier string) (tftags.KeyValueTags, error) { + return ListTags(ctx, meta.(*conns.AWSClient).ImageBuilderConn(), identifier) +} + // map[string]*string handling // Tags returns imagebuilder service tags. @@ -44,7 +48,8 @@ func KeyValueTags(ctx context.Context, tags map[string]*string) tftags.KeyValueT // UpdateTags updates imagebuilder 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 imagebuilderiface.ImagebuilderAPI, identifier string, oldTagsMap interface{}, newTagsMap interface{}) error { + +func UpdateTags(ctx context.Context, conn imagebuilderiface.ImagebuilderAPI, identifier string, oldTagsMap, newTagsMap any) error { oldTags := tftags.New(ctx, oldTagsMap) newTags := tftags.New(ctx, newTagsMap) @@ -77,6 +82,6 @@ func UpdateTags(ctx context.Context, conn imagebuilderiface.ImagebuilderAPI, ide return nil } -func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags interface{}, newTags interface{}) error { +func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags, newTags any) error { return UpdateTags(ctx, meta.(*conns.AWSClient).ImageBuilderConn(), identifier, oldTags, newTags) } diff --git a/internal/service/inspector/tags_gen.go b/internal/service/inspector/tags_gen.go index 3bbddbab5948..9724418e738e 100644 --- a/internal/service/inspector/tags_gen.go +++ b/internal/service/inspector/tags_gen.go @@ -7,6 +7,7 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/inspector" "github.com/aws/aws-sdk-go/service/inspector/inspectoriface" + "github.com/hashicorp/terraform-provider-aws/internal/conns" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" ) @@ -27,6 +28,10 @@ func ListTags(ctx context.Context, conn inspectoriface.InspectorAPI, identifier return KeyValueTags(ctx, output.Tags), nil } +func (p *servicePackage) ListTags(ctx context.Context, meta any, identifier string) (tftags.KeyValueTags, error) { + return ListTags(ctx, meta.(*conns.AWSClient).InspectorConn(), identifier) +} + // []*SERVICE.Tag handling // Tags returns inspector service tags. diff --git a/internal/service/iot/tags_gen.go b/internal/service/iot/tags_gen.go index 4f95c81790b8..56a62f521761 100644 --- a/internal/service/iot/tags_gen.go +++ b/internal/service/iot/tags_gen.go @@ -29,6 +29,10 @@ func ListTags(ctx context.Context, conn iotiface.IoTAPI, identifier string) (tft return KeyValueTags(ctx, output.Tags), nil } +func (p *servicePackage) ListTags(ctx context.Context, meta any, identifier string) (tftags.KeyValueTags, error) { + return ListTags(ctx, meta.(*conns.AWSClient).IoTConn(), identifier) +} + // []*SERVICE.Tag handling // Tags returns iot service tags. @@ -61,7 +65,8 @@ func KeyValueTags(ctx context.Context, tags []*iot.Tag) tftags.KeyValueTags { // UpdateTags updates iot 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 iotiface.IoTAPI, identifier string, oldTagsMap interface{}, newTagsMap interface{}) error { + +func UpdateTags(ctx context.Context, conn iotiface.IoTAPI, identifier string, oldTagsMap, newTagsMap any) error { oldTags := tftags.New(ctx, oldTagsMap) newTags := tftags.New(ctx, newTagsMap) @@ -94,6 +99,6 @@ func UpdateTags(ctx context.Context, conn iotiface.IoTAPI, identifier string, ol return nil } -func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags interface{}, newTags interface{}) error { +func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags, newTags any) error { return UpdateTags(ctx, meta.(*conns.AWSClient).IoTConn(), identifier, oldTags, newTags) } diff --git a/internal/service/iotanalytics/tags_gen.go b/internal/service/iotanalytics/tags_gen.go index 198814a1eba4..316065c5b173 100644 --- a/internal/service/iotanalytics/tags_gen.go +++ b/internal/service/iotanalytics/tags_gen.go @@ -29,6 +29,10 @@ func ListTags(ctx context.Context, conn iotanalyticsiface.IoTAnalyticsAPI, ident return KeyValueTags(ctx, output.Tags), nil } +func (p *servicePackage) ListTags(ctx context.Context, meta any, identifier string) (tftags.KeyValueTags, error) { + return ListTags(ctx, meta.(*conns.AWSClient).IoTAnalyticsConn(), identifier) +} + // []*SERVICE.Tag handling // Tags returns iotanalytics service tags. @@ -61,7 +65,8 @@ func KeyValueTags(ctx context.Context, tags []*iotanalytics.Tag) tftags.KeyValue // UpdateTags updates iotanalytics 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 iotanalyticsiface.IoTAnalyticsAPI, identifier string, oldTagsMap interface{}, newTagsMap interface{}) error { + +func UpdateTags(ctx context.Context, conn iotanalyticsiface.IoTAnalyticsAPI, identifier string, oldTagsMap, newTagsMap any) error { oldTags := tftags.New(ctx, oldTagsMap) newTags := tftags.New(ctx, newTagsMap) @@ -94,6 +99,6 @@ func UpdateTags(ctx context.Context, conn iotanalyticsiface.IoTAnalyticsAPI, ide return nil } -func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags interface{}, newTags interface{}) error { +func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags, newTags any) error { return UpdateTags(ctx, meta.(*conns.AWSClient).IoTAnalyticsConn(), identifier, oldTags, newTags) } diff --git a/internal/service/iotevents/tags_gen.go b/internal/service/iotevents/tags_gen.go index 7949f0b8a2e8..e3c5679f9074 100644 --- a/internal/service/iotevents/tags_gen.go +++ b/internal/service/iotevents/tags_gen.go @@ -29,6 +29,10 @@ func ListTags(ctx context.Context, conn ioteventsiface.IoTEventsAPI, identifier return KeyValueTags(ctx, output.Tags), nil } +func (p *servicePackage) ListTags(ctx context.Context, meta any, identifier string) (tftags.KeyValueTags, error) { + return ListTags(ctx, meta.(*conns.AWSClient).IoTEventsConn(), identifier) +} + // []*SERVICE.Tag handling // Tags returns iotevents service tags. @@ -61,7 +65,8 @@ func KeyValueTags(ctx context.Context, tags []*iotevents.Tag) tftags.KeyValueTag // UpdateTags updates iotevents 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 ioteventsiface.IoTEventsAPI, identifier string, oldTagsMap interface{}, newTagsMap interface{}) error { + +func UpdateTags(ctx context.Context, conn ioteventsiface.IoTEventsAPI, identifier string, oldTagsMap, newTagsMap any) error { oldTags := tftags.New(ctx, oldTagsMap) newTags := tftags.New(ctx, newTagsMap) @@ -94,6 +99,6 @@ func UpdateTags(ctx context.Context, conn ioteventsiface.IoTEventsAPI, identifie return nil } -func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags interface{}, newTags interface{}) error { +func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags, newTags any) error { return UpdateTags(ctx, meta.(*conns.AWSClient).IoTEventsConn(), identifier, oldTags, newTags) } diff --git a/internal/service/ivs/tags_gen.go b/internal/service/ivs/tags_gen.go index 12b124c8d122..22290678900f 100644 --- a/internal/service/ivs/tags_gen.go +++ b/internal/service/ivs/tags_gen.go @@ -29,6 +29,10 @@ func ListTags(ctx context.Context, conn ivsiface.IVSAPI, identifier string) (tft return KeyValueTags(ctx, output.Tags), nil } +func (p *servicePackage) ListTags(ctx context.Context, meta any, identifier string) (tftags.KeyValueTags, error) { + return ListTags(ctx, meta.(*conns.AWSClient).IVSConn(), identifier) +} + // map[string]*string handling // Tags returns ivs service tags. @@ -44,7 +48,8 @@ func KeyValueTags(ctx context.Context, tags map[string]*string) tftags.KeyValueT // UpdateTags updates ivs 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 ivsiface.IVSAPI, identifier string, oldTagsMap interface{}, newTagsMap interface{}) error { + +func UpdateTags(ctx context.Context, conn ivsiface.IVSAPI, identifier string, oldTagsMap, newTagsMap any) error { oldTags := tftags.New(ctx, oldTagsMap) newTags := tftags.New(ctx, newTagsMap) @@ -77,6 +82,6 @@ func UpdateTags(ctx context.Context, conn ivsiface.IVSAPI, identifier string, ol return nil } -func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags interface{}, newTags interface{}) error { +func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags, newTags any) error { return UpdateTags(ctx, meta.(*conns.AWSClient).IVSConn(), identifier, oldTags, newTags) } diff --git a/internal/service/ivschat/tags_gen.go b/internal/service/ivschat/tags_gen.go index 8eab873a6481..7d5d9486e656 100644 --- a/internal/service/ivschat/tags_gen.go +++ b/internal/service/ivschat/tags_gen.go @@ -42,7 +42,7 @@ func KeyValueTags(ctx context.Context, tags map[string]string) tftags.KeyValueTa // UpdateTags updates ivschat 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 *ivschat.Client, identifier string, oldTagsMap interface{}, newTagsMap interface{}) error { +func UpdateTags(ctx context.Context, conn *ivschat.Client, identifier string, oldTagsMap, newTagsMap any) error { oldTags := tftags.New(ctx, oldTagsMap) newTags := tftags.New(ctx, newTagsMap) diff --git a/internal/service/kafka/tags_gen.go b/internal/service/kafka/tags_gen.go index 5bdf70b11704..17455a5b14c4 100644 --- a/internal/service/kafka/tags_gen.go +++ b/internal/service/kafka/tags_gen.go @@ -27,7 +27,8 @@ func KeyValueTags(ctx context.Context, tags map[string]*string) tftags.KeyValueT // UpdateTags updates kafka 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 kafkaiface.KafkaAPI, identifier string, oldTagsMap interface{}, newTagsMap interface{}) error { + +func UpdateTags(ctx context.Context, conn kafkaiface.KafkaAPI, identifier string, oldTagsMap, newTagsMap any) error { oldTags := tftags.New(ctx, oldTagsMap) newTags := tftags.New(ctx, newTagsMap) @@ -60,6 +61,6 @@ func UpdateTags(ctx context.Context, conn kafkaiface.KafkaAPI, identifier string return nil } -func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags interface{}, newTags interface{}) error { +func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags, newTags any) error { return UpdateTags(ctx, meta.(*conns.AWSClient).KafkaConn(), identifier, oldTags, newTags) } diff --git a/internal/service/kendra/tags_gen.go b/internal/service/kendra/tags_gen.go index 6ab6632bf3e3..4764f3b68d17 100644 --- a/internal/service/kendra/tags_gen.go +++ b/internal/service/kendra/tags_gen.go @@ -60,7 +60,7 @@ func KeyValueTags(ctx context.Context, tags []types.Tag) tftags.KeyValueTags { // UpdateTags updates kendra 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 *kendra.Client, identifier string, oldTagsMap interface{}, newTagsMap interface{}) error { +func UpdateTags(ctx context.Context, conn *kendra.Client, identifier string, oldTagsMap, newTagsMap any) error { oldTags := tftags.New(ctx, oldTagsMap) newTags := tftags.New(ctx, newTagsMap) diff --git a/internal/service/keyspaces/tags_gen.go b/internal/service/keyspaces/tags_gen.go index 3568dae2f877..0f0b3aa4ac62 100644 --- a/internal/service/keyspaces/tags_gen.go +++ b/internal/service/keyspaces/tags_gen.go @@ -29,6 +29,10 @@ func ListTags(ctx context.Context, conn keyspacesiface.KeyspacesAPI, identifier return KeyValueTags(ctx, output.Tags), nil } +func (p *servicePackage) ListTags(ctx context.Context, meta any, identifier string) (tftags.KeyValueTags, error) { + return ListTags(ctx, meta.(*conns.AWSClient).KeyspacesConn(), identifier) +} + // []*SERVICE.Tag handling // Tags returns keyspaces service tags. @@ -61,7 +65,8 @@ func KeyValueTags(ctx context.Context, tags []*keyspaces.Tag) tftags.KeyValueTag // UpdateTags updates keyspaces 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 keyspacesiface.KeyspacesAPI, identifier string, oldTagsMap interface{}, newTagsMap interface{}) error { + +func UpdateTags(ctx context.Context, conn keyspacesiface.KeyspacesAPI, identifier string, oldTagsMap, newTagsMap any) error { oldTags := tftags.New(ctx, oldTagsMap) newTags := tftags.New(ctx, newTagsMap) @@ -94,6 +99,6 @@ func UpdateTags(ctx context.Context, conn keyspacesiface.KeyspacesAPI, identifie return nil } -func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags interface{}, newTags interface{}) error { +func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags, newTags any) error { return UpdateTags(ctx, meta.(*conns.AWSClient).KeyspacesConn(), identifier, oldTags, newTags) } diff --git a/internal/service/kinesis/tags_gen.go b/internal/service/kinesis/tags_gen.go index 495b59976df2..46f15b4f609c 100644 --- a/internal/service/kinesis/tags_gen.go +++ b/internal/service/kinesis/tags_gen.go @@ -29,6 +29,10 @@ func ListTags(ctx context.Context, conn kinesisiface.KinesisAPI, identifier stri return KeyValueTags(ctx, output.Tags), nil } +func (p *servicePackage) ListTags(ctx context.Context, meta any, identifier string) (tftags.KeyValueTags, error) { + return ListTags(ctx, meta.(*conns.AWSClient).KinesisConn(), identifier) +} + // []*SERVICE.Tag handling // Tags returns kinesis service tags. @@ -61,7 +65,8 @@ func KeyValueTags(ctx context.Context, tags []*kinesis.Tag) tftags.KeyValueTags // UpdateTags updates kinesis 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 kinesisiface.KinesisAPI, identifier string, oldTagsMap interface{}, newTagsMap interface{}) error { + +func UpdateTags(ctx context.Context, conn kinesisiface.KinesisAPI, identifier string, oldTagsMap, newTagsMap any) error { oldTags := tftags.New(ctx, oldTagsMap) newTags := tftags.New(ctx, newTagsMap) @@ -98,6 +103,6 @@ func UpdateTags(ctx context.Context, conn kinesisiface.KinesisAPI, identifier st return nil } -func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags interface{}, newTags interface{}) error { +func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags, newTags any) error { return UpdateTags(ctx, meta.(*conns.AWSClient).KinesisConn(), identifier, oldTags, newTags) } diff --git a/internal/service/kinesisanalytics/tags_gen.go b/internal/service/kinesisanalytics/tags_gen.go index 1ec822881d17..e1d973c8d975 100644 --- a/internal/service/kinesisanalytics/tags_gen.go +++ b/internal/service/kinesisanalytics/tags_gen.go @@ -29,6 +29,10 @@ func ListTags(ctx context.Context, conn kinesisanalyticsiface.KinesisAnalyticsAP return KeyValueTags(ctx, output.Tags), nil } +func (p *servicePackage) ListTags(ctx context.Context, meta any, identifier string) (tftags.KeyValueTags, error) { + return ListTags(ctx, meta.(*conns.AWSClient).KinesisAnalyticsConn(), identifier) +} + // []*SERVICE.Tag handling // Tags returns kinesisanalytics service tags. @@ -61,7 +65,8 @@ func KeyValueTags(ctx context.Context, tags []*kinesisanalytics.Tag) tftags.KeyV // UpdateTags updates kinesisanalytics 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 kinesisanalyticsiface.KinesisAnalyticsAPI, identifier string, oldTagsMap interface{}, newTagsMap interface{}) error { + +func UpdateTags(ctx context.Context, conn kinesisanalyticsiface.KinesisAnalyticsAPI, identifier string, oldTagsMap, newTagsMap any) error { oldTags := tftags.New(ctx, oldTagsMap) newTags := tftags.New(ctx, newTagsMap) @@ -94,6 +99,6 @@ func UpdateTags(ctx context.Context, conn kinesisanalyticsiface.KinesisAnalytics return nil } -func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags interface{}, newTags interface{}) error { +func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags, newTags any) error { return UpdateTags(ctx, meta.(*conns.AWSClient).KinesisAnalyticsConn(), identifier, oldTags, newTags) } diff --git a/internal/service/kinesisanalyticsv2/tags_gen.go b/internal/service/kinesisanalyticsv2/tags_gen.go index d758b2a9b547..34d62c76e59c 100644 --- a/internal/service/kinesisanalyticsv2/tags_gen.go +++ b/internal/service/kinesisanalyticsv2/tags_gen.go @@ -29,6 +29,10 @@ func ListTags(ctx context.Context, conn kinesisanalyticsv2iface.KinesisAnalytics return KeyValueTags(ctx, output.Tags), nil } +func (p *servicePackage) ListTags(ctx context.Context, meta any, identifier string) (tftags.KeyValueTags, error) { + return ListTags(ctx, meta.(*conns.AWSClient).KinesisAnalyticsV2Conn(), identifier) +} + // []*SERVICE.Tag handling // Tags returns kinesisanalyticsv2 service tags. @@ -61,7 +65,8 @@ func KeyValueTags(ctx context.Context, tags []*kinesisanalyticsv2.Tag) tftags.Ke // UpdateTags updates kinesisanalyticsv2 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 kinesisanalyticsv2iface.KinesisAnalyticsV2API, identifier string, oldTagsMap interface{}, newTagsMap interface{}) error { + +func UpdateTags(ctx context.Context, conn kinesisanalyticsv2iface.KinesisAnalyticsV2API, identifier string, oldTagsMap, newTagsMap any) error { oldTags := tftags.New(ctx, oldTagsMap) newTags := tftags.New(ctx, newTagsMap) @@ -94,6 +99,6 @@ func UpdateTags(ctx context.Context, conn kinesisanalyticsv2iface.KinesisAnalyti return nil } -func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags interface{}, newTags interface{}) error { +func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags, newTags any) error { return UpdateTags(ctx, meta.(*conns.AWSClient).KinesisAnalyticsV2Conn(), identifier, oldTags, newTags) } diff --git a/internal/service/kinesisvideo/tags_gen.go b/internal/service/kinesisvideo/tags_gen.go index 00b54bc92d36..b862c487b045 100644 --- a/internal/service/kinesisvideo/tags_gen.go +++ b/internal/service/kinesisvideo/tags_gen.go @@ -29,6 +29,10 @@ func ListTags(ctx context.Context, conn kinesisvideoiface.KinesisVideoAPI, ident return KeyValueTags(ctx, output.Tags), nil } +func (p *servicePackage) ListTags(ctx context.Context, meta any, identifier string) (tftags.KeyValueTags, error) { + return ListTags(ctx, meta.(*conns.AWSClient).KinesisVideoConn(), identifier) +} + // map[string]*string handling // Tags returns kinesisvideo service tags. @@ -44,7 +48,8 @@ func KeyValueTags(ctx context.Context, tags map[string]*string) tftags.KeyValueT // UpdateTags updates kinesisvideo 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 kinesisvideoiface.KinesisVideoAPI, identifier string, oldTagsMap interface{}, newTagsMap interface{}) error { + +func UpdateTags(ctx context.Context, conn kinesisvideoiface.KinesisVideoAPI, identifier string, oldTagsMap, newTagsMap any) error { oldTags := tftags.New(ctx, oldTagsMap) newTags := tftags.New(ctx, newTagsMap) @@ -77,6 +82,6 @@ func UpdateTags(ctx context.Context, conn kinesisvideoiface.KinesisVideoAPI, ide return nil } -func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags interface{}, newTags interface{}) error { +func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags, newTags any) error { return UpdateTags(ctx, meta.(*conns.AWSClient).KinesisVideoConn(), identifier, oldTags, newTags) } diff --git a/internal/service/kms/tags_gen.go b/internal/service/kms/tags_gen.go index 4a200444f769..0ed9d3bd0dfa 100644 --- a/internal/service/kms/tags_gen.go +++ b/internal/service/kms/tags_gen.go @@ -29,6 +29,10 @@ func ListTags(ctx context.Context, conn kmsiface.KMSAPI, identifier string) (tft return KeyValueTags(ctx, output.Tags), nil } +func (p *servicePackage) ListTags(ctx context.Context, meta any, identifier string) (tftags.KeyValueTags, error) { + return ListTags(ctx, meta.(*conns.AWSClient).KMSConn(), identifier) +} + // []*SERVICE.Tag handling // Tags returns kms service tags. @@ -61,7 +65,8 @@ func KeyValueTags(ctx context.Context, tags []*kms.Tag) tftags.KeyValueTags { // UpdateTags updates kms 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 kmsiface.KMSAPI, identifier string, oldTagsMap interface{}, newTagsMap interface{}) error { + +func UpdateTags(ctx context.Context, conn kmsiface.KMSAPI, identifier string, oldTagsMap, newTagsMap any) error { oldTags := tftags.New(ctx, oldTagsMap) newTags := tftags.New(ctx, newTagsMap) @@ -94,6 +99,6 @@ func UpdateTags(ctx context.Context, conn kmsiface.KMSAPI, identifier string, ol return nil } -func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags interface{}, newTags interface{}) error { +func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags, newTags any) error { return UpdateTags(ctx, meta.(*conns.AWSClient).KMSConn(), identifier, oldTags, newTags) } diff --git a/internal/service/lambda/tags_gen.go b/internal/service/lambda/tags_gen.go index 8606ef47b43e..695a8b4df115 100644 --- a/internal/service/lambda/tags_gen.go +++ b/internal/service/lambda/tags_gen.go @@ -25,7 +25,7 @@ func KeyValueTags(ctx context.Context, tags map[string]string) tftags.KeyValueTa // UpdateTags updates lambda 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 *lambda.Client, identifier string, oldTagsMap interface{}, newTagsMap interface{}) error { +func UpdateTags(ctx context.Context, conn *lambda.Client, identifier string, oldTagsMap, newTagsMap any) error { oldTags := tftags.New(ctx, oldTagsMap) newTags := tftags.New(ctx, newTagsMap) diff --git a/internal/service/licensemanager/tags_gen.go b/internal/service/licensemanager/tags_gen.go index 31f7eaeb8523..bb2f68175682 100644 --- a/internal/service/licensemanager/tags_gen.go +++ b/internal/service/licensemanager/tags_gen.go @@ -44,7 +44,8 @@ func KeyValueTags(ctx context.Context, tags []*licensemanager.Tag) tftags.KeyVal // UpdateTags updates licensemanager 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 licensemanageriface.LicenseManagerAPI, identifier string, oldTagsMap interface{}, newTagsMap interface{}) error { + +func UpdateTags(ctx context.Context, conn licensemanageriface.LicenseManagerAPI, identifier string, oldTagsMap, newTagsMap any) error { oldTags := tftags.New(ctx, oldTagsMap) newTags := tftags.New(ctx, newTagsMap) @@ -77,6 +78,6 @@ func UpdateTags(ctx context.Context, conn licensemanageriface.LicenseManagerAPI, return nil } -func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags interface{}, newTags interface{}) error { +func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags, newTags any) error { return UpdateTags(ctx, meta.(*conns.AWSClient).LicenseManagerConn(), identifier, oldTags, newTags) } diff --git a/internal/service/lightsail/tags_gen.go b/internal/service/lightsail/tags_gen.go index 738dd168824d..faeaf10b0787 100644 --- a/internal/service/lightsail/tags_gen.go +++ b/internal/service/lightsail/tags_gen.go @@ -44,7 +44,8 @@ func KeyValueTags(ctx context.Context, tags []*lightsail.Tag) tftags.KeyValueTag // UpdateTags updates lightsail 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 lightsailiface.LightsailAPI, identifier string, oldTagsMap interface{}, newTagsMap interface{}) error { + +func UpdateTags(ctx context.Context, conn lightsailiface.LightsailAPI, identifier string, oldTagsMap, newTagsMap any) error { oldTags := tftags.New(ctx, oldTagsMap) newTags := tftags.New(ctx, newTagsMap) @@ -77,6 +78,6 @@ func UpdateTags(ctx context.Context, conn lightsailiface.LightsailAPI, identifie return nil } -func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags interface{}, newTags interface{}) error { +func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags, newTags any) error { return UpdateTags(ctx, meta.(*conns.AWSClient).LightsailConn(), identifier, oldTags, newTags) } diff --git a/internal/service/location/tags_gen.go b/internal/service/location/tags_gen.go index 9794b43c1db4..fd923ca6e88d 100644 --- a/internal/service/location/tags_gen.go +++ b/internal/service/location/tags_gen.go @@ -29,6 +29,10 @@ func ListTags(ctx context.Context, conn locationserviceiface.LocationServiceAPI, return KeyValueTags(ctx, output.Tags), nil } +func (p *servicePackage) ListTags(ctx context.Context, meta any, identifier string) (tftags.KeyValueTags, error) { + return ListTags(ctx, meta.(*conns.AWSClient).LocationConn(), identifier) +} + // map[string]*string handling // Tags returns location service tags. @@ -44,7 +48,8 @@ func KeyValueTags(ctx context.Context, tags map[string]*string) tftags.KeyValueT // UpdateTags updates location 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 locationserviceiface.LocationServiceAPI, identifier string, oldTagsMap interface{}, newTagsMap interface{}) error { + +func UpdateTags(ctx context.Context, conn locationserviceiface.LocationServiceAPI, identifier string, oldTagsMap, newTagsMap any) error { oldTags := tftags.New(ctx, oldTagsMap) newTags := tftags.New(ctx, newTagsMap) @@ -77,6 +82,6 @@ func UpdateTags(ctx context.Context, conn locationserviceiface.LocationServiceAP return nil } -func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags interface{}, newTags interface{}) error { +func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags, newTags any) error { return UpdateTags(ctx, meta.(*conns.AWSClient).LocationConn(), identifier, oldTags, newTags) } diff --git a/internal/service/logs/log_group_tags_gen.go b/internal/service/logs/log_group_tags_gen.go index 8084b90c767e..86672fd0c725 100644 --- a/internal/service/logs/log_group_tags_gen.go +++ b/internal/service/logs/log_group_tags_gen.go @@ -29,10 +29,15 @@ func ListLogGroupTags(ctx context.Context, conn cloudwatchlogsiface.CloudWatchLo return KeyValueTags(ctx, output.Tags), nil } +func (p *servicePackage) ListLogGroupTags(ctx context.Context, meta any, identifier string) (tftags.KeyValueTags, error) { + return ListLogGroupTags(ctx, meta.(*conns.AWSClient).LogsConn(), identifier) +} + // UpdateLogGroupTags updates logs service tags. // The identifier is typically the Amazon Resource Name (ARN), although // it may also be a different identifier depending on the service. -func UpdateLogGroupTags(ctx context.Context, conn cloudwatchlogsiface.CloudWatchLogsAPI, identifier string, oldTagsMap interface{}, newTagsMap interface{}) error { + +func UpdateLogGroupTags(ctx context.Context, conn cloudwatchlogsiface.CloudWatchLogsAPI, identifier string, oldTagsMap, newTagsMap any) error { oldTags := tftags.New(ctx, oldTagsMap) newTags := tftags.New(ctx, newTagsMap) @@ -65,6 +70,6 @@ func UpdateLogGroupTags(ctx context.Context, conn cloudwatchlogsiface.CloudWatch return nil } -func (p *servicePackage) UpdateLogGroupTags(ctx context.Context, meta any, identifier string, oldTags interface{}, newTags interface{}) error { +func (p *servicePackage) UpdateLogGroupTags(ctx context.Context, meta any, identifier string, oldTags, newTags any) error { return UpdateLogGroupTags(ctx, meta.(*conns.AWSClient).LogsConn(), identifier, oldTags, newTags) } diff --git a/internal/service/logs/tags_gen.go b/internal/service/logs/tags_gen.go index c09f3ac86fb8..e19c7f3ccb29 100644 --- a/internal/service/logs/tags_gen.go +++ b/internal/service/logs/tags_gen.go @@ -29,6 +29,10 @@ func ListTags(ctx context.Context, conn cloudwatchlogsiface.CloudWatchLogsAPI, i return KeyValueTags(ctx, output.Tags), nil } +func (p *servicePackage) ListTags(ctx context.Context, meta any, identifier string) (tftags.KeyValueTags, error) { + return ListTags(ctx, meta.(*conns.AWSClient).LogsConn(), identifier) +} + // map[string]*string handling // Tags returns logs service tags. @@ -44,7 +48,8 @@ func KeyValueTags(ctx context.Context, tags map[string]*string) tftags.KeyValueT // UpdateTags updates logs 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 cloudwatchlogsiface.CloudWatchLogsAPI, identifier string, oldTagsMap interface{}, newTagsMap interface{}) error { + +func UpdateTags(ctx context.Context, conn cloudwatchlogsiface.CloudWatchLogsAPI, identifier string, oldTagsMap, newTagsMap any) error { oldTags := tftags.New(ctx, oldTagsMap) newTags := tftags.New(ctx, newTagsMap) @@ -77,6 +82,6 @@ func UpdateTags(ctx context.Context, conn cloudwatchlogsiface.CloudWatchLogsAPI, return nil } -func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags interface{}, newTags interface{}) error { +func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags, newTags any) error { return UpdateTags(ctx, meta.(*conns.AWSClient).LogsConn(), identifier, oldTags, newTags) } diff --git a/internal/service/mediaconnect/tags_gen.go b/internal/service/mediaconnect/tags_gen.go index 364ef7531536..723250493fb2 100644 --- a/internal/service/mediaconnect/tags_gen.go +++ b/internal/service/mediaconnect/tags_gen.go @@ -29,6 +29,10 @@ func ListTags(ctx context.Context, conn mediaconnectiface.MediaConnectAPI, ident return KeyValueTags(ctx, output.Tags), nil } +func (p *servicePackage) ListTags(ctx context.Context, meta any, identifier string) (tftags.KeyValueTags, error) { + return ListTags(ctx, meta.(*conns.AWSClient).MediaConnectConn(), identifier) +} + // map[string]*string handling // Tags returns mediaconnect service tags. @@ -44,7 +48,8 @@ func KeyValueTags(ctx context.Context, tags map[string]*string) tftags.KeyValueT // UpdateTags updates mediaconnect 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 mediaconnectiface.MediaConnectAPI, identifier string, oldTagsMap interface{}, newTagsMap interface{}) error { + +func UpdateTags(ctx context.Context, conn mediaconnectiface.MediaConnectAPI, identifier string, oldTagsMap, newTagsMap any) error { oldTags := tftags.New(ctx, oldTagsMap) newTags := tftags.New(ctx, newTagsMap) @@ -77,6 +82,6 @@ func UpdateTags(ctx context.Context, conn mediaconnectiface.MediaConnectAPI, ide return nil } -func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags interface{}, newTags interface{}) error { +func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags, newTags any) error { return UpdateTags(ctx, meta.(*conns.AWSClient).MediaConnectConn(), identifier, oldTags, newTags) } diff --git a/internal/service/mediaconvert/tags_gen.go b/internal/service/mediaconvert/tags_gen.go index 41d8473f3924..afc20b22106d 100644 --- a/internal/service/mediaconvert/tags_gen.go +++ b/internal/service/mediaconvert/tags_gen.go @@ -29,6 +29,10 @@ func ListTags(ctx context.Context, conn mediaconvertiface.MediaConvertAPI, ident return KeyValueTags(ctx, output.ResourceTags.Tags), nil } +func (p *servicePackage) ListTags(ctx context.Context, meta any, identifier string) (tftags.KeyValueTags, error) { + return ListTags(ctx, meta.(*conns.AWSClient).MediaConvertConn(), identifier) +} + // map[string]*string handling // Tags returns mediaconvert service tags. @@ -44,7 +48,8 @@ func KeyValueTags(ctx context.Context, tags map[string]*string) tftags.KeyValueT // UpdateTags updates mediaconvert 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 mediaconvertiface.MediaConvertAPI, identifier string, oldTagsMap interface{}, newTagsMap interface{}) error { + +func UpdateTags(ctx context.Context, conn mediaconvertiface.MediaConvertAPI, identifier string, oldTagsMap, newTagsMap any) error { oldTags := tftags.New(ctx, oldTagsMap) newTags := tftags.New(ctx, newTagsMap) @@ -77,6 +82,6 @@ func UpdateTags(ctx context.Context, conn mediaconvertiface.MediaConvertAPI, ide return nil } -func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags interface{}, newTags interface{}) error { +func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags, newTags any) error { return UpdateTags(ctx, meta.(*conns.AWSClient).MediaConvertConn(), identifier, oldTags, newTags) } diff --git a/internal/service/medialive/tags_gen.go b/internal/service/medialive/tags_gen.go index b54973fb046a..a2a09f83ee3f 100644 --- a/internal/service/medialive/tags_gen.go +++ b/internal/service/medialive/tags_gen.go @@ -42,7 +42,7 @@ func KeyValueTags(ctx context.Context, tags map[string]string) tftags.KeyValueTa // UpdateTags updates medialive 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 *medialive.Client, identifier string, oldTagsMap interface{}, newTagsMap interface{}) error { +func UpdateTags(ctx context.Context, conn *medialive.Client, identifier string, oldTagsMap, newTagsMap any) error { oldTags := tftags.New(ctx, oldTagsMap) newTags := tftags.New(ctx, newTagsMap) diff --git a/internal/service/mediapackage/tags_gen.go b/internal/service/mediapackage/tags_gen.go index 70105b56818d..9c3baedc6933 100644 --- a/internal/service/mediapackage/tags_gen.go +++ b/internal/service/mediapackage/tags_gen.go @@ -29,6 +29,10 @@ func ListTags(ctx context.Context, conn mediapackageiface.MediaPackageAPI, ident return KeyValueTags(ctx, output.Tags), nil } +func (p *servicePackage) ListTags(ctx context.Context, meta any, identifier string) (tftags.KeyValueTags, error) { + return ListTags(ctx, meta.(*conns.AWSClient).MediaPackageConn(), identifier) +} + // map[string]*string handling // Tags returns mediapackage service tags. @@ -44,7 +48,8 @@ func KeyValueTags(ctx context.Context, tags map[string]*string) tftags.KeyValueT // UpdateTags updates mediapackage 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 mediapackageiface.MediaPackageAPI, identifier string, oldTagsMap interface{}, newTagsMap interface{}) error { + +func UpdateTags(ctx context.Context, conn mediapackageiface.MediaPackageAPI, identifier string, oldTagsMap, newTagsMap any) error { oldTags := tftags.New(ctx, oldTagsMap) newTags := tftags.New(ctx, newTagsMap) @@ -77,6 +82,6 @@ func UpdateTags(ctx context.Context, conn mediapackageiface.MediaPackageAPI, ide return nil } -func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags interface{}, newTags interface{}) error { +func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags, newTags any) error { return UpdateTags(ctx, meta.(*conns.AWSClient).MediaPackageConn(), identifier, oldTags, newTags) } diff --git a/internal/service/mediastore/tags_gen.go b/internal/service/mediastore/tags_gen.go index 04c9802d5f95..2d3555db2c3b 100644 --- a/internal/service/mediastore/tags_gen.go +++ b/internal/service/mediastore/tags_gen.go @@ -29,6 +29,10 @@ func ListTags(ctx context.Context, conn mediastoreiface.MediaStoreAPI, identifie return KeyValueTags(ctx, output.Tags), nil } +func (p *servicePackage) ListTags(ctx context.Context, meta any, identifier string) (tftags.KeyValueTags, error) { + return ListTags(ctx, meta.(*conns.AWSClient).MediaStoreConn(), identifier) +} + // []*SERVICE.Tag handling // Tags returns mediastore service tags. @@ -61,7 +65,8 @@ func KeyValueTags(ctx context.Context, tags []*mediastore.Tag) tftags.KeyValueTa // UpdateTags updates mediastore 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 mediastoreiface.MediaStoreAPI, identifier string, oldTagsMap interface{}, newTagsMap interface{}) error { + +func UpdateTags(ctx context.Context, conn mediastoreiface.MediaStoreAPI, identifier string, oldTagsMap, newTagsMap any) error { oldTags := tftags.New(ctx, oldTagsMap) newTags := tftags.New(ctx, newTagsMap) @@ -94,6 +99,6 @@ func UpdateTags(ctx context.Context, conn mediastoreiface.MediaStoreAPI, identif return nil } -func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags interface{}, newTags interface{}) error { +func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags, newTags any) error { return UpdateTags(ctx, meta.(*conns.AWSClient).MediaStoreConn(), identifier, oldTags, newTags) } diff --git a/internal/service/memorydb/tags_gen.go b/internal/service/memorydb/tags_gen.go index 0c3afec43431..28d5ea721676 100644 --- a/internal/service/memorydb/tags_gen.go +++ b/internal/service/memorydb/tags_gen.go @@ -29,6 +29,10 @@ func ListTags(ctx context.Context, conn memorydbiface.MemoryDBAPI, identifier st return KeyValueTags(ctx, output.TagList), nil } +func (p *servicePackage) ListTags(ctx context.Context, meta any, identifier string) (tftags.KeyValueTags, error) { + return ListTags(ctx, meta.(*conns.AWSClient).MemoryDBConn(), identifier) +} + // []*SERVICE.Tag handling // Tags returns memorydb service tags. @@ -61,7 +65,8 @@ func KeyValueTags(ctx context.Context, tags []*memorydb.Tag) tftags.KeyValueTags // UpdateTags updates memorydb 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 memorydbiface.MemoryDBAPI, identifier string, oldTagsMap interface{}, newTagsMap interface{}) error { + +func UpdateTags(ctx context.Context, conn memorydbiface.MemoryDBAPI, identifier string, oldTagsMap, newTagsMap any) error { oldTags := tftags.New(ctx, oldTagsMap) newTags := tftags.New(ctx, newTagsMap) @@ -94,6 +99,6 @@ func UpdateTags(ctx context.Context, conn memorydbiface.MemoryDBAPI, identifier return nil } -func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags interface{}, newTags interface{}) error { +func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags, newTags any) error { return UpdateTags(ctx, meta.(*conns.AWSClient).MemoryDBConn(), identifier, oldTags, newTags) } diff --git a/internal/service/mq/tags_gen.go b/internal/service/mq/tags_gen.go index af6d9a793bd2..270095dddcaa 100644 --- a/internal/service/mq/tags_gen.go +++ b/internal/service/mq/tags_gen.go @@ -29,6 +29,10 @@ func ListTags(ctx context.Context, conn mqiface.MQAPI, identifier string) (tftag return KeyValueTags(ctx, output.Tags), nil } +func (p *servicePackage) ListTags(ctx context.Context, meta any, identifier string) (tftags.KeyValueTags, error) { + return ListTags(ctx, meta.(*conns.AWSClient).MQConn(), identifier) +} + // map[string]*string handling // Tags returns mq service tags. @@ -44,7 +48,8 @@ func KeyValueTags(ctx context.Context, tags map[string]*string) tftags.KeyValueT // UpdateTags updates mq 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 mqiface.MQAPI, identifier string, oldTagsMap interface{}, newTagsMap interface{}) error { + +func UpdateTags(ctx context.Context, conn mqiface.MQAPI, identifier string, oldTagsMap, newTagsMap any) error { oldTags := tftags.New(ctx, oldTagsMap) newTags := tftags.New(ctx, newTagsMap) @@ -77,6 +82,6 @@ func UpdateTags(ctx context.Context, conn mqiface.MQAPI, identifier string, oldT return nil } -func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags interface{}, newTags interface{}) error { +func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags, newTags any) error { return UpdateTags(ctx, meta.(*conns.AWSClient).MQConn(), identifier, oldTags, newTags) } diff --git a/internal/service/mwaa/tags_gen.go b/internal/service/mwaa/tags_gen.go index b658806e6b69..6f0fd50bcacd 100644 --- a/internal/service/mwaa/tags_gen.go +++ b/internal/service/mwaa/tags_gen.go @@ -27,7 +27,8 @@ func KeyValueTags(ctx context.Context, tags map[string]*string) tftags.KeyValueT // UpdateTags updates mwaa 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 mwaaiface.MWAAAPI, identifier string, oldTagsMap interface{}, newTagsMap interface{}) error { + +func UpdateTags(ctx context.Context, conn mwaaiface.MWAAAPI, identifier string, oldTagsMap, newTagsMap any) error { oldTags := tftags.New(ctx, oldTagsMap) newTags := tftags.New(ctx, newTagsMap) @@ -60,6 +61,6 @@ func UpdateTags(ctx context.Context, conn mwaaiface.MWAAAPI, identifier string, return nil } -func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags interface{}, newTags interface{}) error { +func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags, newTags any) error { return UpdateTags(ctx, meta.(*conns.AWSClient).MWAAConn(), identifier, oldTags, newTags) } diff --git a/internal/service/neptune/tags_gen.go b/internal/service/neptune/tags_gen.go index 86dfad23fa76..d95393332cfb 100644 --- a/internal/service/neptune/tags_gen.go +++ b/internal/service/neptune/tags_gen.go @@ -29,6 +29,10 @@ func ListTags(ctx context.Context, conn neptuneiface.NeptuneAPI, identifier stri return KeyValueTags(ctx, output.TagList), nil } +func (p *servicePackage) ListTags(ctx context.Context, meta any, identifier string) (tftags.KeyValueTags, error) { + return ListTags(ctx, meta.(*conns.AWSClient).NeptuneConn(), identifier) +} + // []*SERVICE.Tag handling // Tags returns neptune service tags. @@ -61,7 +65,8 @@ func KeyValueTags(ctx context.Context, tags []*neptune.Tag) tftags.KeyValueTags // UpdateTags updates neptune 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 neptuneiface.NeptuneAPI, identifier string, oldTagsMap interface{}, newTagsMap interface{}) error { + +func UpdateTags(ctx context.Context, conn neptuneiface.NeptuneAPI, identifier string, oldTagsMap, newTagsMap any) error { oldTags := tftags.New(ctx, oldTagsMap) newTags := tftags.New(ctx, newTagsMap) @@ -94,6 +99,6 @@ func UpdateTags(ctx context.Context, conn neptuneiface.NeptuneAPI, identifier st return nil } -func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags interface{}, newTags interface{}) error { +func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags, newTags any) error { return UpdateTags(ctx, meta.(*conns.AWSClient).NeptuneConn(), identifier, oldTags, newTags) } diff --git a/internal/service/networkfirewall/tags_gen.go b/internal/service/networkfirewall/tags_gen.go index 41c95257730f..f7475b220339 100644 --- a/internal/service/networkfirewall/tags_gen.go +++ b/internal/service/networkfirewall/tags_gen.go @@ -29,6 +29,10 @@ func ListTags(ctx context.Context, conn networkfirewalliface.NetworkFirewallAPI, return KeyValueTags(ctx, output.Tags), nil } +func (p *servicePackage) ListTags(ctx context.Context, meta any, identifier string) (tftags.KeyValueTags, error) { + return ListTags(ctx, meta.(*conns.AWSClient).NetworkFirewallConn(), identifier) +} + // []*SERVICE.Tag handling // Tags returns networkfirewall service tags. @@ -61,7 +65,8 @@ func KeyValueTags(ctx context.Context, tags []*networkfirewall.Tag) tftags.KeyVa // UpdateTags updates networkfirewall 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 networkfirewalliface.NetworkFirewallAPI, identifier string, oldTagsMap interface{}, newTagsMap interface{}) error { + +func UpdateTags(ctx context.Context, conn networkfirewalliface.NetworkFirewallAPI, identifier string, oldTagsMap, newTagsMap any) error { oldTags := tftags.New(ctx, oldTagsMap) newTags := tftags.New(ctx, newTagsMap) @@ -94,6 +99,6 @@ func UpdateTags(ctx context.Context, conn networkfirewalliface.NetworkFirewallAP return nil } -func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags interface{}, newTags interface{}) error { +func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags, newTags any) error { return UpdateTags(ctx, meta.(*conns.AWSClient).NetworkFirewallConn(), identifier, oldTags, newTags) } diff --git a/internal/service/networkmanager/tags_gen.go b/internal/service/networkmanager/tags_gen.go index 672666bc7108..c18ad3ab29bd 100644 --- a/internal/service/networkmanager/tags_gen.go +++ b/internal/service/networkmanager/tags_gen.go @@ -44,7 +44,8 @@ func KeyValueTags(ctx context.Context, tags []*networkmanager.Tag) tftags.KeyVal // UpdateTags updates networkmanager 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 networkmanageriface.NetworkManagerAPI, identifier string, oldTagsMap interface{}, newTagsMap interface{}) error { + +func UpdateTags(ctx context.Context, conn networkmanageriface.NetworkManagerAPI, identifier string, oldTagsMap, newTagsMap any) error { oldTags := tftags.New(ctx, oldTagsMap) newTags := tftags.New(ctx, newTagsMap) @@ -77,6 +78,6 @@ func UpdateTags(ctx context.Context, conn networkmanageriface.NetworkManagerAPI, return nil } -func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags interface{}, newTags interface{}) error { +func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags, newTags any) error { return UpdateTags(ctx, meta.(*conns.AWSClient).NetworkManagerConn(), identifier, oldTags, newTags) } diff --git a/internal/service/oam/tags_gen.go b/internal/service/oam/tags_gen.go index 363ce9a40438..420e93c99976 100644 --- a/internal/service/oam/tags_gen.go +++ b/internal/service/oam/tags_gen.go @@ -42,7 +42,7 @@ func KeyValueTags(ctx context.Context, tags map[string]string) tftags.KeyValueTa // UpdateTags updates oam 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 *oam.Client, identifier string, oldTagsMap interface{}, newTagsMap interface{}) error { +func UpdateTags(ctx context.Context, conn *oam.Client, identifier string, oldTagsMap, newTagsMap any) error { oldTags := tftags.New(ctx, oldTagsMap) newTags := tftags.New(ctx, newTagsMap) diff --git a/internal/service/opensearch/tags_gen.go b/internal/service/opensearch/tags_gen.go index 5f2c3812aa30..05baf5d94467 100644 --- a/internal/service/opensearch/tags_gen.go +++ b/internal/service/opensearch/tags_gen.go @@ -29,6 +29,10 @@ func ListTags(ctx context.Context, conn opensearchserviceiface.OpenSearchService return KeyValueTags(ctx, output.TagList), nil } +func (p *servicePackage) ListTags(ctx context.Context, meta any, identifier string) (tftags.KeyValueTags, error) { + return ListTags(ctx, meta.(*conns.AWSClient).OpenSearchConn(), identifier) +} + // []*SERVICE.Tag handling // Tags returns opensearch service tags. @@ -61,7 +65,8 @@ func KeyValueTags(ctx context.Context, tags []*opensearchservice.Tag) tftags.Key // UpdateTags updates opensearch 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 opensearchserviceiface.OpenSearchServiceAPI, identifier string, oldTagsMap interface{}, newTagsMap interface{}) error { + +func UpdateTags(ctx context.Context, conn opensearchserviceiface.OpenSearchServiceAPI, identifier string, oldTagsMap, newTagsMap any) error { oldTags := tftags.New(ctx, oldTagsMap) newTags := tftags.New(ctx, newTagsMap) @@ -94,6 +99,6 @@ func UpdateTags(ctx context.Context, conn opensearchserviceiface.OpenSearchServi return nil } -func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags interface{}, newTags interface{}) error { +func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags, newTags any) error { return UpdateTags(ctx, meta.(*conns.AWSClient).OpenSearchConn(), identifier, oldTags, newTags) } diff --git a/internal/service/opensearchserverless/tags_gen.go b/internal/service/opensearchserverless/tags_gen.go index 14d999862235..5a09a44333be 100644 --- a/internal/service/opensearchserverless/tags_gen.go +++ b/internal/service/opensearchserverless/tags_gen.go @@ -60,7 +60,7 @@ func KeyValueTags(ctx context.Context, tags []types.Tag) tftags.KeyValueTags { // UpdateTags updates opensearchserverless 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 *opensearchserverless.Client, identifier string, oldTagsMap interface{}, newTagsMap interface{}) error { +func UpdateTags(ctx context.Context, conn *opensearchserverless.Client, identifier string, oldTagsMap, newTagsMap any) error { oldTags := tftags.New(ctx, oldTagsMap) newTags := tftags.New(ctx, newTagsMap) diff --git a/internal/service/opsworks/tags_gen.go b/internal/service/opsworks/tags_gen.go index 29c9cc1a8396..3040c43d69b5 100644 --- a/internal/service/opsworks/tags_gen.go +++ b/internal/service/opsworks/tags_gen.go @@ -29,6 +29,10 @@ func ListTags(ctx context.Context, conn opsworksiface.OpsWorksAPI, identifier st return KeyValueTags(ctx, output.Tags), nil } +func (p *servicePackage) ListTags(ctx context.Context, meta any, identifier string) (tftags.KeyValueTags, error) { + return ListTags(ctx, meta.(*conns.AWSClient).OpsWorksConn(), identifier) +} + // map[string]*string handling // Tags returns opsworks service tags. @@ -44,7 +48,8 @@ func KeyValueTags(ctx context.Context, tags map[string]*string) tftags.KeyValueT // UpdateTags updates opsworks 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 opsworksiface.OpsWorksAPI, identifier string, oldTagsMap interface{}, newTagsMap interface{}) error { + +func UpdateTags(ctx context.Context, conn opsworksiface.OpsWorksAPI, identifier string, oldTagsMap, newTagsMap any) error { oldTags := tftags.New(ctx, oldTagsMap) newTags := tftags.New(ctx, newTagsMap) @@ -77,6 +82,6 @@ func UpdateTags(ctx context.Context, conn opsworksiface.OpsWorksAPI, identifier return nil } -func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags interface{}, newTags interface{}) error { +func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags, newTags any) error { return UpdateTags(ctx, meta.(*conns.AWSClient).OpsWorksConn(), identifier, oldTags, newTags) } diff --git a/internal/service/organizations/tags_gen.go b/internal/service/organizations/tags_gen.go index a18988225e5d..8563862c55aa 100644 --- a/internal/service/organizations/tags_gen.go +++ b/internal/service/organizations/tags_gen.go @@ -29,6 +29,10 @@ func ListTags(ctx context.Context, conn organizationsiface.OrganizationsAPI, ide return KeyValueTags(ctx, output.Tags), nil } +func (p *servicePackage) ListTags(ctx context.Context, meta any, identifier string) (tftags.KeyValueTags, error) { + return ListTags(ctx, meta.(*conns.AWSClient).OrganizationsConn(), identifier) +} + // []*SERVICE.Tag handling // Tags returns organizations service tags. @@ -61,7 +65,8 @@ func KeyValueTags(ctx context.Context, tags []*organizations.Tag) tftags.KeyValu // UpdateTags updates organizations 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 organizationsiface.OrganizationsAPI, identifier string, oldTagsMap interface{}, newTagsMap interface{}) error { + +func UpdateTags(ctx context.Context, conn organizationsiface.OrganizationsAPI, identifier string, oldTagsMap, newTagsMap any) error { oldTags := tftags.New(ctx, oldTagsMap) newTags := tftags.New(ctx, newTagsMap) @@ -94,6 +99,6 @@ func UpdateTags(ctx context.Context, conn organizationsiface.OrganizationsAPI, i return nil } -func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags interface{}, newTags interface{}) error { +func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags, newTags any) error { return UpdateTags(ctx, meta.(*conns.AWSClient).OrganizationsConn(), identifier, oldTags, newTags) } diff --git a/internal/service/pinpoint/tags_gen.go b/internal/service/pinpoint/tags_gen.go index 45d4e458ca4d..42a1cf943cbd 100644 --- a/internal/service/pinpoint/tags_gen.go +++ b/internal/service/pinpoint/tags_gen.go @@ -29,6 +29,10 @@ func ListTags(ctx context.Context, conn pinpointiface.PinpointAPI, identifier st return KeyValueTags(ctx, output.TagsModel.Tags), nil } +func (p *servicePackage) ListTags(ctx context.Context, meta any, identifier string) (tftags.KeyValueTags, error) { + return ListTags(ctx, meta.(*conns.AWSClient).PinpointConn(), identifier) +} + // map[string]*string handling // Tags returns pinpoint service tags. @@ -44,7 +48,8 @@ func KeyValueTags(ctx context.Context, tags map[string]*string) tftags.KeyValueT // UpdateTags updates pinpoint 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 pinpointiface.PinpointAPI, identifier string, oldTagsMap interface{}, newTagsMap interface{}) error { + +func UpdateTags(ctx context.Context, conn pinpointiface.PinpointAPI, identifier string, oldTagsMap, newTagsMap any) error { oldTags := tftags.New(ctx, oldTagsMap) newTags := tftags.New(ctx, newTagsMap) @@ -77,6 +82,6 @@ func UpdateTags(ctx context.Context, conn pinpointiface.PinpointAPI, identifier return nil } -func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags interface{}, newTags interface{}) error { +func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags, newTags any) error { return UpdateTags(ctx, meta.(*conns.AWSClient).PinpointConn(), identifier, oldTags, newTags) } diff --git a/internal/service/qldb/tags_gen.go b/internal/service/qldb/tags_gen.go index 7265f601db0a..ae1e9244d9bb 100644 --- a/internal/service/qldb/tags_gen.go +++ b/internal/service/qldb/tags_gen.go @@ -29,6 +29,10 @@ func ListTags(ctx context.Context, conn qldbiface.QLDBAPI, identifier string) (t return KeyValueTags(ctx, output.Tags), nil } +func (p *servicePackage) ListTags(ctx context.Context, meta any, identifier string) (tftags.KeyValueTags, error) { + return ListTags(ctx, meta.(*conns.AWSClient).QLDBConn(), identifier) +} + // map[string]*string handling // Tags returns qldb service tags. @@ -44,7 +48,8 @@ func KeyValueTags(ctx context.Context, tags map[string]*string) tftags.KeyValueT // UpdateTags updates qldb 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 qldbiface.QLDBAPI, identifier string, oldTagsMap interface{}, newTagsMap interface{}) error { + +func UpdateTags(ctx context.Context, conn qldbiface.QLDBAPI, identifier string, oldTagsMap, newTagsMap any) error { oldTags := tftags.New(ctx, oldTagsMap) newTags := tftags.New(ctx, newTagsMap) @@ -77,6 +82,6 @@ func UpdateTags(ctx context.Context, conn qldbiface.QLDBAPI, identifier string, return nil } -func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags interface{}, newTags interface{}) error { +func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags, newTags any) error { return UpdateTags(ctx, meta.(*conns.AWSClient).QLDBConn(), identifier, oldTags, newTags) } diff --git a/internal/service/quicksight/tags_gen.go b/internal/service/quicksight/tags_gen.go index 9ce98a17f78e..ec7b2916346b 100644 --- a/internal/service/quicksight/tags_gen.go +++ b/internal/service/quicksight/tags_gen.go @@ -29,6 +29,10 @@ func ListTags(ctx context.Context, conn quicksightiface.QuickSightAPI, identifie return KeyValueTags(ctx, output.Tags), nil } +func (p *servicePackage) ListTags(ctx context.Context, meta any, identifier string) (tftags.KeyValueTags, error) { + return ListTags(ctx, meta.(*conns.AWSClient).QuickSightConn(), identifier) +} + // []*SERVICE.Tag handling // Tags returns quicksight service tags. @@ -61,7 +65,8 @@ func KeyValueTags(ctx context.Context, tags []*quicksight.Tag) tftags.KeyValueTa // UpdateTags updates quicksight 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 quicksightiface.QuickSightAPI, identifier string, oldTagsMap interface{}, newTagsMap interface{}) error { + +func UpdateTags(ctx context.Context, conn quicksightiface.QuickSightAPI, identifier string, oldTagsMap, newTagsMap any) error { oldTags := tftags.New(ctx, oldTagsMap) newTags := tftags.New(ctx, newTagsMap) @@ -94,6 +99,6 @@ func UpdateTags(ctx context.Context, conn quicksightiface.QuickSightAPI, identif return nil } -func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags interface{}, newTags interface{}) error { +func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags, newTags any) error { return UpdateTags(ctx, meta.(*conns.AWSClient).QuickSightConn(), identifier, oldTags, newTags) } diff --git a/internal/service/ram/tags_gen.go b/internal/service/ram/tags_gen.go index e15d02ca9bb4..399c688f5cac 100644 --- a/internal/service/ram/tags_gen.go +++ b/internal/service/ram/tags_gen.go @@ -44,7 +44,8 @@ func KeyValueTags(ctx context.Context, tags []*ram.Tag) tftags.KeyValueTags { // UpdateTags updates ram 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 ramiface.RAMAPI, identifier string, oldTagsMap interface{}, newTagsMap interface{}) error { + +func UpdateTags(ctx context.Context, conn ramiface.RAMAPI, identifier string, oldTagsMap, newTagsMap any) error { oldTags := tftags.New(ctx, oldTagsMap) newTags := tftags.New(ctx, newTagsMap) @@ -77,6 +78,6 @@ func UpdateTags(ctx context.Context, conn ramiface.RAMAPI, identifier string, ol return nil } -func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags interface{}, newTags interface{}) error { +func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags, newTags any) error { return UpdateTags(ctx, meta.(*conns.AWSClient).RAMConn(), identifier, oldTags, newTags) } diff --git a/internal/service/rds/tags_gen.go b/internal/service/rds/tags_gen.go index 1cc6326a7471..c11103713933 100644 --- a/internal/service/rds/tags_gen.go +++ b/internal/service/rds/tags_gen.go @@ -29,6 +29,10 @@ func ListTags(ctx context.Context, conn rdsiface.RDSAPI, identifier string) (tft return KeyValueTags(ctx, output.TagList), nil } +func (p *servicePackage) ListTags(ctx context.Context, meta any, identifier string) (tftags.KeyValueTags, error) { + return ListTags(ctx, meta.(*conns.AWSClient).RDSConn(), identifier) +} + // []*SERVICE.Tag handling // Tags returns rds service tags. @@ -61,7 +65,8 @@ func KeyValueTags(ctx context.Context, tags []*rds.Tag) tftags.KeyValueTags { // UpdateTags updates rds 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 rdsiface.RDSAPI, identifier string, oldTagsMap interface{}, newTagsMap interface{}) error { + +func UpdateTags(ctx context.Context, conn rdsiface.RDSAPI, identifier string, oldTagsMap, newTagsMap any) error { oldTags := tftags.New(ctx, oldTagsMap) newTags := tftags.New(ctx, newTagsMap) @@ -94,6 +99,6 @@ func UpdateTags(ctx context.Context, conn rdsiface.RDSAPI, identifier string, ol return nil } -func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags interface{}, newTags interface{}) error { +func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags, newTags any) error { return UpdateTags(ctx, meta.(*conns.AWSClient).RDSConn(), identifier, oldTags, newTags) } diff --git a/internal/service/redshift/tags_gen.go b/internal/service/redshift/tags_gen.go index 9baf5808c415..d0f6589af562 100644 --- a/internal/service/redshift/tags_gen.go +++ b/internal/service/redshift/tags_gen.go @@ -44,7 +44,8 @@ func KeyValueTags(ctx context.Context, tags []*redshift.Tag) tftags.KeyValueTags // UpdateTags updates redshift 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 redshiftiface.RedshiftAPI, identifier string, oldTagsMap interface{}, newTagsMap interface{}) error { + +func UpdateTags(ctx context.Context, conn redshiftiface.RedshiftAPI, identifier string, oldTagsMap, newTagsMap any) error { oldTags := tftags.New(ctx, oldTagsMap) newTags := tftags.New(ctx, newTagsMap) @@ -77,6 +78,6 @@ func UpdateTags(ctx context.Context, conn redshiftiface.RedshiftAPI, identifier return nil } -func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags interface{}, newTags interface{}) error { +func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags, newTags any) error { return UpdateTags(ctx, meta.(*conns.AWSClient).RedshiftConn(), identifier, oldTags, newTags) } diff --git a/internal/service/redshiftserverless/tags_gen.go b/internal/service/redshiftserverless/tags_gen.go index 7c624e5734f7..b80e3812230c 100644 --- a/internal/service/redshiftserverless/tags_gen.go +++ b/internal/service/redshiftserverless/tags_gen.go @@ -29,6 +29,10 @@ func ListTags(ctx context.Context, conn redshiftserverlessiface.RedshiftServerle return KeyValueTags(ctx, output.Tags), nil } +func (p *servicePackage) ListTags(ctx context.Context, meta any, identifier string) (tftags.KeyValueTags, error) { + return ListTags(ctx, meta.(*conns.AWSClient).RedshiftServerlessConn(), identifier) +} + // []*SERVICE.Tag handling // Tags returns redshiftserverless service tags. @@ -61,7 +65,8 @@ func KeyValueTags(ctx context.Context, tags []*redshiftserverless.Tag) tftags.Ke // UpdateTags updates redshiftserverless 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 redshiftserverlessiface.RedshiftServerlessAPI, identifier string, oldTagsMap interface{}, newTagsMap interface{}) error { + +func UpdateTags(ctx context.Context, conn redshiftserverlessiface.RedshiftServerlessAPI, identifier string, oldTagsMap, newTagsMap any) error { oldTags := tftags.New(ctx, oldTagsMap) newTags := tftags.New(ctx, newTagsMap) @@ -94,6 +99,6 @@ func UpdateTags(ctx context.Context, conn redshiftserverlessiface.RedshiftServer return nil } -func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags interface{}, newTags interface{}) error { +func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags, newTags any) error { return UpdateTags(ctx, meta.(*conns.AWSClient).RedshiftServerlessConn(), identifier, oldTags, newTags) } diff --git a/internal/service/resourceexplorer2/tags_gen.go b/internal/service/resourceexplorer2/tags_gen.go index e4e63fa146ee..06d7e57b49ba 100644 --- a/internal/service/resourceexplorer2/tags_gen.go +++ b/internal/service/resourceexplorer2/tags_gen.go @@ -42,7 +42,7 @@ func KeyValueTags(ctx context.Context, tags map[string]string) tftags.KeyValueTa // UpdateTags updates resourceexplorer2 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 *resourceexplorer2.Client, identifier string, oldTagsMap interface{}, newTagsMap interface{}) error { +func UpdateTags(ctx context.Context, conn *resourceexplorer2.Client, identifier string, oldTagsMap, newTagsMap any) error { oldTags := tftags.New(ctx, oldTagsMap) newTags := tftags.New(ctx, newTagsMap) diff --git a/internal/service/resourcegroups/tags_gen.go b/internal/service/resourcegroups/tags_gen.go index 9a1807978af3..ab7006fdc5ab 100644 --- a/internal/service/resourcegroups/tags_gen.go +++ b/internal/service/resourcegroups/tags_gen.go @@ -29,6 +29,10 @@ func ListTags(ctx context.Context, conn resourcegroupsiface.ResourceGroupsAPI, i return KeyValueTags(ctx, output.Tags), nil } +func (p *servicePackage) ListTags(ctx context.Context, meta any, identifier string) (tftags.KeyValueTags, error) { + return ListTags(ctx, meta.(*conns.AWSClient).ResourceGroupsConn(), identifier) +} + // map[string]*string handling // Tags returns resourcegroups service tags. @@ -44,7 +48,8 @@ func KeyValueTags(ctx context.Context, tags map[string]*string) tftags.KeyValueT // UpdateTags updates resourcegroups 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 resourcegroupsiface.ResourceGroupsAPI, identifier string, oldTagsMap interface{}, newTagsMap interface{}) error { + +func UpdateTags(ctx context.Context, conn resourcegroupsiface.ResourceGroupsAPI, identifier string, oldTagsMap, newTagsMap any) error { oldTags := tftags.New(ctx, oldTagsMap) newTags := tftags.New(ctx, newTagsMap) @@ -77,6 +82,6 @@ func UpdateTags(ctx context.Context, conn resourcegroupsiface.ResourceGroupsAPI, return nil } -func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags interface{}, newTags interface{}) error { +func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags, newTags any) error { return UpdateTags(ctx, meta.(*conns.AWSClient).ResourceGroupsConn(), identifier, oldTags, newTags) } diff --git a/internal/service/rolesanywhere/tags_gen.go b/internal/service/rolesanywhere/tags_gen.go index 98ce07fd5d7a..d7d9b7b28dee 100644 --- a/internal/service/rolesanywhere/tags_gen.go +++ b/internal/service/rolesanywhere/tags_gen.go @@ -60,7 +60,7 @@ func KeyValueTags(ctx context.Context, tags []types.Tag) tftags.KeyValueTags { // UpdateTags updates rolesanywhere 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 *rolesanywhere.Client, identifier string, oldTagsMap interface{}, newTagsMap interface{}) error { +func UpdateTags(ctx context.Context, conn *rolesanywhere.Client, identifier string, oldTagsMap, newTagsMap any) error { oldTags := tftags.New(ctx, oldTagsMap) newTags := tftags.New(ctx, newTagsMap) diff --git a/internal/service/route53/tags_gen.go b/internal/service/route53/tags_gen.go index e3ef3c0ab931..5da708ad227d 100644 --- a/internal/service/route53/tags_gen.go +++ b/internal/service/route53/tags_gen.go @@ -15,7 +15,7 @@ import ( // ListTags lists route53 service tags. // The identifier is typically the Amazon Resource Name (ARN), although // it may also be a different identifier depending on the service. -func ListTags(ctx context.Context, conn route53iface.Route53API, identifier string, resourceType string) (tftags.KeyValueTags, error) { +func ListTags(ctx context.Context, conn route53iface.Route53API, identifier, resourceType string) (tftags.KeyValueTags, error) { input := &route53.ListTagsForResourceInput{ ResourceId: aws.String(identifier), ResourceType: aws.String(resourceType), @@ -30,6 +30,10 @@ func ListTags(ctx context.Context, conn route53iface.Route53API, identifier stri return KeyValueTags(ctx, output.ResourceTagSet.Tags), nil } +func (p *servicePackage) ListTags(ctx context.Context, meta any, identifier, resourceType string) (tftags.KeyValueTags, error) { + return ListTags(ctx, meta.(*conns.AWSClient).Route53Conn(), identifier, resourceType) +} + // []*SERVICE.Tag handling // Tags returns route53 service tags. @@ -62,7 +66,8 @@ func KeyValueTags(ctx context.Context, tags []*route53.Tag) tftags.KeyValueTags // UpdateTags updates route53 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 route53iface.Route53API, identifier string, resourceType string, oldTagsMap interface{}, newTagsMap interface{}) error { + +func UpdateTags(ctx context.Context, conn route53iface.Route53API, identifier, resourceType string, oldTagsMap, newTagsMap any) error { oldTags := tftags.New(ctx, oldTagsMap) newTags := tftags.New(ctx, newTagsMap) removedTags := oldTags.Removed(newTags) @@ -95,6 +100,6 @@ func UpdateTags(ctx context.Context, conn route53iface.Route53API, identifier st return nil } -func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, resourceType string, oldTags interface{}, newTags interface{}) error { +func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, resourceType string, oldTags, newTags any) error { return UpdateTags(ctx, meta.(*conns.AWSClient).Route53Conn(), identifier, resourceType, oldTags, newTags) } diff --git a/internal/service/route53domains/tags_gen.go b/internal/service/route53domains/tags_gen.go index 4b0beb0b5eea..8cd017b98ec9 100644 --- a/internal/service/route53domains/tags_gen.go +++ b/internal/service/route53domains/tags_gen.go @@ -17,7 +17,7 @@ import ( // This function will optimise the handling over ListTags, if possible. // The identifier is typically the Amazon Resource Name (ARN), although // it may also be a different identifier depending on the service. -func GetTag(ctx context.Context, conn *route53domains.Client, identifier string, key string) (*string, error) { +func GetTag(ctx context.Context, conn *route53domains.Client, identifier, key string) (*string, error) { listTags, err := ListTags(ctx, conn, identifier) if err != nil { @@ -80,7 +80,7 @@ func KeyValueTags(ctx context.Context, tags []types.Tag) tftags.KeyValueTags { // UpdateTags updates route53domains 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 *route53domains.Client, identifier string, oldTagsMap interface{}, newTagsMap interface{}) error { +func UpdateTags(ctx context.Context, conn *route53domains.Client, identifier string, oldTagsMap, newTagsMap any) error { oldTags := tftags.New(ctx, oldTagsMap) newTags := tftags.New(ctx, newTagsMap) diff --git a/internal/service/route53recoveryreadiness/tags_gen.go b/internal/service/route53recoveryreadiness/tags_gen.go index e01112225726..b6005e20b0d2 100644 --- a/internal/service/route53recoveryreadiness/tags_gen.go +++ b/internal/service/route53recoveryreadiness/tags_gen.go @@ -29,6 +29,10 @@ func ListTags(ctx context.Context, conn route53recoveryreadinessiface.Route53Rec return KeyValueTags(ctx, output.Tags), nil } +func (p *servicePackage) ListTags(ctx context.Context, meta any, identifier string) (tftags.KeyValueTags, error) { + return ListTags(ctx, meta.(*conns.AWSClient).Route53RecoveryReadinessConn(), identifier) +} + // map[string]*string handling // Tags returns route53recoveryreadiness service tags. @@ -44,7 +48,8 @@ func KeyValueTags(ctx context.Context, tags map[string]*string) tftags.KeyValueT // UpdateTags updates route53recoveryreadiness 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 route53recoveryreadinessiface.Route53RecoveryReadinessAPI, identifier string, oldTagsMap interface{}, newTagsMap interface{}) error { + +func UpdateTags(ctx context.Context, conn route53recoveryreadinessiface.Route53RecoveryReadinessAPI, identifier string, oldTagsMap, newTagsMap any) error { oldTags := tftags.New(ctx, oldTagsMap) newTags := tftags.New(ctx, newTagsMap) @@ -77,6 +82,6 @@ func UpdateTags(ctx context.Context, conn route53recoveryreadinessiface.Route53R return nil } -func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags interface{}, newTags interface{}) error { +func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags, newTags any) error { return UpdateTags(ctx, meta.(*conns.AWSClient).Route53RecoveryReadinessConn(), identifier, oldTags, newTags) } diff --git a/internal/service/route53resolver/tags_gen.go b/internal/service/route53resolver/tags_gen.go index d7f2645a392c..4d02a1e172c7 100644 --- a/internal/service/route53resolver/tags_gen.go +++ b/internal/service/route53resolver/tags_gen.go @@ -18,7 +18,7 @@ import ( // This function will optimise the handling over ListTags, if possible. // The identifier is typically the Amazon Resource Name (ARN), although // it may also be a different identifier depending on the service. -func GetTag(ctx context.Context, conn route53resolveriface.Route53ResolverAPI, identifier string, key string) (*string, error) { +func GetTag(ctx context.Context, conn route53resolveriface.Route53ResolverAPI, identifier, key string) (*string, error) { listTags, err := ListTags(ctx, conn, identifier) if err != nil { @@ -49,6 +49,10 @@ func ListTags(ctx context.Context, conn route53resolveriface.Route53ResolverAPI, return KeyValueTags(ctx, output.Tags), nil } +func (p *servicePackage) ListTags(ctx context.Context, meta any, identifier string) (tftags.KeyValueTags, error) { + return ListTags(ctx, meta.(*conns.AWSClient).Route53ResolverConn(), identifier) +} + // []*SERVICE.Tag handling // Tags returns route53resolver service tags. @@ -81,7 +85,8 @@ func KeyValueTags(ctx context.Context, tags []*route53resolver.Tag) tftags.KeyVa // UpdateTags updates route53resolver 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 route53resolveriface.Route53ResolverAPI, identifier string, oldTagsMap interface{}, newTagsMap interface{}) error { + +func UpdateTags(ctx context.Context, conn route53resolveriface.Route53ResolverAPI, identifier string, oldTagsMap, newTagsMap any) error { oldTags := tftags.New(ctx, oldTagsMap) newTags := tftags.New(ctx, newTagsMap) @@ -114,6 +119,6 @@ func UpdateTags(ctx context.Context, conn route53resolveriface.Route53ResolverAP return nil } -func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags interface{}, newTags interface{}) error { +func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags, newTags any) error { return UpdateTags(ctx, meta.(*conns.AWSClient).Route53ResolverConn(), identifier, oldTags, newTags) } diff --git a/internal/service/rum/tags_gen.go b/internal/service/rum/tags_gen.go index 5eafac2f18fe..55042daf6f20 100644 --- a/internal/service/rum/tags_gen.go +++ b/internal/service/rum/tags_gen.go @@ -27,7 +27,8 @@ func KeyValueTags(ctx context.Context, tags map[string]*string) tftags.KeyValueT // UpdateTags updates rum 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 cloudwatchrumiface.CloudWatchRUMAPI, identifier string, oldTagsMap interface{}, newTagsMap interface{}) error { + +func UpdateTags(ctx context.Context, conn cloudwatchrumiface.CloudWatchRUMAPI, identifier string, oldTagsMap, newTagsMap any) error { oldTags := tftags.New(ctx, oldTagsMap) newTags := tftags.New(ctx, newTagsMap) @@ -60,6 +61,6 @@ func UpdateTags(ctx context.Context, conn cloudwatchrumiface.CloudWatchRUMAPI, i return nil } -func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags interface{}, newTags interface{}) error { +func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags, newTags any) error { return UpdateTags(ctx, meta.(*conns.AWSClient).RUMConn(), identifier, oldTags, newTags) } diff --git a/internal/service/sagemaker/tags_gen.go b/internal/service/sagemaker/tags_gen.go index d435bd9f079e..7b0ff8bff630 100644 --- a/internal/service/sagemaker/tags_gen.go +++ b/internal/service/sagemaker/tags_gen.go @@ -29,6 +29,10 @@ func ListTags(ctx context.Context, conn sagemakeriface.SageMakerAPI, identifier return KeyValueTags(ctx, output.Tags), nil } +func (p *servicePackage) ListTags(ctx context.Context, meta any, identifier string) (tftags.KeyValueTags, error) { + return ListTags(ctx, meta.(*conns.AWSClient).SageMakerConn(), identifier) +} + // []*SERVICE.Tag handling // Tags returns sagemaker service tags. @@ -61,7 +65,8 @@ func KeyValueTags(ctx context.Context, tags []*sagemaker.Tag) tftags.KeyValueTag // UpdateTags updates sagemaker 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 sagemakeriface.SageMakerAPI, identifier string, oldTagsMap interface{}, newTagsMap interface{}) error { + +func UpdateTags(ctx context.Context, conn sagemakeriface.SageMakerAPI, identifier string, oldTagsMap, newTagsMap any) error { oldTags := tftags.New(ctx, oldTagsMap) newTags := tftags.New(ctx, newTagsMap) @@ -94,6 +99,6 @@ func UpdateTags(ctx context.Context, conn sagemakeriface.SageMakerAPI, identifie return nil } -func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags interface{}, newTags interface{}) error { +func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags, newTags any) error { return UpdateTags(ctx, meta.(*conns.AWSClient).SageMakerConn(), identifier, oldTags, newTags) } diff --git a/internal/service/scheduler/tags_gen.go b/internal/service/scheduler/tags_gen.go index 52d4cd4c9efe..c66155b355f3 100644 --- a/internal/service/scheduler/tags_gen.go +++ b/internal/service/scheduler/tags_gen.go @@ -60,7 +60,7 @@ func KeyValueTags(ctx context.Context, tags []types.Tag) tftags.KeyValueTags { // UpdateTags updates scheduler 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 *scheduler.Client, identifier string, oldTagsMap interface{}, newTagsMap interface{}) error { +func UpdateTags(ctx context.Context, conn *scheduler.Client, identifier string, oldTagsMap, newTagsMap any) error { oldTags := tftags.New(ctx, oldTagsMap) newTags := tftags.New(ctx, newTagsMap) diff --git a/internal/service/schemas/tags_gen.go b/internal/service/schemas/tags_gen.go index 91f34eb9da5b..cbaf1e1b3c8d 100644 --- a/internal/service/schemas/tags_gen.go +++ b/internal/service/schemas/tags_gen.go @@ -29,6 +29,10 @@ func ListTags(ctx context.Context, conn schemasiface.SchemasAPI, identifier stri return KeyValueTags(ctx, output.Tags), nil } +func (p *servicePackage) ListTags(ctx context.Context, meta any, identifier string) (tftags.KeyValueTags, error) { + return ListTags(ctx, meta.(*conns.AWSClient).SchemasConn(), identifier) +} + // map[string]*string handling // Tags returns schemas service tags. @@ -44,7 +48,8 @@ func KeyValueTags(ctx context.Context, tags map[string]*string) tftags.KeyValueT // UpdateTags updates schemas 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 schemasiface.SchemasAPI, identifier string, oldTagsMap interface{}, newTagsMap interface{}) error { + +func UpdateTags(ctx context.Context, conn schemasiface.SchemasAPI, identifier string, oldTagsMap, newTagsMap any) error { oldTags := tftags.New(ctx, oldTagsMap) newTags := tftags.New(ctx, newTagsMap) @@ -77,6 +82,6 @@ func UpdateTags(ctx context.Context, conn schemasiface.SchemasAPI, identifier st return nil } -func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags interface{}, newTags interface{}) error { +func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags, newTags any) error { return UpdateTags(ctx, meta.(*conns.AWSClient).SchemasConn(), identifier, oldTags, newTags) } diff --git a/internal/service/secretsmanager/tags_gen.go b/internal/service/secretsmanager/tags_gen.go index 060966486ead..b691b260e8ba 100644 --- a/internal/service/secretsmanager/tags_gen.go +++ b/internal/service/secretsmanager/tags_gen.go @@ -44,7 +44,8 @@ func KeyValueTags(ctx context.Context, tags []*secretsmanager.Tag) tftags.KeyVal // UpdateTags updates secretsmanager 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 secretsmanageriface.SecretsManagerAPI, identifier string, oldTagsMap interface{}, newTagsMap interface{}) error { + +func UpdateTags(ctx context.Context, conn secretsmanageriface.SecretsManagerAPI, identifier string, oldTagsMap, newTagsMap any) error { oldTags := tftags.New(ctx, oldTagsMap) newTags := tftags.New(ctx, newTagsMap) @@ -77,6 +78,6 @@ func UpdateTags(ctx context.Context, conn secretsmanageriface.SecretsManagerAPI, return nil } -func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags interface{}, newTags interface{}) error { +func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags, newTags any) error { return UpdateTags(ctx, meta.(*conns.AWSClient).SecretsManagerConn(), identifier, oldTags, newTags) } diff --git a/internal/service/securityhub/tags_gen.go b/internal/service/securityhub/tags_gen.go index c7a9046ccf0b..e2e7bf04e3f2 100644 --- a/internal/service/securityhub/tags_gen.go +++ b/internal/service/securityhub/tags_gen.go @@ -29,6 +29,10 @@ func ListTags(ctx context.Context, conn securityhubiface.SecurityHubAPI, identif return KeyValueTags(ctx, output.Tags), nil } +func (p *servicePackage) ListTags(ctx context.Context, meta any, identifier string) (tftags.KeyValueTags, error) { + return ListTags(ctx, meta.(*conns.AWSClient).SecurityHubConn(), identifier) +} + // map[string]*string handling // Tags returns securityhub service tags. @@ -44,7 +48,8 @@ func KeyValueTags(ctx context.Context, tags map[string]*string) tftags.KeyValueT // UpdateTags updates securityhub 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 securityhubiface.SecurityHubAPI, identifier string, oldTagsMap interface{}, newTagsMap interface{}) error { + +func UpdateTags(ctx context.Context, conn securityhubiface.SecurityHubAPI, identifier string, oldTagsMap, newTagsMap any) error { oldTags := tftags.New(ctx, oldTagsMap) newTags := tftags.New(ctx, newTagsMap) @@ -77,6 +82,6 @@ func UpdateTags(ctx context.Context, conn securityhubiface.SecurityHubAPI, ident return nil } -func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags interface{}, newTags interface{}) error { +func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags, newTags any) error { return UpdateTags(ctx, meta.(*conns.AWSClient).SecurityHubConn(), identifier, oldTags, newTags) } diff --git a/internal/service/servicediscovery/tags_gen.go b/internal/service/servicediscovery/tags_gen.go index d5e9b738b4b6..638ffa314abb 100644 --- a/internal/service/servicediscovery/tags_gen.go +++ b/internal/service/servicediscovery/tags_gen.go @@ -29,6 +29,10 @@ func ListTags(ctx context.Context, conn servicediscoveryiface.ServiceDiscoveryAP return KeyValueTags(ctx, output.Tags), nil } +func (p *servicePackage) ListTags(ctx context.Context, meta any, identifier string) (tftags.KeyValueTags, error) { + return ListTags(ctx, meta.(*conns.AWSClient).ServiceDiscoveryConn(), identifier) +} + // []*SERVICE.Tag handling // Tags returns servicediscovery service tags. @@ -61,7 +65,8 @@ func KeyValueTags(ctx context.Context, tags []*servicediscovery.Tag) tftags.KeyV // UpdateTags updates servicediscovery 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 servicediscoveryiface.ServiceDiscoveryAPI, identifier string, oldTagsMap interface{}, newTagsMap interface{}) error { + +func UpdateTags(ctx context.Context, conn servicediscoveryiface.ServiceDiscoveryAPI, identifier string, oldTagsMap, newTagsMap any) error { oldTags := tftags.New(ctx, oldTagsMap) newTags := tftags.New(ctx, newTagsMap) @@ -94,6 +99,6 @@ func UpdateTags(ctx context.Context, conn servicediscoveryiface.ServiceDiscovery return nil } -func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags interface{}, newTags interface{}) error { +func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags, newTags any) error { return UpdateTags(ctx, meta.(*conns.AWSClient).ServiceDiscoveryConn(), identifier, oldTags, newTags) } diff --git a/internal/service/sesv2/tags_gen.go b/internal/service/sesv2/tags_gen.go index c63811411a6e..ec2747c21fd1 100644 --- a/internal/service/sesv2/tags_gen.go +++ b/internal/service/sesv2/tags_gen.go @@ -60,7 +60,7 @@ func KeyValueTags(ctx context.Context, tags []types.Tag) tftags.KeyValueTags { // UpdateTags updates sesv2 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 *sesv2.Client, identifier string, oldTagsMap interface{}, newTagsMap interface{}) error { +func UpdateTags(ctx context.Context, conn *sesv2.Client, identifier string, oldTagsMap, newTagsMap any) error { oldTags := tftags.New(ctx, oldTagsMap) newTags := tftags.New(ctx, newTagsMap) diff --git a/internal/service/sfn/tags_gen.go b/internal/service/sfn/tags_gen.go index e6f3568b6643..ef3a26678151 100644 --- a/internal/service/sfn/tags_gen.go +++ b/internal/service/sfn/tags_gen.go @@ -29,6 +29,10 @@ func ListTags(ctx context.Context, conn sfniface.SFNAPI, identifier string) (tft return KeyValueTags(ctx, output.Tags), nil } +func (p *servicePackage) ListTags(ctx context.Context, meta any, identifier string) (tftags.KeyValueTags, error) { + return ListTags(ctx, meta.(*conns.AWSClient).SFNConn(), identifier) +} + // []*SERVICE.Tag handling // Tags returns sfn service tags. @@ -61,7 +65,8 @@ func KeyValueTags(ctx context.Context, tags []*sfn.Tag) tftags.KeyValueTags { // UpdateTags updates sfn 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 sfniface.SFNAPI, identifier string, oldTagsMap interface{}, newTagsMap interface{}) error { + +func UpdateTags(ctx context.Context, conn sfniface.SFNAPI, identifier string, oldTagsMap, newTagsMap any) error { oldTags := tftags.New(ctx, oldTagsMap) newTags := tftags.New(ctx, newTagsMap) @@ -94,6 +99,6 @@ func UpdateTags(ctx context.Context, conn sfniface.SFNAPI, identifier string, ol return nil } -func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags interface{}, newTags interface{}) error { +func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags, newTags any) error { return UpdateTags(ctx, meta.(*conns.AWSClient).SFNConn(), identifier, oldTags, newTags) } diff --git a/internal/service/shield/tags_gen.go b/internal/service/shield/tags_gen.go index 875851e93f58..de5ac00f1f9c 100644 --- a/internal/service/shield/tags_gen.go +++ b/internal/service/shield/tags_gen.go @@ -29,6 +29,10 @@ func ListTags(ctx context.Context, conn shieldiface.ShieldAPI, identifier string return KeyValueTags(ctx, output.Tags), nil } +func (p *servicePackage) ListTags(ctx context.Context, meta any, identifier string) (tftags.KeyValueTags, error) { + return ListTags(ctx, meta.(*conns.AWSClient).ShieldConn(), identifier) +} + // []*SERVICE.Tag handling // Tags returns shield service tags. @@ -61,7 +65,8 @@ func KeyValueTags(ctx context.Context, tags []*shield.Tag) tftags.KeyValueTags { // UpdateTags updates shield 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 shieldiface.ShieldAPI, identifier string, oldTagsMap interface{}, newTagsMap interface{}) error { + +func UpdateTags(ctx context.Context, conn shieldiface.ShieldAPI, identifier string, oldTagsMap, newTagsMap any) error { oldTags := tftags.New(ctx, oldTagsMap) newTags := tftags.New(ctx, newTagsMap) @@ -94,6 +99,6 @@ func UpdateTags(ctx context.Context, conn shieldiface.ShieldAPI, identifier stri return nil } -func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags interface{}, newTags interface{}) error { +func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags, newTags any) error { return UpdateTags(ctx, meta.(*conns.AWSClient).ShieldConn(), identifier, oldTags, newTags) } diff --git a/internal/service/signer/tags_gen.go b/internal/service/signer/tags_gen.go index 01fbc20b6fea..0eece1ae591c 100644 --- a/internal/service/signer/tags_gen.go +++ b/internal/service/signer/tags_gen.go @@ -29,6 +29,10 @@ func ListTags(ctx context.Context, conn signeriface.SignerAPI, identifier string return KeyValueTags(ctx, output.Tags), nil } +func (p *servicePackage) ListTags(ctx context.Context, meta any, identifier string) (tftags.KeyValueTags, error) { + return ListTags(ctx, meta.(*conns.AWSClient).SignerConn(), identifier) +} + // map[string]*string handling // Tags returns signer service tags. @@ -44,7 +48,8 @@ func KeyValueTags(ctx context.Context, tags map[string]*string) tftags.KeyValueT // UpdateTags updates signer 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 signeriface.SignerAPI, identifier string, oldTagsMap interface{}, newTagsMap interface{}) error { + +func UpdateTags(ctx context.Context, conn signeriface.SignerAPI, identifier string, oldTagsMap, newTagsMap any) error { oldTags := tftags.New(ctx, oldTagsMap) newTags := tftags.New(ctx, newTagsMap) @@ -77,6 +82,6 @@ func UpdateTags(ctx context.Context, conn signeriface.SignerAPI, identifier stri return nil } -func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags interface{}, newTags interface{}) error { +func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags, newTags any) error { return UpdateTags(ctx, meta.(*conns.AWSClient).SignerConn(), identifier, oldTags, newTags) } diff --git a/internal/service/sns/tags_gen.go b/internal/service/sns/tags_gen.go index c8fbe83558f8..37f6c1a12ede 100644 --- a/internal/service/sns/tags_gen.go +++ b/internal/service/sns/tags_gen.go @@ -29,6 +29,10 @@ func ListTags(ctx context.Context, conn snsiface.SNSAPI, identifier string) (tft return KeyValueTags(ctx, output.Tags), nil } +func (p *servicePackage) ListTags(ctx context.Context, meta any, identifier string) (tftags.KeyValueTags, error) { + return ListTags(ctx, meta.(*conns.AWSClient).SNSConn(), identifier) +} + // []*SERVICE.Tag handling // Tags returns sns service tags. @@ -61,7 +65,8 @@ func KeyValueTags(ctx context.Context, tags []*sns.Tag) tftags.KeyValueTags { // UpdateTags updates sns 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 snsiface.SNSAPI, identifier string, oldTagsMap interface{}, newTagsMap interface{}) error { + +func UpdateTags(ctx context.Context, conn snsiface.SNSAPI, identifier string, oldTagsMap, newTagsMap any) error { oldTags := tftags.New(ctx, oldTagsMap) newTags := tftags.New(ctx, newTagsMap) @@ -94,6 +99,6 @@ func UpdateTags(ctx context.Context, conn snsiface.SNSAPI, identifier string, ol return nil } -func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags interface{}, newTags interface{}) error { +func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags, newTags any) error { return UpdateTags(ctx, meta.(*conns.AWSClient).SNSConn(), identifier, oldTags, newTags) } diff --git a/internal/service/sqs/tags_gen.go b/internal/service/sqs/tags_gen.go index 13a768c9ee39..6eec1929353d 100644 --- a/internal/service/sqs/tags_gen.go +++ b/internal/service/sqs/tags_gen.go @@ -29,6 +29,10 @@ func ListTags(ctx context.Context, conn sqsiface.SQSAPI, identifier string) (tft return KeyValueTags(ctx, output.Tags), nil } +func (p *servicePackage) ListTags(ctx context.Context, meta any, identifier string) (tftags.KeyValueTags, error) { + return ListTags(ctx, meta.(*conns.AWSClient).SQSConn(), identifier) +} + // map[string]*string handling // Tags returns sqs service tags. @@ -44,7 +48,8 @@ func KeyValueTags(ctx context.Context, tags map[string]*string) tftags.KeyValueT // UpdateTags updates sqs 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 sqsiface.SQSAPI, identifier string, oldTagsMap interface{}, newTagsMap interface{}) error { + +func UpdateTags(ctx context.Context, conn sqsiface.SQSAPI, identifier string, oldTagsMap, newTagsMap any) error { oldTags := tftags.New(ctx, oldTagsMap) newTags := tftags.New(ctx, newTagsMap) @@ -77,6 +82,6 @@ func UpdateTags(ctx context.Context, conn sqsiface.SQSAPI, identifier string, ol return nil } -func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags interface{}, newTags interface{}) error { +func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags, newTags any) error { return UpdateTags(ctx, meta.(*conns.AWSClient).SQSConn(), identifier, oldTags, newTags) } diff --git a/internal/service/ssm/tags_gen.go b/internal/service/ssm/tags_gen.go index a12b059477f5..96dd062b6314 100644 --- a/internal/service/ssm/tags_gen.go +++ b/internal/service/ssm/tags_gen.go @@ -15,7 +15,7 @@ import ( // ListTags lists ssm service tags. // The identifier is typically the Amazon Resource Name (ARN), although // it may also be a different identifier depending on the service. -func ListTags(ctx context.Context, conn ssmiface.SSMAPI, identifier string, resourceType string) (tftags.KeyValueTags, error) { +func ListTags(ctx context.Context, conn ssmiface.SSMAPI, identifier, resourceType string) (tftags.KeyValueTags, error) { input := &ssm.ListTagsForResourceInput{ ResourceId: aws.String(identifier), ResourceType: aws.String(resourceType), @@ -30,6 +30,10 @@ func ListTags(ctx context.Context, conn ssmiface.SSMAPI, identifier string, reso return KeyValueTags(ctx, output.TagList), nil } +func (p *servicePackage) ListTags(ctx context.Context, meta any, identifier, resourceType string) (tftags.KeyValueTags, error) { + return ListTags(ctx, meta.(*conns.AWSClient).SSMConn(), identifier, resourceType) +} + // []*SERVICE.Tag handling // Tags returns ssm service tags. @@ -62,7 +66,8 @@ func KeyValueTags(ctx context.Context, tags []*ssm.Tag) tftags.KeyValueTags { // UpdateTags updates ssm 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 ssmiface.SSMAPI, identifier string, resourceType string, oldTagsMap interface{}, newTagsMap interface{}) error { + +func UpdateTags(ctx context.Context, conn ssmiface.SSMAPI, identifier, resourceType string, oldTagsMap, newTagsMap any) error { oldTags := tftags.New(ctx, oldTagsMap) newTags := tftags.New(ctx, newTagsMap) @@ -97,6 +102,6 @@ func UpdateTags(ctx context.Context, conn ssmiface.SSMAPI, identifier string, re return nil } -func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, resourceType string, oldTags interface{}, newTags interface{}) error { +func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, resourceType string, oldTags, newTags any) error { return UpdateTags(ctx, meta.(*conns.AWSClient).SSMConn(), identifier, resourceType, oldTags, newTags) } diff --git a/internal/service/ssoadmin/tags_gen.go b/internal/service/ssoadmin/tags_gen.go index 43ab5845fcbc..a72f99e43af3 100644 --- a/internal/service/ssoadmin/tags_gen.go +++ b/internal/service/ssoadmin/tags_gen.go @@ -15,7 +15,7 @@ import ( // ListTags lists ssoadmin service tags. // The identifier is typically the Amazon Resource Name (ARN), although // it may also be a different identifier depending on the service. -func ListTags(ctx context.Context, conn ssoadminiface.SSOAdminAPI, identifier string, resourceType string) (tftags.KeyValueTags, error) { +func ListTags(ctx context.Context, conn ssoadminiface.SSOAdminAPI, identifier, resourceType string) (tftags.KeyValueTags, error) { input := &ssoadmin.ListTagsForResourceInput{ ResourceArn: aws.String(identifier), InstanceArn: aws.String(resourceType), @@ -30,6 +30,10 @@ func ListTags(ctx context.Context, conn ssoadminiface.SSOAdminAPI, identifier st return KeyValueTags(ctx, output.Tags), nil } +func (p *servicePackage) ListTags(ctx context.Context, meta any, identifier, resourceType string) (tftags.KeyValueTags, error) { + return ListTags(ctx, meta.(*conns.AWSClient).SSOAdminConn(), identifier, resourceType) +} + // []*SERVICE.Tag handling // Tags returns ssoadmin service tags. @@ -62,7 +66,8 @@ func KeyValueTags(ctx context.Context, tags []*ssoadmin.Tag) tftags.KeyValueTags // UpdateTags updates ssoadmin 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 ssoadminiface.SSOAdminAPI, identifier string, resourceType string, oldTagsMap interface{}, newTagsMap interface{}) error { + +func UpdateTags(ctx context.Context, conn ssoadminiface.SSOAdminAPI, identifier, resourceType string, oldTagsMap, newTagsMap any) error { oldTags := tftags.New(ctx, oldTagsMap) newTags := tftags.New(ctx, newTagsMap) @@ -97,6 +102,6 @@ func UpdateTags(ctx context.Context, conn ssoadminiface.SSOAdminAPI, identifier return nil } -func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, resourceType string, oldTags interface{}, newTags interface{}) error { +func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, resourceType string, oldTags, newTags any) error { return UpdateTags(ctx, meta.(*conns.AWSClient).SSOAdminConn(), identifier, resourceType, oldTags, newTags) } diff --git a/internal/service/storagegateway/tags_gen.go b/internal/service/storagegateway/tags_gen.go index a3794a914edf..74066e3cec97 100644 --- a/internal/service/storagegateway/tags_gen.go +++ b/internal/service/storagegateway/tags_gen.go @@ -29,6 +29,10 @@ func ListTags(ctx context.Context, conn storagegatewayiface.StorageGatewayAPI, i return KeyValueTags(ctx, output.Tags), nil } +func (p *servicePackage) ListTags(ctx context.Context, meta any, identifier string) (tftags.KeyValueTags, error) { + return ListTags(ctx, meta.(*conns.AWSClient).StorageGatewayConn(), identifier) +} + // []*SERVICE.Tag handling // Tags returns storagegateway service tags. @@ -61,7 +65,8 @@ func KeyValueTags(ctx context.Context, tags []*storagegateway.Tag) tftags.KeyVal // UpdateTags updates storagegateway 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 storagegatewayiface.StorageGatewayAPI, identifier string, oldTagsMap interface{}, newTagsMap interface{}) error { + +func UpdateTags(ctx context.Context, conn storagegatewayiface.StorageGatewayAPI, identifier string, oldTagsMap, newTagsMap any) error { oldTags := tftags.New(ctx, oldTagsMap) newTags := tftags.New(ctx, newTagsMap) @@ -94,6 +99,6 @@ func UpdateTags(ctx context.Context, conn storagegatewayiface.StorageGatewayAPI, return nil } -func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags interface{}, newTags interface{}) error { +func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags, newTags any) error { return UpdateTags(ctx, meta.(*conns.AWSClient).StorageGatewayConn(), identifier, oldTags, newTags) } diff --git a/internal/service/swf/tags_gen.go b/internal/service/swf/tags_gen.go index 4e3d683ba981..f9d507b9f9ea 100644 --- a/internal/service/swf/tags_gen.go +++ b/internal/service/swf/tags_gen.go @@ -29,6 +29,10 @@ func ListTags(ctx context.Context, conn swfiface.SWFAPI, identifier string) (tft return KeyValueTags(ctx, output.Tags), nil } +func (p *servicePackage) ListTags(ctx context.Context, meta any, identifier string) (tftags.KeyValueTags, error) { + return ListTags(ctx, meta.(*conns.AWSClient).SWFConn(), identifier) +} + // []*SERVICE.Tag handling // Tags returns swf service tags. @@ -61,7 +65,8 @@ func KeyValueTags(ctx context.Context, tags []*swf.ResourceTag) tftags.KeyValueT // UpdateTags updates swf 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 swfiface.SWFAPI, identifier string, oldTagsMap interface{}, newTagsMap interface{}) error { + +func UpdateTags(ctx context.Context, conn swfiface.SWFAPI, identifier string, oldTagsMap, newTagsMap any) error { oldTags := tftags.New(ctx, oldTagsMap) newTags := tftags.New(ctx, newTagsMap) @@ -94,6 +99,6 @@ func UpdateTags(ctx context.Context, conn swfiface.SWFAPI, identifier string, ol return nil } -func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags interface{}, newTags interface{}) error { +func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags, newTags any) error { return UpdateTags(ctx, meta.(*conns.AWSClient).SWFConn(), identifier, oldTags, newTags) } diff --git a/internal/service/synthetics/tags_gen.go b/internal/service/synthetics/tags_gen.go index 1c1d333c2895..41c4659f5a6d 100644 --- a/internal/service/synthetics/tags_gen.go +++ b/internal/service/synthetics/tags_gen.go @@ -27,7 +27,8 @@ func KeyValueTags(ctx context.Context, tags map[string]*string) tftags.KeyValueT // UpdateTags updates synthetics 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 syntheticsiface.SyntheticsAPI, identifier string, oldTagsMap interface{}, newTagsMap interface{}) error { + +func UpdateTags(ctx context.Context, conn syntheticsiface.SyntheticsAPI, identifier string, oldTagsMap, newTagsMap any) error { oldTags := tftags.New(ctx, oldTagsMap) newTags := tftags.New(ctx, newTagsMap) @@ -60,6 +61,6 @@ func UpdateTags(ctx context.Context, conn syntheticsiface.SyntheticsAPI, identif return nil } -func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags interface{}, newTags interface{}) error { +func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags, newTags any) error { return UpdateTags(ctx, meta.(*conns.AWSClient).SyntheticsConn(), identifier, oldTags, newTags) } diff --git a/internal/service/timestreamwrite/tags_gen.go b/internal/service/timestreamwrite/tags_gen.go index d4218ea7eb7f..db881f071229 100644 --- a/internal/service/timestreamwrite/tags_gen.go +++ b/internal/service/timestreamwrite/tags_gen.go @@ -29,6 +29,10 @@ func ListTags(ctx context.Context, conn timestreamwriteiface.TimestreamWriteAPI, return KeyValueTags(ctx, output.Tags), nil } +func (p *servicePackage) ListTags(ctx context.Context, meta any, identifier string) (tftags.KeyValueTags, error) { + return ListTags(ctx, meta.(*conns.AWSClient).TimestreamWriteConn(), identifier) +} + // []*SERVICE.Tag handling // Tags returns timestreamwrite service tags. @@ -61,7 +65,8 @@ func KeyValueTags(ctx context.Context, tags []*timestreamwrite.Tag) tftags.KeyVa // UpdateTags updates timestreamwrite 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 timestreamwriteiface.TimestreamWriteAPI, identifier string, oldTagsMap interface{}, newTagsMap interface{}) error { + +func UpdateTags(ctx context.Context, conn timestreamwriteiface.TimestreamWriteAPI, identifier string, oldTagsMap, newTagsMap any) error { oldTags := tftags.New(ctx, oldTagsMap) newTags := tftags.New(ctx, newTagsMap) @@ -94,6 +99,6 @@ func UpdateTags(ctx context.Context, conn timestreamwriteiface.TimestreamWriteAP return nil } -func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags interface{}, newTags interface{}) error { +func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags, newTags any) error { return UpdateTags(ctx, meta.(*conns.AWSClient).TimestreamWriteConn(), identifier, oldTags, newTags) } diff --git a/internal/service/transcribe/tags_gen.go b/internal/service/transcribe/tags_gen.go index 7e8cf18264c8..0e40dcb9c64f 100644 --- a/internal/service/transcribe/tags_gen.go +++ b/internal/service/transcribe/tags_gen.go @@ -60,7 +60,7 @@ func KeyValueTags(ctx context.Context, tags []types.Tag) tftags.KeyValueTags { // UpdateTags updates transcribe 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 *transcribe.Client, identifier string, oldTagsMap interface{}, newTagsMap interface{}) error { +func UpdateTags(ctx context.Context, conn *transcribe.Client, identifier string, oldTagsMap, newTagsMap any) error { oldTags := tftags.New(ctx, oldTagsMap) newTags := tftags.New(ctx, newTagsMap) diff --git a/internal/service/transfer/tags_gen.go b/internal/service/transfer/tags_gen.go index be371e4ee597..dbf2aa2304f2 100644 --- a/internal/service/transfer/tags_gen.go +++ b/internal/service/transfer/tags_gen.go @@ -18,7 +18,7 @@ import ( // This function will optimise the handling over ListTags, if possible. // The identifier is typically the Amazon Resource Name (ARN), although // it may also be a different identifier depending on the service. -func GetTag(ctx context.Context, conn transferiface.TransferAPI, identifier string, key string) (*string, error) { +func GetTag(ctx context.Context, conn transferiface.TransferAPI, identifier, key string) (*string, error) { listTags, err := ListTags(ctx, conn, identifier) if err != nil { @@ -49,6 +49,10 @@ func ListTags(ctx context.Context, conn transferiface.TransferAPI, identifier st return KeyValueTags(ctx, output.Tags), nil } +func (p *servicePackage) ListTags(ctx context.Context, meta any, identifier string) (tftags.KeyValueTags, error) { + return ListTags(ctx, meta.(*conns.AWSClient).TransferConn(), identifier) +} + // []*SERVICE.Tag handling // Tags returns transfer service tags. @@ -81,7 +85,8 @@ func KeyValueTags(ctx context.Context, tags []*transfer.Tag) tftags.KeyValueTags // UpdateTags updates transfer 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 transferiface.TransferAPI, identifier string, oldTagsMap interface{}, newTagsMap interface{}) error { + +func UpdateTags(ctx context.Context, conn transferiface.TransferAPI, identifier string, oldTagsMap, newTagsMap any) error { oldTags := tftags.New(ctx, oldTagsMap) newTags := tftags.New(ctx, newTagsMap) @@ -114,6 +119,6 @@ func UpdateTags(ctx context.Context, conn transferiface.TransferAPI, identifier return nil } -func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags interface{}, newTags interface{}) error { +func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags, newTags any) error { return UpdateTags(ctx, meta.(*conns.AWSClient).TransferConn(), identifier, oldTags, newTags) } diff --git a/internal/service/transfer/update_tags_no_system_ignore_gen.go b/internal/service/transfer/update_tags_no_system_ignore_gen.go index 26300b3734ea..5b759da3112c 100644 --- a/internal/service/transfer/update_tags_no_system_ignore_gen.go +++ b/internal/service/transfer/update_tags_no_system_ignore_gen.go @@ -15,7 +15,8 @@ import ( // UpdateTagsNoIgnoreSystem updates transfer service tags. // The identifier is typically the Amazon Resource Name (ARN), although // it may also be a different identifier depending on the service. -func UpdateTagsNoIgnoreSystem(ctx context.Context, conn transferiface.TransferAPI, identifier string, oldTagsMap interface{}, newTagsMap interface{}) error { + +func UpdateTagsNoIgnoreSystem(ctx context.Context, conn transferiface.TransferAPI, identifier string, oldTagsMap, newTagsMap any) error { oldTags := tftags.New(ctx, oldTagsMap) newTags := tftags.New(ctx, newTagsMap) @@ -48,6 +49,6 @@ func UpdateTagsNoIgnoreSystem(ctx context.Context, conn transferiface.TransferAP return nil } -func (p *servicePackage) UpdateTagsNoIgnoreSystem(ctx context.Context, meta any, identifier string, oldTags interface{}, newTags interface{}) error { +func (p *servicePackage) UpdateTagsNoIgnoreSystem(ctx context.Context, meta any, identifier string, oldTags, newTags any) error { return UpdateTagsNoIgnoreSystem(ctx, meta.(*conns.AWSClient).TransferConn(), identifier, oldTags, newTags) } diff --git a/internal/service/waf/tags_gen.go b/internal/service/waf/tags_gen.go index b0044e5904ab..2b258c842288 100644 --- a/internal/service/waf/tags_gen.go +++ b/internal/service/waf/tags_gen.go @@ -29,6 +29,10 @@ func ListTags(ctx context.Context, conn wafiface.WAFAPI, identifier string) (tft return KeyValueTags(ctx, output.TagInfoForResource.TagList), nil } +func (p *servicePackage) ListTags(ctx context.Context, meta any, identifier string) (tftags.KeyValueTags, error) { + return ListTags(ctx, meta.(*conns.AWSClient).WAFConn(), identifier) +} + // []*SERVICE.Tag handling // Tags returns waf service tags. @@ -61,7 +65,8 @@ func KeyValueTags(ctx context.Context, tags []*waf.Tag) tftags.KeyValueTags { // UpdateTags updates waf 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 wafiface.WAFAPI, identifier string, oldTagsMap interface{}, newTagsMap interface{}) error { + +func UpdateTags(ctx context.Context, conn wafiface.WAFAPI, identifier string, oldTagsMap, newTagsMap any) error { oldTags := tftags.New(ctx, oldTagsMap) newTags := tftags.New(ctx, newTagsMap) @@ -94,6 +99,6 @@ func UpdateTags(ctx context.Context, conn wafiface.WAFAPI, identifier string, ol return nil } -func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags interface{}, newTags interface{}) error { +func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags, newTags any) error { return UpdateTags(ctx, meta.(*conns.AWSClient).WAFConn(), identifier, oldTags, newTags) } diff --git a/internal/service/wafregional/tags_gen.go b/internal/service/wafregional/tags_gen.go index cba6fd7f89bd..dc0eb1ef81e2 100644 --- a/internal/service/wafregional/tags_gen.go +++ b/internal/service/wafregional/tags_gen.go @@ -29,6 +29,10 @@ func ListTags(ctx context.Context, conn wafregionaliface.WAFRegionalAPI, identif return KeyValueTags(ctx, output.TagInfoForResource.TagList), nil } +func (p *servicePackage) ListTags(ctx context.Context, meta any, identifier string) (tftags.KeyValueTags, error) { + return ListTags(ctx, meta.(*conns.AWSClient).WAFRegionalConn(), identifier) +} + // []*SERVICE.Tag handling // Tags returns wafregional service tags. @@ -61,7 +65,8 @@ func KeyValueTags(ctx context.Context, tags []*waf.Tag) tftags.KeyValueTags { // UpdateTags updates wafregional 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 wafregionaliface.WAFRegionalAPI, identifier string, oldTagsMap interface{}, newTagsMap interface{}) error { + +func UpdateTags(ctx context.Context, conn wafregionaliface.WAFRegionalAPI, identifier string, oldTagsMap, newTagsMap any) error { oldTags := tftags.New(ctx, oldTagsMap) newTags := tftags.New(ctx, newTagsMap) @@ -94,6 +99,6 @@ func UpdateTags(ctx context.Context, conn wafregionaliface.WAFRegionalAPI, ident return nil } -func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags interface{}, newTags interface{}) error { +func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags, newTags any) error { return UpdateTags(ctx, meta.(*conns.AWSClient).WAFRegionalConn(), identifier, oldTags, newTags) } diff --git a/internal/service/wafv2/tags_gen.go b/internal/service/wafv2/tags_gen.go index f3da736a0bfe..61dd709ae2c6 100644 --- a/internal/service/wafv2/tags_gen.go +++ b/internal/service/wafv2/tags_gen.go @@ -29,6 +29,10 @@ func ListTags(ctx context.Context, conn wafv2iface.WAFV2API, identifier string) return KeyValueTags(ctx, output.TagInfoForResource.TagList), nil } +func (p *servicePackage) ListTags(ctx context.Context, meta any, identifier string) (tftags.KeyValueTags, error) { + return ListTags(ctx, meta.(*conns.AWSClient).WAFV2Conn(), identifier) +} + // []*SERVICE.Tag handling // Tags returns wafv2 service tags. @@ -61,7 +65,8 @@ func KeyValueTags(ctx context.Context, tags []*wafv2.Tag) tftags.KeyValueTags { // UpdateTags updates wafv2 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 wafv2iface.WAFV2API, identifier string, oldTagsMap interface{}, newTagsMap interface{}) error { + +func UpdateTags(ctx context.Context, conn wafv2iface.WAFV2API, identifier string, oldTagsMap, newTagsMap any) error { oldTags := tftags.New(ctx, oldTagsMap) newTags := tftags.New(ctx, newTagsMap) @@ -94,6 +99,6 @@ func UpdateTags(ctx context.Context, conn wafv2iface.WAFV2API, identifier string return nil } -func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags interface{}, newTags interface{}) error { +func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags, newTags any) error { return UpdateTags(ctx, meta.(*conns.AWSClient).WAFV2Conn(), identifier, oldTags, newTags) } diff --git a/internal/service/worklink/tags_gen.go b/internal/service/worklink/tags_gen.go index 4b6a3bef6fe7..606982cf5408 100644 --- a/internal/service/worklink/tags_gen.go +++ b/internal/service/worklink/tags_gen.go @@ -29,6 +29,10 @@ func ListTags(ctx context.Context, conn worklinkiface.WorkLinkAPI, identifier st return KeyValueTags(ctx, output.Tags), nil } +func (p *servicePackage) ListTags(ctx context.Context, meta any, identifier string) (tftags.KeyValueTags, error) { + return ListTags(ctx, meta.(*conns.AWSClient).WorkLinkConn(), identifier) +} + // map[string]*string handling // Tags returns worklink service tags. @@ -44,7 +48,8 @@ func KeyValueTags(ctx context.Context, tags map[string]*string) tftags.KeyValueT // UpdateTags updates worklink 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 worklinkiface.WorkLinkAPI, identifier string, oldTagsMap interface{}, newTagsMap interface{}) error { + +func UpdateTags(ctx context.Context, conn worklinkiface.WorkLinkAPI, identifier string, oldTagsMap, newTagsMap any) error { oldTags := tftags.New(ctx, oldTagsMap) newTags := tftags.New(ctx, newTagsMap) @@ -77,6 +82,6 @@ func UpdateTags(ctx context.Context, conn worklinkiface.WorkLinkAPI, identifier return nil } -func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags interface{}, newTags interface{}) error { +func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags, newTags any) error { return UpdateTags(ctx, meta.(*conns.AWSClient).WorkLinkConn(), identifier, oldTags, newTags) } diff --git a/internal/service/workspaces/tags_gen.go b/internal/service/workspaces/tags_gen.go index 1bb6e939a10f..36ac6f944865 100644 --- a/internal/service/workspaces/tags_gen.go +++ b/internal/service/workspaces/tags_gen.go @@ -29,6 +29,10 @@ func ListTags(ctx context.Context, conn workspacesiface.WorkSpacesAPI, identifie return KeyValueTags(ctx, output.TagList), nil } +func (p *servicePackage) ListTags(ctx context.Context, meta any, identifier string) (tftags.KeyValueTags, error) { + return ListTags(ctx, meta.(*conns.AWSClient).WorkSpacesConn(), identifier) +} + // []*SERVICE.Tag handling // Tags returns workspaces service tags. @@ -61,7 +65,8 @@ func KeyValueTags(ctx context.Context, tags []*workspaces.Tag) tftags.KeyValueTa // UpdateTags updates workspaces 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 workspacesiface.WorkSpacesAPI, identifier string, oldTagsMap interface{}, newTagsMap interface{}) error { + +func UpdateTags(ctx context.Context, conn workspacesiface.WorkSpacesAPI, identifier string, oldTagsMap, newTagsMap any) error { oldTags := tftags.New(ctx, oldTagsMap) newTags := tftags.New(ctx, newTagsMap) @@ -94,6 +99,6 @@ func UpdateTags(ctx context.Context, conn workspacesiface.WorkSpacesAPI, identif return nil } -func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags interface{}, newTags interface{}) error { +func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags, newTags any) error { return UpdateTags(ctx, meta.(*conns.AWSClient).WorkSpacesConn(), identifier, oldTags, newTags) } diff --git a/internal/service/xray/tags_gen.go b/internal/service/xray/tags_gen.go index d422a386bde5..4856cf1d339c 100644 --- a/internal/service/xray/tags_gen.go +++ b/internal/service/xray/tags_gen.go @@ -29,6 +29,10 @@ func ListTags(ctx context.Context, conn xrayiface.XRayAPI, identifier string) (t return KeyValueTags(ctx, output.Tags), nil } +func (p *servicePackage) ListTags(ctx context.Context, meta any, identifier string) (tftags.KeyValueTags, error) { + return ListTags(ctx, meta.(*conns.AWSClient).XRayConn(), identifier) +} + // []*SERVICE.Tag handling // Tags returns xray service tags. @@ -61,7 +65,8 @@ func KeyValueTags(ctx context.Context, tags []*xray.Tag) tftags.KeyValueTags { // UpdateTags updates xray 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 xrayiface.XRayAPI, identifier string, oldTagsMap interface{}, newTagsMap interface{}) error { + +func UpdateTags(ctx context.Context, conn xrayiface.XRayAPI, identifier string, oldTagsMap, newTagsMap any) error { oldTags := tftags.New(ctx, oldTagsMap) newTags := tftags.New(ctx, newTagsMap) @@ -94,6 +99,6 @@ func UpdateTags(ctx context.Context, conn xrayiface.XRayAPI, identifier string, return nil } -func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags interface{}, newTags interface{}) error { +func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags, newTags any) error { return UpdateTags(ctx, meta.(*conns.AWSClient).XRayConn(), identifier, oldTags, newTags) } From 4a7a6a380a751d249e3eff052378ab461973e7c2 Mon Sep 17 00:00:00 2001 From: Brittan DeYoung <32572259+brittandeyoung@users.noreply.github.com> Date: Tue, 7 Mar 2023 14:54:47 -0500 Subject: [PATCH 498/763] licensemanager: Amend received_licenses_data_source_test. testacc-lint-fix --- .../received_licenses_data_source_test.go | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/internal/service/licensemanager/received_licenses_data_source_test.go b/internal/service/licensemanager/received_licenses_data_source_test.go index 736acd8ac5f7..9131388b2e0e 100644 --- a/internal/service/licensemanager/received_licenses_data_source_test.go +++ b/internal/service/licensemanager/received_licenses_data_source_test.go @@ -54,10 +54,10 @@ func testAccReceivedLicensesDataSourceConfig_arns(productSKU string) string { return fmt.Sprintf(` data "aws_licensemanager_received_licenses" "test" { filter { - name = "ProductSKU" - values = [ + name = "ProductSKU" + values = [ %[1]q - ] + ] } } `, productSKU) @@ -67,10 +67,10 @@ func testAccReceivedLicensesDataSourceConfig_empty() string { return fmt.Sprint(` data "aws_licensemanager_received_licenses" "test" { filter { - name = "IssuerName" - values = [ - "This Is Fake" - ] + name = "IssuerName" + values = [ + "This Is Fake" + ] } } `) From 0ce1b882a987720368b7fdb471553855b0106484 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Tue, 7 Mar 2023 15:05:15 -0500 Subject: [PATCH 499/763] Update 29763.txt --- .changelog/29763.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.changelog/29763.txt b/.changelog/29763.txt index 502f329429ad..c0817da552d7 100644 --- a/.changelog/29763.txt +++ b/.changelog/29763.txt @@ -1,3 +1,7 @@ +```release-note:enhancement +resource/aws_acm_certificate: Change `options` to `Computed` +``` + ```release-note:bug resource/aws_acm_certificate: Update `options.certificate_transparency_logging_preference` in place rather than replacing the resource ``` From 28ec4aa4865ae4513501de5722fdccca48828122 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Tue, 7 Mar 2023 15:14:06 -0500 Subject: [PATCH 500/763] r/aws_acm_certificate: Fix 'TestAccACMCertificate_disableReenableCTLogging'. Acceptance test output: % ACM_CERTIFICATE_ROOT_DOMAIN=ewbankkit.com make testacc TESTARGS='-run=TestAccACMCertificate_disableReenableCTLogging' PKG=acm ACCTEST_PARALLELISM=1 ==> Checking that code complies with gofmt requirements... TF_ACC=1 go test ./internal/service/acm/... -v -count 1 -parallel 1 -run=TestAccACMCertificate_disableReenableCTLogging -timeout 180m === RUN TestAccACMCertificate_disableReenableCTLogging === PAUSE TestAccACMCertificate_disableReenableCTLogging === CONT TestAccACMCertificate_disableReenableCTLogging --- PASS: TestAccACMCertificate_disableReenableCTLogging (149.16s) PASS ok github.com/hashicorp/terraform-provider-aws/internal/service/acm 154.726s --- internal/service/acm/certificate_test.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/internal/service/acm/certificate_test.go b/internal/service/acm/certificate_test.go index 5c074c36eaa9..3a9ae056738c 100644 --- a/internal/service/acm/certificate_test.go +++ b/internal/service/acm/certificate_test.go @@ -1403,6 +1403,11 @@ func TestAccACMCertificate_disableReenableCTLogging(t *testing.T) { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckCertificateDestroy(ctx), Steps: []resource.TestStep{ + { + Config: testAccCertificateConfig_optionsWithValidation(rootDomain, acm.ValidationMethodDns, "ENABLED"), + Check: testAccCheckCertificateExists(ctx, resourceName, &v), + }, + // Check the certificate's attributes once the validation has been applied. { Config: testAccCertificateConfig_optionsWithValidation(rootDomain, acm.ValidationMethodDns, "ENABLED"), Check: resource.ComposeAggregateTestCheckFunc( From 7784cd0dbaab6ab8b96265ed48a0a62628779268 Mon Sep 17 00:00:00 2001 From: Graham Davison Date: Tue, 7 Mar 2023 12:35:38 -0800 Subject: [PATCH 501/763] Uses `go.mod` for Go version in GHA --- .actrc | 2 +- .github/workflows/acctest-terraform-lint.yml | 6 +++--- .github/workflows/changelog.yml | 4 ++-- .github/workflows/dependencies.yml | 2 +- .github/workflows/documentation.yml | 4 ++-- .github/workflows/examples.yml | 6 +++--- .github/workflows/golangci-lint.yml | 5 ++--- .github/workflows/providerlint.yml | 5 ++--- .github/workflows/skaff.yml | 2 +- .github/workflows/snapshot.yml | 2 +- .github/workflows/terraform_provider.yml | 15 +++++++-------- .github/workflows/website.yml | 7 +++---- .github/workflows/workflow-lint.yml | 2 +- 13 files changed, 29 insertions(+), 33 deletions(-) diff --git a/.actrc b/.actrc index 925b26ef54d0..37484f3d1154 100644 --- a/.actrc +++ b/.actrc @@ -1,3 +1,3 @@ # Needed for testing our workflows -P ubuntu-latest=ghcr.io/catthehacker/ubuntu:act-22.04 --P medium=ghcr.io/catthehacker/ubuntu:act-22.04 +-P linux=ghcr.io/catthehacker/ubuntu:act-22.04 diff --git a/.github/workflows/acctest-terraform-lint.yml b/.github/workflows/acctest-terraform-lint.yml index 88722a6303a6..92406038a6ea 100644 --- a/.github/workflows/acctest-terraform-lint.yml +++ b/.github/workflows/acctest-terraform-lint.yml @@ -7,10 +7,10 @@ on: pull_request: paths: - .github/workflows/acctest-terraform-lint.yml - - .go-version - .ci/.tflint.hcl - .ci/scripts/validate-terraform.sh - .ci/tools/go.mod + - go.sum - 'internal/service/**/*_test.go' jobs: @@ -20,7 +20,7 @@ jobs: - uses: actions/checkout@v3 - uses: actions/setup-go@v3 with: - go-version-file: .go-version + go-version-file: go.mod - uses: actions/cache@v3 continue-on-error: true timeout-minutes: 2 @@ -48,7 +48,7 @@ jobs: - uses: actions/checkout@v3 - uses: actions/setup-go@v3 with: - go-version-file: .go-version + go-version-file: go.mod - uses: actions/cache@v3 continue-on-error: true timeout-minutes: 2 diff --git a/.github/workflows/changelog.yml b/.github/workflows/changelog.yml index 14668e53d828..6f3b6b0626cd 100644 --- a/.github/workflows/changelog.yml +++ b/.github/workflows/changelog.yml @@ -7,7 +7,7 @@ on: pull_request: paths: - .changelog/* - - .go-version + - go.sum - CHANGELOG.md pull_request_target: @@ -61,7 +61,7 @@ jobs: - uses: actions/checkout@v3 - uses: actions/setup-go@v3 with: - go-version-file: .go-version + go-version-file: go.mod - uses: actions/cache@v3 continue-on-error: true timeout-minutes: 2 diff --git a/.github/workflows/dependencies.yml b/.github/workflows/dependencies.yml index 60d32a03465d..edfedc5c50a7 100644 --- a/.github/workflows/dependencies.yml +++ b/.github/workflows/dependencies.yml @@ -66,7 +66,7 @@ jobs: - uses: actions/checkout@v3 - uses: actions/setup-go@v3 with: - go-version-file: .go-version + go-version-file: go.mod - name: go mod run: | echo "==> Checking source code with go mod tidy..." diff --git a/.github/workflows/documentation.yml b/.github/workflows/documentation.yml index 4a260d6d4128..ad30caee1994 100644 --- a/.github/workflows/documentation.yml +++ b/.github/workflows/documentation.yml @@ -8,8 +8,8 @@ on: - .ci/.markdownlinkcheck.json - .markdownlint.yml - .github/workflows/documentation.yml - - .go-version - docs/** + - go.mod jobs: markdown-link-check: @@ -40,7 +40,7 @@ jobs: - uses: actions/checkout@v3 - uses: actions/setup-go@v3 with: - go-version-file: .go-version + go-version-file: go.mod - uses: actions/cache@v3 continue-on-error: true timeout-minutes: 2 diff --git a/.github/workflows/examples.yml b/.github/workflows/examples.yml index f35e4f4df9f4..6517fef72177 100644 --- a/.github/workflows/examples.yml +++ b/.github/workflows/examples.yml @@ -6,10 +6,10 @@ on: pull_request: paths: - .github/workflows/examples.yml - - .go-version - .ci/.tflint.hcl - .ci/tools/go.mod - examples/** + - go.mod env: AWS_DEFAULT_REGION: us-west-2 @@ -27,7 +27,7 @@ jobs: key: ${{ runner.os }}-go-pkg-mod-${{ hashFiles('go.sum') }} - uses: actions/setup-go@v3 with: - go-version-file: .go-version + go-version-file: go.mod - name: install tflint run: cd .ci/tools && go install github.com/terraform-linters/tflint @@ -76,7 +76,7 @@ jobs: key: ${{ runner.os }}-go-pkg-mod-${{ hashFiles('go.sum') }} - uses: actions/setup-go@v3 with: - go-version-file: .go-version + go-version-file: go.mod - name: go build run: go build -o terraform-plugin-dir/terraform-provider-aws_v99.99.99_x5 . - name: override plugin diff --git a/.github/workflows/golangci-lint.yml b/.github/workflows/golangci-lint.yml index 05c800c90228..a26a3991e9e9 100644 --- a/.github/workflows/golangci-lint.yml +++ b/.github/workflows/golangci-lint.yml @@ -8,7 +8,6 @@ on: pull_request: paths: - .github/workflows/golangci-lint.yml - - .go-version - .ci/.golangci*.yml - internal/** - go.sum @@ -24,7 +23,7 @@ jobs: - uses: actions/checkout@v3 - uses: actions/setup-go@v3 with: - go-version-file: .go-version + go-version-file: go.mod - name: golangci-lint uses: golangci/golangci-lint-action@v3 with: @@ -38,7 +37,7 @@ jobs: - uses: actions/checkout@v3 - uses: actions/setup-go@v3 with: - go-version-file: .go-version + go-version-file: go.mod - name: golangci-lint uses: golangci/golangci-lint-action@v3 with: diff --git a/.github/workflows/providerlint.yml b/.github/workflows/providerlint.yml index fa4c859968a3..a36b2f005a74 100644 --- a/.github/workflows/providerlint.yml +++ b/.github/workflows/providerlint.yml @@ -9,7 +9,6 @@ on: paths: - .ci/scripts/providerlint.sh - .github/workflows/providerlint.yml - - .go-version - GNUmakefile - go.sum - internal/** @@ -23,7 +22,7 @@ jobs: - uses: actions/checkout@v3 - uses: actions/setup-go@v3 with: - go-version-file: .go-version + go-version-file: go.mod - name: go env run: echo "GOCACHE=$(go env GOCACHE)" >> $GITHUB_ENV - uses: actions/cache@v3 @@ -48,7 +47,7 @@ jobs: - uses: actions/checkout@v3 - uses: actions/setup-go@v3 with: - go-version-file: .go-version + go-version-file: go.mod - name: go env run: echo "GOCACHE=$(go env GOCACHE)" >> $GITHUB_ENV - uses: actions/cache@v3 diff --git a/.github/workflows/skaff.yml b/.github/workflows/skaff.yml index c7bf34541c1a..3393536279b2 100644 --- a/.github/workflows/skaff.yml +++ b/.github/workflows/skaff.yml @@ -20,7 +20,7 @@ jobs: fetch-depth: 0 - uses: actions/setup-go@v3 with: - go-version-file: .go-version + go-version-file: skaff/go.mod # See also: https://github.com/actions/setup-go/issues/54 - name: go env run: | diff --git a/.github/workflows/snapshot.yml b/.github/workflows/snapshot.yml index d3e4bdc46e05..b4bdd51d9103 100644 --- a/.github/workflows/snapshot.yml +++ b/.github/workflows/snapshot.yml @@ -12,7 +12,7 @@ jobs: - uses: actions/checkout@v3 - uses: actions/setup-go@v3 with: - go-version-file: .go-version + go-version-file: go.mod - uses: actions/cache@v3 continue-on-error: true timeout-minutes: 2 diff --git a/.github/workflows/terraform_provider.yml b/.github/workflows/terraform_provider.yml index 7c1d959ccb55..5f6415d87d77 100644 --- a/.github/workflows/terraform_provider.yml +++ b/.github/workflows/terraform_provider.yml @@ -9,7 +9,6 @@ on: paths: - .github/workflows/terraform_provider.yml - .ci/scripts/providerlint.sh - - .go-version - .ci/.golangci.yml - .ci/tools/go.mod - .markdownlint.yml @@ -36,7 +35,7 @@ jobs: - uses: actions/checkout@v3 - uses: actions/setup-go@v3 with: - go-version-file: .go-version + go-version-file: go.mod - uses: actions/cache@v3 continue-on-error: true id: cache-go-pkg-mod @@ -63,7 +62,7 @@ jobs: - if: steps.cache-terraform-plugin-dir.outputs.cache-hit != 'true' || steps.cache-terraform-plugin-dir.outcome == 'failure' uses: actions/setup-go@v3 with: - go-version-file: .go-version + go-version-file: go.mod # See also: https://github.com/actions/setup-go/issues/54 - if: steps.cache-terraform-plugin-dir.outputs.cache-hit != 'true' || steps.cache-terraform-plugin-dir.outcome == 'failure' name: go env @@ -91,7 +90,7 @@ jobs: - uses: actions/checkout@v3 - uses: actions/setup-go@v3 with: - go-version-file: .go-version + go-version-file: go.mod # See also: https://github.com/actions/setup-go/issues/54 - name: go env run: | @@ -125,7 +124,7 @@ jobs: fetch-depth: 0 - uses: actions/setup-go@v3 with: - go-version-file: .go-version + go-version-file: go.mod # See also: https://github.com/actions/setup-go/issues/54 - name: go env run: | @@ -152,7 +151,7 @@ jobs: - uses: actions/checkout@v3 - uses: actions/setup-go@v3 with: - go-version-file: .go-version + go-version-file: go.mod # See also: https://github.com/actions/setup-go/issues/54 - name: go env run: | @@ -182,7 +181,7 @@ jobs: fetch-depth: 0 - uses: actions/setup-go@v3 with: - go-version-file: .go-version + go-version-file: go.mod # See also: https://github.com/actions/setup-go/issues/54 - name: go env run: | @@ -245,7 +244,7 @@ jobs: - uses: actions/checkout@v3 - uses: actions/setup-go@v3 with: - go-version-file: .go-version + go-version-file: go.mod - uses: actions/cache@v3 continue-on-error: true timeout-minutes: 2 diff --git a/.github/workflows/website.yml b/.github/workflows/website.yml index 80b5c7233988..64bf77488d01 100644 --- a/.github/workflows/website.yml +++ b/.github/workflows/website.yml @@ -10,7 +10,6 @@ on: pull_request: paths: - .github/workflows/website.yml - - .go-version - .ci/.markdownlinkcheck.json - .ci/.tflint.hcl - .ci/tools/go.mod @@ -79,7 +78,7 @@ jobs: - uses: actions/checkout@v3 - uses: actions/setup-go@v3 with: - go-version-file: .go-version + go-version-file: .ci/tools/go.mod - uses: actions/cache@v3 continue-on-error: true timeout-minutes: 2 @@ -95,7 +94,7 @@ jobs: - uses: actions/checkout@v3 - uses: actions/setup-go@v3 with: - go-version-file: .go-version + go-version-file: .ci/tools/go.mod - uses: actions/cache@v3 continue-on-error: true timeout-minutes: 2 @@ -113,7 +112,7 @@ jobs: fetch-depth: 0 - uses: actions/setup-go@v3 with: - go-version-file: .go-version + go-version-file: .ci/tools/go.mod - uses: actions/cache@v3 continue-on-error: true timeout-minutes: 2 diff --git a/.github/workflows/workflow-lint.yml b/.github/workflows/workflow-lint.yml index aaaf8f2551af..b86537330fb9 100644 --- a/.github/workflows/workflow-lint.yml +++ b/.github/workflows/workflow-lint.yml @@ -15,7 +15,7 @@ jobs: - uses: actions/checkout@v3 - uses: actions/setup-go@v3 with: - go-version-file: .go-version + go-version-file: .ci/tools/go.mod - name: Install actionlint run: cd .ci/tools && go install github.com/rhysd/actionlint/cmd/actionlint - name: Run actionlint on workflow files From 509c8475290af067233227a324e1b239b992b01f Mon Sep 17 00:00:00 2001 From: Graham Davison Date: Tue, 7 Mar 2023 12:36:11 -0800 Subject: [PATCH 502/763] Skips VCS stamping when installing `providerlint` --- .github/workflows/providerlint.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/providerlint.yml b/.github/workflows/providerlint.yml index a36b2f005a74..903f5eca71eb 100644 --- a/.github/workflows/providerlint.yml +++ b/.github/workflows/providerlint.yml @@ -37,7 +37,7 @@ jobs: with: path: ~/go/pkg/mod key: ${{ runner.os }}-go-pkg-mod-${{ hashFiles('go.sum') }} - - run: cd .ci/providerlint && go install . + - run: cd .ci/providerlint && go install -buildvcs=false . - run: .ci/scripts/providerlint.sh ec2 providerlintb: name: 2 of 2 @@ -62,5 +62,5 @@ jobs: with: path: ~/go/pkg/mod key: ${{ runner.os }}-go-pkg-mod-${{ hashFiles('go.sum') }} - - run: cd .ci/providerlint && go install . + - run: cd .ci/providerlint && go install -buildvcs=false . - run: make providerlint From 66792ce696c789fe208e5b45f535f083f4200558 Mon Sep 17 00:00:00 2001 From: changelogbot Date: Tue, 7 Mar 2023 20:40:29 +0000 Subject: [PATCH 503/763] Update CHANGELOG.md for #29816 --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index e13c371cfecc..70daaa74c28e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,7 @@ FEATURES: ENHANCEMENTS: +* resource/aws_cloudhsm_v2_hsm: Enforce `ExactlyOneOf` for `availability_zone` and `subnet_id` arguments ([#20891](https://github.com/hashicorp/terraform-provider-aws/issues/20891)) * resource/aws_db_instance: Add `listener_endpoint` attribute ([#28434](https://github.com/hashicorp/terraform-provider-aws/issues/28434)) * resource/aws_db_instance: Add plan time validations for `backup_retention_period`, `monitoring_interval`, and `monitoring_role_arn` ([#28434](https://github.com/hashicorp/terraform-provider-aws/issues/28434)) * resource/aws_grafana_workspace: Add `network_access_control` argument ([#29793](https://github.com/hashicorp/terraform-provider-aws/issues/29793)) From c0be0ab1af1dd66f4b8867a7d8deb9a33331d0d3 Mon Sep 17 00:00:00 2001 From: Jared Baker Date: Tue, 7 Mar 2023 15:46:35 -0500 Subject: [PATCH 504/763] add sharon to maintainers list (#29840) --- docs/faq.md | 1 + infrastructure/repository/maintainer-list.tf | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/faq.md b/docs/faq.md index 3d836c684190..5010ee4f4fa6 100644 --- a/docs/faq.md +++ b/docs/faq.md @@ -15,6 +15,7 @@ The HashiCorp Terraform AWS provider team is : * Jared Baker, Engineer - GitHub [@jar-b](https://github.com/jar-b) * Kerim Satirli, Developer Advocate - GitHub [@ksatirli](https://github.com/ksatirli) * Kit Ewbank, Engineer - GitHub [@ewbankkit](https://github.com/ewbankkit) +* Sharon Nam, Engineer - GitHub [@nam054](https://github.com/nam054) ## Why isn’t my PR merged yet? diff --git a/infrastructure/repository/maintainer-list.tf b/infrastructure/repository/maintainer-list.tf index 8fbf4a81c4f4..ed47817f1765 100644 --- a/infrastructure/repository/maintainer-list.tf +++ b/infrastructure/repository/maintainer-list.tf @@ -5,5 +5,5 @@ resource "github_actions_secret" "maintainer_list" { repository = "terraform-provider-aws" secret_name = "MAINTAINER_LIST" - plaintext_value = "['breathingdust', 'dependabot[bot]', 'ewbankkit', 'gdavison', 'jar-b', 'johnsonaj', 'justinretzolk', 'marcosentino', 'YakDriver']" + plaintext_value = "['breathingdust', 'dependabot[bot]', 'ewbankkit', 'gdavison', 'jar-b', 'johnsonaj', 'justinretzolk', 'marcosentino', 'nam054', 'YakDriver']" } From 4d73298b25abcff68c67c894bbfda551093e2f82 Mon Sep 17 00:00:00 2001 From: Brittan DeYoung <32572259+brittandeyoung@users.noreply.github.com> Date: Tue, 7 Mar 2023 15:49:22 -0500 Subject: [PATCH 505/763] licensemanager: Amend grant_test, use datasource for allowed_operations --- internal/service/licensemanager/grant_test.go | 52 +++++++------------ 1 file changed, 19 insertions(+), 33 deletions(-) diff --git a/internal/service/licensemanager/grant_test.go b/internal/service/licensemanager/grant_test.go index f6f6f3fb0c27..fb26dd5962f6 100644 --- a/internal/service/licensemanager/grant_test.go +++ b/internal/service/licensemanager/grant_test.go @@ -35,7 +35,6 @@ func testAccGrant_basic(t *testing.T) { ctx := acctest.Context(t) principalKey := "LICENSE_MANAGER_GRANT_PRINCIPAL" licenseKey := "LICENSE_MANAGER_GRANT_LICENSE_ARN" - homeRegionKey := "LICENSE_MANAGER_GRANT_HOME_REGION" principal := os.Getenv(principalKey) if principal == "" { t.Skipf("Environment variable %s is not set to true", principalKey) @@ -44,10 +43,6 @@ func testAccGrant_basic(t *testing.T) { if licenseArn == "" { t.Skipf("Environment variable %s is not set to true", licenseKey) } - homeRegion := os.Getenv(homeRegionKey) - if homeRegion == "" { - t.Skipf("Environment variable %s is not set to true", homeRegionKey) - } rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resourceName := "aws_licensemanager_grant.test" @@ -58,7 +53,7 @@ func testAccGrant_basic(t *testing.T) { CheckDestroy: testAccCheckGrantDestroy(ctx), Steps: []resource.TestStep{ { - Config: testAccGrantConfig_basic(rName, licenseArn, principal, homeRegion), + Config: testAccGrantConfig_basic(licenseArn, rName, principal), Check: resource.ComposeAggregateTestCheckFunc( testAccCheckGrantExists(ctx, resourceName), acctest.MatchResourceAttrGlobalARN(resourceName, "arn", "license-manager", regexp.MustCompile(`grant:g-.+`)), @@ -67,7 +62,7 @@ func testAccGrant_basic(t *testing.T) { resource.TestCheckTypeSetElemAttr(resourceName, "allowed_operations.*", "CheckInLicense"), resource.TestCheckTypeSetElemAttr(resourceName, "allowed_operations.*", "ExtendConsumptionLicense"), resource.TestCheckTypeSetElemAttr(resourceName, "allowed_operations.*", "CreateToken"), - resource.TestCheckResourceAttr(resourceName, "home_region", homeRegion), + resource.TestCheckResourceAttrSet(resourceName, "home_region"), resource.TestCheckResourceAttr(resourceName, "license_arn", licenseArn), resource.TestCheckResourceAttr(resourceName, "name", rName), resource.TestCheckResourceAttrSet(resourceName, "parent_arn"), @@ -89,7 +84,6 @@ func testAccGrant_disappears(t *testing.T) { ctx := acctest.Context(t) principalKey := "LICENSE_MANAGER_GRANT_PRINCIPAL" licenseKey := "LICENSE_MANAGER_GRANT_LICENSE_ARN" - homeRegionKey := "LICENSE_MANAGER_GRANT_HOME_REGION" principal := os.Getenv(principalKey) if principal == "" { t.Skipf("Environment variable %s is not set to true", principalKey) @@ -98,10 +92,6 @@ func testAccGrant_disappears(t *testing.T) { if licenseArn == "" { t.Skipf("Environment variable %s is not set to true", licenseKey) } - homeRegion := os.Getenv(homeRegionKey) - if homeRegion == "" { - t.Skipf("Environment variable %s is not set to true", homeRegionKey) - } rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resourceName := "aws_licensemanager_grant.test" @@ -112,7 +102,7 @@ func testAccGrant_disappears(t *testing.T) { CheckDestroy: testAccCheckGrantDestroy(ctx), Steps: []resource.TestStep{ { - Config: testAccGrantConfig_basic(rName, licenseArn, principal, homeRegion), + Config: testAccGrantConfig_basic(licenseArn, rName, principal), Check: resource.ComposeTestCheckFunc( testAccCheckGrantExists(ctx, resourceName), acctest.CheckResourceDisappears(ctx, acctest.Provider, tflicensemanager.ResourceGrant(), resourceName), @@ -127,7 +117,6 @@ func testAccGrant_name(t *testing.T) { ctx := acctest.Context(t) principalKey := "LICENSE_MANAGER_GRANT_PRINCIPAL" licenseKey := "LICENSE_MANAGER_GRANT_LICENSE_ARN" - homeRegionKey := "LICENSE_MANAGER_GRANT_HOME_REGION" principal := os.Getenv(principalKey) if principal == "" { t.Skipf("Environment variable %s is not set to true", principalKey) @@ -136,10 +125,6 @@ func testAccGrant_name(t *testing.T) { if licenseArn == "" { t.Skipf("Environment variable %s is not set to true", licenseKey) } - homeRegion := os.Getenv(homeRegionKey) - if homeRegion == "" { - t.Skipf("Environment variable %s is not set to true", homeRegionKey) - } rName1 := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) rName2 := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resourceName := "aws_licensemanager_grant.test" @@ -151,7 +136,7 @@ func testAccGrant_name(t *testing.T) { CheckDestroy: testAccCheckGrantDestroy(ctx), Steps: []resource.TestStep{ { - Config: testAccGrantConfig_basic(rName1, licenseArn, principal, homeRegion), + Config: testAccGrantConfig_basic(licenseArn, rName1, principal), Check: resource.ComposeAggregateTestCheckFunc( testAccCheckGrantExists(ctx, resourceName), resource.TestCheckResourceAttr(resourceName, "name", rName1), @@ -163,7 +148,7 @@ func testAccGrant_name(t *testing.T) { ImportStateVerify: true, }, { - Config: testAccGrantConfig_basic(rName2, licenseArn, principal, homeRegion), + Config: testAccGrantConfig_basic(licenseArn, rName2, principal), Check: resource.ComposeAggregateTestCheckFunc( testAccCheckGrantExists(ctx, resourceName), resource.TestCheckResourceAttr(resourceName, "name", rName2), @@ -226,20 +211,21 @@ func testAccCheckGrantDestroy(ctx context.Context) resource.TestCheckFunc { } } -func testAccGrantConfig_basic(rName string, licenseArn string, principal string, homeRegion string) string { +func testAccGrantConfig_basic(licenseArn string, rName string, principal string) string { return fmt.Sprintf(` +data "aws_licensemanager_received_license" "test" { + license_arn = %[1]q +} + +locals { + allowed_operations = [for i in data.aws_licensemanager_received_license.test.received_metadata[0].allowed_operations : i if i != "CreateGrant"] +} + resource "aws_licensemanager_grant" "test" { - name = %[1]q - allowed_operations = [ - "ListPurchasedLicenses", - "CheckoutLicense", - "CheckInLicense", - "ExtendConsumptionLicense", - "CreateToken" - ] - license_arn = %[2]q - principal = %[3]q - home_region = %[4]q + name = %[2]q + allowed_operations = local.allowed_operations + license_arn = data.aws_licensemanager_received_license.test.license_arn + principal = %[3]q } -`, rName, licenseArn, principal, homeRegion) +`, licenseArn, rName, principal) } From a2c651350e110c2c905a0b12a03e207212c926f4 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Tue, 7 Mar 2023 16:33:57 -0500 Subject: [PATCH 506/763] Add 'testAccCertificateConfig_privateCertificateBase'. --- internal/service/acm/certificate_test.go | 114 +++++------------------ 1 file changed, 24 insertions(+), 90 deletions(-) diff --git a/internal/service/acm/certificate_test.go b/internal/service/acm/certificate_test.go index 3a9ae056738c..7cd1581ab66f 100644 --- a/internal/service/acm/certificate_test.go +++ b/internal/service/acm/certificate_test.go @@ -1781,17 +1781,8 @@ resource "aws_acm_certificate" "test" { `, rootDomainName, domainName) } -func testAccCertificateConfig_privateCertificate_renewable(commonName, certificateDomainName string) string { +func testAccCertificateConfig_privateCertificateBase(commonName string) string { return fmt.Sprintf(` -resource "aws_acm_certificate" "test" { - domain_name = %[2]q - certificate_authority_arn = aws_acmpca_certificate_authority.test.arn - - depends_on = [ - aws_acmpca_certificate_authority_certificate.test, - ] -} - resource "aws_acmpca_certificate_authority" "test" { permanent_deletion_time_in_days = 7 type = "ROOT" @@ -1806,12 +1797,6 @@ resource "aws_acmpca_certificate_authority" "test" { } } -resource "aws_acmpca_permission" "test" { - certificate_authority_arn = aws_acmpca_certificate_authority.test.arn - principal = "acm.amazonaws.com" - actions = ["IssueCertificate", "GetCertificate", "ListPermissions"] -} - resource "aws_acmpca_certificate" "test" { certificate_authority_arn = aws_acmpca_certificate_authority.test.arn certificate_signing_request = aws_acmpca_certificate_authority.test.certificate_signing_request @@ -1833,113 +1818,62 @@ resource "aws_acmpca_certificate_authority_certificate" "test" { } data "aws_partition" "current" {} -`, commonName, certificateDomainName) +`, commonName) } -func testAccCertificateConfig_privateCertificate_noRenewalPermission(commonName, certificateDomainName string) string { - return fmt.Sprintf(` +func testAccCertificateConfig_privateCertificate_renewable(commonName, certificateDomainName string) string { + return acctest.ConfigCompose(testAccCertificateConfig_privateCertificateBase(commonName), fmt.Sprintf(` resource "aws_acm_certificate" "test" { - domain_name = %[2]q + domain_name = %[1]q certificate_authority_arn = aws_acmpca_certificate_authority.test.arn depends_on = [ aws_acmpca_certificate_authority_certificate.test, + aws_acmpca_permission.test, ] } -resource "aws_acmpca_certificate_authority" "test" { - permanent_deletion_time_in_days = 7 - type = "ROOT" - - certificate_authority_configuration { - key_algorithm = "RSA_4096" - signing_algorithm = "SHA512WITHRSA" - - subject { - common_name = %[1]q - } - } +resource "aws_acmpca_permission" "test" { + certificate_authority_arn = aws_acmpca_certificate_authority.test.arn + principal = "acm.amazonaws.com" + actions = ["IssueCertificate", "GetCertificate", "ListPermissions"] } - -resource "aws_acmpca_certificate" "test" { - certificate_authority_arn = aws_acmpca_certificate_authority.test.arn - certificate_signing_request = aws_acmpca_certificate_authority.test.certificate_signing_request - signing_algorithm = "SHA512WITHRSA" - - template_arn = "arn:${data.aws_partition.current.partition}:acm-pca:::template/RootCACertificate/V1" - - validity { - type = "YEARS" - value = 2 - } +`, certificateDomainName)) } -resource "aws_acmpca_certificate_authority_certificate" "test" { +func testAccCertificateConfig_privateCertificate_noRenewalPermission(commonName, certificateDomainName string) string { + return acctest.ConfigCompose(testAccCertificateConfig_privateCertificateBase(commonName), fmt.Sprintf(` +resource "aws_acm_certificate" "test" { + domain_name = %[1]q certificate_authority_arn = aws_acmpca_certificate_authority.test.arn - certificate = aws_acmpca_certificate.test.certificate - certificate_chain = aws_acmpca_certificate.test.certificate_chain + depends_on = [ + aws_acmpca_certificate_authority_certificate.test, + ] } - -data "aws_partition" "current" {} -`, commonName, certificateDomainName) +`, certificateDomainName)) } func testAccCertificateConfig_privateCertificate_pendingRenewal(commonName, certificateDomainName, duration string) string { - return fmt.Sprintf(` + return acctest.ConfigCompose(testAccCertificateConfig_privateCertificateBase(commonName), fmt.Sprintf(` resource "aws_acm_certificate" "test" { - domain_name = %[2]q + domain_name = %[1]q certificate_authority_arn = aws_acmpca_certificate_authority.test.arn - early_renewal_duration = %[3]q + early_renewal_duration = %[2]q depends_on = [ aws_acmpca_certificate_authority_certificate.test, + aws_acmpca_permission.test, ] } -resource "aws_acmpca_certificate_authority" "test" { - permanent_deletion_time_in_days = 7 - type = "ROOT" - - certificate_authority_configuration { - key_algorithm = "RSA_4096" - signing_algorithm = "SHA512WITHRSA" - - subject { - common_name = %[1]q - } - } -} - resource "aws_acmpca_permission" "test" { certificate_authority_arn = aws_acmpca_certificate_authority.test.arn principal = "acm.amazonaws.com" actions = ["IssueCertificate", "GetCertificate", "ListPermissions"] } - -resource "aws_acmpca_certificate" "test" { - certificate_authority_arn = aws_acmpca_certificate_authority.test.arn - certificate_signing_request = aws_acmpca_certificate_authority.test.certificate_signing_request - signing_algorithm = "SHA512WITHRSA" - - template_arn = "arn:${data.aws_partition.current.partition}:acm-pca:::template/RootCACertificate/V1" - - validity { - type = "YEARS" - value = 2 - } -} - -resource "aws_acmpca_certificate_authority_certificate" "test" { - certificate_authority_arn = aws_acmpca_certificate_authority.test.arn - - certificate = aws_acmpca_certificate.test.certificate - certificate_chain = aws_acmpca_certificate.test.certificate_chain -} - -data "aws_partition" "current" {} -`, commonName, certificateDomainName, duration) +`, certificateDomainName, duration)) } func testAccCertificateConfig_subjectAlternativeNames(domainName, subjectAlternativeNames, validationMethod string) string { From d2a881c6c901fcb88e543d5f0ad4b466d382ba89 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Tue, 7 Mar 2023 16:37:10 -0500 Subject: [PATCH 507/763] Fix golangci-lint 'paralleltest'. --- internal/generate/common/args_test.go | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/internal/generate/common/args_test.go b/internal/generate/common/args_test.go index 3a0eabe128b3..0f089575d9fe 100644 --- a/internal/generate/common/args_test.go +++ b/internal/generate/common/args_test.go @@ -5,6 +5,8 @@ import ( ) func TestArgsEmptyString(t *testing.T) { + t.Parallel() + input := `` args := ParseArgs(input) @@ -17,6 +19,8 @@ func TestArgsEmptyString(t *testing.T) { } func TestArgsSinglePositional(t *testing.T) { + t.Parallel() + input := `aws_instance` args := ParseArgs(input) @@ -32,6 +36,8 @@ func TestArgsSinglePositional(t *testing.T) { } func TestArgsSingleQuotedPositional(t *testing.T) { + t.Parallel() + input := `"aws_instance"` args := ParseArgs(input) @@ -47,6 +53,8 @@ func TestArgsSingleQuotedPositional(t *testing.T) { } func TestArgsSingleKeyword(t *testing.T) { + t.Parallel() + input := `vv=42` args := ParseArgs(input) @@ -62,6 +70,8 @@ func TestArgsSingleKeyword(t *testing.T) { } func TestArgsMultipleKeywords(t *testing.T) { + t.Parallel() + input := `vv=42,type=aws_instance` args := ParseArgs(input) @@ -80,6 +90,8 @@ func TestArgsMultipleKeywords(t *testing.T) { } func TestArgsPostionalAndKeywords(t *testing.T) { + t.Parallel() + input := `first, vv=42 ,type=aws_instance,2` args := ParseArgs(input) From 39cf8cef1eb195da1e50a7903e9eb8536d906cb3 Mon Sep 17 00:00:00 2001 From: Javier Ramos Date: Tue, 7 Mar 2023 22:47:03 +0100 Subject: [PATCH 508/763] Add warning about discouraged launch configuration resource (#29567) * Add warning about discouraged launch configuration resource * Update website/docs/r/launch_configuration.html.markdown Co-authored-by: Simon Davis --------- Co-authored-by: Simon Davis --- website/docs/r/launch_configuration.html.markdown | 2 ++ 1 file changed, 2 insertions(+) diff --git a/website/docs/r/launch_configuration.html.markdown b/website/docs/r/launch_configuration.html.markdown index 57091f9c8e66..b460764f4c9a 100644 --- a/website/docs/r/launch_configuration.html.markdown +++ b/website/docs/r/launch_configuration.html.markdown @@ -10,6 +10,8 @@ description: |- Provides a resource to create a new launch configuration, used for autoscaling groups. +!> **WARNING:** The use of launch configurations is discouraged in favour of launch templates. Read more in the [AWS EC2 Documentation](https://docs.aws.amazon.com/autoscaling/ec2/userguide/launch-configurations.html). + -> **Note** When using `aws_launch_configuration` with `aws_autoscaling_group`, it is recommended to use the `name_prefix` (Optional) instead of the `name` (Optional) attribute. This will allow Terraform lifecycles to detect changes to the launch configuration and update the autoscaling group correctly. ## Example Usage From ee0863fb0d104454b0407262d4f43ce86fa8588f Mon Sep 17 00:00:00 2001 From: Dmitry Malinovsky Date: Tue, 7 Mar 2023 22:54:17 +0100 Subject: [PATCH 509/763] docs: adjust import syntax of aws_cognito_resource_server (#29494) The code [1] expects to receive a "PoolId|ResourceServerIdentifier" string [1] https://github.com/hashicorp/terraform-provider-aws/blob/ae683662502d49e73caf3a8d01fb4689ab400592/internal/service/cognitoidp/resource_server.go#L222 --- website/docs/r/cognito_resource_server.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/website/docs/r/cognito_resource_server.markdown b/website/docs/r/cognito_resource_server.markdown index 2e103defdb43..25521d3b8856 100644 --- a/website/docs/r/cognito_resource_server.markdown +++ b/website/docs/r/cognito_resource_server.markdown @@ -72,5 +72,5 @@ In addition to all arguments above, the following attributes are exported: `aws_cognito_resource_server` can be imported using their User Pool ID and Identifier, e.g., ``` -$ terraform import aws_cognito_resource_server.example us-west-2_abc123:https://example.com +$ terraform import aws_cognito_resource_server.example "us-west-2_abc123|https://example.com" ``` From cb866b8cc37af19ef098797818523b414583336b Mon Sep 17 00:00:00 2001 From: Gregory Kman Date: Tue, 7 Mar 2023 15:57:31 -0600 Subject: [PATCH 510/763] Fix domain_name newline (#29388) --- website/docs/r/sagemaker_domain.html.markdown | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/website/docs/r/sagemaker_domain.html.markdown b/website/docs/r/sagemaker_domain.html.markdown index b6daecf4db07..47e241fc859b 100644 --- a/website/docs/r/sagemaker_domain.html.markdown +++ b/website/docs/r/sagemaker_domain.html.markdown @@ -99,7 +99,8 @@ The following arguments are required: The following arguments are optional: * `app_network_access_type` - (Optional) Specifies the VPC used for non-EFS traffic. The default value is `PublicInternetOnly`. Valid values are `PublicInternetOnly` and `VpcOnly`. -* `app_security_group_management` - (Optional) The entity that creates and manages the required security groups for inter-app communication in `VPCOnly` mode. Valid values are `Service` and `Customer`.* `domain_settings` - (Optional) The domain settings. See [Domain Settings](#domain_settings) below. +* `app_security_group_management` - (Optional) The entity that creates and manages the required security groups for inter-app communication in `VPCOnly` mode. Valid values are `Service` and `Customer`. +* `domain_settings` - (Optional) The domain settings. See [Domain Settings](#domain_settings) below. * `domain_settings` - (Optional) The domain's settings. * `kms_key_id` - (Optional) The AWS KMS customer managed CMK used to encrypt the EFS volume attached to the domain. * `retention_policy` - (Optional) The retention policy for this domain, which specifies whether resources will be retained after the Domain is deleted. By default, all resources are retained. See [Retention Policy](#retention_policy) below. From 365eb3d7fda3b01a22476c5ac7f12a88b1061f07 Mon Sep 17 00:00:00 2001 From: Graham Davison Date: Tue, 7 Mar 2023 14:32:36 -0800 Subject: [PATCH 511/763] Removes unneeded dependency on `.go-version` --- .github/workflows/goreleaser-ci.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/goreleaser-ci.yml b/.github/workflows/goreleaser-ci.yml index d58bf3caf783..63f88008cbed 100644 --- a/.github/workflows/goreleaser-ci.yml +++ b/.github/workflows/goreleaser-ci.yml @@ -10,7 +10,6 @@ on: paths: - .github/workflows/goreleaser-ci.yml - .goreleaser.yml - - .go-version - go.sum - main.go - internal/** From 243c5f5e93c92befbb17e07d5616df21b723fc72 Mon Sep 17 00:00:00 2001 From: Graham Davison Date: Tue, 7 Mar 2023 14:32:55 -0800 Subject: [PATCH 512/763] Uses `go.mod` for release Go version --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index db72902dd5ef..03dd0a6918a0 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -39,7 +39,7 @@ jobs: with: goreleaser-release-args: '--timeout 3h --parallelism 4' release-notes: true - setup-go-version-file: '.go-version' + setup-go-version-file: go.mod # Product Version (e.g. v1.2.3 or github.ref_name) product-version: '${{ github.ref_name }}' highest-version-tag: From 034814bf4b9fa64e635df4546c5fa49657d3029e Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Tue, 7 Mar 2023 19:09:09 -0500 Subject: [PATCH 513/763] lambda/docs: Document how to fix Lambda KMSAccessDeniedException --- website/docs/d/lambda_invocation.html.markdown | 2 ++ website/docs/r/lambda_function.html.markdown | 2 ++ website/docs/r/lambda_invocation.html.markdown | 4 ++++ 3 files changed, 8 insertions(+) diff --git a/website/docs/d/lambda_invocation.html.markdown b/website/docs/d/lambda_invocation.html.markdown index d1784c6a3a94..e05dbc07d333 100644 --- a/website/docs/d/lambda_invocation.html.markdown +++ b/website/docs/d/lambda_invocation.html.markdown @@ -12,6 +12,8 @@ Use this data source to invoke custom lambda functions as data source. The lambda function is invoked with [RequestResponse](https://docs.aws.amazon.com/lambda/latest/dg/API_Invoke.html#API_Invoke_RequestSyntax) invocation type. +~> **NOTE:** If you get a `KMSAccessDeniedException: Lambda was unable to decrypt the environment variables because KMS access was denied` error when invoking an [`aws_lambda_function`](/docs/providers/aws/r/lambda_function.html) with environment variables, the IAM role associated with the function may have been deleted and recreated _after_ the function was created. You can fix the problem two ways: 1) updating the function's role to another role and then updating it back again to the recreated role, or 2) by using Terraform to `taint` the function and `apply` your configuration again to recreate the function. (When you create a function, Lambda grants permissions on the KMS key to the function's IAM role. If the IAM role is recreated, the grant is no longer valid. Changing the function's role or recreating the function causes Lambda to update the grant.) + ## Example Usage ```terraform diff --git a/website/docs/r/lambda_function.html.markdown b/website/docs/r/lambda_function.html.markdown index f0045a3edc64..cde4fcaa5d1b 100644 --- a/website/docs/r/lambda_function.html.markdown +++ b/website/docs/r/lambda_function.html.markdown @@ -16,6 +16,8 @@ For a detailed example of setting up Lambda and API Gateway, see [Serverless App ~> **NOTE:** Due to [AWS Lambda improved VPC networking changes that began deploying in September 2019](https://aws.amazon.com/blogs/compute/announcing-improved-vpc-networking-for-aws-lambda-functions/), EC2 subnets and security groups associated with Lambda Functions can take up to 45 minutes to successfully delete. Terraform AWS Provider version 2.31.0 and later automatically handles this increased timeout, however prior versions require setting the customizable deletion timeouts of those Terraform resources to 45 minutes (`delete = "45m"`). AWS and HashiCorp are working together to reduce the amount of time required for resource deletion and updates can be tracked in this [GitHub issue](https://github.com/hashicorp/terraform-provider-aws/issues/10329). +~> **NOTE:** If you get a `KMSAccessDeniedException: Lambda was unable to decrypt the environment variables because KMS access was denied` error when invoking a function with environment variables, the IAM role associated with the function may have been deleted and recreated _after_ the function was created. You can fix the problem two ways: 1) updating the function's role to another role and then updating it back again to the recreated role, or 2) by using Terraform to `taint` the [`aws_lambda_function`](/docs/providers/aws/r/lambda_function.html) and `apply` your configuration again to recreate the function. (When you create a function, Lambda grants permissions on the KMS key to the function's IAM role. If the IAM role is recreated, the grant is no longer valid. Changing the function's role or recreating the function causes Lambda to update the grant.) + -> To give an external source (like an EventBridge Rule, SNS, or S3) permission to access the Lambda function, use the [`aws_lambda_permission`](lambda_permission.html) resource. See [Lambda Permission Model][4] for more details. On the other hand, the `role` argument of this resource is the function's execution role for identity and access to AWS services and resources. ## Example Usage diff --git a/website/docs/r/lambda_invocation.html.markdown b/website/docs/r/lambda_invocation.html.markdown index 8fc5a60022d1..c4d7008604d1 100644 --- a/website/docs/r/lambda_invocation.html.markdown +++ b/website/docs/r/lambda_invocation.html.markdown @@ -12,8 +12,12 @@ Use this resource to invoke a lambda function. The lambda function is invoked wi ~> **NOTE:** This resource _only_ invokes the function when the arguments call for a create or update. In other words, after an initial invocation on _apply_, if the arguments do not change, a subsequent _apply_ does not invoke the function again. To dynamically invoke the function, see the `triggers` example below. To always invoke a function on each _apply_, see the [`aws_lambda_invocation`](/docs/providers/aws/d/lambda_invocation.html) data source. +~> **NOTE:** If you get a `KMSAccessDeniedException: Lambda was unable to decrypt the environment variables because KMS access was denied` error when invoking a function with environment variables, the IAM role associated with the function may have been deleted and recreated _after_ the function was created. You can fix the problem two ways: 1) updating the function's role to another role and then updating it back again to the recreated role, or 2) by using Terraform to `taint` the [`aws_lambda_function`](/docs/providers/aws/r/lambda_function.html) and `apply` your configuration again to recreate the function. (When you create a function, Lambda grants permissions on the KMS key to the function's IAM role. If the IAM role is recreated, the grant is no longer valid. Changing the function's role or recreating the function causes Lambda to update the grant.) + ## Example Usage +### Basic Example + ```terraform resource "aws_lambda_invocation" "example" { function_name = aws_lambda_function.lambda_function_test.function_name From 999ca96d102dc1e9bcf4c44507227fdef27ac8ab Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Tue, 7 Mar 2023 19:13:13 -0500 Subject: [PATCH 514/763] Fix link --- website/docs/r/lambda_function.html.markdown | 2 +- website/docs/r/lambda_invocation.html.markdown | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/website/docs/r/lambda_function.html.markdown b/website/docs/r/lambda_function.html.markdown index cde4fcaa5d1b..56c842bdf57f 100644 --- a/website/docs/r/lambda_function.html.markdown +++ b/website/docs/r/lambda_function.html.markdown @@ -16,7 +16,7 @@ For a detailed example of setting up Lambda and API Gateway, see [Serverless App ~> **NOTE:** Due to [AWS Lambda improved VPC networking changes that began deploying in September 2019](https://aws.amazon.com/blogs/compute/announcing-improved-vpc-networking-for-aws-lambda-functions/), EC2 subnets and security groups associated with Lambda Functions can take up to 45 minutes to successfully delete. Terraform AWS Provider version 2.31.0 and later automatically handles this increased timeout, however prior versions require setting the customizable deletion timeouts of those Terraform resources to 45 minutes (`delete = "45m"`). AWS and HashiCorp are working together to reduce the amount of time required for resource deletion and updates can be tracked in this [GitHub issue](https://github.com/hashicorp/terraform-provider-aws/issues/10329). -~> **NOTE:** If you get a `KMSAccessDeniedException: Lambda was unable to decrypt the environment variables because KMS access was denied` error when invoking a function with environment variables, the IAM role associated with the function may have been deleted and recreated _after_ the function was created. You can fix the problem two ways: 1) updating the function's role to another role and then updating it back again to the recreated role, or 2) by using Terraform to `taint` the [`aws_lambda_function`](/docs/providers/aws/r/lambda_function.html) and `apply` your configuration again to recreate the function. (When you create a function, Lambda grants permissions on the KMS key to the function's IAM role. If the IAM role is recreated, the grant is no longer valid. Changing the function's role or recreating the function causes Lambda to update the grant.) +~> **NOTE:** If you get a `KMSAccessDeniedException: Lambda was unable to decrypt the environment variables because KMS access was denied` error when invoking an [`aws_lambda_function`](/docs/providers/aws/r/lambda_function.html) with environment variables, the IAM role associated with the function may have been deleted and recreated _after_ the function was created. You can fix the problem two ways: 1) updating the function's role to another role and then updating it back again to the recreated role, or 2) by using Terraform to `taint` the function and `apply` your configuration again to recreate the function. (When you create a function, Lambda grants permissions on the KMS key to the function's IAM role. If the IAM role is recreated, the grant is no longer valid. Changing the function's role or recreating the function causes Lambda to update the grant.) -> To give an external source (like an EventBridge Rule, SNS, or S3) permission to access the Lambda function, use the [`aws_lambda_permission`](lambda_permission.html) resource. See [Lambda Permission Model][4] for more details. On the other hand, the `role` argument of this resource is the function's execution role for identity and access to AWS services and resources. diff --git a/website/docs/r/lambda_invocation.html.markdown b/website/docs/r/lambda_invocation.html.markdown index c4d7008604d1..21f2baf30a8b 100644 --- a/website/docs/r/lambda_invocation.html.markdown +++ b/website/docs/r/lambda_invocation.html.markdown @@ -12,7 +12,7 @@ Use this resource to invoke a lambda function. The lambda function is invoked wi ~> **NOTE:** This resource _only_ invokes the function when the arguments call for a create or update. In other words, after an initial invocation on _apply_, if the arguments do not change, a subsequent _apply_ does not invoke the function again. To dynamically invoke the function, see the `triggers` example below. To always invoke a function on each _apply_, see the [`aws_lambda_invocation`](/docs/providers/aws/d/lambda_invocation.html) data source. -~> **NOTE:** If you get a `KMSAccessDeniedException: Lambda was unable to decrypt the environment variables because KMS access was denied` error when invoking a function with environment variables, the IAM role associated with the function may have been deleted and recreated _after_ the function was created. You can fix the problem two ways: 1) updating the function's role to another role and then updating it back again to the recreated role, or 2) by using Terraform to `taint` the [`aws_lambda_function`](/docs/providers/aws/r/lambda_function.html) and `apply` your configuration again to recreate the function. (When you create a function, Lambda grants permissions on the KMS key to the function's IAM role. If the IAM role is recreated, the grant is no longer valid. Changing the function's role or recreating the function causes Lambda to update the grant.) +~> **NOTE:** If you get a `KMSAccessDeniedException: Lambda was unable to decrypt the environment variables because KMS access was denied` error when invoking an [`aws_lambda_function`](/docs/providers/aws/r/lambda_function.html) with environment variables, the IAM role associated with the function may have been deleted and recreated _after_ the function was created. You can fix the problem two ways: 1) updating the function's role to another role and then updating it back again to the recreated role, or 2) by using Terraform to `taint` the function and `apply` your configuration again to recreate the function. (When you create a function, Lambda grants permissions on the KMS key to the function's IAM role. If the IAM role is recreated, the grant is no longer valid. Changing the function's role or recreating the function causes Lambda to update the grant.) ## Example Usage From bb8b39645377e43e0ab6c79c917fb0ec0f0e0027 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Wed, 8 Mar 2023 06:21:32 -0500 Subject: [PATCH 515/763] Generate 'servicepackage.ListTags' and 'servicepackage.UpdateTags' for AWS SDK v2. --- internal/generate/tags/main.go | 2 +- internal/generate/tags/templates/v2/header_body.tmpl | 3 +++ internal/generate/tags/templates/v2/list_tags_body.tmpl | 4 ++++ .../generate/tags/templates/v2/update_tags_body.tmpl | 4 ++++ internal/service/auditmanager/tags_gen.go | 9 +++++++++ internal/service/comprehend/tags_gen.go | 9 +++++++++ internal/service/fis/tags_gen.go | 9 +++++++++ internal/service/healthlake/tags_gen.go | 9 +++++++++ internal/service/ivschat/tags_gen.go | 9 +++++++++ internal/service/kendra/tags_gen.go | 9 +++++++++ internal/service/lambda/tags_gen.go | 5 +++++ internal/service/medialive/tags_gen.go | 9 +++++++++ internal/service/oam/tags_gen.go | 9 +++++++++ internal/service/opensearchserverless/tags_gen.go | 9 +++++++++ internal/service/resourceexplorer2/tags_gen.go | 9 +++++++++ internal/service/rolesanywhere/tags_gen.go | 9 +++++++++ internal/service/route53domains/tags_gen.go | 9 +++++++++ internal/service/scheduler/tags_gen.go | 9 +++++++++ internal/service/sesv2/tags_gen.go | 9 +++++++++ internal/service/transcribe/tags_gen.go | 9 +++++++++ 20 files changed, 152 insertions(+), 1 deletion(-) diff --git a/internal/generate/tags/main.go b/internal/generate/tags/main.go index 955192356bc0..4c6c3164038c 100644 --- a/internal/generate/tags/main.go +++ b/internal/generate/tags/main.go @@ -230,7 +230,7 @@ func main() { ProviderNameUpper: providerNameUpper, ServicePackage: servicePackage, - ConnsPkg: *sdkVersion == sdkV1 && (*listTags || *updateTags), + ConnsPkg: *listTags || *updateTags, ContextPkg: *sdkVersion == sdkV2 || (*getTag || *listTags || *serviceTagsMap || *serviceTagsSlice || *updateTags), FmtPkg: *updateTags, HelperSchemaPkg: awsPkg == "autoscaling", diff --git a/internal/generate/tags/templates/v2/header_body.tmpl b/internal/generate/tags/templates/v2/header_body.tmpl index dc02865ceba7..d54451f5c495 100644 --- a/internal/generate/tags/templates/v2/header_body.tmpl +++ b/internal/generate/tags/templates/v2/header_body.tmpl @@ -25,6 +25,9 @@ import ( "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" {{- end }} + {{- if .ConnsPkg }} + "github.com/hashicorp/terraform-provider-aws/internal/conns" + {{- end }} {{- if .TfResourcePkg }} "github.com/hashicorp/terraform-provider-aws/internal/tfresource" {{- end }} diff --git a/internal/generate/tags/templates/v2/list_tags_body.tmpl b/internal/generate/tags/templates/v2/list_tags_body.tmpl index c14e618a5baf..d84ff66034bf 100644 --- a/internal/generate/tags/templates/v2/list_tags_body.tmpl +++ b/internal/generate/tags/templates/v2/list_tags_body.tmpl @@ -47,3 +47,7 @@ func {{ .ListTagsFunc }}(ctx context.Context, conn {{ .ClientType }}, identifier return KeyValueTags(ctx, output.{{ .ListTagsOutTagsElem }}{{ if .TagTypeIDElem }}, identifier{{ if .TagResTypeElem }}, resourceType{{ end }}{{ end }}), nil } + +func (p *servicePackage) {{ .ListTagsFunc }}(ctx context.Context, meta any, identifier{{ if .TagResTypeElem }}, resourceType{{ end }} string) (tftags.KeyValueTags, error) { + return {{ .ListTagsFunc }}(ctx, meta.(*conns.AWSClient).{{ .ProviderNameUpper }}Client(), identifier{{ if .TagResTypeElem }}, resourceType{{ end }}) +} diff --git a/internal/generate/tags/templates/v2/update_tags_body.tmpl b/internal/generate/tags/templates/v2/update_tags_body.tmpl index be4c3e9cb5ed..1bff3ea22072 100644 --- a/internal/generate/tags/templates/v2/update_tags_body.tmpl +++ b/internal/generate/tags/templates/v2/update_tags_body.tmpl @@ -128,3 +128,7 @@ func {{ .UpdateTagsFunc }}(ctx context.Context, conn {{ .ClientType }}, identifi return nil } + +func (p *servicePackage) {{ .UpdateTagsFunc }}(ctx context.Context, meta any, identifier string{{ if .TagResTypeElem }}, resourceType string{{ end }}, oldTags, newTags any) error { + return {{ .UpdateTagsFunc }}(ctx, meta.(*conns.AWSClient).{{ .ProviderNameUpper }}Client(), identifier{{ if .TagResTypeElem }}, resourceType{{ end }}, oldTags, newTags) +} diff --git a/internal/service/auditmanager/tags_gen.go b/internal/service/auditmanager/tags_gen.go index 261fbbf6f7b3..1c86fe3c464d 100644 --- a/internal/service/auditmanager/tags_gen.go +++ b/internal/service/auditmanager/tags_gen.go @@ -7,6 +7,7 @@ import ( "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/service/auditmanager" + "github.com/hashicorp/terraform-provider-aws/internal/conns" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" ) @@ -27,6 +28,10 @@ func ListTags(ctx context.Context, conn *auditmanager.Client, identifier string) return KeyValueTags(ctx, output.Tags), nil } +func (p *servicePackage) ListTags(ctx context.Context, meta any, identifier string) (tftags.KeyValueTags, error) { + return ListTags(ctx, meta.(*conns.AWSClient).AuditManagerClient(), identifier) +} + // map[string]string handling // Tags returns auditmanager service tags. @@ -74,3 +79,7 @@ func UpdateTags(ctx context.Context, conn *auditmanager.Client, identifier strin return nil } + +func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags, newTags any) error { + return UpdateTags(ctx, meta.(*conns.AWSClient).AuditManagerClient(), identifier, oldTags, newTags) +} diff --git a/internal/service/comprehend/tags_gen.go b/internal/service/comprehend/tags_gen.go index 19b161c0609a..5c0a04881e71 100644 --- a/internal/service/comprehend/tags_gen.go +++ b/internal/service/comprehend/tags_gen.go @@ -8,6 +8,7 @@ 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" + "github.com/hashicorp/terraform-provider-aws/internal/conns" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" ) @@ -28,6 +29,10 @@ func ListTags(ctx context.Context, conn *comprehend.Client, identifier string) ( return KeyValueTags(ctx, output.Tags), nil } +func (p *servicePackage) ListTags(ctx context.Context, meta any, identifier string) (tftags.KeyValueTags, error) { + return ListTags(ctx, meta.(*conns.AWSClient).ComprehendClient(), identifier) +} + // []*SERVICE.Tag handling // Tags returns comprehend service tags. @@ -92,3 +97,7 @@ func UpdateTags(ctx context.Context, conn *comprehend.Client, identifier string, return nil } + +func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags, newTags any) error { + return UpdateTags(ctx, meta.(*conns.AWSClient).ComprehendClient(), identifier, oldTags, newTags) +} diff --git a/internal/service/fis/tags_gen.go b/internal/service/fis/tags_gen.go index 663e334128ee..807d94592c36 100644 --- a/internal/service/fis/tags_gen.go +++ b/internal/service/fis/tags_gen.go @@ -7,6 +7,7 @@ import ( "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/service/fis" + "github.com/hashicorp/terraform-provider-aws/internal/conns" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" ) @@ -27,6 +28,10 @@ func ListTags(ctx context.Context, conn *fis.Client, identifier string) (tftags. return KeyValueTags(ctx, output.Tags), nil } +func (p *servicePackage) ListTags(ctx context.Context, meta any, identifier string) (tftags.KeyValueTags, error) { + return ListTags(ctx, meta.(*conns.AWSClient).FISClient(), identifier) +} + // map[string]string handling // Tags returns fis service tags. @@ -74,3 +79,7 @@ func UpdateTags(ctx context.Context, conn *fis.Client, identifier string, oldTag return nil } + +func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags, newTags any) error { + return UpdateTags(ctx, meta.(*conns.AWSClient).FISClient(), identifier, oldTags, newTags) +} diff --git a/internal/service/healthlake/tags_gen.go b/internal/service/healthlake/tags_gen.go index 3b323ab54314..b9d0e86adaba 100644 --- a/internal/service/healthlake/tags_gen.go +++ b/internal/service/healthlake/tags_gen.go @@ -8,6 +8,7 @@ import ( "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/service/healthlake" "github.com/aws/aws-sdk-go-v2/service/healthlake/types" + "github.com/hashicorp/terraform-provider-aws/internal/conns" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" ) @@ -28,6 +29,10 @@ func ListTags(ctx context.Context, conn *healthlake.Client, identifier string) ( return KeyValueTags(ctx, output.Tags), nil } +func (p *servicePackage) ListTags(ctx context.Context, meta any, identifier string) (tftags.KeyValueTags, error) { + return ListTags(ctx, meta.(*conns.AWSClient).HealthLakeClient(), identifier) +} + // []*SERVICE.Tag handling // Tags returns healthlake service tags. @@ -92,3 +97,7 @@ func UpdateTags(ctx context.Context, conn *healthlake.Client, identifier string, return nil } + +func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags, newTags any) error { + return UpdateTags(ctx, meta.(*conns.AWSClient).HealthLakeClient(), identifier, oldTags, newTags) +} diff --git a/internal/service/ivschat/tags_gen.go b/internal/service/ivschat/tags_gen.go index 7d5d9486e656..a36e2b9f134c 100644 --- a/internal/service/ivschat/tags_gen.go +++ b/internal/service/ivschat/tags_gen.go @@ -7,6 +7,7 @@ import ( "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/service/ivschat" + "github.com/hashicorp/terraform-provider-aws/internal/conns" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" ) @@ -27,6 +28,10 @@ func ListTags(ctx context.Context, conn *ivschat.Client, identifier string) (tft return KeyValueTags(ctx, output.Tags), nil } +func (p *servicePackage) ListTags(ctx context.Context, meta any, identifier string) (tftags.KeyValueTags, error) { + return ListTags(ctx, meta.(*conns.AWSClient).IVSChatClient(), identifier) +} + // map[string]string handling // Tags returns ivschat service tags. @@ -74,3 +79,7 @@ func UpdateTags(ctx context.Context, conn *ivschat.Client, identifier string, ol return nil } + +func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags, newTags any) error { + return UpdateTags(ctx, meta.(*conns.AWSClient).IVSChatClient(), identifier, oldTags, newTags) +} diff --git a/internal/service/kendra/tags_gen.go b/internal/service/kendra/tags_gen.go index 4764f3b68d17..d99e4398773c 100644 --- a/internal/service/kendra/tags_gen.go +++ b/internal/service/kendra/tags_gen.go @@ -8,6 +8,7 @@ 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" + "github.com/hashicorp/terraform-provider-aws/internal/conns" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" ) @@ -28,6 +29,10 @@ func ListTags(ctx context.Context, conn *kendra.Client, identifier string) (tfta return KeyValueTags(ctx, output.Tags), nil } +func (p *servicePackage) ListTags(ctx context.Context, meta any, identifier string) (tftags.KeyValueTags, error) { + return ListTags(ctx, meta.(*conns.AWSClient).KendraClient(), identifier) +} + // []*SERVICE.Tag handling // Tags returns kendra service tags. @@ -92,3 +97,7 @@ func UpdateTags(ctx context.Context, conn *kendra.Client, identifier string, old return nil } + +func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags, newTags any) error { + return UpdateTags(ctx, meta.(*conns.AWSClient).KendraClient(), identifier, oldTags, newTags) +} diff --git a/internal/service/lambda/tags_gen.go b/internal/service/lambda/tags_gen.go index 695a8b4df115..960715c9df93 100644 --- a/internal/service/lambda/tags_gen.go +++ b/internal/service/lambda/tags_gen.go @@ -7,6 +7,7 @@ import ( "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/service/lambda" + "github.com/hashicorp/terraform-provider-aws/internal/conns" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" ) @@ -57,3 +58,7 @@ func UpdateTags(ctx context.Context, conn *lambda.Client, identifier string, old return nil } + +func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags, newTags any) error { + return UpdateTags(ctx, meta.(*conns.AWSClient).LambdaClient(), identifier, oldTags, newTags) +} diff --git a/internal/service/medialive/tags_gen.go b/internal/service/medialive/tags_gen.go index a2a09f83ee3f..7a269c7e2e06 100644 --- a/internal/service/medialive/tags_gen.go +++ b/internal/service/medialive/tags_gen.go @@ -7,6 +7,7 @@ import ( "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/service/medialive" + "github.com/hashicorp/terraform-provider-aws/internal/conns" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" ) @@ -27,6 +28,10 @@ func ListTags(ctx context.Context, conn *medialive.Client, identifier string) (t return KeyValueTags(ctx, output.Tags), nil } +func (p *servicePackage) ListTags(ctx context.Context, meta any, identifier string) (tftags.KeyValueTags, error) { + return ListTags(ctx, meta.(*conns.AWSClient).MediaLiveClient(), identifier) +} + // map[string]string handling // Tags returns medialive service tags. @@ -74,3 +79,7 @@ func UpdateTags(ctx context.Context, conn *medialive.Client, identifier string, return nil } + +func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags, newTags any) error { + return UpdateTags(ctx, meta.(*conns.AWSClient).MediaLiveClient(), identifier, oldTags, newTags) +} diff --git a/internal/service/oam/tags_gen.go b/internal/service/oam/tags_gen.go index 420e93c99976..f0e79cc84458 100644 --- a/internal/service/oam/tags_gen.go +++ b/internal/service/oam/tags_gen.go @@ -7,6 +7,7 @@ import ( "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/service/oam" + "github.com/hashicorp/terraform-provider-aws/internal/conns" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" ) @@ -27,6 +28,10 @@ func ListTags(ctx context.Context, conn *oam.Client, identifier string) (tftags. return KeyValueTags(ctx, output.Tags), nil } +func (p *servicePackage) ListTags(ctx context.Context, meta any, identifier string) (tftags.KeyValueTags, error) { + return ListTags(ctx, meta.(*conns.AWSClient).ObservabilityAccessManagerClient(), identifier) +} + // map[string]string handling // Tags returns oam service tags. @@ -74,3 +79,7 @@ func UpdateTags(ctx context.Context, conn *oam.Client, identifier string, oldTag return nil } + +func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags, newTags any) error { + return UpdateTags(ctx, meta.(*conns.AWSClient).ObservabilityAccessManagerClient(), identifier, oldTags, newTags) +} diff --git a/internal/service/opensearchserverless/tags_gen.go b/internal/service/opensearchserverless/tags_gen.go index 5a09a44333be..19cee575881a 100644 --- a/internal/service/opensearchserverless/tags_gen.go +++ b/internal/service/opensearchserverless/tags_gen.go @@ -8,6 +8,7 @@ import ( "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/service/opensearchserverless" "github.com/aws/aws-sdk-go-v2/service/opensearchserverless/types" + "github.com/hashicorp/terraform-provider-aws/internal/conns" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" ) @@ -28,6 +29,10 @@ func ListTags(ctx context.Context, conn *opensearchserverless.Client, identifier return KeyValueTags(ctx, output.Tags), nil } +func (p *servicePackage) ListTags(ctx context.Context, meta any, identifier string) (tftags.KeyValueTags, error) { + return ListTags(ctx, meta.(*conns.AWSClient).OpenSearchServerlessClient(), identifier) +} + // []*SERVICE.Tag handling // Tags returns opensearchserverless service tags. @@ -92,3 +97,7 @@ func UpdateTags(ctx context.Context, conn *opensearchserverless.Client, identifi return nil } + +func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags, newTags any) error { + return UpdateTags(ctx, meta.(*conns.AWSClient).OpenSearchServerlessClient(), identifier, oldTags, newTags) +} diff --git a/internal/service/resourceexplorer2/tags_gen.go b/internal/service/resourceexplorer2/tags_gen.go index 06d7e57b49ba..b3c5247e0a55 100644 --- a/internal/service/resourceexplorer2/tags_gen.go +++ b/internal/service/resourceexplorer2/tags_gen.go @@ -7,6 +7,7 @@ import ( "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/service/resourceexplorer2" + "github.com/hashicorp/terraform-provider-aws/internal/conns" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" ) @@ -27,6 +28,10 @@ func ListTags(ctx context.Context, conn *resourceexplorer2.Client, identifier st return KeyValueTags(ctx, output.Tags), nil } +func (p *servicePackage) ListTags(ctx context.Context, meta any, identifier string) (tftags.KeyValueTags, error) { + return ListTags(ctx, meta.(*conns.AWSClient).ResourceExplorer2Client(), identifier) +} + // map[string]string handling // Tags returns resourceexplorer2 service tags. @@ -74,3 +79,7 @@ func UpdateTags(ctx context.Context, conn *resourceexplorer2.Client, identifier return nil } + +func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags, newTags any) error { + return UpdateTags(ctx, meta.(*conns.AWSClient).ResourceExplorer2Client(), identifier, oldTags, newTags) +} diff --git a/internal/service/rolesanywhere/tags_gen.go b/internal/service/rolesanywhere/tags_gen.go index d7d9b7b28dee..fe77f02753a5 100644 --- a/internal/service/rolesanywhere/tags_gen.go +++ b/internal/service/rolesanywhere/tags_gen.go @@ -8,6 +8,7 @@ import ( "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/service/rolesanywhere" "github.com/aws/aws-sdk-go-v2/service/rolesanywhere/types" + "github.com/hashicorp/terraform-provider-aws/internal/conns" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" ) @@ -28,6 +29,10 @@ func ListTags(ctx context.Context, conn *rolesanywhere.Client, identifier string return KeyValueTags(ctx, output.Tags), nil } +func (p *servicePackage) ListTags(ctx context.Context, meta any, identifier string) (tftags.KeyValueTags, error) { + return ListTags(ctx, meta.(*conns.AWSClient).RolesAnywhereClient(), identifier) +} + // []*SERVICE.Tag handling // Tags returns rolesanywhere service tags. @@ -92,3 +97,7 @@ func UpdateTags(ctx context.Context, conn *rolesanywhere.Client, identifier stri return nil } + +func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags, newTags any) error { + return UpdateTags(ctx, meta.(*conns.AWSClient).RolesAnywhereClient(), identifier, oldTags, newTags) +} diff --git a/internal/service/route53domains/tags_gen.go b/internal/service/route53domains/tags_gen.go index 8cd017b98ec9..09bf067bcb3a 100644 --- a/internal/service/route53domains/tags_gen.go +++ b/internal/service/route53domains/tags_gen.go @@ -8,6 +8,7 @@ import ( "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/service/route53domains" "github.com/aws/aws-sdk-go-v2/service/route53domains/types" + "github.com/hashicorp/terraform-provider-aws/internal/conns" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" ) @@ -48,6 +49,10 @@ func ListTags(ctx context.Context, conn *route53domains.Client, identifier strin return KeyValueTags(ctx, output.TagList), nil } +func (p *servicePackage) ListTags(ctx context.Context, meta any, identifier string) (tftags.KeyValueTags, error) { + return ListTags(ctx, meta.(*conns.AWSClient).Route53DomainsClient(), identifier) +} + // []*SERVICE.Tag handling // Tags returns route53domains service tags. @@ -112,3 +117,7 @@ func UpdateTags(ctx context.Context, conn *route53domains.Client, identifier str return nil } + +func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags, newTags any) error { + return UpdateTags(ctx, meta.(*conns.AWSClient).Route53DomainsClient(), identifier, oldTags, newTags) +} diff --git a/internal/service/scheduler/tags_gen.go b/internal/service/scheduler/tags_gen.go index c66155b355f3..0baaa9172e1b 100644 --- a/internal/service/scheduler/tags_gen.go +++ b/internal/service/scheduler/tags_gen.go @@ -8,6 +8,7 @@ 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" + "github.com/hashicorp/terraform-provider-aws/internal/conns" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" ) @@ -28,6 +29,10 @@ func ListTags(ctx context.Context, conn *scheduler.Client, identifier string) (t return KeyValueTags(ctx, output.Tags), nil } +func (p *servicePackage) ListTags(ctx context.Context, meta any, identifier string) (tftags.KeyValueTags, error) { + return ListTags(ctx, meta.(*conns.AWSClient).SchedulerClient(), identifier) +} + // []*SERVICE.Tag handling // Tags returns scheduler service tags. @@ -92,3 +97,7 @@ func UpdateTags(ctx context.Context, conn *scheduler.Client, identifier string, return nil } + +func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags, newTags any) error { + return UpdateTags(ctx, meta.(*conns.AWSClient).SchedulerClient(), identifier, oldTags, newTags) +} diff --git a/internal/service/sesv2/tags_gen.go b/internal/service/sesv2/tags_gen.go index ec2747c21fd1..3c71e2781109 100644 --- a/internal/service/sesv2/tags_gen.go +++ b/internal/service/sesv2/tags_gen.go @@ -8,6 +8,7 @@ import ( "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/service/sesv2" "github.com/aws/aws-sdk-go-v2/service/sesv2/types" + "github.com/hashicorp/terraform-provider-aws/internal/conns" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" ) @@ -28,6 +29,10 @@ func ListTags(ctx context.Context, conn *sesv2.Client, identifier string) (tftag return KeyValueTags(ctx, output.Tags), nil } +func (p *servicePackage) ListTags(ctx context.Context, meta any, identifier string) (tftags.KeyValueTags, error) { + return ListTags(ctx, meta.(*conns.AWSClient).SESV2Client(), identifier) +} + // []*SERVICE.Tag handling // Tags returns sesv2 service tags. @@ -92,3 +97,7 @@ func UpdateTags(ctx context.Context, conn *sesv2.Client, identifier string, oldT return nil } + +func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags, newTags any) error { + return UpdateTags(ctx, meta.(*conns.AWSClient).SESV2Client(), identifier, oldTags, newTags) +} diff --git a/internal/service/transcribe/tags_gen.go b/internal/service/transcribe/tags_gen.go index 0e40dcb9c64f..483be7ddc389 100644 --- a/internal/service/transcribe/tags_gen.go +++ b/internal/service/transcribe/tags_gen.go @@ -8,6 +8,7 @@ import ( "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/service/transcribe" "github.com/aws/aws-sdk-go-v2/service/transcribe/types" + "github.com/hashicorp/terraform-provider-aws/internal/conns" tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" ) @@ -28,6 +29,10 @@ func ListTags(ctx context.Context, conn *transcribe.Client, identifier string) ( return KeyValueTags(ctx, output.Tags), nil } +func (p *servicePackage) ListTags(ctx context.Context, meta any, identifier string) (tftags.KeyValueTags, error) { + return ListTags(ctx, meta.(*conns.AWSClient).TranscribeClient(), identifier) +} + // []*SERVICE.Tag handling // Tags returns transcribe service tags. @@ -92,3 +97,7 @@ func UpdateTags(ctx context.Context, conn *transcribe.Client, identifier string, return nil } + +func (p *servicePackage) UpdateTags(ctx context.Context, meta any, identifier string, oldTags, newTags any) error { + return UpdateTags(ctx, meta.(*conns.AWSClient).TranscribeClient(), identifier, oldTags, newTags) +} From c9f460f4505fa1dde2cedc74f75e71e4a2d10994 Mon Sep 17 00:00:00 2001 From: Brittan DeYoung <32572259+brittandeyoung@users.noreply.github.com> Date: Wed, 8 Mar 2023 08:19:47 -0500 Subject: [PATCH 516/763] licensemanager: Amend grant, update find method to handle rejected status --- internal/service/licensemanager/grant.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/internal/service/licensemanager/grant.go b/internal/service/licensemanager/grant.go index 3aceab47d436..45a6b9404c16 100644 --- a/internal/service/licensemanager/grant.go +++ b/internal/service/licensemanager/grant.go @@ -174,6 +174,11 @@ func resourceGrantDelete(ctx context.Context, d *schema.ResourceData, meta inter out, err := FindGrantByARN(ctx, conn, d.Id()) + if tfresource.NotFound(err) { + create.LogNotFoundRemoveState(names.LicenseManager, create.ErrActionReading, ResGrant, d.Id()) + return nil + } + if err != nil { return create.DiagError(names.LicenseManager, create.ErrActionReading, ResGrant, d.Id(), err) } @@ -210,7 +215,7 @@ func FindGrantByARN(ctx context.Context, conn *licensemanager.LicenseManager, ar return nil, err } - if out == nil || out.Grant == nil || aws.StringValue(out.Grant.GrantStatus) == licensemanager.GrantStatusDeleted { + if out == nil || out.Grant == nil || aws.StringValue(out.Grant.GrantStatus) == licensemanager.GrantStatusDeleted || aws.StringValue(out.Grant.GrantStatus) == licensemanager.GrantStatusRejected { return nil, tfresource.NewEmptyResultError(in) } From 08239d88a07c0887d58365d073e11524c3740333 Mon Sep 17 00:00:00 2001 From: Brittan DeYoung <32572259+brittandeyoung@users.noreply.github.com> Date: Wed, 8 Mar 2023 08:20:15 -0500 Subject: [PATCH 517/763] licensemanager: Amend grant_accepter_test, use data source for testing --- .../licensemanager/grant_accepter_test.go | 82 ++++++++++++------- 1 file changed, 53 insertions(+), 29 deletions(-) diff --git a/internal/service/licensemanager/grant_accepter_test.go b/internal/service/licensemanager/grant_accepter_test.go index 7ea163585ede..a6e8689e4908 100644 --- a/internal/service/licensemanager/grant_accepter_test.go +++ b/internal/service/licensemanager/grant_accepter_test.go @@ -7,6 +7,7 @@ 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" "github.com/hashicorp/terraform-provider-aws/internal/acctest" @@ -17,39 +18,40 @@ import ( func TestAccLicenseManagerGrantAccepter_basic(t *testing.T) { ctx := acctest.Context(t) - grantARNKey := "LICENSE_MANAGER_GRANT_ACCEPTER_ARN_BASIC" - grantARN := os.Getenv(grantARNKey) - if grantARN == "" { - t.Skipf("Environment variable %s is not set to true", grantARNKey) + rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) + licenseKey := "LICENSE_MANAGER_GRANT_LICENSE_ARN" + licenseARN := os.Getenv(licenseKey) + if licenseARN == "" { + t.Skipf("Environment variable %s is not set to true", licenseKey) } resourceName := "aws_licensemanager_grant_accepter.test" + resourceGrantName := "aws_licensemanager_grant.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { + acctest.PreCheck(t) + }, ErrorCheck: acctest.ErrorCheck(t, licensemanager.EndpointsID), - ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ProtoV5ProviderFactories: acctest.ProtoV5FactoriesAlternate(ctx, t), CheckDestroy: testAccCheckGrantAccepterDestroy(ctx), Steps: []resource.TestStep{ { - Config: testAccGrantAccepterConfig_basic(grantARN), + Config: testAccGrantAccepterConfig_basic(licenseARN, rName), Check: resource.ComposeAggregateTestCheckFunc( testAccCheckGrantAccepterExists(ctx, resourceName), - resource.TestCheckResourceAttrSet(resourceName, "grant_arn"), - resource.TestCheckTypeSetElemAttr(resourceName, "allowed_operations.*", "ListPurchasedLicenses"), - resource.TestCheckTypeSetElemAttr(resourceName, "allowed_operations.*", "CheckoutLicense"), - resource.TestCheckTypeSetElemAttr(resourceName, "allowed_operations.*", "CheckInLicense"), - resource.TestCheckTypeSetElemAttr(resourceName, "allowed_operations.*", "ExtendConsumptionLicense"), - resource.TestCheckTypeSetElemAttr(resourceName, "allowed_operations.*", "CreateToken"), - resource.TestCheckResourceAttrSet(resourceName, "home_region"), - resource.TestCheckResourceAttrSet(resourceName, "license_arn"), - resource.TestCheckResourceAttrSet(resourceName, "name"), - resource.TestCheckResourceAttrSet(resourceName, "parent_arn"), - resource.TestCheckResourceAttrSet(resourceName, "principal"), + resource.TestCheckResourceAttrPair(resourceName, "grant_arn", resourceGrantName, "arn"), + resource.TestCheckResourceAttrSet(resourceName, "allowed_operations.0"), + resource.TestCheckResourceAttrPair(resourceName, "home_region", resourceGrantName, "home_region"), + resource.TestCheckResourceAttr(resourceName, "license_arn", licenseARN), + resource.TestCheckResourceAttrPair(resourceName, "name", resourceGrantName, "name"), + resource.TestCheckResourceAttrPair(resourceName, "parent_arn", resourceGrantName, "parent_arn"), + resource.TestCheckResourceAttrPair(resourceName, "principal", resourceGrantName, "principal"), resource.TestCheckResourceAttrSet(resourceName, "status"), resource.TestCheckResourceAttrSet(resourceName, "version"), ), }, { + Config: testAccGrantAccepterConfig_basic(licenseARN, rName), ResourceName: resourceName, ImportState: true, ImportStateVerify: true, @@ -60,21 +62,24 @@ func TestAccLicenseManagerGrantAccepter_basic(t *testing.T) { func TestAccLicenseManagerGrantAccepter_disappears(t *testing.T) { ctx := acctest.Context(t) - grantARNKey := "LICENSE_MANAGER_GRANT_ACCEPTER_ARN_DISAPPEARS" - grantARN := os.Getenv(grantARNKey) - if grantARN == "" { - t.Skipf("Environment variable %s is not set to true", grantARNKey) + rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) + licenseKey := "LICENSE_MANAGER_GRANT_LICENSE_ARN" + licenseARN := os.Getenv(licenseKey) + if licenseARN == "" { + t.Skipf("Environment variable %s is not set to true", licenseKey) } resourceName := "aws_licensemanager_grant_accepter.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, + PreCheck: func() { + acctest.PreCheck(t) + }, ErrorCheck: acctest.ErrorCheck(t, licensemanager.EndpointsID), - ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ProtoV5ProviderFactories: acctest.ProtoV5FactoriesAlternate(ctx, t), CheckDestroy: testAccCheckGrantAccepterDestroy(ctx), Steps: []resource.TestStep{ { - Config: testAccGrantAccepterConfig_basic(grantARN), + Config: testAccGrantAccepterConfig_basic(licenseARN, rName), Check: resource.ComposeTestCheckFunc( testAccCheckGrantAccepterExists(ctx, resourceName), acctest.CheckResourceDisappears(ctx, acctest.Provider, tflicensemanager.ResourceGrantAccepter(), resourceName), @@ -138,10 +143,29 @@ func testAccCheckGrantAccepterDestroy(ctx context.Context) resource.TestCheckFun } } -func testAccGrantAccepterConfig_basic(grantARN string) string { - return fmt.Sprintf(` +func testAccGrantAccepterConfig_basic(licenseARN string, rName string) string { + return acctest.ConfigAlternateAccountProvider() + fmt.Sprintf(` +data "aws_licensemanager_received_license" "test" { + provider = awsalternate + license_arn = %[1]q +} + +locals { + allowed_operations = [for i in data.aws_licensemanager_received_license.test.received_metadata[0].allowed_operations : i if i != "CreateGrant"] +} + +resource "aws_licensemanager_grant" "test" { + provider = awsalternate + + name = %[2]q + allowed_operations = local.allowed_operations + license_arn = data.aws_licensemanager_received_license.test.license_arn + principal = "arn:aws:iam::${data.aws_caller_identity.current.account_id}:root" +} +data "aws_caller_identity" "current" {} + resource "aws_licensemanager_grant_accepter" "test" { - grant_arn = %[1]q + grant_arn = aws_licensemanager_grant.test.arn } -`, grantARN) +`, licenseARN, rName) } From 60d270af8c3daab7d02b74343a51595ba58a8241 Mon Sep 17 00:00:00 2001 From: Brittan DeYoung <32572259+brittandeyoung@users.noreply.github.com> Date: Wed, 8 Mar 2023 08:20:41 -0500 Subject: [PATCH 518/763] licensemanager: Amend grant_test, proper casing of ARN --- internal/service/licensemanager/grant_test.go | 26 +++++++++---------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/internal/service/licensemanager/grant_test.go b/internal/service/licensemanager/grant_test.go index fb26dd5962f6..79097ec71885 100644 --- a/internal/service/licensemanager/grant_test.go +++ b/internal/service/licensemanager/grant_test.go @@ -39,8 +39,8 @@ func testAccGrant_basic(t *testing.T) { if principal == "" { t.Skipf("Environment variable %s is not set to true", principalKey) } - licenseArn := os.Getenv(licenseKey) - if licenseArn == "" { + licenseARN := os.Getenv(licenseKey) + if licenseARN == "" { t.Skipf("Environment variable %s is not set to true", licenseKey) } rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) @@ -53,7 +53,7 @@ func testAccGrant_basic(t *testing.T) { CheckDestroy: testAccCheckGrantDestroy(ctx), Steps: []resource.TestStep{ { - Config: testAccGrantConfig_basic(licenseArn, rName, principal), + Config: testAccGrantConfig_basic(licenseARN, rName, principal), Check: resource.ComposeAggregateTestCheckFunc( testAccCheckGrantExists(ctx, resourceName), acctest.MatchResourceAttrGlobalARN(resourceName, "arn", "license-manager", regexp.MustCompile(`grant:g-.+`)), @@ -63,7 +63,7 @@ func testAccGrant_basic(t *testing.T) { resource.TestCheckTypeSetElemAttr(resourceName, "allowed_operations.*", "ExtendConsumptionLicense"), resource.TestCheckTypeSetElemAttr(resourceName, "allowed_operations.*", "CreateToken"), resource.TestCheckResourceAttrSet(resourceName, "home_region"), - resource.TestCheckResourceAttr(resourceName, "license_arn", licenseArn), + resource.TestCheckResourceAttr(resourceName, "license_arn", licenseARN), resource.TestCheckResourceAttr(resourceName, "name", rName), resource.TestCheckResourceAttrSet(resourceName, "parent_arn"), resource.TestCheckResourceAttr(resourceName, "principal", principal), @@ -88,8 +88,8 @@ func testAccGrant_disappears(t *testing.T) { if principal == "" { t.Skipf("Environment variable %s is not set to true", principalKey) } - licenseArn := os.Getenv(licenseKey) - if licenseArn == "" { + licenseARN := os.Getenv(licenseKey) + if licenseARN == "" { t.Skipf("Environment variable %s is not set to true", licenseKey) } rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) @@ -102,7 +102,7 @@ func testAccGrant_disappears(t *testing.T) { CheckDestroy: testAccCheckGrantDestroy(ctx), Steps: []resource.TestStep{ { - Config: testAccGrantConfig_basic(licenseArn, rName, principal), + Config: testAccGrantConfig_basic(licenseARN, rName, principal), Check: resource.ComposeTestCheckFunc( testAccCheckGrantExists(ctx, resourceName), acctest.CheckResourceDisappears(ctx, acctest.Provider, tflicensemanager.ResourceGrant(), resourceName), @@ -121,8 +121,8 @@ func testAccGrant_name(t *testing.T) { if principal == "" { t.Skipf("Environment variable %s is not set to true", principalKey) } - licenseArn := os.Getenv(licenseKey) - if licenseArn == "" { + licenseARN := os.Getenv(licenseKey) + if licenseARN == "" { t.Skipf("Environment variable %s is not set to true", licenseKey) } rName1 := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) @@ -136,7 +136,7 @@ func testAccGrant_name(t *testing.T) { CheckDestroy: testAccCheckGrantDestroy(ctx), Steps: []resource.TestStep{ { - Config: testAccGrantConfig_basic(licenseArn, rName1, principal), + Config: testAccGrantConfig_basic(licenseARN, rName1, principal), Check: resource.ComposeAggregateTestCheckFunc( testAccCheckGrantExists(ctx, resourceName), resource.TestCheckResourceAttr(resourceName, "name", rName1), @@ -148,7 +148,7 @@ func testAccGrant_name(t *testing.T) { ImportStateVerify: true, }, { - Config: testAccGrantConfig_basic(licenseArn, rName2, principal), + Config: testAccGrantConfig_basic(licenseARN, rName2, principal), Check: resource.ComposeAggregateTestCheckFunc( testAccCheckGrantExists(ctx, resourceName), resource.TestCheckResourceAttr(resourceName, "name", rName2), @@ -211,7 +211,7 @@ func testAccCheckGrantDestroy(ctx context.Context) resource.TestCheckFunc { } } -func testAccGrantConfig_basic(licenseArn string, rName string, principal string) string { +func testAccGrantConfig_basic(licenseARN string, rName string, principal string) string { return fmt.Sprintf(` data "aws_licensemanager_received_license" "test" { license_arn = %[1]q @@ -227,5 +227,5 @@ resource "aws_licensemanager_grant" "test" { license_arn = data.aws_licensemanager_received_license.test.license_arn principal = %[3]q } -`, licenseArn, rName, principal) +`, licenseARN, rName, principal) } From a44f4217dd5a839bcbec5120cb02dc4b349e9c10 Mon Sep 17 00:00:00 2001 From: changelogbot Date: Wed, 8 Mar 2023 13:21:24 +0000 Subject: [PATCH 519/763] Update CHANGELOG.md for #29841 --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 70daaa74c28e..4f43b47b0d1e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,7 @@ FEATURES: ENHANCEMENTS: +* resource/aws_acm_certificate: Change `options` to `Computed` ([#29763](https://github.com/hashicorp/terraform-provider-aws/issues/29763)) * resource/aws_cloudhsm_v2_hsm: Enforce `ExactlyOneOf` for `availability_zone` and `subnet_id` arguments ([#20891](https://github.com/hashicorp/terraform-provider-aws/issues/20891)) * resource/aws_db_instance: Add `listener_endpoint` attribute ([#28434](https://github.com/hashicorp/terraform-provider-aws/issues/28434)) * resource/aws_db_instance: Add plan time validations for `backup_retention_period`, `monitoring_interval`, and `monitoring_role_arn` ([#28434](https://github.com/hashicorp/terraform-provider-aws/issues/28434)) @@ -17,6 +18,7 @@ ENHANCEMENTS: BUG FIXES: +* resource/aws_acm_certificate: Update `options.certificate_transparency_logging_preference` in place rather than replacing the resource ([#29763](https://github.com/hashicorp/terraform-provider-aws/issues/29763)) * resource/aws_batch_job_definition: Prevents perpetual diff when container properties environment variable has empty value. ([#29820](https://github.com/hashicorp/terraform-provider-aws/issues/29820)) * resource/aws_grafana_workspace: Allow removing `vpc_configuration` ([#29793](https://github.com/hashicorp/terraform-provider-aws/issues/29793)) * resource/aws_medialive_channel: Fix setting of the `video_pid` attribute in `m2ts_settings` ([#29824](https://github.com/hashicorp/terraform-provider-aws/issues/29824)) From ea5047c4f4065179deb5af946d4a523befb47427 Mon Sep 17 00:00:00 2001 From: Brittan DeYoung <32572259+brittandeyoung@users.noreply.github.com> Date: Wed, 8 Mar 2023 08:24:13 -0500 Subject: [PATCH 520/763] licensemanager: Amend received_license_data_source, prefer AWS Go SDK pointer --- internal/service/licensemanager/received_license_data_source.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/service/licensemanager/received_license_data_source.go b/internal/service/licensemanager/received_license_data_source.go index ec555ead2995..f031d639fad6 100644 --- a/internal/service/licensemanager/received_license_data_source.go +++ b/internal/service/licensemanager/received_license_data_source.go @@ -225,7 +225,7 @@ func dataSourceReceivedLicenseRead(ctx context.Context, d *schema.ResourceData, return sdkdiag.AppendErrorf(diags, "reading Received Licenses: %s", err) } - d.SetId(*out.LicenseArn) + d.SetId(aws.StringValue(out.LicenseArn)) d.Set("beneficiary", out.Beneficiary) d.Set("consumption_configuration", []interface{}{flattenConsumptionConfiguration(out.ConsumptionConfiguration)}) d.Set("create_time", out.CreateTime) From d465a503e53b370bd87ef7824794da15bb0212ac Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Wed, 8 Mar 2023 08:33:47 -0500 Subject: [PATCH 521/763] r/aws_elastic_beanstalk_configuration_template: Tidy up. --- .../configuration_template.go | 85 +++++++------------ 1 file changed, 30 insertions(+), 55 deletions(-) diff --git a/internal/service/elasticbeanstalk/configuration_template.go b/internal/service/elasticbeanstalk/configuration_template.go index ef4f765fd59e..399323fd160c 100644 --- a/internal/service/elasticbeanstalk/configuration_template.go +++ b/internal/service/elasticbeanstalk/configuration_template.go @@ -63,36 +63,32 @@ func resourceConfigurationTemplateCreate(ctx context.Context, d *schema.Resource var diags diag.Diagnostics conn := meta.(*conns.AWSClient).ElasticBeanstalkConn() - // Get the relevant properties name := d.Get("name").(string) - appName := d.Get("application").(string) - - optionSettings := gatherOptionSettings(d) - - opts := elasticbeanstalk.CreateConfigurationTemplateInput{ - ApplicationName: aws.String(appName), + input := &elasticbeanstalk.CreateConfigurationTemplateInput{ + ApplicationName: aws.String(d.Get("application").(string)), + OptionSettings: gatherOptionSettings(d), TemplateName: aws.String(name), - OptionSettings: optionSettings, } if attr, ok := d.GetOk("description"); ok { - opts.Description = aws.String(attr.(string)) + input.Description = aws.String(attr.(string)) } if attr, ok := d.GetOk("environment_id"); ok { - opts.EnvironmentId = aws.String(attr.(string)) + input.EnvironmentId = aws.String(attr.(string)) } if attr, ok := d.GetOk("solution_stack_name"); ok { - opts.SolutionStackName = aws.String(attr.(string)) + input.SolutionStackName = aws.String(attr.(string)) } - log.Printf("[DEBUG] Elastic Beanstalk configuration template create opts: %s", opts) - if _, err := conn.CreateConfigurationTemplateWithContext(ctx, &opts); err != nil { - return sdkdiag.AppendErrorf(diags, "creating Elastic Beanstalk configuration template: %s", err) + output, err := conn.CreateConfigurationTemplateWithContext(ctx, input) + + if err != nil { + return sdkdiag.AppendErrorf(diags, "creating Elastic Beanstalk Configuration Template (%s): %s", name, err) } - d.SetId(name) + d.SetId(aws.StringValue(output.TemplateName)) return append(diags, resourceConfigurationTemplateRead(ctx, d, meta)...) } @@ -125,44 +121,21 @@ func resourceConfigurationTemplateUpdate(ctx context.Context, d *schema.Resource var diags diag.Diagnostics conn := meta.(*conns.AWSClient).ElasticBeanstalkConn() - log.Printf("[DEBUG] Elastic Beanstalk configuration template update: %s", d.Get("name").(string)) - if d.HasChange("description") { - if err := resourceConfigurationTemplateDescriptionUpdate(ctx, conn, d); err != nil { - return sdkdiag.AppendErrorf(diags, "updating Elastic Beanstalk Configuration Template (%s): %s", d.Id(), err) + input := &elasticbeanstalk.UpdateConfigurationTemplateInput{ + ApplicationName: aws.String(d.Get("application").(string)), + Description: aws.String(d.Get("description").(string)), + TemplateName: aws.String(d.Id()), } - } - if d.HasChange("setting") { - if err := resourceConfigurationTemplateOptionSettingsUpdate(ctx, conn, d); err != nil { + _, err := conn.UpdateConfigurationTemplateWithContext(ctx, input) + + if err != nil { return sdkdiag.AppendErrorf(diags, "updating Elastic Beanstalk Configuration Template (%s): %s", d.Id(), err) } } - return append(diags, resourceConfigurationTemplateRead(ctx, d, meta)...) -} - -func resourceConfigurationTemplateDescriptionUpdate(ctx context.Context, conn *elasticbeanstalk.ElasticBeanstalk, d *schema.ResourceData) error { - _, err := conn.UpdateConfigurationTemplateWithContext(ctx, &elasticbeanstalk.UpdateConfigurationTemplateInput{ - ApplicationName: aws.String(d.Get("application").(string)), - TemplateName: aws.String(d.Get("name").(string)), - Description: aws.String(d.Get("description").(string)), - }) - - return err -} - -func resourceConfigurationTemplateOptionSettingsUpdate(ctx context.Context, conn *elasticbeanstalk.ElasticBeanstalk, d *schema.ResourceData) error { if d.HasChange("setting") { - _, err := conn.ValidateConfigurationSettingsWithContext(ctx, &elasticbeanstalk.ValidateConfigurationSettingsInput{ - ApplicationName: aws.String(d.Get("application").(string)), - TemplateName: aws.String(d.Get("name").(string)), - OptionSettings: gatherOptionSettings(d), - }) - if err != nil { - return err - } - o, n := d.GetChange("setting") if o == nil { o = new(schema.Set) @@ -196,41 +169,43 @@ func resourceConfigurationTemplateOptionSettingsUpdate(ctx context.Context, conn } } - req := &elasticbeanstalk.UpdateConfigurationTemplateInput{ + input := &elasticbeanstalk.UpdateConfigurationTemplateInput{ ApplicationName: aws.String(d.Get("application").(string)), - TemplateName: aws.String(d.Get("name").(string)), OptionSettings: add, + TemplateName: aws.String(d.Id()), } for _, elem := range remove { - req.OptionsToRemove = append(req.OptionsToRemove, &elasticbeanstalk.OptionSpecification{ + input.OptionsToRemove = append(input.OptionsToRemove, &elasticbeanstalk.OptionSpecification{ Namespace: elem.Namespace, OptionName: elem.OptionName, }) } - log.Printf("[DEBUG] Update Configuration Template request: %s", req) - if _, err := conn.UpdateConfigurationTemplateWithContext(ctx, req); err != nil { - return err + _, err := conn.UpdateConfigurationTemplateWithContext(ctx, input) + + if err != nil { + return sdkdiag.AppendErrorf(diags, "updating Elastic Beanstalk Configuration Template (%s): %s", d.Id(), err) } } - return nil + return append(diags, resourceConfigurationTemplateRead(ctx, d, meta)...) } func resourceConfigurationTemplateDelete(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { var diags diag.Diagnostics conn := meta.(*conns.AWSClient).ElasticBeanstalkConn() - application := d.Get("application").(string) - + log.Printf("[INFO] Deleting Elastic Beanstalk Configuration Template: %s", d.Id()) _, err := conn.DeleteConfigurationTemplateWithContext(ctx, &elasticbeanstalk.DeleteConfigurationTemplateInput{ - ApplicationName: aws.String(application), + ApplicationName: aws.String(d.Get("application").(string)), TemplateName: aws.String(d.Id()), }) + if err != nil { return sdkdiag.AppendErrorf(diags, "deleting Elastic Beanstalk Configuration Template (%s): %s", d.Id(), err) } + return diags } From 8ac1ef8acc9427469c004b77bff7c25743c123cf Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Wed, 8 Mar 2023 08:37:18 -0500 Subject: [PATCH 522/763] FindConfigurationSettingsByTwoPartKey: Map 'No Platform named' errors to 'resource.NotFoundError'. --- internal/service/elasticbeanstalk/configuration_template.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/internal/service/elasticbeanstalk/configuration_template.go b/internal/service/elasticbeanstalk/configuration_template.go index 399323fd160c..ae5ef2a3f484 100644 --- a/internal/service/elasticbeanstalk/configuration_template.go +++ b/internal/service/elasticbeanstalk/configuration_template.go @@ -209,6 +209,10 @@ func resourceConfigurationTemplateDelete(ctx context.Context, d *schema.Resource return diags } +const ( + errCodeInvalidParameterValue = "InvalidParameterValue" +) + func FindConfigurationSettingsByTwoPartKey(ctx context.Context, conn *elasticbeanstalk.ElasticBeanstalk, applicationName, templateName string) (*elasticbeanstalk.ConfigurationSettingsDescription, error) { input := &elasticbeanstalk.DescribeConfigurationSettingsInput{ ApplicationName: aws.String(applicationName), @@ -217,7 +221,7 @@ func FindConfigurationSettingsByTwoPartKey(ctx context.Context, conn *elasticbea output, err := conn.DescribeConfigurationSettingsWithContext(ctx, input) - if tfawserr.ErrMessageContains(err, "InvalidParameterValue", "No Configuration Template named") || tfawserr.ErrMessageContains(err, "InvalidParameterValue", "No Application named") { + if tfawserr.ErrMessageContains(err, errCodeInvalidParameterValue, "No Configuration Template named") || tfawserr.ErrMessageContains(err, errCodeInvalidParameterValue, "No Application named") || tfawserr.ErrMessageContains(err, errCodeInvalidParameterValue, "No Platform named") { return nil, &resource.NotFoundError{ LastError: err, LastRequest: input, From 5fe82f1d0748675bc045d2170c2d37ec73bed18c Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Wed, 8 Mar 2023 08:40:32 -0500 Subject: [PATCH 523/763] r/aws_elastic_beanstalk_configuration_template: Add 'TestAccElasticBeanstalkConfigurationTemplate_Disappears_application'. Acceptance test output: % make testacc TESTARGS='-run=TestAccElasticBeanstalkConfigurationTemplate_Disappears_application' PKG=elasticbeanstalk ACCTEST_PARALLELISM=3 ==> Checking that code complies with gofmt requirements... TF_ACC=1 go test ./internal/service/elasticbeanstalk/... -v -count 1 -parallel 3 -run=TestAccElasticBeanstalkConfigurationTemplate_Disappears_application -timeout 180m === RUN TestAccElasticBeanstalkConfigurationTemplate_Disappears_application === PAUSE TestAccElasticBeanstalkConfigurationTemplate_Disappears_application === CONT TestAccElasticBeanstalkConfigurationTemplate_Disappears_application --- PASS: TestAccElasticBeanstalkConfigurationTemplate_Disappears_application (17.68s) PASS ok github.com/hashicorp/terraform-provider-aws/internal/service/elasticbeanstalk 23.407s --- .../configuration_template_test.go | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/internal/service/elasticbeanstalk/configuration_template_test.go b/internal/service/elasticbeanstalk/configuration_template_test.go index b4e7c06256e7..3df84eceb331 100644 --- a/internal/service/elasticbeanstalk/configuration_template_test.go +++ b/internal/service/elasticbeanstalk/configuration_template_test.go @@ -61,6 +61,30 @@ func TestAccElasticBeanstalkConfigurationTemplate_disappears(t *testing.T) { }) } +func TestAccElasticBeanstalkConfigurationTemplate_Disappears_application(t *testing.T) { + ctx := acctest.Context(t) + var config elasticbeanstalk.ConfigurationSettingsDescription + rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) + resourceName := "aws_elastic_beanstalk_configuration_template.test" + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { acctest.PreCheck(t) }, + ErrorCheck: acctest.ErrorCheck(t, elasticbeanstalk.EndpointsID), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + CheckDestroy: testAccCheckConfigurationTemplateDestroy(ctx), + Steps: []resource.TestStep{ + { + Config: testAccConfigurationTemplateConfig_basic(rName), + Check: resource.ComposeTestCheckFunc( + testAccCheckConfigurationTemplateExists(ctx, resourceName, &config), + acctest.CheckResourceDisappears(ctx, acctest.Provider, tfelasticbeanstalk.ResourceApplication(), "aws_elastic_beanstalk_application.test"), + ), + ExpectNonEmptyPlan: true, + }, + }, + }) +} + func TestAccElasticBeanstalkConfigurationTemplate_vpc(t *testing.T) { ctx := acctest.Context(t) var config elasticbeanstalk.ConfigurationSettingsDescription From e92e871ddfe14cea7dc9d8678cb690f33febc77a Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Wed, 8 Mar 2023 08:46:22 -0500 Subject: [PATCH 524/763] Add CHANGELOG entry. --- .changelog/29863.txt | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 .changelog/29863.txt diff --git a/.changelog/29863.txt b/.changelog/29863.txt new file mode 100644 index 000000000000..233e13a6e7d4 --- /dev/null +++ b/.changelog/29863.txt @@ -0,0 +1,3 @@ +```release-note:bug +resource/aws_elastic_beanstalk_configuration_template: Map errors like `InvalidParameterValue: No Platform named '...' found.` to `resource.NotFoundError` so `terraform refesh` correctly removes the resource from state +``` \ No newline at end of file From aa96355cfbf9eb1dea9284bea7d1488eca472489 Mon Sep 17 00:00:00 2001 From: drfaust92 Date: Wed, 8 Mar 2023 15:48:54 +0200 Subject: [PATCH 525/763] docs + tests --- a.txt | 31 ++++++++++ .../service/redshiftserverless/namespace.go | 2 +- .../redshiftserverless/namespace_test.go | 60 +++++++++++++++++++ ...redshiftserverless_namespace.html.markdown | 2 +- 4 files changed, 93 insertions(+), 2 deletions(-) create mode 100644 a.txt diff --git a/a.txt b/a.txt new file mode 100644 index 000000000000..f8ab6d2d4f17 --- /dev/null +++ b/a.txt @@ -0,0 +1,31 @@ +==> Checking that code complies with gofmt requirements... +TF_ACC=1 go test ./internal/service/redshiftserverless/... -v -count 1 -parallel 20 -run='TestAccRedshiftServerlessNamespace_defaultIamRole' -timeout 180m +=== RUN TestAccRedshiftServerlessNamespace_defaultIamRole +=== PAUSE TestAccRedshiftServerlessNamespace_defaultIamRole +=== CONT TestAccRedshiftServerlessNamespace_defaultIamRole + namespace_test.go:69: Step 3/3 error: After applying this test step and performing a `terraform refresh`, the plan was not empty. + stdout + + + Terraform used the selected providers to generate the following execution + plan. Resource actions are indicated with the following symbols: + ~ update in-place + + Terraform will perform the following actions: + + # aws_redshiftserverless_namespace.test will be updated in-place + ~ resource "aws_redshiftserverless_namespace" "test" { + ~ iam_roles = [ + + "arn:aws:iam::577328853911:role/tf-acc-test-3253094499414672642", + - "arn:aws:iam::577328853911:role/tf-acc-test-3253094499414672642-2", + ] + id = "tf-acc-test-3253094499414672642" + tags = {} + # (8 unchanged attributes hidden) + } + + Plan: 0 to add, 1 to change, 0 to destroy. +--- FAIL: TestAccRedshiftServerlessNamespace_defaultIamRole (54.97s) +FAIL +FAIL github.com/hashicorp/terraform-provider-aws/internal/service/redshiftserverless 57.234s +FAIL diff --git a/internal/service/redshiftserverless/namespace.go b/internal/service/redshiftserverless/namespace.go index 8a86c7960dba..717910395ba3 100644 --- a/internal/service/redshiftserverless/namespace.go +++ b/internal/service/redshiftserverless/namespace.go @@ -78,7 +78,7 @@ func ResourceNamespace() *schema.Resource { Optional: true, Elem: &schema.Schema{ Type: schema.TypeString, - ValidateFunc: validation.StringInSlice([]string{"userlog", "connectionlog", "useractivitylog"}, false), + ValidateFunc: validation.StringInSlice(redshiftserverless.LogExport_Values(), false), }, }, "namespace_id": { diff --git a/internal/service/redshiftserverless/namespace_test.go b/internal/service/redshiftserverless/namespace_test.go index 5a5f20ae966c..9fd3ddeef726 100644 --- a/internal/service/redshiftserverless/namespace_test.go +++ b/internal/service/redshiftserverless/namespace_test.go @@ -61,6 +61,34 @@ func TestAccRedshiftServerlessNamespace_basic(t *testing.T) { }) } +func TestAccRedshiftServerlessNamespace_defaultIamRole(t *testing.T) { + ctx := acctest.Context(t) + resourceName := "aws_redshiftserverless_namespace.test" + rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { acctest.PreCheck(t) }, + ErrorCheck: acctest.ErrorCheck(t, redshiftserverless.EndpointsID), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + CheckDestroy: testAccCheckNamespaceDestroy(ctx), + Steps: []resource.TestStep{ + { + Config: testAccNamespaceConfig_defaultIamRole(rName), + Check: resource.ComposeTestCheckFunc( + testAccCheckNamespaceExists(ctx, resourceName), + resource.TestCheckResourceAttr(resourceName, "namespace_name", rName), + resource.TestCheckResourceAttrPair(resourceName, "default_iam_role_arn", "aws_iam_role.test", "arn"), + ), + }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, + }, + }) +} + func TestAccRedshiftServerlessNamespace_user(t *testing.T) { ctx := acctest.Context(t) resourceName := "aws_redshiftserverless_namespace.test" @@ -278,3 +306,35 @@ resource "aws_redshiftserverless_namespace" "test" { } `, rName, tagKey1, tagValue1, tagKey2, tagValue2) } + +func testAccNamespaceConfig_defaultIamRole(rName string) string { + return fmt.Sprintf(` +resource "aws_iam_role" "test" { + name = %[1]q + + assume_role_policy = < Date: Wed, 8 Mar 2023 15:51:28 +0200 Subject: [PATCH 526/763] docs + tests --- internal/service/redshiftserverless/namespace_test.go | 1 + 1 file changed, 1 insertion(+) diff --git a/internal/service/redshiftserverless/namespace_test.go b/internal/service/redshiftserverless/namespace_test.go index 9fd3ddeef726..e801e3939de7 100644 --- a/internal/service/redshiftserverless/namespace_test.go +++ b/internal/service/redshiftserverless/namespace_test.go @@ -335,6 +335,7 @@ EOF resource "aws_redshiftserverless_namespace" "test" { namespace_name = %[1]q default_iam_role_arn = aws_iam_role.test.arn + iam_roles = [aws_iam_role.test.arn] } `, rName) } From 22e6f9c08aa483f1071a6264dbc8d0679dbc61ca Mon Sep 17 00:00:00 2001 From: drfaust92 Date: Wed, 8 Mar 2023 15:55:32 +0200 Subject: [PATCH 527/763] docs + tests --- a.txt | 31 ------------------------------- 1 file changed, 31 deletions(-) delete mode 100644 a.txt diff --git a/a.txt b/a.txt deleted file mode 100644 index f8ab6d2d4f17..000000000000 --- a/a.txt +++ /dev/null @@ -1,31 +0,0 @@ -==> Checking that code complies with gofmt requirements... -TF_ACC=1 go test ./internal/service/redshiftserverless/... -v -count 1 -parallel 20 -run='TestAccRedshiftServerlessNamespace_defaultIamRole' -timeout 180m -=== RUN TestAccRedshiftServerlessNamespace_defaultIamRole -=== PAUSE TestAccRedshiftServerlessNamespace_defaultIamRole -=== CONT TestAccRedshiftServerlessNamespace_defaultIamRole - namespace_test.go:69: Step 3/3 error: After applying this test step and performing a `terraform refresh`, the plan was not empty. - stdout - - - Terraform used the selected providers to generate the following execution - plan. Resource actions are indicated with the following symbols: - ~ update in-place - - Terraform will perform the following actions: - - # aws_redshiftserverless_namespace.test will be updated in-place - ~ resource "aws_redshiftserverless_namespace" "test" { - ~ iam_roles = [ - + "arn:aws:iam::577328853911:role/tf-acc-test-3253094499414672642", - - "arn:aws:iam::577328853911:role/tf-acc-test-3253094499414672642-2", - ] - id = "tf-acc-test-3253094499414672642" - tags = {} - # (8 unchanged attributes hidden) - } - - Plan: 0 to add, 1 to change, 0 to destroy. ---- FAIL: TestAccRedshiftServerlessNamespace_defaultIamRole (54.97s) -FAIL -FAIL github.com/hashicorp/terraform-provider-aws/internal/service/redshiftserverless 57.234s -FAIL From 071d554b7fa713969137438981570245b721ed35 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 8 Mar 2023 09:13:30 -0500 Subject: [PATCH 528/763] build(deps): bump github.com/aws/aws-sdk-go-v2/service/rolesanywhere (#29852) Bumps [github.com/aws/aws-sdk-go-v2/service/rolesanywhere](https://github.com/aws/aws-sdk-go-v2) from 1.1.4 to 1.1.5. - [Release notes](https://github.com/aws/aws-sdk-go-v2/releases) - [Changelog](https://github.com/aws/aws-sdk-go-v2/blob/main/CHANGELOG.md) - [Commits](https://github.com/aws/aws-sdk-go-v2/compare/config/v1.1.4...config/v1.1.5) --- updated-dependencies: - dependency-name: github.com/aws/aws-sdk-go-v2/service/rolesanywhere dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 274df8cc8471..021ec8259eb6 100644 --- a/go.mod +++ b/go.mod @@ -26,7 +26,7 @@ require ( github.com/aws/aws-sdk-go-v2/service/pipes v1.2.0 github.com/aws/aws-sdk-go-v2/service/rds v1.40.5 github.com/aws/aws-sdk-go-v2/service/resourceexplorer2 v1.2.5 - github.com/aws/aws-sdk-go-v2/service/rolesanywhere v1.1.4 + github.com/aws/aws-sdk-go-v2/service/rolesanywhere v1.1.5 github.com/aws/aws-sdk-go-v2/service/route53domains v1.14.4 github.com/aws/aws-sdk-go-v2/service/s3control v1.29.4 github.com/aws/aws-sdk-go-v2/service/scheduler v1.1.4 diff --git a/go.sum b/go.sum index 20a4d703c179..da5b86a6abd7 100644 --- a/go.sum +++ b/go.sum @@ -88,8 +88,8 @@ github.com/aws/aws-sdk-go-v2/service/rds v1.40.5 h1:m4v9hSOgnLmSDbdVdNT0H8GTY6ti github.com/aws/aws-sdk-go-v2/service/rds v1.40.5/go.mod h1:994zebv5Cj1WoGzo3zrrscm1zBLFvGwoA3ve1eVYNVQ= github.com/aws/aws-sdk-go-v2/service/resourceexplorer2 v1.2.5 h1:+F3ULspZOOeUy3LWcIrTguJdO1/A1llhML7alifHldQ= github.com/aws/aws-sdk-go-v2/service/resourceexplorer2 v1.2.5/go.mod h1:9qmFEhCHjKM1+oO2XlzI5adhgfbTdyaDK5joeHLr2WM= -github.com/aws/aws-sdk-go-v2/service/rolesanywhere v1.1.4 h1:jifVZl6fqn5jSSph1XPv4eucXt3xcFq3xJLQOWUwFDQ= -github.com/aws/aws-sdk-go-v2/service/rolesanywhere v1.1.4/go.mod h1:YER6EnZk8ud7mEHI4SeHtpE6VjIaOuD1a/ayUegKaB0= +github.com/aws/aws-sdk-go-v2/service/rolesanywhere v1.1.5 h1:ywT18Rmkr/cWcJSJNyLOF3lJIHGozt1NH7B+QyTceZw= +github.com/aws/aws-sdk-go-v2/service/rolesanywhere v1.1.5/go.mod h1:YER6EnZk8ud7mEHI4SeHtpE6VjIaOuD1a/ayUegKaB0= github.com/aws/aws-sdk-go-v2/service/route53domains v1.14.4 h1:/1qBMwOZb/2ua5jFMc8xmLUxHz7VNt70Zx2fKLoZ40M= github.com/aws/aws-sdk-go-v2/service/route53domains v1.14.4/go.mod h1:MSwXvIWYZIBgC1otPRfafXbiOIdihO36INeOhqCciao= github.com/aws/aws-sdk-go-v2/service/s3control v1.29.4 h1:2FnFwA3DaXibWS3gMk9/hfJL3oNU+jIWsgytn5X2aFQ= From f9c8eb419911a8b66ab36c5266f70f4e869b24f9 Mon Sep 17 00:00:00 2001 From: changelogbot Date: Wed, 8 Mar 2023 14:18:51 +0000 Subject: [PATCH 529/763] Update CHANGELOG.md for #29863 --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4f43b47b0d1e..2c6999044408 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -20,6 +20,7 @@ BUG FIXES: * resource/aws_acm_certificate: Update `options.certificate_transparency_logging_preference` in place rather than replacing the resource ([#29763](https://github.com/hashicorp/terraform-provider-aws/issues/29763)) * resource/aws_batch_job_definition: Prevents perpetual diff when container properties environment variable has empty value. ([#29820](https://github.com/hashicorp/terraform-provider-aws/issues/29820)) +* resource/aws_elastic_beanstalk_configuration_template: Map errors like `InvalidParameterValue: No Platform named '...' found.` to `resource.NotFoundError` so `terraform refesh` correctly removes the resource from state ([#29863](https://github.com/hashicorp/terraform-provider-aws/issues/29863)) * resource/aws_grafana_workspace: Allow removing `vpc_configuration` ([#29793](https://github.com/hashicorp/terraform-provider-aws/issues/29793)) * resource/aws_medialive_channel: Fix setting of the `video_pid` attribute in `m2ts_settings` ([#29824](https://github.com/hashicorp/terraform-provider-aws/issues/29824)) From 3ee19a4c84caabbd2569c060896b38896958d155 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 8 Mar 2023 09:21:34 -0500 Subject: [PATCH 530/763] build(deps): bump github.com/aws/aws-sdk-go in /.ci/providerlint (#29854) Bumps [github.com/aws/aws-sdk-go](https://github.com/aws/aws-sdk-go) from 1.44.215 to 1.44.216. - [Release notes](https://github.com/aws/aws-sdk-go/releases) - [Commits](https://github.com/aws/aws-sdk-go/compare/v1.44.215...v1.44.216) --- updated-dependencies: - dependency-name: github.com/aws/aws-sdk-go dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .ci/providerlint/go.mod | 2 +- .ci/providerlint/go.sum | 4 ++-- .../aws/aws-sdk-go/aws/endpoints/defaults.go | 13 +++++++++++++ .ci/providerlint/vendor/modules.txt | 2 +- 4 files changed, 17 insertions(+), 4 deletions(-) diff --git a/.ci/providerlint/go.mod b/.ci/providerlint/go.mod index 20e3e59aae55..2efe5181cfb9 100644 --- a/.ci/providerlint/go.mod +++ b/.ci/providerlint/go.mod @@ -3,7 +3,7 @@ module github.com/hashicorp/terraform-provider-aws/ci/providerlint go 1.19 require ( - github.com/aws/aws-sdk-go v1.44.215 + github.com/aws/aws-sdk-go v1.44.216 github.com/bflad/tfproviderlint v0.28.1 github.com/hashicorp/terraform-plugin-sdk/v2 v2.25.0 golang.org/x/tools v0.1.12 diff --git a/.ci/providerlint/go.sum b/.ci/providerlint/go.sum index db7b6bffa1ba..83bffc8274d1 100644 --- a/.ci/providerlint/go.sum +++ b/.ci/providerlint/go.sum @@ -65,8 +65,8 @@ github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5/go.mod h1:wHh0iHkY github.com/aws/aws-sdk-go v1.15.78/go.mod h1:E3/ieXAlvM0XWO57iftYVDLLvQ824smPP3ATZkfNZeM= github.com/aws/aws-sdk-go v1.25.3/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo= github.com/aws/aws-sdk-go v1.37.0/go.mod h1:hcU610XS61/+aQV88ixoOzUoG7v3b31pl2zKMmprdro= -github.com/aws/aws-sdk-go v1.44.215 h1:K3KERfO6MaV349idub2w1u1H0R0KSkED0LshPnaAn3Q= -github.com/aws/aws-sdk-go v1.44.215/go.mod h1:aVsgQcEevwlmQ7qHE9I3h+dtQgpqhFB+i8Phjh7fkwI= +github.com/aws/aws-sdk-go v1.44.216 h1:nDL5hEGBlUNHXMWbpP4dIyP8IB5tvRgksWE7biVu8JY= +github.com/aws/aws-sdk-go v1.44.216/go.mod h1:aVsgQcEevwlmQ7qHE9I3h+dtQgpqhFB+i8Phjh7fkwI= github.com/bflad/gopaniccheck v0.1.0 h1:tJftp+bv42ouERmUMWLoUn/5bi/iQZjHPznM00cP/bU= github.com/bflad/gopaniccheck v0.1.0/go.mod h1:ZCj2vSr7EqVeDaqVsWN4n2MwdROx1YL+LFo47TSWtsA= github.com/bflad/tfproviderlint v0.28.1 h1:7f54/ynV6/lK5/1EyG7tHtc4sMdjJSEFGjZNRJKwBs8= diff --git a/.ci/providerlint/vendor/github.com/aws/aws-sdk-go/aws/endpoints/defaults.go b/.ci/providerlint/vendor/github.com/aws/aws-sdk-go/aws/endpoints/defaults.go index ad6cf3696dfb..7d9fccd3af97 100644 --- a/.ci/providerlint/vendor/github.com/aws/aws-sdk-go/aws/endpoints/defaults.go +++ b/.ci/providerlint/vendor/github.com/aws/aws-sdk-go/aws/endpoints/defaults.go @@ -14264,6 +14264,9 @@ var awsPartition = partition{ endpointKey{ Region: "eu-west-3", }: endpoint{}, + endpointKey{ + Region: "me-central-1", + }: endpoint{}, endpointKey{ Region: "me-south-1", }: endpoint{}, @@ -30264,6 +30267,16 @@ var awscnPartition = partition{ }: endpoint{}, }, }, + "rolesanywhere": service{ + Endpoints: serviceEndpoints{ + endpointKey{ + Region: "cn-north-1", + }: endpoint{}, + endpointKey{ + Region: "cn-northwest-1", + }: endpoint{}, + }, + }, "route53": service{ PartitionEndpoint: "aws-cn-global", IsRegionalized: boxedFalse, diff --git a/.ci/providerlint/vendor/modules.txt b/.ci/providerlint/vendor/modules.txt index e814d5961dec..cd5537e5e598 100644 --- a/.ci/providerlint/vendor/modules.txt +++ b/.ci/providerlint/vendor/modules.txt @@ -4,7 +4,7 @@ github.com/agext/levenshtein # github.com/apparentlymart/go-textseg/v13 v13.0.0 ## explicit; go 1.16 github.com/apparentlymart/go-textseg/v13/textseg -# github.com/aws/aws-sdk-go v1.44.215 +# github.com/aws/aws-sdk-go v1.44.216 ## explicit; go 1.11 github.com/aws/aws-sdk-go/aws/awserr github.com/aws/aws-sdk-go/aws/endpoints From 4ee07856b92d582ff5cd943405c83d310bd76820 Mon Sep 17 00:00:00 2001 From: Brittan DeYoung <32572259+brittandeyoung@users.noreply.github.com> Date: Wed, 8 Mar 2023 09:35:11 -0500 Subject: [PATCH 531/763] website: Amend licensemanager_received_licenses, fmt fix --- .../d/licensemanager_received_licenses.html.markdown | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/website/docs/d/licensemanager_received_licenses.html.markdown b/website/docs/d/licensemanager_received_licenses.html.markdown index 3451aa034897..6a36d53e1841 100644 --- a/website/docs/d/licensemanager_received_licenses.html.markdown +++ b/website/docs/d/licensemanager_received_licenses.html.markdown @@ -12,15 +12,15 @@ This resource can be used to get a set of license ARNs matching a filter. ## Example Usage -The following shows getting all license ARNs issued from the AWS marketplace. Providing no filter, would provide all license ARNs for the entire account. +The following shows getting all license ARNs issued from the AWS marketplace. Providing no filter, would provide all license ARNs for the entire account. ```terraform data "aws_licensemanager_received_licenses" "test" { filter { - name = "IssuerName" - values = [ - "AWS/Marketplace" - ] + name = "IssuerName" + values = [ + "AWS/Marketplace" + ] } } ``` @@ -50,4 +50,3 @@ data "aws_licensemanager_received_licenses" "selected" { ## Attributes Reference * `arns` - List of all the license ARNs found. - From cf049dabd8d6a404e7d7d82a28ba2bc477a9b7af Mon Sep 17 00:00:00 2001 From: Brittan DeYoung <32572259+brittandeyoung@users.noreply.github.com> Date: Wed, 8 Mar 2023 09:35:59 -0500 Subject: [PATCH 532/763] licensemanager: Add licensemanager_received_license --- ...ensemanager_received_license.html.markdown | 104 ++++++++++++++++++ 1 file changed, 104 insertions(+) create mode 100644 website/docs/d/licensemanager_received_license.html.markdown diff --git a/website/docs/d/licensemanager_received_license.html.markdown b/website/docs/d/licensemanager_received_license.html.markdown new file mode 100644 index 000000000000..411867ea7643 --- /dev/null +++ b/website/docs/d/licensemanager_received_license.html.markdown @@ -0,0 +1,104 @@ +--- +subcategory: "License Manager" +layout: "aws" +page_title: "AWS: aws_licensemanager_received_license" +description: |- + Get information about a set of license manager received license +--- + +# Data Source: aws_licensemanager_received_license + +This resource can be used to get data on a received license using an ARN. This can be helpful for pulling in data on a license from the AWS marketplace and sharing that license with another account. + +## Example Usage + +The following shows getting the received license data using and ARN. + +```terraform +data "aws_licensemanager_received_license" "test" { + license_arn = "arn:aws:license-manager::111111111111:license:l-ecbaa94eb71a4830b6d7e49268fecaa0" +} +``` + +## Argument Reference + +* `license_arn` - (Required) The ARN of the received license you want data for. + +## Attributes Reference + +* `id` - The received license ARN (Same as: `license_arn`). +* `beneficiary` - Granted license beneficiary. This is in the form of the ARN of the root user of the account. +* `consumption_configuration` - Configuration for consumption of the license. [Detailed below](#consumption_configuration) +* `create_time` - Creation time of the granted license. +* `entitlements` - License entitlements. [Detailed below](#entitlements) +* `home_region` - Home Region of the granted license. +* `issuer` - Granted license issuer. [Detailed below](#issuer) +* `license_arn` - Amazon Resource Name (ARN) of the license. +* `license_metadata`- Granted license metadata. This is in the form of a set of all meta data. [Detailed below](#license_metadata) +* `license_name` - License name. +* `product_name` - Product name. +* `product_sku ` - Product SKU. +* `received_metadata` - Granted license received metadata. [Detailed below](#received_metadata) +* `status` - Granted license status. +* `validity` - Date and time range during which the granted license is valid, in ISO8601-UTC format. [Detailed below](#validity) +* `version` - Version of the granted license. + +### consumption_configuration + +* `borrow_configuration` - Details about a borrow configuration. [Detailed below](#borrow_configuration) +* `provisional_configuration` - Details about a provisional configuration. [Detailed below](#provisional_configuration) +* `renewal_frequency` - Renewal frequency. + +#### borrow_configuration + +A list with a single map. + +* `allow_early_check_in` - Indicates whether early check-ins are allowed. +* `max_time_to_live_in_minutes` - Maximum time for the borrow configuration, in minutes. + +#### provisional_configuration + +A list with a single map. + +* `max_time_to_live_in_minutes` - Maximum time for the provisional configuration, in minutes. + +### entitlements + +A list with a single map. + +* `allow_check_in` - Indicates whether check-ins are allowed. +* `max_count` - Maximum entitlement count. Use if the unit is not None. +* `name` - Entitlement name. +* `overage` - Indicates whether overages are allowed. +* `unit` - Entitlement unit. +* `value` - Entitlement resource. Use only if the unit is None. + +### issuer + +A list with a single map. + +* `key_fingerprint` - Issuer key fingerprint. +* `name` - Issuer name. +* `sign_key` - Asymmetric KMS key from AWS Key Management Service. The KMS key must have a key usage of sign and verify, and support the RSASSA-PSS SHA-256 signing algorithm. + +### license_metadata + +Each metadata item will have the following attributes. + +* `name` - The key name. +* `value` - The value. + +### received_metadata + +A list with a single map. + +* `allowed_operations` - A list of allowed operations. +* `received_status` - Received status. +* `received_status_reason` - Received status reason. + +### validity + +A list with a single map. + +* `begin` - Start of the validity time range. +* `end` - End of the validity time range. From 2ed8f9f6b5e9d0817ee8c1884d178e64fdfd1837 Mon Sep 17 00:00:00 2001 From: Brittan DeYoung <32572259+brittandeyoung@users.noreply.github.com> Date: Wed, 8 Mar 2023 09:41:46 -0500 Subject: [PATCH 533/763] licensemanager: Amend service_package_gen, regenerate after merge to main --- .../licensemanager/service_package_gen.go | 20 +++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/internal/service/licensemanager/service_package_gen.go b/internal/service/licensemanager/service_package_gen.go index da9e3b0102c4..42d98d54558d 100644 --- a/internal/service/licensemanager/service_package_gen.go +++ b/internal/service/licensemanager/service_package_gen.go @@ -21,8 +21,14 @@ func (p *servicePackage) FrameworkResources(ctx context.Context) []*types.Servic func (p *servicePackage) SDKDataSources(ctx context.Context) []*types.ServicePackageSDKDataSource { return []*types.ServicePackageSDKDataSource{ - "aws_licensemanager_received_license": DataSourceReceivedLicense, - "aws_licensemanager_received_licenses": DataSourceReceivedLicenses, + { + Factory: DataSourceReceivedLicense, + TypeName: "aws_licensemanager_received_license", + }, + { + Factory: DataSourceReceivedLicenses, + TypeName: "aws_licensemanager_received_licenses", + }, } } @@ -32,10 +38,16 @@ func (p *servicePackage) SDKResources(ctx context.Context) []*types.ServicePacka Factory: ResourceAssociation, TypeName: "aws_licensemanager_association", }, + { + Factory: ResourceGrant, + TypeName: "aws_licensemanager_grant", + }, + { + Factory: ResourceGrantAccepter, + TypeName: "aws_licensemanager_grant_accepter", + }, { Factory: ResourceLicenseConfiguration, - "aws_licensemanager_grant": ResourceGrant, - "aws_licensemanager_grant_accepter": ResourceGrantAccepter, TypeName: "aws_licensemanager_license_configuration", }, } From 22ba96277a30b6a4c60e41815014d869c3f3d5c1 Mon Sep 17 00:00:00 2001 From: Brittan DeYoung <32572259+brittandeyoung@users.noreply.github.com> Date: Wed, 8 Mar 2023 09:58:36 -0500 Subject: [PATCH 534/763] changelog: Amend 29741 to add new datasources --- .changelog/29741.txt | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/.changelog/29741.txt b/.changelog/29741.txt index 983f40e9fdd3..0c8182c79ad0 100644 --- a/.changelog/29741.txt +++ b/.changelog/29741.txt @@ -4,4 +4,12 @@ aws_licensemanager_grant ```release-note:new-resource aws_licensemanager_grant_accepter -``` \ No newline at end of file +``` + +```release-note:new-data-source +aws_licensemanager_received_license +``` + +```release-note:new-data-source +aws_licensemanager_received_licenses +``` From 5a76753c6b35cde86d4472c98f69440e52615b69 Mon Sep 17 00:00:00 2001 From: Brittan DeYoung <32572259+brittandeyoung@users.noreply.github.com> Date: Wed, 8 Mar 2023 10:28:40 -0500 Subject: [PATCH 535/763] licensemanager: Amend grant_accepter_test, use aws_partition data source for arn --- .../licensemanager/grant_accepter_test.go | 29 ++++++++++++++----- 1 file changed, 22 insertions(+), 7 deletions(-) diff --git a/internal/service/licensemanager/grant_accepter_test.go b/internal/service/licensemanager/grant_accepter_test.go index a6e8689e4908..5662aa38c72d 100644 --- a/internal/service/licensemanager/grant_accepter_test.go +++ b/internal/service/licensemanager/grant_accepter_test.go @@ -16,18 +16,31 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/tfresource" ) -func TestAccLicenseManagerGrantAccepter_basic(t *testing.T) { +func TestAccLicenseManagerGrantAccepter_serial(t *testing.T) { + t.Parallel() + + testCases := map[string]map[string]func(t *testing.T){ + "grant": { + "basic": testAccGrantAccepter_basic, + "disappears": testAccGrantAccepter_disappears, + }, + } + + acctest.RunSerialTests2Levels(t, testCases, 0) +} + +func testAccGrantAccepter_basic(t *testing.T) { ctx := acctest.Context(t) rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) licenseKey := "LICENSE_MANAGER_GRANT_LICENSE_ARN" licenseARN := os.Getenv(licenseKey) if licenseARN == "" { - t.Skipf("Environment variable %s is not set to true", licenseKey) + t.Skipf("Environment variable %s is not set", licenseKey) } resourceName := "aws_licensemanager_grant_accepter.test" resourceGrantName := "aws_licensemanager_grant.test" - resource.ParallelTest(t, resource.TestCase{ + resource.Test(t, resource.TestCase{ PreCheck: func() { acctest.PreCheck(t) }, @@ -60,7 +73,7 @@ func TestAccLicenseManagerGrantAccepter_basic(t *testing.T) { }) } -func TestAccLicenseManagerGrantAccepter_disappears(t *testing.T) { +func testAccGrantAccepter_disappears(t *testing.T) { ctx := acctest.Context(t) rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) licenseKey := "LICENSE_MANAGER_GRANT_LICENSE_ARN" @@ -70,7 +83,7 @@ func TestAccLicenseManagerGrantAccepter_disappears(t *testing.T) { } resourceName := "aws_licensemanager_grant_accepter.test" - resource.ParallelTest(t, resource.TestCase{ + resource.Test(t, resource.TestCase{ PreCheck: func() { acctest.PreCheck(t) }, @@ -154,15 +167,17 @@ locals { allowed_operations = [for i in data.aws_licensemanager_received_license.test.received_metadata[0].allowed_operations : i if i != "CreateGrant"] } +data "aws_partition" "current" {} +data "aws_caller_identity" "current" {} + resource "aws_licensemanager_grant" "test" { provider = awsalternate name = %[2]q allowed_operations = local.allowed_operations license_arn = data.aws_licensemanager_received_license.test.license_arn - principal = "arn:aws:iam::${data.aws_caller_identity.current.account_id}:root" + principal = "arn:${data.aws_partition.current.partition}:iam::${data.aws_caller_identity.current.account_id}:root" } -data "aws_caller_identity" "current" {} resource "aws_licensemanager_grant_accepter" "test" { grant_arn = aws_licensemanager_grant.test.arn From 417d013e98d25b0c5ae36a8604ddd9c599bf69c3 Mon Sep 17 00:00:00 2001 From: Brittan DeYoung <32572259+brittandeyoung@users.noreply.github.com> Date: Wed, 8 Mar 2023 10:29:08 -0500 Subject: [PATCH 536/763] licensemanager: Amend received_licenses_data_source, removed un used function --- .../received_licenses_data_source.go | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/internal/service/licensemanager/received_licenses_data_source.go b/internal/service/licensemanager/received_licenses_data_source.go index fe5dcf7894e5..01305a94e9e5 100644 --- a/internal/service/licensemanager/received_licenses_data_source.go +++ b/internal/service/licensemanager/received_licenses_data_source.go @@ -90,17 +90,3 @@ func FindReceivedLicenses(ctx context.Context, conn *licensemanager.LicenseManag return out, nil } - -func expandLicenseARNs(rawLicenseARNs []interface{}) []string { - if rawLicenseARNs == nil { - return nil - } - - licenseARNs := make([]string, 0, 8) - - for _, item := range rawLicenseARNs { - licenseARNs = append(licenseARNs, item.(string)) - } - - return licenseARNs -} From 8fe75aa85ca052ddff7f6a2fd51a216a0081ee06 Mon Sep 17 00:00:00 2001 From: Brittan DeYoung <32572259+brittandeyoung@users.noreply.github.com> Date: Wed, 8 Mar 2023 10:30:45 -0500 Subject: [PATCH 537/763] licensemanager: Amend received_licenses_data_source_test, removed un needed fmt.Sprint --- .../licensemanager/received_licenses_data_source_test.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/service/licensemanager/received_licenses_data_source_test.go b/internal/service/licensemanager/received_licenses_data_source_test.go index 9131388b2e0e..38678865eb19 100644 --- a/internal/service/licensemanager/received_licenses_data_source_test.go +++ b/internal/service/licensemanager/received_licenses_data_source_test.go @@ -64,7 +64,7 @@ data "aws_licensemanager_received_licenses" "test" { } func testAccReceivedLicensesDataSourceConfig_empty() string { - return fmt.Sprint(` + return ` data "aws_licensemanager_received_licenses" "test" { filter { name = "IssuerName" @@ -73,5 +73,5 @@ data "aws_licensemanager_received_licenses" "test" { ] } } -`) +` } From 612d104436bd41254afb87303cf5139f1126b2a4 Mon Sep 17 00:00:00 2001 From: Brittan DeYoung <32572259+brittandeyoung@users.noreply.github.com> Date: Wed, 8 Mar 2023 10:31:15 -0500 Subject: [PATCH 538/763] licensemanager: Add license_grants_data_source --- .../license_grants_data_source.go | 91 +++++++++++++++++++ 1 file changed, 91 insertions(+) create mode 100644 internal/service/licensemanager/license_grants_data_source.go diff --git a/internal/service/licensemanager/license_grants_data_source.go b/internal/service/licensemanager/license_grants_data_source.go new file mode 100644 index 000000000000..955a83c650a4 --- /dev/null +++ b/internal/service/licensemanager/license_grants_data_source.go @@ -0,0 +1,91 @@ +package licensemanager + +import ( + "context" + + "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/service/licensemanager" + "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-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" +) + +func DataSourceDistributedGrants() *schema.Resource { + return &schema.Resource{ + ReadWithoutTimeout: dataSourceDistributedGrantsRead, + Schema: map[string]*schema.Schema{ + "filter": DataSourceFiltersSchema(), + "arns": { + Type: schema.TypeList, + Computed: true, + Elem: &schema.Schema{Type: schema.TypeString}, + }, + }, + } +} + +func dataSourceDistributedGrantsRead(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { + var diags diag.Diagnostics + conn := meta.(*conns.AWSClient).LicenseManagerConn() + + in := &licensemanager.ListDistributedGrantsInput{} + + in.Filters = BuildFiltersDataSource( + d.Get("filter").(*schema.Set), + ) + + if len(in.Filters) == 0 { + in.Filters = nil + } + + out, err := FindDistributedDistributedGrants(ctx, conn, in) + + if err != nil { + return sdkdiag.AppendErrorf(diags, "reading Distributes Grants: %s", err) + } + + var grantARNs []string + + for _, v := range out { + grantARNs = append(grantARNs, aws.StringValue(v.GrantArn)) + } + + d.SetId(meta.(*conns.AWSClient).Region) + d.Set("arns", grantARNs) + + return diags +} + +func FindDistributedDistributedGrants(ctx context.Context, conn *licensemanager.LicenseManager, in *licensemanager.ListDistributedGrantsInput) ([]*licensemanager.Grant, error) { + var out []*licensemanager.Grant + + err := listDistributedGrantsPages(ctx, conn, in, func(page *licensemanager.ListDistributedGrantsOutput, lastPage bool) bool { + if page == nil { + return !lastPage + } + + for _, v := range page.Grants { + if v != nil { + out = append(out, v) + } + } + + return !lastPage + }) + + if tfawserr.ErrCodeEquals(err, licensemanager.ErrCodeResourceNotFoundException) { + return nil, &resource.NotFoundError{ + LastError: err, + LastRequest: in, + } + } + + if err != nil { + return nil, err + } + + return out, nil +} From d175735a7cec6ced604cea36b04e4b4e5dc46105 Mon Sep 17 00:00:00 2001 From: Brittan DeYoung <32572259+brittandeyoung@users.noreply.github.com> Date: Wed, 8 Mar 2023 10:31:35 -0500 Subject: [PATCH 539/763] licensemanager: Add license_gratns_data_source_test --- .../license_grants_data_source_test.go | 103 ++++++++++++++++++ 1 file changed, 103 insertions(+) create mode 100644 internal/service/licensemanager/license_grants_data_source_test.go diff --git a/internal/service/licensemanager/license_grants_data_source_test.go b/internal/service/licensemanager/license_grants_data_source_test.go new file mode 100644 index 000000000000..949451097dd5 --- /dev/null +++ b/internal/service/licensemanager/license_grants_data_source_test.go @@ -0,0 +1,103 @@ +package licensemanager_test + +import ( + "fmt" + "os" + "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 TestAccLicenseManagerGrantsDataSource_basic(t *testing.T) { + ctx := acctest.Context(t) + rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) + datasourceName := "data.aws_licensemanager_grants.test" + licenseKey := "LICENSE_MANAGER_GRANT_LICENSE_ARN" + licenseARN := os.Getenv(licenseKey) + if licenseARN == "" { + t.Skipf("Environment variable %s is not set to true", licenseKey) + } + resourceName := "aws_licensemanager_grant.test" + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { acctest.PreCheck(t) }, + ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), + ProtoV5ProviderFactories: acctest.ProtoV5FactoriesAlternate(ctx, t), + Steps: []resource.TestStep{ + { + Config: testAccGrantsDataSourceConfig_arns(licenseARN, rName), + Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttr(datasourceName, "arns.#", "1"), + resource.TestCheckResourceAttrPair(resourceName, "arns.0", resourceName, "arn"), + ), + }, + }, + }) +} + +func TestAccLicenseManagerGrantsDataSource_empty(t *testing.T) { + ctx := acctest.Context(t) + datasourceName := "data.aws_licensemanager_grants.test" + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { acctest.PreCheck(t) }, + ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), + ProtoV5ProviderFactories: acctest.ProtoV5FactoriesAlternate(ctx, t), + Steps: []resource.TestStep{ + { + Config: testAccGrantsDataSourceConfig_empty(), + Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttr(datasourceName, "arns.#", "0"), + ), + }, + }, + }) +} + +func testAccGrantsDataSourceConfig_arns(licenseARN string, rName string) string { + return acctest.ConfigAlternateAccountProvider() + fmt.Sprintf(` +data "aws_licensemanager_received_license" "test" { + provider = awsalternate + license_arn = %[1]q +} + +locals { + allowed_operations = [for i in data.aws_licensemanager_received_license.test.received_metadata[0].allowed_operations : i if i != "CreateGrant"] +} +data "aws_partition" "current" {} +data "aws_caller_identity" "current" {} + +resource "aws_licensemanager_grant" "test" { + provider = awsalternate + + name = %[2]q + allowed_operations = local.allowed_operations + license_arn = data.aws_licensemanager_received_license.test.license_arn + principal = "arn:${data.aws_partition.current.partition}:iam::${data.aws_caller_identity.current.account_id}:root" +} + +data "aws_licensemanager_grants" "test" { + filter { + name = "ProductSKU" + values = [ + %[1]q + ] + } +} +`, licenseARN, rName) +} + +func testAccGrantsDataSourceConfig_empty() string { + return ` +data "aws_licensemanager_grants" "test" { + filter { + name = "LicenseIssuerName" + values = [ + "This Is Fake" + ] + } +} +` +} From 47cb62eec1f17b17a719d5ffdb7f7193da555ac7 Mon Sep 17 00:00:00 2001 From: Brittan DeYoung <32572259+brittandeyoung@users.noreply.github.com> Date: Wed, 8 Mar 2023 10:32:35 -0500 Subject: [PATCH 540/763] licensemanager: Add license_grants to service gen --- internal/service/licensemanager/license_grants_data_source.go | 1 + internal/service/licensemanager/service_package_gen.go | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/internal/service/licensemanager/license_grants_data_source.go b/internal/service/licensemanager/license_grants_data_source.go index 955a83c650a4..2e852c013edb 100644 --- a/internal/service/licensemanager/license_grants_data_source.go +++ b/internal/service/licensemanager/license_grants_data_source.go @@ -13,6 +13,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" ) +// @SDKDataSource("aws_licensemanager_grants") func DataSourceDistributedGrants() *schema.Resource { return &schema.Resource{ ReadWithoutTimeout: dataSourceDistributedGrantsRead, diff --git a/internal/service/licensemanager/service_package_gen.go b/internal/service/licensemanager/service_package_gen.go index 42d98d54558d..7597b93f1903 100644 --- a/internal/service/licensemanager/service_package_gen.go +++ b/internal/service/licensemanager/service_package_gen.go @@ -21,6 +21,10 @@ func (p *servicePackage) FrameworkResources(ctx context.Context) []*types.Servic func (p *servicePackage) SDKDataSources(ctx context.Context) []*types.ServicePackageSDKDataSource { return []*types.ServicePackageSDKDataSource{ + { + Factory: DataSourceDistributedGrants, + TypeName: "aws_licensemanager_grants", + }, { Factory: DataSourceReceivedLicense, TypeName: "aws_licensemanager_received_license", From eb3107720bee75a7935670a5e014da7339acebb4 Mon Sep 17 00:00:00 2001 From: Brittan DeYoung <32572259+brittandeyoung@users.noreply.github.com> Date: Wed, 8 Mar 2023 10:32:51 -0500 Subject: [PATCH 541/763] website: Add licensemanager_grants data source --- .../d/licensemanager_grants.html.markdown | 54 +++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 website/docs/d/licensemanager_grants.html.markdown diff --git a/website/docs/d/licensemanager_grants.html.markdown b/website/docs/d/licensemanager_grants.html.markdown new file mode 100644 index 000000000000..8369ffc24f81 --- /dev/null +++ b/website/docs/d/licensemanager_grants.html.markdown @@ -0,0 +1,54 @@ +--- +subcategory: "License Manager" +layout: "aws" +page_title: "AWS: aws_licensemanager_grants" +description: |- + Get information about a set of license manager grant licenses +--- + +# Data Source: aws_licensemanager_grants + +This resource can be used to get a set of license grant ARNs matching a filter. + +## Example Usage + +The following shows getting all license grant ARNs granted to your account. + +```terraform +data "aws_caller_identity" "current" {} + +data "aws_licensemanager_grants" "test" { + filter { + name = "GranteePrincipalARN" + values = [ + "arn:aws:iam::${data.aws_caller_identity.current.account_id}:root" + ] + } +} +``` + +## Argument Reference + +* `filter` - (Optional) Custom filter block as described below. + +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](https://docs.aws.amazon.com/license-manager/latest/APIReference/API_ListReceivedGrants.html#API_ListReceivedGrants_RequestSyntax). + For example, if filtering using `ProductSKU`, use: + +```terraform +data "aws_licensemanager_grants" "selected" { + filter { + name = "ProductSKU" + values = [""] # insert values here + } +} +``` + +* `values` - (Required) Set of values that are accepted for the given field. + +## Attributes Reference + +* `arns` - List of all the license grant ARNs found. From 440c2149af63512780d0d65703b78d93adf356a8 Mon Sep 17 00:00:00 2001 From: changhyuni Date: Thu, 9 Mar 2023 00:55:05 +0900 Subject: [PATCH 542/763] Fix typo --- internal/service/opensearch/domain_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/service/opensearch/domain_test.go b/internal/service/opensearch/domain_test.go index d004bf2878d6..4f668fc3f1ed 100644 --- a/internal/service/opensearch/domain_test.go +++ b/internal/service/opensearch/domain_test.go @@ -150,7 +150,7 @@ func TestAccOpenSearchDomain_basic(t *testing.T) { Check: resource.ComposeTestCheckFunc( testAccCheckDomainExists(ctx, resourceName, &domain), resource.TestCheckResourceAttr(resourceName, "engine_version", "OpenSearch_1.1"), - resource.TestMatchResourceAttr(resourceName, "dashboard_endpoint", regexp.MustCompile(`.*(opensearch|es)\..*/_dashboards/`)), + resource.TestMatchResourceAttr(resourceName, "dashboard_endpoint", regexp.MustCompile(`.*(opensearch|es)\..*/_dashboards`)), resource.TestCheckResourceAttr(resourceName, "vpc_options.#", "0"), resource.TestCheckResourceAttr(resourceName, "tags.%", "0"), ), From 3de934543f205b05f06855e8ead7f49dec372c28 Mon Sep 17 00:00:00 2001 From: changhyuni Date: Thu, 9 Mar 2023 01:01:50 +0900 Subject: [PATCH 543/763] Fix opensearch document --- website/docs/d/opensearch_domain.html.markdown | 4 ++-- website/docs/r/opensearch_domain.html.markdown | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/website/docs/d/opensearch_domain.html.markdown b/website/docs/d/opensearch_domain.html.markdown index bc39452c13d8..6d61b5f906cb 100644 --- a/website/docs/d/opensearch_domain.html.markdown +++ b/website/docs/d/opensearch_domain.html.markdown @@ -57,7 +57,7 @@ The following attributes are exported: * `warm_enabled` - Warm storage is enabled. * `warm_count` - Number of warm nodes in the cluster. * `warm_type` - Instance type for the OpenSearch cluster's warm nodes. -* `cognito_options` - Domain Amazon Cognito Authentication options for Kibana. +* `cognito_options` - Domain Amazon Cognito Authentication options for Dashboard. * `enabled` - Whether Amazon Cognito Authentication is enabled. * `user_pool_id` - Cognito User pool used by the domain. * `identity_pool_id` - Cognito Identity pool used by the domain. @@ -76,7 +76,7 @@ The following attributes are exported: * `enabled` - Whether encryption at rest is enabled in the domain. * `kms_key_id` - KMS key id used to encrypt data at rest. * `endpoint` – Domain-specific endpoint used to submit index, search, and data upload requests. -* `kibana_endpoint` - Domain-specific endpoint used to access the Kibana application. +* `dashboard_endpoint` - Domain-specific endpoint used to access the Dashboard application. * `log_publishing_options` - Domain log publishing related options. * `log_type` - Type of OpenSearch log being published. * `cloudwatch_log_group_arn` - CloudWatch Log Group where the logs are published. diff --git a/website/docs/r/opensearch_domain.html.markdown b/website/docs/r/opensearch_domain.html.markdown index d851e183d345..61f4f0bac271 100644 --- a/website/docs/r/opensearch_domain.html.markdown +++ b/website/docs/r/opensearch_domain.html.markdown @@ -322,7 +322,7 @@ The following arguments are optional: * `advanced_security_options` - (Optional) Configuration block for [fine-grained access control](https://docs.aws.amazon.com/opensearch-service/latest/developerguide/fgac.html). Detailed below. * `auto_tune_options` - (Optional) Configuration block for the Auto-Tune options of the domain. Detailed below. * `cluster_config` - (Optional) Configuration block for the cluster of the domain. Detailed below. -* `cognito_options` - (Optional) Configuration block for authenticating Kibana with Cognito. Detailed below. +* `cognito_options` - (Optional) Configuration block for authenticating dashboard with Cognito. Detailed below. * `domain_endpoint_options` - (Optional) Configuration block for domain endpoint HTTP(S) related options. Detailed below. * `ebs_options` - (Optional) Configuration block for EBS related options, may be required based on chosen [instance size](https://aws.amazon.com/opensearch-service/pricing/). Detailed below. * `engine_version` - (Optional) Either `Elasticsearch_X.Y` or `OpenSearch_X.Y` to specify the engine version for the Amazon OpenSearch Service domain. For example, `OpenSearch_1.0` or `Elasticsearch_7.9`. See [Creating and managing Amazon OpenSearch Service domains](http://docs.aws.amazon.com/opensearch-service/latest/developerguide/createupdatedomains.html#createdomains). Defaults to `OpenSearch_1.1`. @@ -387,9 +387,9 @@ The following arguments are optional: ### cognito_options -AWS documentation: [Amazon Cognito Authentication for Kibana](https://docs.aws.amazon.com/opensearch-service/latest/developerguide/es-cognito-auth.html) +AWS documentation: [Amazon Cognito Authentication for Dashboard](https://docs.aws.amazon.com/opensearch-service/latest/developerguide/es-cognito-auth.html) -* `enabled` - (Optional) Whether Amazon Cognito authentication with Kibana is enabled or not. Default is `false`. +* `enabled` - (Optional) Whether Amazon Cognito authentication with Dashboard is enabled or not. Default is `false`. * `identity_pool_id` - (Required) ID of the Cognito Identity Pool to use. * `role_arn` - (Required) ARN of the IAM role that has the AmazonOpenSearchServiceCognitoAccess policy attached. * `user_pool_id` - (Required) ID of the Cognito User Pool to use. @@ -452,7 +452,7 @@ In addition to all arguments above, the following attributes are exported: * `domain_id` - Unique identifier for the domain. * `domain_name` - Name of the OpenSearch domain. * `endpoint` - Domain-specific endpoint used to submit index, search, and data upload requests. -* `kibana_endpoint` - Domain-specific endpoint for kibana without https scheme. +* `dashboard_endpoint` - Domain-specific endpoint for Dashboard without https scheme. * `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). * `vpc_options.0.availability_zones` - If the domain was created inside a VPC, the names of the availability zones the configured `subnet_ids` were created inside. * `vpc_options.0.vpc_id` - If the domain was created inside a VPC, the ID of the VPC. From 4f0c5a91a2c75a893e8c3cc2c24c78a5217b5df6 Mon Sep 17 00:00:00 2001 From: Brittan DeYoung <32572259+brittandeyoung@users.noreply.github.com> Date: Wed, 8 Mar 2023 11:06:46 -0500 Subject: [PATCH 544/763] licensemanager: Amend license_grants_data_source_test, move to serial tests --- .../license_grants_data_source_test.go | 50 ++++++++++--------- 1 file changed, 27 insertions(+), 23 deletions(-) diff --git a/internal/service/licensemanager/license_grants_data_source_test.go b/internal/service/licensemanager/license_grants_data_source_test.go index 949451097dd5..48beeac880c9 100644 --- a/internal/service/licensemanager/license_grants_data_source_test.go +++ b/internal/service/licensemanager/license_grants_data_source_test.go @@ -11,7 +11,20 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) -func TestAccLicenseManagerGrantsDataSource_basic(t *testing.T) { +func TestAccLicenseManagerGrantsDataSource_serial(t *testing.T) { + t.Parallel() + + testCases := map[string]map[string]func(t *testing.T){ + "grant": { + "basic": testAccGrantsDataSource_basic, + "empty": testAccGrantsDataSource_empty, + }, + } + + acctest.RunSerialTests2Levels(t, testCases, 0) +} + +func testAccGrantsDataSource_basic(t *testing.T) { ctx := acctest.Context(t) rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) datasourceName := "data.aws_licensemanager_grants.test" @@ -20,9 +33,7 @@ func TestAccLicenseManagerGrantsDataSource_basic(t *testing.T) { if licenseARN == "" { t.Skipf("Environment variable %s is not set to true", licenseKey) } - resourceName := "aws_licensemanager_grant.test" - - resource.ParallelTest(t, resource.TestCase{ + resource.Test(t, resource.TestCase{ PreCheck: func() { acctest.PreCheck(t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5FactoriesAlternate(ctx, t), @@ -30,21 +41,19 @@ func TestAccLicenseManagerGrantsDataSource_basic(t *testing.T) { { Config: testAccGrantsDataSourceConfig_arns(licenseARN, rName), Check: resource.ComposeTestCheckFunc( - resource.TestCheckResourceAttr(datasourceName, "arns.#", "1"), - resource.TestCheckResourceAttrPair(resourceName, "arns.0", resourceName, "arn"), + resource.TestCheckResourceAttrSet(datasourceName, "arns.0"), ), }, }, }) } -func TestAccLicenseManagerGrantsDataSource_empty(t *testing.T) { - ctx := acctest.Context(t) +func testAccGrantsDataSource_empty(t *testing.T) { datasourceName := "data.aws_licensemanager_grants.test" - resource.ParallelTest(t, resource.TestCase{ + resource.Test(t, resource.TestCase{ PreCheck: func() { acctest.PreCheck(t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), - ProtoV5ProviderFactories: acctest.ProtoV5FactoriesAlternate(ctx, t), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ { Config: testAccGrantsDataSourceConfig_empty(), @@ -59,33 +68,28 @@ func TestAccLicenseManagerGrantsDataSource_empty(t *testing.T) { func testAccGrantsDataSourceConfig_arns(licenseARN string, rName string) string { return acctest.ConfigAlternateAccountProvider() + fmt.Sprintf(` data "aws_licensemanager_received_license" "test" { - provider = awsalternate license_arn = %[1]q } locals { allowed_operations = [for i in data.aws_licensemanager_received_license.test.received_metadata[0].allowed_operations : i if i != "CreateGrant"] } -data "aws_partition" "current" {} -data "aws_caller_identity" "current" {} -resource "aws_licensemanager_grant" "test" { - provider = awsalternate +data "aws_partition" "current" { + provider = awsalternate +} +data "aws_caller_identity" "current" { + provider = awsalternate +} +resource "aws_licensemanager_grant" "test" { name = %[2]q allowed_operations = local.allowed_operations license_arn = data.aws_licensemanager_received_license.test.license_arn principal = "arn:${data.aws_partition.current.partition}:iam::${data.aws_caller_identity.current.account_id}:root" } -data "aws_licensemanager_grants" "test" { - filter { - name = "ProductSKU" - values = [ - %[1]q - ] - } -} +data "aws_licensemanager_grants" "test" {} `, licenseARN, rName) } From 4b586daa734496f3dd8f99f40104c1962128f7b2 Mon Sep 17 00:00:00 2001 From: Brittan DeYoung <32572259+brittandeyoung@users.noreply.github.com> Date: Wed, 8 Mar 2023 11:13:19 -0500 Subject: [PATCH 545/763] licensemanager: Amend license_grants_data_source_test, lint fix --- .../service/licensemanager/license_grants_data_source_test.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/service/licensemanager/license_grants_data_source_test.go b/internal/service/licensemanager/license_grants_data_source_test.go index 48beeac880c9..1103ac778371 100644 --- a/internal/service/licensemanager/license_grants_data_source_test.go +++ b/internal/service/licensemanager/license_grants_data_source_test.go @@ -76,10 +76,10 @@ locals { } data "aws_partition" "current" { - provider = awsalternate + provider = awsalternate } data "aws_caller_identity" "current" { - provider = awsalternate + provider = awsalternate } resource "aws_licensemanager_grant" "test" { From f6072c84ed105d8a832b3fe7243839df7968e92d Mon Sep 17 00:00:00 2001 From: Brittan DeYoung <32572259+brittandeyoung@users.noreply.github.com> Date: Wed, 8 Mar 2023 11:15:56 -0500 Subject: [PATCH 546/763] changelog: Amend 29741, add new datasource --- .changelog/29741.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.changelog/29741.txt b/.changelog/29741.txt index 0c8182c79ad0..7e7cea0e4650 100644 --- a/.changelog/29741.txt +++ b/.changelog/29741.txt @@ -13,3 +13,7 @@ aws_licensemanager_received_license ```release-note:new-data-source aws_licensemanager_received_licenses ``` + +```release-note:new-data-source +aws_licensemanager_grants +``` \ No newline at end of file From cd956a9ba799eb64d10a5c12f64e61d7dd5978d6 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Wed, 8 Mar 2023 11:43:36 -0500 Subject: [PATCH 547/763] r/flow_log: 'cross_account_iam_role_arn' -> 'deliver_cross_account_role'. --- .changelog/29254.txt | 2 +- internal/service/ec2/vpc_flow_log.go | 6 +++--- internal/service/ec2/vpc_flow_log_test.go | 5 +++-- website/docs/r/flow_log.html.markdown | 2 +- 4 files changed, 8 insertions(+), 7 deletions(-) diff --git a/.changelog/29254.txt b/.changelog/29254.txt index 056e906d1dec..b08582ef390a 100644 --- a/.changelog/29254.txt +++ b/.changelog/29254.txt @@ -1,3 +1,3 @@ ```release-note:enhancement -resource/aws_flow_log: Add `cross_account_iam_role_arn` attribute +resource/aws_flow_log: Add `deliver_cross_account_role` argument ``` diff --git a/internal/service/ec2/vpc_flow_log.go b/internal/service/ec2/vpc_flow_log.go index 3c72927d272f..0dab439240cf 100644 --- a/internal/service/ec2/vpc_flow_log.go +++ b/internal/service/ec2/vpc_flow_log.go @@ -38,7 +38,7 @@ func ResourceFlowLog() *schema.Resource { Type: schema.TypeString, Computed: true, }, - "cross_account_iam_role_arn": { + "deliver_cross_account_role": { Type: schema.TypeString, Optional: true, ForceNew: true, @@ -217,7 +217,7 @@ func resourceLogFlowCreate(ctx context.Context, d *schema.ResourceData, meta int input.DestinationOptions = expandDestinationOptionsRequest(v.([]interface{})[0].(map[string]interface{})) } - if v, ok := d.GetOk("cross_account_iam_role_arn"); ok { + if v, ok := d.GetOk("deliver_cross_account_role"); ok { input.DeliverCrossAccountRole = aws.String(v.(string)) } @@ -286,7 +286,7 @@ func resourceLogFlowRead(ctx context.Context, d *schema.ResourceData, meta inter Resource: fmt.Sprintf("vpc-flow-log/%s", d.Id()), }.String() d.Set("arn", arn) - d.Set("cross_account_iam_role_arn", fl.DeliverCrossAccountRole) + d.Set("deliver_cross_account_role", fl.DeliverCrossAccountRole) if fl.DestinationOptions != nil { if err := d.Set("destination_options", []interface{}{flattenDestinationOptionsResponse(fl.DestinationOptions)}); err != nil { return sdkdiag.AppendErrorf(diags, "setting destination_options: %s", err) diff --git a/internal/service/ec2/vpc_flow_log_test.go b/internal/service/ec2/vpc_flow_log_test.go index 747aa4042a57..0e5d04a50794 100644 --- a/internal/service/ec2/vpc_flow_log_test.go +++ b/internal/service/ec2/vpc_flow_log_test.go @@ -36,6 +36,7 @@ func TestAccVPCFlowLog_vpcID(t *testing.T) { Check: resource.ComposeTestCheckFunc( testAccCheckFlowLogExists(ctx, resourceName, &flowLog), acctest.MatchResourceAttrRegionalARN(resourceName, "arn", "ec2", regexp.MustCompile(`vpc-flow-log/fl-.+`)), + resource.TestCheckResourceAttr(resourceName, "deliver_cross_account_role", ""), resource.TestCheckResourceAttrPair(resourceName, "iam_role_arn", iamRoleResourceName, "arn"), resource.TestCheckResourceAttr(resourceName, "log_destination", ""), resource.TestCheckResourceAttr(resourceName, "log_destination_type", "cloud-watch-logs"), @@ -149,7 +150,7 @@ func TestAccVPCFlowLog_crossAccountRole(t *testing.T) { Config: testAccVPCFlowLogConfig_crossAccountRole(rName, rName2), Check: resource.ComposeTestCheckFunc( testAccCheckFlowLogExists(ctx, resourceName, &flowLog), - resource.TestCheckResourceAttrPair(resourceName, "cross_account_iam_role_arn", crossAccountIamRoleResourceName, "arn"), + resource.TestCheckResourceAttrPair(resourceName, "deliver_cross_account_role", crossAccountIamRoleResourceName, "arn"), resource.TestCheckResourceAttrPair(resourceName, "iam_role_arn", iamRoleResourceName, "arn"), resource.TestCheckResourceAttr(resourceName, "log_destination", ""), resource.TestCheckResourceAttr(resourceName, "log_destination_type", "cloud-watch-logs"), @@ -963,7 +964,7 @@ resource "aws_cloudwatch_log_group" "test" { } resource "aws_flow_log" "test" { - cross_account_iam_role_arn = aws_iam_role.test_cross_account.arn + deliver_cross_account_role = aws_iam_role.test_cross_account.arn iam_role_arn = aws_iam_role.test.arn log_group_name = aws_cloudwatch_log_group.test.name subnet_id = aws_subnet.test.id diff --git a/website/docs/r/flow_log.html.markdown b/website/docs/r/flow_log.html.markdown index 97e4ccb74f70..5398fbcd5632 100644 --- a/website/docs/r/flow_log.html.markdown +++ b/website/docs/r/flow_log.html.markdown @@ -181,7 +181,7 @@ resource "aws_s3_bucket" "example" { The following arguments are supported: * `traffic_type` - (Required) The type of traffic to capture. Valid values: `ACCEPT`,`REJECT`, `ALL`. -* `cross_account_iam_role_arn` - (Optional) ARN of the IAM role that allows Amazon EC2 to publish flow logs across accounts. +* `deliver_cross_account_role` - (Optional) ARN of the IAM role that allows Amazon EC2 to publish flow logs across accounts. * `eni_id` - (Optional) Elastic Network Interface ID to attach to * `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`. From cb3fbaa6cb2f44adc67a3cf0a9e1c740d712e14c Mon Sep 17 00:00:00 2001 From: Jamie Date: Thu, 9 Mar 2023 00:50:37 +0800 Subject: [PATCH 548/763] docs: Modify policy reference for resource aws_iam_role_policy.cloudwatch (#29865) --- website/docs/r/api_gateway_account.html.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/website/docs/r/api_gateway_account.html.markdown b/website/docs/r/api_gateway_account.html.markdown index c66f298844d4..abe0b547b1ce 100644 --- a/website/docs/r/api_gateway_account.html.markdown +++ b/website/docs/r/api_gateway_account.html.markdown @@ -57,7 +57,7 @@ data "aws_iam_policy_document" "cloudwatch" { resource "aws_iam_role_policy" "cloudwatch" { name = "default" role = aws_iam_role.cloudwatch.id - policy = data.aws_iam_policy_document.json + policy = data.aws_iam_policy_document.cloudwatch.json } ``` From 7640ae2511b8abc797d234e8faf7b3c2469c8f5b Mon Sep 17 00:00:00 2001 From: quartercastle Date: Mon, 6 Mar 2023 14:46:47 +0100 Subject: [PATCH 549/763] fix issue with include_fec not being set include_fec in fec_output_settings are not set correctly --- .../channel_encoder_settings_schema.go | 2 +- internal/service/medialive/channel_test.go | 148 ++++++++++++++++++ 2 files changed, 149 insertions(+), 1 deletion(-) diff --git a/internal/service/medialive/channel_encoder_settings_schema.go b/internal/service/medialive/channel_encoder_settings_schema.go index 7c95ae30d27a..4199f98ab322 100644 --- a/internal/service/medialive/channel_encoder_settings_schema.go +++ b/internal/service/medialive/channel_encoder_settings_schema.go @@ -3938,7 +3938,7 @@ func expandFecOutputSettings(tfList []interface{}) *types.FecOutputSettings { if v, ok := m["column_depth"].(int); ok { settings.ColumnDepth = int32(v) } - if v, ok := m["column_depth"].(string); ok && v != "" { + if v, ok := m["include_fec"].(string); ok && v != "" { settings.IncludeFec = types.FecOutputIncludeFec(v) } if v, ok := m["row_length"].(int); ok { diff --git a/internal/service/medialive/channel_test.go b/internal/service/medialive/channel_test.go index 9fa6d13e1afc..ed4e1734abef 100644 --- a/internal/service/medialive/channel_test.go +++ b/internal/service/medialive/channel_test.go @@ -143,6 +143,68 @@ func TestAccMediaLiveChannel_m2ts_settings(t *testing.T) { }) } +func TestAccMediaLiveChannel_udp_output_settings(t *testing.T) { + ctx := acctest.Context(t) + if testing.Short() { + t.Skip("skipping long-running test in short mode") + } + + var channel medialive.DescribeChannelOutput + rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) + resourceName := "aws_medialive_channel.test" + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { + acctest.PreCheck(t) + acctest.PreCheckPartitionHasService(names.MediaLiveEndpointID, t) + testAccChannelsPreCheck(ctx, t) + }, + ErrorCheck: acctest.ErrorCheck(t, names.MediaLiveEndpointID), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + CheckDestroy: testAccCheckChannelDestroy(ctx), + Steps: []resource.TestStep{ + { + Config: testAccChannelConfig_udpOutputSettings(rName), + Check: resource.ComposeTestCheckFunc( + testAccCheckChannelExists(ctx, resourceName, &channel), + resource.TestCheckResourceAttrSet(resourceName, "channel_id"), + resource.TestCheckResourceAttr(resourceName, "channel_class", "STANDARD"), + resource.TestCheckResourceAttr(resourceName, "name", rName), + resource.TestCheckResourceAttrSet(resourceName, "role_arn"), + resource.TestCheckResourceAttr(resourceName, "input_specification.0.codec", "AVC"), + resource.TestCheckResourceAttr(resourceName, "input_specification.0.input_resolution", "HD"), + resource.TestCheckResourceAttr(resourceName, "input_specification.0.maximum_bitrate", "MAX_20_MBPS"), + resource.TestCheckTypeSetElemNestedAttrs(resourceName, "input_attachments.*", map[string]string{ + "input_attachment_name": "example-input1", + }), + resource.TestCheckTypeSetElemNestedAttrs(resourceName, "destinations.*", map[string]string{ + "id": rName, + }), + resource.TestCheckResourceAttr(resourceName, "encoder_settings.0.timecode_config.0.source", "EMBEDDED"), + resource.TestCheckTypeSetElemNestedAttrs(resourceName, "encoder_settings.0.audio_descriptions.*", map[string]string{ + "audio_selector_name": rName, + "name": rName, + }), + resource.TestCheckTypeSetElemNestedAttrs(resourceName, "encoder_settings.0.video_descriptions.*", map[string]string{ + "name": "test-video-name", + }), + resource.TestCheckTypeSetElemNestedAttrs(resourceName, "encoder_settings.0.output_groups.0.outputs.0.output_settings.0.udp_output_settings.0.fec_output_settings.*", map[string]string{ + "include_fec": "COLUMN_AND_ROW", + "column_depth": "5", + "row_length": "5", + }), + ), + }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + ImportStateVerifyIgnore: []string{"start_channel"}, + }, + }, + }) +} + func TestAccMediaLiveChannel_audioDescriptions_codecSettings(t *testing.T) { ctx := acctest.Context(t) if testing.Short() { @@ -713,6 +775,92 @@ resource "aws_medialive_channel" "test" { `, rName)) } +func testAccChannelConfig_udpOutputSettings(rName string) string { + return acctest.ConfigCompose( + testAccChannelBaseConfig(rName), + testAccChannelBaseMultiplexConfig(rName), + fmt.Sprintf(` +resource "aws_medialive_channel" "test" { + name = %[1]q + channel_class = "STANDARD" + role_arn = aws_iam_role.test.arn + + input_specification { + codec = "AVC" + input_resolution = "HD" + maximum_bitrate = "MAX_20_MBPS" + } + + input_attachments { + input_attachment_name = "example-input1" + input_id = aws_medialive_input.test.id + } + + destinations { + id = %[1]q + + settings { + url = "rtp://localhost:8000" + } + + settings { + url = "rtp://localhost:8001" + } + } + + encoder_settings { + timecode_config { + source = "EMBEDDED" + } + + video_descriptions { + name = "test-video-name" + } + + audio_descriptions { + audio_selector_name = %[1]q + name = %[1]q + } + + output_groups { + output_group_settings { + udp_group_settings { + input_loss_action = "DROP_TS" + } + } + + outputs { + output_name = "test-output-name" + video_description_name = "test-video-name" + audio_description_names = [%[1]q] + output_settings { + udp_output_settings { + destination { + destination_ref_id = %[1]q + } + + fec_output_settings { + include_fec = "COLUMN_AND_ROW" + column_depth = 5 + row_length = 5 + } + + container_settings { + m2ts_settings { + audio_buffer_model = "ATSC" + buffer_model = "MULTIPLEX" + rate_mode = "CBR" + } + } + } + } + } + } + } +} +`, rName)) +} + func testAccChannelConfig_m2tsSettings(rName string) string { return acctest.ConfigCompose( testAccChannelBaseConfig(rName), From 8814069b1dd93233468b1efc44ffae9710737191 Mon Sep 17 00:00:00 2001 From: quartercastle Date: Mon, 6 Mar 2023 15:31:10 +0100 Subject: [PATCH 550/763] terraform fmt --- internal/service/medialive/channel_test.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/internal/service/medialive/channel_test.go b/internal/service/medialive/channel_test.go index ed4e1734abef..0e2c1b9df437 100644 --- a/internal/service/medialive/channel_test.go +++ b/internal/service/medialive/channel_test.go @@ -800,11 +800,11 @@ resource "aws_medialive_channel" "test" { id = %[1]q settings { - url = "rtp://localhost:8000" + url = "rtp://localhost:8000" } settings { - url = "rtp://localhost:8001" + url = "rtp://localhost:8001" } } @@ -850,9 +850,9 @@ resource "aws_medialive_channel" "test" { audio_buffer_model = "ATSC" buffer_model = "MULTIPLEX" rate_mode = "CBR" - } - } - } + } + } + } } } } From 833c614ef67a2432cf48c9ae96044658801de9cb Mon Sep 17 00:00:00 2001 From: quartercastle Date: Mon, 6 Mar 2023 16:43:03 +0100 Subject: [PATCH 551/763] fix order of arguments --- internal/service/medialive/channel_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/service/medialive/channel_test.go b/internal/service/medialive/channel_test.go index 0e2c1b9df437..a8bc6aba1c7b 100644 --- a/internal/service/medialive/channel_test.go +++ b/internal/service/medialive/channel_test.go @@ -156,7 +156,7 @@ func TestAccMediaLiveChannel_udp_output_settings(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { acctest.PreCheck(t) - acctest.PreCheckPartitionHasService(names.MediaLiveEndpointID, t) + acctest.PreCheckPartitionHasService(t, names.MediaLiveEndpointID) testAccChannelsPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, names.MediaLiveEndpointID), From d7a2d096edd1189357dee2b3a0a9b8e3b503da4b Mon Sep 17 00:00:00 2001 From: quartercastle Date: Mon, 6 Mar 2023 16:50:41 +0100 Subject: [PATCH 552/763] add changelog --- .changelog/29808.txt | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 .changelog/29808.txt diff --git a/.changelog/29808.txt b/.changelog/29808.txt new file mode 100644 index 000000000000..890c1fdbd855 --- /dev/null +++ b/.changelog/29808.txt @@ -0,0 +1,3 @@ +``release-note:bug + resource/aws_medialive_channel: Fix setting of the `include_fec` attribute in `fec_output_settings` + ``` From 6558adc2b5cefbd62ad6f05e71899bc8ce0bd0ac Mon Sep 17 00:00:00 2001 From: quartercastle Date: Mon, 6 Mar 2023 16:52:05 +0100 Subject: [PATCH 553/763] fix formatting error --- .changelog/29808.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.changelog/29808.txt b/.changelog/29808.txt index 890c1fdbd855..16ce4d93f537 100644 --- a/.changelog/29808.txt +++ b/.changelog/29808.txt @@ -1,3 +1,3 @@ -``release-note:bug - resource/aws_medialive_channel: Fix setting of the `include_fec` attribute in `fec_output_settings` - ``` +```release-note:bug +resource/aws_medialive_channel: Fix setting of the `include_fec` attribute in `fec_output_settings` +``` From aaf0c94e07a494b252e2948fa839ad0df893b784 Mon Sep 17 00:00:00 2001 From: Frederik Kvartborg Albertsen Date: Wed, 8 Mar 2023 17:49:13 +0100 Subject: [PATCH 554/763] Update internal/service/medialive/channel_test.go Co-authored-by: Adrian Johnson --- internal/service/medialive/channel_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/service/medialive/channel_test.go b/internal/service/medialive/channel_test.go index a8bc6aba1c7b..b0f88f43bec0 100644 --- a/internal/service/medialive/channel_test.go +++ b/internal/service/medialive/channel_test.go @@ -143,7 +143,7 @@ func TestAccMediaLiveChannel_m2ts_settings(t *testing.T) { }) } -func TestAccMediaLiveChannel_udp_output_settings(t *testing.T) { +func TestAccMediaLiveChannel_UDP_outputSettings(t *testing.T) { ctx := acctest.Context(t) if testing.Short() { t.Skip("skipping long-running test in short mode") From d5e068d9dfe9d3ad4498f58972e82a84bdc24e37 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 8 Mar 2023 08:52:26 -0800 Subject: [PATCH 555/763] build(deps): bump breathingdust/github-team-slackbot (#29851) Bumps [breathingdust/github-team-slackbot](https://github.com/breathingdust/github-team-slackbot) from 18.0.0 to 18.2.0. - [Release notes](https://github.com/breathingdust/github-team-slackbot/releases) - [Commits](https://github.com/breathingdust/github-team-slackbot/compare/fb599cd2de52631372d646388ef507a8b283a606...e5c4459dcf1cb88320764db206e5c5b1f50f6e6e) --- updated-dependencies: - dependency-name: breathingdust/github-team-slackbot dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/team_slack_bot.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/team_slack_bot.yml b/.github/workflows/team_slack_bot.yml index beea68972083..886a4fea5792 100644 --- a/.github/workflows/team_slack_bot.yml +++ b/.github/workflows/team_slack_bot.yml @@ -11,7 +11,7 @@ jobs: if: github.repository_owner == 'hashicorp' steps: - name: open-pr-stats - uses: breathingdust/github-team-slackbot@fb599cd2de52631372d646388ef507a8b283a606 + uses: breathingdust/github-team-slackbot@e5c4459dcf1cb88320764db206e5c5b1f50f6e6e with: github_token: ${{ secrets.ORGSCOPED_GITHUB_TOKEN}} org: hashicorp From 99facf716bad99906104e188683fdc1a22bafc59 Mon Sep 17 00:00:00 2001 From: taewdy Date: Thu, 9 Mar 2023 03:53:54 +1100 Subject: [PATCH 556/763] consistent naming convention for variable in example (#29848) --- examples/eks-getting-started/eks-cluster.tf | 2 +- examples/eks-getting-started/outputs.tf | 2 +- examples/eks-getting-started/variables.tf | 2 +- examples/eks-getting-started/vpc.tf | 4 ++-- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/examples/eks-getting-started/eks-cluster.tf b/examples/eks-getting-started/eks-cluster.tf index 9ab6a6acf5f2..36ba135b07c7 100644 --- a/examples/eks-getting-started/eks-cluster.tf +++ b/examples/eks-getting-started/eks-cluster.tf @@ -62,7 +62,7 @@ resource "aws_security_group_rule" "demo-cluster-ingress-workstation-https" { } resource "aws_eks_cluster" "demo" { - name = var.cluster-name + name = var.cluster_name role_arn = aws_iam_role.demo-cluster.arn vpc_config { diff --git a/examples/eks-getting-started/outputs.tf b/examples/eks-getting-started/outputs.tf index 8ba7ddae290a..f38892685546 100644 --- a/examples/eks-getting-started/outputs.tf +++ b/examples/eks-getting-started/outputs.tf @@ -46,7 +46,7 @@ users: args: - "token" - "-i" - - "${var.cluster-name}" + - "${var.cluster_name}" KUBECONFIG } diff --git a/examples/eks-getting-started/variables.tf b/examples/eks-getting-started/variables.tf index 88180a552bae..265111500a59 100644 --- a/examples/eks-getting-started/variables.tf +++ b/examples/eks-getting-started/variables.tf @@ -2,7 +2,7 @@ variable "aws_region" { default = "us-west-2" } -variable "cluster-name" { +variable "cluster_name" { default = "terraform-eks-demo" type = string } diff --git a/examples/eks-getting-started/vpc.tf b/examples/eks-getting-started/vpc.tf index fb029f98d4ff..99e26b7fa474 100644 --- a/examples/eks-getting-started/vpc.tf +++ b/examples/eks-getting-started/vpc.tf @@ -11,7 +11,7 @@ resource "aws_vpc" "demo" { tags = tomap({ "Name" = "terraform-eks-demo-node", - "kubernetes.io/cluster/${var.cluster-name}" = "shared", + "kubernetes.io/cluster/${var.cluster_name}" = "shared", }) } @@ -25,7 +25,7 @@ resource "aws_subnet" "demo" { tags = tomap({ "Name" = "terraform-eks-demo-node", - "kubernetes.io/cluster/${var.cluster-name}" = "shared", + "kubernetes.io/cluster/${var.cluster_name}" = "shared", }) } From d72769bf61e60a931172028c1de16d1bc5439b0f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 8 Mar 2023 13:25:04 -0500 Subject: [PATCH 557/763] build(deps): bump github.com/aws/aws-sdk-go from 1.44.215 to 1.44.216 (#29853) Bumps [github.com/aws/aws-sdk-go](https://github.com/aws/aws-sdk-go) from 1.44.215 to 1.44.216. - [Release notes](https://github.com/aws/aws-sdk-go/releases) - [Commits](https://github.com/aws/aws-sdk-go/compare/v1.44.215...v1.44.216) --- updated-dependencies: - dependency-name: github.com/aws/aws-sdk-go dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 021ec8259eb6..41d4d96643ce 100644 --- a/go.mod +++ b/go.mod @@ -4,7 +4,7 @@ go 1.19 require ( github.com/ProtonMail/go-crypto v0.0.0-20230201104953-d1d05f4e2bfb - github.com/aws/aws-sdk-go v1.44.215 + github.com/aws/aws-sdk-go v1.44.216 github.com/aws/aws-sdk-go-v2 v1.17.5 github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.12.23 github.com/aws/aws-sdk-go-v2/service/auditmanager v1.24.1 diff --git a/go.sum b/go.sum index da5b86a6abd7..c1718c9ffd65 100644 --- a/go.sum +++ b/go.sum @@ -23,8 +23,8 @@ github.com/apparentlymart/go-textseg/v13 v13.0.0/go.mod h1:ZK2fH7c4NqDTLtiYLvIkE github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310 h1:BUAU3CGlLvorLI26FmByPp2eC2qla6E1Tw+scpcg/to= github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5/go.mod h1:wHh0iHkYZB8zMSxRWpUBQtwG5a7fFgvEO+odwuTv2gs= -github.com/aws/aws-sdk-go v1.44.215 h1:K3KERfO6MaV349idub2w1u1H0R0KSkED0LshPnaAn3Q= -github.com/aws/aws-sdk-go v1.44.215/go.mod h1:aVsgQcEevwlmQ7qHE9I3h+dtQgpqhFB+i8Phjh7fkwI= +github.com/aws/aws-sdk-go v1.44.216 h1:nDL5hEGBlUNHXMWbpP4dIyP8IB5tvRgksWE7biVu8JY= +github.com/aws/aws-sdk-go v1.44.216/go.mod h1:aVsgQcEevwlmQ7qHE9I3h+dtQgpqhFB+i8Phjh7fkwI= github.com/aws/aws-sdk-go-v2 v1.17.4/go.mod h1:uzbQtefpm44goOPmdKyAlXSNcwlRgF3ePWVW6EtJvvw= github.com/aws/aws-sdk-go-v2 v1.17.5 h1:TzCUW1Nq4H8Xscph5M/skINUitxM5UBAyvm2s7XBzL4= github.com/aws/aws-sdk-go-v2 v1.17.5/go.mod h1:uzbQtefpm44goOPmdKyAlXSNcwlRgF3ePWVW6EtJvvw= From de046f3473cb69d4316391aaa81bf223c3d05ba6 Mon Sep 17 00:00:00 2001 From: changelogbot Date: Wed, 8 Mar 2023 18:27:48 +0000 Subject: [PATCH 558/763] Update CHANGELOG.md for #29853 --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2c6999044408..d42353a0d508 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -22,6 +22,7 @@ BUG FIXES: * resource/aws_batch_job_definition: Prevents perpetual diff when container properties environment variable has empty value. ([#29820](https://github.com/hashicorp/terraform-provider-aws/issues/29820)) * resource/aws_elastic_beanstalk_configuration_template: Map errors like `InvalidParameterValue: No Platform named '...' found.` to `resource.NotFoundError` so `terraform refesh` correctly removes the resource from state ([#29863](https://github.com/hashicorp/terraform-provider-aws/issues/29863)) * resource/aws_grafana_workspace: Allow removing `vpc_configuration` ([#29793](https://github.com/hashicorp/terraform-provider-aws/issues/29793)) +* resource/aws_medialive_channel: Fix setting of the `include_fec` attribute in `fec_output_settings` ([#29808](https://github.com/hashicorp/terraform-provider-aws/issues/29808)) * resource/aws_medialive_channel: Fix setting of the `video_pid` attribute in `m2ts_settings` ([#29824](https://github.com/hashicorp/terraform-provider-aws/issues/29824)) ## 4.57.1 (March 6, 2023) From 09999b1fc50ee6a6fde6fc1cf88289558bcebe19 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Wed, 8 Mar 2023 13:40:33 -0500 Subject: [PATCH 559/763] r/aws_flow_log: Fix IAM eventual consistency errors on resource Create. --- .changelog/29254.txt | 4 ++++ internal/service/ec2/vpc_flow_log.go | 10 ++++++---- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/.changelog/29254.txt b/.changelog/29254.txt index b08582ef390a..dc79906f993b 100644 --- a/.changelog/29254.txt +++ b/.changelog/29254.txt @@ -1,3 +1,7 @@ ```release-note:enhancement resource/aws_flow_log: Add `deliver_cross_account_role` argument ``` + +```release-note:bug +resource/aws_flow_log: Fix IAM eventual consistency errors on resource Create +``` \ No newline at end of file diff --git a/internal/service/ec2/vpc_flow_log.go b/internal/service/ec2/vpc_flow_log.go index 0dab439240cf..f3a984478b50 100644 --- a/internal/service/ec2/vpc_flow_log.go +++ b/internal/service/ec2/vpc_flow_log.go @@ -245,17 +245,19 @@ func resourceLogFlowCreate(ctx context.Context, d *schema.ResourceData, meta int input.TagSpecifications = tagSpecificationsFromKeyValueTags(tags, ec2.ResourceTypeVpcFlowLog) } - output, err := conn.CreateFlowLogsWithContext(ctx, input) + outputRaw, err := tfresource.RetryWhenAWSErrMessageContains(ctx, propagationTimeout, func() (interface{}, error) { + return conn.CreateFlowLogsWithContext(ctx, input) + }, errCodeInvalidParameter, "Unable to assume given IAM role") - if err == nil && output != nil { - err = UnsuccessfulItemsError(output.Unsuccessful) + if err == nil && outputRaw != nil { + err = UnsuccessfulItemsError(outputRaw.(*ec2.CreateFlowLogsOutput).Unsuccessful) } if err != nil { return sdkdiag.AppendErrorf(diags, "creating Flow Log (%s): %s", resourceID, err) } - d.SetId(aws.StringValue(output.FlowLogIds[0])) + d.SetId(aws.StringValue(outputRaw.(*ec2.CreateFlowLogsOutput).FlowLogIds[0])) return append(diags, resourceLogFlowRead(ctx, d, meta)...) } From 83f800cb9f09070afd8d164348648c93103cc1d8 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Wed, 8 Mar 2023 13:41:09 -0500 Subject: [PATCH 560/763] r/aws_flow_log: Tidy up acceptance tests. --- internal/service/ec2/vpc_flow_log_test.go | 334 ++++++++-------------- 1 file changed, 122 insertions(+), 212 deletions(-) diff --git a/internal/service/ec2/vpc_flow_log_test.go b/internal/service/ec2/vpc_flow_log_test.go index 0e5d04a50794..22d3551de6e1 100644 --- a/internal/service/ec2/vpc_flow_log_test.go +++ b/internal/service/ec2/vpc_flow_log_test.go @@ -16,7 +16,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/tfresource" ) -func TestAccVPCFlowLog_vpcID(t *testing.T) { +func TestAccVPCFlowLog_basic(t *testing.T) { ctx := acctest.Context(t) var flowLog ec2.FlowLog cloudwatchLogGroupResourceName := "aws_cloudwatch_log_group.test" @@ -32,8 +32,8 @@ func TestAccVPCFlowLog_vpcID(t *testing.T) { CheckDestroy: testAccCheckFlowLogDestroy(ctx), Steps: []resource.TestStep{ { - Config: testAccVPCFlowLogConfig_id(rName), - Check: resource.ComposeTestCheckFunc( + Config: testAccVPCFlowLogConfig_basic(rName), + Check: resource.ComposeAggregateTestCheckFunc( testAccCheckFlowLogExists(ctx, resourceName, &flowLog), acctest.MatchResourceAttrRegionalARN(resourceName, "arn", "ec2", regexp.MustCompile(`vpc-flow-log/fl-.+`)), resource.TestCheckResourceAttr(resourceName, "deliver_cross_account_role", ""), @@ -42,6 +42,7 @@ func TestAccVPCFlowLog_vpcID(t *testing.T) { resource.TestCheckResourceAttr(resourceName, "log_destination_type", "cloud-watch-logs"), resource.TestCheckResourceAttrPair(resourceName, "log_group_name", cloudwatchLogGroupResourceName, "name"), resource.TestCheckResourceAttr(resourceName, "max_aggregation_interval", "600"), + resource.TestCheckResourceAttr(resourceName, "tags.%", "0"), resource.TestCheckResourceAttr(resourceName, "traffic_type", "ALL"), resource.TestCheckResourceAttrPair(resourceName, "vpc_id", vpcResourceName, "id"), ), @@ -51,10 +52,6 @@ func TestAccVPCFlowLog_vpcID(t *testing.T) { ImportState: true, ImportStateVerify: true, }, - { - Config: testAccVPCFlowLogConfig_destinationTypeCloudWatchLogs(rName), - ExpectNonEmptyPlan: false, - }, }, }) } @@ -84,10 +81,6 @@ func TestAccVPCFlowLog_logFormat(t *testing.T) { ImportState: true, ImportStateVerify: true, }, - { - Config: testAccVPCFlowLogConfig_destinationTypeCloudWatchLogs(rName), - ExpectNonEmptyPlan: false, - }, }, }) } @@ -98,7 +91,7 @@ func TestAccVPCFlowLog_subnetID(t *testing.T) { cloudwatchLogGroupResourceName := "aws_cloudwatch_log_group.test" iamRoleResourceName := "aws_iam_role.test" resourceName := "aws_flow_log.test" - subnetResourceName := "aws_subnet.test" + subnetResourceName := "aws_subnet.test.0" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ @@ -129,46 +122,6 @@ func TestAccVPCFlowLog_subnetID(t *testing.T) { }) } -func TestAccVPCFlowLog_crossAccountRole(t *testing.T) { - ctx := acctest.Context(t) - var flowLog ec2.FlowLog - cloudwatchLogGroupResourceName := "aws_cloudwatch_log_group.test" - crossAccountIamRoleResourceName := "aws_iam_role.test_cross_account" - iamRoleResourceName := "aws_iam_role.test" - resourceName := "aws_flow_log.test" - subnetResourceName := "aws_subnet.test" - rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - rName2 := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - - resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t) }, - ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), - ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - CheckDestroy: testAccCheckFlowLogDestroy(ctx), - Steps: []resource.TestStep{ - { - Config: testAccVPCFlowLogConfig_crossAccountRole(rName, rName2), - Check: resource.ComposeTestCheckFunc( - testAccCheckFlowLogExists(ctx, resourceName, &flowLog), - resource.TestCheckResourceAttrPair(resourceName, "deliver_cross_account_role", crossAccountIamRoleResourceName, "arn"), - resource.TestCheckResourceAttrPair(resourceName, "iam_role_arn", iamRoleResourceName, "arn"), - resource.TestCheckResourceAttr(resourceName, "log_destination", ""), - resource.TestCheckResourceAttr(resourceName, "log_destination_type", "cloud-watch-logs"), - resource.TestCheckResourceAttrPair(resourceName, "log_group_name", cloudwatchLogGroupResourceName, "name"), - resource.TestCheckResourceAttr(resourceName, "max_aggregation_interval", "600"), - resource.TestCheckResourceAttrPair(resourceName, "subnet_id", subnetResourceName, "id"), - resource.TestCheckResourceAttr(resourceName, "traffic_type", "ALL"), - ), - }, - { - ResourceName: resourceName, - ImportState: true, - ImportStateVerify: true, - }, - }, - }) -} - func TestAccVPCFlowLog_transitGatewayID(t *testing.T) { ctx := acctest.Context(t) var flowLog ec2.FlowLog @@ -185,7 +138,7 @@ func TestAccVPCFlowLog_transitGatewayID(t *testing.T) { CheckDestroy: testAccCheckFlowLogDestroy(ctx), Steps: []resource.TestStep{ { - Config: testAccVPCFlowLogConfig_transitGatewayId(rName), + Config: testAccVPCFlowLogConfig_transitGatewayID(rName), Check: resource.ComposeTestCheckFunc( testAccCheckFlowLogExists(ctx, resourceName, &flowLog), acctest.MatchResourceAttrRegionalARN(resourceName, "arn", "ec2", regexp.MustCompile(`vpc-flow-log/fl-.+`)), @@ -222,7 +175,7 @@ func TestAccVPCFlowLog_transitGatewayAttachmentID(t *testing.T) { CheckDestroy: testAccCheckFlowLogDestroy(ctx), Steps: []resource.TestStep{ { - Config: testAccVPCFlowLogConfig_transitGatewayAttachmentId(rName), + Config: testAccVPCFlowLogConfig_transitGatewayAttachmentID(rName), Check: resource.ComposeTestCheckFunc( testAccCheckFlowLogExists(ctx, resourceName, &flowLog), acctest.MatchResourceAttrRegionalARN(resourceName, "arn", "ec2", regexp.MustCompile(`vpc-flow-log/fl-.+`)), @@ -607,7 +560,7 @@ func TestAccVPCFlowLog_disappears(t *testing.T) { CheckDestroy: testAccCheckFlowLogDestroy(ctx), Steps: []resource.TestStep{ { - Config: testAccVPCFlowLogConfig_id(rName), + Config: testAccVPCFlowLogConfig_basic(rName), Check: resource.ComposeTestCheckFunc( testAccCheckFlowLogExists(ctx, resourceName, &flowLog), acctest.CheckResourceDisappears(ctx, acctest.Provider, tfec2.ResourceFlowLog(), resourceName), @@ -669,20 +622,52 @@ func testAccCheckFlowLogDestroy(ctx context.Context) resource.TestCheckFunc { } } -func testAccFlowLogConfigBase(rName string) string { - return fmt.Sprintf(` -resource "aws_vpc" "test" { - cidr_block = "10.0.0.0/16" +func testAccFlowLogConfig_base(rName string) string { + return acctest.ConfigVPCWithSubnets(rName, 1) +} - tags = { - Name = %[1]q - } +func testAccVPCFlowLogConfig_basic(rName string) string { + return acctest.ConfigCompose(testAccFlowLogConfig_base(rName), fmt.Sprintf(` +data "aws_partition" "current" {} + +resource "aws_iam_role" "test" { + name = %[1]q + + assume_role_policy = < Date: Wed, 8 Mar 2023 12:02:02 -0800 Subject: [PATCH 561/763] Converts `create_time` to RFC 3339 --- internal/service/licensemanager/grant_test.go | 5 +++++ .../received_license_data_source.go | 17 ++++++++++++++--- .../received_license_data_source_test.go | 15 +++++++++------ ...icensemanager_received_license.html.markdown | 2 +- 4 files changed, 29 insertions(+), 10 deletions(-) diff --git a/internal/service/licensemanager/grant_test.go b/internal/service/licensemanager/grant_test.go index 79097ec71885..01ff5cbdee5e 100644 --- a/internal/service/licensemanager/grant_test.go +++ b/internal/service/licensemanager/grant_test.go @@ -17,6 +17,11 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/tfresource" ) +const ( + homeRegionKey = "LICENSE_MANAGER_GRANT_HOME_REGION" + licenseARNKey = "LICENSE_MANAGER_GRANT_LICENSE_ARN" +) + func TestAccLicenseManagerGrant_serial(t *testing.T) { t.Parallel() diff --git a/internal/service/licensemanager/received_license_data_source.go b/internal/service/licensemanager/received_license_data_source.go index f031d639fad6..493580d36f85 100644 --- a/internal/service/licensemanager/received_license_data_source.go +++ b/internal/service/licensemanager/received_license_data_source.go @@ -3,6 +3,8 @@ package licensemanager import ( "context" "errors" + "strconv" + "time" "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/licensemanager" @@ -215,20 +217,21 @@ func dataSourceReceivedLicenseRead(ctx context.Context, d *schema.ResourceData, var diags diag.Diagnostics conn := meta.(*conns.AWSClient).LicenseManagerConn() + arn := d.Get("license_arn").(string) + in := &licensemanager.ListReceivedLicensesInput{ - LicenseArns: aws.StringSlice([]string{d.Get("license_arn").(string)}), + LicenseArns: aws.StringSlice([]string{arn}), } out, err := FindReceivedLicenseByARN(ctx, conn, in) if err != nil { - return sdkdiag.AppendErrorf(diags, "reading Received Licenses: %s", err) + return sdkdiag.AppendErrorf(diags, "reading License Manager Received License (%s): %s", arn, err) } d.SetId(aws.StringValue(out.LicenseArn)) d.Set("beneficiary", out.Beneficiary) d.Set("consumption_configuration", []interface{}{flattenConsumptionConfiguration(out.ConsumptionConfiguration)}) - d.Set("create_time", out.CreateTime) d.Set("entitlements", flattenEntitlements(out.Entitlements)) d.Set("home_region", out.HomeRegion) d.Set("issuer", []interface{}{flattenIssuer(out.Issuer)}) @@ -242,6 +245,14 @@ func dataSourceReceivedLicenseRead(ctx context.Context, d *schema.ResourceData, d.Set("validity", []interface{}{flattenDateTimeRange(out.Validity)}) d.Set("version", out.Version) + if v := aws.StringValue(out.CreateTime); v != "" { + seconds, err := strconv.ParseInt(v, 10, 64) + if err != nil { + return sdkdiag.AppendErrorf(diags, "reading License Manager Received License (%s): %s", arn, err) + } + d.Set("create_time", time.Unix(seconds, 0).UTC().Format(time.RFC3339)) + } + return diags } diff --git a/internal/service/licensemanager/received_license_data_source_test.go b/internal/service/licensemanager/received_license_data_source_test.go index 77c759e0a3cd..d1eb17982161 100644 --- a/internal/service/licensemanager/received_license_data_source_test.go +++ b/internal/service/licensemanager/received_license_data_source_test.go @@ -12,11 +12,14 @@ import ( func TestAccLicenseManagerReceivedLicenseDataSource_basic(t *testing.T) { datasourceName := "data.aws_licensemanager_received_license.test" - licenseARNKey := "LICENSE_MANAGER_LICENSE_ARN" licenseARN := os.Getenv(licenseARNKey) if licenseARN == "" { t.Skipf("Environment variable %s is not set", licenseARNKey) } + homeRegion := os.Getenv(homeRegionKey) + if homeRegion == "" { + t.Skipf("Environment variable %s is not set to true", homeRegionKey) + } resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { acctest.PreCheck(t) }, @@ -25,14 +28,14 @@ func TestAccLicenseManagerReceivedLicenseDataSource_basic(t *testing.T) { Steps: []resource.TestStep{ { Config: testAccReceivedLicenseDataSourceConfig_arn(licenseARN), - Check: resource.ComposeTestCheckFunc( - resource.TestCheckResourceAttrSet(datasourceName, "beneficiary"), + Check: resource.ComposeAggregateTestCheckFunc( + acctest.CheckResourceAttrGlobalARN(datasourceName, "beneficiary", "iam", "root"), resource.TestCheckResourceAttr(datasourceName, "consumption_configuration.#", "1"), - resource.TestCheckResourceAttrSet(datasourceName, "create_time"), + acctest.CheckResourceAttrRFC3339(datasourceName, "create_time"), resource.TestCheckResourceAttr(datasourceName, "entitlements.#", "1"), - resource.TestCheckResourceAttrSet(datasourceName, "home_region"), + resource.TestCheckResourceAttr(datasourceName, "home_region", homeRegion), resource.TestCheckResourceAttr(datasourceName, "issuer.#", "1"), - resource.TestCheckResourceAttrSet(datasourceName, "license_arn"), + resource.TestCheckResourceAttr(datasourceName, "license_arn", licenseARN), resource.TestCheckResourceAttrSet(datasourceName, "license_metadata.0.%"), resource.TestCheckResourceAttrSet(datasourceName, "license_name"), resource.TestCheckResourceAttrSet(datasourceName, "product_name"), diff --git a/website/docs/d/licensemanager_received_license.html.markdown b/website/docs/d/licensemanager_received_license.html.markdown index 411867ea7643..102fd521bdea 100644 --- a/website/docs/d/licensemanager_received_license.html.markdown +++ b/website/docs/d/licensemanager_received_license.html.markdown @@ -29,7 +29,7 @@ data "aws_licensemanager_received_license" "test" { * `id` - The received license ARN (Same as: `license_arn`). * `beneficiary` - Granted license beneficiary. This is in the form of the ARN of the root user of the account. * `consumption_configuration` - Configuration for consumption of the license. [Detailed below](#consumption_configuration) -* `create_time` - Creation time of the granted license. +* `create_time` - Creation time of the granted license in RFC 3339 format. * `entitlements` - License entitlements. [Detailed below](#entitlements) * `home_region` - Home Region of the granted license. * `issuer` - Granted license issuer. [Detailed below](#issuer) From 9af9749f7c694bce79cc4d74961465030b98652e Mon Sep 17 00:00:00 2001 From: Nabil Houidi <35373676+NabilHouidi@users.noreply.github.com> Date: Sun, 5 Mar 2023 16:55:09 +0100 Subject: [PATCH 562/763] feat(ec2): add ipv6_addresses to aws_instances data source --- .../service/ec2/ec2_instances_data_source.go | 11 ++++++++- .../ec2/ec2_instances_data_source_test.go | 23 ++++++++++++++++--- 2 files changed, 30 insertions(+), 4 deletions(-) diff --git a/internal/service/ec2/ec2_instances_data_source.go b/internal/service/ec2/ec2_instances_data_source.go index 4529244c341d..d42d8d126dd9 100644 --- a/internal/service/ec2/ec2_instances_data_source.go +++ b/internal/service/ec2/ec2_instances_data_source.go @@ -50,6 +50,11 @@ func DataSourceInstances() *schema.Resource { Computed: true, Elem: &schema.Schema{Type: schema.TypeString}, }, + "ipv6_addresses": { + Type: schema.TypeList, + Computed: true, + Elem: &schema.Schema{Type: schema.TypeString}, + }, }, } } @@ -90,7 +95,7 @@ func dataSourceInstancesRead(ctx context.Context, d *schema.ResourceData, meta i return sdkdiag.AppendErrorf(diags, "reading EC2 Instances: %s", err) } - var instanceIDs, privateIPs, publicIPs []string + var instanceIDs, privateIPs, publicIPs, ipv6Addresses []string for _, v := range output { instanceIDs = append(instanceIDs, aws.StringValue(v.InstanceId)) @@ -100,12 +105,16 @@ func dataSourceInstancesRead(ctx context.Context, d *schema.ResourceData, meta i if publicIP := aws.StringValue(v.PublicIpAddress); publicIP != "" { publicIPs = append(publicIPs, publicIP) } + if ipv6Address := aws.StringValue(v.Ipv6Address); ipv6Address != "" { + ipv6Addresses = append(ipv6Addresses, ipv6Address) + } } d.SetId(meta.(*conns.AWSClient).Region) d.Set("ids", instanceIDs) d.Set("private_ips", privateIPs) d.Set("public_ips", publicIPs) + d.Set("ipv6_addresses", ipv6Addresses) return diags } diff --git a/internal/service/ec2/ec2_instances_data_source_test.go b/internal/service/ec2/ec2_instances_data_source_test.go index f19a27aeeb58..856412c2949b 100644 --- a/internal/service/ec2/ec2_instances_data_source_test.go +++ b/internal/service/ec2/ec2_instances_data_source_test.go @@ -23,6 +23,7 @@ func TestAccEC2InstancesDataSource_basic(t *testing.T) { Check: resource.ComposeTestCheckFunc( resource.TestCheckResourceAttr("data.aws_instances.test", "ids.#", "2"), resource.TestCheckResourceAttr("data.aws_instances.test", "private_ips.#", "2"), + resource.TestCheckResourceAttr("data.aws_instances.test", "ipv6_addresses.#", "2"), // Public IP values are flakey for new EC2 instances due to eventual consistency resource.TestCheckResourceAttrSet("data.aws_instances.test", "public_ips.#"), ), @@ -81,6 +82,7 @@ func TestAccEC2InstancesDataSource_empty(t *testing.T) { resource.TestCheckResourceAttr("data.aws_instances.test", "ids.#", "0"), resource.TestCheckResourceAttr("data.aws_instances.test", "private_ips.#", "0"), resource.TestCheckResourceAttr("data.aws_instances.test", "public_ips.#", "0"), + resource.TestCheckResourceAttr("data.aws_instances.test", "ipv6_addresses.#", "0"), ), }, }, @@ -101,6 +103,7 @@ func TestAccEC2InstancesDataSource_timeout(t *testing.T) { resource.TestCheckResourceAttr("data.aws_instances.test", "ids.#", "2"), resource.TestCheckResourceAttr("data.aws_instances.test", "private_ips.#", "2"), resource.TestCheckResourceAttrSet("data.aws_instances.test", "public_ips.#"), + resource.TestCheckResourceAttrSet("data.aws_instances.test", "ipv6_addresses.#"), ), }, }, @@ -112,10 +115,24 @@ func testAccInstancesDataSourceConfig_ids(rName string) string { acctest.ConfigLatestAmazonLinuxHVMEBSAMI(), acctest.AvailableEC2InstanceTypeForRegion("t3.micro", "t2.micro"), fmt.Sprintf(` +resource "aws_vpc" "test" { + cidr_block = "10.0.0.0/16" + assign_generated_ipv6_cidr_block = true +} + +resource "aws_subnet" "test" { + vpc_id = aws_vpc.test.id + cidr_block = "10.0.1.0/24" + ipv6_cidr_block = "${cidrsubnet(aws_vpc.test.ipv6_cidr_block, 8, 1)}" + assign_ipv6_address_on_creation = true +} + resource "aws_instance" "test" { - count = 2 - ami = data.aws_ami.amzn-ami-minimal-hvm-ebs.id - instance_type = data.aws_ec2_instance_type_offering.available.instance_type + count = 2 + ami = data.aws_ami.amzn-ami-minimal-hvm-ebs.id + instance_type = data.aws_ec2_instance_type_offering.available.instance_type + subnet_id = aws_subnet.test.id + ipv6_address_count = 1 tags = { Name = %[1]q From 312dc4bc80a10ebf976fc20f0f4d4fd87bd6dbce Mon Sep 17 00:00:00 2001 From: Nabil Houidi <35373676+NabilHouidi@users.noreply.github.com> Date: Sun, 5 Mar 2023 17:04:57 +0100 Subject: [PATCH 563/763] docs(instances): update docs --- website/docs/d/instances.html.markdown | 1 + 1 file changed, 1 insertion(+) diff --git a/website/docs/d/instances.html.markdown b/website/docs/d/instances.html.markdown index bdf2a1cfab53..b0d34f0a4097 100644 --- a/website/docs/d/instances.html.markdown +++ b/website/docs/d/instances.html.markdown @@ -60,6 +60,7 @@ several valid keys, for a full reference, check out * `ids` - IDs of instances found through the filter * `private_ips` - Private IP addresses of instances found through the filter * `public_ips` - Public IP addresses of instances found through the filter +* `ipv6_addresses` - IPv6 addresses of instances found through the filter ## Timeouts From c7b44fd55dbefcba3441071e5c80c9dc896b6770 Mon Sep 17 00:00:00 2001 From: Nabil Houidi <35373676+NabilHouidi@users.noreply.github.com> Date: Sun, 5 Mar 2023 17:24:35 +0100 Subject: [PATCH 564/763] chore: add changelog entry --- .changelog/29794.txt | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 .changelog/29794.txt diff --git a/.changelog/29794.txt b/.changelog/29794.txt new file mode 100644 index 000000000000..9556ab7b6399 --- /dev/null +++ b/.changelog/29794.txt @@ -0,0 +1,3 @@ +```release-note:enhancement +data-source/aws_instances: Add `ipv6_addresses` attribute +``` \ No newline at end of file From 1e0294f31ff580a7ca48473cf893a4c235a66cec Mon Sep 17 00:00:00 2001 From: Nabil Houidi <35373676+NabilHouidi@users.noreply.github.com> Date: Wed, 8 Mar 2023 21:10:14 +0100 Subject: [PATCH 565/763] chore(tests): fix terrafmt for acceptance tests --- .../service/ec2/ec2_instances_data_source_test.go | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/internal/service/ec2/ec2_instances_data_source_test.go b/internal/service/ec2/ec2_instances_data_source_test.go index 856412c2949b..9e55415aff54 100644 --- a/internal/service/ec2/ec2_instances_data_source_test.go +++ b/internal/service/ec2/ec2_instances_data_source_test.go @@ -116,15 +116,15 @@ func testAccInstancesDataSourceConfig_ids(rName string) string { acctest.AvailableEC2InstanceTypeForRegion("t3.micro", "t2.micro"), fmt.Sprintf(` resource "aws_vpc" "test" { - cidr_block = "10.0.0.0/16" - assign_generated_ipv6_cidr_block = true + cidr_block = "10.0.0.0/16" + assign_generated_ipv6_cidr_block = true } resource "aws_subnet" "test" { - vpc_id = aws_vpc.test.id - cidr_block = "10.0.1.0/24" - ipv6_cidr_block = "${cidrsubnet(aws_vpc.test.ipv6_cidr_block, 8, 1)}" - assign_ipv6_address_on_creation = true + vpc_id = aws_vpc.test.id + cidr_block = "10.0.1.0/24" + ipv6_cidr_block = "${cidrsubnet(aws_vpc.test.ipv6_cidr_block, 8, 1)}" + assign_ipv6_address_on_creation = true } resource "aws_instance" "test" { From c10ad6d5bfbffd0693426bc8c2e4b006fb3cb4de Mon Sep 17 00:00:00 2001 From: Graham Davison Date: Wed, 8 Mar 2023 12:17:23 -0800 Subject: [PATCH 566/763] Updates received licenses data source to use license key --- .../common_schema_data_source.go | 1 + .../received_licenses_data_source_test.go | 19 +++++++++++-------- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/internal/service/licensemanager/common_schema_data_source.go b/internal/service/licensemanager/common_schema_data_source.go index 99f220df60a9..db66c9cc0a8c 100644 --- a/internal/service/licensemanager/common_schema_data_source.go +++ b/internal/service/licensemanager/common_schema_data_source.go @@ -36,6 +36,7 @@ func DataSourceFiltersSchema() *schema.Schema { "values": { Type: schema.TypeList, Required: true, + MinItems: 1, Elem: &schema.Schema{Type: schema.TypeString}, }, }, diff --git a/internal/service/licensemanager/received_licenses_data_source_test.go b/internal/service/licensemanager/received_licenses_data_source_test.go index 38678865eb19..f07aabed3844 100644 --- a/internal/service/licensemanager/received_licenses_data_source_test.go +++ b/internal/service/licensemanager/received_licenses_data_source_test.go @@ -12,10 +12,9 @@ import ( func TestAccLicenseManagerReceivedLicensesDataSource_basic(t *testing.T) { datasourceName := "data.aws_licensemanager_received_licenses.test" - productSKUKey := "LICENSE_MANAGER_LICENSE_PRODUCT_SKU" - productSKU := os.Getenv(productSKUKey) - if productSKU == "" { - t.Skipf("Environment variable %s is not set", productSKUKey) + licenseARN := os.Getenv(licenseARNKey) + if licenseARN == "" { + t.Skipf("Environment variable %s is not set", licenseARNKey) } resource.ParallelTest(t, resource.TestCase{ @@ -24,7 +23,7 @@ func TestAccLicenseManagerReceivedLicensesDataSource_basic(t *testing.T) { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ { - Config: testAccReceivedLicensesDataSourceConfig_arns(productSKU), + Config: testAccReceivedLicensesDataSourceConfig_arns(licenseARN), Check: resource.ComposeTestCheckFunc( resource.TestCheckResourceAttr(datasourceName, "arns.#", "1"), ), @@ -50,17 +49,21 @@ func TestAccLicenseManagerReceivedLicensesDataSource_empty(t *testing.T) { }) } -func testAccReceivedLicensesDataSourceConfig_arns(productSKU string) string { +func testAccReceivedLicensesDataSourceConfig_arns(licenseARN string) string { return fmt.Sprintf(` data "aws_licensemanager_received_licenses" "test" { filter { name = "ProductSKU" values = [ - %[1]q + data.aws_licensemanager_received_license.test.product_sku ] } } -`, productSKU) + +data "aws_licensemanager_received_license" "test" { + license_arn = %[1]q +} +`, licenseARN) } func testAccReceivedLicensesDataSourceConfig_empty() string { From 5245efd28463c974d352869d4e7a1132a3b09d6a Mon Sep 17 00:00:00 2001 From: James Pancoast Date: Wed, 8 Mar 2023 13:31:23 -0700 Subject: [PATCH 567/763] Fixed aws_iam_policy_document data source example and added the necessary 'statement' block. --- website/docs/r/organizations_policy.html.markdown | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/website/docs/r/organizations_policy.html.markdown b/website/docs/r/organizations_policy.html.markdown index b0dac4e15a7f..46ceacf81dd3 100644 --- a/website/docs/r/organizations_policy.html.markdown +++ b/website/docs/r/organizations_policy.html.markdown @@ -14,9 +14,11 @@ Provides a resource to manage an [AWS Organizations policy](https://docs.aws.ama ```terraform data "aws_iam_policy_document" "example" { - effect = "Allow" - actions = ["*"] - resources = ["*"] + statement { + effect = "Allow" + actions = ["*"] + resources = ["*"] + } } resource "aws_organizations_policy" "example" { From 2b849039debbd3938fad3f195f54c4065c0f4c30 Mon Sep 17 00:00:00 2001 From: Terr Date: Wed, 8 Mar 2023 20:49:06 +0100 Subject: [PATCH 568/763] Show safer example for `device_name`, and mark it as required `device_name` is required in a `block_device_mappings` block. `terraform validate` doesn't complain when it's missing but `apply` will come back with a HTTP 400 error. Secondly, the top example shows using `/dev/sda1` for an additional volume. Doing this can cause you to end up with unbootable instances, even if the root volume of the AMI is /dev/xvda. Moreover, the web management console won't allow you to select `/dev/sda` when setting up a launch template. According to https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/device_naming.html, `/dev/sdf` is a safe choice for both HVM and Paravirtual instances. --- website/docs/r/launch_template.html.markdown | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/website/docs/r/launch_template.html.markdown b/website/docs/r/launch_template.html.markdown index 6d80a981959f..497f9b21e354 100644 --- a/website/docs/r/launch_template.html.markdown +++ b/website/docs/r/launch_template.html.markdown @@ -17,7 +17,7 @@ resource "aws_launch_template" "foo" { name = "foo" block_device_mappings { - device_name = "/dev/sda1" + device_name = "/dev/sdf" ebs { volume_size = 20 @@ -168,7 +168,7 @@ To find out more information for an existing AMI to override the configuration, Each `block_device_mappings` supports the following: -* `device_name` - (Optional) The name of the device to mount. +* `device_name` - (Required) The name of the device to mount. * `ebs` - (Optional) Configure EBS volume properties. * `no_device` - (Optional) Suppresses the specified device included in the AMI's block device mapping. * `virtual_name` - (Optional) The [Instance Store Device From 3e06a28c931d2992cdf733ecc364cc99785b90eb Mon Sep 17 00:00:00 2001 From: Graham Davison Date: Wed, 8 Mar 2023 13:35:05 -0800 Subject: [PATCH 569/763] Restores license home region to grant tests --- internal/service/licensemanager/grant_test.go | 54 +++++++++++-------- 1 file changed, 32 insertions(+), 22 deletions(-) diff --git a/internal/service/licensemanager/grant_test.go b/internal/service/licensemanager/grant_test.go index 01ff5cbdee5e..4c6c5a37b738 100644 --- a/internal/service/licensemanager/grant_test.go +++ b/internal/service/licensemanager/grant_test.go @@ -19,6 +19,7 @@ import ( const ( homeRegionKey = "LICENSE_MANAGER_GRANT_HOME_REGION" + principalKey = "LICENSE_MANAGER_GRANT_PRINCIPAL" licenseARNKey = "LICENSE_MANAGER_GRANT_LICENSE_ARN" ) @@ -38,15 +39,17 @@ func TestAccLicenseManagerGrant_serial(t *testing.T) { func testAccGrant_basic(t *testing.T) { ctx := acctest.Context(t) - principalKey := "LICENSE_MANAGER_GRANT_PRINCIPAL" - licenseKey := "LICENSE_MANAGER_GRANT_LICENSE_ARN" principal := os.Getenv(principalKey) if principal == "" { - t.Skipf("Environment variable %s is not set to true", principalKey) + t.Skipf("Environment variable %s is not set", principalKey) } - licenseARN := os.Getenv(licenseKey) + licenseARN := os.Getenv(licenseARNKey) if licenseARN == "" { - t.Skipf("Environment variable %s is not set to true", licenseKey) + t.Skipf("Environment variable %s is not set", licenseARNKey) + } + homeRegion := os.Getenv(homeRegionKey) + if homeRegion == "" { + t.Skipf("Environment variable %s is not set", homeRegionKey) } rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resourceName := "aws_licensemanager_grant.test" @@ -58,7 +61,7 @@ func testAccGrant_basic(t *testing.T) { CheckDestroy: testAccCheckGrantDestroy(ctx), Steps: []resource.TestStep{ { - Config: testAccGrantConfig_basic(licenseARN, rName, principal), + Config: testAccGrantConfig_basic(licenseARN, rName, principal, homeRegion), Check: resource.ComposeAggregateTestCheckFunc( testAccCheckGrantExists(ctx, resourceName), acctest.MatchResourceAttrGlobalARN(resourceName, "arn", "license-manager", regexp.MustCompile(`grant:g-.+`)), @@ -66,7 +69,7 @@ func testAccGrant_basic(t *testing.T) { resource.TestCheckTypeSetElemAttr(resourceName, "allowed_operations.*", "CheckoutLicense"), resource.TestCheckTypeSetElemAttr(resourceName, "allowed_operations.*", "CheckInLicense"), resource.TestCheckTypeSetElemAttr(resourceName, "allowed_operations.*", "ExtendConsumptionLicense"), - resource.TestCheckTypeSetElemAttr(resourceName, "allowed_operations.*", "CreateToken"), + // resource.TestCheckTypeSetElemAttr(resourceName, "allowed_operations.*", "CreateToken"), resource.TestCheckResourceAttrSet(resourceName, "home_region"), resource.TestCheckResourceAttr(resourceName, "license_arn", licenseARN), resource.TestCheckResourceAttr(resourceName, "name", rName), @@ -87,15 +90,17 @@ func testAccGrant_basic(t *testing.T) { func testAccGrant_disappears(t *testing.T) { ctx := acctest.Context(t) - principalKey := "LICENSE_MANAGER_GRANT_PRINCIPAL" - licenseKey := "LICENSE_MANAGER_GRANT_LICENSE_ARN" principal := os.Getenv(principalKey) if principal == "" { t.Skipf("Environment variable %s is not set to true", principalKey) } - licenseARN := os.Getenv(licenseKey) + licenseARN := os.Getenv(licenseARNKey) if licenseARN == "" { - t.Skipf("Environment variable %s is not set to true", licenseKey) + t.Skipf("Environment variable %s is not set to true", licenseARNKey) + } + homeRegion := os.Getenv(homeRegionKey) + if homeRegion == "" { + t.Skipf("Environment variable %s is not set to true", homeRegionKey) } rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resourceName := "aws_licensemanager_grant.test" @@ -107,8 +112,8 @@ func testAccGrant_disappears(t *testing.T) { CheckDestroy: testAccCheckGrantDestroy(ctx), Steps: []resource.TestStep{ { - Config: testAccGrantConfig_basic(licenseARN, rName, principal), - Check: resource.ComposeTestCheckFunc( + Config: testAccGrantConfig_basic(licenseARN, rName, principal, homeRegion), + Check: resource.ComposeAggregateTestCheckFunc( testAccCheckGrantExists(ctx, resourceName), acctest.CheckResourceDisappears(ctx, acctest.Provider, tflicensemanager.ResourceGrant(), resourceName), ), @@ -120,15 +125,17 @@ func testAccGrant_disappears(t *testing.T) { func testAccGrant_name(t *testing.T) { ctx := acctest.Context(t) - principalKey := "LICENSE_MANAGER_GRANT_PRINCIPAL" - licenseKey := "LICENSE_MANAGER_GRANT_LICENSE_ARN" principal := os.Getenv(principalKey) if principal == "" { t.Skipf("Environment variable %s is not set to true", principalKey) } - licenseARN := os.Getenv(licenseKey) + licenseARN := os.Getenv(licenseARNKey) if licenseARN == "" { - t.Skipf("Environment variable %s is not set to true", licenseKey) + t.Skipf("Environment variable %s is not set to true", licenseARNKey) + } + homeRegion := os.Getenv(homeRegionKey) + if homeRegion == "" { + t.Skipf("Environment variable %s is not set to true", homeRegionKey) } rName1 := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) rName2 := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) @@ -141,7 +148,7 @@ func testAccGrant_name(t *testing.T) { CheckDestroy: testAccCheckGrantDestroy(ctx), Steps: []resource.TestStep{ { - Config: testAccGrantConfig_basic(licenseARN, rName1, principal), + Config: testAccGrantConfig_basic(licenseARN, rName1, principal, homeRegion), Check: resource.ComposeAggregateTestCheckFunc( testAccCheckGrantExists(ctx, resourceName), resource.TestCheckResourceAttr(resourceName, "name", rName1), @@ -153,7 +160,7 @@ func testAccGrant_name(t *testing.T) { ImportStateVerify: true, }, { - Config: testAccGrantConfig_basic(licenseARN, rName2, principal), + Config: testAccGrantConfig_basic(licenseARN, rName2, principal, homeRegion), Check: resource.ComposeAggregateTestCheckFunc( testAccCheckGrantExists(ctx, resourceName), resource.TestCheckResourceAttr(resourceName, "name", rName2), @@ -216,8 +223,10 @@ func testAccCheckGrantDestroy(ctx context.Context) resource.TestCheckFunc { } } -func testAccGrantConfig_basic(licenseARN string, rName string, principal string) string { - return fmt.Sprintf(` +func testAccGrantConfig_basic(licenseARN, rName, principal, homeRegion string) string { + return acctest.ConfigCompose( + acctest.ConfigRegionalProvider(homeRegion), + fmt.Sprintf(` data "aws_licensemanager_received_license" "test" { license_arn = %[1]q } @@ -232,5 +241,6 @@ resource "aws_licensemanager_grant" "test" { license_arn = data.aws_licensemanager_received_license.test.license_arn principal = %[3]q } -`, licenseARN, rName, principal) +`, licenseARN, rName, principal), + ) } From 2bdeb747eaf18a83e35a9cabecef9616cb53e2b6 Mon Sep 17 00:00:00 2001 From: Graham Davison Date: Wed, 8 Mar 2023 13:36:13 -0800 Subject: [PATCH 570/763] Update license grant data source tests to match grant resource tests --- .../license_grants_data_source_test.go | 49 ++++++++++--------- 1 file changed, 27 insertions(+), 22 deletions(-) diff --git a/internal/service/licensemanager/license_grants_data_source_test.go b/internal/service/licensemanager/license_grants_data_source_test.go index 1103ac778371..f18b1888e7cc 100644 --- a/internal/service/licensemanager/license_grants_data_source_test.go +++ b/internal/service/licensemanager/license_grants_data_source_test.go @@ -17,7 +17,7 @@ func TestAccLicenseManagerGrantsDataSource_serial(t *testing.T) { testCases := map[string]map[string]func(t *testing.T){ "grant": { "basic": testAccGrantsDataSource_basic, - "empty": testAccGrantsDataSource_empty, + "empty": testAccGrantsDataSource_noMatch, }, } @@ -28,19 +28,27 @@ func testAccGrantsDataSource_basic(t *testing.T) { ctx := acctest.Context(t) rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) datasourceName := "data.aws_licensemanager_grants.test" - licenseKey := "LICENSE_MANAGER_GRANT_LICENSE_ARN" - licenseARN := os.Getenv(licenseKey) + licenseARN := os.Getenv(licenseARNKey) if licenseARN == "" { - t.Skipf("Environment variable %s is not set to true", licenseKey) + t.Skipf("Environment variable %s is not set to true", licenseARNKey) } + principal := os.Getenv(principalKey) + if principal == "" { + t.Skipf("Environment variable %s is not set", principalKey) + } + homeRegion := os.Getenv(homeRegionKey) + if homeRegion == "" { + t.Skipf("Environment variable %s is not set", homeRegionKey) + } + resource.Test(t, resource.TestCase{ PreCheck: func() { acctest.PreCheck(t) }, ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5FactoriesAlternate(ctx, t), Steps: []resource.TestStep{ { - Config: testAccGrantsDataSourceConfig_arns(licenseARN, rName), - Check: resource.ComposeTestCheckFunc( + Config: testAccGrantsDataSourceConfig_basic(licenseARN, rName, principal, homeRegion), + Check: resource.ComposeAggregateTestCheckFunc( resource.TestCheckResourceAttrSet(datasourceName, "arns.0"), ), }, @@ -48,7 +56,7 @@ func testAccGrantsDataSource_basic(t *testing.T) { }) } -func testAccGrantsDataSource_empty(t *testing.T) { +func testAccGrantsDataSource_noMatch(t *testing.T) { datasourceName := "data.aws_licensemanager_grants.test" resource.Test(t, resource.TestCase{ PreCheck: func() { acctest.PreCheck(t) }, @@ -56,8 +64,8 @@ func testAccGrantsDataSource_empty(t *testing.T) { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ { - Config: testAccGrantsDataSourceConfig_empty(), - Check: resource.ComposeTestCheckFunc( + Config: testAccGrantsDataSourceConfig_noMatch(), + Check: resource.ComposeAggregateTestCheckFunc( resource.TestCheckResourceAttr(datasourceName, "arns.#", "0"), ), }, @@ -65,8 +73,11 @@ func testAccGrantsDataSource_empty(t *testing.T) { }) } -func testAccGrantsDataSourceConfig_arns(licenseARN string, rName string) string { - return acctest.ConfigAlternateAccountProvider() + fmt.Sprintf(` +func testAccGrantsDataSourceConfig_basic(licenseARN, rName, principal, homeRegion string) string { + return acctest.ConfigCompose( + acctest.ConfigRegionalProvider(homeRegion), + acctest.ConfigAlternateAccountProvider(), + fmt.Sprintf(` data "aws_licensemanager_received_license" "test" { license_arn = %[1]q } @@ -75,31 +86,25 @@ locals { allowed_operations = [for i in data.aws_licensemanager_received_license.test.received_metadata[0].allowed_operations : i if i != "CreateGrant"] } -data "aws_partition" "current" { - provider = awsalternate -} -data "aws_caller_identity" "current" { - provider = awsalternate -} - resource "aws_licensemanager_grant" "test" { name = %[2]q allowed_operations = local.allowed_operations license_arn = data.aws_licensemanager_received_license.test.license_arn - principal = "arn:${data.aws_partition.current.partition}:iam::${data.aws_caller_identity.current.account_id}:root" + principal = %[3]q } data "aws_licensemanager_grants" "test" {} -`, licenseARN, rName) +`, licenseARN, rName, principal), + ) } -func testAccGrantsDataSourceConfig_empty() string { +func testAccGrantsDataSourceConfig_noMatch() string { return ` data "aws_licensemanager_grants" "test" { filter { name = "LicenseIssuerName" values = [ - "This Is Fake" + "No Match" ] } } From b444c6242c0d24846f433742d0a22db7c04cf98f Mon Sep 17 00:00:00 2001 From: Graham Davison Date: Wed, 8 Mar 2023 14:09:13 -0800 Subject: [PATCH 571/763] Serializes all grant-related tests --- .../service/licensemanager/grant_accepter_test.go | 13 ------------- internal/service/licensemanager/grant_test.go | 8 ++++++++ .../license_grants_data_source_test.go | 13 ------------- 3 files changed, 8 insertions(+), 26 deletions(-) diff --git a/internal/service/licensemanager/grant_accepter_test.go b/internal/service/licensemanager/grant_accepter_test.go index 5662aa38c72d..cb52ad6b90cb 100644 --- a/internal/service/licensemanager/grant_accepter_test.go +++ b/internal/service/licensemanager/grant_accepter_test.go @@ -16,19 +16,6 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/tfresource" ) -func TestAccLicenseManagerGrantAccepter_serial(t *testing.T) { - t.Parallel() - - testCases := map[string]map[string]func(t *testing.T){ - "grant": { - "basic": testAccGrantAccepter_basic, - "disappears": testAccGrantAccepter_disappears, - }, - } - - acctest.RunSerialTests2Levels(t, testCases, 0) -} - func testAccGrantAccepter_basic(t *testing.T) { ctx := acctest.Context(t) rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) diff --git a/internal/service/licensemanager/grant_test.go b/internal/service/licensemanager/grant_test.go index 4c6c5a37b738..394394869eb8 100644 --- a/internal/service/licensemanager/grant_test.go +++ b/internal/service/licensemanager/grant_test.go @@ -32,6 +32,14 @@ func TestAccLicenseManagerGrant_serial(t *testing.T) { "disappears": testAccGrant_disappears, "name": testAccGrant_name, }, + "grant_accepter": { + "basic": testAccGrantAccepter_basic, + "disappears": testAccGrantAccepter_disappears, + }, + "grant_data_source": { + "basic": testAccGrantsDataSource_basic, + "empty": testAccGrantsDataSource_noMatch, + }, } acctest.RunSerialTests2Levels(t, testCases, 0) diff --git a/internal/service/licensemanager/license_grants_data_source_test.go b/internal/service/licensemanager/license_grants_data_source_test.go index f18b1888e7cc..8c6705d3d050 100644 --- a/internal/service/licensemanager/license_grants_data_source_test.go +++ b/internal/service/licensemanager/license_grants_data_source_test.go @@ -11,19 +11,6 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) -func TestAccLicenseManagerGrantsDataSource_serial(t *testing.T) { - t.Parallel() - - testCases := map[string]map[string]func(t *testing.T){ - "grant": { - "basic": testAccGrantsDataSource_basic, - "empty": testAccGrantsDataSource_noMatch, - }, - } - - acctest.RunSerialTests2Levels(t, testCases, 0) -} - func testAccGrantsDataSource_basic(t *testing.T) { ctx := acctest.Context(t) rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) From 14b165979b7fcff4c7aaa1dd4cc42c391ef71225 Mon Sep 17 00:00:00 2001 From: Graham Davison Date: Wed, 8 Mar 2023 14:45:50 -0800 Subject: [PATCH 572/763] Adds more precise test values --- internal/service/licensemanager/grant_test.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/internal/service/licensemanager/grant_test.go b/internal/service/licensemanager/grant_test.go index 394394869eb8..675ef4edb21d 100644 --- a/internal/service/licensemanager/grant_test.go +++ b/internal/service/licensemanager/grant_test.go @@ -77,13 +77,12 @@ func testAccGrant_basic(t *testing.T) { resource.TestCheckTypeSetElemAttr(resourceName, "allowed_operations.*", "CheckoutLicense"), resource.TestCheckTypeSetElemAttr(resourceName, "allowed_operations.*", "CheckInLicense"), resource.TestCheckTypeSetElemAttr(resourceName, "allowed_operations.*", "ExtendConsumptionLicense"), - // resource.TestCheckTypeSetElemAttr(resourceName, "allowed_operations.*", "CreateToken"), - resource.TestCheckResourceAttrSet(resourceName, "home_region"), + resource.TestCheckResourceAttr(resourceName, "home_region", homeRegion), resource.TestCheckResourceAttr(resourceName, "license_arn", licenseARN), resource.TestCheckResourceAttr(resourceName, "name", rName), resource.TestCheckResourceAttrSet(resourceName, "parent_arn"), resource.TestCheckResourceAttr(resourceName, "principal", principal), - resource.TestCheckResourceAttrSet(resourceName, "status"), + resource.TestCheckResourceAttr(resourceName, "status", "PENDING_ACCEPT"), resource.TestCheckResourceAttr(resourceName, "version", "1"), ), }, From 39c10f3b3e2e934989668ab688db276ec0415d4f Mon Sep 17 00:00:00 2001 From: Graham Davison Date: Wed, 8 Mar 2023 16:33:38 -0800 Subject: [PATCH 573/763] Uses principal for cross-account tests --- internal/acctest/acctest.go | 61 ++++++++++++ internal/service/licensemanager/grant.go | 2 +- .../licensemanager/grant_accepter_test.go | 99 ++++++++++++------- .../received_license_data_source.go | 4 +- 4 files changed, 130 insertions(+), 36 deletions(-) diff --git a/internal/acctest/acctest.go b/internal/acctest/acctest.go index be342bd4a76e..162144d1ebbd 100644 --- a/internal/acctest/acctest.go +++ b/internal/acctest/acctest.go @@ -126,6 +126,26 @@ func protoV5ProviderFactoriesInit(ctx context.Context, providerNames ...string) return factories } +func protoV5ProviderFactoriesNamedInit(ctx context.Context, t *testing.T, providers map[string]*schema.Provider, providerNames ...string) map[string]func() (tfprotov5.ProviderServer, error) { + factories := make(map[string]func() (tfprotov5.ProviderServer, error), len(providerNames)) + + for _, name := range providerNames { + providerServerFactory, p, err := provider.ProtoV5ProviderServerFactory(ctx) + + if err != nil { + t.Fatal(err) + } + + factories[name] = func() (tfprotov5.ProviderServer, error) { //nolint:unparam + return providerServerFactory(), nil + } + + providers[name] = p + } + + return factories +} + func protoV5ProviderFactoriesPlusProvidersInit(ctx context.Context, t *testing.T, providers *[]*schema.Provider, providerNames ...string) map[string]func() (tfprotov5.ProviderServer, error) { factories := make(map[string]func() (tfprotov5.ProviderServer, error), len(providerNames)) @@ -158,6 +178,10 @@ func ProtoV5FactoriesPlusProvidersAlternate(ctx context.Context, t *testing.T, p return protoV5ProviderFactoriesPlusProvidersInit(ctx, t, providers, ProviderName, ProviderNameAlternate) } +func ProtoV5FactoriesNamed(ctx context.Context, t *testing.T, providers map[string]*schema.Provider) map[string]func() (tfprotov5.ProviderServer, error) { + return protoV5ProviderFactoriesNamedInit(ctx, t, providers, ProviderName, ProviderNameAlternate) +} + func ProtoV5FactoriesAlternate(ctx context.Context, t *testing.T) map[string]func() (tfprotov5.ProviderServer, error) { return protoV5ProviderFactoriesInit(ctx, ProviderName, ProviderNameAlternate) } @@ -1172,6 +1196,26 @@ func RegionProviderFunc(region string, providers *[]*schema.Provider) func() *sc } } +func NamedProviderFunc(name string, providers map[string]*schema.Provider) func() *schema.Provider { + return func() *schema.Provider { + return NamedProvider(name, providers) + } +} + +func NamedProvider(name string, providers map[string]*schema.Provider) *schema.Provider { + if name == "" { + log.Printf("[ERROR] No name passed") + } + + p, ok := providers[name] + if !ok { + log.Printf("[ERROR] No provider named %q found", name) + return nil + } + + return p +} + func DeleteResource(ctx context.Context, resource *schema.Resource, d *schema.ResourceData, meta interface{}) error { if resource.DeleteContext != nil || resource.DeleteWithoutTimeout != nil { var diags diag.Diagnostics @@ -1228,6 +1272,23 @@ func CheckWithProviders(f TestCheckWithProviderFunc, providers *[]*schema.Provid } } +func CheckWithNamedProviders(f TestCheckWithProviderFunc, providers map[string]*schema.Provider) resource.TestCheckFunc { + return func(s *terraform.State) error { + numberOfProviders := len(providers) + for k, provo := range providers { + if provo.Meta() == nil { + log.Printf("[DEBUG] Skipping empty provider %q (total: %d)", k, numberOfProviders) + continue + } + log.Printf("[DEBUG] Calling check with provider %q (total: %d)", k, numberOfProviders) + if err := f(s, provo); err != nil { + return err + } + } + return nil + } +} + // ErrorCheckSkipMessagesContaining skips tests based on error messages that indicate unsupported features func ErrorCheckSkipMessagesContaining(t *testing.T, messages ...string) resource.ErrorCheckFunc { return func(err error) error { diff --git a/internal/service/licensemanager/grant.go b/internal/service/licensemanager/grant.go index 45a6b9404c16..deb65ae42e75 100644 --- a/internal/service/licensemanager/grant.go +++ b/internal/service/licensemanager/grant.go @@ -185,7 +185,7 @@ func resourceGrantDelete(ctx context.Context, d *schema.ResourceData, meta inter in := &licensemanager.DeleteGrantInput{ GrantArn: aws.String(d.Id()), - Version: aws.String(*out.Version), + Version: out.Version, } _, err = conn.DeleteGrantWithContext(ctx, in) diff --git a/internal/service/licensemanager/grant_accepter_test.go b/internal/service/licensemanager/grant_accepter_test.go index cb52ad6b90cb..76ad72928cbf 100644 --- a/internal/service/licensemanager/grant_accepter_test.go +++ b/internal/service/licensemanager/grant_accepter_test.go @@ -6,9 +6,11 @@ import ( "os" "testing" + "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" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/internal/conns" @@ -19,26 +21,35 @@ import ( func testAccGrantAccepter_basic(t *testing.T) { ctx := acctest.Context(t) rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - licenseKey := "LICENSE_MANAGER_GRANT_LICENSE_ARN" - licenseARN := os.Getenv(licenseKey) + licenseARN := os.Getenv(licenseARNKey) if licenseARN == "" { - t.Skipf("Environment variable %s is not set", licenseKey) + t.Skipf("Environment variable %s is not set", licenseARNKey) + } + principal := os.Getenv(principalKey) + if principal == "" { + t.Skipf("Environment variable %s is not set", principalKey) + } + homeRegion := os.Getenv(homeRegionKey) + if homeRegion == "" { + t.Skipf("Environment variable %s is not set", homeRegionKey) } resourceName := "aws_licensemanager_grant_accepter.test" resourceGrantName := "aws_licensemanager_grant.test" + providers := make(map[string]*schema.Provider) + resource.Test(t, resource.TestCase{ PreCheck: func() { acctest.PreCheck(t) }, ErrorCheck: acctest.ErrorCheck(t, licensemanager.EndpointsID), - ProtoV5ProviderFactories: acctest.ProtoV5FactoriesAlternate(ctx, t), - CheckDestroy: testAccCheckGrantAccepterDestroy(ctx), + ProtoV5ProviderFactories: acctest.ProtoV5FactoriesNamed(ctx, t, providers), + CheckDestroy: acctest.CheckWithNamedProviders(testAccCheckGrantAccepterDestroyWithProvider(ctx), providers), Steps: []resource.TestStep{ { - Config: testAccGrantAccepterConfig_basic(licenseARN, rName), + Config: testAccGrantAccepterConfig_basic(licenseARN, rName, principal, homeRegion), Check: resource.ComposeAggregateTestCheckFunc( - testAccCheckGrantAccepterExists(ctx, resourceName), + testAccCheckGrantAccepterExists(ctx, resourceName, acctest.NamedProviderFunc(acctest.ProviderName, providers)), resource.TestCheckResourceAttrPair(resourceName, "grant_arn", resourceGrantName, "arn"), resource.TestCheckResourceAttrSet(resourceName, "allowed_operations.0"), resource.TestCheckResourceAttrPair(resourceName, "home_region", resourceGrantName, "home_region"), @@ -51,7 +62,7 @@ func testAccGrantAccepter_basic(t *testing.T) { ), }, { - Config: testAccGrantAccepterConfig_basic(licenseARN, rName), + Config: testAccGrantAccepterConfig_basic(licenseARN, rName, principal, homeRegion), ResourceName: resourceName, ImportState: true, ImportStateVerify: true, @@ -63,26 +74,35 @@ func testAccGrantAccepter_basic(t *testing.T) { func testAccGrantAccepter_disappears(t *testing.T) { ctx := acctest.Context(t) rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - licenseKey := "LICENSE_MANAGER_GRANT_LICENSE_ARN" - licenseARN := os.Getenv(licenseKey) + licenseARN := os.Getenv(licenseARNKey) if licenseARN == "" { - t.Skipf("Environment variable %s is not set to true", licenseKey) + t.Skipf("Environment variable %s is not set to true", licenseARNKey) + } + principal := os.Getenv(principalKey) + if principal == "" { + t.Skipf("Environment variable %s is not set", principalKey) + } + homeRegion := os.Getenv(homeRegionKey) + if homeRegion == "" { + t.Skipf("Environment variable %s is not set", homeRegionKey) } resourceName := "aws_licensemanager_grant_accepter.test" + providers := make(map[string]*schema.Provider) + resource.Test(t, resource.TestCase{ PreCheck: func() { acctest.PreCheck(t) }, ErrorCheck: acctest.ErrorCheck(t, licensemanager.EndpointsID), - ProtoV5ProviderFactories: acctest.ProtoV5FactoriesAlternate(ctx, t), - CheckDestroy: testAccCheckGrantAccepterDestroy(ctx), + ProtoV5ProviderFactories: acctest.ProtoV5FactoriesNamed(ctx, t, providers), + CheckDestroy: acctest.CheckWithNamedProviders(testAccCheckGrantAccepterDestroyWithProvider(ctx), providers), Steps: []resource.TestStep{ { - Config: testAccGrantAccepterConfig_basic(licenseARN, rName), - Check: resource.ComposeTestCheckFunc( - testAccCheckGrantAccepterExists(ctx, resourceName), - acctest.CheckResourceDisappears(ctx, acctest.Provider, tflicensemanager.ResourceGrantAccepter(), resourceName), + Config: testAccGrantAccepterConfig_basic(licenseARN, rName, principal, homeRegion), + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheckGrantAccepterExists(ctx, resourceName, acctest.NamedProviderFunc(acctest.ProviderName, providers)), + acctest.CheckResourceDisappears(ctx, acctest.NamedProvider(acctest.ProviderName, providers), tflicensemanager.ResourceGrantAccepter(), resourceName), ), ExpectNonEmptyPlan: true, }, @@ -90,7 +110,7 @@ func testAccGrantAccepter_disappears(t *testing.T) { }) } -func testAccCheckGrantAccepterExists(ctx context.Context, n string) resource.TestCheckFunc { +func testAccCheckGrantAccepterExists(ctx context.Context, n string, providerF func() *schema.Provider) resource.TestCheckFunc { return func(s *terraform.State) error { rs, ok := s.RootModule().Resources[n] if !ok { @@ -101,7 +121,7 @@ func testAccCheckGrantAccepterExists(ctx context.Context, n string) resource.Tes return fmt.Errorf("No License Manager License Configuration ID is set") } - conn := acctest.Provider.Meta().(*conns.AWSClient).LicenseManagerConn() + conn := providerF().Meta().(*conns.AWSClient).LicenseManagerConn() out, err := tflicensemanager.FindGrantAccepterByGrantARN(ctx, conn, rs.Primary.ID) @@ -117,9 +137,9 @@ func testAccCheckGrantAccepterExists(ctx context.Context, n string) resource.Tes } } -func testAccCheckGrantAccepterDestroy(ctx context.Context) resource.TestCheckFunc { - return func(s *terraform.State) error { - conn := acctest.Provider.Meta().(*conns.AWSClient).LicenseManagerConn() +func testAccCheckGrantAccepterDestroyWithProvider(ctx context.Context) acctest.TestCheckWithProviderFunc { + return func(s *terraform.State, provider *schema.Provider) error { + conn := provider.Meta().(*conns.AWSClient).LicenseManagerConn() for _, rs := range s.RootModule().Resources { if rs.Type != "aws_licensemanager_grant_accepter" { @@ -143,8 +163,27 @@ func testAccCheckGrantAccepterDestroy(ctx context.Context) resource.TestCheckFun } } -func testAccGrantAccepterConfig_basic(licenseARN string, rName string) string { - return acctest.ConfigAlternateAccountProvider() + fmt.Sprintf(` +func testAccGrantAccepterConfig_basic(licenseARN, rName, principal, homeRegion string) string { + principalArn, _ := arn.Parse(principal) + roleARN := arn.ARN{ + Partition: principalArn.Partition, + Service: "iam", + AccountID: principalArn.AccountID, + Resource: "role/OrganizationAccountAccessRole", + } + return acctest.ConfigCompose( + acctest.ConfigNamedRegionalProvider(acctest.ProviderNameAlternate, homeRegion), + fmt.Sprintf(` +provider %[1]q { + assume_role { + role_arn = %[2]q + } +}`, acctest.ProviderName, roleARN), + fmt.Sprintf(` +resource "aws_licensemanager_grant_accepter" "test" { + grant_arn = aws_licensemanager_grant.test.arn +} + data "aws_licensemanager_received_license" "test" { provider = awsalternate license_arn = %[1]q @@ -154,20 +193,14 @@ locals { allowed_operations = [for i in data.aws_licensemanager_received_license.test.received_metadata[0].allowed_operations : i if i != "CreateGrant"] } -data "aws_partition" "current" {} -data "aws_caller_identity" "current" {} - resource "aws_licensemanager_grant" "test" { provider = awsalternate name = %[2]q allowed_operations = local.allowed_operations license_arn = data.aws_licensemanager_received_license.test.license_arn - principal = "arn:${data.aws_partition.current.partition}:iam::${data.aws_caller_identity.current.account_id}:root" -} - -resource "aws_licensemanager_grant_accepter" "test" { - grant_arn = aws_licensemanager_grant.test.arn + principal = %[3]q } -`, licenseARN, rName) +`, licenseARN, rName, principal), + ) } diff --git a/internal/service/licensemanager/received_license_data_source.go b/internal/service/licensemanager/received_license_data_source.go index 493580d36f85..de81b77eb7e2 100644 --- a/internal/service/licensemanager/received_license_data_source.go +++ b/internal/service/licensemanager/received_license_data_source.go @@ -136,7 +136,7 @@ func DataSourceReceivedLicense() *schema.Resource { }, "license_metadata": { Computed: true, - Type: schema.TypeList, + Type: schema.TypeSet, Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ "name": { @@ -191,7 +191,7 @@ func DataSourceReceivedLicense() *schema.Resource { }, "validity": { Computed: true, - Type: schema.TypeSet, + Type: schema.TypeList, Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ "begin": { From 3d439544acf1ffe2fb81dc4acd82da8af8608d4c Mon Sep 17 00:00:00 2001 From: Graham Davison Date: Wed, 8 Mar 2023 16:55:38 -0800 Subject: [PATCH 574/763] Uses `envvar.SkipIfEmpty` to skip tests when environment variables are not set --- .../licensemanager/grant_accepter_test.go | 32 +++-------- internal/service/licensemanager/grant_test.go | 53 ++++++------------- .../license_grants_data_source_test.go | 17 ++---- .../received_license_data_source_test.go | 12 ++--- .../received_licenses_data_source_test.go | 7 +-- 5 files changed, 32 insertions(+), 89 deletions(-) diff --git a/internal/service/licensemanager/grant_accepter_test.go b/internal/service/licensemanager/grant_accepter_test.go index 76ad72928cbf..f1fc33d996b6 100644 --- a/internal/service/licensemanager/grant_accepter_test.go +++ b/internal/service/licensemanager/grant_accepter_test.go @@ -3,7 +3,6 @@ package licensemanager_test import ( "context" "fmt" - "os" "testing" "github.com/aws/aws-sdk-go/aws/arn" @@ -14,6 +13,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/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" tflicensemanager "github.com/hashicorp/terraform-provider-aws/internal/service/licensemanager" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" ) @@ -21,18 +21,9 @@ import ( func testAccGrantAccepter_basic(t *testing.T) { ctx := acctest.Context(t) rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - licenseARN := os.Getenv(licenseARNKey) - if licenseARN == "" { - t.Skipf("Environment variable %s is not set", licenseARNKey) - } - principal := os.Getenv(principalKey) - if principal == "" { - t.Skipf("Environment variable %s is not set", principalKey) - } - homeRegion := os.Getenv(homeRegionKey) - if homeRegion == "" { - t.Skipf("Environment variable %s is not set", homeRegionKey) - } + licenseARN := envvar.SkipIfEmpty(t, licenseARNKey, envVarLicenseARNKeyError) + principal := envvar.SkipIfEmpty(t, principalKey, envVarPrincipalKeyError) + homeRegion := envvar.SkipIfEmpty(t, homeRegionKey, envVarHomeRegionError) resourceName := "aws_licensemanager_grant_accepter.test" resourceGrantName := "aws_licensemanager_grant.test" @@ -74,18 +65,9 @@ func testAccGrantAccepter_basic(t *testing.T) { func testAccGrantAccepter_disappears(t *testing.T) { ctx := acctest.Context(t) rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - licenseARN := os.Getenv(licenseARNKey) - if licenseARN == "" { - t.Skipf("Environment variable %s is not set to true", licenseARNKey) - } - principal := os.Getenv(principalKey) - if principal == "" { - t.Skipf("Environment variable %s is not set", principalKey) - } - homeRegion := os.Getenv(homeRegionKey) - if homeRegion == "" { - t.Skipf("Environment variable %s is not set", homeRegionKey) - } + licenseARN := envvar.SkipIfEmpty(t, licenseARNKey, envVarLicenseARNKeyError) + principal := envvar.SkipIfEmpty(t, principalKey, envVarPrincipalKeyError) + homeRegion := envvar.SkipIfEmpty(t, homeRegionKey, envVarHomeRegionError) resourceName := "aws_licensemanager_grant_accepter.test" providers := make(map[string]*schema.Provider) diff --git a/internal/service/licensemanager/grant_test.go b/internal/service/licensemanager/grant_test.go index 675ef4edb21d..9aefc8427009 100644 --- a/internal/service/licensemanager/grant_test.go +++ b/internal/service/licensemanager/grant_test.go @@ -3,7 +3,6 @@ package licensemanager_test import ( "context" "fmt" - "os" "regexp" "testing" @@ -13,6 +12,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/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" tflicensemanager "github.com/hashicorp/terraform-provider-aws/internal/service/licensemanager" "github.com/hashicorp/terraform-provider-aws/internal/tfresource" ) @@ -23,6 +23,12 @@ const ( licenseARNKey = "LICENSE_MANAGER_GRANT_LICENSE_ARN" ) +const ( + envVarHomeRegionError = "The region where the license has been imported into the current account." + envVarLicenseARNKeyError = "ARN for a license imported into the current account." + envVarPrincipalKeyError = "ARN of a principal to share the license with. Either a root user, Organization, or Organizational Unit." +) + func TestAccLicenseManagerGrant_serial(t *testing.T) { t.Parallel() @@ -47,18 +53,9 @@ func TestAccLicenseManagerGrant_serial(t *testing.T) { func testAccGrant_basic(t *testing.T) { ctx := acctest.Context(t) - principal := os.Getenv(principalKey) - if principal == "" { - t.Skipf("Environment variable %s is not set", principalKey) - } - licenseARN := os.Getenv(licenseARNKey) - if licenseARN == "" { - t.Skipf("Environment variable %s is not set", licenseARNKey) - } - homeRegion := os.Getenv(homeRegionKey) - if homeRegion == "" { - t.Skipf("Environment variable %s is not set", homeRegionKey) - } + licenseARN := envvar.SkipIfEmpty(t, licenseARNKey, envVarLicenseARNKeyError) + principal := envvar.SkipIfEmpty(t, principalKey, envVarPrincipalKeyError) + homeRegion := envvar.SkipIfEmpty(t, homeRegionKey, envVarHomeRegionError) rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resourceName := "aws_licensemanager_grant.test" @@ -97,18 +94,9 @@ func testAccGrant_basic(t *testing.T) { func testAccGrant_disappears(t *testing.T) { ctx := acctest.Context(t) - principal := os.Getenv(principalKey) - if principal == "" { - t.Skipf("Environment variable %s is not set to true", principalKey) - } - licenseARN := os.Getenv(licenseARNKey) - if licenseARN == "" { - t.Skipf("Environment variable %s is not set to true", licenseARNKey) - } - homeRegion := os.Getenv(homeRegionKey) - if homeRegion == "" { - t.Skipf("Environment variable %s is not set to true", homeRegionKey) - } + licenseARN := envvar.SkipIfEmpty(t, licenseARNKey, envVarLicenseARNKeyError) + principal := envvar.SkipIfEmpty(t, principalKey, envVarPrincipalKeyError) + homeRegion := envvar.SkipIfEmpty(t, homeRegionKey, envVarHomeRegionError) rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resourceName := "aws_licensemanager_grant.test" @@ -132,18 +120,9 @@ func testAccGrant_disappears(t *testing.T) { func testAccGrant_name(t *testing.T) { ctx := acctest.Context(t) - principal := os.Getenv(principalKey) - if principal == "" { - t.Skipf("Environment variable %s is not set to true", principalKey) - } - licenseARN := os.Getenv(licenseARNKey) - if licenseARN == "" { - t.Skipf("Environment variable %s is not set to true", licenseARNKey) - } - homeRegion := os.Getenv(homeRegionKey) - if homeRegion == "" { - t.Skipf("Environment variable %s is not set to true", homeRegionKey) - } + licenseARN := envvar.SkipIfEmpty(t, licenseARNKey, envVarLicenseARNKeyError) + principal := envvar.SkipIfEmpty(t, principalKey, envVarPrincipalKeyError) + homeRegion := envvar.SkipIfEmpty(t, homeRegionKey, envVarHomeRegionError) rName1 := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) rName2 := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resourceName := "aws_licensemanager_grant.test" diff --git a/internal/service/licensemanager/license_grants_data_source_test.go b/internal/service/licensemanager/license_grants_data_source_test.go index 8c6705d3d050..ac9517530864 100644 --- a/internal/service/licensemanager/license_grants_data_source_test.go +++ b/internal/service/licensemanager/license_grants_data_source_test.go @@ -2,31 +2,22 @@ package licensemanager_test import ( "fmt" - "os" "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" + "github.com/hashicorp/terraform-provider-aws/internal/envvar" ) func testAccGrantsDataSource_basic(t *testing.T) { ctx := acctest.Context(t) rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) datasourceName := "data.aws_licensemanager_grants.test" - licenseARN := os.Getenv(licenseARNKey) - if licenseARN == "" { - t.Skipf("Environment variable %s is not set to true", licenseARNKey) - } - principal := os.Getenv(principalKey) - if principal == "" { - t.Skipf("Environment variable %s is not set", principalKey) - } - homeRegion := os.Getenv(homeRegionKey) - if homeRegion == "" { - t.Skipf("Environment variable %s is not set", homeRegionKey) - } + licenseARN := envvar.SkipIfEmpty(t, licenseARNKey, envVarLicenseARNKeyError) + principal := envvar.SkipIfEmpty(t, principalKey, envVarPrincipalKeyError) + homeRegion := envvar.SkipIfEmpty(t, homeRegionKey, envVarHomeRegionError) resource.Test(t, resource.TestCase{ PreCheck: func() { acctest.PreCheck(t) }, diff --git a/internal/service/licensemanager/received_license_data_source_test.go b/internal/service/licensemanager/received_license_data_source_test.go index d1eb17982161..e62dfcbb42ab 100644 --- a/internal/service/licensemanager/received_license_data_source_test.go +++ b/internal/service/licensemanager/received_license_data_source_test.go @@ -2,24 +2,18 @@ package licensemanager_test import ( "fmt" - "os" "testing" "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" + "github.com/hashicorp/terraform-provider-aws/internal/envvar" ) func TestAccLicenseManagerReceivedLicenseDataSource_basic(t *testing.T) { datasourceName := "data.aws_licensemanager_received_license.test" - licenseARN := os.Getenv(licenseARNKey) - if licenseARN == "" { - t.Skipf("Environment variable %s is not set", licenseARNKey) - } - homeRegion := os.Getenv(homeRegionKey) - if homeRegion == "" { - t.Skipf("Environment variable %s is not set to true", homeRegionKey) - } + licenseARN := envvar.SkipIfEmpty(t, licenseARNKey, envVarLicenseARNKeyError) + homeRegion := envvar.SkipIfEmpty(t, homeRegionKey, envVarHomeRegionError) resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { acctest.PreCheck(t) }, diff --git a/internal/service/licensemanager/received_licenses_data_source_test.go b/internal/service/licensemanager/received_licenses_data_source_test.go index f07aabed3844..5134a541b294 100644 --- a/internal/service/licensemanager/received_licenses_data_source_test.go +++ b/internal/service/licensemanager/received_licenses_data_source_test.go @@ -2,20 +2,17 @@ package licensemanager_test import ( "fmt" - "os" "testing" "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" + "github.com/hashicorp/terraform-provider-aws/internal/envvar" ) func TestAccLicenseManagerReceivedLicensesDataSource_basic(t *testing.T) { datasourceName := "data.aws_licensemanager_received_licenses.test" - licenseARN := os.Getenv(licenseARNKey) - if licenseARN == "" { - t.Skipf("Environment variable %s is not set", licenseARNKey) - } + licenseARN := envvar.SkipIfEmpty(t, licenseARNKey, envVarLicenseARNKeyError) resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { acctest.PreCheck(t) }, From a86c50993a3a3a6448a223aeb429281a211cfae3 Mon Sep 17 00:00:00 2001 From: Graham Davison Date: Wed, 8 Mar 2023 17:08:46 -0800 Subject: [PATCH 575/763] Updates environment variables --- docs/acc-test-environment-variables.md | 3 +++ internal/service/licensemanager/grant_test.go | 6 +++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/docs/acc-test-environment-variables.md b/docs/acc-test-environment-variables.md index 64392327c6a8..a3d5df02a9cc 100644 --- a/docs/acc-test-environment-variables.md +++ b/docs/acc-test-environment-variables.md @@ -83,4 +83,7 @@ Environment variables (beyond standard AWS Go SDK ones) used by acceptance testi | `TEST_AWS_SES_VERIFIED_EMAIL_ARN` | Verified SES Email Identity for use in Cognito User Pool testing. | | `TF_ACC` | Enables Go tests containing `resource.Test()` and `resource.ParallelTest()`. | | `TF_ACC_ASSUME_ROLE_ARN` | Amazon Resource Name of existing IAM Role to use for limited permissions acceptance testing. | +| `TF_AWS_LICENSE_MANAGER_GRANT_HOME_REGION` | Region where a License Manager license is imported. | +| `TF_AWS_LICENSE_MANAGER_GRANT_LICENSE_ARN` | ARN for a License Manager license imported into the current account. | +| `TF_AWS_LICENSE_MANAGER_GRANT_PRINCIPAL` | ARN of a principal to share the License Manager license with. Either a root user, Organization, or Organizational Unit. | | `TF_TEST_CLOUDFRONT_RETAIN` | Flag to disable but dangle CloudFront Distributions during testing to reduce feedback time (must be manually destroyed afterwards) | diff --git a/internal/service/licensemanager/grant_test.go b/internal/service/licensemanager/grant_test.go index 9aefc8427009..fa4a2b7334b7 100644 --- a/internal/service/licensemanager/grant_test.go +++ b/internal/service/licensemanager/grant_test.go @@ -18,9 +18,9 @@ import ( ) const ( - homeRegionKey = "LICENSE_MANAGER_GRANT_HOME_REGION" - principalKey = "LICENSE_MANAGER_GRANT_PRINCIPAL" - licenseARNKey = "LICENSE_MANAGER_GRANT_LICENSE_ARN" + homeRegionKey = "TF_AWS_LICENSE_MANAGER_GRANT_HOME_REGION" + licenseARNKey = "TF_AWS_LICENSE_MANAGER_GRANT_LICENSE_ARN" + principalKey = "TF_AWS_LICENSE_MANAGER_GRANT_PRINCIPAL" ) const ( From fa0443d2596e444a4fc6c993632db457691b86a9 Mon Sep 17 00:00:00 2001 From: Graham Davison Date: Wed, 8 Mar 2023 17:09:06 -0800 Subject: [PATCH 576/763] Cleanup --- internal/service/licensemanager/association_test.go | 4 ++-- .../service/licensemanager/license_configuration_test.go | 8 ++++---- .../licensemanager/received_licenses_data_source_test.go | 4 ++-- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/internal/service/licensemanager/association_test.go b/internal/service/licensemanager/association_test.go index cb44c6050dd1..ddb80039dc4e 100644 --- a/internal/service/licensemanager/association_test.go +++ b/internal/service/licensemanager/association_test.go @@ -28,7 +28,7 @@ func TestAccLicenseManagerAssociation_basic(t *testing.T) { Steps: []resource.TestStep{ { Config: testAccAssociationConfig_basic(rName), - Check: resource.ComposeTestCheckFunc( + Check: resource.ComposeAggregateTestCheckFunc( testAccCheckAssociationExists(ctx, resourceName), resource.TestCheckResourceAttrPair(resourceName, "license_configuration_arn", "aws_licensemanager_license_configuration.test", "id"), resource.TestCheckResourceAttrPair(resourceName, "resource_arn", "aws_instance.test", "arn"), @@ -56,7 +56,7 @@ func TestAccLicenseManagerAssociation_disappears(t *testing.T) { Steps: []resource.TestStep{ { Config: testAccAssociationConfig_basic(rName), - Check: resource.ComposeTestCheckFunc( + Check: resource.ComposeAggregateTestCheckFunc( testAccCheckAssociationExists(ctx, resourceName), acctest.CheckResourceDisappears(ctx, acctest.Provider, tflicensemanager.ResourceAssociation(), resourceName), ), diff --git a/internal/service/licensemanager/license_configuration_test.go b/internal/service/licensemanager/license_configuration_test.go index cba9f31d3f85..691991f8710e 100644 --- a/internal/service/licensemanager/license_configuration_test.go +++ b/internal/service/licensemanager/license_configuration_test.go @@ -76,7 +76,7 @@ func TestAccLicenseManagerLicenseConfiguration_disappears(t *testing.T) { Steps: []resource.TestStep{ { Config: testAccLicenseConfigurationConfig_basic(rName), - Check: resource.ComposeTestCheckFunc( + Check: resource.ComposeAggregateTestCheckFunc( testAccCheckLicenseConfigurationExists(ctx, resourceName, &licenseConfiguration), acctest.CheckResourceDisappears(ctx, acctest.Provider, tflicensemanager.ResourceLicenseConfiguration(), resourceName), ), @@ -100,7 +100,7 @@ func TestAccLicenseManagerLicenseConfiguration_tags(t *testing.T) { Steps: []resource.TestStep{ { Config: testAccLicenseConfigurationConfig_tags1(rName, "key1", "value1"), - Check: resource.ComposeTestCheckFunc( + Check: resource.ComposeAggregateTestCheckFunc( testAccCheckLicenseConfigurationExists(ctx, resourceName, &licenseConfiguration), resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), resource.TestCheckResourceAttr(resourceName, "tags.key1", "value1"), @@ -113,7 +113,7 @@ func TestAccLicenseManagerLicenseConfiguration_tags(t *testing.T) { }, { Config: testAccLicenseConfigurationConfig_tags2(rName, "key1", "value1updated", "key2", "value2"), - Check: resource.ComposeTestCheckFunc( + Check: resource.ComposeAggregateTestCheckFunc( testAccCheckLicenseConfigurationExists(ctx, resourceName, &licenseConfiguration), resource.TestCheckResourceAttr(resourceName, "tags.%", "2"), resource.TestCheckResourceAttr(resourceName, "tags.key1", "value1updated"), @@ -122,7 +122,7 @@ func TestAccLicenseManagerLicenseConfiguration_tags(t *testing.T) { }, { Config: testAccLicenseConfigurationConfig_tags1(rName, "key2", "value2"), - Check: resource.ComposeTestCheckFunc( + Check: resource.ComposeAggregateTestCheckFunc( testAccCheckLicenseConfigurationExists(ctx, resourceName, &licenseConfiguration), resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), resource.TestCheckResourceAttr(resourceName, "tags.key2", "value2"), diff --git a/internal/service/licensemanager/received_licenses_data_source_test.go b/internal/service/licensemanager/received_licenses_data_source_test.go index 5134a541b294..5b023a40eb97 100644 --- a/internal/service/licensemanager/received_licenses_data_source_test.go +++ b/internal/service/licensemanager/received_licenses_data_source_test.go @@ -21,7 +21,7 @@ func TestAccLicenseManagerReceivedLicensesDataSource_basic(t *testing.T) { Steps: []resource.TestStep{ { Config: testAccReceivedLicensesDataSourceConfig_arns(licenseARN), - Check: resource.ComposeTestCheckFunc( + Check: resource.ComposeAggregateTestCheckFunc( resource.TestCheckResourceAttr(datasourceName, "arns.#", "1"), ), }, @@ -38,7 +38,7 @@ func TestAccLicenseManagerReceivedLicensesDataSource_empty(t *testing.T) { Steps: []resource.TestStep{ { Config: testAccReceivedLicensesDataSourceConfig_empty(), - Check: resource.ComposeTestCheckFunc( + Check: resource.ComposeAggregateTestCheckFunc( resource.TestCheckResourceAttr(datasourceName, "arns.#", "0"), ), }, From b3de5d7e149ffdcc9325379c90b54bd77a4ff44c Mon Sep 17 00:00:00 2001 From: Graham Davison Date: Wed, 8 Mar 2023 17:10:13 -0800 Subject: [PATCH 577/763] Adds License Manager acceptance tests to Org Account --- .teamcity/components/generated/service_orgacct.kt | 1 + 1 file changed, 1 insertion(+) diff --git a/.teamcity/components/generated/service_orgacct.kt b/.teamcity/components/generated/service_orgacct.kt index 339ae3c64d65..76b95980d053 100644 --- a/.teamcity/components/generated/service_orgacct.kt +++ b/.teamcity/components/generated/service_orgacct.kt @@ -9,6 +9,7 @@ val orgacctServices = mapOf( "config" to ServiceSpec("Config" /*"TestAccConfig_serial|TestAccConfigConfigurationAggregator_"*/), "fms" to ServiceSpec("FMS"), "guardduty" to ServiceSpec("GuardDuty"), + "licensemanager" to ServiceSpec("License Manager"), "macie2" to ServiceSpec("Macie2"), "organizations" to ServiceSpec("Organizations"), "securityhub" to ServiceSpec( From 58653b99b76ccc3d7a976d9a89fe5062ad3105c4 Mon Sep 17 00:00:00 2001 From: Graham Davison Date: Wed, 8 Mar 2023 17:14:40 -0800 Subject: [PATCH 578/763] terrafmt --- .../licensemanager/received_licenses_data_source_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/service/licensemanager/received_licenses_data_source_test.go b/internal/service/licensemanager/received_licenses_data_source_test.go index 5b023a40eb97..8049475c3d99 100644 --- a/internal/service/licensemanager/received_licenses_data_source_test.go +++ b/internal/service/licensemanager/received_licenses_data_source_test.go @@ -52,7 +52,7 @@ data "aws_licensemanager_received_licenses" "test" { filter { name = "ProductSKU" values = [ - data.aws_licensemanager_received_license.test.product_sku + data.aws_licensemanager_received_license.test.product_sku ] } } From b2c1d2384ca71ab07491d013f6ef16187b8bf8a2 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Thu, 9 Mar 2023 08:27:39 -0500 Subject: [PATCH 579/763] Fix semgrep 'ci.caps4-in-func-name'. --- internal/service/redshiftserverless/namespace_test.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/internal/service/redshiftserverless/namespace_test.go b/internal/service/redshiftserverless/namespace_test.go index e801e3939de7..50bc3384b569 100644 --- a/internal/service/redshiftserverless/namespace_test.go +++ b/internal/service/redshiftserverless/namespace_test.go @@ -61,7 +61,7 @@ func TestAccRedshiftServerlessNamespace_basic(t *testing.T) { }) } -func TestAccRedshiftServerlessNamespace_defaultIamRole(t *testing.T) { +func TestAccRedshiftServerlessNamespace_defaultIAMRole(t *testing.T) { ctx := acctest.Context(t) resourceName := "aws_redshiftserverless_namespace.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) @@ -73,7 +73,7 @@ func TestAccRedshiftServerlessNamespace_defaultIamRole(t *testing.T) { CheckDestroy: testAccCheckNamespaceDestroy(ctx), Steps: []resource.TestStep{ { - Config: testAccNamespaceConfig_defaultIamRole(rName), + Config: testAccNamespaceConfig_defaultIAMRole(rName), Check: resource.ComposeTestCheckFunc( testAccCheckNamespaceExists(ctx, resourceName), resource.TestCheckResourceAttr(resourceName, "namespace_name", rName), @@ -307,7 +307,7 @@ resource "aws_redshiftserverless_namespace" "test" { `, rName, tagKey1, tagValue1, tagKey2, tagValue2) } -func testAccNamespaceConfig_defaultIamRole(rName string) string { +func testAccNamespaceConfig_defaultIAMRole(rName string) string { return fmt.Sprintf(` resource "aws_iam_role" "test" { name = %[1]q From f4e538b64774d2314526dd7c8942aaa01572162b Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Thu, 9 Mar 2023 08:38:03 -0500 Subject: [PATCH 580/763] r/aws_amplify_domain_association: Document 'enable_auto_sub_domain'. --- website/docs/r/amplify_domain_association.html.markdown | 1 + 1 file changed, 1 insertion(+) diff --git a/website/docs/r/amplify_domain_association.html.markdown b/website/docs/r/amplify_domain_association.html.markdown index 24057309b3e7..9a982a2419d4 100644 --- a/website/docs/r/amplify_domain_association.html.markdown +++ b/website/docs/r/amplify_domain_association.html.markdown @@ -53,6 +53,7 @@ The following arguments are supported: * `app_id` - (Required) Unique ID for an Amplify app. * `domain_name` - (Required) Domain name for the domain association. +* `enable_auto_sub_domain` - (Optional) Enables the automated creation of subdomains for branches. * `sub_domain` - (Required) Setting for the subdomain. Documented below. * `wait_for_verification` - (Optional) If enabled, the resource will wait for the domain association status to change to `PENDING_DEPLOYMENT` or `AVAILABLE`. Setting this to `false` will skip the process. Default: `true`. From 1239d97f0806885cd43d1ca3bc1d0d48fc2b4cf6 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Thu, 9 Mar 2023 08:43:13 -0500 Subject: [PATCH 581/763] r/aws_amplify_domain_association: Cosmetics. --- .../service/amplify/domain_association.go | 29 +++++++------------ .../amplify/domain_association_test.go | 6 ++-- 2 files changed, 13 insertions(+), 22 deletions(-) diff --git a/internal/service/amplify/domain_association.go b/internal/service/amplify/domain_association.go index 7fc051f83e4e..5a1636449e47 100644 --- a/internal/service/amplify/domain_association.go +++ b/internal/service/amplify/domain_association.go @@ -22,6 +22,7 @@ func ResourceDomainAssociation() *schema.Resource { ReadWithoutTimeout: resourceDomainAssociationRead, UpdateWithoutTimeout: resourceDomainAssociationUpdate, DeleteWithoutTimeout: resourceDomainAssociationDelete, + Importer: &schema.ResourceImporter{ StateContext: schema.ImportStatePassthroughContext, }, @@ -32,30 +33,25 @@ func ResourceDomainAssociation() *schema.Resource { Required: true, ForceNew: true, }, - "arn": { Type: schema.TypeString, Computed: true, }, - "certificate_verification_dns_record": { Type: schema.TypeString, Computed: true, }, - "domain_name": { Type: schema.TypeString, Required: true, ForceNew: true, ValidateFunc: validation.StringLenBetween(1, 255), }, - "enable_auto_sub_domain": { Type: schema.TypeBool, Optional: true, Default: false, }, - "sub_domain": { Type: schema.TypeSet, Required: true, @@ -82,7 +78,6 @@ func ResourceDomainAssociation() *schema.Resource { }, }, }, - "wait_for_verification": { Type: schema.TypeBool, Optional: true, @@ -98,17 +93,14 @@ func resourceDomainAssociationCreate(ctx context.Context, d *schema.ResourceData appID := d.Get("app_id").(string) domainName := d.Get("domain_name").(string) - enableAutoSubDomain := d.Get("enable_auto_sub_domain").(bool) id := DomainAssociationCreateResourceID(appID, domainName) - input := &lify.CreateDomainAssociationInput{ AppId: aws.String(appID), DomainName: aws.String(domainName), + EnableAutoSubDomain: aws.Bool(d.Get("enable_auto_sub_domain").(bool)), SubDomainSettings: expandSubDomainSettings(d.Get("sub_domain").(*schema.Set).List()), - EnableAutoSubDomain: aws.Bool(enableAutoSubDomain), } - log.Printf("[DEBUG] Creating Amplify Domain Association: %s", input) _, err := conn.CreateDomainAssociationWithContext(ctx, input) if err != nil { @@ -118,12 +110,12 @@ func resourceDomainAssociationCreate(ctx context.Context, d *schema.ResourceData d.SetId(id) if _, err := waitDomainAssociationCreated(ctx, conn, appID, domainName); err != nil { - return sdkdiag.AppendErrorf(diags, "waiting for Amplify Domain Association (%s) to create: %s", d.Id(), err) + return sdkdiag.AppendErrorf(diags, "waiting for Amplify Domain Association (%s) create: %s", d.Id(), err) } if d.Get("wait_for_verification").(bool) { if _, err := waitDomainAssociationVerified(ctx, conn, appID, domainName); err != nil { - return sdkdiag.AppendErrorf(diags, "waiting for Amplify Domain Association (%s) to verify: %s", d.Id(), err) + return sdkdiag.AppendErrorf(diags, "waiting for Amplify Domain Association (%s) verification: %s", d.Id(), err) } } @@ -174,21 +166,20 @@ func resourceDomainAssociationUpdate(ctx context.Context, d *schema.ResourceData return sdkdiag.AppendErrorf(diags, "parsing Amplify Domain Association ID: %s", err) } - if d.HasChanges("sub_domain", "enable_auto_sub_domain") { + if d.HasChanges("enable_auto_sub_domain", "sub_domain") { input := &lify.UpdateDomainAssociationInput{ AppId: aws.String(appID), DomainName: aws.String(domainName), } - if d.HasChange("sub_domain") { - input.SubDomainSettings = expandSubDomainSettings(d.Get("sub_domain").(*schema.Set).List()) - } - if d.HasChange("enable_auto_sub_domain") { input.EnableAutoSubDomain = aws.Bool(d.Get("enable_auto_sub_domain").(bool)) } - log.Printf("[DEBUG] Creating Amplify Domain Association: %s", input) + if d.HasChange("sub_domain") { + input.SubDomainSettings = expandSubDomainSettings(d.Get("sub_domain").(*schema.Set).List()) + } + _, err := conn.UpdateDomainAssociationWithContext(ctx, input) if err != nil { @@ -198,7 +189,7 @@ func resourceDomainAssociationUpdate(ctx context.Context, d *schema.ResourceData if d.Get("wait_for_verification").(bool) { if _, err := waitDomainAssociationVerified(ctx, conn, appID, domainName); err != nil { - return sdkdiag.AppendErrorf(diags, "waiting for Amplify Domain Association (%s) to verify: %s", d.Id(), err) + return sdkdiag.AppendErrorf(diags, "waiting for Amplify Domain Association (%s) verification: %s", d.Id(), err) } } diff --git a/internal/service/amplify/domain_association_test.go b/internal/service/amplify/domain_association_test.go index c8663dad3f20..cd37763f89c9 100644 --- a/internal/service/amplify/domain_association_test.go +++ b/internal/service/amplify/domain_association_test.go @@ -41,12 +41,12 @@ func testAccDomainAssociation_basic(t *testing.T) { testAccCheckDomainAssociationExists(ctx, resourceName, &domain), acctest.MatchResourceAttrRegionalARN(resourceName, "arn", "amplify", regexp.MustCompile(`apps/.+/domains/.+`)), resource.TestCheckResourceAttr(resourceName, "domain_name", domainName), + resource.TestCheckResourceAttr(resourceName, "enable_auto_sub_domain", "false"), resource.TestCheckResourceAttr(resourceName, "sub_domain.#", "1"), resource.TestCheckTypeSetElemNestedAttrs(resourceName, "sub_domain.*", map[string]string{ "branch_name": rName, "prefix": "", }), - resource.TestCheckResourceAttr(resourceName, "enable_auto_sub_domain", "false"), resource.TestCheckResourceAttr(resourceName, "wait_for_verification", "false"), ), }, @@ -114,12 +114,12 @@ func testAccDomainAssociation_update(t *testing.T) { testAccCheckDomainAssociationExists(ctx, resourceName, &domain), acctest.MatchResourceAttrRegionalARN(resourceName, "arn", "amplify", regexp.MustCompile(`apps/.+/domains/.+`)), resource.TestCheckResourceAttr(resourceName, "domain_name", domainName), + resource.TestCheckResourceAttr(resourceName, "enable_auto_sub_domain", "false"), resource.TestCheckResourceAttr(resourceName, "sub_domain.#", "1"), resource.TestCheckTypeSetElemNestedAttrs(resourceName, "sub_domain.*", map[string]string{ "branch_name": rName, "prefix": "", }), - resource.TestCheckResourceAttr(resourceName, "enable_auto_sub_domain", "false"), resource.TestCheckResourceAttr(resourceName, "wait_for_verification", "true"), ), }, @@ -135,6 +135,7 @@ func testAccDomainAssociation_update(t *testing.T) { testAccCheckDomainAssociationExists(ctx, resourceName, &domain), acctest.MatchResourceAttrRegionalARN(resourceName, "arn", "amplify", regexp.MustCompile(`apps/.+/domains/.+`)), resource.TestCheckResourceAttr(resourceName, "domain_name", domainName), + resource.TestCheckResourceAttr(resourceName, "enable_auto_sub_domain", "true"), resource.TestCheckResourceAttr(resourceName, "sub_domain.#", "2"), resource.TestCheckTypeSetElemNestedAttrs(resourceName, "sub_domain.*", map[string]string{ "branch_name": rName, @@ -144,7 +145,6 @@ func testAccDomainAssociation_update(t *testing.T) { "branch_name": fmt.Sprintf("%s-2", rName), "prefix": "www", }), - resource.TestCheckResourceAttr(resourceName, "enable_auto_sub_domain", "true"), resource.TestCheckResourceAttr(resourceName, "wait_for_verification", "true"), ), }, From 4ed90ede57a54169aafcdc1af607a07f151200e0 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Thu, 9 Mar 2023 08:55:57 -0500 Subject: [PATCH 582/763] d/aws_instances: Cosmetics. --- .../service/ec2/ec2_instances_data_source.go | 8 +++---- .../ec2/ec2_instances_data_source_test.go | 21 +++++-------------- 2 files changed, 9 insertions(+), 20 deletions(-) diff --git a/internal/service/ec2/ec2_instances_data_source.go b/internal/service/ec2/ec2_instances_data_source.go index d42d8d126dd9..391a57b726e3 100644 --- a/internal/service/ec2/ec2_instances_data_source.go +++ b/internal/service/ec2/ec2_instances_data_source.go @@ -40,17 +40,17 @@ func DataSourceInstances() *schema.Resource { ValidateFunc: validation.StringInSlice(ec2.InstanceStateName_Values(), false), }, }, - "private_ips": { + "ipv6_addresses": { Type: schema.TypeList, Computed: true, Elem: &schema.Schema{Type: schema.TypeString}, }, - "public_ips": { + "private_ips": { Type: schema.TypeList, Computed: true, Elem: &schema.Schema{Type: schema.TypeString}, }, - "ipv6_addresses": { + "public_ips": { Type: schema.TypeList, Computed: true, Elem: &schema.Schema{Type: schema.TypeString}, @@ -112,9 +112,9 @@ func dataSourceInstancesRead(ctx context.Context, d *schema.ResourceData, meta i d.SetId(meta.(*conns.AWSClient).Region) d.Set("ids", instanceIDs) + d.Set("ipv6_addresses", ipv6Addresses) d.Set("private_ips", privateIPs) d.Set("public_ips", publicIPs) - d.Set("ipv6_addresses", ipv6Addresses) return diags } diff --git a/internal/service/ec2/ec2_instances_data_source_test.go b/internal/service/ec2/ec2_instances_data_source_test.go index 9e55415aff54..ba43362d2158 100644 --- a/internal/service/ec2/ec2_instances_data_source_test.go +++ b/internal/service/ec2/ec2_instances_data_source_test.go @@ -22,8 +22,8 @@ func TestAccEC2InstancesDataSource_basic(t *testing.T) { Config: testAccInstancesDataSourceConfig_ids(rName), Check: resource.ComposeTestCheckFunc( resource.TestCheckResourceAttr("data.aws_instances.test", "ids.#", "2"), - resource.TestCheckResourceAttr("data.aws_instances.test", "private_ips.#", "2"), resource.TestCheckResourceAttr("data.aws_instances.test", "ipv6_addresses.#", "2"), + resource.TestCheckResourceAttr("data.aws_instances.test", "private_ips.#", "2"), // Public IP values are flakey for new EC2 instances due to eventual consistency resource.TestCheckResourceAttrSet("data.aws_instances.test", "public_ips.#"), ), @@ -80,9 +80,9 @@ func TestAccEC2InstancesDataSource_empty(t *testing.T) { Config: testAccInstancesDataSourceConfig_empty(rName), Check: resource.ComposeTestCheckFunc( resource.TestCheckResourceAttr("data.aws_instances.test", "ids.#", "0"), + resource.TestCheckResourceAttr("data.aws_instances.test", "ipv6_addresses.#", "0"), resource.TestCheckResourceAttr("data.aws_instances.test", "private_ips.#", "0"), resource.TestCheckResourceAttr("data.aws_instances.test", "public_ips.#", "0"), - resource.TestCheckResourceAttr("data.aws_instances.test", "ipv6_addresses.#", "0"), ), }, }, @@ -101,9 +101,9 @@ func TestAccEC2InstancesDataSource_timeout(t *testing.T) { Config: testAccInstancesDataSourceConfig_timeout(rName), Check: resource.ComposeTestCheckFunc( resource.TestCheckResourceAttr("data.aws_instances.test", "ids.#", "2"), + resource.TestCheckResourceAttrSet("data.aws_instances.test", "ipv6_addresses.#"), resource.TestCheckResourceAttr("data.aws_instances.test", "private_ips.#", "2"), resource.TestCheckResourceAttrSet("data.aws_instances.test", "public_ips.#"), - resource.TestCheckResourceAttrSet("data.aws_instances.test", "ipv6_addresses.#"), ), }, }, @@ -114,24 +114,13 @@ func testAccInstancesDataSourceConfig_ids(rName string) string { return acctest.ConfigCompose( acctest.ConfigLatestAmazonLinuxHVMEBSAMI(), acctest.AvailableEC2InstanceTypeForRegion("t3.micro", "t2.micro"), + acctest.ConfigVPCWithSubnetsIPv6(rName, 1), fmt.Sprintf(` -resource "aws_vpc" "test" { - cidr_block = "10.0.0.0/16" - assign_generated_ipv6_cidr_block = true -} - -resource "aws_subnet" "test" { - vpc_id = aws_vpc.test.id - cidr_block = "10.0.1.0/24" - ipv6_cidr_block = "${cidrsubnet(aws_vpc.test.ipv6_cidr_block, 8, 1)}" - assign_ipv6_address_on_creation = true -} - resource "aws_instance" "test" { count = 2 ami = data.aws_ami.amzn-ami-minimal-hvm-ebs.id instance_type = data.aws_ec2_instance_type_offering.available.instance_type - subnet_id = aws_subnet.test.id + subnet_id = aws_subnet.test[0].id ipv6_address_count = 1 tags = { From 7583dc9a8486d8251ddf64c331cfe97f006bc550 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Thu, 9 Mar 2023 09:06:41 -0500 Subject: [PATCH 583/763] d/aws_ec2_transit_gateway_attachment: Cosmetics. --- .changelog/29648.txt | 3 +- .../transitgateway_attachment_data_source.go | 30 +++++++++---------- ...2_transit_gateway_attachment.html.markdown | 4 +-- 3 files changed, 18 insertions(+), 19 deletions(-) diff --git a/.changelog/29648.txt b/.changelog/29648.txt index 5b768acd31bc..acb342ee0c20 100644 --- a/.changelog/29648.txt +++ b/.changelog/29648.txt @@ -1,4 +1,3 @@ ```release-note:enhancement -data-source/aws_ec2_transit_gateway_attachment: Add association_state argument -data-source/aws_ec2_transit_gateway_attachment: Add association_transit_gateway_route_table_id argument +data-source/aws_ec2_transit_gateway_attachment: Add `association_state` and `association_transit_gateway_route_table_id` attributes ``` diff --git a/internal/service/ec2/transitgateway_attachment_data_source.go b/internal/service/ec2/transitgateway_attachment_data_source.go index 61d235dd5b22..eb66fc44e95b 100644 --- a/internal/service/ec2/transitgateway_attachment_data_source.go +++ b/internal/service/ec2/transitgateway_attachment_data_source.go @@ -25,6 +25,14 @@ func DataSourceTransitGatewayAttachment() *schema.Resource { Type: schema.TypeString, Computed: true, }, + "association_state": { + Type: schema.TypeString, + Computed: true, + }, + "association_transit_gateway_route_table_id": { + Type: schema.TypeString, + Computed: true, + }, "filter": CustomFiltersSchema(), "resource_id": { Type: schema.TypeString, @@ -56,14 +64,6 @@ func DataSourceTransitGatewayAttachment() *schema.Resource { Type: schema.TypeString, Computed: true, }, - "association_state": { - Type: schema.TypeString, - Computed: true, - }, - "association_transit_gateway_route_table_id": { - Type: schema.TypeString, - Computed: true, - }, }, } } @@ -106,13 +106,6 @@ func dataSourceTransitGatewayAttachmentRead(ctx context.Context, d *schema.Resou Resource: fmt.Sprintf("transit-gateway-attachment/%s", d.Id()), }.String() d.Set("arn", arn) - d.Set("resource_id", transitGatewayAttachment.ResourceId) - d.Set("resource_owner_id", resourceOwnerID) - d.Set("resource_type", transitGatewayAttachment.ResourceType) - d.Set("state", transitGatewayAttachment.State) - d.Set("transit_gateway_attachment_id", transitGatewayAttachmentID) - d.Set("transit_gateway_id", transitGatewayAttachment.TransitGatewayId) - d.Set("transit_gateway_owner_id", transitGatewayAttachment.TransitGatewayOwnerId) if v := transitGatewayAttachment.Association; v != nil { d.Set("association_state", v.State) d.Set("association_transit_gateway_route_table_id", v.TransitGatewayRouteTableId) @@ -120,6 +113,13 @@ func dataSourceTransitGatewayAttachmentRead(ctx context.Context, d *schema.Resou d.Set("association_state", nil) d.Set("association_transit_gateway_route_table_id", nil) } + d.Set("resource_id", transitGatewayAttachment.ResourceId) + d.Set("resource_owner_id", resourceOwnerID) + d.Set("resource_type", transitGatewayAttachment.ResourceType) + d.Set("state", transitGatewayAttachment.State) + d.Set("transit_gateway_attachment_id", transitGatewayAttachmentID) + d.Set("transit_gateway_id", transitGatewayAttachment.TransitGatewayId) + d.Set("transit_gateway_owner_id", transitGatewayAttachment.TransitGatewayOwnerId) if err := d.Set("tags", KeyValueTags(ctx, transitGatewayAttachment.Tags).IgnoreAWS().IgnoreConfig(ignoreTagsConfig).Map()); err != nil { return sdkdiag.AppendErrorf(diags, "setting tags: %s", err) diff --git a/website/docs/d/ec2_transit_gateway_attachment.html.markdown b/website/docs/d/ec2_transit_gateway_attachment.html.markdown index 66a3ff8ded91..3992cdf22103 100644 --- a/website/docs/d/ec2_transit_gateway_attachment.html.markdown +++ b/website/docs/d/ec2_transit_gateway_attachment.html.markdown @@ -43,6 +43,8 @@ The following arguments are supported: In addition to all arguments above, the following attributes are exported: * `arn` - ARN of the attachment. +* `association_state` - The state of the association (see [the underlying AWS API](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_TransitGatewayAttachmentAssociation.html) for valid values). +* `association_transit_gateway_route_table_id` - The ID of the route table for the transit gateway. * `resource_id` - ID of the resource. * `resource_owner_id` - ID of the AWS account that owns the resource. * `resource_type` - Resource type. @@ -50,5 +52,3 @@ In addition to all arguments above, the following attributes are exported: * `tags` - Key-value tags for the attachment. * `transit_gateway_id` - ID of the transit gateway. * `transit_gateway_owner_id` - The ID of the AWS account that owns the transit gateway. -* `association_state` - The state of the association (see [the underlying AWS API](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_TransitGatewayAttachmentAssociation.html) for valid values). -* `association_transit_gateway_route_table_id` - The ID of the route table for the transit gateway. From 6b2ba3137209f61aef646f47e7d390fa4ea6e1fe Mon Sep 17 00:00:00 2001 From: Justin Retzolk <44710313+justinretzolk@users.noreply.github.com> Date: Thu, 9 Mar 2023 15:05:45 -0600 Subject: [PATCH 584/763] Fix typo in r/aws_eks_cluster --- website/docs/r/eks_cluster.html.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/website/docs/r/eks_cluster.html.markdown b/website/docs/r/eks_cluster.html.markdown index 9a063377be0a..0645882b83c2 100644 --- a/website/docs/r/eks_cluster.html.markdown +++ b/website/docs/r/eks_cluster.html.markdown @@ -46,7 +46,7 @@ output "kubeconfig-certificate-authority-data" { ```terraform data "aws_iam_policy_document" "assume_role" { - satement { + statement { effect = "Allow" principals { From f5b4a93aaa0a7a3561f2643add81e6dcdc6b75b7 Mon Sep 17 00:00:00 2001 From: changelogbot Date: Thu, 9 Mar 2023 21:47:52 +0000 Subject: [PATCH 585/763] Update CHANGELOG.md for #29891 --- CHANGELOG.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index d42353a0d508..ef9a39044b53 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,13 +3,22 @@ FEATURES: * **New Data Source:** `aws_ecs_task_execution` ([#29783](https://github.com/hashicorp/terraform-provider-aws/issues/29783)) +* **New Data Source:** `aws_licensemanager_grants` ([#29741](https://github.com/hashicorp/terraform-provider-aws/issues/29741)) +* **New Data Source:** `aws_licensemanager_received_license` ([#29741](https://github.com/hashicorp/terraform-provider-aws/issues/29741)) +* **New Data Source:** `aws_licensemanager_received_licenses` ([#29741](https://github.com/hashicorp/terraform-provider-aws/issues/29741)) +* **New Resource:** `aws_licensemanager_grant` ([#29741](https://github.com/hashicorp/terraform-provider-aws/issues/29741)) +* **New Resource:** `aws_licensemanager_grant_accepter` ([#29741](https://github.com/hashicorp/terraform-provider-aws/issues/29741)) ENHANCEMENTS: +* data-source/aws_ec2_transit_gateway_attachment: Add `association_state` and `association_transit_gateway_route_table_id` attributes ([#29648](https://github.com/hashicorp/terraform-provider-aws/issues/29648)) +* data-source/aws_instances: Add `ipv6_addresses` attribute ([#29794](https://github.com/hashicorp/terraform-provider-aws/issues/29794)) * resource/aws_acm_certificate: Change `options` to `Computed` ([#29763](https://github.com/hashicorp/terraform-provider-aws/issues/29763)) +* resource/aws_amplify_domain_association: Add `enable_auto_sub_domain` argument ([#92814](https://github.com/hashicorp/terraform-provider-aws/issues/92814)) * resource/aws_cloudhsm_v2_hsm: Enforce `ExactlyOneOf` for `availability_zone` and `subnet_id` arguments ([#20891](https://github.com/hashicorp/terraform-provider-aws/issues/20891)) * resource/aws_db_instance: Add `listener_endpoint` attribute ([#28434](https://github.com/hashicorp/terraform-provider-aws/issues/28434)) * resource/aws_db_instance: Add plan time validations for `backup_retention_period`, `monitoring_interval`, and `monitoring_role_arn` ([#28434](https://github.com/hashicorp/terraform-provider-aws/issues/28434)) +* resource/aws_flow_log: Add `deliver_cross_account_role` argument ([#29254](https://github.com/hashicorp/terraform-provider-aws/issues/29254)) * resource/aws_grafana_workspace: Add `network_access_control` argument ([#29793](https://github.com/hashicorp/terraform-provider-aws/issues/29793)) * resource/aws_sesv2_configuration_set: Add `vdm_options` argument ([#28812](https://github.com/hashicorp/terraform-provider-aws/issues/28812)) * resource/aws_transfer_server: Add `protocol_details` argument ([#28621](https://github.com/hashicorp/terraform-provider-aws/issues/28621)) @@ -21,6 +30,7 @@ BUG FIXES: * resource/aws_acm_certificate: Update `options.certificate_transparency_logging_preference` in place rather than replacing the resource ([#29763](https://github.com/hashicorp/terraform-provider-aws/issues/29763)) * resource/aws_batch_job_definition: Prevents perpetual diff when container properties environment variable has empty value. ([#29820](https://github.com/hashicorp/terraform-provider-aws/issues/29820)) * resource/aws_elastic_beanstalk_configuration_template: Map errors like `InvalidParameterValue: No Platform named '...' found.` to `resource.NotFoundError` so `terraform refesh` correctly removes the resource from state ([#29863](https://github.com/hashicorp/terraform-provider-aws/issues/29863)) +* resource/aws_flow_log: Fix IAM eventual consistency errors on resource Create ([#29254](https://github.com/hashicorp/terraform-provider-aws/issues/29254)) * resource/aws_grafana_workspace: Allow removing `vpc_configuration` ([#29793](https://github.com/hashicorp/terraform-provider-aws/issues/29793)) * resource/aws_medialive_channel: Fix setting of the `include_fec` attribute in `fec_output_settings` ([#29808](https://github.com/hashicorp/terraform-provider-aws/issues/29808)) * resource/aws_medialive_channel: Fix setting of the `video_pid` attribute in `m2ts_settings` ([#29824](https://github.com/hashicorp/terraform-provider-aws/issues/29824)) From 0c65087fb46538844b89bb037bf98a2d199acc71 Mon Sep 17 00:00:00 2001 From: Justin Retzolk <44710313+justinretzolk@users.noreply.github.com> Date: Thu, 9 Mar 2023 15:51:44 -0600 Subject: [PATCH 586/763] Fix typos related to policy rewrite --- website/docs/r/appsync_datasource.html.markdown | 2 +- website/docs/r/iam_policy_attachment.html.markdown | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/website/docs/r/appsync_datasource.html.markdown b/website/docs/r/appsync_datasource.html.markdown index 1148dcf63c84..482343765224 100644 --- a/website/docs/r/appsync_datasource.html.markdown +++ b/website/docs/r/appsync_datasource.html.markdown @@ -53,7 +53,7 @@ data "aws_iam_policy_document" "example" { resource "aws_iam_role_policy" "example" { name = "example" role = aws_iam_role.example.id - policy = data.aws_iam_role_policy.example.json + policy = data.aws_iam_policy_document.example.json } resource "aws_appsync_graphql_api" "example" { diff --git a/website/docs/r/iam_policy_attachment.html.markdown b/website/docs/r/iam_policy_attachment.html.markdown index cf901f02927b..e5414264eb12 100644 --- a/website/docs/r/iam_policy_attachment.html.markdown +++ b/website/docs/r/iam_policy_attachment.html.markdown @@ -56,7 +56,7 @@ data "aws_iam_policy_document" "policy" { resource "aws_iam_policy" "policy" { name = "test-policy" description = "A test policy" - policy = data.aws_iam_policy.policy.json + policy = data.aws_iam_policy_document.policy.json } resource "aws_iam_policy_attachment" "test-attach" { From 3d6307cd1e5a403afa787cdf3acf1d51f11536f6 Mon Sep 17 00:00:00 2001 From: Sharon Nam Date: Tue, 7 Mar 2023 10:57:36 -0800 Subject: [PATCH 587/763] Fix updates on empty env vars in aws_lambda_func Resource wanted to repeatedly apply a change on an empty environment.variables. Now it will check that the variable is not empty before flattening. --- .changelog/29839.txt | 3 ++ internal/service/lambda/function.go | 11 ++++ internal/service/lambda/function_test.go | 64 ++++++++++++++++++++++++ 3 files changed, 78 insertions(+) create mode 100644 .changelog/29839.txt diff --git a/.changelog/29839.txt b/.changelog/29839.txt new file mode 100644 index 000000000000..e4714d7bd466 --- /dev/null +++ b/.changelog/29839.txt @@ -0,0 +1,3 @@ +```release-note:bug +resource/aws_lambda_function: Fix empty environment variable update +``` \ No newline at end of file diff --git a/internal/service/lambda/function.go b/internal/service/lambda/function.go index 18b289e1f6d3..b4447e74b1d0 100644 --- a/internal/service/lambda/function.go +++ b/internal/service/lambda/function.go @@ -112,6 +112,17 @@ func ResourceFunction() *schema.Resource { }, }, }, + // Suppress diff if change is to an empty list + DiffSuppressFunc: func(k, old, new string, d *schema.ResourceData) bool { + if old == "0" && new == "1" { + _, n := d.GetChange("environment.0.variables") + newn, ok := n.(map[string]interface{}) + if ok && len(newn) == 0 { + return true + } + } + return false + }, }, "ephemeral_storage": { Type: schema.TypeList, diff --git a/internal/service/lambda/function_test.go b/internal/service/lambda/function_test.go index 1ce6d7dc7826..cb318759ecde 100644 --- a/internal/service/lambda/function_test.go +++ b/internal/service/lambda/function_test.go @@ -461,6 +461,52 @@ func TestAccLambdaFunction_EnvironmentVariables_noValue(t *testing.T) { }) } +func TestAccLambdaFunction_EnvironmentVariables_emptyUpgrade(t *testing.T) { + ctx := acctest.Context(t) + var conf lambda.GetFunctionOutput + rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) + resourceName := "aws_lambda_function.test" + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { acctest.PreCheck(t) }, + ErrorCheck: acctest.ErrorCheck(t, names.LambdaEndpointID), + CheckDestroy: testAccCheckFunctionDestroy(ctx), + Steps: []resource.TestStep{ + { + ExternalProviders: map[string]resource.ExternalProvider{ + "aws": { + Source: "hashicorp/aws", + VersionConstraint: "4.56.0", + }, + }, + Config: testAccFunctionConfig_EmptyEnv_envVariables(rName), + Check: resource.ComposeTestCheckFunc( + testAccCheckFunctionExists(ctx, resourceName, &conf), + resource.TestCheckResourceAttr(resourceName, "environment.#", "0"), + ), + // We know a persistent diff is present in this version + ExpectNonEmptyPlan: true, + }, + { + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + Config: testAccFunctionConfig_EmptyEnv_envVariables(rName), + ResourceName: resourceName, + // Newer versions of the provider should suppress the diff without requiring an apply + ExpectNonEmptyPlan: false, + PlanOnly: true, + }, + { + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + Config: testAccFunctionConfig_envVariables(rName), + Check: resource.ComposeTestCheckFunc( + testAccCheckFunctionExists(ctx, resourceName, &conf), + resource.TestCheckResourceAttr(resourceName, "environment.0.variables.foo", "bar"), + ), + }, + }, + }) +} + func TestAccLambdaFunction_encryptedEnvVariables(t *testing.T) { ctx := acctest.Context(t) if testing.Short() { @@ -2665,6 +2711,24 @@ resource "aws_lambda_function" "test" { `, rName)) } +func testAccFunctionConfig_EmptyEnv_envVariables(rName string) string { + return acctest.ConfigCompose( + acctest.ConfigLambdaBase(rName, rName, rName), + fmt.Sprintf(` +resource "aws_lambda_function" "test" { + filename = "test-fixtures/lambdatest.zip" + function_name = %[1]q + role = aws_iam_role.iam_for_lambda.arn + handler = "exports.example" + runtime = "nodejs16.x" + + environment { + variables = {} + } +} +`, rName)) +} + func testAccFunctionConfig_envVariablesModified(rName string) string { return acctest.ConfigCompose( acctest.ConfigLambdaBase(rName, rName, rName), From 7814bdadcd282bc73604599d349cf0b97048d626 Mon Sep 17 00:00:00 2001 From: Justin Retzolk <44710313+justinretzolk@users.noreply.github.com> Date: Thu, 9 Mar 2023 16:17:18 -0600 Subject: [PATCH 588/763] Correct r/aws_codebuild_project typo --- website/docs/r/codebuild_project.html.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/website/docs/r/codebuild_project.html.markdown b/website/docs/r/codebuild_project.html.markdown index 345ad439cb6a..cf790d70166a 100755 --- a/website/docs/r/codebuild_project.html.markdown +++ b/website/docs/r/codebuild_project.html.markdown @@ -103,7 +103,7 @@ data "aws_iam_policy_document" "example" { resource "aws_iam_role_policy" "example" { role = aws_iam_role.example.name - policy = data.aws_iam_role_policy.example.json + policy = data.aws_iam_policy_document.example.json } resource "aws_codebuild_project" "example" { From a3bafd92ba0a81b7fddcee1761da8ee83e13d68e Mon Sep 17 00:00:00 2001 From: changelogbot Date: Fri, 10 Mar 2023 01:26:32 +0000 Subject: [PATCH 589/763] Update CHANGELOG.md after v4.58.0 --- CHANGELOG.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ef9a39044b53..9fb5bc4b360f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,5 @@ -## 4.58.0 (Unreleased) +## 4.59.0 (Unreleased) +## 4.58.0 (March 10, 2023) FEATURES: From c0a56e5247d74f3329bc9db4e71c26d81697979c Mon Sep 17 00:00:00 2001 From: Martin Samuels Date: Fri, 10 Mar 2023 12:37:00 +0000 Subject: [PATCH 590/763] docs: update aws_budgets_budget documentation Signed-off-by: Martin Samuels --- website/docs/r/budgets_budget.html.markdown | 62 +++++++++++++++------ 1 file changed, 44 insertions(+), 18 deletions(-) diff --git a/website/docs/r/budgets_budget.html.markdown b/website/docs/r/budgets_budget.html.markdown index 2bb54fbfbfdb..74f455e1c78f 100644 --- a/website/docs/r/budgets_budget.html.markdown +++ b/website/docs/r/budgets_budget.html.markdown @@ -138,6 +138,32 @@ resource "aws_budgets_budget" "ri_utilization" { } ``` +Create a cost_filter using resource tags + +```terraform +resource "aws_budgets_budget" "cost" { + # ... + cost_filter { + name = "TagKeyValue" + values = [ + "TagKey$TagValue", + ] + } +``` + +Create a cost_filter using resource tags, obtaining the tag value from a terraform variable + +```terraform +resource "aws_budgets_budget" "cost" { + # ... + cost_filter { + name = "TagKeyValue" + values = [ + "TagKey${"$"}${var.TagValue}" + ] + } +``` + ## Argument Reference For more detailed documentation about each argument, refer to the [AWS official @@ -201,24 +227,24 @@ Refer to [AWS CostTypes documentation](https://docs.aws.amazon.com/aws-cost-mana ### Cost Filter -Valid name for `cost_filter` parameter vary depending on the `budget_type` value. - -* `cost` - * `AZ` - * `LinkedAccount` - * `Operation` - * `PurchaseType` - * `Service` - * `TagKeyValue` -* `usage` - * `AZ` - * `LinkedAccount` - * `Operation` - * `PurchaseType` - * `UsageType:` - * `TagKeyValue` - -Refer to [AWS CostFilter documentation](http://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/data-type-filter.html) for further detail. +Based on your choice of budget type, you can choose one or more of the available budget filters. + + * `PurchaseType` + * `UsageTypeGroup` + * `Service` + * `Operation` + * `UsageType` + * `BillingEntity` + * `CostCategory` + * `LinkedAccount` + * `TagKeyValue` + * `LegalEntityName` + * `InvoicingEntity` + * `AZ` + * `Region` + * `InstanceType` + +Refer to [AWS CostFilter documentation](https://docs.aws.amazon.com/cost-management/latest/userguide/budgets-create-filters.html) for further detail. ### Cost Filters From 48d1696aff9f9763b68208ec1d3e12649aac6579 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Fri, 10 Mar 2023 08:31:19 -0500 Subject: [PATCH 591/763] r/aws_dx_private_virtual_interface: Document 'sitelink_enabled' argument. --- website/docs/r/dx_private_virtual_interface.html.markdown | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/website/docs/r/dx_private_virtual_interface.html.markdown b/website/docs/r/dx_private_virtual_interface.html.markdown index 8b625c500c66..88c6f85cb044 100644 --- a/website/docs/r/dx_private_virtual_interface.html.markdown +++ b/website/docs/r/dx_private_virtual_interface.html.markdown @@ -33,11 +33,12 @@ The following arguments are supported: * `name` - (Required) The name for the virtual interface. * `vlan` - (Required) The VLAN ID. * `amazon_address` - (Optional) The IPv4 CIDR address to use to send traffic to Amazon. Required for IPv4 BGP peers. -* `mtu` - (Optional) The maximum transmission unit (MTU) is the size, in bytes, of the largest permissible packet that can be passed over the connection. -The MTU of a virtual private interface can be either `1500` or `9001` (jumbo frames). Default is `1500`. * `bgp_auth_key` - (Optional) The authentication key for BGP configuration. * `customer_address` - (Optional) The IPv4 CIDR destination address to which Amazon should send traffic. Required for IPv4 BGP peers. * `dx_gateway_id` - (Optional) The ID of the Direct Connect gateway to which to connect the virtual interface. +* `mtu` - (Optional) The maximum transmission unit (MTU) is the size, in bytes, of the largest permissible packet that can be passed over the connection. +The MTU of a virtual private interface can be either `1500` or `9001` (jumbo frames). Default is `1500`. +* `sitelink_enabled` - (Optional) Indicates whether to enable or disable SiteLink. * `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. * `vpn_gateway_id` - (Optional) The ID of the [virtual private gateway](vpn_gateway.html) to which to connect the virtual interface. @@ -46,9 +47,9 @@ The MTU of a virtual private interface can be either `1500` or `9001` (jumbo fra In addition to all arguments above, the following attributes are exported: * `id` - The ID of the virtual interface. +* `aws_device` - The Direct Connect endpoint on which the virtual interface terminates. * `arn` - The ARN of the virtual interface. * `jumbo_frame_capable` - Indicates whether jumbo frames (9001 MTU) are supported. -* `aws_device` - The Direct Connect endpoint on which the virtual interface terminates. * `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). ## Timeouts From 631a6872de614546f4e6031261c4add6139b3610 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Fri, 10 Mar 2023 08:32:45 -0500 Subject: [PATCH 592/763] r/aws_dx_transit_virtual_interface: Document 'sitelink_enabled' argument. --- website/docs/r/dx_transit_virtual_interface.html.markdown | 1 + 1 file changed, 1 insertion(+) diff --git a/website/docs/r/dx_transit_virtual_interface.html.markdown b/website/docs/r/dx_transit_virtual_interface.html.markdown index eaa3f185f30f..56646a775ec7 100644 --- a/website/docs/r/dx_transit_virtual_interface.html.markdown +++ b/website/docs/r/dx_transit_virtual_interface.html.markdown @@ -45,6 +45,7 @@ The following arguments are supported: * `customer_address` - (Optional) The IPv4 CIDR destination address to which Amazon should send traffic. Required for IPv4 BGP peers. * `mtu` - (Optional) The maximum transmission unit (MTU) is the size, in bytes, of the largest permissible packet that can be passed over the connection. The MTU of a virtual transit interface can be either `1500` or `8500` (jumbo frames). Default is `1500`. +* `sitelink_enabled` - (Optional) Indicates whether to enable or disable SiteLink. * `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. ## Attributes Reference From fe71686191fa811cadbc5798ae5bee41a4cd8ad6 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Fri, 10 Mar 2023 08:35:23 -0500 Subject: [PATCH 593/763] Update dx_private_virtual_interface.html.markdown --- website/docs/r/dx_private_virtual_interface.html.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/website/docs/r/dx_private_virtual_interface.html.markdown b/website/docs/r/dx_private_virtual_interface.html.markdown index 88c6f85cb044..80ce5d6279ca 100644 --- a/website/docs/r/dx_private_virtual_interface.html.markdown +++ b/website/docs/r/dx_private_virtual_interface.html.markdown @@ -47,8 +47,8 @@ The MTU of a virtual private interface can be either `1500` or `9001` (jumbo fra In addition to all arguments above, the following attributes are exported: * `id` - The ID of the virtual interface. -* `aws_device` - The Direct Connect endpoint on which the virtual interface terminates. * `arn` - The ARN of the virtual interface. +* `aws_device` - The Direct Connect endpoint on which the virtual interface terminates. * `jumbo_frame_capable` - Indicates whether jumbo frames (9001 MTU) are supported. * `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). From 56a197b50e5cac20c89f9e0509928237175eafbf Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 10 Mar 2023 08:59:53 -0500 Subject: [PATCH 594/763] build(deps): bump github.com/aws/aws-sdk-go-v2/service/sesv2 (#29901) Bumps [github.com/aws/aws-sdk-go-v2/service/sesv2](https://github.com/aws/aws-sdk-go-v2) from 1.16.4 to 1.17.0. - [Release notes](https://github.com/aws/aws-sdk-go-v2/releases) - [Changelog](https://github.com/aws/aws-sdk-go-v2/blob/main/CHANGELOG.md) - [Commits](https://github.com/aws/aws-sdk-go-v2/compare/v1.16.4...v1.17.0) --- updated-dependencies: - dependency-name: github.com/aws/aws-sdk-go-v2/service/sesv2 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 41d4d96643ce..11908c91ea43 100644 --- a/go.mod +++ b/go.mod @@ -30,7 +30,7 @@ require ( github.com/aws/aws-sdk-go-v2/service/route53domains v1.14.4 github.com/aws/aws-sdk-go-v2/service/s3control v1.29.4 github.com/aws/aws-sdk-go-v2/service/scheduler v1.1.4 - github.com/aws/aws-sdk-go-v2/service/sesv2 v1.16.4 + github.com/aws/aws-sdk-go-v2/service/sesv2 v1.17.0 github.com/aws/aws-sdk-go-v2/service/ssm v1.35.5 github.com/aws/aws-sdk-go-v2/service/ssmcontacts v1.14.4 github.com/aws/aws-sdk-go-v2/service/ssmincidents v1.20.4 diff --git a/go.sum b/go.sum index c1718c9ffd65..b541669dd9a8 100644 --- a/go.sum +++ b/go.sum @@ -96,8 +96,8 @@ github.com/aws/aws-sdk-go-v2/service/s3control v1.29.4 h1:2FnFwA3DaXibWS3gMk9/hf github.com/aws/aws-sdk-go-v2/service/s3control v1.29.4/go.mod h1:7N/XbfABmShA4NEeFRhn9itmFk/E3DZ9im/+1++XnCY= github.com/aws/aws-sdk-go-v2/service/scheduler v1.1.4 h1:LfCy6abbOMk2O6OdxFiMvySEMMYXyA4wLTZZzoyDU14= github.com/aws/aws-sdk-go-v2/service/scheduler v1.1.4/go.mod h1:l7ebY4UfyEXzsM+yh74U1yTsZ4c8OZZd8de4aY0G19U= -github.com/aws/aws-sdk-go-v2/service/sesv2 v1.16.4 h1:2bikS7i3POwibqKLlkyZBYKsdTWtFMT20QTHasMEMB4= -github.com/aws/aws-sdk-go-v2/service/sesv2 v1.16.4/go.mod h1:uIM2GAheOB6xz7UuG5By72Zw2B/20fViFsbDY1JVTVY= +github.com/aws/aws-sdk-go-v2/service/sesv2 v1.17.0 h1:0HyUGJ3DCaXmOPFkCYhvi8aDA4WOsZ42mq4GnTGSlmA= +github.com/aws/aws-sdk-go-v2/service/sesv2 v1.17.0/go.mod h1:uIM2GAheOB6xz7UuG5By72Zw2B/20fViFsbDY1JVTVY= github.com/aws/aws-sdk-go-v2/service/ssm v1.35.5 h1:x7FjoHx8A559fAHi0WMnrVxxk9iXwyj1UK5S7TrqFAM= github.com/aws/aws-sdk-go-v2/service/ssm v1.35.5/go.mod h1:DlzAqaXaUSJVQGuZrGPb4TWTkDG6vUs5OiIoX0AxjkU= github.com/aws/aws-sdk-go-v2/service/ssmcontacts v1.14.4 h1:IzV/IHEKeM0taWRbFuHU8onhj7R088VzYau7Ka2jDsw= From caa7596c3102222eaf34e31c20242d49dbab4a0f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 10 Mar 2023 09:00:48 -0500 Subject: [PATCH 595/763] build(deps): bump github.com/aws/aws-sdk-go in /.ci/providerlint (#29902) Bumps [github.com/aws/aws-sdk-go](https://github.com/aws/aws-sdk-go) from 1.44.216 to 1.44.218. - [Release notes](https://github.com/aws/aws-sdk-go/releases) - [Commits](https://github.com/aws/aws-sdk-go/compare/v1.44.216...v1.44.218) --- updated-dependencies: - dependency-name: github.com/aws/aws-sdk-go dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .ci/providerlint/go.mod | 2 +- .ci/providerlint/go.sum | 4 +- .../aws/aws-sdk-go/aws/endpoints/defaults.go | 133 ++++++++++++++++++ .ci/providerlint/vendor/modules.txt | 2 +- 4 files changed, 137 insertions(+), 4 deletions(-) diff --git a/.ci/providerlint/go.mod b/.ci/providerlint/go.mod index 2efe5181cfb9..e2e103d5bad7 100644 --- a/.ci/providerlint/go.mod +++ b/.ci/providerlint/go.mod @@ -3,7 +3,7 @@ module github.com/hashicorp/terraform-provider-aws/ci/providerlint go 1.19 require ( - github.com/aws/aws-sdk-go v1.44.216 + github.com/aws/aws-sdk-go v1.44.218 github.com/bflad/tfproviderlint v0.28.1 github.com/hashicorp/terraform-plugin-sdk/v2 v2.25.0 golang.org/x/tools v0.1.12 diff --git a/.ci/providerlint/go.sum b/.ci/providerlint/go.sum index 83bffc8274d1..c1838df19626 100644 --- a/.ci/providerlint/go.sum +++ b/.ci/providerlint/go.sum @@ -65,8 +65,8 @@ github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5/go.mod h1:wHh0iHkY github.com/aws/aws-sdk-go v1.15.78/go.mod h1:E3/ieXAlvM0XWO57iftYVDLLvQ824smPP3ATZkfNZeM= github.com/aws/aws-sdk-go v1.25.3/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo= github.com/aws/aws-sdk-go v1.37.0/go.mod h1:hcU610XS61/+aQV88ixoOzUoG7v3b31pl2zKMmprdro= -github.com/aws/aws-sdk-go v1.44.216 h1:nDL5hEGBlUNHXMWbpP4dIyP8IB5tvRgksWE7biVu8JY= -github.com/aws/aws-sdk-go v1.44.216/go.mod h1:aVsgQcEevwlmQ7qHE9I3h+dtQgpqhFB+i8Phjh7fkwI= +github.com/aws/aws-sdk-go v1.44.218 h1:p707+xOCazWhkSpZOeyhtTcg7Z+asxxvueGgYPSitn4= +github.com/aws/aws-sdk-go v1.44.218/go.mod h1:aVsgQcEevwlmQ7qHE9I3h+dtQgpqhFB+i8Phjh7fkwI= github.com/bflad/gopaniccheck v0.1.0 h1:tJftp+bv42ouERmUMWLoUn/5bi/iQZjHPznM00cP/bU= github.com/bflad/gopaniccheck v0.1.0/go.mod h1:ZCj2vSr7EqVeDaqVsWN4n2MwdROx1YL+LFo47TSWtsA= github.com/bflad/tfproviderlint v0.28.1 h1:7f54/ynV6/lK5/1EyG7tHtc4sMdjJSEFGjZNRJKwBs8= diff --git a/.ci/providerlint/vendor/github.com/aws/aws-sdk-go/aws/endpoints/defaults.go b/.ci/providerlint/vendor/github.com/aws/aws-sdk-go/aws/endpoints/defaults.go index 7d9fccd3af97..1b68cbb78648 100644 --- a/.ci/providerlint/vendor/github.com/aws/aws-sdk-go/aws/endpoints/defaults.go +++ b/.ci/providerlint/vendor/github.com/aws/aws-sdk-go/aws/endpoints/defaults.go @@ -13331,16 +13331,51 @@ var awsPartition = partition{ }, }, Endpoints: serviceEndpoints{ + endpointKey{ + Region: "af-south-1", + }: endpoint{ + Hostname: "internetmonitor.af-south-1.api.aws", + }, + endpointKey{ + Region: "ap-east-1", + }: endpoint{ + Hostname: "internetmonitor.ap-east-1.api.aws", + }, + endpointKey{ + Region: "ap-northeast-1", + }: endpoint{ + Hostname: "internetmonitor.ap-northeast-1.api.aws", + }, + endpointKey{ + Region: "ap-northeast-2", + }: endpoint{ + Hostname: "internetmonitor.ap-northeast-2.api.aws", + }, endpointKey{ Region: "ap-northeast-3", }: endpoint{ Hostname: "internetmonitor.ap-northeast-3.api.aws", }, + endpointKey{ + Region: "ap-south-1", + }: endpoint{ + Hostname: "internetmonitor.ap-south-1.api.aws", + }, endpointKey{ Region: "ap-south-2", }: endpoint{ Hostname: "internetmonitor.ap-south-2.api.aws", }, + endpointKey{ + Region: "ap-southeast-1", + }: endpoint{ + Hostname: "internetmonitor.ap-southeast-1.api.aws", + }, + endpointKey{ + Region: "ap-southeast-2", + }: endpoint{ + Hostname: "internetmonitor.ap-southeast-2.api.aws", + }, endpointKey{ Region: "ap-southeast-3", }: endpoint{ @@ -13351,21 +13386,86 @@ var awsPartition = partition{ }: endpoint{ Hostname: "internetmonitor.ap-southeast-4.api.aws", }, + endpointKey{ + Region: "ca-central-1", + }: endpoint{ + Hostname: "internetmonitor.ca-central-1.api.aws", + }, + endpointKey{ + Region: "eu-central-1", + }: endpoint{ + Hostname: "internetmonitor.eu-central-1.api.aws", + }, endpointKey{ Region: "eu-central-2", }: endpoint{ Hostname: "internetmonitor.eu-central-2.api.aws", }, + endpointKey{ + Region: "eu-north-1", + }: endpoint{ + Hostname: "internetmonitor.eu-north-1.api.aws", + }, + endpointKey{ + Region: "eu-south-1", + }: endpoint{ + Hostname: "internetmonitor.eu-south-1.api.aws", + }, endpointKey{ Region: "eu-south-2", }: endpoint{ Hostname: "internetmonitor.eu-south-2.api.aws", }, + endpointKey{ + Region: "eu-west-1", + }: endpoint{ + Hostname: "internetmonitor.eu-west-1.api.aws", + }, + endpointKey{ + Region: "eu-west-2", + }: endpoint{ + Hostname: "internetmonitor.eu-west-2.api.aws", + }, + endpointKey{ + Region: "eu-west-3", + }: endpoint{ + Hostname: "internetmonitor.eu-west-3.api.aws", + }, endpointKey{ Region: "me-central-1", }: endpoint{ Hostname: "internetmonitor.me-central-1.api.aws", }, + endpointKey{ + Region: "me-south-1", + }: endpoint{ + Hostname: "internetmonitor.me-south-1.api.aws", + }, + endpointKey{ + Region: "sa-east-1", + }: endpoint{ + Hostname: "internetmonitor.sa-east-1.api.aws", + }, + endpointKey{ + Region: "us-east-1", + }: endpoint{ + Hostname: "internetmonitor.us-east-1.api.aws", + }, + endpointKey{ + Region: "us-east-2", + }: endpoint{ + Hostname: "internetmonitor.us-east-2.api.aws", + }, + endpointKey{ + Region: "us-west-1", + }: endpoint{ + Hostname: "internetmonitor.us-west-1.api.aws", + }, + endpointKey{ + Region: "us-west-2", + }: endpoint{ + Hostname: "internetmonitor.us-west-2.api.aws", + }, }, }, "iot": service{ @@ -20756,6 +20856,9 @@ var awsPartition = partition{ endpointKey{ Region: "ap-southeast-2", }: endpoint{}, + endpointKey{ + Region: "ca-central-1", + }: endpoint{}, endpointKey{ Region: "eu-central-1", }: endpoint{}, @@ -20768,12 +20871,18 @@ var awsPartition = partition{ endpointKey{ Region: "eu-west-2", }: endpoint{}, + endpointKey{ + Region: "eu-west-3", + }: endpoint{}, endpointKey{ Region: "us-east-1", }: endpoint{}, endpointKey{ Region: "us-east-2", }: endpoint{}, + endpointKey{ + Region: "us-west-1", + }: endpoint{}, endpointKey{ Region: "us-west-2", }: endpoint{}, @@ -35352,21 +35461,45 @@ var awsusgovPartition = partition{ Endpoints: serviceEndpoints{ endpointKey{ Region: "us-gov-east-1", + }: endpoint{ + Protocols: []string{"https"}, + }, + endpointKey{ + Region: "us-gov-east-1", + Variant: fipsVariant, }: endpoint{ Hostname: "serverlessrepo.us-gov-east-1.amazonaws.com", Protocols: []string{"https"}, + }, + endpointKey{ + Region: "us-gov-east-1-fips", + }: endpoint{ + Hostname: "serverlessrepo.us-gov-east-1.amazonaws.com", CredentialScope: credentialScope{ Region: "us-gov-east-1", }, + Deprecated: boxedTrue, }, endpointKey{ Region: "us-gov-west-1", + }: endpoint{ + Protocols: []string{"https"}, + }, + endpointKey{ + Region: "us-gov-west-1", + Variant: fipsVariant, }: endpoint{ Hostname: "serverlessrepo.us-gov-west-1.amazonaws.com", Protocols: []string{"https"}, + }, + endpointKey{ + Region: "us-gov-west-1-fips", + }: endpoint{ + Hostname: "serverlessrepo.us-gov-west-1.amazonaws.com", CredentialScope: credentialScope{ Region: "us-gov-west-1", }, + Deprecated: boxedTrue, }, }, }, diff --git a/.ci/providerlint/vendor/modules.txt b/.ci/providerlint/vendor/modules.txt index cd5537e5e598..fe097891a1ae 100644 --- a/.ci/providerlint/vendor/modules.txt +++ b/.ci/providerlint/vendor/modules.txt @@ -4,7 +4,7 @@ github.com/agext/levenshtein # github.com/apparentlymart/go-textseg/v13 v13.0.0 ## explicit; go 1.16 github.com/apparentlymart/go-textseg/v13/textseg -# github.com/aws/aws-sdk-go v1.44.216 +# github.com/aws/aws-sdk-go v1.44.218 ## explicit; go 1.11 github.com/aws/aws-sdk-go/aws/awserr github.com/aws/aws-sdk-go/aws/endpoints From e17aa415495b08e35c7189c73f0981384a78436a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 10 Mar 2023 09:02:49 -0500 Subject: [PATCH 596/763] build(deps): bump github.com/aws/aws-sdk-go-v2/service/ec2 (#29880) Bumps [github.com/aws/aws-sdk-go-v2/service/ec2](https://github.com/aws/aws-sdk-go-v2) from 1.88.0 to 1.89.0. - [Release notes](https://github.com/aws/aws-sdk-go-v2/releases) - [Changelog](https://github.com/aws/aws-sdk-go-v2/blob/main/CHANGELOG.md) - [Commits](https://github.com/aws/aws-sdk-go-v2/compare/service/ec2/v1.88.0...service/ec2/v1.89.0) --- updated-dependencies: - dependency-name: github.com/aws/aws-sdk-go-v2/service/ec2 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 11908c91ea43..a8e9e45f7269 100644 --- a/go.mod +++ b/go.mod @@ -12,7 +12,7 @@ require ( github.com/aws/aws-sdk-go-v2/service/cloudwatchlogs v1.20.5 github.com/aws/aws-sdk-go-v2/service/comprehend v1.22.0 github.com/aws/aws-sdk-go-v2/service/computeoptimizer v1.21.3 - github.com/aws/aws-sdk-go-v2/service/ec2 v1.88.0 + github.com/aws/aws-sdk-go-v2/service/ec2 v1.89.0 github.com/aws/aws-sdk-go-v2/service/fis v1.14.4 github.com/aws/aws-sdk-go-v2/service/healthlake v1.15.4 github.com/aws/aws-sdk-go-v2/service/identitystore v1.16.4 diff --git a/go.sum b/go.sum index b541669dd9a8..b48c6290529f 100644 --- a/go.sum +++ b/go.sum @@ -53,8 +53,8 @@ github.com/aws/aws-sdk-go-v2/service/comprehend v1.22.0 h1:HfIi9A8XYph6xwnoevrO9 github.com/aws/aws-sdk-go-v2/service/comprehend v1.22.0/go.mod h1:wR/O51vYY5XCt2FzuaSgvHV36BozkKxKWW4NoDIXrlc= github.com/aws/aws-sdk-go-v2/service/computeoptimizer v1.21.3 h1:JkWxBPjWWDKjVWjBoiIw9zbMA72Ynde66y5fInm9Q/g= github.com/aws/aws-sdk-go-v2/service/computeoptimizer v1.21.3/go.mod h1:U4bKXeB586zd73RIAkJX+ZmUtwI00xLJhDKJ7+hTCO0= -github.com/aws/aws-sdk-go-v2/service/ec2 v1.88.0 h1:YVxTUKCZqTzp2bT/ctafMOf/36TYKlk+Zio9kuHYxXU= -github.com/aws/aws-sdk-go-v2/service/ec2 v1.88.0/go.mod h1:2HxUY7Pkfmt1uIhPrFp0/O6+0aGoLaGIN5tXp/rYDL8= +github.com/aws/aws-sdk-go-v2/service/ec2 v1.89.0 h1:f/mZ9YbM+c429V/3ghExrw9bpM4kRzmjyNui7bnRkaE= +github.com/aws/aws-sdk-go-v2/service/ec2 v1.89.0/go.mod h1:2HxUY7Pkfmt1uIhPrFp0/O6+0aGoLaGIN5tXp/rYDL8= github.com/aws/aws-sdk-go-v2/service/fis v1.14.4 h1:YHeT7fN7oQY7wUzOwZv4gfzULrrojjbFq9vipBUvFgE= github.com/aws/aws-sdk-go-v2/service/fis v1.14.4/go.mod h1:IQGhkhTVkQE+/bVqKbLpipbH9H935C05Z0/z6k7eVPQ= github.com/aws/aws-sdk-go-v2/service/healthlake v1.15.4 h1:VFI+riYGn52qqqU8hbCgOhYkVz7ZDjKJ1HN4vsaqkdE= From b63e3cdcfc6e284a91bcdd2b9a95f70b4279cfa8 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 10 Mar 2023 14:05:48 +0000 Subject: [PATCH 597/763] build(deps): bump github.com/aws/aws-sdk-go from 1.44.216 to 1.44.218 Bumps [github.com/aws/aws-sdk-go](https://github.com/aws/aws-sdk-go) from 1.44.216 to 1.44.218. - [Release notes](https://github.com/aws/aws-sdk-go/releases) - [Commits](https://github.com/aws/aws-sdk-go/compare/v1.44.216...v1.44.218) --- updated-dependencies: - dependency-name: github.com/aws/aws-sdk-go dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index a8e9e45f7269..5705163eb1cf 100644 --- a/go.mod +++ b/go.mod @@ -4,7 +4,7 @@ go 1.19 require ( github.com/ProtonMail/go-crypto v0.0.0-20230201104953-d1d05f4e2bfb - github.com/aws/aws-sdk-go v1.44.216 + github.com/aws/aws-sdk-go v1.44.218 github.com/aws/aws-sdk-go-v2 v1.17.5 github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.12.23 github.com/aws/aws-sdk-go-v2/service/auditmanager v1.24.1 diff --git a/go.sum b/go.sum index b48c6290529f..54246b612cc0 100644 --- a/go.sum +++ b/go.sum @@ -23,8 +23,8 @@ github.com/apparentlymart/go-textseg/v13 v13.0.0/go.mod h1:ZK2fH7c4NqDTLtiYLvIkE github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310 h1:BUAU3CGlLvorLI26FmByPp2eC2qla6E1Tw+scpcg/to= github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5/go.mod h1:wHh0iHkYZB8zMSxRWpUBQtwG5a7fFgvEO+odwuTv2gs= -github.com/aws/aws-sdk-go v1.44.216 h1:nDL5hEGBlUNHXMWbpP4dIyP8IB5tvRgksWE7biVu8JY= -github.com/aws/aws-sdk-go v1.44.216/go.mod h1:aVsgQcEevwlmQ7qHE9I3h+dtQgpqhFB+i8Phjh7fkwI= +github.com/aws/aws-sdk-go v1.44.218 h1:p707+xOCazWhkSpZOeyhtTcg7Z+asxxvueGgYPSitn4= +github.com/aws/aws-sdk-go v1.44.218/go.mod h1:aVsgQcEevwlmQ7qHE9I3h+dtQgpqhFB+i8Phjh7fkwI= github.com/aws/aws-sdk-go-v2 v1.17.4/go.mod h1:uzbQtefpm44goOPmdKyAlXSNcwlRgF3ePWVW6EtJvvw= github.com/aws/aws-sdk-go-v2 v1.17.5 h1:TzCUW1Nq4H8Xscph5M/skINUitxM5UBAyvm2s7XBzL4= github.com/aws/aws-sdk-go-v2 v1.17.5/go.mod h1:uzbQtefpm44goOPmdKyAlXSNcwlRgF3ePWVW6EtJvvw= From 6bcf1c039fcf1ba021730b05b9568b51031e1934 Mon Sep 17 00:00:00 2001 From: Daniel Cotton <31445918+danielcotton@users.noreply.github.com> Date: Fri, 10 Mar 2023 20:47:29 +1030 Subject: [PATCH 598/763] Fix aws_lightsail_instance name validation --- .changelog/29903.txt | 3 +++ internal/service/lightsail/instance.go | 2 +- internal/service/lightsail/instance_test.go | 25 +++++++++++++++------ 3 files changed, 22 insertions(+), 8 deletions(-) create mode 100644 .changelog/29903.txt diff --git a/.changelog/29903.txt b/.changelog/29903.txt new file mode 100644 index 000000000000..f45372464045 --- /dev/null +++ b/.changelog/29903.txt @@ -0,0 +1,3 @@ +```release-note:bug +resource/aws_lightsail_instance: Fix `name` validation to allow instances to start with a numeric character +``` diff --git a/internal/service/lightsail/instance.go b/internal/service/lightsail/instance.go index d9d3e78b1882..3c87228cb090 100644 --- a/internal/service/lightsail/instance.go +++ b/internal/service/lightsail/instance.go @@ -62,7 +62,7 @@ func ResourceInstance() *schema.Resource { ForceNew: true, ValidateFunc: validation.All( validation.StringLenBetween(2, 255), - validation.StringMatch(regexp.MustCompile(`^[a-zA-Z]`), "must begin with an alphabetic character"), + validation.StringMatch(regexp.MustCompile(`^[a-zA-Z0-9]`), "must begin with an alphanumeric character"), validation.StringMatch(regexp.MustCompile(`^[a-zA-Z0-9_\-.]+[^._\-]$`), "must contain only alphanumeric characters, underscores, hyphens, and dots"), ), }, diff --git a/internal/service/lightsail/instance_test.go b/internal/service/lightsail/instance_test.go index ea2d09577fd7..5aadfc94b143 100644 --- a/internal/service/lightsail/instance_test.go +++ b/internal/service/lightsail/instance_test.go @@ -58,6 +58,7 @@ func TestAccLightsailInstance_name(t *testing.T) { resourceName := "aws_lightsail_instance.test" rNameWithSpaces := fmt.Sprint(rName, "string with spaces") rNameWithStartingDigit := fmt.Sprintf("01-%s", rName) + rNameWithStartingHyphen := fmt.Sprintf("-%s", rName) rNameWithUnderscore := fmt.Sprintf("%s_123456", rName) resource.ParallelTest(t, resource.TestCase{ @@ -75,8 +76,18 @@ func TestAccLightsailInstance_name(t *testing.T) { ExpectError: regexp.MustCompile(`must contain only alphanumeric characters, underscores, hyphens, and dots`), }, { - Config: testAccInstanceConfig_basic(rNameWithStartingDigit), - ExpectError: regexp.MustCompile(`must begin with an alphabetic character`), + Config: testAccInstanceConfig_basic(rNameWithStartingHyphen), + ExpectError: regexp.MustCompile(`must begin with an alphanumeric character`), + }, + { + Config: testAccInstanceConfig_basic(rNameWithStartingDigit), + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheckInstanceExists(ctx, resourceName), + resource.TestCheckResourceAttrSet(resourceName, "availability_zone"), + resource.TestCheckResourceAttrSet(resourceName, "blueprint_id"), + resource.TestCheckResourceAttrSet(resourceName, "bundle_id"), + resource.TestCheckResourceAttrSet(resourceName, "key_pair_name"), + ), }, { Config: testAccInstanceConfig_basic(rName), @@ -367,7 +378,7 @@ func testAccInstanceConfig_basic(rName string) string { resource "aws_lightsail_instance" "test" { name = "%s" availability_zone = data.aws_availability_zones.available.names[0] - blueprint_id = "amazon_linux" + blueprint_id = "amazon_linux_2" bundle_id = "nano_1_0" } `, rName)) @@ -380,7 +391,7 @@ func testAccInstanceConfig_tags1(rName string) string { resource "aws_lightsail_instance" "test" { name = "%s" availability_zone = data.aws_availability_zones.available.names[0] - blueprint_id = "amazon_linux" + blueprint_id = "amazon_linux_2" bundle_id = "nano_1_0" tags = { @@ -398,7 +409,7 @@ func testAccInstanceConfig_tags2(rName string) string { resource "aws_lightsail_instance" "test" { name = "%s" availability_zone = data.aws_availability_zones.available.names[0] - blueprint_id = "amazon_linux" + blueprint_id = "amazon_linux_2" bundle_id = "nano_1_0" tags = { @@ -417,7 +428,7 @@ func testAccInstanceConfig_IPAddressType(rName string, rIPAddressType string) st resource "aws_lightsail_instance" "test" { name = %[1]q availability_zone = data.aws_availability_zones.available.names[0] - blueprint_id = "amazon_linux" + blueprint_id = "amazon_linux_2" bundle_id = "nano_1_0" ip_address_type = %[2]q } @@ -431,7 +442,7 @@ func testAccInstanceConfig_addOn(rName string, snapshotTime string, status strin resource "aws_lightsail_instance" "test" { name = %[1]q availability_zone = data.aws_availability_zones.available.names[0] - blueprint_id = "amazon_linux" + blueprint_id = "amazon_linux_2" bundle_id = "nano_1_0" add_on { type = "AutoSnapshot" From 11d5322451988d0cc6a1241767f759599738989b Mon Sep 17 00:00:00 2001 From: Asteao Date: Fri, 10 Mar 2023 06:33:44 -0800 Subject: [PATCH 599/763] [Docs]: Code Example for aws_sesv2_email_identity (BYODKIM) is misleading (#29730) * Update sesv2_email_identity.html.markdown Taken from https://docs.aws.amazon.com/ses/latest/dg/send-email-authentication-dkim-bring-your-own.html * Update sesv2_email_identity.html.markdown * Update sesv2_email_identity.html.markdown --- website/docs/r/sesv2_email_identity.html.markdown | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/website/docs/r/sesv2_email_identity.html.markdown b/website/docs/r/sesv2_email_identity.html.markdown index 67ff2e0fb3a1..c40c28fef7c4 100644 --- a/website/docs/r/sesv2_email_identity.html.markdown +++ b/website/docs/r/sesv2_email_identity.html.markdown @@ -46,15 +46,11 @@ resource "aws_sesv2_email_identity" "example" { #### DKIM Signing Attributes (BYODKIM) ```terraform -resource "tls_private_key" "example" { - algorithm = "RSA" -} - resource "aws_sesv2_email_identity" "example" { email_identity = "example.com" dkim_signing_attributes { - domain_signing_private_key = base64encode(tls_private_key.example.private_key_pem) + domain_signing_private_key = "MIIJKAIBAAKCAgEA2Se7p8zvnI4yh+Gh9j2rG5e2aRXjg03Y8saiupLnadPH9xvM..." #PEM private key without headers or newline characters domain_signing_selector = "example" } } @@ -71,6 +67,9 @@ The following arguments are supported: ### dkim_signing_attributes * `domain_signing_private_key` - (Optional) [Bring Your Own DKIM] A private key that's used to generate a DKIM signature. The private key must use 1024 or 2048-bit RSA encryption, and must be encoded using base64 encoding. + +-> **NOTE:** You have to delete the first and last lines ('-----BEGIN PRIVATE KEY-----' and '-----END PRIVATE KEY-----', respectively) of the generated private key. Additionally, you have to remove the line breaks in the generated private key. The resulting value is a string of characters with no spaces or line breaks. + * `domain_signing_selector` - (Optional) [Bring Your Own DKIM] A string that's used to identify a public key in the DNS configuration for a domain. * `next_signing_key_length` - (Optional) [Easy DKIM] The key length of the future DKIM key pair to be generated. This can be changed at most once per day. Valid values: `RSA_1024_BIT`, `RSA_2048_BIT`. From 9950f1ef031b7b920dfb855aa1bb5c429571f968 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Fri, 10 Mar 2023 10:20:01 -0500 Subject: [PATCH 600/763] Tweak CHANGELOG entry. --- .changelog/29735.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.changelog/29735.txt b/.changelog/29735.txt index d2a9223f1236..b35971db283c 100644 --- a/.changelog/29735.txt +++ b/.changelog/29735.txt @@ -1,3 +1,3 @@ ```release-note:bug -resource/aws_apigatewayv2_integration: Fix ConflictException: Unable to complete operation due to concurrent modification. +resource/aws_apigatewayv2_integration: Retry errors like `ConflictException: Unable to complete operation due to concurrent modification. Please try again later.` ``` From 5aed50fda59852f10ee90edfea9bd5570f146c77 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Fri, 10 Mar 2023 10:23:30 -0500 Subject: [PATCH 601/763] Cosmetics. --- internal/conns/config.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/internal/conns/config.go b/internal/conns/config.go index f4d5f7b07c7e..f19857d8a70a 100644 --- a/internal/conns/config.go +++ b/internal/conns/config.go @@ -267,8 +267,7 @@ func (c *Config) ConfigureProvider(ctx context.Context, client *AWSClient) (*AWS r.Retryable = aws.Bool(true) } }) - - //Potential fix for https://github.com/hashicorp/terraform-provider-aws/issues/18018 + client.apigatewayv2Conn.Handlers.Retry.PushBack(func(r *request.Request) { // Many operations can return an error such as: // ConflictException: Unable to complete operation due to concurrent modification. Please try again later. From 35d809159325952aaa7e492077879232795efcaf Mon Sep 17 00:00:00 2001 From: luca-pasquali <40779586+luca-pasquali@users.noreply.github.com> Date: Sat, 11 Mar 2023 02:30:08 +1100 Subject: [PATCH 602/763] Update instance_arn for aws_ssoadmin_permission_set_inline_policy (#29698) * update instance_arn for aws_ssoadmin_permission_set_inline_policy * add changelog entry * remove CHANGELOG --------- Co-authored-by: Adrian Johnson --- .../docs/r/ssoadmin_permission_set_inline_policy.html.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/website/docs/r/ssoadmin_permission_set_inline_policy.html.markdown b/website/docs/r/ssoadmin_permission_set_inline_policy.html.markdown index d657e5496221..3b347582328b 100644 --- a/website/docs/r/ssoadmin_permission_set_inline_policy.html.markdown +++ b/website/docs/r/ssoadmin_permission_set_inline_policy.html.markdown @@ -40,7 +40,7 @@ data "aws_iam_policy_document" "example" { resource "aws_ssoadmin_permission_set_inline_policy" "example" { inline_policy = data.aws_iam_policy_document.example.json - instance_arn = aws_ssoadmin_permission_set.example.instance_arn + instance_arn = tolist(data.aws_ssoadmin_instances.example.arns)[0] permission_set_arn = aws_ssoadmin_permission_set.example.arn } ``` From ac1afefac3d6c7b6b30ccd5e310c98360d92570d Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Fri, 10 Mar 2023 10:41:54 -0500 Subject: [PATCH 603/763] Cosmetics. --- .changelog/29566.txt | 2 +- internal/service/glue/crawler.go | 444 +++++++++++++------------- internal/service/glue/crawler_test.go | 6 +- 3 files changed, 228 insertions(+), 224 deletions(-) diff --git a/.changelog/29566.txt b/.changelog/29566.txt index 67cd1710d7a0..57afe4ba759f 100644 --- a/.changelog/29566.txt +++ b/.changelog/29566.txt @@ -1,3 +1,3 @@ ```release-note:enhancement -resource/aws_glue_crawler: Add create_native_delta_table argument to delta_target block +resource/aws_glue_crawler: Add `create_native_delta_table` attribute to the `delta_target` configuration block ``` \ No newline at end of file diff --git a/internal/service/glue/crawler.go b/internal/service/glue/crawler.go index 454911204d78..413e140d37ca 100644 --- a/internal/service/glue/crawler.go +++ b/internal/service/glue/crawler.go @@ -35,6 +35,7 @@ func ResourceCrawler() *schema.Resource { ReadWithoutTimeout: resourceCrawlerRead, UpdateWithoutTimeout: resourceCrawlerUpdate, DeleteWithoutTimeout: resourceCrawlerDelete, + Importer: &schema.ResourceImporter{ StateContext: schema.ImportStatePassthroughContext, }, @@ -79,6 +80,11 @@ func ResourceCrawler() *schema.Resource { }, }, }, + "classifiers": { + Type: schema.TypeList, + Optional: true, + Elem: &schema.Schema{Type: schema.TypeString}, + }, "configuration": { Type: schema.TypeString, Optional: true, @@ -89,11 +95,6 @@ func ResourceCrawler() *schema.Resource { }, ValidateFunc: validation.StringIsJSON, }, - "classifiers": { - Type: schema.TypeList, - Optional: true, - Elem: &schema.Schema{Type: schema.TypeString}, - }, "database_name": { Type: schema.TypeString, ForceNew: true, @@ -110,6 +111,10 @@ func ResourceCrawler() *schema.Resource { Type: schema.TypeString, Optional: true, }, + "create_native_delta_table": { + Type: schema.TypeBool, + Required: true, + }, "delta_tables": { Type: schema.TypeSet, Required: true, @@ -119,10 +124,6 @@ func ResourceCrawler() *schema.Resource { Type: schema.TypeBool, Required: true, }, - "create_native_delta_table": { - Type: schema.TypeBool, - Required: true, - }, }, }, }, @@ -284,36 +285,6 @@ func ResourceCrawler() *schema.Resource { return old == strings.TrimPrefix(newARN.Resource, "role/") }, }, - "schedule": { - Type: schema.TypeString, - Optional: true, - }, - "schema_change_policy": { - Type: schema.TypeList, - Optional: true, - DiffSuppressFunc: verify.SuppressMissingOptionalConfigurationBlock, - MaxItems: 1, - Elem: &schema.Resource{ - Schema: map[string]*schema.Schema{ - "delete_behavior": { - Type: schema.TypeString, - Optional: true, - Default: glue.DeleteBehaviorDeprecateInDatabase, - ValidateFunc: validation.StringInSlice(glue.DeleteBehavior_Values(), false), - }, - "update_behavior": { - Type: schema.TypeString, - Optional: true, - Default: glue.UpdateBehaviorUpdateInDatabase, - ValidateFunc: validation.StringInSlice(glue.UpdateBehavior_Values(), false), - }, - }, - }, - }, - "security_configuration": { - Type: schema.TypeString, - Optional: true, - }, "s3_target": { Type: schema.TypeList, Optional: true, @@ -352,6 +323,36 @@ func ResourceCrawler() *schema.Resource { }, }, }, + "schedule": { + Type: schema.TypeString, + Optional: true, + }, + "schema_change_policy": { + Type: schema.TypeList, + Optional: true, + DiffSuppressFunc: verify.SuppressMissingOptionalConfigurationBlock, + MaxItems: 1, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "delete_behavior": { + Type: schema.TypeString, + Optional: true, + Default: glue.DeleteBehaviorDeprecateInDatabase, + ValidateFunc: validation.StringInSlice(glue.DeleteBehavior_Values(), false), + }, + "update_behavior": { + Type: schema.TypeString, + Optional: true, + Default: glue.UpdateBehaviorUpdateInDatabase, + ValidateFunc: validation.StringInSlice(glue.UpdateBehavior_Values(), false), + }, + }, + }, + }, + "security_configuration": { + Type: schema.TypeString, + Optional: true, + }, "table_prefix": { Type: schema.TypeString, Optional: true, @@ -411,6 +412,188 @@ func resourceCrawlerCreate(ctx context.Context, d *schema.ResourceData, meta int return append(diags, resourceCrawlerRead(ctx, d, meta)...) } +func resourceCrawlerRead(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { + var diags diag.Diagnostics + conn := meta.(*conns.AWSClient).GlueConn() + defaultTagsConfig := meta.(*conns.AWSClient).DefaultTagsConfig + ignoreTagsConfig := meta.(*conns.AWSClient).IgnoreTagsConfig + + crawler, err := FindCrawlerByName(ctx, conn, d.Id()) + if !d.IsNewResource() && tfresource.NotFound(err) { + log.Printf("[WARN] Glue Crawler (%s) not found, removing from state", d.Id()) + d.SetId("") + return diags + } + + if err != nil { + return sdkdiag.AppendErrorf(diags, "reading Glue Crawler (%s): %s", d.Id(), err) + } + + crawlerARN := arn.ARN{ + Partition: meta.(*conns.AWSClient).Partition, + Service: "glue", + Region: meta.(*conns.AWSClient).Region, + AccountID: meta.(*conns.AWSClient).AccountID, + Resource: fmt.Sprintf("crawler/%s", d.Id()), + }.String() + d.Set("arn", crawlerARN) + d.Set("name", crawler.Name) + d.Set("database_name", crawler.DatabaseName) + d.Set("role", crawler.Role) + d.Set("configuration", crawler.Configuration) + d.Set("description", crawler.Description) + d.Set("security_configuration", crawler.CrawlerSecurityConfiguration) + d.Set("schedule", "") + if crawler.Schedule != nil { + d.Set("schedule", crawler.Schedule.ScheduleExpression) + } + if err := d.Set("classifiers", flex.FlattenStringList(crawler.Classifiers)); err != nil { + return sdkdiag.AppendErrorf(diags, "setting classifiers: %s", err) + } + d.Set("table_prefix", crawler.TablePrefix) + + if crawler.SchemaChangePolicy != nil { + if err := d.Set("schema_change_policy", flattenCrawlerSchemaChangePolicy(crawler.SchemaChangePolicy)); err != nil { + return sdkdiag.AppendErrorf(diags, "setting schema_change_policy: %s", err) + } + } + + if crawler.Targets != nil { + if err := d.Set("dynamodb_target", flattenDynamoDBTargets(crawler.Targets.DynamoDBTargets)); err != nil { + return sdkdiag.AppendErrorf(diags, "setting dynamodb_target: %s", err) + } + + if err := d.Set("jdbc_target", flattenJDBCTargets(crawler.Targets.JdbcTargets)); err != nil { + return sdkdiag.AppendErrorf(diags, "setting jdbc_target: %s", err) + } + + if err := d.Set("s3_target", flattenS3Targets(crawler.Targets.S3Targets)); err != nil { + return sdkdiag.AppendErrorf(diags, "setting s3_target: %s", err) + } + + if err := d.Set("catalog_target", flattenCatalogTargets(crawler.Targets.CatalogTargets)); err != nil { + return sdkdiag.AppendErrorf(diags, "setting catalog_target: %s", err) + } + + if err := d.Set("mongodb_target", flattenMongoDBTargets(crawler.Targets.MongoDBTargets)); err != nil { + return sdkdiag.AppendErrorf(diags, "setting mongodb_target: %s", err) + } + + if err := d.Set("delta_target", flattenDeltaTargets(crawler.Targets.DeltaTargets)); err != nil { + return sdkdiag.AppendErrorf(diags, "setting delta_target: %s", err) + } + } + + tags, err := ListTags(ctx, conn, crawlerARN) + + if err != nil { + return sdkdiag.AppendErrorf(diags, "listing tags for Glue Crawler (%s): %s", crawlerARN, err) + } + + tags = tags.IgnoreAWS().IgnoreConfig(ignoreTagsConfig) + + //lintignore:AWSR002 + if err := d.Set("tags", tags.RemoveDefaultConfig(defaultTagsConfig).Map()); err != nil { + return sdkdiag.AppendErrorf(diags, "setting tags: %s", err) + } + + if err := d.Set("tags_all", tags.Map()); err != nil { + return sdkdiag.AppendErrorf(diags, "setting tags_all: %s", err) + } + + if err := d.Set("lineage_configuration", flattenCrawlerLineageConfiguration(crawler.LineageConfiguration)); err != nil { + return sdkdiag.AppendErrorf(diags, "setting lineage_configuration: %s", err) + } + + if err := d.Set("lake_formation_configuration", flattenLakeFormationConfiguration(crawler.LakeFormationConfiguration)); err != nil { + return sdkdiag.AppendErrorf(diags, "setting lake_formation_configuration: %s", err) + } + + if err := d.Set("recrawl_policy", flattenCrawlerRecrawlPolicy(crawler.RecrawlPolicy)); err != nil { + return sdkdiag.AppendErrorf(diags, "setting recrawl_policy: %s", err) + } + + return diags +} + +func resourceCrawlerUpdate(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { + var diags diag.Diagnostics + glueConn := meta.(*conns.AWSClient).GlueConn() + name := d.Get("name").(string) + + if d.HasChangesExcept("tags", "tags_all") { + updateCrawlerInput, err := updateCrawlerInput(d, name) + if err != nil { + return sdkdiag.AppendErrorf(diags, "updating Glue Crawler (%s): %s", d.Id(), err) + } + + // Retry for IAM eventual consistency + err = resource.RetryContext(ctx, propagationTimeout, func() *resource.RetryError { + _, err := glueConn.UpdateCrawlerWithContext(ctx, updateCrawlerInput) + if err != nil { + // InvalidInputException: Insufficient Lake Formation permission(s) on xxx + if tfawserr.ErrMessageContains(err, glue.ErrCodeInvalidInputException, "Insufficient Lake Formation permission") { + return resource.RetryableError(err) + } + + if tfawserr.ErrMessageContains(err, glue.ErrCodeInvalidInputException, "Service is unable to assume role") { + return resource.RetryableError(err) + } + + // InvalidInputException: Unable to retrieve connection tf-acc-test-8656357591012534997: User: arn:aws:sts::*******:assumed-role/tf-acc-test-8656357591012534997/AWS-Crawler is not authorized to perform: glue:GetConnection on resource: * (Service: AmazonDataCatalog; Status Code: 400; Error Code: AccessDeniedException; Request ID: 4d72b66f-9c75-11e8-9faf-5b526c7be968) + if tfawserr.ErrMessageContains(err, glue.ErrCodeInvalidInputException, "is not authorized") { + return resource.RetryableError(err) + } + + // InvalidInputException: SQS queue arn:aws:sqs:us-west-2:*******:tf-acc-test-4317277351691904203 does not exist or the role provided does not have access to it. + if tfawserr.ErrMessageContains(err, glue.ErrCodeInvalidInputException, "SQS queue") && tfawserr.ErrMessageContains(err, glue.ErrCodeInvalidInputException, "does not exist or the role provided does not have access to it") { + return resource.RetryableError(err) + } + + return resource.NonRetryableError(err) + } + return nil + }) + + if tfresource.TimedOut(err) { + _, err = glueConn.UpdateCrawlerWithContext(ctx, updateCrawlerInput) + } + + if err != nil { + return sdkdiag.AppendErrorf(diags, "updating Glue Crawler (%s): %s", d.Id(), err) + } + } + + if d.HasChange("tags_all") { + o, n := d.GetChange("tags_all") + if err := UpdateTags(ctx, glueConn, d.Get("arn").(string), o, n); err != nil { + return sdkdiag.AppendErrorf(diags, "updating tags: %s", err) + } + } + + return append(diags, resourceCrawlerRead(ctx, d, meta)...) +} + +func resourceCrawlerDelete(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { + var diags diag.Diagnostics + glueConn := meta.(*conns.AWSClient).GlueConn() + + log.Printf("[DEBUG] Deleting Glue Crawler: %s", d.Id()) + _, err := glueConn.DeleteCrawlerWithContext(ctx, &glue.DeleteCrawlerInput{ + Name: aws.String(d.Id()), + }) + + if tfawserr.ErrCodeEquals(err, glue.ErrCodeEntityNotFoundException) { + return diags + } + + if err != nil { + return sdkdiag.AppendErrorf(diags, "deleting Glue Crawler (%s): %s", d.Id(), err) + } + + return diags +} + func createCrawlerInput(ctx context.Context, d *schema.ResourceData, crawlerName string, defaultTagsConfig *tftags.DefaultConfig) (*glue.CreateCrawlerInput, error) { tags := defaultTagsConfig.MergeTags(tftags.New(ctx, d.Get("tags").(map[string]interface{}))) @@ -741,9 +924,9 @@ func expandDeltaTargets(targets []interface{}) []*glue.DeltaTarget { func expandDeltaTarget(cfg map[string]interface{}) *glue.DeltaTarget { target := &glue.DeltaTarget{ + CreateNativeDeltaTable: aws.Bool(cfg["create_native_delta_table"].(bool)), DeltaTables: flex.ExpandStringSet(cfg["delta_tables"].(*schema.Set)), WriteManifest: aws.Bool(cfg["write_manifest"].(bool)), - CreateNativeDeltaTable: aws.Bool(cfg["create_native_delta_table"].(bool)), } if v, ok := cfg["connection_name"].(string); ok { @@ -753,168 +936,6 @@ func expandDeltaTarget(cfg map[string]interface{}) *glue.DeltaTarget { return target } -func resourceCrawlerUpdate(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - var diags diag.Diagnostics - glueConn := meta.(*conns.AWSClient).GlueConn() - name := d.Get("name").(string) - - if d.HasChangesExcept("tags", "tags_all") { - updateCrawlerInput, err := updateCrawlerInput(d, name) - if err != nil { - return sdkdiag.AppendErrorf(diags, "updating Glue Crawler (%s): %s", d.Id(), err) - } - - // Retry for IAM eventual consistency - err = resource.RetryContext(ctx, propagationTimeout, func() *resource.RetryError { - _, err := glueConn.UpdateCrawlerWithContext(ctx, updateCrawlerInput) - if err != nil { - // InvalidInputException: Insufficient Lake Formation permission(s) on xxx - if tfawserr.ErrMessageContains(err, glue.ErrCodeInvalidInputException, "Insufficient Lake Formation permission") { - return resource.RetryableError(err) - } - - if tfawserr.ErrMessageContains(err, glue.ErrCodeInvalidInputException, "Service is unable to assume role") { - return resource.RetryableError(err) - } - - // InvalidInputException: Unable to retrieve connection tf-acc-test-8656357591012534997: User: arn:aws:sts::*******:assumed-role/tf-acc-test-8656357591012534997/AWS-Crawler is not authorized to perform: glue:GetConnection on resource: * (Service: AmazonDataCatalog; Status Code: 400; Error Code: AccessDeniedException; Request ID: 4d72b66f-9c75-11e8-9faf-5b526c7be968) - if tfawserr.ErrMessageContains(err, glue.ErrCodeInvalidInputException, "is not authorized") { - return resource.RetryableError(err) - } - - // InvalidInputException: SQS queue arn:aws:sqs:us-west-2:*******:tf-acc-test-4317277351691904203 does not exist or the role provided does not have access to it. - if tfawserr.ErrMessageContains(err, glue.ErrCodeInvalidInputException, "SQS queue") && tfawserr.ErrMessageContains(err, glue.ErrCodeInvalidInputException, "does not exist or the role provided does not have access to it") { - return resource.RetryableError(err) - } - - return resource.NonRetryableError(err) - } - return nil - }) - - if tfresource.TimedOut(err) { - _, err = glueConn.UpdateCrawlerWithContext(ctx, updateCrawlerInput) - } - - if err != nil { - return sdkdiag.AppendErrorf(diags, "updating Glue Crawler (%s): %s", d.Id(), err) - } - } - - if d.HasChange("tags_all") { - o, n := d.GetChange("tags_all") - if err := UpdateTags(ctx, glueConn, d.Get("arn").(string), o, n); err != nil { - return sdkdiag.AppendErrorf(diags, "updating tags: %s", err) - } - } - - return append(diags, resourceCrawlerRead(ctx, d, meta)...) -} - -func resourceCrawlerRead(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - var diags diag.Diagnostics - conn := meta.(*conns.AWSClient).GlueConn() - defaultTagsConfig := meta.(*conns.AWSClient).DefaultTagsConfig - ignoreTagsConfig := meta.(*conns.AWSClient).IgnoreTagsConfig - - crawler, err := FindCrawlerByName(ctx, conn, d.Id()) - if !d.IsNewResource() && tfresource.NotFound(err) { - log.Printf("[WARN] Glue Crawler (%s) not found, removing from state", d.Id()) - d.SetId("") - return diags - } - - if err != nil { - return sdkdiag.AppendErrorf(diags, "reading Glue Crawler (%s): %s", d.Id(), err) - } - - crawlerARN := arn.ARN{ - Partition: meta.(*conns.AWSClient).Partition, - Service: "glue", - Region: meta.(*conns.AWSClient).Region, - AccountID: meta.(*conns.AWSClient).AccountID, - Resource: fmt.Sprintf("crawler/%s", d.Id()), - }.String() - d.Set("arn", crawlerARN) - d.Set("name", crawler.Name) - d.Set("database_name", crawler.DatabaseName) - d.Set("role", crawler.Role) - d.Set("configuration", crawler.Configuration) - d.Set("description", crawler.Description) - d.Set("security_configuration", crawler.CrawlerSecurityConfiguration) - d.Set("schedule", "") - if crawler.Schedule != nil { - d.Set("schedule", crawler.Schedule.ScheduleExpression) - } - if err := d.Set("classifiers", flex.FlattenStringList(crawler.Classifiers)); err != nil { - return sdkdiag.AppendErrorf(diags, "setting classifiers: %s", err) - } - d.Set("table_prefix", crawler.TablePrefix) - - if crawler.SchemaChangePolicy != nil { - if err := d.Set("schema_change_policy", flattenCrawlerSchemaChangePolicy(crawler.SchemaChangePolicy)); err != nil { - return sdkdiag.AppendErrorf(diags, "setting schema_change_policy: %s", err) - } - } - - if crawler.Targets != nil { - if err := d.Set("dynamodb_target", flattenDynamoDBTargets(crawler.Targets.DynamoDBTargets)); err != nil { - return sdkdiag.AppendErrorf(diags, "setting dynamodb_target: %s", err) - } - - if err := d.Set("jdbc_target", flattenJDBCTargets(crawler.Targets.JdbcTargets)); err != nil { - return sdkdiag.AppendErrorf(diags, "setting jdbc_target: %s", err) - } - - if err := d.Set("s3_target", flattenS3Targets(crawler.Targets.S3Targets)); err != nil { - return sdkdiag.AppendErrorf(diags, "setting s3_target: %s", err) - } - - if err := d.Set("catalog_target", flattenCatalogTargets(crawler.Targets.CatalogTargets)); err != nil { - return sdkdiag.AppendErrorf(diags, "setting catalog_target: %s", err) - } - - if err := d.Set("mongodb_target", flattenMongoDBTargets(crawler.Targets.MongoDBTargets)); err != nil { - return sdkdiag.AppendErrorf(diags, "setting mongodb_target: %s", err) - } - - if err := d.Set("delta_target", flattenDeltaTargets(crawler.Targets.DeltaTargets)); err != nil { - return sdkdiag.AppendErrorf(diags, "setting delta_target: %s", err) - } - } - - tags, err := ListTags(ctx, conn, crawlerARN) - - if err != nil { - return sdkdiag.AppendErrorf(diags, "listing tags for Glue Crawler (%s): %s", crawlerARN, err) - } - - tags = tags.IgnoreAWS().IgnoreConfig(ignoreTagsConfig) - - //lintignore:AWSR002 - if err := d.Set("tags", tags.RemoveDefaultConfig(defaultTagsConfig).Map()); err != nil { - return sdkdiag.AppendErrorf(diags, "setting tags: %s", err) - } - - if err := d.Set("tags_all", tags.Map()); err != nil { - return sdkdiag.AppendErrorf(diags, "setting tags_all: %s", err) - } - - if err := d.Set("lineage_configuration", flattenCrawlerLineageConfiguration(crawler.LineageConfiguration)); err != nil { - return sdkdiag.AppendErrorf(diags, "setting lineage_configuration: %s", err) - } - - if err := d.Set("lake_formation_configuration", flattenLakeFormationConfiguration(crawler.LakeFormationConfiguration)); err != nil { - return sdkdiag.AppendErrorf(diags, "setting lake_formation_configuration: %s", err) - } - - if err := d.Set("recrawl_policy", flattenCrawlerRecrawlPolicy(crawler.RecrawlPolicy)); err != nil { - return sdkdiag.AppendErrorf(diags, "setting recrawl_policy: %s", err) - } - - return diags -} - func flattenS3Targets(s3Targets []*glue.S3Target) []map[string]interface{} { result := make([]map[string]interface{}, 0) @@ -1001,32 +1022,15 @@ func flattenDeltaTargets(deltaTargets []*glue.DeltaTarget) []map[string]interfac for _, deltaTarget := range deltaTargets { attrs := make(map[string]interface{}) attrs["connection_name"] = aws.StringValue(deltaTarget.ConnectionName) + attrs["create_native_delta_table"] = aws.BoolValue(deltaTarget.CreateNativeDeltaTable) attrs["delta_tables"] = flex.FlattenStringSet(deltaTarget.DeltaTables) attrs["write_manifest"] = aws.BoolValue(deltaTarget.WriteManifest) - attrs["create_native_delta_table"] = aws.BoolValue(deltaTarget.CreateNativeDeltaTable) result = append(result, attrs) } return result } -func resourceCrawlerDelete(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - var diags diag.Diagnostics - glueConn := meta.(*conns.AWSClient).GlueConn() - - log.Printf("[DEBUG] deleting Glue Crawler: %s", d.Id()) - _, err := glueConn.DeleteCrawlerWithContext(ctx, &glue.DeleteCrawlerInput{ - Name: aws.String(d.Id()), - }) - if err != nil { - if tfawserr.ErrCodeEquals(err, glue.ErrCodeEntityNotFoundException) { - return diags - } - return sdkdiag.AppendErrorf(diags, "deleting Glue Crawler: %s", err) - } - return diags -} - func flattenCrawlerSchemaChangePolicy(cfg *glue.SchemaChangePolicy) []map[string]interface{} { if cfg == nil { return []map[string]interface{}{} diff --git a/internal/service/glue/crawler_test.go b/internal/service/glue/crawler_test.go index 25500e971ee5..082e23f0a254 100644 --- a/internal/service/glue/crawler_test.go +++ b/internal/service/glue/crawler_test.go @@ -533,10 +533,10 @@ func TestAccGlueCrawler_deltaTarget(t *testing.T) { testAccCheckCrawlerExists(ctx, resourceName, &crawler), resource.TestCheckResourceAttr(resourceName, "delta_target.#", "1"), resource.TestCheckResourceAttr(resourceName, "delta_target.0.connection_name", rName), + resource.TestCheckResourceAttr(resourceName, "delta_target.0.create_native_delta_table", "true"), resource.TestCheckResourceAttr(resourceName, "delta_target.0.delta_tables.#", "1"), resource.TestCheckTypeSetElemAttr(resourceName, "delta_target.0.delta_tables.*", "s3://table1"), resource.TestCheckResourceAttr(resourceName, "delta_target.0.write_manifest", "false"), - resource.TestCheckResourceAttr(resourceName, "delta_target.0.create_native_delta_table", "false"), ), }, { @@ -550,10 +550,10 @@ func TestAccGlueCrawler_deltaTarget(t *testing.T) { testAccCheckCrawlerExists(ctx, resourceName, &crawler), resource.TestCheckResourceAttr(resourceName, "delta_target.#", "1"), resource.TestCheckResourceAttr(resourceName, "delta_target.0.connection_name", rName), + resource.TestCheckResourceAttr(resourceName, "delta_target.0.create_native_delta_table", "true"), resource.TestCheckResourceAttr(resourceName, "delta_target.0.delta_tables.#", "1"), resource.TestCheckTypeSetElemAttr(resourceName, "delta_target.0.delta_tables.*", "s3://table2"), resource.TestCheckResourceAttr(resourceName, "delta_target.0.write_manifest", "false"), - resource.TestCheckResourceAttr(resourceName, "delta_target.0.create_native_delta_table", "false"), ), }, }, @@ -2961,7 +2961,7 @@ resource "aws_glue_crawler" "test" { connection_name = aws_glue_connection.test.name delta_tables = [%[3]q] write_manifest = false - create_native_delta_table = false + create_native_delta_table = true } } `, rName, connectionUrl, tableName)) From ea18850240efd470a8c724fbf97fc1212051c761 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Fri, 10 Mar 2023 10:45:12 -0500 Subject: [PATCH 604/763] r/aws_glue_crawler: 'delta_target.create_native_delta_table' is Optional. --- internal/service/glue/crawler.go | 2 +- internal/service/glue/crawler_test.go | 12 ++++++------ website/docs/r/glue_crawler.html.markdown | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/internal/service/glue/crawler.go b/internal/service/glue/crawler.go index 413e140d37ca..28723f08c184 100644 --- a/internal/service/glue/crawler.go +++ b/internal/service/glue/crawler.go @@ -113,7 +113,7 @@ func ResourceCrawler() *schema.Resource { }, "create_native_delta_table": { Type: schema.TypeBool, - Required: true, + Optional: true, }, "delta_tables": { Type: schema.TypeSet, diff --git a/internal/service/glue/crawler_test.go b/internal/service/glue/crawler_test.go index 082e23f0a254..f374cd246bde 100644 --- a/internal/service/glue/crawler_test.go +++ b/internal/service/glue/crawler_test.go @@ -528,12 +528,12 @@ func TestAccGlueCrawler_deltaTarget(t *testing.T) { CheckDestroy: testAccCheckCrawlerDestroy(ctx), Steps: []resource.TestStep{ { - Config: testAccCrawlerConfig_deltaTarget(rName, connectionUrl, "s3://table1"), + Config: testAccCrawlerConfig_deltaTarget(rName, connectionUrl, "s3://table1", "null"), Check: resource.ComposeTestCheckFunc( testAccCheckCrawlerExists(ctx, resourceName, &crawler), resource.TestCheckResourceAttr(resourceName, "delta_target.#", "1"), resource.TestCheckResourceAttr(resourceName, "delta_target.0.connection_name", rName), - resource.TestCheckResourceAttr(resourceName, "delta_target.0.create_native_delta_table", "true"), + resource.TestCheckResourceAttr(resourceName, "delta_target.0.create_native_delta_table", "false"), resource.TestCheckResourceAttr(resourceName, "delta_target.0.delta_tables.#", "1"), resource.TestCheckTypeSetElemAttr(resourceName, "delta_target.0.delta_tables.*", "s3://table1"), resource.TestCheckResourceAttr(resourceName, "delta_target.0.write_manifest", "false"), @@ -545,7 +545,7 @@ func TestAccGlueCrawler_deltaTarget(t *testing.T) { ImportStateVerify: true, }, { - Config: testAccCrawlerConfig_deltaTarget(rName, connectionUrl, "s3://table2"), + Config: testAccCrawlerConfig_deltaTarget(rName, connectionUrl, "s3://table2", "true"), Check: resource.ComposeTestCheckFunc( testAccCheckCrawlerExists(ctx, resourceName, &crawler), resource.TestCheckResourceAttr(resourceName, "delta_target.#", "1"), @@ -2933,7 +2933,7 @@ resource "aws_glue_crawler" "test" { `, rName, connectionUrl, path1, path2)) } -func testAccCrawlerConfig_deltaTarget(rName, connectionUrl, tableName string) string { +func testAccCrawlerConfig_deltaTarget(rName, connectionUrl, tableName, createNativeDeltaTable string) string { return acctest.ConfigCompose(testAccCrawlerConfig_base(rName), fmt.Sprintf(` resource "aws_glue_catalog_database" "test" { name = %[1]q @@ -2961,10 +2961,10 @@ resource "aws_glue_crawler" "test" { connection_name = aws_glue_connection.test.name delta_tables = [%[3]q] write_manifest = false - create_native_delta_table = true + create_native_delta_table = %[4]s } } -`, rName, connectionUrl, tableName)) +`, rName, connectionUrl, tableName, createNativeDeltaTable)) } func testAccCrawlerConfig_lakeformation(rName string, use bool) string { diff --git a/website/docs/r/glue_crawler.html.markdown b/website/docs/r/glue_crawler.html.markdown index cabe77e32869..03f90afa3d8b 100644 --- a/website/docs/r/glue_crawler.html.markdown +++ b/website/docs/r/glue_crawler.html.markdown @@ -194,9 +194,9 @@ The following arguments are supported: ### Delta Target * `connection_name` - (Optional) The name of the connection to use to connect to the Delta table target. +* `create_native_delta_table` (Optional) Specifies whether the crawler will create native tables, to allow integration with query engines that support querying of the Delta transaction log directly. * `delta_tables` - (Required) A list of the Amazon S3 paths to the Delta tables. * `write_manifest` - (Required) Specifies whether to write the manifest files to the Delta table path. -* `create_native_delta_table` (Required) Specifies whether the crawler will create native tables, to allow integration with query engines that support querying of the Delta transaction log directly. ### Schema Change Policy From 3d1cdbe95e074deaee2c21d8d08d78c845e7dad8 Mon Sep 17 00:00:00 2001 From: Adrian Johnson Date: Fri, 10 Mar 2023 09:47:17 -0600 Subject: [PATCH 605/763] r/aws_qldb_ledger: use timeouts in waiters --- internal/service/qldb/ledger.go | 21 ++++++++------------- 1 file changed, 8 insertions(+), 13 deletions(-) diff --git a/internal/service/qldb/ledger.go b/internal/service/qldb/ledger.go index 591117172990..9ebde64740c7 100644 --- a/internal/service/qldb/ledger.go +++ b/internal/service/qldb/ledger.go @@ -20,11 +20,6 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/verify" ) -const ( - createLedgerTimeout = 5 * time.Minute - deleteLedgerTimeout = 15 * time.Minute -) - // @SDKResource("aws_qldb_ledger") func ResourceLedger() *schema.Resource { return &schema.Resource{ @@ -38,8 +33,8 @@ func ResourceLedger() *schema.Resource { }, Timeouts: &schema.ResourceTimeout{ - Create: schema.DefaultTimeout(createLedgerTimeout), - Delete: schema.DefaultTimeout(createLedgerTimeout), + Create: schema.DefaultTimeout(10 * time.Minute), + Delete: schema.DefaultTimeout(10 * time.Minute), }, Schema: map[string]*schema.Schema{ @@ -110,7 +105,7 @@ func resourceLedgerCreate(ctx context.Context, d *schema.ResourceData, meta inte d.SetId(aws.StringValue(output.Name)) - if _, err := waitLedgerCreated(ctx, conn, d.Id()); err != nil { + if _, err := waitLedgerCreated(ctx, conn, d.Timeout(schema.TimeoutCreate), d.Id()); err != nil { return diag.Errorf("waiting for QLDB Ledger (%s) create: %s", d.Id(), err) } @@ -227,7 +222,7 @@ func resourceLedgerDelete(ctx context.Context, d *schema.ResourceData, meta inte return diag.Errorf("deleting QLDB Ledger (%s): %s", d.Id(), err) } - if _, err := waitLedgerDeleted(ctx, conn, d.Id()); err != nil { + if _, err := waitLedgerDeleted(ctx, conn, d.Timeout(schema.TimeoutDelete), d.Id()); err != nil { return diag.Errorf("waiting for QLDB Ledger (%s) delete: %s", d.Id(), err) } @@ -282,12 +277,12 @@ func statusLedgerState(ctx context.Context, conn *qldb.QLDB, name string) resour } } -func waitLedgerCreated(ctx context.Context, conn *qldb.QLDB, name string) (*qldb.DescribeLedgerOutput, error) { +func waitLedgerCreated(ctx context.Context, conn *qldb.QLDB, timeout time.Duration, name string) (*qldb.DescribeLedgerOutput, error) { stateConf := &resource.StateChangeConf{ Pending: []string{qldb.LedgerStateCreating}, Target: []string{qldb.LedgerStateActive}, Refresh: statusLedgerState(ctx, conn, name), - Timeout: createLedgerTimeout, + Timeout: timeout, MinTimeout: 3 * time.Second, } @@ -300,12 +295,12 @@ func waitLedgerCreated(ctx context.Context, conn *qldb.QLDB, name string) (*qldb return nil, err } -func waitLedgerDeleted(ctx context.Context, conn *qldb.QLDB, name string) (*qldb.DescribeLedgerOutput, error) { +func waitLedgerDeleted(ctx context.Context, conn *qldb.QLDB, timeout time.Duration, name string) (*qldb.DescribeLedgerOutput, error) { stateConf := &resource.StateChangeConf{ Pending: []string{qldb.LedgerStateActive, qldb.LedgerStateDeleting}, Target: []string{}, Refresh: statusLedgerState(ctx, conn, name), - Timeout: deleteLedgerTimeout, + Timeout: timeout, MinTimeout: 1 * time.Second, } From 27c525bd4379b62ec9208e77745b2d0462bc59bd Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Fri, 10 Mar 2023 10:56:41 -0500 Subject: [PATCH 606/763] Add CHANGELOG entry. --- .changelog/29291.txt | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 .changelog/29291.txt diff --git a/.changelog/29291.txt b/.changelog/29291.txt new file mode 100644 index 000000000000..ea78ef419630 --- /dev/null +++ b/.changelog/29291.txt @@ -0,0 +1,3 @@ +```release-note:enhancement +data-source/aws_ce_cost_category: Add `default_value` attribute +``` \ No newline at end of file From 89a4935b28fcb7be9d098837479c31c89c1a452d Mon Sep 17 00:00:00 2001 From: Adrian Johnson Date: Fri, 10 Mar 2023 09:57:10 -0600 Subject: [PATCH 607/763] docs: tweak default timeout times --- website/docs/r/qldb_ledger.html.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/website/docs/r/qldb_ledger.html.markdown b/website/docs/r/qldb_ledger.html.markdown index 3c09d400c958..8b6c2e3e5592 100644 --- a/website/docs/r/qldb_ledger.html.markdown +++ b/website/docs/r/qldb_ledger.html.markdown @@ -43,7 +43,7 @@ In addition to all arguments above, the following attributes are exported: [Configuration options](https://developer.hashicorp.com/terraform/language/resources/syntax#operation-timeouts): -- `create` - (Default `5m`) +- `create` - (Default `10m`) - `delete` - (Default `10m`) ## Import From 826a4f1e06f9a55ddf7de759946f8deaa0669fc6 Mon Sep 17 00:00:00 2001 From: Adrian Johnson Date: Fri, 10 Mar 2023 09:58:53 -0600 Subject: [PATCH 608/763] update CHANGELOG entry --- .changelog/29635.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.changelog/29635.txt b/.changelog/29635.txt index b5e8f13c13ec..331d79f483e4 100644 --- a/.changelog/29635.txt +++ b/.changelog/29635.txt @@ -1,3 +1,3 @@ -```release-note:fix -resource/aws_qldb_ledger: Added timeouts +```release-note:enhancement +resource/aws_qldb_ledger: Add configurable timeouts ``` \ No newline at end of file From b7e7b96711c58ad94282872a9fa42603812f8b2e Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Fri, 10 Mar 2023 11:03:35 -0500 Subject: [PATCH 609/763] d/aws_ce_cost_category: Cosmetics. --- .../service/ce/cost_category_data_source.go | 373 +++++++++--------- .../ce/cost_category_data_source_test.go | 4 +- 2 files changed, 186 insertions(+), 191 deletions(-) diff --git a/internal/service/ce/cost_category_data_source.go b/internal/service/ce/cost_category_data_source.go index 3185e9ba23cb..06c4ece6f807 100644 --- a/internal/service/ce/cost_category_data_source.go +++ b/internal/service/ce/cost_category_data_source.go @@ -15,11 +15,193 @@ import ( // @SDKDataSource("aws_ce_cost_category") func DataSourceCostCategory() *schema.Resource { + schemaCostCategoryRuleExpressionComputed := func() *schema.Resource { + return &schema.Resource{ + Schema: map[string]*schema.Schema{ + "cost_category": { + Type: schema.TypeList, + Computed: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "key": { + Type: schema.TypeString, + Computed: true, + }, + "match_options": { + Type: schema.TypeSet, + Computed: true, + Elem: &schema.Schema{ + Type: schema.TypeString, + }, + }, + "values": { + Type: schema.TypeSet, + Computed: true, + Elem: &schema.Schema{ + Type: schema.TypeString, + }, + }, + }, + }, + }, + "dimension": { + Type: schema.TypeList, + Computed: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "key": { + Type: schema.TypeString, + Computed: true, + }, + "match_options": { + Type: schema.TypeSet, + Computed: true, + Elem: &schema.Schema{ + Type: schema.TypeString, + }, + }, + "values": { + Type: schema.TypeSet, + Computed: true, + Elem: &schema.Schema{ + Type: schema.TypeString, + }, + }, + }, + }, + }, + "tags": { + Type: schema.TypeList, + Computed: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "key": { + Type: schema.TypeString, + Computed: true, + }, + "match_options": { + Type: schema.TypeSet, + Computed: true, + Elem: &schema.Schema{ + Type: schema.TypeString, + }, + }, + "values": { + Type: schema.TypeSet, + Computed: true, + Elem: &schema.Schema{ + Type: schema.TypeString, + }, + }, + }, + }, + }, + }, + } + } + schemaCostCategoryRuleComputed := func() *schema.Resource { + return &schema.Resource{ + Schema: map[string]*schema.Schema{ + "and": { + Type: schema.TypeSet, + Computed: true, + Elem: schemaCostCategoryRuleExpressionComputed(), + }, + "cost_category": { + Type: schema.TypeList, + Computed: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "key": { + Type: schema.TypeString, + Computed: true, + }, + "match_options": { + Type: schema.TypeSet, + Computed: true, + Elem: &schema.Schema{ + Type: schema.TypeString, + }, + }, + "values": { + Type: schema.TypeSet, + Computed: true, + Elem: &schema.Schema{ + Type: schema.TypeString, + }, + }, + }, + }, + }, + "dimension": { + Type: schema.TypeList, + Computed: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "key": { + Type: schema.TypeString, + Computed: true, + }, + "match_options": { + Type: schema.TypeSet, + Computed: true, + Elem: &schema.Schema{ + Type: schema.TypeString, + }, + }, + "values": { + Type: schema.TypeSet, + Computed: true, + Elem: &schema.Schema{ + Type: schema.TypeString, + }, + }, + }, + }, + }, + "not": { + Type: schema.TypeList, + Computed: true, + Elem: schemaCostCategoryRuleExpressionComputed(), + }, + "or": { + Type: schema.TypeSet, + Computed: true, + Elem: schemaCostCategoryRuleExpressionComputed(), + }, + "tags": { + Type: schema.TypeList, + Computed: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "key": { + Type: schema.TypeString, + Computed: true, + }, + "match_options": { + Type: schema.TypeSet, + Computed: true, + Elem: &schema.Schema{ + Type: schema.TypeString, + }, + }, + "values": { + Type: schema.TypeSet, + Computed: true, + Elem: &schema.Schema{ + Type: schema.TypeString, + }, + }, + }, + }, + }, + }, + } + } + return &schema.Resource{ ReadWithoutTimeout: dataSourceCostCategoryRead, - Importer: &schema.ResourceImporter{ - StateContext: schema.ImportStatePassthroughContext, - }, + Schema: map[string]*schema.Schema{ "cost_category_arn": { Type: schema.TypeString, @@ -131,191 +313,6 @@ func DataSourceCostCategory() *schema.Resource { } } -func schemaCostCategoryRuleComputed() *schema.Resource { - return &schema.Resource{ - Schema: map[string]*schema.Schema{ - "and": { - Type: schema.TypeSet, - Computed: true, - Elem: schemaCostCategoryRuleExpressionComputed(), - }, - "cost_category": { - Type: schema.TypeList, - Computed: true, - Elem: &schema.Resource{ - Schema: map[string]*schema.Schema{ - "key": { - Type: schema.TypeString, - Computed: true, - }, - "match_options": { - Type: schema.TypeSet, - Computed: true, - Elem: &schema.Schema{ - Type: schema.TypeString, - }, - }, - "values": { - Type: schema.TypeSet, - Computed: true, - Elem: &schema.Schema{ - Type: schema.TypeString, - }, - }, - }, - }, - }, - "dimension": { - Type: schema.TypeList, - Computed: true, - Elem: &schema.Resource{ - Schema: map[string]*schema.Schema{ - "key": { - Type: schema.TypeString, - Computed: true, - }, - "match_options": { - Type: schema.TypeSet, - Computed: true, - Elem: &schema.Schema{ - Type: schema.TypeString, - }, - }, - "values": { - Type: schema.TypeSet, - Computed: true, - Elem: &schema.Schema{ - Type: schema.TypeString, - }, - }, - }, - }, - }, - "not": { - Type: schema.TypeList, - Computed: true, - Elem: schemaCostCategoryRuleExpressionComputed(), - }, - "or": { - Type: schema.TypeSet, - Computed: true, - Elem: schemaCostCategoryRuleExpressionComputed(), - }, - "tags": { - Type: schema.TypeList, - Computed: true, - Elem: &schema.Resource{ - Schema: map[string]*schema.Schema{ - "key": { - Type: schema.TypeString, - Computed: true, - }, - "match_options": { - Type: schema.TypeSet, - Computed: true, - Elem: &schema.Schema{ - Type: schema.TypeString, - }, - }, - "values": { - Type: schema.TypeSet, - Computed: true, - Elem: &schema.Schema{ - Type: schema.TypeString, - }, - }, - }, - }, - }, - }, - } -} - -func schemaCostCategoryRuleExpressionComputed() *schema.Resource { - return &schema.Resource{ - Schema: map[string]*schema.Schema{ - "cost_category": { - Type: schema.TypeList, - Computed: true, - Elem: &schema.Resource{ - Schema: map[string]*schema.Schema{ - "key": { - Type: schema.TypeString, - Computed: true, - }, - "match_options": { - Type: schema.TypeSet, - Computed: true, - Elem: &schema.Schema{ - Type: schema.TypeString, - }, - }, - "values": { - Type: schema.TypeSet, - Computed: true, - Elem: &schema.Schema{ - Type: schema.TypeString, - }, - }, - }, - }, - }, - "dimension": { - Type: schema.TypeList, - Computed: true, - Elem: &schema.Resource{ - Schema: map[string]*schema.Schema{ - "key": { - Type: schema.TypeString, - Computed: true, - }, - "match_options": { - Type: schema.TypeSet, - Computed: true, - Elem: &schema.Schema{ - Type: schema.TypeString, - }, - }, - "values": { - Type: schema.TypeSet, - Computed: true, - Elem: &schema.Schema{ - Type: schema.TypeString, - }, - }, - }, - }, - }, - "tags": { - Type: schema.TypeList, - Computed: true, - Elem: &schema.Resource{ - Schema: map[string]*schema.Schema{ - "key": { - Type: schema.TypeString, - Computed: true, - }, - "match_options": { - Type: schema.TypeSet, - Computed: true, - Elem: &schema.Schema{ - Type: schema.TypeString, - }, - }, - "values": { - Type: schema.TypeSet, - Computed: true, - Elem: &schema.Schema{ - Type: schema.TypeString, - }, - }, - }, - }, - }, - }, - } -} - func dataSourceCostCategoryRead(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { conn := meta.(*conns.AWSClient).CEConn() ignoreTagsConfig := meta.(*conns.AWSClient).IgnoreTagsConfig diff --git a/internal/service/ce/cost_category_data_source_test.go b/internal/service/ce/cost_category_data_source_test.go index 6eae05efa22e..8af6285cc6dc 100644 --- a/internal/service/ce/cost_category_data_source_test.go +++ b/internal/service/ce/cost_category_data_source_test.go @@ -38,9 +38,7 @@ func TestAccCECostCategoryDataSource_basic(t *testing.T) { } func testAccCostCategoryDataSourceConfig_basic(rName string) string { - return acctest.ConfigCompose( - testAccCostCategoryConfig_basic(rName), - ` + return acctest.ConfigCompose(testAccCostCategoryConfig_basic(rName), ` data "aws_ce_cost_category" "test" { cost_category_arn = aws_ce_cost_category.test.arn } From 2596ed6c47d1c56b4770dc80902b660b22871b30 Mon Sep 17 00:00:00 2001 From: Francois Gouteroux Date: Fri, 10 Mar 2023 17:09:52 +0100 Subject: [PATCH 610/763] fix: add XNotImplemented error handling in resourceBucketRead (#29632) * fix: add XNotImplemented error handling in resourceBucketRead * add changelog --- .changelog/29632.txt | 3 +++ internal/service/s3/bucket.go | 10 +++++----- 2 files changed, 8 insertions(+), 5 deletions(-) create mode 100644 .changelog/29632.txt diff --git a/.changelog/29632.txt b/.changelog/29632.txt new file mode 100644 index 000000000000..e0ccf2be7b64 --- /dev/null +++ b/.changelog/29632.txt @@ -0,0 +1,3 @@ +```release-note:enhancement +resource/aws_s3_bucket: Add error handling for `XNotImplemented` errors when reading `acceleration_status`, 'request_payer`, `lifecycle_rule`, `logging`, or `replication_configuration` into terraform state. +``` diff --git a/internal/service/s3/bucket.go b/internal/service/s3/bucket.go index 41205872d276..c14a72f9048b 100644 --- a/internal/service/s3/bucket.go +++ b/internal/service/s3/bucket.go @@ -1146,7 +1146,7 @@ func resourceBucketRead(ctx context.Context, d *schema.ResourceData, meta interf } // Amazon S3 Transfer Acceleration might not be supported in the region - if err != nil && !tfawserr.ErrCodeEquals(err, ErrCodeMethodNotAllowed, ErrCodeUnsupportedArgument, ErrCodeNotImplemented) { + if err != nil && !tfawserr.ErrCodeEquals(err, ErrCodeMethodNotAllowed, ErrCodeUnsupportedArgument, ErrCodeNotImplemented, ErrCodeXNotImplemented) { return sdkdiag.AppendErrorf(diags, "getting S3 Bucket (%s) accelerate configuration: %s", d.Id(), err) } @@ -1171,7 +1171,7 @@ func resourceBucketRead(ctx context.Context, d *schema.ResourceData, meta interf return diags } - if err != nil && !tfawserr.ErrCodeEquals(err, ErrCodeNotImplemented) { + if err != nil && !tfawserr.ErrCodeEquals(err, ErrCodeNotImplemented, ErrCodeXNotImplemented) { return sdkdiag.AppendErrorf(diags, "getting S3 Bucket request payment: %s", err) } @@ -1195,7 +1195,7 @@ func resourceBucketRead(ctx context.Context, d *schema.ResourceData, meta interf return diags } - if err != nil && !tfawserr.ErrCodeEquals(err, ErrCodeNotImplemented) { + if err != nil && !tfawserr.ErrCodeEquals(err, ErrCodeNotImplemented, ErrCodeXNotImplemented) { return sdkdiag.AppendErrorf(diags, "getting S3 Bucket logging: %s", err) } @@ -1224,7 +1224,7 @@ func resourceBucketRead(ctx context.Context, d *schema.ResourceData, meta interf return diags } - if err != nil && !tfawserr.ErrCodeEquals(err, ErrCodeNoSuchLifecycleConfiguration, ErrCodeNotImplemented) { + if err != nil && !tfawserr.ErrCodeEquals(err, ErrCodeNoSuchLifecycleConfiguration, ErrCodeNotImplemented, ErrCodeXNotImplemented) { return sdkdiag.AppendErrorf(diags, "getting S3 Bucket (%s) Lifecycle Configuration: %s", d.Id(), err) } @@ -1253,7 +1253,7 @@ func resourceBucketRead(ctx context.Context, d *schema.ResourceData, meta interf return diags } - if err != nil && !tfawserr.ErrCodeEquals(err, ErrCodeReplicationConfigurationNotFound, ErrCodeNotImplemented) { + if err != nil && !tfawserr.ErrCodeEquals(err, ErrCodeReplicationConfigurationNotFound, ErrCodeNotImplemented, ErrCodeXNotImplemented) { return sdkdiag.AppendErrorf(diags, "getting S3 Bucket replication: %s", err) } From 0dfffaf719cc36e322f334ef94ec8ffef5338c46 Mon Sep 17 00:00:00 2001 From: Benny Lu Date: Fri, 10 Mar 2023 08:12:16 -0800 Subject: [PATCH 611/763] aws_scheduler_schedule - correct assign_public_ip description (#29659) * aws_scheduler_schedule - correct assign_public_ip description * r/aws_scheduler_schedule: re-word assign_public_ip description --------- Co-authored-by: Jared Baker --- website/docs/r/scheduler_schedule.html.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/website/docs/r/scheduler_schedule.html.markdown b/website/docs/r/scheduler_schedule.html.markdown index e42b5821e927..a831ab2c4959 100644 --- a/website/docs/r/scheduler_schedule.html.markdown +++ b/website/docs/r/scheduler_schedule.html.markdown @@ -139,7 +139,7 @@ The following arguments are optional: ##### network_configuration Configuration Block -* `assign_public_ip` - (Optional) Specifies whether the task's elastic network interface receives a public IP address. You can specify `ENABLED` only when the `launch_type` is set to `FARGATE`. One of: `ENABLED`, `DISABLED`. +* `assign_public_ip` - (Optional) Specifies whether the task's elastic network interface receives a public IP address. This attribute is a boolean type, where `true` maps to `ENABLED` and `false` to `DISABLED`. You can specify `true` only when the `launch_type` is set to `FARGATE`. * `security_groups` - (Optional) Set of 1 to 5 Security Group ID-s to be associated with the task. These security groups must all be in the same VPC. * `subnets` - (Optional) Set of 1 to 16 subnets to be associated with the task. These subnets must all be in the same VPC. From fd9990c3736af7edf0412960dbad7ac3104ed29f Mon Sep 17 00:00:00 2001 From: Adrian Johnson Date: Fri, 10 Mar 2023 10:24:20 -0600 Subject: [PATCH 612/763] docs: fix dead link --- website/docs/r/rds_cluster_activity_stream.html.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/website/docs/r/rds_cluster_activity_stream.html.markdown b/website/docs/r/rds_cluster_activity_stream.html.markdown index 852207cff651..37f6726de57f 100644 --- a/website/docs/r/rds_cluster_activity_stream.html.markdown +++ b/website/docs/r/rds_cluster_activity_stream.html.markdown @@ -14,7 +14,7 @@ Database Activity Streams have some limits and requirements, refer to the [Monit ~> **Note:** This resource always calls the RDS [`StartActivityStream`][2] API with the `ApplyImmediately` parameter set to `true`. This is because the Terraform needs the activity stream to be started in order for it to get the associated attributes. -~> **Note:** This resource depends on having at least one `aws_rds_cluster_instance` created. To avoid race conditions when all resources are being created together, add an explicit resource reference using the [resource `depends_on` meta-argument](/docs/configuration/resources.html#depends_on-explicit-resource-dependencies). +~> **Note:** This resource depends on having at least one `aws_rds_cluster_instance` created. To avoid race conditions when all resources are being created together, add an explicit resource reference using the [resource `depends_on` meta-argument](https://www.terraform.io/docs/configuration/resources.html#depends_on-explicit-resource-dependencies). ~> **Note:** This resource is available in all regions except the following: `cn-north-1`, `cn-northwest-1`, `us-gov-east-1`, `us-gov-west-1` From 28de2cd61fd7e36269ac8c19cfc942ed668952cd Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Fri, 10 Mar 2023 11:42:33 -0500 Subject: [PATCH 613/763] Tweak CHANGELOG entry. --- .changelog/27598.txt | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.changelog/27598.txt b/.changelog/27598.txt index 4f89a0478fe9..a863e2f2497d 100644 --- a/.changelog/27598.txt +++ b/.changelog/27598.txt @@ -1,4 +1,3 @@ ```release-note:bug -resource/aws_elasticsearch: Remove validation for EBS storage throughput as AWS has backend limits they can raise for select customers +resource/aws_elasticsearch_domain: Remove validation for `ebs_options.throughput` as the 1,000 MB/s limit can be raised ``` - From 2411efba8182004faf1cd7207d87f6588637c969 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Fri, 10 Mar 2023 11:47:17 -0500 Subject: [PATCH 614/763] r/aws_elasticsearch_domain: Update documentation for 'ebs_options.throughput'. --- website/docs/r/elasticsearch_domain.html.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/website/docs/r/elasticsearch_domain.html.markdown b/website/docs/r/elasticsearch_domain.html.markdown index 3159adaa35d6..40561157ddbd 100644 --- a/website/docs/r/elasticsearch_domain.html.markdown +++ b/website/docs/r/elasticsearch_domain.html.markdown @@ -294,7 +294,7 @@ AWS documentation: [Amazon Cognito Authentication for Kibana](https://docs.aws.a * `ebs_enabled` - (Required) Whether EBS volumes are attached to data nodes in the domain. * `iops` - (Optional) Baseline input/output (I/O) performance of EBS volumes attached to data nodes. Applicable only for the GP3 and Provisioned IOPS EBS volume types. -* `throughput` - (Required if `volume_type` is set to `gp3`) Specifies the throughput (in MiB/s) of the EBS volumes attached to data nodes. Applicable only for the gp3 volume type. Valid values are between `125` and `1000`. +* `throughput` - (Required if `volume_type` is set to `gp3`) Specifies the throughput (in MiB/s) of the EBS volumes attached to data nodes. Applicable only for the gp3 volume type. * `volume_size` - (Required if `ebs_enabled` is set to `true`.) Size of EBS volumes attached to data nodes (in GiB). * `volume_type` - (Optional) Type of EBS volumes attached to data nodes. From 28a52fbccb306f9a96ce898a36f7dae48d0589c2 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Fri, 10 Mar 2023 11:51:32 -0500 Subject: [PATCH 615/763] r/aws_elasticsearch_domain: Restore the 125MB/s lower bound validation for 'ebs_options.throughput'. --- .changelog/27598.txt | 2 +- internal/service/elasticsearch/domain.go | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/.changelog/27598.txt b/.changelog/27598.txt index a863e2f2497d..425ea33ed7cc 100644 --- a/.changelog/27598.txt +++ b/.changelog/27598.txt @@ -1,3 +1,3 @@ ```release-note:bug -resource/aws_elasticsearch_domain: Remove validation for `ebs_options.throughput` as the 1,000 MB/s limit can be raised +resource/aws_elasticsearch_domain: Remove upper bound validation for `ebs_options.throughput` as the 1,000 MB/s limit can be raised ``` diff --git a/internal/service/elasticsearch/domain.go b/internal/service/elasticsearch/domain.go index bed7260e0d34..80ef851435cb 100644 --- a/internal/service/elasticsearch/domain.go +++ b/internal/service/elasticsearch/domain.go @@ -386,9 +386,10 @@ func ResourceDomain() *schema.Resource { Optional: true, }, "throughput": { - Type: schema.TypeInt, - Optional: true, - Computed: true, + Type: schema.TypeInt, + Optional: true, + Computed: true, + ValidateFunc: validation.IntAtLeast(125), }, "volume_size": { Type: schema.TypeInt, From ffae5511718b75c40811e1d394ef98f0e8a41528 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Fri, 10 Mar 2023 11:53:36 -0500 Subject: [PATCH 616/763] r/aws_opensearch_domain: Remove upper bound validation for 'ebs_options.throughput' as the 1,000 MB/s limit can be raised. --- .changelog/27598.txt | 4 ++++ internal/service/opensearch/domain.go | 2 +- website/docs/r/opensearch_domain.html.markdown | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/.changelog/27598.txt b/.changelog/27598.txt index 425ea33ed7cc..93aea7a8e3db 100644 --- a/.changelog/27598.txt +++ b/.changelog/27598.txt @@ -1,3 +1,7 @@ ```release-note:bug resource/aws_elasticsearch_domain: Remove upper bound validation for `ebs_options.throughput` as the 1,000 MB/s limit can be raised ``` + +```release-note:bug +resource/aws_opensearch_domain: Remove upper bound validation for `ebs_options.throughput` as the 1,000 MB/s limit can be raised +``` diff --git a/internal/service/opensearch/domain.go b/internal/service/opensearch/domain.go index 2006dc9a0cbc..3cb2a0c3ae9d 100644 --- a/internal/service/opensearch/domain.go +++ b/internal/service/opensearch/domain.go @@ -401,7 +401,7 @@ func ResourceDomain() *schema.Resource { Type: schema.TypeInt, Optional: true, Computed: true, - ValidateFunc: validation.IntBetween(125, 1000), + ValidateFunc: validation.IntAtLeast(125), }, "volume_size": { Type: schema.TypeInt, diff --git a/website/docs/r/opensearch_domain.html.markdown b/website/docs/r/opensearch_domain.html.markdown index 4529596e9d0b..b1fd3cb4fc25 100644 --- a/website/docs/r/opensearch_domain.html.markdown +++ b/website/docs/r/opensearch_domain.html.markdown @@ -400,7 +400,7 @@ AWS documentation: [Amazon Cognito Authentication for Kibana](https://docs.aws.a * `ebs_enabled` - (Required) Whether EBS volumes are attached to data nodes in the domain. * `iops` - (Optional) Baseline input/output (I/O) performance of EBS volumes attached to data nodes. Applicable only for the GP3 and Provisioned IOPS EBS volume types. -* `throughput` - (Required if `volume_type` is set to `gp3`) Specifies the throughput (in MiB/s) of the EBS volumes attached to data nodes. Applicable only for the gp3 volume type. Valid values are between `125` and `1000`. +* `throughput` - (Required if `volume_type` is set to `gp3`) Specifies the throughput (in MiB/s) of the EBS volumes attached to data nodes. Applicable only for the gp3 volume type. * `volume_size` - (Required if `ebs_enabled` is set to `true`.) Size of EBS volumes attached to data nodes (in GiB). * `volume_type` - (Optional) Type of EBS volumes attached to data nodes. From 191f929f3f23f7c52bd59a0879ca89ffdcebc688 Mon Sep 17 00:00:00 2001 From: Jared Baker Date: Fri, 10 Mar 2023 11:39:58 -0500 Subject: [PATCH 617/763] r/aws_sagemaker_endpoint_configuration: fix variant_name generation when unset --- internal/service/sagemaker/endpoint_configuration.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/service/sagemaker/endpoint_configuration.go b/internal/service/sagemaker/endpoint_configuration.go index bf756562510f..d7fff5d30109 100644 --- a/internal/service/sagemaker/endpoint_configuration.go +++ b/internal/service/sagemaker/endpoint_configuration.go @@ -619,8 +619,8 @@ func expandProductionVariants(configured []interface{}) []*sagemaker.ProductionV l.InstanceType = aws.String(v) } - if v, ok := data["variant_name"]; ok { - l.VariantName = aws.String(v.(string)) + if v, ok := data["variant_name"].(string); ok && v != "" { + l.VariantName = aws.String(v) } else { l.VariantName = aws.String(resource.UniqueId()) } From 284bf43c911c82435b361429b2fe779eafb4960b Mon Sep 17 00:00:00 2001 From: Jared Baker Date: Fri, 10 Mar 2023 11:53:50 -0500 Subject: [PATCH 618/763] r/aws_sagemaker_endpoint_configuration: variant_name generation test --- .../sagemaker/endpoint_configuration_test.go | 42 +++++++++++++++++++ 1 file changed, 42 insertions(+) diff --git a/internal/service/sagemaker/endpoint_configuration_test.go b/internal/service/sagemaker/endpoint_configuration_test.go index 5511846edc73..1556253c5002 100644 --- a/internal/service/sagemaker/endpoint_configuration_test.go +++ b/internal/service/sagemaker/endpoint_configuration_test.go @@ -179,6 +179,33 @@ func TestAccSageMakerEndpointConfiguration_ProductionVariants_acceleratorType(t }) } +func TestAccSageMakerEndpointConfiguration_ProductionVariants_variantNameGenerated(t *testing.T) { + ctx := acctest.Context(t) + rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) + resourceName := "aws_sagemaker_endpoint_configuration.test" + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { acctest.PreCheck(t) }, + ErrorCheck: acctest.ErrorCheck(t, sagemaker.EndpointsID), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + CheckDestroy: testAccCheckEndpointConfigurationDestroy(ctx), + Steps: []resource.TestStep{ + { + Config: testAccEndpointConfigurationConfig_productionVariantVariantNameGenerated(rName), + Check: resource.ComposeTestCheckFunc( + testAccCheckEndpointConfigurationExists(ctx, resourceName), + resource.TestCheckResourceAttrSet(resourceName, "production_variants.0.variant_name"), + ), + }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, + }, + }) +} + func TestAccSageMakerEndpointConfiguration_kmsKeyID(t *testing.T) { ctx := acctest.Context(t) rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) @@ -599,6 +626,21 @@ resource "aws_sagemaker_endpoint_configuration" "test" { `, rName)) } +func testAccEndpointConfigurationConfig_productionVariantVariantNameGenerated(rName string) string { + return acctest.ConfigCompose(testAccEndpointConfigurationConfig_base(rName), fmt.Sprintf(` +resource "aws_sagemaker_endpoint_configuration" "test" { + name = %[1]q + + production_variants { + model_name = aws_sagemaker_model.test.name + initial_instance_count = 2 + instance_type = "ml.t2.medium" + initial_variant_weight = 1 + } +} +`, rName)) +} + func testAccEndpointConfigurationConfig_kmsKeyID(rName string) string { return acctest.ConfigCompose(testAccEndpointConfigurationConfig_base(rName), fmt.Sprintf(` resource "aws_sagemaker_endpoint_configuration" "test" { From a1b316a957ef45c45b072b4aa39c6381163afe24 Mon Sep 17 00:00:00 2001 From: Jared Baker Date: Fri, 10 Mar 2023 11:44:53 -0500 Subject: [PATCH 619/763] chore: changelog --- .changelog/29915.txt | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 .changelog/29915.txt diff --git a/.changelog/29915.txt b/.changelog/29915.txt new file mode 100644 index 000000000000..e0312700084f --- /dev/null +++ b/.changelog/29915.txt @@ -0,0 +1,3 @@ +```release-note:bug +resource/aws_sagemaker_endpoint_configuration: Fix `variant_name` generation when unset +``` From a9c57b4a986836de996e8e0a18a922f5f885ac55 Mon Sep 17 00:00:00 2001 From: Adrian Johnson Date: Fri, 10 Mar 2023 10:59:58 -0600 Subject: [PATCH 620/763] remove CHANGELOG entry --- CHANGELOG.md | 1 - 1 file changed, 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ffb568c73097..31324b17ac57 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -62,7 +62,6 @@ ENHANCEMENTS: * resource/aws_network_interface_attachment: Added import capabilities for the resource ([#27364](https://github.com/hashicorp/terraform-provider-aws/issues/27364)) * resource/aws_sesv2_dedicated_ip_pool: Add `scaling_mode` attribute ([#27388](https://github.com/hashicorp/terraform-provider-aws/issues/27388)) * resource/aws_ssm_parameter: Support `aws:ssm:integration` as a valid value for `data_type` ([#27329](https://github.com/hashicorp/terraform-provider-aws/issues/27329)) -* resource/aws_appflow_flow: Add support for preserving source data types in the S3 output config ([#26372](https://github.com/hashicorp/terraform-provider-aws/issues/26372)) BUG FIXES: From 46074ce450114c2019db50888dea99213ee0c6d9 Mon Sep 17 00:00:00 2001 From: Adrian Johnson Date: Fri, 10 Mar 2023 11:10:35 -0600 Subject: [PATCH 621/763] r/aws_appflow_flow: remove attribute from upsolver --- internal/service/appflow/flow.go | 4 ---- 1 file changed, 4 deletions(-) diff --git a/internal/service/appflow/flow.go b/internal/service/appflow/flow.go index 69b58420fb61..b169c10e4fb0 100644 --- a/internal/service/appflow/flow.go +++ b/internal/service/appflow/flow.go @@ -620,10 +620,6 @@ func ResourceFlow() *schema.Resource { }, }, }, - "preserve_source_data_typing": { - Type: schema.TypeBool, - Optional: true, - }, }, }, }, From d69340184abcbb22174a364a50d876d3302f36e5 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Fri, 10 Mar 2023 12:12:02 -0500 Subject: [PATCH 622/763] Revert "Revert "Update CHANGELOG.md"" This reverts commit 2b6ab2fb28027d243d2a577a67256c952e456d11. --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 28e29c9462d0..d43059855534 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -20,6 +20,7 @@ ENHANCEMENTS: * data-source/aws_identitystore_group: Add `alternate_identifier` argument and `description` attribute ([#27762](https://github.com/hashicorp/terraform-provider-aws/issues/27762)) * resource/aws_connect_instance: Add `multi_party_conference_enabled` argument ([#27734](https://github.com/hashicorp/terraform-provider-aws/issues/27734)) * resource/aws_msk_cluster: Add `storage_mode` argument ([#27546](https://github.com/hashicorp/terraform-provider-aws/issues/27546)) +resource/aws_cognito_user_pool_domain: Add `cloudfront_distribution_zone_id` attribute ([#27790](https://github.com/hashicorp/terraform-provider-aws/pull/27790)) ## 4.39.0 (November 10, 2022) From 1c608246e1fca71f26eea7b6246beab52b897331 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Fri, 10 Mar 2023 12:12:15 -0500 Subject: [PATCH 623/763] Revert "Revert "Fix formatting"" This reverts commit e86eb6bc7163f61f35312f97418bc69b2644fe26. --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d43059855534..95a3608cf91a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -20,7 +20,7 @@ ENHANCEMENTS: * data-source/aws_identitystore_group: Add `alternate_identifier` argument and `description` attribute ([#27762](https://github.com/hashicorp/terraform-provider-aws/issues/27762)) * resource/aws_connect_instance: Add `multi_party_conference_enabled` argument ([#27734](https://github.com/hashicorp/terraform-provider-aws/issues/27734)) * resource/aws_msk_cluster: Add `storage_mode` argument ([#27546](https://github.com/hashicorp/terraform-provider-aws/issues/27546)) -resource/aws_cognito_user_pool_domain: Add `cloudfront_distribution_zone_id` attribute ([#27790](https://github.com/hashicorp/terraform-provider-aws/pull/27790)) +* resource/aws_cognito_user_pool_domain: Add `cloudfront_distribution_zone_id` attribute ([#27790](https://github.com/hashicorp/terraform-provider-aws/pull/27790)) ## 4.39.0 (November 10, 2022) From e2e25b93eed10267de0bdd9b5272c5b15c6cfb36 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Fri, 10 Mar 2023 12:12:22 -0500 Subject: [PATCH 624/763] Revert "Fix formatting" This reverts commit 7770c8b7c73b99b0e12238283d6746f3bf4806a4. --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 95a3608cf91a..d43059855534 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -20,7 +20,7 @@ ENHANCEMENTS: * data-source/aws_identitystore_group: Add `alternate_identifier` argument and `description` attribute ([#27762](https://github.com/hashicorp/terraform-provider-aws/issues/27762)) * resource/aws_connect_instance: Add `multi_party_conference_enabled` argument ([#27734](https://github.com/hashicorp/terraform-provider-aws/issues/27734)) * resource/aws_msk_cluster: Add `storage_mode` argument ([#27546](https://github.com/hashicorp/terraform-provider-aws/issues/27546)) -* resource/aws_cognito_user_pool_domain: Add `cloudfront_distribution_zone_id` attribute ([#27790](https://github.com/hashicorp/terraform-provider-aws/pull/27790)) +resource/aws_cognito_user_pool_domain: Add `cloudfront_distribution_zone_id` attribute ([#27790](https://github.com/hashicorp/terraform-provider-aws/pull/27790)) ## 4.39.0 (November 10, 2022) From 1a8f503c70ea8752a4646503867d20d7b158f83f Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Fri, 10 Mar 2023 12:12:29 -0500 Subject: [PATCH 625/763] Revert "Update CHANGELOG.md" This reverts commit e2cb013b15ff39e457b61dd910c0328f368e8ec7. --- CHANGELOG.md | 1 - 1 file changed, 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d43059855534..28e29c9462d0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -20,7 +20,6 @@ ENHANCEMENTS: * data-source/aws_identitystore_group: Add `alternate_identifier` argument and `description` attribute ([#27762](https://github.com/hashicorp/terraform-provider-aws/issues/27762)) * resource/aws_connect_instance: Add `multi_party_conference_enabled` argument ([#27734](https://github.com/hashicorp/terraform-provider-aws/issues/27734)) * resource/aws_msk_cluster: Add `storage_mode` argument ([#27546](https://github.com/hashicorp/terraform-provider-aws/issues/27546)) -resource/aws_cognito_user_pool_domain: Add `cloudfront_distribution_zone_id` attribute ([#27790](https://github.com/hashicorp/terraform-provider-aws/pull/27790)) ## 4.39.0 (November 10, 2022) From 25a95cf9ddc103f59abebfab9d42adb652073346 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Fri, 10 Mar 2023 12:12:35 -0500 Subject: [PATCH 626/763] Revert "Add cloudfront_distribution_zone_id parameter to aws_cognito_user_pool_domain" This reverts commit 60f8fe2cf157a6a291c2a6429c8b2cebcd0ecce6. --- .../service/cognitoidp/user_pool_domain.go | 23 ------------------- .../cognitoidp/user_pool_domain_test.go | 1 - .../docs/r/cognito_user_pool_domain.markdown | 5 ++-- 3 files changed, 3 insertions(+), 26 deletions(-) diff --git a/internal/service/cognitoidp/user_pool_domain.go b/internal/service/cognitoidp/user_pool_domain.go index 1fe6850e8b76..f9c71fdcdda3 100644 --- a/internal/service/cognitoidp/user_pool_domain.go +++ b/internal/service/cognitoidp/user_pool_domain.go @@ -7,7 +7,6 @@ import ( "time" "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/endpoints" "github.com/aws/aws-sdk-go/service/cognitoidentityprovider" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" @@ -18,15 +17,6 @@ import ( "github.com/hashicorp/terraform-provider-aws/names" ) -// route53ZoneID defines the route 53 zone ID for CloudFront. This -// is used to set the zone_id attribute. -const route53ZoneID = "Z2FDTNDATAQYW2" - -// cnRoute53ZoneID defines the route 53 zone ID for CloudFront in AWS CN. -// This is used to set the zone_id attribute. -// ref: https://docs.amazonaws.cn/en_us/aws/latest/userguide/route53.html -const cnRoute53ZoneID = "Z3RFFRIM2A3IF5" - func ResourceUserPoolDomain() *schema.Resource { return &schema.Resource{ Create: resourceUserPoolDomainCreate, @@ -62,10 +52,6 @@ func ResourceUserPoolDomain() *schema.Resource { Type: schema.TypeString, Computed: true, }, - "cloudfront_distribution_zone_id": { - Type: schema.TypeString, - Computed: true, - }, "s3_bucket": { Type: schema.TypeString, Computed: true, @@ -150,15 +136,6 @@ func resourceUserPoolDomainRead(d *schema.ResourceData, meta interface{}) error } d.Set("aws_account_id", desc.AWSAccountId) d.Set("cloudfront_distribution_arn", desc.CloudFrontDistribution) - - // override hosted_zone_id from flattenDistributionConfig - region := meta.(*conns.AWSClient).Region - if v, ok := endpoints.PartitionForRegion(endpoints.DefaultPartitions(), region); ok && v.ID() == endpoints.AwsCnPartitionID { - d.Set("cloudfront_distribution_zone_id", cnRoute53ZoneID) - } else { - d.Set("cloudfront_distribution_zone_id", route53ZoneID) - } - d.Set("s3_bucket", desc.S3Bucket) d.Set("user_pool_id", desc.UserPoolId) d.Set("version", desc.Version) diff --git a/internal/service/cognitoidp/user_pool_domain_test.go b/internal/service/cognitoidp/user_pool_domain_test.go index 50db08474c91..5da97d4617c9 100644 --- a/internal/service/cognitoidp/user_pool_domain_test.go +++ b/internal/service/cognitoidp/user_pool_domain_test.go @@ -35,7 +35,6 @@ func TestAccCognitoIDPUserPoolDomain_basic(t *testing.T) { resource.TestCheckResourceAttr("aws_cognito_user_pool.main", "name", poolName), resource.TestCheckResourceAttrSet("aws_cognito_user_pool_domain.main", "aws_account_id"), resource.TestCheckResourceAttrSet("aws_cognito_user_pool_domain.main", "cloudfront_distribution_arn"), - resource.TestCheckResourceAttr("aws_cognito_user_pool_domain.main", "cloudfront_distribution_zone_id", "Z2FDTNDATAQYW2"), resource.TestCheckResourceAttrSet("aws_cognito_user_pool_domain.main", "s3_bucket"), resource.TestCheckResourceAttrSet("aws_cognito_user_pool_domain.main", "version"), ), diff --git a/website/docs/r/cognito_user_pool_domain.markdown b/website/docs/r/cognito_user_pool_domain.markdown index 5bdf0727190e..da3149666050 100644 --- a/website/docs/r/cognito_user_pool_domain.markdown +++ b/website/docs/r/cognito_user_pool_domain.markdown @@ -48,8 +48,9 @@ resource "aws_route53_record" "auth-cognito-A" { zone_id = data.aws_route53_zone.example.zone_id alias { evaluate_target_health = false - name = aws_cognito_user_pool_domain.main.cloudfront_distribution_arn - zone_id = aws_cognito_user_pool_domain.main.cloudfront_distribution_zone_id + name = aws_cognito_user_pool_domain.main.cloudfront_distribution_arn + # This zone_id is fixed + zone_id = "Z2FDTNDATAQYW2" } } ``` From 21dbb9444b246ef6dad489d222ed4e617cfab53a Mon Sep 17 00:00:00 2001 From: Adrian Johnson Date: Fri, 10 Mar 2023 11:14:35 -0600 Subject: [PATCH 627/763] add CHANGLOG entry --- .changelog/27616.txt | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 .changelog/27616.txt diff --git a/.changelog/27616.txt b/.changelog/27616.txt new file mode 100644 index 000000000000..80a02a006dbd --- /dev/null +++ b/.changelog/27616.txt @@ -0,0 +1,3 @@ +```release-note:enhancement +resource/aws_appflow_flow: Add attribute `preserve_source_data_typing` to `s3_output_format_config` in `s3` +``` \ No newline at end of file From 07201e958b0de3b9bad13b674658d376400ac98a Mon Sep 17 00:00:00 2001 From: Adrian Johnson Date: Fri, 10 Mar 2023 11:52:21 -0600 Subject: [PATCH 628/763] r/aws_appflow_flow: add test --- internal/service/appflow/flow_test.go | 117 ++++++++++++++++++++++++++ 1 file changed, 117 insertions(+) diff --git a/internal/service/appflow/flow_test.go b/internal/service/appflow/flow_test.go index 3dccea858c8b..6ac477f43e3e 100644 --- a/internal/service/appflow/flow_test.go +++ b/internal/service/appflow/flow_test.go @@ -68,6 +68,53 @@ func TestAccAppFlowFlow_basic(t *testing.T) { }) } +func TestAccAppFlowFlow_S3_outputFormatConfig_ParquetFileType(t *testing.T) { + ctx := acctest.Context(t) + var flowOutput appflow.FlowDefinition + rSourceName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) + rDestinationName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) + rFlowName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) + resourceName := "aws_appflow_flow.test" + scheduleStartTime := time.Now().UTC().AddDate(0, 0, 1).Format(time.RFC3339) + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { acctest.PreCheck(t) }, + ErrorCheck: acctest.ErrorCheck(t, appflow.EndpointsID), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + CheckDestroy: testAccCheckFlowDestroy(ctx), + Steps: []resource.TestStep{ + { + Config: testAccFlowConfig_S3_OutputFormatConfig_ParquetFileType(rSourceName, rDestinationName, rFlowName, scheduleStartTime, "PARQUET", true), + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheckFlowExists(ctx, resourceName, &flowOutput), + resource.TestCheckResourceAttrSet(resourceName, "destination_flow_config.#"), + resource.TestCheckResourceAttrSet(resourceName, "destination_flow_config.0.connector_type"), + resource.TestCheckResourceAttrSet(resourceName, "destination_flow_config.0.destination_connector_properties.#"), + resource.TestCheckResourceAttr(resourceName, "destination_flow_config.0.destination_connector_properties.0.s3.0.s3_output_format_config.0.preserve_source_data_typing", "true"), + resource.TestCheckResourceAttr(resourceName, "destination_flow_config.0.destination_connector_properties.0.s3.0.s3_output_format_config.0.file_type", "PARQUET"), + resource.TestCheckResourceAttrSet(resourceName, "task.#"), + resource.TestCheckResourceAttrSet(resourceName, "task.0.source_fields.#"), + resource.TestCheckResourceAttrSet(resourceName, "task.0.task_type"), + ), + }, + { + Config: testAccFlowConfig_S3_OutputFormatConfig_ParquetFileType(rSourceName, rDestinationName, rFlowName, scheduleStartTime, "PARQUET", false), + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheckFlowExists(ctx, resourceName, &flowOutput), + resource.TestCheckResourceAttrSet(resourceName, "destination_flow_config.#"), + resource.TestCheckResourceAttrSet(resourceName, "destination_flow_config.0.connector_type"), + resource.TestCheckResourceAttrSet(resourceName, "destination_flow_config.0.destination_connector_properties.#"), + resource.TestCheckResourceAttr(resourceName, "destination_flow_config.0.destination_connector_properties.0.s3.0.s3_output_format_config.0.preserve_source_data_typing", "false"), + resource.TestCheckResourceAttr(resourceName, "destination_flow_config.0.destination_connector_properties.0.s3.0.s3_output_format_config.0.file_type", "PARQUET"), + resource.TestCheckResourceAttrSet(resourceName, "task.#"), + resource.TestCheckResourceAttrSet(resourceName, "task.0.source_fields.#"), + resource.TestCheckResourceAttrSet(resourceName, "task.0.task_type"), + ), + }, + }, + }) +} + func TestAccAppFlowFlow_update(t *testing.T) { ctx := acctest.Context(t) var flowOutput appflow.FlowDefinition @@ -344,6 +391,76 @@ resource "aws_appflow_flow" "test" { ) } +func testAccFlowConfig_S3_OutputFormatConfig_ParquetFileType(rSourceName, rDestinationName, rFlowName, scheduleStartTime, fileType string, preserveSourceDataTyping bool) string { + return acctest.ConfigCompose( + testAccFlowConfig_base(rSourceName, rDestinationName), + fmt.Sprintf(` +resource "aws_appflow_flow" "test" { + name = %[1]q + + source_flow_config { + connector_type = "S3" + source_connector_properties { + s3 { + bucket_name = aws_s3_bucket_policy.test_source.bucket + bucket_prefix = "flow" + } + } + } + + destination_flow_config { + connector_type = "S3" + destination_connector_properties { + s3 { + bucket_name = aws_s3_bucket_policy.test_destination.bucket + + s3_output_format_config { + prefix_config { + prefix_type = "PATH" + } + + file_type = %[3]q + preserve_source_data_typing = %[4]t + + aggregation_config { + aggregation_type = "None" + } + } + } + } + } + + task { + source_fields = ["testField"] + destination_field = "testField" + task_type = "Map" + + task_properties = { + "DESTINATION_DATA_TYPE" = "string" + "SOURCE_DATA_TYPE" = "string" + } + + connector_operator { + s3 = "NO_OP" + } + } + + trigger_config { + trigger_type = "Scheduled" + + trigger_properties { + scheduled { + data_pull_mode = "Incremental" + schedule_expression = "rate(3hours)" + schedule_start_time = %[2]q + } + } + } +} +`, rFlowName, scheduleStartTime, fileType, preserveSourceDataTyping), + ) +} + func testAccFlowConfig_update(rSourceName string, rDestinationName string, rFlowName string, description string) string { return acctest.ConfigCompose( testAccFlowConfig_base(rSourceName, rDestinationName), From 2915747cabbf33183a7d3e0fe5c69bec2eacc34f Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Fri, 10 Mar 2023 13:28:55 -0500 Subject: [PATCH 629/763] r/aws_cognito_user_pool_domain: Tidy up non-custom domain acceptance tests. Acceptance test output: % make testacc TESTARGS='-run=TestAccCognitoIDPUserPoolDomain_basic' PKG=cognitoidp ACCTEST_PARALLELISM=3 ==> Checking that code complies with gofmt requirements... TF_ACC=1 go test ./internal/service/cognitoidp/... -v -count 1 -parallel 3 -run=TestAccCognitoIDPUserPoolDomain_basic -timeout 180m === RUN TestAccCognitoIDPUserPoolDomain_basic === PAUSE TestAccCognitoIDPUserPoolDomain_basic === CONT TestAccCognitoIDPUserPoolDomain_basic --- PASS: TestAccCognitoIDPUserPoolDomain_basic (29.00s) PASS ok github.com/hashicorp/terraform-provider-aws/internal/service/cognitoidp 36.617s --- .../cognitoidp/user_pool_domain_test.go | 80 +++++++++---------- 1 file changed, 39 insertions(+), 41 deletions(-) diff --git a/internal/service/cognitoidp/user_pool_domain_test.go b/internal/service/cognitoidp/user_pool_domain_test.go index 5da97d4617c9..edc8c0bc70e1 100644 --- a/internal/service/cognitoidp/user_pool_domain_test.go +++ b/internal/service/cognitoidp/user_pool_domain_test.go @@ -18,8 +18,8 @@ import ( ) func TestAccCognitoIDPUserPoolDomain_basic(t *testing.T) { - domainName := fmt.Sprintf("tf-acc-test-domain-%d", sdkacctest.RandInt()) - poolName := fmt.Sprintf("tf-acc-test-pool-%s", sdkacctest.RandString(10)) + rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) + resourceName := "aws_cognito_user_pool_domain.test" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { acctest.PreCheck(t); testAccPreCheckIdentityProvider(t) }, @@ -28,19 +28,18 @@ func TestAccCognitoIDPUserPoolDomain_basic(t *testing.T) { CheckDestroy: testAccCheckUserPoolDomainDestroy, Steps: []resource.TestStep{ { - Config: testAccUserPoolDomainConfig_basic(domainName, poolName), + Config: testAccUserPoolDomainConfig_basic(rName), Check: resource.ComposeAggregateTestCheckFunc( - testAccCheckUserPoolDomainExists("aws_cognito_user_pool_domain.main"), - resource.TestCheckResourceAttr("aws_cognito_user_pool_domain.main", "domain", domainName), - resource.TestCheckResourceAttr("aws_cognito_user_pool.main", "name", poolName), - resource.TestCheckResourceAttrSet("aws_cognito_user_pool_domain.main", "aws_account_id"), - resource.TestCheckResourceAttrSet("aws_cognito_user_pool_domain.main", "cloudfront_distribution_arn"), - resource.TestCheckResourceAttrSet("aws_cognito_user_pool_domain.main", "s3_bucket"), - resource.TestCheckResourceAttrSet("aws_cognito_user_pool_domain.main", "version"), + testAccCheckUserPoolDomainExists(resourceName), + acctest.CheckResourceAttrAccountID(resourceName, "aws_account_id"), + resource.TestCheckResourceAttrSet(resourceName, "cloudfront_distribution_arn"), + resource.TestCheckResourceAttr(resourceName, "domain", rName), + resource.TestCheckResourceAttrSet(resourceName, "s3_bucket"), + resource.TestCheckResourceAttrSet(resourceName, "version"), ), }, { - ResourceName: "aws_cognito_user_pool_domain.main", + ResourceName: resourceName, ImportState: true, ImportStateVerify: true, }, @@ -48,6 +47,28 @@ func TestAccCognitoIDPUserPoolDomain_basic(t *testing.T) { }) } +func TestAccCognitoIDPUserPoolDomain_disappears(t *testing.T) { + rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) + resourceName := "aws_cognito_user_pool_domain.test" + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { acctest.PreCheck(t); testAccPreCheckIdentityProvider(t) }, + ErrorCheck: acctest.ErrorCheck(t, cognitoidentityprovider.EndpointsID), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + CheckDestroy: testAccCheckUserPoolDomainDestroy, + Steps: []resource.TestStep{ + { + Config: testAccUserPoolDomainConfig_basic(rName), + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheckUserPoolDomainExists(resourceName), + acctest.CheckResourceDisappears(acctest.Provider, tfcognitoidp.ResourceUserPoolDomain(), resourceName), + ), + ExpectNonEmptyPlan: true, + }, + }, + }) +} + func TestAccCognitoIDPUserPoolDomain_custom(t *testing.T) { rootDomain := acctest.ACMCertificateDomainFromEnv(t) domain := acctest.ACMCertificateRandomSubDomain(rootDomain) @@ -86,29 +107,6 @@ func TestAccCognitoIDPUserPoolDomain_custom(t *testing.T) { }) } -func TestAccCognitoIDPUserPoolDomain_disappears(t *testing.T) { - domainName := fmt.Sprintf("tf-acc-test-domain-%d", sdkacctest.RandInt()) - poolName := fmt.Sprintf("tf-acc-test-pool-%s", sdkacctest.RandString(10)) - resourceName := "aws_cognito_user_pool_domain.main" - - resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckIdentityProvider(t) }, - ErrorCheck: acctest.ErrorCheck(t, cognitoidentityprovider.EndpointsID), - ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - CheckDestroy: testAccCheckUserPoolDomainDestroy, - Steps: []resource.TestStep{ - { - Config: testAccUserPoolDomainConfig_basic(domainName, poolName), - Check: resource.ComposeAggregateTestCheckFunc( - testAccCheckUserPoolDomainExists(resourceName), - acctest.CheckResourceDisappears(acctest.Provider, tfcognitoidp.ResourceUserPoolDomain(), resourceName), - ), - ExpectNonEmptyPlan: true, - }, - }, - }) -} - func testAccCheckUserPoolDomainExists(n string) resource.TestCheckFunc { return func(s *terraform.State) error { rs, ok := s.RootModule().Resources[n] @@ -153,17 +151,17 @@ func testAccCheckUserPoolDomainDestroy(s *terraform.State) error { return nil } -func testAccUserPoolDomainConfig_basic(domainName, poolName string) string { +func testAccUserPoolDomainConfig_basic(rName string) string { return fmt.Sprintf(` -resource "aws_cognito_user_pool_domain" "main" { - domain = "%s" - user_pool_id = aws_cognito_user_pool.main.id +resource "aws_cognito_user_pool_domain" "test" { + domain = %[1]q + user_pool_id = aws_cognito_user_pool.test.id } -resource "aws_cognito_user_pool" "main" { - name = "%s" +resource "aws_cognito_user_pool" "test" { + name = %[1]q } -`, domainName, poolName) +`, rName) } func testAccUserPoolDomainConfig_custom(rootDomain string, domain string, poolName string) string { From 6320a5e8c176751ff18591ba32348b46d033447b Mon Sep 17 00:00:00 2001 From: changelogbot Date: Fri, 10 Mar 2023 18:38:33 +0000 Subject: [PATCH 630/763] Update CHANGELOG.md for #29915 --- CHANGELOG.md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9fb5bc4b360f..12ed90bca2f9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,20 @@ ## 4.59.0 (Unreleased) + +ENHANCEMENTS: + +* data-source/aws_ce_cost_category: Add `default_value` attribute ([#29291](https://github.com/hashicorp/terraform-provider-aws/issues/29291)) +* resource/aws_appflow_flow: Add attribute `preserve_source_data_typing` to `s3_output_format_config` in `s3` ([#27616](https://github.com/hashicorp/terraform-provider-aws/issues/27616)) +* resource/aws_glue_crawler: Add `create_native_delta_table` attribute to the `delta_target` configuration block ([#29566](https://github.com/hashicorp/terraform-provider-aws/issues/29566)) +* resource/aws_qldb_ledger: Add configurable timeouts ([#29635](https://github.com/hashicorp/terraform-provider-aws/issues/29635)) +* resource/aws_s3_bucket: Add error handling for `XNotImplemented` errors when reading `acceleration_status`, 'request_payer`, `lifecycle_rule`, `logging`, or `replication_configuration` into terraform state. ([#29632](https://github.com/hashicorp/terraform-provider-aws/issues/29632)) + +BUG FIXES: + +* resource/aws_apigatewayv2_integration: Retry errors like `ConflictException: Unable to complete operation due to concurrent modification. Please try again later.` ([#29735](https://github.com/hashicorp/terraform-provider-aws/issues/29735)) +* resource/aws_elasticsearch_domain: Remove upper bound validation for `ebs_options.throughput` as the 1,000 MB/s limit can be raised ([#27598](https://github.com/hashicorp/terraform-provider-aws/issues/27598)) +* resource/aws_opensearch_domain: Remove upper bound validation for `ebs_options.throughput` as the 1,000 MB/s limit can be raised ([#27598](https://github.com/hashicorp/terraform-provider-aws/issues/27598)) +* resource/aws_sagemaker_endpoint_configuration: Fix `variant_name` generation when unset ([#29915](https://github.com/hashicorp/terraform-provider-aws/issues/29915)) + ## 4.58.0 (March 10, 2023) FEATURES: From 28bb7859cd66d6388b96a6e867a0b7ec01aff8f8 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Fri, 10 Mar 2023 13:59:18 -0500 Subject: [PATCH 631/763] Update 29632.txt --- .changelog/29632.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.changelog/29632.txt b/.changelog/29632.txt index e0ccf2be7b64..e5cbbc8fa4b4 100644 --- a/.changelog/29632.txt +++ b/.changelog/29632.txt @@ -1,3 +1,3 @@ ```release-note:enhancement -resource/aws_s3_bucket: Add error handling for `XNotImplemented` errors when reading `acceleration_status`, 'request_payer`, `lifecycle_rule`, `logging`, or `replication_configuration` into terraform state. +resource/aws_s3_bucket: Add error handling for `XNotImplemented` errors when reading `acceleration_status`, `request_payer`, `lifecycle_rule`, `logging`, or `replication_configuration` into terraform state. ``` From fd804cfc4e30d3dce111623fd1899bae52595100 Mon Sep 17 00:00:00 2001 From: changelogbot Date: Fri, 10 Mar 2023 19:05:08 +0000 Subject: [PATCH 632/763] Update CHANGELOG.md for #29916 --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 12ed90bca2f9..5cb04953ae65 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,7 +6,7 @@ ENHANCEMENTS: * resource/aws_appflow_flow: Add attribute `preserve_source_data_typing` to `s3_output_format_config` in `s3` ([#27616](https://github.com/hashicorp/terraform-provider-aws/issues/27616)) * resource/aws_glue_crawler: Add `create_native_delta_table` attribute to the `delta_target` configuration block ([#29566](https://github.com/hashicorp/terraform-provider-aws/issues/29566)) * resource/aws_qldb_ledger: Add configurable timeouts ([#29635](https://github.com/hashicorp/terraform-provider-aws/issues/29635)) -* resource/aws_s3_bucket: Add error handling for `XNotImplemented` errors when reading `acceleration_status`, 'request_payer`, `lifecycle_rule`, `logging`, or `replication_configuration` into terraform state. ([#29632](https://github.com/hashicorp/terraform-provider-aws/issues/29632)) +* resource/aws_s3_bucket: Add error handling for `XNotImplemented` errors when reading `acceleration_status`, `request_payer`, `lifecycle_rule`, `logging`, or `replication_configuration` into terraform state. ([#29632](https://github.com/hashicorp/terraform-provider-aws/issues/29632)) BUG FIXES: From 836db0267e5ae905e736d5e17f16e586e0ba60f1 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Fri, 10 Mar 2023 14:09:59 -0500 Subject: [PATCH 633/763] r/aws_cognito_user_pool_domain: Add 'FindUserPoolDomain'. Acceptance test output: % make testacc TESTARGS='-run=TestAccCognitoIDPUserPoolDomain_basic\|TestAccCognitoIDPUserPoolDomain_disappears' PKG=cognitoidp ACCTEST_PARALLELISM=3 ==> Checking that code complies with gofmt requirements... TF_ACC=1 go test ./internal/service/cognitoidp/... -v -count 1 -parallel 3 -run=TestAccCognitoIDPUserPoolDomain_basic\|TestAccCognitoIDPUserPoolDomain_disappears -timeout 180m === RUN TestAccCognitoIDPUserPoolDomain_basic === PAUSE TestAccCognitoIDPUserPoolDomain_basic === RUN TestAccCognitoIDPUserPoolDomain_disappears === PAUSE TestAccCognitoIDPUserPoolDomain_disappears === CONT TestAccCognitoIDPUserPoolDomain_basic === CONT TestAccCognitoIDPUserPoolDomain_disappears --- PASS: TestAccCognitoIDPUserPoolDomain_disappears (20.23s) --- PASS: TestAccCognitoIDPUserPoolDomain_basic (22.65s) PASS ok github.com/hashicorp/terraform-provider-aws/internal/service/cognitoidp 29.843s --- internal/service/cognitoidp/status.go | 35 ---- .../service/cognitoidp/user_pool_domain.go | 171 ++++++++++++------ .../cognitoidp/user_pool_domain_test.go | 20 +- internal/service/cognitoidp/wait.go | 57 ------ 4 files changed, 127 insertions(+), 156 deletions(-) delete mode 100644 internal/service/cognitoidp/status.go delete mode 100644 internal/service/cognitoidp/wait.go diff --git a/internal/service/cognitoidp/status.go b/internal/service/cognitoidp/status.go deleted file mode 100644 index b72f319e142f..000000000000 --- a/internal/service/cognitoidp/status.go +++ /dev/null @@ -1,35 +0,0 @@ -package cognitoidp - -import ( - "context" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/service/cognitoidentityprovider" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" -) - -const ( - userPoolDomainStatusNotFound = "NotFound" - userPoolDomainStatusUnknown = "Unknown" -) - -// statusUserPoolDomain fetches the Operation and its Status -func statusUserPoolDomain(ctx context.Context, conn *cognitoidentityprovider.CognitoIdentityProvider, domain string) resource.StateRefreshFunc { - return func() (interface{}, string, error) { - input := &cognitoidentityprovider.DescribeUserPoolDomainInput{ - Domain: aws.String(domain), - } - - output, err := conn.DescribeUserPoolDomainWithContext(ctx, input) - - if err != nil { - return nil, userPoolDomainStatusUnknown, err - } - - if output == nil { - return nil, userPoolDomainStatusNotFound, nil - } - - return output, aws.StringValue(output.DomainDescription.Status), nil - } -} diff --git a/internal/service/cognitoidp/user_pool_domain.go b/internal/service/cognitoidp/user_pool_domain.go index 4cbfc93d3787..734e1f12bef2 100644 --- a/internal/service/cognitoidp/user_pool_domain.go +++ b/internal/service/cognitoidp/user_pool_domain.go @@ -2,7 +2,6 @@ package cognitoidp import ( "context" - "errors" "log" "time" @@ -10,11 +9,13 @@ import ( "github.com/aws/aws-sdk-go/service/cognitoidentityprovider" "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/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" "github.com/hashicorp/terraform-provider-aws/internal/verify" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -25,16 +26,15 @@ func ResourceUserPoolDomain() *schema.Resource { CreateWithoutTimeout: resourceUserPoolDomainCreate, ReadWithoutTimeout: resourceUserPoolDomainRead, DeleteWithoutTimeout: resourceUserPoolDomainDelete, + Importer: &schema.ResourceImporter{ StateContext: schema.ImportStatePassthroughContext, }, Schema: map[string]*schema.Schema{ - "domain": { - Type: schema.TypeString, - Required: true, - ForceNew: true, - ValidateFunc: validation.StringLenBetween(1, 63), + "aws_account_id": { + Type: schema.TypeString, + Computed: true, }, "certificate_arn": { Type: schema.TypeString, @@ -42,23 +42,25 @@ func ResourceUserPoolDomain() *schema.Resource { ForceNew: true, ValidateFunc: verify.ValidARN, }, - "user_pool_id": { - Type: schema.TypeString, - Required: true, - ForceNew: true, - }, - "aws_account_id": { - Type: schema.TypeString, - Computed: true, - }, "cloudfront_distribution_arn": { Type: schema.TypeString, Computed: true, }, + "domain": { + Type: schema.TypeString, + Required: true, + ForceNew: true, + ValidateFunc: validation.StringLenBetween(1, 63), + }, "s3_bucket": { Type: schema.TypeString, Computed: true, }, + "user_pool_id": { + Type: schema.TypeString, + Required: true, + ForceNew: true, + }, "version": { Type: schema.TypeString, Computed: true, @@ -72,33 +74,29 @@ func resourceUserPoolDomainCreate(ctx context.Context, d *schema.ResourceData, m conn := meta.(*conns.AWSClient).CognitoIDPConn() domain := d.Get("domain").(string) - - timeout := 1 * time.Minute //Default timeout for a basic domain - - params := &cognitoidentityprovider.CreateUserPoolDomainInput{ + timeout := 1 * time.Minute + input := &cognitoidentityprovider.CreateUserPoolDomainInput{ Domain: aws.String(domain), UserPoolId: aws.String(d.Get("user_pool_id").(string)), } if v, ok := d.GetOk("certificate_arn"); ok { - customDomainConfig := &cognitoidentityprovider.CustomDomainConfigType{ + input.CustomDomainConfig = &cognitoidentityprovider.CustomDomainConfigType{ CertificateArn: aws.String(v.(string)), } - params.CustomDomainConfig = customDomainConfig - timeout = 60 * time.Minute //Custom domains take more time to become active + timeout = 60 * time.Minute // Custom domains take more time to become active. } - log.Printf("[DEBUG] Creating Cognito User Pool Domain: %s", params) + _, err := conn.CreateUserPoolDomainWithContext(ctx, input) - _, err := conn.CreateUserPoolDomainWithContext(ctx, params) if err != nil { - return sdkdiag.AppendErrorf(diags, "Error creating Cognito User Pool Domain: %s", err) + return sdkdiag.AppendErrorf(diags, "creating Cognito User Pool Domain (%s): %s", domain, err) } d.SetId(domain) if _, err := waitUserPoolDomainCreated(ctx, conn, d.Id(), timeout); err != nil { - return sdkdiag.AppendErrorf(diags, "waiting for User Pool Domain (%s) creation: %s", d.Id(), err) + return sdkdiag.AppendErrorf(diags, "waiting for Cognito User Pool Domain (%s) create: %s", d.Id(), err) } return append(diags, resourceUserPoolDomainRead(ctx, d, meta)...) @@ -107,40 +105,26 @@ func resourceUserPoolDomainCreate(ctx context.Context, d *schema.ResourceData, m func resourceUserPoolDomainRead(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { var diags diag.Diagnostics conn := meta.(*conns.AWSClient).CognitoIDPConn() - log.Printf("[DEBUG] Reading Cognito User Pool Domain: %s", d.Id()) - - domain, err := conn.DescribeUserPoolDomainWithContext(ctx, &cognitoidentityprovider.DescribeUserPoolDomainInput{ - Domain: aws.String(d.Id()), - }) - if !d.IsNewResource() && tfawserr.ErrCodeEquals(err, cognitoidentityprovider.ErrCodeResourceNotFoundException) { - create.LogNotFoundRemoveState(names.CognitoIDP, create.ErrActionReading, ResNameUserPoolDomain, d.Id()) - d.SetId("") - return diags - } - if err != nil { - return create.DiagError(names.CognitoIDP, create.ErrActionReading, ResNameUserPoolDomain, d.Id(), err) - } + desc, err := FindUserPoolDomain(ctx, conn, d.Id()) - desc := domain.DomainDescription - - if !d.IsNewResource() && desc.Status == nil { + if !d.IsNewResource() && tfresource.NotFound(err) { create.LogNotFoundRemoveState(names.CognitoIDP, create.ErrActionReading, ResNameUserPoolDomain, d.Id()) d.SetId("") return diags } - if d.IsNewResource() && desc.Status == nil { - return create.DiagError(names.CognitoIDP, create.ErrActionReading, ResNameUserPoolDomain, d.Id(), errors.New("not found after creation")) + if err != nil { + return sdkdiag.AppendErrorf(diags, "reading Cognito User Pool Domain (%s): %s", d.Id(), err) } - d.Set("domain", d.Id()) + d.Set("aws_account_id", desc.AWSAccountId) d.Set("certificate_arn", "") if desc.CustomDomainConfig != nil { d.Set("certificate_arn", desc.CustomDomainConfig.CertificateArn) } - d.Set("aws_account_id", desc.AWSAccountId) d.Set("cloudfront_distribution_arn", desc.CloudFrontDistribution) + d.Set("domain", d.Id()) d.Set("s3_bucket", desc.S3Bucket) d.Set("user_pool_id", desc.UserPoolId) d.Set("version", desc.Version) @@ -151,22 +135,103 @@ func resourceUserPoolDomainRead(ctx context.Context, d *schema.ResourceData, met func resourceUserPoolDomainDelete(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { var diags diag.Diagnostics conn := meta.(*conns.AWSClient).CognitoIDPConn() - log.Printf("[DEBUG] Deleting Cognito User Pool Domain: %s", d.Id()) + log.Printf("[DEBUG] Deleting Cognito User Pool Domain: %s", d.Id()) _, err := conn.DeleteUserPoolDomainWithContext(ctx, &cognitoidentityprovider.DeleteUserPoolDomainInput{ Domain: aws.String(d.Id()), UserPoolId: aws.String(d.Get("user_pool_id").(string)), }) + + if tfawserr.ErrMessageContains(err, cognitoidentityprovider.ErrCodeInvalidParameterException, "No such domain") { + return diags + } + if err != nil { - return sdkdiag.AppendErrorf(diags, "Error deleting User Pool Domain: %s", err) + return sdkdiag.AppendErrorf(diags, "deleting Cognito User Pool Domain (%s): %s", d.Id(), err) } - if _, err := waitUserPoolDomainDeleted(ctx, conn, d.Id()); err != nil { - if tfawserr.ErrCodeEquals(err, cognitoidentityprovider.ErrCodeResourceNotFoundException) { - return diags - } - return sdkdiag.AppendErrorf(diags, "waiting for User Pool Domain (%s) deletion: %s", d.Id(), err) + if _, err := waitUserPoolDomainDeleted(ctx, conn, d.Id(), 1*time.Minute); err != nil { + return sdkdiag.AppendErrorf(diags, "waiting for Cognito User Pool Domain (%s) delete: %s", d.Id(), err) } return diags } + +func FindUserPoolDomain(ctx context.Context, conn *cognitoidentityprovider.CognitoIdentityProvider, domain string) (*cognitoidentityprovider.DomainDescriptionType, error) { + input := &cognitoidentityprovider.DescribeUserPoolDomainInput{ + Domain: aws.String(domain), + } + + output, err := conn.DescribeUserPoolDomainWithContext(ctx, input) + + if tfawserr.ErrCodeEquals(err, cognitoidentityprovider.ErrCodeResourceNotFoundException) { + return nil, &resource.NotFoundError{ + LastError: err, + LastRequest: input, + } + } + + if err != nil { + return nil, err + } + + // e.g. + // { + // "DomainDescription": {} + // } + if output == nil || output.DomainDescription == nil || output.DomainDescription.Status == nil { + return nil, tfresource.NewEmptyResultError(input) + } + + return output.DomainDescription, nil +} + +func statusUserPoolDomain(ctx context.Context, conn *cognitoidentityprovider.CognitoIdentityProvider, domain string) resource.StateRefreshFunc { + return func() (interface{}, string, error) { + output, err := FindUserPoolDomain(ctx, conn, domain) + + if tfresource.NotFound(err) { + return nil, "", nil + } + + if err != nil { + return nil, "", err + } + + return output, aws.StringValue(output.Status), nil + } +} + +func waitUserPoolDomainCreated(ctx context.Context, conn *cognitoidentityprovider.CognitoIdentityProvider, domain string, timeout time.Duration) (*cognitoidentityprovider.DomainDescriptionType, error) { + stateConf := &resource.StateChangeConf{ + Pending: []string{cognitoidentityprovider.DomainStatusTypeCreating, cognitoidentityprovider.DomainStatusTypeUpdating}, + Target: []string{cognitoidentityprovider.DomainStatusTypeActive}, + Refresh: statusUserPoolDomain(ctx, conn, domain), + Timeout: timeout, + } + + outputRaw, err := stateConf.WaitForStateContext(ctx) + + if output, ok := outputRaw.(*cognitoidentityprovider.DomainDescriptionType); ok { + return output, err + } + + return nil, err +} + +func waitUserPoolDomainDeleted(ctx context.Context, conn *cognitoidentityprovider.CognitoIdentityProvider, domain string, timeout time.Duration) (*cognitoidentityprovider.DomainDescriptionType, error) { + stateConf := &resource.StateChangeConf{ + Pending: []string{cognitoidentityprovider.DomainStatusTypeUpdating, cognitoidentityprovider.DomainStatusTypeDeleting}, + Target: []string{}, + Refresh: statusUserPoolDomain(ctx, conn, domain), + Timeout: timeout, + } + + outputRaw, err := stateConf.WaitForStateContext(ctx) + + if output, ok := outputRaw.(*cognitoidentityprovider.DomainDescriptionType); ok { + return output, err + } + + return nil, err +} diff --git a/internal/service/cognitoidp/user_pool_domain_test.go b/internal/service/cognitoidp/user_pool_domain_test.go index a3cc89ec747d..cd0b0de10fa7 100644 --- a/internal/service/cognitoidp/user_pool_domain_test.go +++ b/internal/service/cognitoidp/user_pool_domain_test.go @@ -7,15 +7,14 @@ import ( "regexp" "testing" - "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" "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" + "github.com/hashicorp/terraform-provider-aws/internal/tfresource" ) func TestAccCognitoIDPUserPoolDomain_basic(t *testing.T) { @@ -124,9 +123,7 @@ func testAccCheckUserPoolDomainExists(ctx context.Context, n string) resource.Te conn := acctest.Provider.Meta().(*conns.AWSClient).CognitoIDPConn() - _, err := conn.DescribeUserPoolDomainWithContext(ctx, &cognitoidentityprovider.DescribeUserPoolDomainInput{ - Domain: aws.String(rs.Primary.ID), - }) + _, err := tfcognitoidp.FindUserPoolDomain(ctx, conn, rs.Primary.ID) return err } @@ -141,16 +138,17 @@ func testAccCheckUserPoolDomainDestroy(ctx context.Context) resource.TestCheckFu continue } - _, err := conn.DescribeUserPoolDomainWithContext(ctx, &cognitoidentityprovider.DescribeUserPoolDomainInput{ - Domain: aws.String(rs.Primary.ID), - }) + _, err := tfcognitoidp.FindUserPoolDomain(ctx, conn, rs.Primary.ID) + + if tfresource.NotFound(err) { + continue + } if err != nil { - if tfawserr.ErrCodeEquals(err, cognitoidentityprovider.ErrCodeResourceNotFoundException) { - return nil - } return err } + + return fmt.Errorf("Cognito User Pool Domain %s still exists", rs.Primary.ID) } return nil diff --git a/internal/service/cognitoidp/wait.go b/internal/service/cognitoidp/wait.go deleted file mode 100644 index 1f03522b094d..000000000000 --- a/internal/service/cognitoidp/wait.go +++ /dev/null @@ -1,57 +0,0 @@ -package cognitoidp - -import ( - "context" - "time" - - "github.com/aws/aws-sdk-go/service/cognitoidentityprovider" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" -) - -const ( - // Maximum amount of time to wait for an Operation to return Success - userPoolDomainDeleteTimeout = 1 * time.Minute -) - -// waitUserPoolDomainDeleted waits for an Operation to return Success -func waitUserPoolDomainDeleted(ctx context.Context, conn *cognitoidentityprovider.CognitoIdentityProvider, domain string) (*cognitoidentityprovider.DescribeUserPoolDomainOutput, error) { - stateConf := &resource.StateChangeConf{ - Pending: []string{ - cognitoidentityprovider.DomainStatusTypeUpdating, - cognitoidentityprovider.DomainStatusTypeDeleting, - }, - Target: []string{""}, - Refresh: statusUserPoolDomain(ctx, conn, domain), - Timeout: userPoolDomainDeleteTimeout, - } - - outputRaw, err := stateConf.WaitForStateContext(ctx) - - if output, ok := outputRaw.(*cognitoidentityprovider.DescribeUserPoolDomainOutput); ok { - return output, err - } - - return nil, err -} - -func waitUserPoolDomainCreated(ctx context.Context, conn *cognitoidentityprovider.CognitoIdentityProvider, domain string, timeout time.Duration) (*cognitoidentityprovider.DescribeUserPoolDomainOutput, error) { - stateConf := &resource.StateChangeConf{ - Pending: []string{ - cognitoidentityprovider.DomainStatusTypeCreating, - cognitoidentityprovider.DomainStatusTypeUpdating, - }, - Target: []string{ - cognitoidentityprovider.DomainStatusTypeActive, - }, - Refresh: statusUserPoolDomain(ctx, conn, domain), - Timeout: timeout, - } - - outputRaw, err := stateConf.WaitForStateContext(ctx) - - if output, ok := outputRaw.(*cognitoidentityprovider.DescribeUserPoolDomainOutput); ok { - return output, err - } - - return nil, err -} From 3bb63b34d1c4bbe9fd44018999b80e76c466eaf5 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Fri, 10 Mar 2023 14:33:26 -0500 Subject: [PATCH 634/763] r/aws_cognito_user_pool_domain: Add 'cloudfront_distribution' attribute. Acceptance test output: % make testacc TESTARGS='-run=TestAccCognitoIDPUserPoolDomain_basic' PKG=cognitoidp ACCTEST_PARALLELISM=3 ==> Checking that code complies with gofmt requirements... TF_ACC=1 go test ./internal/service/cognitoidp/... -v -count 1 -parallel 3 -run=TestAccCognitoIDPUserPoolDomain_basic -timeout 180m === RUN TestAccCognitoIDPUserPoolDomain_basic === PAUSE TestAccCognitoIDPUserPoolDomain_basic === CONT TestAccCognitoIDPUserPoolDomain_basic --- PASS: TestAccCognitoIDPUserPoolDomain_basic (21.12s) PASS ok github.com/hashicorp/terraform-provider-aws/internal/service/cognitoidp 27.965s --- .changelog/27790.txt | 3 +++ internal/service/cognitoidp/user_pool_domain.go | 5 +++++ internal/service/cognitoidp/user_pool_domain_test.go | 1 + website/docs/r/cognito_user_pool_domain.markdown | 1 + 4 files changed, 10 insertions(+) create mode 100644 .changelog/27790.txt diff --git a/.changelog/27790.txt b/.changelog/27790.txt new file mode 100644 index 000000000000..d37395a7ba61 --- /dev/null +++ b/.changelog/27790.txt @@ -0,0 +1,3 @@ +```release-note:enhancement +resource/aws_cognito_user_pool_domain: Add `cloudfront_distribution` attribute +``` \ No newline at end of file diff --git a/internal/service/cognitoidp/user_pool_domain.go b/internal/service/cognitoidp/user_pool_domain.go index 734e1f12bef2..caa763a8681b 100644 --- a/internal/service/cognitoidp/user_pool_domain.go +++ b/internal/service/cognitoidp/user_pool_domain.go @@ -42,6 +42,10 @@ func ResourceUserPoolDomain() *schema.Resource { ForceNew: true, ValidateFunc: verify.ValidARN, }, + "cloudfront_distribution": { + Type: schema.TypeString, + Computed: true, + }, "cloudfront_distribution_arn": { Type: schema.TypeString, Computed: true, @@ -123,6 +127,7 @@ func resourceUserPoolDomainRead(ctx context.Context, d *schema.ResourceData, met if desc.CustomDomainConfig != nil { d.Set("certificate_arn", desc.CustomDomainConfig.CertificateArn) } + d.Set("cloudfront_distribution", desc.CloudFrontDistribution) d.Set("cloudfront_distribution_arn", desc.CloudFrontDistribution) d.Set("domain", d.Id()) d.Set("s3_bucket", desc.S3Bucket) diff --git a/internal/service/cognitoidp/user_pool_domain_test.go b/internal/service/cognitoidp/user_pool_domain_test.go index cd0b0de10fa7..07f41b91bedc 100644 --- a/internal/service/cognitoidp/user_pool_domain_test.go +++ b/internal/service/cognitoidp/user_pool_domain_test.go @@ -33,6 +33,7 @@ func TestAccCognitoIDPUserPoolDomain_basic(t *testing.T) { Check: resource.ComposeAggregateTestCheckFunc( testAccCheckUserPoolDomainExists(ctx, resourceName), acctest.CheckResourceAttrAccountID(resourceName, "aws_account_id"), + resource.TestCheckResourceAttrSet(resourceName, "cloudfront_distribution"), resource.TestCheckResourceAttrSet(resourceName, "cloudfront_distribution_arn"), resource.TestCheckResourceAttr(resourceName, "domain", rName), resource.TestCheckResourceAttrSet(resourceName, "s3_bucket"), diff --git a/website/docs/r/cognito_user_pool_domain.markdown b/website/docs/r/cognito_user_pool_domain.markdown index da3149666050..82d0847d4da9 100644 --- a/website/docs/r/cognito_user_pool_domain.markdown +++ b/website/docs/r/cognito_user_pool_domain.markdown @@ -68,6 +68,7 @@ The following arguments are supported: In addition to all arguments above, the following attributes are exported: * `aws_account_id` - The AWS account ID for the user pool owner. +* `cloudfront_distribution` - The Amazon CloudFront endpoint (e.g. `dpp0gtxikpq3y.cloudfront.net`) that you use as the target of the alias that you set up with your Domain Name Service (DNS) provider. * `cloudfront_distribution_arn` - The URL of the CloudFront distribution. This is required to generate the ALIAS `aws_route53_record` * `s3_bucket` - The S3 bucket where the static files for this domain are stored. * `version` - The app version. From bd4df049bfdf1f9cfeb14c5f142be4d64fb1dc4c Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Fri, 10 Mar 2023 14:57:35 -0500 Subject: [PATCH 635/763] Add 'verify.CloudFrontDistributionHostedZoneIDForPartition'. --- internal/verify/consts.go | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 internal/verify/consts.go diff --git a/internal/verify/consts.go b/internal/verify/consts.go new file mode 100644 index 000000000000..0c732b669b50 --- /dev/null +++ b/internal/verify/consts.go @@ -0,0 +1,14 @@ +package verify + +import ( + "github.com/aws/aws-sdk-go/aws/endpoints" +) + +// CloudFrontDistributionHostedZoneIDForPartition returns for the Route 53 hosted zone ID +// for Amazon CloudFront distributions in the specified AWS partition. +func CloudFrontDistributionHostedZoneIDForPartition(partition string) string { + if partition == endpoints.AwsCnPartitionID { + return "Z3RFFRIM2A3IF5" // See https://docs.amazonaws.cn/en_us/aws/latest/userguide/route53.html + } + return "Z2FDTNDATAQYW2" // See https://docs.aws.amazon.com/Route53/latest/APIReference/API_AliasTarget.html#Route53-Type-AliasTarget-HostedZoneId +} From 4f5dea09be22f1b5ddcbdcbac2835f9251e37551 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Fri, 10 Mar 2023 15:01:47 -0500 Subject: [PATCH 636/763] Add 'AWSClient.CloudFrontDistributionHostedZoneID'. --- internal/conns/awsclient.go | 10 ++++++++++ internal/verify/consts.go | 14 -------------- 2 files changed, 10 insertions(+), 14 deletions(-) delete mode 100644 internal/verify/consts.go diff --git a/internal/conns/awsclient.go b/internal/conns/awsclient.go index 4f001a37d14d..a3bdc0d7269e 100644 --- a/internal/conns/awsclient.go +++ b/internal/conns/awsclient.go @@ -5,6 +5,7 @@ import ( "fmt" "net/http" + "github.com/aws/aws-sdk-go/aws/endpoints" "github.com/aws/aws-sdk-go/service/s3" ) @@ -43,3 +44,12 @@ func (client *AWSClient) SetHTTPClient(httpClient *http.Client) { func (client *AWSClient) HTTPClient() *http.Client { return client.httpClient } + +// CloudFrontDistributionHostedZoneIDForPartition returns for the Route 53 hosted zone ID +// for Amazon CloudFront distributions in the configured AWS partition. +func (client *AWSClient) CloudFrontDistributionHostedZoneID() string { + if client.Partition == endpoints.AwsCnPartitionID { + return "Z3RFFRIM2A3IF5" // See https://docs.amazonaws.cn/en_us/aws/latest/userguide/route53.html + } + return "Z2FDTNDATAQYW2" // See https://docs.aws.amazon.com/Route53/latest/APIReference/API_AliasTarget.html#Route53-Type-AliasTarget-HostedZoneId +} diff --git a/internal/verify/consts.go b/internal/verify/consts.go deleted file mode 100644 index 0c732b669b50..000000000000 --- a/internal/verify/consts.go +++ /dev/null @@ -1,14 +0,0 @@ -package verify - -import ( - "github.com/aws/aws-sdk-go/aws/endpoints" -) - -// CloudFrontDistributionHostedZoneIDForPartition returns for the Route 53 hosted zone ID -// for Amazon CloudFront distributions in the specified AWS partition. -func CloudFrontDistributionHostedZoneIDForPartition(partition string) string { - if partition == endpoints.AwsCnPartitionID { - return "Z3RFFRIM2A3IF5" // See https://docs.amazonaws.cn/en_us/aws/latest/userguide/route53.html - } - return "Z2FDTNDATAQYW2" // See https://docs.aws.amazon.com/Route53/latest/APIReference/API_AliasTarget.html#Route53-Type-AliasTarget-HostedZoneId -} From 497fb60767e2efd16cd25fd6670ff94139da0cb7 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Fri, 10 Mar 2023 15:12:44 -0500 Subject: [PATCH 637/763] r/aws_cognito_user_pool_domain: Add 'cloudfront_distribution_zone_id' attribute. Acceptance test output: % make testacc TESTARGS='-run=TestAccCognitoIDPUserPoolDomain_basic\|TestAccCognitoIDPUserPoolDomain_disappears' PKG=cognitoidp ACCTEST_PARALLELISM=3 ==> Checking that code complies with gofmt requirements... TF_ACC=1 go test ./internal/service/cognitoidp/... -v -count 1 -parallel 3 -run=TestAccCognitoIDPUserPoolDomain_basic\|TestAccCognitoIDPUserPoolDomain_disappears -timeout 180m === RUN TestAccCognitoIDPUserPoolDomain_basic === PAUSE TestAccCognitoIDPUserPoolDomain_basic === RUN TestAccCognitoIDPUserPoolDomain_disappears === PAUSE TestAccCognitoIDPUserPoolDomain_disappears === CONT TestAccCognitoIDPUserPoolDomain_basic === CONT TestAccCognitoIDPUserPoolDomain_disappears --- PASS: TestAccCognitoIDPUserPoolDomain_disappears (24.03s) --- PASS: TestAccCognitoIDPUserPoolDomain_basic (27.20s) PASS ok github.com/hashicorp/terraform-provider-aws/internal/service/cognitoidp 35.682s --- .changelog/27790.txt | 2 +- internal/service/cognitoidp/user_pool_domain.go | 5 +++++ internal/service/cognitoidp/user_pool_domain_test.go | 1 + website/docs/r/cognito_user_pool_domain.markdown | 6 +++--- 4 files changed, 10 insertions(+), 4 deletions(-) diff --git a/.changelog/27790.txt b/.changelog/27790.txt index d37395a7ba61..f87daa007ff6 100644 --- a/.changelog/27790.txt +++ b/.changelog/27790.txt @@ -1,3 +1,3 @@ ```release-note:enhancement -resource/aws_cognito_user_pool_domain: Add `cloudfront_distribution` attribute +resource/aws_cognito_user_pool_domain: Add `cloudfront_distribution` and `cloudfront_distribution_zone_id` attributes ``` \ No newline at end of file diff --git a/internal/service/cognitoidp/user_pool_domain.go b/internal/service/cognitoidp/user_pool_domain.go index caa763a8681b..524833dd0017 100644 --- a/internal/service/cognitoidp/user_pool_domain.go +++ b/internal/service/cognitoidp/user_pool_domain.go @@ -50,6 +50,10 @@ func ResourceUserPoolDomain() *schema.Resource { Type: schema.TypeString, Computed: true, }, + "cloudfront_distribution_zone_id": { + Type: schema.TypeString, + Computed: true, + }, "domain": { Type: schema.TypeString, Required: true, @@ -129,6 +133,7 @@ func resourceUserPoolDomainRead(ctx context.Context, d *schema.ResourceData, met } d.Set("cloudfront_distribution", desc.CloudFrontDistribution) d.Set("cloudfront_distribution_arn", desc.CloudFrontDistribution) + d.Set("cloudfront_distribution_zone_id", meta.(*conns.AWSClient).CloudFrontDistributionHostedZoneID()) d.Set("domain", d.Id()) d.Set("s3_bucket", desc.S3Bucket) d.Set("user_pool_id", desc.UserPoolId) diff --git a/internal/service/cognitoidp/user_pool_domain_test.go b/internal/service/cognitoidp/user_pool_domain_test.go index 07f41b91bedc..bddfa3269d18 100644 --- a/internal/service/cognitoidp/user_pool_domain_test.go +++ b/internal/service/cognitoidp/user_pool_domain_test.go @@ -35,6 +35,7 @@ func TestAccCognitoIDPUserPoolDomain_basic(t *testing.T) { acctest.CheckResourceAttrAccountID(resourceName, "aws_account_id"), resource.TestCheckResourceAttrSet(resourceName, "cloudfront_distribution"), resource.TestCheckResourceAttrSet(resourceName, "cloudfront_distribution_arn"), + resource.TestCheckResourceAttr(resourceName, "cloudfront_distribution_zone_id", "Z2FDTNDATAQYW2"), resource.TestCheckResourceAttr(resourceName, "domain", rName), resource.TestCheckResourceAttrSet(resourceName, "s3_bucket"), resource.TestCheckResourceAttrSet(resourceName, "version"), diff --git a/website/docs/r/cognito_user_pool_domain.markdown b/website/docs/r/cognito_user_pool_domain.markdown index 82d0847d4da9..6ec489827c11 100644 --- a/website/docs/r/cognito_user_pool_domain.markdown +++ b/website/docs/r/cognito_user_pool_domain.markdown @@ -48,9 +48,8 @@ resource "aws_route53_record" "auth-cognito-A" { zone_id = data.aws_route53_zone.example.zone_id alias { evaluate_target_health = false - name = aws_cognito_user_pool_domain.main.cloudfront_distribution_arn - # This zone_id is fixed - zone_id = "Z2FDTNDATAQYW2" + name = aws_cognito_user_pool_domain.main.cloudfront_distribution + zone_id = aws_cognito_user_pool_domain.main.cloudfront_distribution_zone_id } } ``` @@ -70,6 +69,7 @@ In addition to all arguments above, the following attributes are exported: * `aws_account_id` - The AWS account ID for the user pool owner. * `cloudfront_distribution` - The Amazon CloudFront endpoint (e.g. `dpp0gtxikpq3y.cloudfront.net`) that you use as the target of the alias that you set up with your Domain Name Service (DNS) provider. * `cloudfront_distribution_arn` - The URL of the CloudFront distribution. This is required to generate the ALIAS `aws_route53_record` +* `cloudfront_distribution_zone_id` - The Route 53 hosted zone ID of the CloudFront distribution. * `s3_bucket` - The S3 bucket where the static files for this domain are stored. * `version` - The app version. From 1ef6686a07adf0500a3e9da99528201582fecbeb Mon Sep 17 00:00:00 2001 From: DBX12 Date: Mon, 17 Oct 2022 19:30:31 +0200 Subject: [PATCH 638/763] Add attribute arn_without_revision on aws_ecs_task_definition --- internal/service/ecs/task_definition.go | 11 +++++++++++ internal/service/ecs/task_definition_data_source.go | 5 +++++ 2 files changed, 16 insertions(+) diff --git a/internal/service/ecs/task_definition.go b/internal/service/ecs/task_definition.go index 7155179c6194..bcb31665ebaa 100644 --- a/internal/service/ecs/task_definition.go +++ b/internal/service/ecs/task_definition.go @@ -63,6 +63,10 @@ func ResourceTaskDefinition() *schema.Resource { Type: schema.TypeString, Computed: true, }, + "arn_without_revision": { + Type: schema.TypeString, + Computed: true, + }, "container_definitions": { Type: schema.TypeString, Required: true, @@ -541,6 +545,7 @@ func resourceTaskDefinitionCreate(ctx context.Context, d *schema.ResourceData, m d.SetId(aws.StringValue(taskDefinition.Family)) d.Set("arn", taskDefinition.TaskDefinitionArn) + d.Set("arn_without_revision", computeArnWithoutRevision(*taskDefinition.TaskDefinitionArn)) // Some partitions (i.e., ISO) may not support tag-on-create, attempt tag after create if input.Tags == nil && len(tags) > 0 { @@ -600,6 +605,7 @@ func resourceTaskDefinitionRead(ctx context.Context, d *schema.ResourceData, met d.SetId(aws.StringValue(taskDefinition.Family)) d.Set("arn", taskDefinition.TaskDefinitionArn) + d.Set("arn_without_revision", computeArnWithoutRevision(*taskDefinition.TaskDefinitionArn)) d.Set("family", taskDefinition.Family) d.Set("revision", taskDefinition.Revision) @@ -1243,3 +1249,8 @@ func flattenTaskDefinitionEphemeralStorage(pc *ecs.EphemeralStorage) []map[strin return []map[string]interface{}{m} } + +func computeArnWithoutRevision(taskDefinitionArn string) string { + arnRegexp := regexp.MustCompile(`:\d+$`) + return arnRegexp.ReplaceAllString(taskDefinitionArn, "") +} diff --git a/internal/service/ecs/task_definition_data_source.go b/internal/service/ecs/task_definition_data_source.go index 4ef9ecc775e3..ea9be2f7a320 100644 --- a/internal/service/ecs/task_definition_data_source.go +++ b/internal/service/ecs/task_definition_data_source.go @@ -27,6 +27,10 @@ func DataSourceTaskDefinition() *schema.Resource { Type: schema.TypeString, Computed: true, }, + "arn_without_revision": { + Type: schema.TypeString, + Computed: true, + }, "family": { Type: schema.TypeString, Computed: true, @@ -73,6 +77,7 @@ func dataSourceTaskDefinitionRead(ctx context.Context, d *schema.ResourceData, m d.SetId(aws.StringValue(taskDefinition.TaskDefinitionArn)) d.Set("arn", taskDefinition.TaskDefinitionArn) + d.Set("arn_without_revision", computeArnWithoutRevision(*taskDefinition.TaskDefinitionArn)) d.Set("family", taskDefinition.Family) d.Set("network_mode", taskDefinition.NetworkMode) d.Set("revision", taskDefinition.Revision) From 71701896572fd2ee6b49fe65f8d02bfee8cf402d Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Fri, 10 Mar 2023 16:22:54 -0500 Subject: [PATCH 639/763] r/aws_cognito_user_pool_domain: Simplify 'TestAccCognitoIDPUserPoolDomain_custom'. Acceptance test output: % AWS_DEFAULT_REGION=us-east-1 ACM_CERTIFICATE_ROOT_DOMAIN=example.com make testacc TESTARGS='-run=TestAccCognitoIDPUserPoolDomain_custom' PKG=cognitoidp ACCTEST_PARALLELISM=3 ==> Checking that code complies with gofmt requirements... TF_ACC=1 go test ./internal/service/cognitoidp/... -v -count 1 -parallel 3 -run=TestAccCognitoIDPUserPoolDomain_custom -timeout 180m === RUN TestAccCognitoIDPUserPoolDomain_custom === PAUSE TestAccCognitoIDPUserPoolDomain_custom === CONT TestAccCognitoIDPUserPoolDomain_custom --- PASS: TestAccCognitoIDPUserPoolDomain_custom (1340.98s) PASS ok github.com/hashicorp/terraform-provider-aws/internal/service/cognitoidp 1346.121s --- internal/service/cognitoidp/acc_test.go | 94 ------------------- .../cognitoidp/user_pool_domain_test.go | 48 +++------- 2 files changed, 13 insertions(+), 129 deletions(-) delete mode 100644 internal/service/cognitoidp/acc_test.go diff --git a/internal/service/cognitoidp/acc_test.go b/internal/service/cognitoidp/acc_test.go deleted file mode 100644 index 3b6d7ac7553b..000000000000 --- a/internal/service/cognitoidp/acc_test.go +++ /dev/null @@ -1,94 +0,0 @@ -package cognitoidp_test - -import ( - "context" - "sync" - "testing" - - "github.com/aws/aws-sdk-go/aws/endpoints" - "github.com/aws/aws-sdk-go/service/cognitoidentityprovider" - "github.com/hashicorp/terraform-plugin-sdk/v2/diag" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/hashicorp/terraform-provider-aws/internal/acctest" - "github.com/hashicorp/terraform-provider-aws/internal/provider" -) - -// Cognito User Pool Custom Domains can only be created with ACM Certificates in specific regions. - -// testAccCognitoUserPoolCustomDomainRegion is the chosen Cognito User Pool Custom Domains testing region -// -// Cached to prevent issues should multiple regions become available. -var testAccCognitoUserPoolCustomDomainRegion string - -// testAccProviderCognitoUserPoolCustomDomain is the Cognito User Pool Custom Domains provider instance -// -// This Provider can be used in testing code for API calls without requiring -// the use of saving and referencing specific ProviderFactories instances. -// -// testAccPreCheckUserPoolCustomDomain(t) must be called before using this provider instance. -var testAccProviderCognitoUserPoolCustomDomain *schema.Provider - -// testAccProviderCognitoUserPoolCustomDomainConfigure ensures the provider is only configured once -var testAccProviderCognitoUserPoolCustomDomainConfigure sync.Once - -// testAccPreCheckUserPoolCustomDomain verifies AWS credentials and that Cognito User Pool Custom Domains is supported -func testAccPreCheckUserPoolCustomDomain(ctx context.Context, t *testing.T) { - acctest.PreCheckPartitionHasService(t, cognitoidentityprovider.EndpointsID) - - region := testAccGetUserPoolCustomDomainRegion() - - if region == "" { - t.Skip("Cognito User Pool Custom Domains not available in this AWS Partition") - } - - // Since we are outside the scope of the Terraform configuration we must - // call Configure() to properly initialize the provider configuration. - testAccProviderCognitoUserPoolCustomDomainConfigure.Do(func() { - var err error - testAccProviderCognitoUserPoolCustomDomain, err = provider.New(ctx) - - if err != nil { - t.Fatal(err) - } - - config := map[string]interface{}{ - "region": region, - } - - diags := testAccProviderCognitoUserPoolCustomDomain.Configure(ctx, terraform.NewResourceConfigRaw(config)) - - if diags != nil && diags.HasError() { - for _, d := range diags { - if d.Severity == diag.Error { - t.Fatalf("error configuring Cognito User Pool Custom Domains provider: %s", d.Summary) - } - } - } - }) -} - -// testAccUserPoolCustomDomainRegionProviderConfig is the Terraform provider configuration for Cognito User Pool Custom Domains region testing -// -// Testing Cognito User Pool Custom Domains assumes no other provider configurations -// are necessary and overwrites the "aws" provider configuration. -func testAccUserPoolCustomDomainRegionProviderConfig() string { - return acctest.ConfigRegionalProvider(testAccGetUserPoolCustomDomainRegion()) -} - -// testAccGetUserPoolCustomDomainRegion returns the Cognito User Pool Custom Domains region for testing -func testAccGetUserPoolCustomDomainRegion() string { - if testAccCognitoUserPoolCustomDomainRegion != "" { - return testAccCognitoUserPoolCustomDomainRegion - } - - // AWS Commercial: https://docs.aws.amazon.com/cognito/latest/developerguide/cognito-user-pools-add-custom-domain.html - // AWS GovCloud (US) - not supported: https://docs.aws.amazon.com/govcloud-us/latest/UserGuide/govcloud-cog.html - // AWS China - not supported: https://docs.amazonaws.cn/en_us/aws/latest/userguide/cognito.html - switch acctest.Partition() { - case endpoints.AwsPartitionID: - testAccCognitoUserPoolCustomDomainRegion = endpoints.UsEast1RegionID - } - - return testAccCognitoUserPoolCustomDomainRegion -} diff --git a/internal/service/cognitoidp/user_pool_domain_test.go b/internal/service/cognitoidp/user_pool_domain_test.go index bddfa3269d18..02f48eb7ede8 100644 --- a/internal/service/cognitoidp/user_pool_domain_test.go +++ b/internal/service/cognitoidp/user_pool_domain_test.go @@ -4,9 +4,9 @@ import ( "context" "errors" "fmt" - "regexp" "testing" + "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" @@ -75,16 +75,18 @@ func TestAccCognitoIDPUserPoolDomain_disappears(t *testing.T) { func TestAccCognitoIDPUserPoolDomain_custom(t *testing.T) { ctx := acctest.Context(t) + if testing.Short() { + t.Skip("skipping long-running test in short mode") + } + rootDomain := acctest.ACMCertificateDomainFromEnv(t) domain := acctest.ACMCertificateRandomSubDomain(rootDomain) - poolName := fmt.Sprintf("tf-acc-test-pool-%s", sdkacctest.RandString(10)) - + poolName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) acmCertificateResourceName := "aws_acm_certificate.test" - cognitoUserPoolResourceName := "aws_cognito_user_pool.test" resourceName := "aws_cognito_user_pool_domain.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckUserPoolCustomDomain(ctx, t) }, + PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckRegion(t, endpoints.UsEast1RegionID) }, ErrorCheck: acctest.ErrorCheck(t, cognitoidentityprovider.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckUserPoolDomainDestroy(ctx), @@ -95,12 +97,11 @@ func TestAccCognitoIDPUserPoolDomain_custom(t *testing.T) { testAccCheckUserPoolDomainExists(ctx, resourceName), acctest.CheckResourceAttrAccountID(resourceName, "aws_account_id"), resource.TestCheckResourceAttrPair(resourceName, "certificate_arn", acmCertificateResourceName, "arn"), - //lintignore:AWSAT001 // Reference: https://github.com/hashicorp/terraform-provider-aws/issues/11666 - resource.TestMatchResourceAttr(resourceName, "cloudfront_distribution_arn", regexp.MustCompile(`[a-z0-9]+.cloudfront.net$`)), + resource.TestCheckResourceAttrSet(resourceName, "cloudfront_distribution"), + resource.TestCheckResourceAttr(resourceName, "cloudfront_distribution_zone_id", "Z2FDTNDATAQYW2"), resource.TestCheckResourceAttrPair(resourceName, "domain", acmCertificateResourceName, "domain_name"), - resource.TestMatchResourceAttr(resourceName, "s3_bucket", regexp.MustCompile(`^.+$`)), - resource.TestCheckResourceAttrPair(resourceName, "user_pool_id", cognitoUserPoolResourceName, "id"), - resource.TestMatchResourceAttr(resourceName, "version", regexp.MustCompile(`^.+$`)), + resource.TestCheckResourceAttrSet(resourceName, "s3_bucket"), + resource.TestCheckResourceAttrSet(resourceName, "version"), ), }, { @@ -171,9 +172,7 @@ resource "aws_cognito_user_pool" "test" { } func testAccUserPoolDomainConfig_custom(rootDomain string, domain string, poolName string) string { - return acctest.ConfigCompose( - testAccUserPoolCustomDomainRegionProviderConfig(), - fmt.Sprintf(` + return fmt.Sprintf(` data "aws_route53_zone" "test" { name = %[1]q private_zone = false @@ -184,27 +183,6 @@ resource "aws_acm_certificate" "test" { validation_method = "DNS" } -# -# for_each acceptance testing requires: -# https://github.com/hashicorp/terraform-plugin-sdk/issues/536 -# -# resource "aws_route53_record" "test" { -# for_each = { -# for dvo in aws_acm_certificate.test.domain_validation_options: dvo.domain_name => { -# name = dvo.resource_record_name -# record = dvo.resource_record_value -# type = dvo.resource_record_type -# } -# } - -# allow_overwrite = true -# name = each.value.name -# records = [each.value.record] -# ttl = 60 -# type = each.value.type -# zone_id = data.aws_route53_zone.test.zone_id -# } - resource "aws_route53_record" "test" { allow_overwrite = true name = tolist(aws_acm_certificate.test.domain_validation_options)[0].resource_record_name @@ -228,5 +206,5 @@ resource "aws_cognito_user_pool_domain" "test" { domain = aws_acm_certificate.test.domain_name user_pool_id = aws_cognito_user_pool.test.id } -`, rootDomain, domain, poolName)) +`, rootDomain, domain, poolName) } From 45f3b3aaf2ffae6288036405b915e0727438c381 Mon Sep 17 00:00:00 2001 From: Jared Baker Date: Fri, 10 Mar 2023 15:06:52 -0500 Subject: [PATCH 640/763] r/aws_ecs_task_defintion: refactor revision removal func also replaces direct pointer dereferences with the aws.StringValue helper --- internal/service/ecs/task_definition.go | 21 ++++++++++++++----- .../ecs/task_definition_data_source.go | 2 +- 2 files changed, 17 insertions(+), 6 deletions(-) diff --git a/internal/service/ecs/task_definition.go b/internal/service/ecs/task_definition.go index bcb31665ebaa..1f5e6a5e0f02 100644 --- a/internal/service/ecs/task_definition.go +++ b/internal/service/ecs/task_definition.go @@ -545,7 +545,7 @@ func resourceTaskDefinitionCreate(ctx context.Context, d *schema.ResourceData, m d.SetId(aws.StringValue(taskDefinition.Family)) d.Set("arn", taskDefinition.TaskDefinitionArn) - d.Set("arn_without_revision", computeArnWithoutRevision(*taskDefinition.TaskDefinitionArn)) + d.Set("arn_without_revision", StripRevision(aws.StringValue(taskDefinition.TaskDefinitionArn))) // Some partitions (i.e., ISO) may not support tag-on-create, attempt tag after create if input.Tags == nil && len(tags) > 0 { @@ -605,7 +605,7 @@ func resourceTaskDefinitionRead(ctx context.Context, d *schema.ResourceData, met d.SetId(aws.StringValue(taskDefinition.Family)) d.Set("arn", taskDefinition.TaskDefinitionArn) - d.Set("arn_without_revision", computeArnWithoutRevision(*taskDefinition.TaskDefinitionArn)) + d.Set("arn_without_revision", StripRevision(aws.StringValue(taskDefinition.TaskDefinitionArn))) d.Set("family", taskDefinition.Family) d.Set("revision", taskDefinition.Revision) @@ -1250,7 +1250,18 @@ func flattenTaskDefinitionEphemeralStorage(pc *ecs.EphemeralStorage) []map[strin return []map[string]interface{}{m} } -func computeArnWithoutRevision(taskDefinitionArn string) string { - arnRegexp := regexp.MustCompile(`:\d+$`) - return arnRegexp.ReplaceAllString(taskDefinitionArn, "") +// StripRevision strips the trailing revision number from a task definition ARN +// +// Invalid ARNs will return an empty string. ARNs with an unexpected number of +// separators in the resource section are returned unmodified. +func StripRevision(s string) string { + tdArn, err := arn.Parse(s) + if err != nil { + return "" + } + parts := strings.Split(tdArn.Resource, ":") + if len(parts) == 2 { + tdArn.Resource = parts[0] + } + return tdArn.String() } diff --git a/internal/service/ecs/task_definition_data_source.go b/internal/service/ecs/task_definition_data_source.go index ea9be2f7a320..eb88dfbd770b 100644 --- a/internal/service/ecs/task_definition_data_source.go +++ b/internal/service/ecs/task_definition_data_source.go @@ -77,7 +77,7 @@ func dataSourceTaskDefinitionRead(ctx context.Context, d *schema.ResourceData, m d.SetId(aws.StringValue(taskDefinition.TaskDefinitionArn)) d.Set("arn", taskDefinition.TaskDefinitionArn) - d.Set("arn_without_revision", computeArnWithoutRevision(*taskDefinition.TaskDefinitionArn)) + d.Set("arn_without_revision", StripRevision(aws.StringValue(taskDefinition.TaskDefinitionArn))) d.Set("family", taskDefinition.Family) d.Set("network_mode", taskDefinition.NetworkMode) d.Set("revision", taskDefinition.Revision) From 82810570ddb6fc62a3396c04ca290cf2e71e8826 Mon Sep 17 00:00:00 2001 From: Jared Baker Date: Fri, 10 Mar 2023 15:07:59 -0500 Subject: [PATCH 641/763] r/aws_ecs_task_defintion: StripRevision tests --- internal/service/ecs/task_definition_test.go | 38 ++++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/internal/service/ecs/task_definition_test.go b/internal/service/ecs/task_definition_test.go index 60d66f89a528..7cd03e2e370e 100644 --- a/internal/service/ecs/task_definition_test.go +++ b/internal/service/ecs/task_definition_test.go @@ -27,6 +27,42 @@ func testAccErrorCheckSkip(t *testing.T) resource.ErrorCheckFunc { ) } +func Test_StripRevision(t *testing.T) { + t.Parallel() + + testCases := []struct { + name string + s string + want string + }{ + {"empty", "", ""}, + { + "invalid arn", + "some:string:thing", + "", + }, + { + "with revision", + "arn:aws:ecs:us-east-1:000000000000:task-definition/my-task:42", //lintignore:AWSAT003,AWSAT005 + "arn:aws:ecs:us-east-1:000000000000:task-definition/my-task", //lintignore:AWSAT003,AWSAT005 + }, + { + "no revision", + "arn:aws:ecs:us-east-1:000000000000:task-definition/my-task", //lintignore:AWSAT003,AWSAT005 + "arn:aws:ecs:us-east-1:000000000000:task-definition/my-task", //lintignore:AWSAT003,AWSAT005 + }, + } + for _, tc := range testCases { + tc := tc + t.Run(tc.name, func(t *testing.T) { + t.Parallel() + if got := tfecs.StripRevision(tc.s); got != tc.want { + t.Errorf("StripRevision() = %v, want %v", got, tc.want) + } + }) + } +} + func TestAccECSTaskDefinition_basic(t *testing.T) { ctx := acctest.Context(t) var def ecs.TaskDefinition @@ -45,6 +81,7 @@ func TestAccECSTaskDefinition_basic(t *testing.T) { Check: resource.ComposeTestCheckFunc( testAccCheckTaskDefinitionExists(ctx, resourceName, &def), acctest.MatchResourceAttrRegionalARN(resourceName, "arn", "ecs", regexp.MustCompile(`task-definition/.+`)), + acctest.MatchResourceAttrRegionalARN(resourceName, "arn_without_revision", "ecs", regexp.MustCompile(`task-definition/.+`)), ), }, { @@ -52,6 +89,7 @@ func TestAccECSTaskDefinition_basic(t *testing.T) { Check: resource.ComposeTestCheckFunc( testAccCheckTaskDefinitionExists(ctx, resourceName, &def), acctest.MatchResourceAttrRegionalARN(resourceName, "arn", "ecs", regexp.MustCompile(`task-definition/.+`)), + acctest.MatchResourceAttrRegionalARN(resourceName, "arn_without_revision", "ecs", regexp.MustCompile(`task-definition/.+`)), ), }, { From b321b2c687490ee8c8e25ee2106b7c517c301a48 Mon Sep 17 00:00:00 2001 From: Jared Baker Date: Fri, 10 Mar 2023 15:18:38 -0500 Subject: [PATCH 642/763] [r|d]/aws_ecs_task_definition: arn_without_revision docs --- website/docs/d/ecs_task_definition.html.markdown | 13 +++++++------ website/docs/r/ecs_task_definition.html.markdown | 1 + 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/website/docs/d/ecs_task_definition.html.markdown b/website/docs/d/ecs_task_definition.html.markdown index 6cd4ab04eeba..494ad4ab219c 100644 --- a/website/docs/d/ecs_task_definition.html.markdown +++ b/website/docs/d/ecs_task_definition.html.markdown @@ -64,10 +64,11 @@ The following arguments are supported: In addition to all arguments above, the following attributes are exported: -* `id` - ARN of the task definition -* `arn` - ARN of the task definition -* `family` - Family of this task definition +* `id` - ARN of the task definition. +* `arn` - ARN of the task definition. +* `arn_without_revision` - ARN of the Task Definition with the trailing `revision` removed. This may be useful for situations where the latest task definition is always desired. If a revision isn't specified, the latest ACTIVE revision is used. See the [AWS documentation](https://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_StartTask.html#ECS-StartTask-request-taskDefinition) for details. +* `family` - Family of this task definition. * `network_mode` - Docker networking mode to use for the containers in this task. -* `revision` - Revision of this task definition -* `status` - Status of this task definition -* `task_role_arn` - ARN of the IAM role that containers in this task can assume +* `revision` - Revision of this task definition. +* `status` - Status of this task definition. +* `task_role_arn` - ARN of the IAM role that containers in this task can assume. diff --git a/website/docs/r/ecs_task_definition.html.markdown b/website/docs/r/ecs_task_definition.html.markdown index 9b31e22eb49c..65ca66e5fba1 100644 --- a/website/docs/r/ecs_task_definition.html.markdown +++ b/website/docs/r/ecs_task_definition.html.markdown @@ -330,6 +330,7 @@ For more information, see [Specifying an FSX Windows File Server volume in your In addition to all arguments above, the following attributes are exported: * `arn` - Full ARN of the Task Definition (including both `family` and `revision`). +* `arn_without_revision` - ARN of the Task Definition with the trailing `revision` removed. This may be useful for situations where the latest task definition is always desired. If a revision isn't specified, the latest ACTIVE revision is used. See the [AWS documentation](https://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_StartTask.html#ECS-StartTask-request-taskDefinition) for details. * `revision` - Revision of the task in a particular family. * `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). From 1e00934a66ebd1e6a97e09bb8d1dbeb75f1473d2 Mon Sep 17 00:00:00 2001 From: Jared Baker Date: Fri, 10 Mar 2023 15:20:49 -0500 Subject: [PATCH 643/763] chore: changelog --- .changelog/27351.txt | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 .changelog/27351.txt diff --git a/.changelog/27351.txt b/.changelog/27351.txt new file mode 100644 index 000000000000..a28381ea0dc6 --- /dev/null +++ b/.changelog/27351.txt @@ -0,0 +1,3 @@ +```release-note:enhancement +resource/aws_ecs_task_definition: Add `arn_without_revision` attribute +``` From 34f14650a457651a2129d8c6a06f72449dff0a43 Mon Sep 17 00:00:00 2001 From: changelogbot Date: Fri, 10 Mar 2023 22:05:26 +0000 Subject: [PATCH 644/763] Update CHANGELOG.md for #29839 --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5cb04953ae65..90bf38aedc85 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,8 @@ BUG FIXES: * resource/aws_apigatewayv2_integration: Retry errors like `ConflictException: Unable to complete operation due to concurrent modification. Please try again later.` ([#29735](https://github.com/hashicorp/terraform-provider-aws/issues/29735)) * resource/aws_elasticsearch_domain: Remove upper bound validation for `ebs_options.throughput` as the 1,000 MB/s limit can be raised ([#27598](https://github.com/hashicorp/terraform-provider-aws/issues/27598)) +* resource/aws_lambda_function: Fix empty environment variable update ([#29839](https://github.com/hashicorp/terraform-provider-aws/issues/29839)) +* resource/aws_lightsail_instance: Fix `name` validation to allow instances to start with a numeric character ([#29903](https://github.com/hashicorp/terraform-provider-aws/issues/29903)) * resource/aws_opensearch_domain: Remove upper bound validation for `ebs_options.throughput` as the 1,000 MB/s limit can be raised ([#27598](https://github.com/hashicorp/terraform-provider-aws/issues/27598)) * resource/aws_sagemaker_endpoint_configuration: Fix `variant_name` generation when unset ([#29915](https://github.com/hashicorp/terraform-provider-aws/issues/29915)) From 2f5961ab41c09c22eac8bd771559a11dd7d2addd Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Fri, 10 Mar 2023 18:07:33 -0500 Subject: [PATCH 645/763] CloudFront Distribution: Use 'AWSClient.CloudFrontDistributionHostedZoneID'. Acceptance test output: % make testacc TESTARGS='-run=TestAccCloudFrontDistributionDataSource_\|TestAccCloudFrontDistribution_disappears\|TestAccCloudFrontDistribution_enabled\|TestAccCloudFrontDistribution_retainOnDelete' PKG=cloudfront ACCTEST_PARALLELISM=3 ==> Checking that code complies with gofmt requirements... TF_ACC=1 go test ./internal/service/cloudfront/... -v -count 1 -parallel 3 -run=TestAccCloudFrontDistributionDataSource_\|TestAccCloudFrontDistribution_disappears\|TestAccCloudFrontDistribution_enabled\|TestAccCloudFrontDistribution_retainOnDelete -timeout 180m === RUN TestAccCloudFrontDistributionDataSource_basic === PAUSE TestAccCloudFrontDistributionDataSource_basic === RUN TestAccCloudFrontDistribution_disappears === PAUSE TestAccCloudFrontDistribution_disappears === RUN TestAccCloudFrontDistribution_enabled === PAUSE TestAccCloudFrontDistribution_enabled === RUN TestAccCloudFrontDistribution_retainOnDelete === PAUSE TestAccCloudFrontDistribution_retainOnDelete === CONT TestAccCloudFrontDistributionDataSource_basic === CONT TestAccCloudFrontDistribution_enabled === CONT TestAccCloudFrontDistribution_retainOnDelete --- PASS: TestAccCloudFrontDistributionDataSource_basic (424.34s) === CONT TestAccCloudFrontDistribution_disappears --- PASS: TestAccCloudFrontDistribution_retainOnDelete (434.92s) --- PASS: TestAccCloudFrontDistribution_enabled (650.99s) --- PASS: TestAccCloudFrontDistribution_disappears (229.03s) PASS ok github.com/hashicorp/terraform-provider-aws/internal/service/cloudfront 658.754s --- internal/service/cloudfront/distribution.go | 177 +++++++----------- .../distribution_configuration_structure.go | 10 - .../cloudfront/distribution_data_source.go | 20 +- .../distribution_data_source_test.go | 3 +- internal/service/cloudfront/find.go | 25 --- 5 files changed, 74 insertions(+), 161 deletions(-) diff --git a/internal/service/cloudfront/distribution.go b/internal/service/cloudfront/distribution.go index 1bf26cab450c..d84d94f2f5e6 100644 --- a/internal/service/cloudfront/distribution.go +++ b/internal/service/cloudfront/distribution.go @@ -6,7 +6,6 @@ import ( "time" "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/endpoints" "github.com/aws/aws-sdk-go/service/cloudfront" "github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" @@ -887,12 +886,9 @@ func resourceDistributionRead(ctx context.Context, d *schema.ResourceData, meta defaultTagsConfig := meta.(*conns.AWSClient).DefaultTagsConfig ignoreTagsConfig := meta.(*conns.AWSClient).IgnoreTagsConfig - params := &cloudfront.GetDistributionInput{ - Id: aws.String(d.Id()), - } + output, err := FindDistributionByID(ctx, conn, d.Id()) - resp, err := conn.GetDistributionWithContext(ctx, params) - if !d.IsNewResource() && tfawserr.ErrCodeEquals(err, cloudfront.ErrCodeNoSuchDistribution) { + if !d.IsNewResource() && tfresource.NotFound(err) { create.LogNotFoundRemoveState(names.CloudFront, create.ErrActionReading, ResNameDistribution, d.Id()) d.SetId("") return diags @@ -903,32 +899,25 @@ func resourceDistributionRead(ctx context.Context, d *schema.ResourceData, meta } // Update attributes from DistributionConfig - err = flattenDistributionConfig(d, resp.Distribution.DistributionConfig) + err = flattenDistributionConfig(d, output.Distribution.DistributionConfig) if err != nil { return sdkdiag.AppendErrorf(diags, "reading CloudFront Distribution (%s): %s", d.Id(), err) } // Update other attributes outside of DistributionConfig - if err := d.Set("trusted_key_groups", flattenActiveTrustedKeyGroups(resp.Distribution.ActiveTrustedKeyGroups)); err != nil { + if err := d.Set("trusted_key_groups", flattenActiveTrustedKeyGroups(output.Distribution.ActiveTrustedKeyGroups)); err != nil { return sdkdiag.AppendErrorf(diags, "setting trusted_key_groups: %s", err) } - if err := d.Set("trusted_signers", flattenActiveTrustedSigners(resp.Distribution.ActiveTrustedSigners)); err != nil { + if err := d.Set("trusted_signers", flattenActiveTrustedSigners(output.Distribution.ActiveTrustedSigners)); err != nil { return sdkdiag.AppendErrorf(diags, "setting trusted_signers: %s", err) } - d.Set("status", resp.Distribution.Status) - d.Set("domain_name", resp.Distribution.DomainName) - d.Set("last_modified_time", aws.String(resp.Distribution.LastModifiedTime.String())) - d.Set("in_progress_validation_batches", resp.Distribution.InProgressInvalidationBatches) - d.Set("etag", resp.ETag) - d.Set("arn", resp.Distribution.ARN) - - // override hosted_zone_id from flattenDistributionConfig - region := meta.(*conns.AWSClient).Region - if v, ok := endpoints.PartitionForRegion(endpoints.DefaultPartitions(), region); ok && v.ID() == endpoints.AwsCnPartitionID { - d.Set("hosted_zone_id", cnRoute53ZoneID) - } else { - d.Set("hosted_zone_id", route53ZoneID) - } + d.Set("status", output.Distribution.Status) + d.Set("domain_name", output.Distribution.DomainName) + d.Set("last_modified_time", aws.String(output.Distribution.LastModifiedTime.String())) + d.Set("in_progress_validation_batches", output.Distribution.InProgressInvalidationBatches) + d.Set("etag", output.ETag) + d.Set("arn", output.Distribution.ARN) + d.Set("hosted_zone_id", meta.(*conns.AWSClient).CloudFrontDistributionHostedZoneID()) tags, err := ListTags(ctx, conn, d.Get("arn").(string)) if err != nil { @@ -1028,36 +1017,26 @@ func resourceDistributionDelete(ctx context.Context, d *schema.ResourceData, met conn := meta.(*conns.AWSClient).CloudFrontConn() if d.Get("retain_on_delete").(bool) { - // Check if we need to disable first - getDistributionInput := &cloudfront.GetDistributionInput{ - Id: aws.String(d.Id()), - } - - log.Printf("[DEBUG] Refreshing CloudFront Distribution (%s) to check if disable is necessary", d.Id()) - getDistributionOutput, err := conn.GetDistributionWithContext(ctx, getDistributionInput) + // Check if we need to disable first. + output, err := FindDistributionByID(ctx, conn, d.Id()) if err != nil { - return sdkdiag.AppendErrorf(diags, "refreshing CloudFront Distribution (%s) to check if disable is necessary: %s", d.Id(), err) + return sdkdiag.AppendErrorf(diags, "reading CloudFront Distribution (%s): %s", d.Id(), err) } - if getDistributionOutput == nil || getDistributionOutput.Distribution == nil || getDistributionOutput.Distribution.DistributionConfig == nil { - return sdkdiag.AppendErrorf(diags, "refreshing CloudFront Distribution (%s) to check if disable is necessary: empty response", d.Id()) - } - - if !aws.BoolValue(getDistributionOutput.Distribution.DistributionConfig.Enabled) { + if !aws.BoolValue(output.Distribution.DistributionConfig.Enabled) { log.Printf("[WARN] Removing CloudFront Distribution ID %q with `retain_on_delete` set. Please delete this distribution manually.", d.Id()) return diags } - updateDistributionInput := &cloudfront.UpdateDistributionInput{ - DistributionConfig: getDistributionOutput.Distribution.DistributionConfig, - Id: getDistributionInput.Id, - IfMatch: getDistributionOutput.ETag, + input := &cloudfront.UpdateDistributionInput{ + DistributionConfig: output.Distribution.DistributionConfig, + Id: aws.String(d.Id()), + IfMatch: output.ETag, } - updateDistributionInput.DistributionConfig.Enabled = aws.Bool(false) + input.DistributionConfig.Enabled = aws.Bool(false) - log.Printf("[DEBUG] Disabling CloudFront Distribution: %s", d.Id()) - _, err = conn.UpdateDistributionWithContext(ctx, updateDistributionInput) + _, err = conn.UpdateDistributionWithContext(ctx, input) if err != nil { return sdkdiag.AppendErrorf(diags, "disabling CloudFront Distribution (%s): %s", d.Id(), err) @@ -1067,13 +1046,13 @@ func resourceDistributionDelete(ctx context.Context, d *schema.ResourceData, met return diags } - deleteDistributionInput := &cloudfront.DeleteDistributionInput{ + deleteDistroInput := &cloudfront.DeleteDistributionInput{ Id: aws.String(d.Id()), IfMatch: aws.String(d.Get("etag").(string)), } log.Printf("[DEBUG] Deleting CloudFront Distribution: %s", d.Id()) - _, err := conn.DeleteDistributionWithContext(ctx, deleteDistributionInput) + _, err := conn.DeleteDistributionWithContext(ctx, deleteDistroInput) if err == nil || tfawserr.ErrCodeEquals(err, cloudfront.ErrCodeNoSuchDistribution) { return diags @@ -1081,113 +1060,95 @@ func resourceDistributionDelete(ctx context.Context, d *schema.ResourceData, met // Refresh our ETag if it is out of date and attempt deletion again. if tfawserr.ErrCodeEquals(err, cloudfront.ErrCodeInvalidIfMatchVersion) { - getDistributionInput := &cloudfront.GetDistributionInput{ - Id: aws.String(d.Id()), - } - var getDistributionOutput *cloudfront.GetDistributionOutput - - log.Printf("[DEBUG] Refreshing CloudFront Distribution (%s) ETag", d.Id()) - getDistributionOutput, err = conn.GetDistributionWithContext(ctx, getDistributionInput) + var output *cloudfront.GetDistributionOutput + output, err = FindDistributionByID(ctx, conn, d.Id()) if err != nil { - return sdkdiag.AppendErrorf(diags, "refreshing CloudFront Distribution (%s) ETag: %s", d.Id(), err) + return sdkdiag.AppendErrorf(diags, "reading CloudFront Distribution (%s): %s", d.Id(), err) } - if getDistributionOutput == nil { - return sdkdiag.AppendErrorf(diags, "refreshing CloudFront Distribution (%s) ETag: empty response", d.Id()) - } - - deleteDistributionInput.IfMatch = getDistributionOutput.ETag + deleteDistroInput.IfMatch = output.ETag - _, err = conn.DeleteDistributionWithContext(ctx, deleteDistributionInput) + _, err = conn.DeleteDistributionWithContext(ctx, deleteDistroInput) } // Disable distribution if it is not yet disabled and attempt deletion again. // Here we update via the deployed configuration to ensure we are not submitting an out of date // configuration from the Terraform configuration, should other changes have occurred manually. if tfawserr.ErrCodeEquals(err, cloudfront.ErrCodeDistributionNotDisabled) { - getDistributionInput := &cloudfront.GetDistributionInput{ - Id: aws.String(d.Id()), - } - var getDistributionOutput *cloudfront.GetDistributionOutput - - log.Printf("[DEBUG] Refreshing CloudFront Distribution (%s) to disable", d.Id()) - getDistributionOutput, err = conn.GetDistributionWithContext(ctx, getDistributionInput) + var output *cloudfront.GetDistributionOutput + output, err = FindDistributionByID(ctx, conn, d.Id()) if err != nil { - return sdkdiag.AppendErrorf(diags, "refreshing CloudFront Distribution (%s) to disable: %s", d.Id(), err) + return sdkdiag.AppendErrorf(diags, "reading CloudFront Distribution (%s): %s", d.Id(), err) } - if getDistributionOutput == nil || getDistributionOutput.Distribution == nil { - return sdkdiag.AppendErrorf(diags, "refreshing CloudFront Distribution (%s) to disable: empty response", d.Id()) + updateDistroInput := &cloudfront.UpdateDistributionInput{ + DistributionConfig: output.Distribution.DistributionConfig, + Id: aws.String(d.Id()), + IfMatch: output.ETag, } + updateDistroInput.DistributionConfig.Enabled = aws.Bool(false) + var updateDistroOutput *cloudfront.UpdateDistributionOutput - updateDistributionInput := &cloudfront.UpdateDistributionInput{ - DistributionConfig: getDistributionOutput.Distribution.DistributionConfig, - Id: deleteDistributionInput.Id, - IfMatch: getDistributionOutput.ETag, - } - updateDistributionInput.DistributionConfig.Enabled = aws.Bool(false) - var updateDistributionOutput *cloudfront.UpdateDistributionOutput - - log.Printf("[DEBUG] Disabling CloudFront Distribution: %s", d.Id()) - updateDistributionOutput, err = conn.UpdateDistributionWithContext(ctx, updateDistributionInput) + updateDistroOutput, err = conn.UpdateDistributionWithContext(ctx, updateDistroInput) if err != nil { return sdkdiag.AppendErrorf(diags, "disabling CloudFront Distribution (%s): %s", d.Id(), err) } - log.Printf("[DEBUG] Waiting until CloudFront Distribution (%s) is deployed", d.Id()) if err := DistributionWaitUntilDeployed(ctx, d.Id(), meta); err != nil { return sdkdiag.AppendErrorf(diags, "waiting until CloudFront Distribution (%s) is deployed: %s", d.Id(), err) } - deleteDistributionInput.IfMatch = updateDistributionOutput.ETag + deleteDistroInput.IfMatch = updateDistroOutput.ETag - _, err = conn.DeleteDistributionWithContext(ctx, deleteDistributionInput) + _, err = conn.DeleteDistributionWithContext(ctx, deleteDistroInput) // CloudFront has eventual consistency issues even for "deployed" state. // Occasionally the DeleteDistribution call will return this error as well, in which retries will succeed: // * PreconditionFailed: The request failed because it didn't meet the preconditions in one or more request-header fields - if tfawserr.ErrCodeEquals(err, cloudfront.ErrCodeDistributionNotDisabled) || tfawserr.ErrCodeEquals(err, cloudfront.ErrCodePreconditionFailed) { - err = resource.RetryContext(ctx, 2*time.Minute, func() *resource.RetryError { - _, err := conn.DeleteDistributionWithContext(ctx, deleteDistributionInput) + if tfawserr.ErrCodeEquals(err, cloudfront.ErrCodeDistributionNotDisabled, cloudfront.ErrCodePreconditionFailed) { + _, err = tfresource.RetryWhenAWSErrCodeEquals(ctx, 2*time.Minute, func() (interface{}, error) { + return conn.DeleteDistributionWithContext(ctx, deleteDistroInput) + }, cloudfront.ErrCodeDistributionNotDisabled, cloudfront.ErrCodePreconditionFailed) + } + } - if tfawserr.ErrCodeEquals(err, cloudfront.ErrCodeDistributionNotDisabled) { - return resource.RetryableError(err) - } + if tfawserr.ErrCodeEquals(err, cloudfront.ErrCodeNoSuchDistribution) { + return diags + } - if tfawserr.ErrCodeEquals(err, cloudfront.ErrCodeNoSuchDistribution) { - return nil - } + if err != nil { + return sdkdiag.AppendErrorf(diags, "deleting CloudFront Distribution (%s): %s", d.Id(), err) + } - if tfawserr.ErrCodeEquals(err, cloudfront.ErrCodePreconditionFailed) { - return resource.RetryableError(err) - } + return diags +} - if err != nil { - return resource.NonRetryableError(err) - } +func FindDistributionByID(ctx context.Context, conn *cloudfront.CloudFront, id string) (*cloudfront.GetDistributionOutput, error) { + input := &cloudfront.GetDistributionInput{ + Id: aws.String(id), + } - return nil - }) + output, err := conn.GetDistributionWithContext(ctx, input) - // Propagate AWS Go SDK retried error, if any - if tfresource.TimedOut(err) { - _, err = conn.DeleteDistributionWithContext(ctx, deleteDistributionInput) - } + if tfawserr.ErrCodeEquals(err, cloudfront.ErrCodeNoSuchDistribution) { + return nil, &resource.NotFoundError{ + LastError: err, + LastRequest: input, } } - if tfawserr.ErrCodeEquals(err, cloudfront.ErrCodeNoSuchDistribution) { - return diags + if err != nil { + return nil, err } - if err != nil { - return sdkdiag.AppendErrorf(diags, "CloudFront Distribution %s cannot be deleted: %s", d.Id(), err) + if output == nil || output.Distribution == nil || output.Distribution.DistributionConfig == nil { + return nil, tfresource.NewEmptyResultError(input) } - return diags + return output, nil } // resourceAwsCloudFrontWebDistributionWaitUntilDeployed blocks until the diff --git a/internal/service/cloudfront/distribution_configuration_structure.go b/internal/service/cloudfront/distribution_configuration_structure.go index ea633d811424..4e47611c30aa 100644 --- a/internal/service/cloudfront/distribution_configuration_structure.go +++ b/internal/service/cloudfront/distribution_configuration_structure.go @@ -20,15 +20,6 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/flex" ) -// route53ZoneID defines the route 53 zone ID for CloudFront. This -// is used to set the zone_id attribute. -const route53ZoneID = "Z2FDTNDATAQYW2" - -// cnRoute53ZoneID defines the route 53 zone ID for CloudFront in AWS CN. -// This is used to set the zone_id attribute. -// ref: https://docs.amazonaws.cn/en_us/aws/latest/userguide/route53.html -const cnRoute53ZoneID = "Z3RFFRIM2A3IF5" - // Assemble the *cloudfront.DistributionConfig variable. Calls out to various // expander functions to convert attributes and sub-attributes to the various // complex structures which are necessary to properly build the @@ -90,7 +81,6 @@ func flattenDistributionConfig(d *schema.ResourceData, distributionConfig *cloud d.Set("enabled", distributionConfig.Enabled) d.Set("is_ipv6_enabled", distributionConfig.IsIPV6Enabled) d.Set("price_class", distributionConfig.PriceClass) - d.Set("hosted_zone_id", route53ZoneID) err = d.Set("default_cache_behavior", []interface{}{flattenDefaultCacheBehavior(distributionConfig.DefaultCacheBehavior)}) if err != nil { diff --git a/internal/service/cloudfront/distribution_data_source.go b/internal/service/cloudfront/distribution_data_source.go index 1ac8589cf992..a8f088c3e43d 100644 --- a/internal/service/cloudfront/distribution_data_source.go +++ b/internal/service/cloudfront/distribution_data_source.go @@ -4,8 +4,6 @@ import ( "context" "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/endpoints" - "github.com/aws/aws-sdk-go/service/cloudfront" "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" @@ -68,21 +66,16 @@ func DataSourceDistribution() *schema.Resource { func dataSourceDistributionRead(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { var diags diag.Diagnostics - d.SetId(d.Get("id").(string)) conn := meta.(*conns.AWSClient).CloudFrontConn() ignoreTagsConfig := meta.(*conns.AWSClient).IgnoreTagsConfig - input := &cloudfront.GetDistributionInput{ - Id: aws.String(d.Id()), - } + output, err := FindDistributionByID(ctx, conn, d.Get("id").(string)) - output, err := conn.GetDistributionWithContext(ctx, input) if err != nil { return sdkdiag.AppendErrorf(diags, "getting CloudFront Distribution (%s): %s", d.Id(), err) } - if output == nil { - return sdkdiag.AppendErrorf(diags, "getting CloudFront Distribution (%s): empty response", d.Id()) - } + + d.SetId(aws.StringValue(output.Distribution.Id)) d.Set("etag", output.ETag) if distribution := output.Distribution; distribution != nil { d.Set("arn", distribution.ARN) @@ -90,12 +83,7 @@ func dataSourceDistributionRead(ctx context.Context, d *schema.ResourceData, met d.Set("in_progress_validation_batches", distribution.InProgressInvalidationBatches) d.Set("last_modified_time", aws.String(distribution.LastModifiedTime.String())) d.Set("status", distribution.Status) - region := meta.(*conns.AWSClient).Region - if v, ok := endpoints.PartitionForRegion(endpoints.DefaultPartitions(), region); ok && v.ID() == endpoints.AwsCnPartitionID { - d.Set("hosted_zone_id", cnRoute53ZoneID) - } else { - d.Set("hosted_zone_id", route53ZoneID) - } + d.Set("hosted_zone_id", meta.(*conns.AWSClient).CloudFrontDistributionHostedZoneID()) if distributionConfig := distribution.DistributionConfig; distributionConfig != nil { d.Set("enabled", distributionConfig.Enabled) if aliases := distributionConfig.Aliases; aliases != nil { diff --git a/internal/service/cloudfront/distribution_data_source_test.go b/internal/service/cloudfront/distribution_data_source_test.go index d2caabc6105a..16c1bfa292bf 100644 --- a/internal/service/cloudfront/distribution_data_source_test.go +++ b/internal/service/cloudfront/distribution_data_source_test.go @@ -37,8 +37,7 @@ func TestAccCloudFrontDistributionDataSource_basic(t *testing.T) { } func testAccDistributionDataSourceConfig_basic(rName string) string { - return acctest.ConfigCompose( - testAccDistributionConfig_s3Tags(rName), ` + return acctest.ConfigCompose(testAccDistributionConfig_s3Tags(rName), ` data "aws_cloudfront_distribution" "test" { id = aws_cloudfront_distribution.s3_distribution.id } diff --git a/internal/service/cloudfront/find.go b/internal/service/cloudfront/find.go index 79244a741845..c5a8df9d9e96 100644 --- a/internal/service/cloudfront/find.go +++ b/internal/service/cloudfront/find.go @@ -35,31 +35,6 @@ func FindCachePolicyByID(ctx context.Context, conn *cloudfront.CloudFront, id st return output, nil } -func FindDistributionByID(ctx context.Context, conn *cloudfront.CloudFront, id string) (*cloudfront.GetDistributionOutput, error) { - input := &cloudfront.GetDistributionInput{ - Id: aws.String(id), - } - - output, err := conn.GetDistributionWithContext(ctx, input) - - if tfawserr.ErrCodeEquals(err, cloudfront.ErrCodeNoSuchDistribution) { - return nil, &resource.NotFoundError{ - LastError: err, - LastRequest: input, - } - } - - if err != nil { - return nil, err - } - - if output == nil || output.Distribution == nil || output.Distribution.DistributionConfig == nil { - return nil, tfresource.NewEmptyResultError(input) - } - - return output, nil -} - func FindFieldLevelEncryptionConfigByID(ctx context.Context, conn *cloudfront.CloudFront, id string) (*cloudfront.GetFieldLevelEncryptionConfigOutput, error) { input := &cloudfront.GetFieldLevelEncryptionConfigInput{ Id: aws.String(id), From 7bfb5daa72d85441dd180f761a35e52afaa36ede Mon Sep 17 00:00:00 2001 From: Indresh-Prakash Date: Sat, 11 Mar 2023 05:46:56 +0530 Subject: [PATCH 646/763] Add gp3 under iops section for launch template (#29897) --- website/docs/r/launch_template.html.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/website/docs/r/launch_template.html.markdown b/website/docs/r/launch_template.html.markdown index 6d80a981959f..0a9066e819e8 100644 --- a/website/docs/r/launch_template.html.markdown +++ b/website/docs/r/launch_template.html.markdown @@ -182,7 +182,7 @@ The `ebs` block supports the following: * `encrypted` - (Optional) Enables [EBS encryption](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSEncryption.html) on the volume. Cannot be used with `snapshot_id`. * `iops` - (Optional) The amount of provisioned [IOPS](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-io-characteristics.html). - This must be set with a `volume_type` of `"io1/io2"`. + This must be set with a `volume_type` of `"io1/io2/gp3"`. * `kms_key_id` - (Optional) The ARN of the AWS Key Management Service (AWS KMS) customer master key (CMK) to use when creating the encrypted volume. `encrypted` must be set to `true` when this is set. * `snapshot_id` - (Optional) The Snapshot ID to mount. From e90f324445f1cbde307e748a360194dd2a59904c Mon Sep 17 00:00:00 2001 From: Mike Christof Date: Sat, 11 Mar 2023 00:17:44 +0000 Subject: [PATCH 647/763] fix r/sagemaker_app typos (#29904) --- website/docs/r/sagemaker_app.html.markdown | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/website/docs/r/sagemaker_app.html.markdown b/website/docs/r/sagemaker_app.html.markdown index f4247829c4d3..76bc6b0f1f8a 100644 --- a/website/docs/r/sagemaker_app.html.markdown +++ b/website/docs/r/sagemaker_app.html.markdown @@ -30,9 +30,9 @@ The following arguments are supported: * `app_name` - (Required) The name of the app. * `app_type` - (Required) The type of app. Valid values are `JupyterServer`, `KernelGateway`, `RStudioServerPro`, `RSessionGateway` and `TensorBoard`. * `domain_id` - (Required) The domain ID. -* `user_profile_name` - (Optional) The user profile name. At least on of `user_profile_name` or `space_name` required. +* `user_profile_name` - (Optional) The user profile name. At least one of `user_profile_name` or `space_name` required. * `resource_spec` - (Optional) The instance type and the Amazon Resource Name (ARN) of the SageMaker image created on the instance.See [Resource Spec](#resource-spec) below. -* `space_name` - (Optional) The name of the space. At least on of `user_profile_name` or `space_name` required. +* `space_name` - (Optional) The name of the space. At least one of `user_profile_name` or `space_name` required. * `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. ### Resource Spec From 6a6906c793435d12812f6fcfcd43fbb980d7c4e0 Mon Sep 17 00:00:00 2001 From: teruya <27873650+teru01@users.noreply.github.com> Date: Sat, 11 Mar 2023 11:43:38 +0900 Subject: [PATCH 648/763] r/aws_lb_target_group: add cross_zone_enabled option --- internal/service/elbv2/target_group.go | 27 ++++++++ internal/service/elbv2/target_group_test.go | 69 +++++++++++++++++++++ 2 files changed, 96 insertions(+) diff --git a/internal/service/elbv2/target_group.go b/internal/service/elbv2/target_group.go index bbcfc60af0fd..68f20cf2388d 100644 --- a/internal/service/elbv2/target_group.go +++ b/internal/service/elbv2/target_group.go @@ -147,6 +147,16 @@ func ResourceTargetGroup() *schema.Resource { "least_outstanding_requests", }, false), }, + "load_balancing_cross_zone_enabled": { + Type: schema.TypeString, + Optional: true, + Computed: true, + ValidateFunc: validation.StringInSlice([]string{ + "true", + "false", + "use_load_balancer_configuration", + }, false), + }, "name": { Type: schema.TypeString, Optional: true, @@ -475,6 +485,13 @@ func resourceTargetGroupCreate(ctx context.Context, d *schema.ResourceData, meta }) } + if v, ok := d.GetOk("load_balancing_cross_zone_enabled"); ok { + attrs = append(attrs, &elbv2.TargetGroupAttribute{ + Key: aws.String("load_balancing.cross_zone.enabled"), + Value: aws.String(v.(string)), + }) + } + if v, ok := d.GetOk("preserve_client_ip"); ok { attrs = append(attrs, &elbv2.TargetGroupAttribute{ Key: aws.String("preserve_client_ip.enabled"), @@ -767,6 +784,13 @@ func resourceTargetGroupUpdate(ctx context.Context, d *schema.ResourceData, meta }) } + if d.HasChange("load_balancing_cross_zone_enabled") { + attrs = append(attrs, &elbv2.TargetGroupAttribute{ + Key: aws.String("load_balancing.cross_zone.enabled"), + Value: aws.String(d.Get("load_balancing_cross_zone_enabled").(string)), + }) + } + if d.HasChange("target_failover") { failoverBlock := d.Get("target_failover").([]interface{}) if len(failoverBlock) == 1 { @@ -1093,6 +1117,9 @@ func flattenTargetGroupResource(ctx context.Context, d *schema.ResourceData, met case "load_balancing.algorithm.type": loadBalancingAlgorithm := aws.StringValue(attr.Value) d.Set("load_balancing_algorithm_type", loadBalancingAlgorithm) + case "load_balancing.cross_zone.enabled": + loadBalancingCrossZoneEnabled := aws.StringValue(attr.Value) + d.Set("load_balancing_cross_zone_enabled", loadBalancingCrossZoneEnabled) case "preserve_client_ip.enabled": _, err := strconv.ParseBool(aws.StringValue(attr.Value)) if err != nil { diff --git a/internal/service/elbv2/target_group_test.go b/internal/service/elbv2/target_group_test.go index dcbbf0dec819..03bdf7889fb0 100644 --- a/internal/service/elbv2/target_group_test.go +++ b/internal/service/elbv2/target_group_test.go @@ -2122,6 +2122,49 @@ func TestAccELBV2TargetGroup_ALBAlias_updateLoadBalancingAlgorithmType(t *testin }) } +func TestAccELBV2TargetGroup_ALBAlias_updateLoadBalancingCrossZoneEnabled(t *testing.T) { + ctx := acctest.Context(t) + var conf elbv2.TargetGroup + rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) + resourceName := "aws_alb_target_group.test" + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { acctest.PreCheck(t) }, + ErrorCheck: acctest.ErrorCheck(t, elbv2.EndpointsID), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + CheckDestroy: testAccCheckTargetGroupDestroy(ctx), + Steps: []resource.TestStep{ + { + Config: testAccTargetGroupConfig_albLoadBalancingCrossZoneEnabled(rName, false, false), + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheckTargetGroupExists(ctx, resourceName, &conf), + resource.TestCheckResourceAttrSet(resourceName, "arn"), + resource.TestCheckResourceAttr(resourceName, "name", rName), + resource.TestCheckResourceAttr(resourceName, "load_balancing_cross_zone_enabled", "use_load_balancer_configuration"), + ), + }, + { + Config: testAccTargetGroupConfig_albLoadBalancingCrossZoneEnabled(rName, true, true), + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheckTargetGroupExists(ctx, resourceName, &conf), + resource.TestCheckResourceAttrSet(resourceName, "arn"), + resource.TestCheckResourceAttr(resourceName, "name", rName), + resource.TestCheckResourceAttr(resourceName, "load_balancing_cross_zone_enabled", "true"), + ), + }, + { + Config: testAccTargetGroupConfig_albLoadBalancingCrossZoneEnabled(rName, true, false), + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheckTargetGroupExists(ctx, resourceName, &conf), + resource.TestCheckResourceAttrSet(resourceName, "arn"), + resource.TestCheckResourceAttr(resourceName, "name", rName), + resource.TestCheckResourceAttr(resourceName, "load_balancing_cross_zone_enabled", "false"), + ), + }, + }, + }) +} + func TestAccELBV2TargetGroup_ALBAlias_updateStickinessEnabled(t *testing.T) { ctx := acctest.Context(t) var conf elbv2.TargetGroup @@ -3512,6 +3555,32 @@ resource "aws_vpc" "test" { }`, rName, algoTypeParam) } +func testAccTargetGroupConfig_albLoadBalancingCrossZoneEnabled(rName string, nonDefault bool, enabled bool) string { + var crossZoneParam string + + if nonDefault { + crossZoneParam = fmt.Sprintf(`load_balancing_cross_zone_enabled = "%v"`, enabled) + } + + return fmt.Sprintf(` +resource "aws_alb_target_group" "test" { + name = %[1]q + port = 443 + protocol = "HTTPS" + vpc_id = aws_vpc.test.id + + %[2]s +} + +resource "aws_vpc" "test" { + cidr_block = "10.0.0.0/16" + + tags = { + Name = %[1]q + } +}`, rName, crossZoneParam) +} + func testAccTargetGroupConfig_albMissingPort(rName string) string { return fmt.Sprintf(` resource "aws_alb_target_group" "test" { From 57a998a61a287cf036a57923beb2e71a02e8b2ac Mon Sep 17 00:00:00 2001 From: teruya <27873650+teru01@users.noreply.github.com> Date: Sat, 11 Mar 2023 12:07:57 +0900 Subject: [PATCH 649/763] d/aws_lb_target_group: add cross_zone_enabled option --- internal/service/elbv2/target_group_data_source.go | 7 +++++++ internal/service/elbv2/target_group_data_source_test.go | 9 ++++++--- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/internal/service/elbv2/target_group_data_source.go b/internal/service/elbv2/target_group_data_source.go index f724e07e561f..c5c07a321d04 100644 --- a/internal/service/elbv2/target_group_data_source.go +++ b/internal/service/elbv2/target_group_data_source.go @@ -97,6 +97,10 @@ func DataSourceTargetGroup() *schema.Resource { Type: schema.TypeString, Computed: true, }, + "load_balancing_cross_zone_enabled": { + Type: schema.TypeString, + Computed: true, + }, "name": { Type: schema.TypeString, Optional: true, @@ -277,6 +281,9 @@ func dataSourceTargetGroupRead(ctx context.Context, d *schema.ResourceData, meta case "load_balancing.algorithm.type": loadBalancingAlgorithm := aws.StringValue(attr.Value) d.Set("load_balancing_algorithm_type", loadBalancingAlgorithm) + case "load_balancing.cross_zone.enabled": + loadBalancingCrossZoneEnabled := aws.StringValue(attr.Value) + d.Set("load_balancing_cross_zone_enabled", loadBalancingCrossZoneEnabled) case "preserve_client_ip.enabled": _, err := strconv.ParseBool(aws.StringValue(attr.Value)) if err != nil { diff --git a/internal/service/elbv2/target_group_data_source_test.go b/internal/service/elbv2/target_group_data_source_test.go index e2d6ab54aa24..28caeeb14d28 100644 --- a/internal/service/elbv2/target_group_data_source_test.go +++ b/internal/service/elbv2/target_group_data_source_test.go @@ -31,6 +31,7 @@ func TestAccELBV2TargetGroupDataSource_basic(t *testing.T) { resource.TestCheckResourceAttr(datasourceNameByARN, "protocol_version", "HTTP1"), resource.TestCheckResourceAttrSet(datasourceNameByARN, "vpc_id"), resource.TestCheckResourceAttrSet(datasourceNameByARN, "load_balancing_algorithm_type"), + resource.TestCheckResourceAttrSet(datasourceNameByARN, "load_balancing_cross_zone_enabled"), resource.TestCheckResourceAttr(datasourceNameByARN, "deregistration_delay", "300"), resource.TestCheckResourceAttr(datasourceNameByARN, "slow_start", "0"), resource.TestCheckResourceAttr(datasourceNameByARN, "tags.%", "1"), @@ -51,6 +52,7 @@ func TestAccELBV2TargetGroupDataSource_basic(t *testing.T) { resource.TestCheckResourceAttr(datasourceNameByName, "port", "8080"), resource.TestCheckResourceAttr(datasourceNameByName, "protocol", "HTTP"), resource.TestCheckResourceAttrSet(datasourceNameByName, "load_balancing_algorithm_type"), + resource.TestCheckResourceAttrSet(datasourceNameByName, "load_balancing_cross_zone_enabled"), resource.TestCheckResourceAttrSet(datasourceNameByName, "vpc_id"), resource.TestCheckResourceAttr(datasourceNameByName, "deregistration_delay", "300"), resource.TestCheckResourceAttr(datasourceNameByName, "slow_start", "0"), @@ -91,6 +93,7 @@ func TestAccELBV2TargetGroupDataSource_appCookie(t *testing.T) { resource.TestCheckResourceAttr(resourceNameArn, "protocol_version", "HTTP1"), resource.TestCheckResourceAttrSet(resourceNameArn, "vpc_id"), resource.TestCheckResourceAttrSet(resourceNameArn, "load_balancing_algorithm_type"), + resource.TestCheckResourceAttrSet(resourceNameArn, "load_balancing_cross_zone_enabled"), resource.TestCheckResourceAttr(resourceNameArn, "deregistration_delay", "300"), resource.TestCheckResourceAttr(resourceNameArn, "slow_start", "0"), resource.TestCheckResourceAttr(resourceNameArn, "tags.%", "1"), @@ -195,7 +198,7 @@ func TestAccELBV2TargetGroupDataSource_tags(t *testing.T) { resource.TestCheckResourceAttrPair(dataSourceMatchFirstTag, "arn_suffix", resourceTg1, "arn_suffix"), resource.TestCheckResourceAttrPair(dataSourceMatchFirstTag, "id", resourceTg1, "id"), resource.TestCheckResourceAttrPair(dataSourceMatchFirstTag, "load_balancing_algorithm_type", resourceTg1, "load_balancing_algorithm_type"), - resource.TestCheckResourceAttrPair(dataSourceMatchFirstTag, "load_balancing_algorithm_type", resourceTg1, "load_balancing_algorithm_type"), + resource.TestCheckResourceAttrPair(dataSourceMatchFirstTag, "load_balancing_cross_zone_enabled", resourceTg1, "load_balancing_cross_zone_enabled"), resource.TestCheckResourceAttrPair(dataSourceMatchFirstTag, "health_check.#", resourceTg1, "health_check.#"), resource.TestCheckResourceAttrPair(dataSourceMatchFirstTag, "health_check.0.path", resourceTg1, "health_check.0.path"), resource.TestCheckResourceAttrPair(dataSourceMatchFirstTag, "health_check.0.port", resourceTg1, "health_check.0.port"), @@ -210,7 +213,7 @@ func TestAccELBV2TargetGroupDataSource_tags(t *testing.T) { resource.TestCheckResourceAttrPair(dataSourceMatchSecondTag, "arn_suffix", resourceTg2, "arn_suffix"), resource.TestCheckResourceAttrPair(dataSourceMatchSecondTag, "id", resourceTg2, "id"), resource.TestCheckResourceAttrPair(dataSourceMatchSecondTag, "load_balancing_algorithm_type", resourceTg2, "load_balancing_algorithm_type"), - resource.TestCheckResourceAttrPair(dataSourceMatchSecondTag, "load_balancing_algorithm_type", resourceTg2, "load_balancing_algorithm_type"), + resource.TestCheckResourceAttrPair(dataSourceMatchSecondTag, "load_balancing_cross_zone_enabled", resourceTg2, "load_balancing_cross_zone_enabled"), resource.TestCheckResourceAttrPair(dataSourceMatchSecondTag, "health_check.#", resourceTg2, "health_check.#"), resource.TestCheckResourceAttrPair(dataSourceMatchSecondTag, "health_check.0.path", resourceTg2, "health_check.0.path"), resource.TestCheckResourceAttrPair(dataSourceMatchSecondTag, "health_check.0.port", resourceTg2, "health_check.0.port"), @@ -225,7 +228,7 @@ func TestAccELBV2TargetGroupDataSource_tags(t *testing.T) { resource.TestCheckResourceAttrPair(dataSourceMatchFirstTagAndName, "arn_suffix", resourceTg1, "arn_suffix"), resource.TestCheckResourceAttrPair(dataSourceMatchFirstTagAndName, "id", resourceTg1, "id"), resource.TestCheckResourceAttrPair(dataSourceMatchFirstTagAndName, "load_balancing_algorithm_type", resourceTg1, "load_balancing_algorithm_type"), - resource.TestCheckResourceAttrPair(dataSourceMatchFirstTagAndName, "load_balancing_algorithm_type", resourceTg1, "load_balancing_algorithm_type"), + resource.TestCheckResourceAttrPair(dataSourceMatchFirstTagAndName, "load_balancing_cross_zone_enabled", resourceTg1, "load_balancing_cross_zone_enabled"), resource.TestCheckResourceAttrPair(dataSourceMatchFirstTagAndName, "health_check.#", resourceTg1, "health_check.#"), resource.TestCheckResourceAttrPair(dataSourceMatchFirstTagAndName, "health_check.0.path", resourceTg1, "health_check.0.path"), resource.TestCheckResourceAttrPair(dataSourceMatchFirstTagAndName, "health_check.0.port", resourceTg1, "health_check.0.port"), From 511fa8753b14659203d57d2d9cdb124232348b79 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Sat, 11 Mar 2023 14:48:12 -0500 Subject: [PATCH 650/763] r/aws_api_gateway_domain_name: Add 'FindDomainName'. Acceptance test output: make testacc TESTARGS='-run=TestAccAPIGatewayDomainName_' PKG=apigateway ACCTEST_PARALLELISM=3 % make testacc TESTARGS='-run=TestAccAPIGatewayDomainName_' PKG=apigateway ACCTEST_PARALLELISM=3 ==> Checking that code complies with gofmt requirements... TF_ACC=1 go test ./internal/service/apigateway/... -v -count 1 -parallel 3 -run=TestAccAPIGatewayDomainName_ -timeout 180m === RUN TestAccAPIGatewayDomainName_certificateARN acctest.go:1585: Environment variable ACM_CERTIFICATE_ROOT_DOMAIN is not set. For DNS validation requests, this domain must be publicly accessible and configurable via Route53 during the testing. For email validation requests, you must have access to one of the five standard email addresses used (admin|administrator|hostmaster|postmaster|webmaster)@domain or one of the WHOIS contact addresses. --- SKIP: TestAccAPIGatewayDomainName_certificateARN (0.00s) === RUN TestAccAPIGatewayDomainName_certificateName domain_name_test.go:60: Environment variable AWS_API_GATEWAY_DOMAIN_NAME_CERTIFICATE_BODY is not set. This environment variable must be set to any non-empty value with a publicly trusted certificate body to enable the test. --- SKIP: TestAccAPIGatewayDomainName_certificateName (0.00s) === RUN TestAccAPIGatewayDomainName_regionalCertificateARN === PAUSE TestAccAPIGatewayDomainName_regionalCertificateARN === RUN TestAccAPIGatewayDomainName_regionalCertificateName domain_name_test.go:156: Environment variable AWS_API_GATEWAY_DOMAIN_NAME_REGIONAL_CERTIFICATE_NAME_ENABLED is not set. This environment variable must be set to any non-empty value in a region where uploading REGIONAL certificates is allowed to enable the test. --- SKIP: TestAccAPIGatewayDomainName_regionalCertificateName (0.00s) === RUN TestAccAPIGatewayDomainName_securityPolicy === PAUSE TestAccAPIGatewayDomainName_securityPolicy === RUN TestAccAPIGatewayDomainName_tags === PAUSE TestAccAPIGatewayDomainName_tags === RUN TestAccAPIGatewayDomainName_disappears === PAUSE TestAccAPIGatewayDomainName_disappears === RUN TestAccAPIGatewayDomainName_MutualTLSAuthentication_basic acctest.go:1585: Environment variable ACM_CERTIFICATE_ROOT_DOMAIN is not set. For DNS validation requests, this domain must be publicly accessible and configurable via Route53 during the testing. For email validation requests, you must have access to one of the five standard email addresses used (admin|administrator|hostmaster|postmaster|webmaster)@domain or one of the WHOIS contact addresses. --- SKIP: TestAccAPIGatewayDomainName_MutualTLSAuthentication_basic (0.00s) === RUN TestAccAPIGatewayDomainName_MutualTLSAuthentication_ownership acctest.go:1585: Environment variable ACM_CERTIFICATE_ROOT_DOMAIN is not set. For DNS validation requests, this domain must be publicly accessible and configurable via Route53 during the testing. For email validation requests, you must have access to one of the five standard email addresses used (admin|administrator|hostmaster|postmaster|webmaster)@domain or one of the WHOIS contact addresses. --- SKIP: TestAccAPIGatewayDomainName_MutualTLSAuthentication_ownership (0.00s) === CONT TestAccAPIGatewayDomainName_regionalCertificateARN === CONT TestAccAPIGatewayDomainName_tags === CONT TestAccAPIGatewayDomainName_securityPolicy === CONT TestAccAPIGatewayDomainName_disappears --- PASS: TestAccAPIGatewayDomainName_regionalCertificateARN (21.13s) --- PASS: TestAccAPIGatewayDomainName_disappears (101.96s) --- PASS: TestAccAPIGatewayDomainName_tags (130.61s) --- PASS: TestAccAPIGatewayDomainName_securityPolicy (179.21s) PASS ok github.com/hashicorp/terraform-provider-aws/internal/service/apigateway 184.570s % AWS_DEFAULT_REGION=us-east-1 ACM_CERTIFICATE_ROOT_DOMAIN=example.com make testacc TESTARGS='-run=TestAccAPIGatewayDomainName_certificateARN\|TestAccAPIGatewayDomainName_MutualTLSAuthentication_' PKG=apigateway ACCTEST_PARALLELISM=2 ==> Checking that code complies with gofmt requirements... TF_ACC=1 go test ./internal/service/apigateway/... -v -count 1 -parallel 2 -run=TestAccAPIGatewayDomainName_certificateARN\|TestAccAPIGatewayDomainName_MutualTLSAuthentication_ -timeout 180m === RUN TestAccAPIGatewayDomainName_certificateARN === PAUSE TestAccAPIGatewayDomainName_certificateARN === RUN TestAccAPIGatewayDomainName_MutualTLSAuthentication_basic === PAUSE TestAccAPIGatewayDomainName_MutualTLSAuthentication_basic === RUN TestAccAPIGatewayDomainName_MutualTLSAuthentication_ownership === PAUSE TestAccAPIGatewayDomainName_MutualTLSAuthentication_ownership === CONT TestAccAPIGatewayDomainName_certificateARN === CONT TestAccAPIGatewayDomainName_MutualTLSAuthentication_ownership --- PASS: TestAccAPIGatewayDomainName_MutualTLSAuthentication_ownership (99.50s) === CONT TestAccAPIGatewayDomainName_MutualTLSAuthentication_basic --- PASS: TestAccAPIGatewayDomainName_MutualTLSAuthentication_basic (199.75s) --- PASS: TestAccAPIGatewayDomainName_certificateARN (1018.74s) PASS ok github.com/hashicorp/terraform-provider-aws/internal/service/apigateway 1023.818s --- internal/service/apigateway/acc_test.go | 125 ------- internal/service/apigateway/domain_name.go | 330 +++++++++--------- .../service/apigateway/domain_name_test.go | 163 +++------ 3 files changed, 211 insertions(+), 407 deletions(-) delete mode 100644 internal/service/apigateway/acc_test.go diff --git a/internal/service/apigateway/acc_test.go b/internal/service/apigateway/acc_test.go deleted file mode 100644 index 565c25a88f62..000000000000 --- a/internal/service/apigateway/acc_test.go +++ /dev/null @@ -1,125 +0,0 @@ -package apigateway_test - -import ( - "context" - "fmt" - "sync" - "testing" - - "github.com/aws/aws-sdk-go/aws/arn" - "github.com/aws/aws-sdk-go/aws/endpoints" - "github.com/aws/aws-sdk-go/service/apigateway" - "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/terraform" - "github.com/hashicorp/terraform-provider-aws/internal/acctest" - "github.com/hashicorp/terraform-provider-aws/internal/provider" -) - -// API Gateway Edge-Optimized Domain Name can only be created with ACM Certificates in specific regions. - -// testAccEdgeDomainNameRegion is the chosen API Gateway Domain Name testing region -// -// Cached to prevent issues should multiple regions become available. -var testAccEdgeDomainNameRegion string - -// testAccProviderEdgeDomainName is the API Gateway Domain Name provider instance -// -// This Provider can be used in testing code for API calls without requiring -// the use of saving and referencing specific ProviderFactories instances. -// -// testAccPreCheckEdgeDomainName(t) must be called before using this provider instance. -var testAccProviderEdgeDomainName *schema.Provider - -// testAccProviderEdgeDomainNameConfigure ensures the provider is only configured once -var testAccProviderEdgeDomainNameConfigure sync.Once - -// testAccPreCheckEdgeDomainName verifies AWS credentials and that API Gateway Domain Name is supported -func testAccPreCheckEdgeDomainName(ctx context.Context, t *testing.T) { - acctest.PreCheckPartitionHasService(t, apigateway.EndpointsID) - - region := testAccGetEdgeDomainNameRegion() - - if region == "" { - t.Skip("API Gateway Domain Name not available in this AWS Partition") - } - - // Since we are outside the scope of the Terraform configuration we must - // call Configure() to properly initialize the provider configuration. - testAccProviderEdgeDomainNameConfigure.Do(func() { - var err error - testAccProviderEdgeDomainName, err = provider.New(ctx) - - if err != nil { - t.Fatal(err) - } - - config := map[string]interface{}{ - "region": region, - } - - diags := testAccProviderEdgeDomainName.Configure(ctx, terraform.NewResourceConfigRaw(config)) - - if diags != nil && diags.HasError() { - for _, d := range diags { - if d.Severity == diag.Error { - t.Fatalf("error configuring API Gateway Domain Name provider: %s", d.Summary) - } - } - } - }) -} - -// testAccEdgeDomainNameRegionProviderConfig is the Terraform provider configuration for API Gateway Domain Name region testing -// -// Testing API Gateway Domain Name assumes no other provider configurations -// are necessary and overwrites the "aws" provider configuration. -func testAccEdgeDomainNameRegionProviderConfig() string { - return acctest.ConfigRegionalProvider(testAccGetEdgeDomainNameRegion()) -} - -// testAccEdgeDomainNameRegion returns the API Gateway Domain Name region for testing -func testAccGetEdgeDomainNameRegion() string { - if testAccEdgeDomainNameRegion != "" { - return testAccEdgeDomainNameRegion - } - - // AWS Commercial: https://docs.aws.amazon.com/apigateway/latest/developerguide/how-to-custom-domains.html - // AWS GovCloud (US) - edge custom domain names not supported: https://docs.aws.amazon.com/govcloud-us/latest/UserGuide/govcloud-abp.html - // AWS China - edge custom domain names not supported: https://docs.amazonaws.cn/en_us/aws/latest/userguide/api-gateway.html - switch acctest.Partition() { - case endpoints.AwsPartitionID: - testAccEdgeDomainNameRegion = endpoints.UsEast1RegionID - } - - return testAccEdgeDomainNameRegion -} - -// testAccCheckResourceAttrRegionalARNEdgeDomainName ensures the Terraform state exactly matches the expected API Gateway Edge Domain Name format -func testAccCheckResourceAttrRegionalARNEdgeDomainName(resourceName, attributeName, arnService string, domain string) resource.TestCheckFunc { - return func(s *terraform.State) error { - attributeValue := arn.ARN{ - Partition: acctest.Partition(), - Region: testAccGetEdgeDomainNameRegion(), - Resource: fmt.Sprintf("/domainnames/%s", domain), - Service: arnService, - }.String() - - return resource.TestCheckResourceAttr(resourceName, attributeName, attributeValue)(s) - } -} - -// testAccCheckResourceAttrRegionalARNRegionalDomainName ensures the Terraform state exactly matches the expected API Gateway Regional Domain Name format -func testAccCheckResourceAttrRegionalARNRegionalDomainName(resourceName, attributeName, arnService string, domain string) resource.TestCheckFunc { - return func(s *terraform.State) error { - attributeValue := arn.ARN{ - Partition: acctest.Partition(), - Region: acctest.Region(), - Resource: fmt.Sprintf("/domainnames/%s", domain), - Service: arnService, - }.String() - - return resource.TestCheckResourceAttr(resourceName, attributeName, attributeValue)(s) - } -} diff --git a/internal/service/apigateway/domain_name.go b/internal/service/apigateway/domain_name.go index e2c9255357e8..f8aea787248f 100644 --- a/internal/service/apigateway/domain_name.go +++ b/internal/service/apigateway/domain_name.go @@ -11,11 +11,13 @@ import ( "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/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/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" ) @@ -26,35 +28,41 @@ func ResourceDomainName() *schema.Resource { ReadWithoutTimeout: resourceDomainNameRead, UpdateWithoutTimeout: resourceDomainNameUpdate, DeleteWithoutTimeout: resourceDomainNameDelete, + Importer: &schema.ResourceImporter{ StateContext: schema.ImportStatePassthroughContext, }, Schema: map[string]*schema.Schema{ - + "arn": { + Type: schema.TypeString, + Computed: true, + }, //According to AWS Documentation, ACM will be the only way to add certificates //to ApiGateway DomainNames. When this happens, we will be deprecating all certificate methods //except certificate_arn. We are not quite sure when this will happen. + "certificate_arn": { + Type: schema.TypeString, + Optional: true, + ConflictsWith: []string{"certificate_body", "certificate_chain", "certificate_name", "certificate_private_key", "regional_certificate_arn", "regional_certificate_name"}, + }, "certificate_body": { Type: schema.TypeString, ForceNew: true, Optional: true, ConflictsWith: []string{"certificate_arn", "regional_certificate_arn"}, }, - "certificate_chain": { Type: schema.TypeString, ForceNew: true, Optional: true, ConflictsWith: []string{"certificate_arn", "regional_certificate_arn"}, }, - "certificate_name": { Type: schema.TypeString, Optional: true, ConflictsWith: []string{"certificate_arn", "regional_certificate_arn", "regional_certificate_name"}, }, - "certificate_private_key": { Type: schema.TypeString, ForceNew: true, @@ -62,44 +70,23 @@ func ResourceDomainName() *schema.Resource { Sensitive: true, ConflictsWith: []string{"certificate_arn", "regional_certificate_arn"}, }, - - "domain_name": { - Type: schema.TypeString, - Required: true, - ForceNew: true, - }, - - "security_policy": { + "certificate_upload_date": { Type: schema.TypeString, - Optional: true, Computed: true, - ValidateFunc: validation.StringInSlice([]string{ - apigateway.SecurityPolicyTls10, - apigateway.SecurityPolicyTls12, - }, true), - }, - - "certificate_arn": { - Type: schema.TypeString, - Optional: true, - ConflictsWith: []string{"certificate_body", "certificate_chain", "certificate_name", "certificate_private_key", "regional_certificate_arn", "regional_certificate_name"}, }, - "cloudfront_domain_name": { Type: schema.TypeString, Computed: true, }, - - "certificate_upload_date": { + "cloudfront_zone_id": { Type: schema.TypeString, Computed: true, }, - - "cloudfront_zone_id": { + "domain_name": { Type: schema.TypeString, - Computed: true, + Required: true, + ForceNew: true, }, - "endpoint_configuration": { Type: schema.TypeList, Optional: true, @@ -125,7 +112,6 @@ func ResourceDomainName() *schema.Resource { }, }, }, - "mutual_tls_authentication": { Type: schema.TypeList, Optional: true, @@ -144,38 +130,35 @@ func ResourceDomainName() *schema.Resource { }, }, }, - "ownership_verification_certificate_arn": { Type: schema.TypeString, Optional: true, Computed: true, ValidateFunc: verify.ValidARN, }, - "regional_certificate_arn": { Type: schema.TypeString, Optional: true, ConflictsWith: []string{"certificate_arn", "certificate_body", "certificate_chain", "certificate_name", "certificate_private_key", "regional_certificate_name"}, }, - "regional_certificate_name": { Type: schema.TypeString, Optional: true, ConflictsWith: []string{"certificate_arn", "certificate_name", "regional_certificate_arn"}, }, - "regional_domain_name": { Type: schema.TypeString, Computed: true, }, - "regional_zone_id": { Type: schema.TypeString, Computed: true, }, - "arn": { - Type: schema.TypeString, - Computed: true, + "security_policy": { + Type: schema.TypeString, + Optional: true, + Computed: true, + ValidateFunc: validation.StringInSlice(apigateway.SecurityPolicy_Values(), true), }, "tags": tftags.TagsSchema(), "tags_all": tftags.TagsSchemaComputed(), @@ -190,63 +173,64 @@ func resourceDomainNameCreate(ctx context.Context, d *schema.ResourceData, meta conn := meta.(*conns.AWSClient).APIGatewayConn() defaultTagsConfig := meta.(*conns.AWSClient).DefaultTagsConfig tags := defaultTagsConfig.MergeTags(tftags.New(ctx, d.Get("tags").(map[string]interface{}))) - log.Printf("[DEBUG] Creating API Gateway Domain Name") - params := &apigateway.CreateDomainNameInput{ - DomainName: aws.String(d.Get("domain_name").(string)), + domainName := d.Get("domain_name").(string) + input := &apigateway.CreateDomainNameInput{ + DomainName: aws.String(domainName), MutualTlsAuthentication: expandMutualTLSAuthentication(d.Get("mutual_tls_authentication").([]interface{})), } if v, ok := d.GetOk("certificate_arn"); ok { - params.CertificateArn = aws.String(v.(string)) - } - - if v, ok := d.GetOk("certificate_name"); ok { - params.CertificateName = aws.String(v.(string)) + input.CertificateArn = aws.String(v.(string)) } if v, ok := d.GetOk("certificate_body"); ok { - params.CertificateBody = aws.String(v.(string)) + input.CertificateBody = aws.String(v.(string)) } if v, ok := d.GetOk("certificate_chain"); ok { - params.CertificateChain = aws.String(v.(string)) + input.CertificateChain = aws.String(v.(string)) + } + + if v, ok := d.GetOk("certificate_name"); ok { + input.CertificateName = aws.String(v.(string)) } if v, ok := d.GetOk("certificate_private_key"); ok { - params.CertificatePrivateKey = aws.String(v.(string)) + input.CertificatePrivateKey = aws.String(v.(string)) } if v, ok := d.GetOk("endpoint_configuration"); ok { - params.EndpointConfiguration = expandEndpointConfiguration(v.([]interface{})) + input.EndpointConfiguration = expandEndpointConfiguration(v.([]interface{})) + } + + if v, ok := d.GetOk("ownership_verification_certificate_arn"); ok { + input.OwnershipVerificationCertificateArn = aws.String(v.(string)) } if v, ok := d.GetOk("regional_certificate_arn"); ok { - params.RegionalCertificateArn = aws.String(v.(string)) + input.RegionalCertificateArn = aws.String(v.(string)) } if v, ok := d.GetOk("regional_certificate_name"); ok { - params.RegionalCertificateName = aws.String(v.(string)) + input.RegionalCertificateName = aws.String(v.(string)) } if v, ok := d.GetOk("security_policy"); ok { - params.SecurityPolicy = aws.String(v.(string)) - } - - if v, ok := d.GetOk("ownership_verification_certificate_arn"); ok { - params.OwnershipVerificationCertificateArn = aws.String(v.(string)) + input.SecurityPolicy = aws.String(v.(string)) } if len(tags) > 0 { - params.Tags = Tags(tags.IgnoreAWS()) + input.Tags = Tags(tags.IgnoreAWS()) } - domainName, err := conn.CreateDomainNameWithContext(ctx, params) + output, err := conn.CreateDomainNameWithContext(ctx, input) + if err != nil { - return sdkdiag.AppendErrorf(diags, "creating API Gateway Domain Name: %s", err) + return sdkdiag.AppendErrorf(diags, "creating API Gateway Domain Name (%s): %s", domainName, err) } - d.SetId(aws.StringValue(domainName.DomainName)) + d.SetId(aws.StringValue(output.DomainName)) return append(diags, resourceDomainNameRead(ctx, d, meta)...) } @@ -257,29 +241,16 @@ func resourceDomainNameRead(ctx context.Context, d *schema.ResourceData, meta in defaultTagsConfig := meta.(*conns.AWSClient).DefaultTagsConfig ignoreTagsConfig := meta.(*conns.AWSClient).IgnoreTagsConfig - log.Printf("[DEBUG] Reading API Gateway Domain Name %s", d.Id()) + domainName, err := FindDomainName(ctx, conn, d.Id()) - domainName, err := conn.GetDomainNameWithContext(ctx, &apigateway.GetDomainNameInput{ - DomainName: aws.String(d.Id()), - }) - if err != nil { - if !d.IsNewResource() && tfawserr.ErrCodeEquals(err, apigateway.ErrCodeNotFoundException) { - log.Printf("[WARN] API Gateway Domain Name (%s) not found, removing from state", d.Id()) - d.SetId("") - return diags - } - return sdkdiag.AppendErrorf(diags, "reading API Gateway Domain Name (%s): %s", d.Id(), err) - } - - tags := KeyValueTags(ctx, domainName.Tags).IgnoreAWS().IgnoreConfig(ignoreTagsConfig) - - //lintignore:AWSR002 - if err := d.Set("tags", tags.RemoveDefaultConfig(defaultTagsConfig).Map()); err != nil { - return sdkdiag.AppendErrorf(diags, "setting tags: %s", err) + if !d.IsNewResource() && tfresource.NotFound(err) { + log.Printf("[WARN] API Gateway Domain Name (%s) not found, removing from state", d.Id()) + d.SetId("") + return diags } - if err := d.Set("tags_all", tags.Map()); err != nil { - return sdkdiag.AppendErrorf(diags, "setting tags_all: %s", err) + if err != nil { + return sdkdiag.AppendErrorf(diags, "reading API Gateway Domain Name (%s): %s", d.Id(), err) } arn := arn.ARN{ @@ -291,129 +262,137 @@ func resourceDomainNameRead(ctx context.Context, d *schema.ResourceData, meta in d.Set("arn", arn) d.Set("certificate_arn", domainName.CertificateArn) d.Set("certificate_name", domainName.CertificateName) - if err := d.Set("certificate_upload_date", domainName.CertificateUploadDate.Format(time.RFC3339)); err != nil { - log.Printf("[DEBUG] Error setting certificate_upload_date: %s", err) + if domainName.CertificateUploadDate != nil { + d.Set("certificate_upload_date", domainName.CertificateUploadDate.Format(time.RFC3339)) + } else { + d.Set("certificate_upload_date", nil) } d.Set("cloudfront_domain_name", domainName.DistributionDomainName) - d.Set("cloudfront_zone_id", cloudFrontRoute53ZoneID) + d.Set("cloudfront_zone_id", meta.(*conns.AWSClient).CloudFrontDistributionHostedZoneID()) d.Set("domain_name", domainName.DomainName) - d.Set("security_policy", domainName.SecurityPolicy) - d.Set("ownership_verification_certificate_arn", domainName.OwnershipVerificationCertificateArn) - if err := d.Set("endpoint_configuration", flattenEndpointConfiguration(domainName.EndpointConfiguration)); err != nil { return sdkdiag.AppendErrorf(diags, "setting endpoint_configuration: %s", err) } - if err = d.Set("mutual_tls_authentication", flattenMutualTLSAuthentication(domainName.MutualTlsAuthentication)); err != nil { return sdkdiag.AppendErrorf(diags, "setting mutual_tls_authentication: %s", err) } - + d.Set("ownership_verification_certificate_arn", domainName.OwnershipVerificationCertificateArn) d.Set("regional_certificate_arn", domainName.RegionalCertificateArn) d.Set("regional_certificate_name", domainName.RegionalCertificateName) d.Set("regional_domain_name", domainName.RegionalDomainName) d.Set("regional_zone_id", domainName.RegionalHostedZoneId) + d.Set("security_policy", domainName.SecurityPolicy) - return diags -} - -func resourceDomainNameUpdateOperations(d *schema.ResourceData) []*apigateway.PatchOperation { - operations := make([]*apigateway.PatchOperation, 0) + tags := KeyValueTags(ctx, domainName.Tags).IgnoreAWS().IgnoreConfig(ignoreTagsConfig) - if d.HasChange("certificate_name") { - operations = append(operations, &apigateway.PatchOperation{ - Op: aws.String(apigateway.OpReplace), - Path: aws.String("/certificateName"), - Value: aws.String(d.Get("certificate_name").(string)), - }) + //lintignore:AWSR002 + if err := d.Set("tags", tags.RemoveDefaultConfig(defaultTagsConfig).Map()); err != nil { + return sdkdiag.AppendErrorf(diags, "setting tags: %s", err) } - if d.HasChange("certificate_arn") { - operations = append(operations, &apigateway.PatchOperation{ - Op: aws.String(apigateway.OpReplace), - Path: aws.String("/certificateArn"), - Value: aws.String(d.Get("certificate_arn").(string)), - }) + if err := d.Set("tags_all", tags.Map()); err != nil { + return sdkdiag.AppendErrorf(diags, "setting tags_all: %s", err) } - if d.HasChange("regional_certificate_name") { - operations = append(operations, &apigateway.PatchOperation{ - Op: aws.String(apigateway.OpReplace), - Path: aws.String("/regionalCertificateName"), - Value: aws.String(d.Get("regional_certificate_name").(string)), - }) - } + return diags +} - if d.HasChange("regional_certificate_arn") { - operations = append(operations, &apigateway.PatchOperation{ - Op: aws.String(apigateway.OpReplace), - Path: aws.String("/regionalCertificateArn"), - Value: aws.String(d.Get("regional_certificate_arn").(string)), - }) - } +func resourceDomainNameUpdate(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { + var diags diag.Diagnostics + conn := meta.(*conns.AWSClient).APIGatewayConn() - if d.HasChange("security_policy") { - operations = append(operations, &apigateway.PatchOperation{ - Op: aws.String(apigateway.OpReplace), - Path: aws.String("/securityPolicy"), - Value: aws.String(d.Get("security_policy").(string)), - }) - } + if d.HasChangesExcept("tags", "tags_all") { + var operations []*apigateway.PatchOperation - if d.HasChange("endpoint_configuration.0.types") { - // The domain name must have an endpoint type. - // If attempting to remove the configuration, do nothing. - if v, ok := d.GetOk("endpoint_configuration"); ok && len(v.([]interface{})) > 0 { - m := v.([]interface{})[0].(map[string]interface{}) + if d.HasChange("certificate_arn") { + operations = append(operations, &apigateway.PatchOperation{ + Op: aws.String(apigateway.OpReplace), + Path: aws.String("/certificateArn"), + Value: aws.String(d.Get("certificate_arn").(string)), + }) + } + if d.HasChange("certificate_name") { operations = append(operations, &apigateway.PatchOperation{ Op: aws.String(apigateway.OpReplace), - Path: aws.String("/endpointConfiguration/types/0"), - Value: aws.String(m["types"].([]interface{})[0].(string)), + Path: aws.String("/certificateName"), + Value: aws.String(d.Get("certificate_name").(string)), }) } - } - if d.HasChange("mutual_tls_authentication") { - mutTLSAuth := d.Get("mutual_tls_authentication").([]interface{}) + if d.HasChange("endpoint_configuration.0.types") { + // The domain name must have an endpoint type. + // If attempting to remove the configuration, do nothing. + if v, ok := d.GetOk("endpoint_configuration"); ok && len(v.([]interface{})) > 0 { + m := v.([]interface{})[0].(map[string]interface{}) + + operations = append(operations, &apigateway.PatchOperation{ + Op: aws.String(apigateway.OpReplace), + Path: aws.String("/endpointConfiguration/types/0"), + Value: aws.String(m["types"].([]interface{})[0].(string)), + }) + } + } - if len(mutTLSAuth) == 0 || mutTLSAuth[0] == nil { - // To disable mutual TLS for a custom domain name, remove the truststore from your custom domain name. + if d.HasChange("mutual_tls_authentication") { + mutTLSAuth := d.Get("mutual_tls_authentication").([]interface{}) + + if len(mutTLSAuth) == 0 || mutTLSAuth[0] == nil { + // To disable mutual TLS for a custom domain name, remove the truststore from your custom domain name. + operations = append(operations, &apigateway.PatchOperation{ + Op: aws.String(apigateway.OpReplace), + Path: aws.String("/mutualTlsAuthentication/truststoreUri"), + Value: aws.String(""), + }) + } else { + operations = append(operations, &apigateway.PatchOperation{ + Op: aws.String(apigateway.OpReplace), + Path: aws.String("/mutualTlsAuthentication/truststoreVersion"), + Value: aws.String(mutTLSAuth[0].(map[string]interface{})["truststore_version"].(string)), + }) + } + } + + if d.HasChange("regional_certificate_arn") { operations = append(operations, &apigateway.PatchOperation{ Op: aws.String(apigateway.OpReplace), - Path: aws.String("/mutualTlsAuthentication/truststoreUri"), - Value: aws.String(""), + Path: aws.String("/regionalCertificateArn"), + Value: aws.String(d.Get("regional_certificate_arn").(string)), }) - } else { + } + + if d.HasChange("regional_certificate_name") { operations = append(operations, &apigateway.PatchOperation{ Op: aws.String(apigateway.OpReplace), - Path: aws.String("/mutualTlsAuthentication/truststoreVersion"), - Value: aws.String(mutTLSAuth[0].(map[string]interface{})["truststore_version"].(string)), + Path: aws.String("/regionalCertificateName"), + Value: aws.String(d.Get("regional_certificate_name").(string)), }) } - } - return operations -} + if d.HasChange("security_policy") { + operations = append(operations, &apigateway.PatchOperation{ + Op: aws.String(apigateway.OpReplace), + Path: aws.String("/securityPolicy"), + Value: aws.String(d.Get("security_policy").(string)), + }) + } -func resourceDomainNameUpdate(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - var diags diag.Diagnostics - conn := meta.(*conns.AWSClient).APIGatewayConn() - log.Printf("[DEBUG] Updating API Gateway Domain Name %s", d.Id()) + _, err := conn.UpdateDomainNameWithContext(ctx, &apigateway.UpdateDomainNameInput{ + DomainName: aws.String(d.Id()), + PatchOperations: operations, + }) - if d.HasChange("tags_all") { - o, n := d.GetChange("tags_all") - if err := UpdateTags(ctx, conn, d.Get("arn").(string), o, n); err != nil { - return sdkdiag.AppendErrorf(diags, "updating tags: %s", err) + if err != nil { + return sdkdiag.AppendErrorf(diags, "updating API Gateway Domain Name (%s): %s", d.Id(), err) } } - _, err := conn.UpdateDomainNameWithContext(ctx, &apigateway.UpdateDomainNameInput{ - DomainName: aws.String(d.Id()), - PatchOperations: resourceDomainNameUpdateOperations(d), - }) + if d.HasChange("tags_all") { + o, n := d.GetChange("tags_all") - if err != nil { - return sdkdiag.AppendErrorf(diags, "updating API Gateway Domain Name (%s): %s", d.Id(), err) + if err := UpdateTags(ctx, conn, d.Get("arn").(string), o, n); err != nil { + return sdkdiag.AppendErrorf(diags, "updating API Gateway Domain Name (%s) tags: %s", d.Id(), err) + } } return append(diags, resourceDomainNameRead(ctx, d, meta)...) @@ -422,8 +401,8 @@ func resourceDomainNameUpdate(ctx context.Context, d *schema.ResourceData, meta func resourceDomainNameDelete(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { var diags diag.Diagnostics conn := meta.(*conns.AWSClient).APIGatewayConn() - log.Printf("[DEBUG] Deleting API Gateway Domain Name: %s", d.Id()) + log.Printf("[DEBUG] Deleting API Gateway Domain Name: %s", d.Id()) _, err := conn.DeleteDomainNameWithContext(ctx, &apigateway.DeleteDomainNameInput{ DomainName: aws.String(d.Id()), }) @@ -439,6 +418,31 @@ func resourceDomainNameDelete(ctx context.Context, d *schema.ResourceData, meta return diags } +func FindDomainName(ctx context.Context, conn *apigateway.APIGateway, domainName string) (*apigateway.DomainName, error) { + input := &apigateway.GetDomainNameInput{ + DomainName: aws.String(domainName), + } + + output, err := conn.GetDomainNameWithContext(ctx, input) + + if tfawserr.ErrCodeEquals(err, apigateway.ErrCodeNotFoundException) { + return nil, &resource.NotFoundError{ + LastError: err, + LastRequest: input, + } + } + + if err != nil { + return nil, err + } + + if output == nil { + return nil, tfresource.NewEmptyResultError(input) + } + + return output, nil +} + func expandMutualTLSAuthentication(tfList []interface{}) *apigateway.MutualTlsAuthenticationInput { if len(tfList) == 0 || tfList[0] == nil { return nil diff --git a/internal/service/apigateway/domain_name_test.go b/internal/service/apigateway/domain_name_test.go index a2a4270689fc..2f6e1a63e059 100644 --- a/internal/service/apigateway/domain_name_test.go +++ b/internal/service/apigateway/domain_name_test.go @@ -7,36 +7,36 @@ import ( "regexp" "testing" - "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/aws/arn" + "github.com/aws/aws-sdk-go/aws/endpoints" "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" "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" + "github.com/hashicorp/terraform-provider-aws/internal/tfresource" ) func TestAccAPIGatewayDomainName_certificateARN(t *testing.T) { ctx := acctest.Context(t) rootDomain := acctest.ACMCertificateDomainFromEnv(t) domain := acctest.ACMCertificateRandomSubDomain(rootDomain) - var domainName apigateway.DomainName acmCertificateResourceName := "aws_acm_certificate.test" resourceName := "aws_api_gateway_domain_name.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckEdgeDomainName(ctx, t) }, + PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckRegion(t, endpoints.UsEast1RegionID) }, ErrorCheck: acctest.ErrorCheck(t, apigateway.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - CheckDestroy: testAccCheckEdgeDomainNameDestroy(ctx), + CheckDestroy: testAccCheckDomainNameDestroy(ctx), Steps: []resource.TestStep{ { Config: testAccDomainNameConfig_certificateARN(rootDomain, domain), Check: resource.ComposeTestCheckFunc( - testAccCheckEdgeDomainNameExists(ctx, resourceName, &domainName), + testAccCheckDomainNameExists(ctx, resourceName, &domainName), testAccCheckResourceAttrRegionalARNEdgeDomainName(resourceName, "arn", "apigateway", domain), resource.TestCheckResourceAttrPair(resourceName, "certificate_arn", acmCertificateResourceName, "arn"), resource.TestMatchResourceAttr(resourceName, "cloudfront_domain_name", regexp.MustCompile(`[a-z0-9]+.cloudfront.net`)), @@ -86,7 +86,6 @@ func TestAccAPIGatewayDomainName_certificateName(t *testing.T) { "This environment variable must be set to any non-empty value " + "with a domain name acceptable for the certificate to enable the test.") } - var conf apigateway.DomainName resourceName := "aws_api_gateway_domain_name.test" @@ -123,7 +122,6 @@ func TestAccAPIGatewayDomainName_regionalCertificateARN(t *testing.T) { var domainName apigateway.DomainName resourceName := "aws_api_gateway_domain_name.test" rName := acctest.RandomSubdomain() - key := acctest.TLSRSAPrivateKeyPEM(t, 2048) certificate := acctest.TLSRSAX509SelfSignedCertificatePEM(t, key, rName) @@ -149,7 +147,6 @@ func TestAccAPIGatewayDomainName_regionalCertificateARN(t *testing.T) { func TestAccAPIGatewayDomainName_regionalCertificateName(t *testing.T) { ctx := acctest.Context(t) - // For now, use an environment variable to limit running this test // BadRequestException: Uploading certificates is not supported for REGIONAL. // See Remarks section of https://docs.aws.amazon.com/apigateway/api-reference/link-relation/domainname-create/ @@ -162,14 +159,11 @@ func TestAccAPIGatewayDomainName_regionalCertificateName(t *testing.T) { "in a region where uploading REGIONAL certificates is allowed " + "to enable the test.") } - var domainName apigateway.DomainName resourceName := "aws_api_gateway_domain_name.test" - domain := acctest.RandomDomainName() domainWildcard := fmt.Sprintf("*.%s", domain) rName := fmt.Sprintf("%s.%s", sdkacctest.RandString(8), domain) - caKey := acctest.TLSRSAPrivateKeyPEM(t, 2048) caCertificate := acctest.TLSRSAX509SelfSignedCACertificatePEM(t, caKey) key := acctest.TLSRSAPrivateKeyPEM(t, 2048) @@ -205,7 +199,6 @@ func TestAccAPIGatewayDomainName_securityPolicy(t *testing.T) { var domainName apigateway.DomainName resourceName := "aws_api_gateway_domain_name.test" rName := acctest.RandomSubdomain() - key := acctest.TLSRSAPrivateKeyPEM(t, 2048) certificate := acctest.TLSRSAX509SelfSignedCertificatePEM(t, key, rName) @@ -236,7 +229,6 @@ func TestAccAPIGatewayDomainName_tags(t *testing.T) { var domainName apigateway.DomainName resourceName := "aws_api_gateway_domain_name.test" rName := acctest.RandomSubdomain() - key := acctest.TLSRSAPrivateKeyPEM(t, 2048) certificate := acctest.TLSRSAX509SelfSignedCertificatePEM(t, key, rName) @@ -285,7 +277,6 @@ func TestAccAPIGatewayDomainName_disappears(t *testing.T) { var domainName apigateway.DomainName resourceName := "aws_api_gateway_domain_name.test" rName := acctest.RandomSubdomain() - key := acctest.TLSRSAPrivateKeyPEM(t, 2048) certificate := acctest.TLSRSAX509SelfSignedCertificatePEM(t, key, rName) @@ -311,7 +302,6 @@ func TestAccAPIGatewayDomainName_MutualTLSAuthentication_basic(t *testing.T) { ctx := acctest.Context(t) rootDomain := acctest.ACMCertificateDomainFromEnv(t) domain := fmt.Sprintf("%s.%s", acctest.RandomSubdomain(), rootDomain) - var v apigateway.DomainName resourceName := "aws_api_gateway_domain_name.test" acmCertificateResourceName := "aws_acm_certificate.test" @@ -359,7 +349,6 @@ func TestAccAPIGatewayDomainName_MutualTLSAuthentication_ownership(t *testing.T) domain := fmt.Sprintf("%s.%s", acctest.RandomSubdomain(), rootDomain) key := acctest.TLSRSAPrivateKeyPEM(t, 2048) certificate := acctest.TLSRSAX509SelfSignedCertificatePEM(t, key, domain) - var v apigateway.DomainName resourceName := "aws_api_gateway_domain_name.test" publicAcmCertificateResourceName := "aws_acm_certificate.test" @@ -393,7 +382,7 @@ func TestAccAPIGatewayDomainName_MutualTLSAuthentication_ownership(t *testing.T) }) } -func testAccCheckDomainNameExists(ctx context.Context, n string, res *apigateway.DomainName) resource.TestCheckFunc { +func testAccCheckDomainNameExists(ctx context.Context, n string, v *apigateway.DomainName) resource.TestCheckFunc { return func(s *terraform.State) error { rs, ok := s.RootModule().Resources[n] if !ok { @@ -401,24 +390,18 @@ func testAccCheckDomainNameExists(ctx context.Context, n string, res *apigateway } if rs.Primary.ID == "" { - return fmt.Errorf("No API Gateway DomainName ID is set") + return fmt.Errorf("No API Gateway Domain Name ID is set") } conn := acctest.Provider.Meta().(*conns.AWSClient).APIGatewayConn() - req := &apigateway.GetDomainNameInput{ - DomainName: aws.String(rs.Primary.ID), - } - describe, err := conn.GetDomainNameWithContext(ctx, req) + output, err := tfapigateway.FindDomainName(ctx, conn, rs.Primary.ID) + if err != nil { return err } - if *describe.DomainName != rs.Primary.ID { - return fmt.Errorf("APIGateway DomainName not found") - } - - *res = *describe + *v = *output return nil } @@ -433,87 +416,52 @@ func testAccCheckDomainNameDestroy(ctx context.Context) resource.TestCheckFunc { continue } - _, err := conn.GetDomainNameWithContext(ctx, &apigateway.GetDomainNameInput{ - DomainName: aws.String(rs.Primary.ID), - }) + _, err := tfapigateway.FindDomainName(ctx, conn, rs.Primary.ID) + + if tfresource.NotFound(err) { + continue + } if err != nil { - if tfawserr.ErrCodeEquals(err, apigateway.ErrCodeNotFoundException) { - return nil - } return err } - return fmt.Errorf("API Gateway Domain Name still exists: %s", rs.Primary.ID) + return fmt.Errorf("API Gateway Domain Name %s still exists", rs.Primary.ID) } return nil } } -func testAccCheckEdgeDomainNameExists(ctx context.Context, resourceName string, domainName *apigateway.DomainName) resource.TestCheckFunc { +// testAccCheckResourceAttrRegionalARNEdgeDomainName ensures the Terraform state exactly matches the expected API Gateway Edge Domain Name format. +func testAccCheckResourceAttrRegionalARNEdgeDomainName(resourceName, attributeName, arnService string, domain string) resource.TestCheckFunc { return func(s *terraform.State) error { - rs, ok := s.RootModule().Resources[resourceName] - - if !ok { - return fmt.Errorf("not found: %s", resourceName) - } - - if rs.Primary.ID == "" { - return fmt.Errorf("resource ID not set") - } - - conn := testAccProviderEdgeDomainName.Meta().(*conns.AWSClient).APIGatewayConn() - - input := &apigateway.GetDomainNameInput{ - DomainName: aws.String(rs.Primary.ID), - } - - output, err := conn.GetDomainNameWithContext(ctx, input) - - if err != nil { - return fmt.Errorf("error reading API Gateway Domain Name (%s): %w", rs.Primary.ID, err) - } - - *domainName = *output - - return nil + attributeValue := arn.ARN{ + Partition: acctest.Partition(), + Region: acctest.Region(), + Resource: fmt.Sprintf("/domainnames/%s", domain), + Service: arnService, + }.String() + + return resource.TestCheckResourceAttr(resourceName, attributeName, attributeValue)(s) } } -func testAccCheckEdgeDomainNameDestroy(ctx context.Context) resource.TestCheckFunc { +// testAccCheckResourceAttrRegionalARNRegionalDomainName ensures the Terraform state exactly matches the expected API Gateway Regional Domain Name format. +func testAccCheckResourceAttrRegionalARNRegionalDomainName(resourceName, attributeName, arnService string, domain string) resource.TestCheckFunc { return func(s *terraform.State) error { - conn := testAccProviderEdgeDomainName.Meta().(*conns.AWSClient).APIGatewayConn() - - for _, rs := range s.RootModule().Resources { - if rs.Type != "aws_api_gateway_domain_name" { - continue - } - - input := &apigateway.GetDomainNameInput{ - DomainName: aws.String(rs.Primary.ID), - } - - output, err := conn.GetDomainNameWithContext(ctx, input) - - if tfawserr.ErrCodeEquals(err, apigateway.ErrCodeNotFoundException) { - continue - } - - if err != nil { - return fmt.Errorf("error reading API Gateway Domain Name (%s): %w", rs.Primary.ID, err) - } - - if output != nil && aws.StringValue(output.DomainName) == rs.Primary.ID { - return fmt.Errorf("API Gateway Domain Name (%s) still exists", rs.Primary.ID) - } - } - - return nil + attributeValue := arn.ARN{ + Partition: acctest.Partition(), + Region: acctest.Region(), + Resource: fmt.Sprintf("/domainnames/%s", domain), + Service: arnService, + }.String() + + return resource.TestCheckResourceAttr(resourceName, attributeName, attributeValue)(s) } } -func testAccDomainNamePublicCertConfig(rootDomain, domain string) string { +func testAccDomainNameConfig_basePublicCert(rootDomain, domain string) string { return fmt.Sprintf(` data "aws_route53_zone" "test" { name = %[1]q @@ -525,26 +473,6 @@ resource "aws_acm_certificate" "test" { validation_method = "DNS" } -# -# for_each acceptance testing requires: -# https://github.com/hashicorp/terraform-plugin-sdk/issues/536 -# -# resource "aws_route53_record" "test" { -# for_each = { -# for dvo in aws_acm_certificate.test.domain_validation_options: dvo.domain_name => { -# name = dvo.resource_record_name -# record = dvo.resource_record_value -# type = dvo.resource_record_type -# } -# } -# allow_overwrite = true -# name = each.value.name -# records = [each.value.record] -# ttl = 60 -# type = each.value.type -# zone_id = data.aws_route53_zone.test.zone_id -# } - resource "aws_route53_record" "test" { allow_overwrite = true name = tolist(aws_acm_certificate.test.domain_validation_options)[0].resource_record_name @@ -562,10 +490,7 @@ resource "aws_acm_certificate_validation" "test" { } func testAccDomainNameConfig_certificateARN(rootDomain string, domain string) string { - return acctest.ConfigCompose( - testAccEdgeDomainNameRegionProviderConfig(), - testAccDomainNamePublicCertConfig(rootDomain, domain), - ` + return acctest.ConfigCompose(testAccDomainNameConfig_basePublicCert(rootDomain, domain), ` resource "aws_api_gateway_domain_name" "test" { domain_name = aws_acm_certificate.test.domain_name certificate_arn = aws_acm_certificate_validation.test.certificate_arn @@ -580,7 +505,7 @@ resource "aws_api_gateway_domain_name" "test" { func testAccDomainNameConfig_certificate(domainName, key, certificate, chainCertificate string) string { return fmt.Sprintf(` resource "aws_api_gateway_domain_name" "test" { - domain_name = "%[1]s" + domain_name = %[1]q certificate_body = "%[2]s" certificate_chain = "%[3]s" certificate_name = "tf-acc-apigateway-domain-name" @@ -613,7 +538,7 @@ resource "aws_api_gateway_domain_name" "test" { certificate_body = "%[2]s" certificate_chain = "%[3]s" certificate_private_key = "%[4]s" - domain_name = "%[1]s" + domain_name = %[1]q regional_certificate_name = "tf-acc-apigateway-domain-name" endpoint_configuration { @@ -689,7 +614,7 @@ resource "aws_api_gateway_domain_name" "test" { func testAccDomainNameConfig_mutualTLSAuthentication(rName, rootDomain, domain string) string { return acctest.ConfigCompose( - testAccDomainNamePublicCertConfig(rootDomain, domain), + testAccDomainNameConfig_basePublicCert(rootDomain, domain), fmt.Sprintf(` resource "aws_s3_bucket" "test" { bucket = %[1]q @@ -729,7 +654,7 @@ resource "aws_api_gateway_domain_name" "test" { func testAccDomainNameConfig_mutualTLSAuthenticationMissing(rootDomain, domain string) string { return acctest.ConfigCompose( - testAccDomainNamePublicCertConfig(rootDomain, domain), + testAccDomainNameConfig_basePublicCert(rootDomain, domain), ` resource "aws_api_gateway_domain_name" "test" { domain_name = aws_acm_certificate.test.domain_name @@ -745,7 +670,7 @@ resource "aws_api_gateway_domain_name" "test" { func testAccDomainNameConfig_mutualTLSOwnership(rName, rootDomain, domain, certificate, key string) string { return acctest.ConfigCompose( - testAccDomainNamePublicCertConfig(rootDomain, domain), + testAccDomainNameConfig_basePublicCert(rootDomain, domain), fmt.Sprintf(` resource "aws_s3_bucket" "test" { bucket = %[1]q From a751b9dcc520e646e074e8ca55ba68147c36bf2b Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Sat, 11 Mar 2023 14:55:29 -0500 Subject: [PATCH 651/763] d/aws_api_gateway_domain_name: Use` 'FindDomainName'. Acceptance test output: % make testacc TESTARGS='-run=TestAccAPIGatewayDomainNameDataSource_' PKG=apigateway ACCTEST_PARALLELISM=3 ==> Checking that code complies with gofmt requirements... TF_ACC=1 go test ./internal/service/apigateway/... -v -count 1 -parallel 3 -run=TestAccAPIGatewayDomainNameDataSource_ -timeout 180m === RUN TestAccAPIGatewayDomainNameDataSource_basic === PAUSE TestAccAPIGatewayDomainNameDataSource_basic === CONT TestAccAPIGatewayDomainNameDataSource_basic --- PASS: TestAccAPIGatewayDomainNameDataSource_basic (20.95s) PASS ok github.com/hashicorp/terraform-provider-aws/internal/service/apigateway 26.176s --- .../apigateway/domain_name_data_source.go | 51 +++++++------------ .../domain_name_data_source_test.go | 1 - 2 files changed, 19 insertions(+), 33 deletions(-) diff --git a/internal/service/apigateway/domain_name_data_source.go b/internal/service/apigateway/domain_name_data_source.go index 7a0fba115dd7..10ec4ef08a03 100644 --- a/internal/service/apigateway/domain_name_data_source.go +++ b/internal/service/apigateway/domain_name_data_source.go @@ -7,7 +7,6 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/arn" - "github.com/aws/aws-sdk-go/service/apigateway" "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" @@ -15,14 +14,11 @@ import ( tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" ) -// cloudFrontRoute53ZoneID defines the route 53 zone ID for CloudFront. This -// is used to set the zone_id attribute. -const cloudFrontRoute53ZoneID = "Z2FDTNDATAQYW2" - // @SDKDataSource("aws_api_gateway_domain_name") func DataSourceDomainName() *schema.Resource { return &schema.Resource{ ReadWithoutTimeout: dataSourceDomainNameRead, + Schema: map[string]*schema.Schema{ "arn": { Type: schema.TypeString, @@ -95,19 +91,14 @@ func dataSourceDomainNameRead(ctx context.Context, d *schema.ResourceData, meta conn := meta.(*conns.AWSClient).APIGatewayConn() ignoreTagsConfig := meta.(*conns.AWSClient).IgnoreTagsConfig - input := &apigateway.GetDomainNameInput{} - - if v, ok := d.GetOk("domain_name"); ok { - input.DomainName = aws.String(v.(string)) - } - - domainName, err := conn.GetDomainNameWithContext(ctx, input) + domainName := d.Get("domain_name").(string) + output, err := FindDomainName(ctx, conn, domainName) if err != nil { - return sdkdiag.AppendErrorf(diags, "getting API Gateway Domain Name: %s", err) + return sdkdiag.AppendErrorf(diags, "reading API Gateway Domain Name (%s): %s", domainName, err) } - d.SetId(aws.StringValue(domainName.DomainName)) + d.SetId(aws.StringValue(output.DomainName)) arn := arn.ARN{ Partition: meta.(*conns.AWSClient).Partition, @@ -116,28 +107,24 @@ func dataSourceDomainNameRead(ctx context.Context, d *schema.ResourceData, meta Resource: fmt.Sprintf("/domainnames/%s", d.Id()), }.String() d.Set("arn", arn) - d.Set("certificate_arn", domainName.CertificateArn) - d.Set("certificate_name", domainName.CertificateName) - - if domainName.CertificateUploadDate != nil { - d.Set("certificate_upload_date", domainName.CertificateUploadDate.Format(time.RFC3339)) + d.Set("certificate_arn", output.CertificateArn) + d.Set("certificate_name", output.CertificateName) + if output.CertificateUploadDate != nil { + d.Set("certificate_upload_date", output.CertificateUploadDate.Format(time.RFC3339)) } - - d.Set("cloudfront_domain_name", domainName.DistributionDomainName) - d.Set("cloudfront_zone_id", cloudFrontRoute53ZoneID) - d.Set("domain_name", domainName.DomainName) - - if err := d.Set("endpoint_configuration", flattenEndpointConfiguration(domainName.EndpointConfiguration)); err != nil { + d.Set("cloudfront_domain_name", output.DistributionDomainName) + d.Set("cloudfront_zone_id", meta.(*conns.AWSClient).CloudFrontDistributionHostedZoneID()) + d.Set("domain_name", output.DomainName) + if err := d.Set("endpoint_configuration", flattenEndpointConfiguration(output.EndpointConfiguration)); err != nil { return sdkdiag.AppendErrorf(diags, "setting endpoint_configuration: %s", err) } + d.Set("regional_certificate_arn", output.RegionalCertificateArn) + d.Set("regional_certificate_name", output.RegionalCertificateName) + d.Set("regional_domain_name", output.RegionalDomainName) + d.Set("regional_zone_id", output.RegionalHostedZoneId) + d.Set("security_policy", output.SecurityPolicy) - d.Set("regional_certificate_arn", domainName.RegionalCertificateArn) - d.Set("regional_certificate_name", domainName.RegionalCertificateName) - d.Set("regional_domain_name", domainName.RegionalDomainName) - d.Set("regional_zone_id", domainName.RegionalHostedZoneId) - d.Set("security_policy", domainName.SecurityPolicy) - - if err := d.Set("tags", KeyValueTags(ctx, domainName.Tags).IgnoreAWS().IgnoreConfig(ignoreTagsConfig).Map()); err != nil { + if err := d.Set("tags", KeyValueTags(ctx, output.Tags).IgnoreAWS().IgnoreConfig(ignoreTagsConfig).Map()); err != nil { return sdkdiag.AppendErrorf(diags, "setting tags: %s", err) } diff --git a/internal/service/apigateway/domain_name_data_source_test.go b/internal/service/apigateway/domain_name_data_source_test.go index c090086843e6..02c151e3a05a 100644 --- a/internal/service/apigateway/domain_name_data_source_test.go +++ b/internal/service/apigateway/domain_name_data_source_test.go @@ -14,7 +14,6 @@ func TestAccAPIGatewayDomainNameDataSource_basic(t *testing.T) { resourceName := "aws_api_gateway_domain_name.test" dataSourceName := "data.aws_api_gateway_domain_name.test" rName := acctest.RandomSubdomain() - key := acctest.TLSRSAPrivateKeyPEM(t, 2048) certificate := acctest.TLSRSAX509SelfSignedCertificatePEM(t, key, rName) From 6311399b83002e420b8ced6b49a7867b51044bc1 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Sat, 11 Mar 2023 15:19:18 -0500 Subject: [PATCH 652/763] Fix terrafmt error. --- website/docs/r/cognito_user_pool_domain.markdown | 1 + 1 file changed, 1 insertion(+) diff --git a/website/docs/r/cognito_user_pool_domain.markdown b/website/docs/r/cognito_user_pool_domain.markdown index 6ec489827c11..9211cb3bef6b 100644 --- a/website/docs/r/cognito_user_pool_domain.markdown +++ b/website/docs/r/cognito_user_pool_domain.markdown @@ -48,6 +48,7 @@ resource "aws_route53_record" "auth-cognito-A" { zone_id = data.aws_route53_zone.example.zone_id alias { evaluate_target_health = false + name = aws_cognito_user_pool_domain.main.cloudfront_distribution zone_id = aws_cognito_user_pool_domain.main.cloudfront_distribution_zone_id } From a0da992d6a2d15de68a8a2cbc7965f6c5be01011 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Sat, 11 Mar 2023 15:46:46 -0500 Subject: [PATCH 653/763] r/aws_oam_sink: 'id' -> 'sink_id'. --- internal/service/oam/sink.go | 11 ++++++----- internal/service/oam/sink_test.go | 13 ++----------- website/docs/r/oam_sink.html.markdown | 2 +- 3 files changed, 9 insertions(+), 17 deletions(-) diff --git a/internal/service/oam/sink.go b/internal/service/oam/sink.go index 230eadf9ceb4..2198829751ba 100644 --- a/internal/service/oam/sink.go +++ b/internal/service/oam/sink.go @@ -20,6 +20,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/names" ) +// @SDKResource("aws_oam_sink") func ResourceSink() *schema.Resource { return &schema.Resource{ CreateWithoutTimeout: resourceSinkCreate, @@ -42,15 +43,15 @@ func ResourceSink() *schema.Resource { Type: schema.TypeString, Computed: true, }, - "id": { - Type: schema.TypeString, - Computed: true, - }, "name": { Type: schema.TypeString, Required: true, ForceNew: true, }, + "sink_id": { + Type: schema.TypeString, + Computed: true, + }, "tags": tftags.TagsSchema(), "tags_all": tftags.TagsSchemaComputed(), }, @@ -107,8 +108,8 @@ func resourceSinkRead(ctx context.Context, d *schema.ResourceData, meta interfac } d.Set("arn", out.Arn) - d.Set("id", out.Id) d.Set("name", out.Name) + d.Set("sink_id", out.Id) tags, err := ListTags(ctx, conn, d.Id()) if err != nil { diff --git a/internal/service/oam/sink_test.go b/internal/service/oam/sink_test.go index fd04d6d5c502..7048b7a05737 100644 --- a/internal/service/oam/sink_test.go +++ b/internal/service/oam/sink_test.go @@ -43,10 +43,10 @@ func TestAccObservabilityAccessManagerSink_basic(t *testing.T) { Config: testAccSinkConfigBasic(rName), Check: resource.ComposeTestCheckFunc( testAccCheckSinkExists(resourceName, &sink), + acctest.MatchResourceAttrRegionalARN(resourceName, "arn", "oam", regexp.MustCompile(`sink/+.`)), resource.TestCheckResourceAttr(resourceName, "name", rName), - resource.TestCheckResourceAttrSet(resourceName, "id"), + resource.TestCheckResourceAttrSet(resourceName, "sink_id"), resource.TestCheckResourceAttr(resourceName, "tags.%", "0"), - acctest.MatchResourceAttrRegionalARN(resourceName, "arn", "oam", regexp.MustCompile(`sink/+.`)), ), }, { @@ -113,11 +113,8 @@ func TestAccObservabilityAccessManagerSink_tags(t *testing.T) { Config: testAccSinkConfigTags1(rName, "key1", "value1"), Check: resource.ComposeTestCheckFunc( testAccCheckSinkExists(resourceName, &sink), - resource.TestCheckResourceAttr(resourceName, "name", rName), - resource.TestCheckResourceAttrSet(resourceName, "id"), resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), resource.TestCheckResourceAttr(resourceName, "tags.key1", "value1"), - acctest.MatchResourceAttrRegionalARN(resourceName, "arn", "oam", regexp.MustCompile(`sink/+.`)), ), }, { @@ -129,23 +126,17 @@ func TestAccObservabilityAccessManagerSink_tags(t *testing.T) { Config: testAccSinkConfigTags2(rName, "key1", "value1updated", "key2", "value2"), Check: resource.ComposeTestCheckFunc( testAccCheckSinkExists(resourceName, &sink), - resource.TestCheckResourceAttr(resourceName, "name", rName), - resource.TestCheckResourceAttrSet(resourceName, "id"), resource.TestCheckResourceAttr(resourceName, "tags.%", "2"), resource.TestCheckResourceAttr(resourceName, "tags.key1", "value1updated"), resource.TestCheckResourceAttr(resourceName, "tags.key2", "value2"), - acctest.MatchResourceAttrRegionalARN(resourceName, "arn", "oam", regexp.MustCompile(`sink/+.`)), ), }, { Config: testAccSinkConfigTags1(rName, "key2", "value2"), Check: resource.ComposeTestCheckFunc( testAccCheckSinkExists(resourceName, &sink), - resource.TestCheckResourceAttr(resourceName, "name", rName), - resource.TestCheckResourceAttrSet(resourceName, "id"), resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), resource.TestCheckResourceAttr(resourceName, "tags.key2", "value2"), - acctest.MatchResourceAttrRegionalARN(resourceName, "arn", "oam", regexp.MustCompile(`sink/+.`)), ), }, }, diff --git a/website/docs/r/oam_sink.html.markdown b/website/docs/r/oam_sink.html.markdown index e9ebf34bd7f7..b19a0a448ead 100644 --- a/website/docs/r/oam_sink.html.markdown +++ b/website/docs/r/oam_sink.html.markdown @@ -39,7 +39,7 @@ The following arguments are optional: In addition to all arguments above, the following attributes are exported: * `arn` - ARN of the Sink. -* `id` - ID string that AWS generated as part of the sink ARN. +* `sink_id` - ID string that AWS generated as part of the sink ARN. ## Timeouts From 0f5fbccc5dd3069f14039d7fff6c15329b1292db Mon Sep 17 00:00:00 2001 From: Nabil Houidi <35373676+NabilHouidi@users.noreply.github.com> Date: Sun, 12 Mar 2023 13:30:51 +0100 Subject: [PATCH 654/763] feat(dynamo): add arg to set deletion protection for table --- internal/service/dynamodb/table.go | 16 +++++ internal/service/dynamodb/table_test.go | 73 +++++++++++++++++++++ website/docs/r/dynamodb_table.html.markdown | 1 + 3 files changed, 90 insertions(+) diff --git a/internal/service/dynamodb/table.go b/internal/service/dynamodb/table.go index 3cdb2e491e88..cc9a76d0cd9c 100644 --- a/internal/service/dynamodb/table.go +++ b/internal/service/dynamodb/table.go @@ -146,6 +146,11 @@ func ResourceTable() *schema.Resource { Default: dynamodb.BillingModeProvisioned, ValidateFunc: validation.StringInSlice(dynamodb.BillingMode_Values(), false), }, + "deletion_protection_enabled": { + Type: schema.TypeBool, + Optional: true, + Default: false, + }, "global_secondary_index": { Type: schema.TypeSet, Optional: true, @@ -505,6 +510,10 @@ func resourceTableCreate(ctx context.Context, d *schema.ResourceData, meta inter input.AttributeDefinitions = expandAttributes(aSet.List()) } + if v, ok := d.GetOk("deletion_protection_enabled"); ok { + input.DeletionProtectionEnabled = aws.Bool(v.(bool)) + } + if v, ok := d.GetOk("local_secondary_index"); ok { lsiSet := v.(*schema.Set) input.LocalSecondaryIndexes = expandLocalSecondaryIndexes(lsiSet.List(), keySchemaMap) @@ -632,6 +641,8 @@ func resourceTableRead(ctx context.Context, d *schema.ResourceData, meta interfa d.Set("billing_mode", dynamodb.BillingModeProvisioned) } + d.Set("deletion_protection_enabled", table.DeletionProtectionEnabled) + if table.ProvisionedThroughput != nil { d.Set("write_capacity", table.ProvisionedThroughput.WriteCapacityUnits) d.Set("read_capacity", table.ProvisionedThroughput.ReadCapacityUnits) @@ -828,6 +839,11 @@ func resourceTableUpdate(ctx context.Context, d *schema.ResourceData, meta inter input.ProvisionedThroughput = expandProvisionedThroughputUpdate(d.Id(), capacityMap, billingMode, oldBillingMode) } + if d.HasChange("deletion_protection_enabled") { + hasTableUpdate = true + input.DeletionProtectionEnabled = aws.Bool(d.Get("deletion_protection_enabled").(bool)) + } + // make change when // stream_enabled has change (below) OR // stream_view_type has change and stream_enabled is true (special case) diff --git a/internal/service/dynamodb/table_test.go b/internal/service/dynamodb/table_test.go index d25eb7e7bcc3..ce4d45bba456 100644 --- a/internal/service/dynamodb/table_test.go +++ b/internal/service/dynamodb/table_test.go @@ -347,6 +347,7 @@ func TestAccDynamoDBTable_basic(t *testing.T) { names.AttrType: "S", }), resource.TestCheckResourceAttr(resourceName, "billing_mode", "PROVISIONED"), + resource.TestCheckResourceAttr(resourceName, "deletion_protection_enabled", "false"), resource.TestCheckResourceAttr(resourceName, "global_secondary_index.#", "0"), resource.TestCheckResourceAttr(resourceName, "hash_key", rName), resource.TestCheckResourceAttr(resourceName, "local_secondary_index.#", "0"), @@ -380,6 +381,45 @@ func TestAccDynamoDBTable_basic(t *testing.T) { }) } +func TestAccDynamoDBTable_deletion_protection(t *testing.T) { + ctx := acctest.Context(t) + var conf dynamodb.TableDescription + resourceName := "aws_dynamodb_table.test" + rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { acctest.PreCheck(t) }, + ErrorCheck: acctest.ErrorCheck(t, dynamodb.EndpointsID), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + CheckDestroy: testAccCheckTableDestroy(ctx), + Steps: []resource.TestStep{ + { + Config: testAccTableConfig_enable_deletion_protection(rName), + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheckInitialTableExists(ctx, resourceName, &conf), + acctest.CheckResourceAttrRegionalARN(resourceName, names.AttrARN, "dynamodb", fmt.Sprintf("table/%s", rName)), + resource.TestCheckResourceAttr(resourceName, names.AttrName, rName), + resource.TestCheckTypeSetElemNestedAttrs(resourceName, "attribute.*", map[string]string{ + names.AttrName: rName, + names.AttrType: "S", + }), + resource.TestCheckResourceAttr(resourceName, "deletion_protection_enabled", "true"), + ), + }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, + // disable deletion protection for the sweeper to work + { + Config: testAccTableConfig_disable_deletion_protection(rName), + Check: resource.TestCheckResourceAttr(resourceName, "deletion_protection_enabled", "false"), + }, + }, + }) +} + func TestAccDynamoDBTable_disappears(t *testing.T) { ctx := acctest.Context(t) var conf dynamodb.TableDescription @@ -2701,6 +2741,39 @@ resource "aws_dynamodb_table" "test" { `, rName) } +func testAccTableConfig_enable_deletion_protection(rName string) string { + return fmt.Sprintf(` +resource "aws_dynamodb_table" "test" { + name = %[1]q + read_capacity = 1 + write_capacity = 1 + hash_key = %[1]q + deletion_protection_enabled = true + + attribute { + name = %[1]q + type = "S" + } +} +`, rName) +} + +func testAccTableConfig_disable_deletion_protection(rName string) string { + return fmt.Sprintf(` +resource "aws_dynamodb_table" "test" { + name = %[1]q + read_capacity = 1 + write_capacity = 1 + hash_key = %[1]q + deletion_protection_enabled = false + attribute { + name = %[1]q + type = "S" + } +} +`, rName) +} + func testAccTableConfig_backup(rName string) string { return fmt.Sprintf(` resource "aws_dynamodb_table" "test" { diff --git a/website/docs/r/dynamodb_table.html.markdown b/website/docs/r/dynamodb_table.html.markdown index 5a7e9a4a1b9f..b337903eb189 100644 --- a/website/docs/r/dynamodb_table.html.markdown +++ b/website/docs/r/dynamodb_table.html.markdown @@ -176,6 +176,7 @@ Required arguments: Optional arguments: * `billing_mode` - (Optional) Controls how you are charged for read and write throughput and how you manage capacity. The valid values are `PROVISIONED` and `PAY_PER_REQUEST`. Defaults to `PROVISIONED`. +* `deletion_protection_enabled` - (Optional) Enables deletion protection for table. Defaults to `false`. * `global_secondary_index` - (Optional) Describe a GSI for the table; subject to the normal limits on the number of GSIs, projected attributes, etc. See below. * `local_secondary_index` - (Optional, Forces new resource) Describe an LSI on the table; these can only be allocated _at creation_ so you cannot change this definition after you have created the resource. See below. * `point_in_time_recovery` - (Optional) Enable point-in-time recovery options. See below. From 78073c3ad9a00163f2499c6cf6eebda4a188177d Mon Sep 17 00:00:00 2001 From: Nabil Houidi <35373676+NabilHouidi@users.noreply.github.com> Date: Sun, 12 Mar 2023 15:04:37 +0100 Subject: [PATCH 655/763] chore: add changelog entry --- .changelog/29924.txt | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 .changelog/29924.txt diff --git a/.changelog/29924.txt b/.changelog/29924.txt new file mode 100644 index 000000000000..f01db3760dcb --- /dev/null +++ b/.changelog/29924.txt @@ -0,0 +1,3 @@ +```release-note:enhancement +resource/aws_dynamodb_table: Add `deletion_protection_enabled` argument to enable deletion protection for table. +``` From e1322db9c8109f3f756e6c22982a2c68ce0dbbd0 Mon Sep 17 00:00:00 2001 From: Martin Samuels Date: Sun, 12 Mar 2023 14:56:22 +0000 Subject: [PATCH 656/763] Update website/docs/r/budgets_budget.html.markdown Co-authored-by: Simon Davis --- website/docs/r/budgets_budget.html.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/website/docs/r/budgets_budget.html.markdown b/website/docs/r/budgets_budget.html.markdown index 74f455e1c78f..82e87d8ab5e6 100644 --- a/website/docs/r/budgets_budget.html.markdown +++ b/website/docs/r/budgets_budget.html.markdown @@ -138,7 +138,7 @@ resource "aws_budgets_budget" "ri_utilization" { } ``` -Create a cost_filter using resource tags +Create a Cost Filter using Resource Tags ```terraform resource "aws_budgets_budget" "cost" { From 9938078ccaa64bdaeeb428f6266f7b58e422508d Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Sun, 12 Mar 2023 14:35:25 -0400 Subject: [PATCH 657/763] d/aws_servicecatalog_provisioning_artifacts: Alphabetize attributes. --- .../servicecatalog/provisioning_artifacts_data_source.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/internal/service/servicecatalog/provisioning_artifacts_data_source.go b/internal/service/servicecatalog/provisioning_artifacts_data_source.go index 50c6d2013794..219cd3d39309 100644 --- a/internal/service/servicecatalog/provisioning_artifacts_data_source.go +++ b/internal/service/servicecatalog/provisioning_artifacts_data_source.go @@ -19,16 +19,16 @@ func DataSourceProvisioningArtifacts() *schema.Resource { }, Schema: map[string]*schema.Schema{ - "product_id": { - Type: schema.TypeString, - Required: true, - }, "accept_language": { Type: schema.TypeString, Default: AcceptLanguageEnglish, Optional: true, ValidateFunc: validation.StringInSlice(AcceptLanguage_Values(), false), }, + "product_id": { + Type: schema.TypeString, + Required: true, + }, "provisioning_artifact_details": { Type: schema.TypeList, Computed: true, From 90ec7e4fd680f7413e48ac588dfc1f7564ddb67a Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Sun, 12 Mar 2023 14:37:17 -0400 Subject: [PATCH 658/763] d/aws_servicecatalog_provisioning_artifacts: Add '@SDKDataSource'. --- .../servicecatalog/provisioning_artifacts_data_source.go | 1 + internal/service/servicecatalog/service_package_gen.go | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/internal/service/servicecatalog/provisioning_artifacts_data_source.go b/internal/service/servicecatalog/provisioning_artifacts_data_source.go index 219cd3d39309..4d4c4489c41d 100644 --- a/internal/service/servicecatalog/provisioning_artifacts_data_source.go +++ b/internal/service/servicecatalog/provisioning_artifacts_data_source.go @@ -10,6 +10,7 @@ import ( "github.com/hashicorp/terraform-provider-aws/internal/conns" ) +// @SDKDataSource("aws_servicecatalog_provisioning_artifacts") func DataSourceProvisioningArtifacts() *schema.Resource { return &schema.Resource{ Read: dataSourceProvisioningArtifactsRead, diff --git a/internal/service/servicecatalog/service_package_gen.go b/internal/service/servicecatalog/service_package_gen.go index f9ebd2907307..8e5d2591e955 100644 --- a/internal/service/servicecatalog/service_package_gen.go +++ b/internal/service/servicecatalog/service_package_gen.go @@ -41,6 +41,10 @@ func (p *servicePackage) SDKDataSources(ctx context.Context) []*types.ServicePac Factory: DataSourceProduct, TypeName: "aws_servicecatalog_product", }, + { + Factory: DataSourceProvisioningArtifacts, + TypeName: "aws_servicecatalog_provisioning_artifacts", + }, } } From eb92c0c0d4d99a1f927a1d5894cb20482b41bc85 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Sun, 12 Mar 2023 14:43:19 -0400 Subject: [PATCH 659/763] d/aws_servicecatalog_provisioning_artifacts: Use 'WithoutTimeout' handler variant. --- .../provisioning_artifacts_data_source.go | 26 +++++++++---------- ...provisioning_artifacts_data_source_test.go | 13 +++++----- 2 files changed, 20 insertions(+), 19 deletions(-) diff --git a/internal/service/servicecatalog/provisioning_artifacts_data_source.go b/internal/service/servicecatalog/provisioning_artifacts_data_source.go index 4d4c4489c41d..96747f401643 100644 --- a/internal/service/servicecatalog/provisioning_artifacts_data_source.go +++ b/internal/service/servicecatalog/provisioning_artifacts_data_source.go @@ -1,19 +1,21 @@ package servicecatalog import ( - "fmt" + "context" "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/servicecatalog" + "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" "github.com/hashicorp/terraform-provider-aws/internal/conns" + "github.com/hashicorp/terraform-provider-aws/internal/errs/sdkdiag" ) // @SDKDataSource("aws_servicecatalog_provisioning_artifacts") func DataSourceProvisioningArtifacts() *schema.Resource { return &schema.Resource{ - Read: dataSourceProvisioningArtifactsRead, + ReadWithoutTimeout: dataSourceProvisioningArtifactsRead, Timeouts: &schema.ResourceTimeout{ Read: schema.DefaultTimeout(ConstraintReadTimeout), @@ -70,29 +72,27 @@ func DataSourceProvisioningArtifacts() *schema.Resource { } } -func dataSourceProvisioningArtifactsRead(d *schema.ResourceData, meta interface{}) error { +func dataSourceProvisioningArtifactsRead(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { + var diags diag.Diagnostics conn := meta.(*conns.AWSClient).ServiceCatalogConn() + productID := d.Get("product_id").(string) input := &servicecatalog.ListProvisioningArtifactsInput{ - ProductId: aws.String(d.Get("product_id").(string)), AcceptLanguage: aws.String(d.Get("accept_language").(string)), + ProductId: aws.String(productID), } - output, err := conn.ListProvisioningArtifacts(input) + output, err := conn.ListProvisioningArtifactsWithContext(ctx, input) if err != nil { - return fmt.Errorf("error describing provisioning artifact: %w", err) - } - if output == nil { - return fmt.Errorf("no provisioning artifacts found matching criteria; try different search") + return sdkdiag.AppendErrorf(diags, "listing Service Catalog Provisioning Artifacts: %s", err) } + + d.SetId(productID) if err := d.Set("provisioning_artifact_details", flattenProvisioningArtifactDetails(output.ProvisioningArtifactDetails)); err != nil { - return fmt.Errorf("error setting provisioning artifact details: %w", err) + return sdkdiag.AppendErrorf(diags, "setting provisioning_artifact_details: %s", err) } - d.SetId(d.Get("product_id").(string)) - d.Set("accept_language", d.Get("accept_language").(string)) - return nil } diff --git a/internal/service/servicecatalog/provisioning_artifacts_data_source_test.go b/internal/service/servicecatalog/provisioning_artifacts_data_source_test.go index b794e777eb6a..ac01396c2277 100644 --- a/internal/service/servicecatalog/provisioning_artifacts_data_source_test.go +++ b/internal/service/servicecatalog/provisioning_artifacts_data_source_test.go @@ -23,13 +23,14 @@ func TestAccServiceCatalogProvisioningArtifactsDataSource_basic(t *testing.T) { Steps: []resource.TestStep{ { Config: testAccProvisioningArtifactsDataSourceConfig_basic(rName, domain), - Check: resource.ComposeTestCheckFunc( + Check: resource.ComposeAggregateTestCheckFunc( resource.TestCheckResourceAttr(dataSourceName, "accept_language", tfservicecatalog.AcceptLanguageEnglish), + resource.TestCheckResourceAttrPair(dataSourceName, "product_id", "aws_servicecatalog_product.test", "id"), + resource.TestCheckResourceAttr(dataSourceName, "provisioning_artifact_details.#", "1"), resource.TestCheckResourceAttr(dataSourceName, "provisioning_artifact_details.0.active", "true"), resource.TestCheckResourceAttrSet(dataSourceName, "provisioning_artifact_details.0.description"), resource.TestCheckResourceAttr(dataSourceName, "provisioning_artifact_details.0.guidance", servicecatalog.ProvisioningArtifactGuidanceDefault), resource.TestCheckResourceAttr(dataSourceName, "provisioning_artifact_details.0.name", rName), - resource.TestCheckResourceAttrPair(dataSourceName, "product_id", "aws_servicecatalog_product.test", "id"), resource.TestCheckResourceAttr(dataSourceName, "provisioning_artifact_details.0.type", servicecatalog.ProductTypeCloudFormationTemplate), ), }, @@ -37,7 +38,7 @@ func TestAccServiceCatalogProvisioningArtifactsDataSource_basic(t *testing.T) { }) } -func testAccProvisioningArtifactsDataSourceBaseConfig(rName, domain string) string { +func testAccProvisioningArtifactsDataSourceConfig_base(rName, domain string) string { return fmt.Sprintf(` resource "aws_s3_bucket" "test" { bucket = %[1]q @@ -98,6 +99,7 @@ resource "aws_servicecatalog_product" "test" { Name = %[1]q } } + resource "aws_servicecatalog_provisioning_artifact" "test" { accept_language = "en" active = true @@ -113,10 +115,9 @@ resource "aws_servicecatalog_provisioning_artifact" "test" { } func testAccProvisioningArtifactsDataSourceConfig_basic(rName, domain string) string { - return acctest.ConfigCompose(testAccProvisioningArtifactsDataSourceBaseConfig(rName, domain), ` + return acctest.ConfigCompose(testAccProvisioningArtifactsDataSourceConfig_base(rName, domain), ` data "aws_servicecatalog_provisioning_artifacts" "test" { - accept_language = "en" - product_id = aws_servicecatalog_product.test.id + product_id = aws_servicecatalog_product.test.id } `) } From 52a897c12fef61793ec6bb4dc7732853d2489051 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Sun, 12 Mar 2023 15:21:02 -0400 Subject: [PATCH 660/763] r/aws_codegurureviewer_repository_association: Cosmetics. --- .../repository_association_test.go | 30 ++++++++----------- 1 file changed, 12 insertions(+), 18 deletions(-) diff --git a/internal/service/codegurureviewer/repository_association_test.go b/internal/service/codegurureviewer/repository_association_test.go index a08acfbed0e9..a1a4dbd94af8 100644 --- a/internal/service/codegurureviewer/repository_association_test.go +++ b/internal/service/codegurureviewer/repository_association_test.go @@ -32,7 +32,7 @@ func TestAccCodeGuruReviewerRepositoryAssociation_basic(t *testing.T) { PreCheck: func() { acctest.PreCheck(t) acctest.PreCheckPartitionHasService(t, codegurureviewer.EndpointsID) - testAccPreCheck(t) + testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, codegurureviewer.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, @@ -67,7 +67,7 @@ func TestAccCodeGuruReviewerRepositoryAssociation_KMSKey(t *testing.T) { PreCheck: func() { acctest.PreCheck(t) acctest.PreCheckPartitionHasService(t, codegurureviewer.EndpointsID) - testAccPreCheck(t) + testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, codegurureviewer.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, @@ -102,7 +102,7 @@ func TestAccCodeGuruReviewerRepositoryAssociation_S3Repository(t *testing.T) { PreCheck: func() { acctest.PreCheck(t) acctest.PreCheckPartitionHasService(t, codegurureviewer.EndpointsID) - testAccPreCheck(t) + testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, codegurureviewer.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, @@ -138,7 +138,7 @@ func TestAccCodeGuruReviewerRepositoryAssociation_tags(t *testing.T) { PreCheck: func() { acctest.PreCheck(t) acctest.PreCheckPartitionHasService(t, codegurureviewer.EndpointsID) - testAccPreCheck(t) + testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, codegurureviewer.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, @@ -182,7 +182,7 @@ func TestAccCodeGuruReviewerRepositoryAssociation_disappears(t *testing.T) { PreCheck: func() { acctest.PreCheck(t) acctest.PreCheckPartitionHasService(t, codegurureviewer.EndpointsID) - testAccPreCheck(t) + testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, codegurureviewer.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, @@ -253,9 +253,8 @@ func testAccCheckRepositoryAssociationExists(ctx context.Context, name string, r } } -func testAccPreCheck(t *testing.T) { +func testAccPreCheck(ctx context.Context, t *testing.T) { conn := acctest.Provider.Meta().(*conns.AWSClient).CodeGuruReviewerConn() - ctx := context.Background() input := &codegurureviewer.ListRepositoryAssociationsInput{} _, err := conn.ListRepositoryAssociationsWithContext(ctx, input) @@ -330,7 +329,11 @@ resource "aws_codegurureviewer_repository_association" "test" { } func testAccRepositoryAssociationConfig_s3_repository(rName string) string { - return acctest.ConfigCompose(testAccRepositoryAssociation_s3_repository(rName), ` + return fmt.Sprintf(` +resource "aws_s3_bucket" "test" { + bucket = %[1]q +} + resource "aws_codegurureviewer_repository_association" "test" { repository { s3_bucket { @@ -339,7 +342,7 @@ resource "aws_codegurureviewer_repository_association" "test" { } } } -`) +`, rName) } func testAccRepositoryAssociation_codecommit_repository(rName string) string { @@ -356,15 +359,6 @@ resource "aws_codecommit_repository" "test" { `, rName) } -func testAccRepositoryAssociation_s3_repository(rName string) string { - return fmt.Sprintf(` - -resource "aws_s3_bucket" "test" { - bucket = %[1]q -} -`, rName) -} - func testAccRepositoryAssociation_kms_key() string { return ` resource "aws_kms_key" "test" { From 88cc890e975c6d4f8f0ef8dffd5883c3adfc2e35 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Sun, 12 Mar 2023 16:57:03 -0400 Subject: [PATCH 661/763] FMS: Require 'us-east-1' for acceptance tests. --- internal/service/fms/acc_test.go | 83 ---------------------- internal/service/fms/admin_account_test.go | 15 ++-- internal/service/fms/policy_test.go | 35 +++++---- 3 files changed, 23 insertions(+), 110 deletions(-) delete mode 100644 internal/service/fms/acc_test.go diff --git a/internal/service/fms/acc_test.go b/internal/service/fms/acc_test.go deleted file mode 100644 index adfec0089b6b..000000000000 --- a/internal/service/fms/acc_test.go +++ /dev/null @@ -1,83 +0,0 @@ -package fms_test - -import ( - "context" - "sync" - "testing" - - "github.com/aws/aws-sdk-go/aws/endpoints" - "github.com/aws/aws-sdk-go/service/fms" - "github.com/hashicorp/terraform-plugin-sdk/v2/diag" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/hashicorp/terraform-provider-aws/internal/acctest" - "github.com/hashicorp/terraform-provider-aws/internal/provider" -) - -// Firewall Management Service admin APIs are only enabled in specific regions, otherwise: -// InvalidOperationException: This operation is not supported in the 'us-west-2' region. - -// testAccAdminRegion is the chosen Firewall Management Service testing region -// -// Cached to prevent issues should multiple regions become available. -var testAccAdminRegion string - -// testAccProviderAdmin is the Firewall Management Service provider instance -// -// This Provider can be used in testing code for API calls without requiring -// the use of saving and referencing specific ProviderFactories instances. -// -// testAccPreCheckAdmin(t) must be called before using this provider instance. -var testAccProviderAdmin *schema.Provider - -// testAccProviderAdminConfigure ensures the provider is only configured once -var testAccProviderAdminConfigure sync.Once - -// testAccPreCheckAdmin verifies AWS credentials and that Firewall Management Service is supported -func testAccPreCheckAdmin(ctx context.Context, t *testing.T) { - acctest.PreCheckPartitionHasService(t, fms.EndpointsID) - - // Since we are outside the scope of the Terraform configuration we must - // call Configure() to properly initialize the provider configuration. - testAccProviderAdminConfigure.Do(func() { - var err error - testAccProviderAdmin, err = provider.New(ctx) - - if err != nil { - t.Fatal(err) - } - - config := map[string]interface{}{ - "region": testAccGetAdminRegion(), - } - - diags := testAccProviderAdmin.Configure(ctx, terraform.NewResourceConfigRaw(config)) - - if diags != nil && diags.HasError() { - for _, d := range diags { - if d.Severity == diag.Error { - t.Fatalf("error configuring Firewall Management Service provider: %s", d.Summary) - } - } - } - }) -} - -// testAccAdminRegionProviderConfig is the Terraform provider configuration for Firewall Management Service region testing -// -// Testing Firewall Management Service assumes no other provider configurations -// are necessary and overwrites the "aws" provider configuration. -func testAccAdminRegionProviderConfig() string { - return acctest.ConfigRegionalProvider(testAccGetAdminRegion()) -} - -// testAccGetAdminRegion returns the Firewall Management Service region for testing -func testAccGetAdminRegion() string { - if testAccAdminRegion != "" { - return testAccAdminRegion - } - - testAccAdminRegion = endpoints.UsEast1RegionID - - return testAccAdminRegion -} diff --git a/internal/service/fms/admin_account_test.go b/internal/service/fms/admin_account_test.go index 52e444f6d806..85bae23baa62 100644 --- a/internal/service/fms/admin_account_test.go +++ b/internal/service/fms/admin_account_test.go @@ -6,6 +6,7 @@ import ( "testing" "github.com/aws/aws-sdk-go/aws" + "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" @@ -21,7 +22,7 @@ func testAccAdminAccount_basic(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { acctest.PreCheck(t) - testAccPreCheckAdmin(ctx, t) + acctest.PreCheckRegion(t, endpoints.UsEast1RegionID) acctest.PreCheckOrganizationsAccount(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, fms.EndpointsID), @@ -29,7 +30,7 @@ func testAccAdminAccount_basic(t *testing.T) { CheckDestroy: testAccCheckAdminAccountDestroy(ctx), Steps: []resource.TestStep{ { - Config: testAccAdminAccountConfig_basic(), + Config: testAccAdminAccountConfig_basic, Check: resource.ComposeTestCheckFunc( acctest.CheckResourceAttrAccountID(resourceName, "account_id"), ), @@ -40,7 +41,7 @@ func testAccAdminAccount_basic(t *testing.T) { func testAccCheckAdminAccountDestroy(ctx context.Context) resource.TestCheckFunc { return func(s *terraform.State) error { - conn := testAccProviderAdmin.Meta().(*conns.AWSClient).FMSConn() + conn := acctest.Provider.Meta().(*conns.AWSClient).FMSConn() for _, rs := range s.RootModule().Resources { if rs.Type != "aws_fms_admin_account" { @@ -68,10 +69,7 @@ func testAccCheckAdminAccountDestroy(ctx context.Context) resource.TestCheckFunc } } -func testAccAdminAccountConfig_basic() string { - return acctest.ConfigCompose( - testAccAdminRegionProviderConfig(), - ` +const testAccAdminAccountConfig_basic = ` data "aws_partition" "current" {} resource "aws_organizations_organization" "test" { @@ -82,5 +80,4 @@ resource "aws_organizations_organization" "test" { resource "aws_fms_admin_account" "test" { account_id = aws_organizations_organization.test.master_account_id } -`) -} +` diff --git a/internal/service/fms/policy_test.go b/internal/service/fms/policy_test.go index 0ac28906d471..c846e17f19b0 100644 --- a/internal/service/fms/policy_test.go +++ b/internal/service/fms/policy_test.go @@ -5,6 +5,7 @@ import ( "fmt" "testing" + "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" @@ -23,7 +24,7 @@ func testAccPolicy_basic(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { acctest.PreCheck(t) - testAccPreCheckAdmin(ctx, t) + acctest.PreCheckRegion(t, endpoints.UsEast1RegionID) acctest.PreCheckOrganizationsEnabled(ctx, t) acctest.PreCheckOrganizationManagementAccount(ctx, t) }, @@ -60,7 +61,7 @@ func testAccPolicy_cloudFrontDistribution(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { acctest.PreCheck(t) - testAccPreCheckAdmin(ctx, t) + acctest.PreCheckRegion(t, endpoints.UsEast1RegionID) acctest.PreCheckOrganizationsEnabled(ctx, t) acctest.PreCheckOrganizationManagementAccount(ctx, t) }, @@ -94,7 +95,7 @@ func testAccPolicy_includeMap(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { acctest.PreCheck(t) - testAccPreCheckAdmin(ctx, t) + acctest.PreCheckRegion(t, endpoints.UsEast1RegionID) acctest.PreCheckOrganizationsEnabled(ctx, t) acctest.PreCheckOrganizationManagementAccount(ctx, t) }, @@ -129,7 +130,7 @@ func testAccPolicy_update(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { acctest.PreCheck(t) - testAccPreCheckAdmin(ctx, t) + acctest.PreCheckRegion(t, endpoints.UsEast1RegionID) acctest.PreCheckOrganizationsEnabled(ctx, t) acctest.PreCheckOrganizationManagementAccount(ctx, t) }, @@ -160,7 +161,7 @@ func testAccPolicy_resourceTags(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { acctest.PreCheck(t) - testAccPreCheckAdmin(ctx, t) + acctest.PreCheckRegion(t, endpoints.UsEast1RegionID) acctest.PreCheckOrganizationsEnabled(ctx, t) acctest.PreCheckOrganizationManagementAccount(ctx, t) }, @@ -196,7 +197,7 @@ func testAccPolicy_tags(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { acctest.PreCheck(t) - testAccPreCheckAdmin(ctx, t) + acctest.PreCheckRegion(t, endpoints.UsEast1RegionID) acctest.PreCheckOrganizationsEnabled(ctx, t) acctest.PreCheckOrganizationManagementAccount(ctx, t) }, @@ -269,18 +270,16 @@ func testAccCheckPolicyExists(ctx context.Context, n string) resource.TestCheckF } } -func testAccPolicyConfigOrgMgmtAccountBase() string { - return acctest.ConfigCompose(testAccAdminRegionProviderConfig(), ` +const testAccPolicyConfig_baseOrgMgmtAccount = ` data "aws_caller_identity" "current" {} resource "aws_fms_admin_account" "test" { account_id = data.aws_caller_identity.current.account_id } -`) -} +` func testAccPolicyConfig_basic(policyName, ruleGroupName string) string { - return acctest.ConfigCompose(testAccPolicyConfigOrgMgmtAccountBase(), fmt.Sprintf(` + return acctest.ConfigCompose(testAccPolicyConfig_baseOrgMgmtAccount, fmt.Sprintf(` resource "aws_fms_policy" "test" { exclude_resource_tags = false name = %[1]q @@ -307,7 +306,7 @@ resource "aws_wafregional_rule_group" "test" { } func testAccPolicyConfig_cloudFrontDistribution(rName string) string { - return acctest.ConfigCompose(testAccPolicyConfigOrgMgmtAccountBase(), fmt.Sprintf(` + return acctest.ConfigCompose(testAccPolicyConfig_baseOrgMgmtAccount, fmt.Sprintf(` resource "aws_fms_policy" "test" { exclude_resource_tags = false name = %[1]q @@ -383,7 +382,7 @@ resource "aws_kinesis_firehose_delivery_stream" "test" { } func testAccPolicyConfig_updated(policyName, ruleGroupName string) string { - return acctest.ConfigCompose(testAccPolicyConfigOrgMgmtAccountBase(), fmt.Sprintf(` + return acctest.ConfigCompose(testAccPolicyConfig_baseOrgMgmtAccount, fmt.Sprintf(` resource "aws_fms_policy" "test" { exclude_resource_tags = false name = %[1]q @@ -414,7 +413,7 @@ resource "aws_wafregional_rule_group" "test" { } func testAccPolicyConfig_include(rName string) string { - return acctest.ConfigCompose(testAccPolicyConfigOrgMgmtAccountBase(), fmt.Sprintf(` + return acctest.ConfigCompose(testAccPolicyConfig_baseOrgMgmtAccount, fmt.Sprintf(` resource "aws_fms_policy" "test" { exclude_resource_tags = false name = %[1]q @@ -441,7 +440,7 @@ resource "aws_wafregional_rule_group" "test" { } func testAccPolicyConfig_resourceTags1(rName, tagKey1, tagValue1 string) string { - return acctest.ConfigCompose(testAccPolicyConfigOrgMgmtAccountBase(), fmt.Sprintf(` + return acctest.ConfigCompose(testAccPolicyConfig_baseOrgMgmtAccount, fmt.Sprintf(` resource "aws_fms_policy" "test" { exclude_resource_tags = false name = %[1]q @@ -468,7 +467,7 @@ resource "aws_wafregional_rule_group" "test" { } func testAccPolicyConfig_resourceTags2(rName, tagKey1, tagValue1, tagKey2, tagValue2 string) string { - return acctest.ConfigCompose(testAccPolicyConfigOrgMgmtAccountBase(), fmt.Sprintf(` + return acctest.ConfigCompose(testAccPolicyConfig_baseOrgMgmtAccount, fmt.Sprintf(` resource "aws_fms_policy" "test" { exclude_resource_tags = false name = %[1]q @@ -496,7 +495,7 @@ resource "aws_wafregional_rule_group" "test" { } func testAccPolicyConfig_tags1(rName, tagKey1, tagValue1 string) string { - return acctest.ConfigCompose(testAccPolicyConfigOrgMgmtAccountBase(), fmt.Sprintf(` + return acctest.ConfigCompose(testAccPolicyConfig_baseOrgMgmtAccount, fmt.Sprintf(` resource "aws_fms_policy" "test" { exclude_resource_tags = false name = %[1]q @@ -523,7 +522,7 @@ resource "aws_wafregional_rule_group" "test" { } func testAccPolicyConfig_tags2(rName, tagKey1, tagValue1, tagKey2, tagValue2 string) string { - return acctest.ConfigCompose(testAccPolicyConfigOrgMgmtAccountBase(), fmt.Sprintf(` + return acctest.ConfigCompose(testAccPolicyConfig_baseOrgMgmtAccount, fmt.Sprintf(` resource "aws_fms_policy" "test" { exclude_resource_tags = false name = %[1]q From 599c22bf0cc6ea713365648f7d1728bd758420f5 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Sun, 12 Mar 2023 17:04:17 -0400 Subject: [PATCH 662/763] Lightsail Domains: Require 'us-east-1' for acceptance tests. --- internal/service/lightsail/acc_test.go | 94 ------------------- .../service/lightsail/domain_entry_test.go | 18 ++-- internal/service/lightsail/domain_test.go | 17 ++-- 3 files changed, 17 insertions(+), 112 deletions(-) delete mode 100644 internal/service/lightsail/acc_test.go diff --git a/internal/service/lightsail/acc_test.go b/internal/service/lightsail/acc_test.go deleted file mode 100644 index 9f1a1844e1d6..000000000000 --- a/internal/service/lightsail/acc_test.go +++ /dev/null @@ -1,94 +0,0 @@ -package lightsail_test - -import ( - "context" - "sync" - "testing" - - "github.com/aws/aws-sdk-go/aws/endpoints" - "github.com/aws/aws-sdk-go/service/lightsail" - "github.com/hashicorp/terraform-plugin-sdk/v2/diag" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/hashicorp/terraform-provider-aws/internal/acctest" - "github.com/hashicorp/terraform-provider-aws/internal/provider" -) - -// Lightsail Domains can only be created in specific regions. - -// testAccLightsailDomainRegion is the chosen Lightsail Domains testing region -// -// Cached to prevent issues should multiple regions become available. -var testAccLightsailDomainRegion string - -// testAccProviderLightsailDomain is the Lightsail Domains provider instance -// -// This Provider can be used in testing code for API calls without requiring -// the use of saving and referencing specific ProviderFactories instances. -// -// testAccPreCheckDomain(t) must be called before using this provider instance. -var testAccProviderLightsailDomain *schema.Provider - -// testAccProviderLightsailDomainConfigure ensures the provider is only configured once -var testAccProviderLightsailDomainConfigure sync.Once - -// testAccPreCheckDomain verifies AWS credentials and that Lightsail Domains is supported -func testAccPreCheckDomain(ctx context.Context, t *testing.T) { - acctest.PreCheckPartitionHasService(t, lightsail.EndpointsID) - - region := testAccGetDomainRegion() - - if region == "" { - t.Skip("Lightsail Domains not available in this AWS Partition") - } - - // Since we are outside the scope of the Terraform configuration we must - // call Configure() to properly initialize the provider configuration. - testAccProviderLightsailDomainConfigure.Do(func() { - var err error - testAccProviderLightsailDomain, err = provider.New(ctx) - - if err != nil { - t.Fatal(err) - } - - config := map[string]interface{}{ - "region": region, - } - - diags := testAccProviderLightsailDomain.Configure(ctx, terraform.NewResourceConfigRaw(config)) - - if diags != nil && diags.HasError() { - for _, d := range diags { - if d.Severity == diag.Error { - t.Fatalf("error configuring Lightsail Domains provider: %s", d.Summary) - } - } - } - }) -} - -// testAccDomainRegionProviderConfig is the Terraform provider configuration for Lightsail Domains region testing -// -// Testing Lightsail Domains assumes no other provider configurations -// are necessary and overwrites the "aws" provider configuration. -func testAccDomainRegionProviderConfig() string { - return acctest.ConfigRegionalProvider(testAccGetDomainRegion()) -} - -// testAccGetDomainRegion returns the Lightsail Domains region for testing -func testAccGetDomainRegion() string { - if testAccLightsailDomainRegion != "" { - return testAccLightsailDomainRegion - } - - // AWS Commercial: https://lightsail.aws.amazon.com/ls/docs/en_us/articles/lightsail-how-to-create-dns-entry - // AWS GovCloud (US) - service not supported: https://docs.aws.amazon.com/govcloud-us/latest/UserGuide/using-services.html - // AWS China - service not supported: https://www.amazonaws.cn/en/about-aws/regional-product-services/ - switch acctest.Partition() { - case endpoints.AwsPartitionID: - testAccLightsailDomainRegion = endpoints.UsEast1RegionID - } - - return testAccLightsailDomainRegion -} diff --git a/internal/service/lightsail/domain_entry_test.go b/internal/service/lightsail/domain_entry_test.go index b986934abe48..36f451f5872f 100644 --- a/internal/service/lightsail/domain_entry_test.go +++ b/internal/service/lightsail/domain_entry_test.go @@ -8,6 +8,7 @@ import ( "time" "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" @@ -28,7 +29,7 @@ func TestAccLightsailDomainEntry_basic(t *testing.T) { domainEntryName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckDomain(ctx, t) }, + PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckRegion(t, endpoints.UsEast1RegionID) }, ErrorCheck: acctest.ErrorCheck(t, lightsail.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDomainEntryDestroy(ctx), @@ -60,7 +61,7 @@ func TestAccLightsailDomainEntry_disappears(t *testing.T) { domainEntryName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) testDestroy := func(*terraform.State) error { - conn := testAccProviderLightsailDomain.Meta().(*conns.AWSClient).LightsailConn() + conn := acctest.Provider.Meta().(*conns.AWSClient).LightsailConn() _, err := conn.DeleteDomainEntryWithContext(ctx, &lightsail.DeleteDomainEntryInput{ DomainName: aws.String(domainName), DomainEntry: &lightsail.DomainEntry{ @@ -81,7 +82,7 @@ func TestAccLightsailDomainEntry_disappears(t *testing.T) { } resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckDomain(ctx, t) }, + PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckRegion(t, endpoints.UsEast1RegionID) }, ErrorCheck: acctest.ErrorCheck(t, lightsail.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDomainEntryDestroy(ctx), @@ -110,7 +111,7 @@ func testAccCheckDomainEntryExists(ctx context.Context, n string, domainEntry *l return errors.New("No Lightsail Domain Entry ID is set") } - conn := testAccProviderLightsailDomain.Meta().(*conns.AWSClient).LightsailConn() + conn := acctest.Provider.Meta().(*conns.AWSClient).LightsailConn() resp, err := tflightsail.FindDomainEntryById(ctx, conn, rs.Primary.ID) @@ -135,7 +136,7 @@ func testAccCheckDomainEntryDestroy(ctx context.Context) resource.TestCheckFunc continue } - conn := testAccProviderLightsailDomain.Meta().(*conns.AWSClient).LightsailConn() + conn := acctest.Provider.Meta().(*conns.AWSClient).LightsailConn() _, err := tflightsail.FindDomainEntryById(ctx, conn, rs.Primary.ID) @@ -155,17 +156,16 @@ func testAccCheckDomainEntryDestroy(ctx context.Context) resource.TestCheckFunc } func testAccDomainEntryConfig_basic(domainName string, domainEntryName string) string { - return acctest.ConfigCompose( - testAccDomainRegionProviderConfig(), - fmt.Sprintf(` + return fmt.Sprintf(` resource "aws_lightsail_domain" "test" { domain_name = %[1]q } + resource "aws_lightsail_domain_entry" "test" { domain_name = aws_lightsail_domain.test.id name = %[2]q type = "A" target = "127.0.0.1" } -`, domainName, domainEntryName)) +`, domainName, domainEntryName) } diff --git a/internal/service/lightsail/domain_test.go b/internal/service/lightsail/domain_test.go index 4b0471411775..71277b097280 100644 --- a/internal/service/lightsail/domain_test.go +++ b/internal/service/lightsail/domain_test.go @@ -7,6 +7,7 @@ import ( "testing" "github.com/aws/aws-sdk-go/aws" + "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" @@ -24,7 +25,7 @@ func TestAccLightsailDomain_basic(t *testing.T) { resourceName := "aws_lightsail_domain.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckDomain(ctx, t) }, + PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckRegion(t, endpoints.UsEast1RegionID) }, ErrorCheck: acctest.ErrorCheck(t, lightsail.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDomainDestroy(ctx), @@ -46,7 +47,7 @@ func TestAccLightsailDomain_disappears(t *testing.T) { resourceName := "aws_lightsail_domain.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckDomain(ctx, t) }, + PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckRegion(t, endpoints.UsEast1RegionID) }, ErrorCheck: acctest.ErrorCheck(t, lightsail.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckDomainDestroy(ctx), @@ -55,7 +56,7 @@ func TestAccLightsailDomain_disappears(t *testing.T) { Config: testAccDomainConfig_basic(lightsailDomainName), Check: resource.ComposeAggregateTestCheckFunc( testAccCheckDomainExists(ctx, resourceName, &domain), - acctest.CheckResourceDisappears(ctx, testAccProviderLightsailDomain, tflightsail.ResourceDomain(), resourceName), + acctest.CheckResourceDisappears(ctx, acctest.Provider, tflightsail.ResourceDomain(), resourceName), ), ExpectNonEmptyPlan: true, }, @@ -74,7 +75,7 @@ func testAccCheckDomainExists(ctx context.Context, n string, domain *lightsail.D return errors.New("No Lightsail Domain ID is set") } - conn := testAccProviderLightsailDomain.Meta().(*conns.AWSClient).LightsailConn() + conn := acctest.Provider.Meta().(*conns.AWSClient).LightsailConn() resp, err := conn.GetDomainWithContext(ctx, &lightsail.GetDomainInput{ DomainName: aws.String(rs.Primary.ID), @@ -99,7 +100,7 @@ func testAccCheckDomainDestroy(ctx context.Context) resource.TestCheckFunc { continue } - conn := testAccProviderLightsailDomain.Meta().(*conns.AWSClient).LightsailConn() + conn := acctest.Provider.Meta().(*conns.AWSClient).LightsailConn() resp, err := conn.GetDomainWithContext(ctx, &lightsail.GetDomainInput{ DomainName: aws.String(rs.Primary.ID), @@ -123,11 +124,9 @@ func testAccCheckDomainDestroy(ctx context.Context) resource.TestCheckFunc { } func testAccDomainConfig_basic(lightsailDomainName string) string { - return acctest.ConfigCompose( - testAccDomainRegionProviderConfig(), - fmt.Sprintf(` + return fmt.Sprintf(` resource "aws_lightsail_domain" "test" { domain_name = "%s" } -`, lightsailDomainName)) +`, lightsailDomainName) } From 6780caee7faa34034719e777b908dafe24bf2f5e Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Sun, 12 Mar 2023 17:09:39 -0400 Subject: [PATCH 663/763] WAF WebACL Logging: Require 'us-east-1' for acceptance tests. --- internal/service/waf/acc_test.go | 94 ---------------------------- internal/service/waf/web_acl_test.go | 21 +++---- 2 files changed, 8 insertions(+), 107 deletions(-) delete mode 100644 internal/service/waf/acc_test.go diff --git a/internal/service/waf/acc_test.go b/internal/service/waf/acc_test.go deleted file mode 100644 index 0cbf3d734d68..000000000000 --- a/internal/service/waf/acc_test.go +++ /dev/null @@ -1,94 +0,0 @@ -package waf_test - -import ( - "context" - "sync" - "testing" - - "github.com/aws/aws-sdk-go/aws/endpoints" - "github.com/aws/aws-sdk-go/service/waf" - "github.com/hashicorp/terraform-plugin-sdk/v2/diag" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/hashicorp/terraform-provider-aws/internal/acctest" - "github.com/hashicorp/terraform-provider-aws/internal/provider" -) - -// WAF Logging Configurations can only be enabled with destinations in specific regions, - -// testAccWafLoggingConfigurationRegion is the chosen WAF Logging Configurations testing region -// -// Cached to prevent issues should multiple regions become available. -var testAccWafLoggingConfigurationRegion string - -// testAccProviderWafLoggingConfiguration is the WAF Logging Configurations provider instance -// -// This Provider can be used in testing code for API calls without requiring -// the use of saving and referencing specific ProviderFactories instances. -// -// testAccPreCheckLoggingConfiguration(t) must be called before using this provider instance. -var testAccProviderWafLoggingConfiguration *schema.Provider - -// testAccProviderWafLoggingConfigurationConfigure ensures the provider is only configured once -var testAccProviderWafLoggingConfigurationConfigure sync.Once - -// testAccPreCheckLoggingConfiguration verifies AWS credentials and that WAF Logging Configurations is supported -func testAccPreCheckLoggingConfiguration(ctx context.Context, t *testing.T) { - acctest.PreCheckPartitionHasService(t, waf.EndpointsID) - - region := testAccGetLoggingConfigurationRegion() - - if region == "" { - t.Skip("WAF Logging Configuration not available in this AWS Partition") - } - - // Since we are outside the scope of the Terraform configuration we must - // call Configure() to properly initialize the provider configuration. - testAccProviderWafLoggingConfigurationConfigure.Do(func() { - var err error - testAccProviderWafLoggingConfiguration, err = provider.New(ctx) - - if err != nil { - t.Fatal(err) - } - - config := map[string]interface{}{ - "region": region, - } - - diags := testAccProviderWafLoggingConfiguration.Configure(ctx, terraform.NewResourceConfigRaw(config)) - - if diags != nil && diags.HasError() { - for _, d := range diags { - if d.Severity == diag.Error { - t.Fatalf("error configuring WAF Logging Configurations provider: %s", d.Summary) - } - } - } - }) -} - -// testAccLoggingConfigurationRegionProviderConfig is the Terraform provider configuration for WAF Logging Configurations region testing -// -// Testing WAF Logging Configurations assumes no other provider configurations -// are necessary and overwrites the "aws" provider configuration. -func testAccLoggingConfigurationRegionProviderConfig() string { - return acctest.ConfigRegionalProvider(testAccGetLoggingConfigurationRegion()) -} - -// testAccGetLoggingConfigurationRegion returns the WAF Logging Configurations region for testing -func testAccGetLoggingConfigurationRegion() string { - if testAccWafLoggingConfigurationRegion != "" { - return testAccWafLoggingConfigurationRegion - } - - // AWS Commercial: https://docs.aws.amazon.com/waf/latest/developerguide/classic-logging.html - // AWS GovCloud (US) - not available yet: https://docs.aws.amazon.com/govcloud-us/latest/UserGuide/govcloud-waf.html - // AWS China - not available yet - switch acctest.Partition() { - case endpoints.AwsPartitionID: - testAccWafLoggingConfigurationRegion = endpoints.UsEast1RegionID - } - - return testAccWafLoggingConfigurationRegion -} diff --git a/internal/service/waf/web_acl_test.go b/internal/service/waf/web_acl_test.go index e9850525a1dc..94f681389f03 100644 --- a/internal/service/waf/web_acl_test.go +++ b/internal/service/waf/web_acl_test.go @@ -7,6 +7,7 @@ import ( "testing" "github.com/aws/aws-sdk-go/aws" + "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" @@ -190,7 +191,7 @@ func TestAccWAFWebACL_logging(t *testing.T) { PreCheck: func() { acctest.PreCheck(t) testAccPreCheck(ctx, t) - testAccPreCheckLoggingConfiguration(ctx, t) + acctest.PreCheckRegion(t, endpoints.UsEast1RegionID) }, ErrorCheck: acctest.ErrorCheck(t, waf.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, @@ -530,9 +531,7 @@ resource "aws_waf_web_acl" "test" { } func testAccWebACLConfig_logging(rName string) string { - return acctest.ConfigCompose( - testAccLoggingConfigurationRegionProviderConfig(), - fmt.Sprintf(` + return fmt.Sprintf(` resource "aws_waf_web_acl" "test" { name = %[1]q metric_name = %[1]q @@ -597,13 +596,11 @@ resource "aws_kinesis_firehose_delivery_stream" "test" { bucket_arn = aws_s3_bucket.test.arn } } -`, rName)) +`, rName) } func testAccWebACLConfig_loggingRemoved(rName string) string { - return acctest.ConfigCompose( - testAccLoggingConfigurationRegionProviderConfig(), - fmt.Sprintf(` + return fmt.Sprintf(` resource "aws_waf_web_acl" "test" { metric_name = %[1]q name = %[1]q @@ -612,13 +609,11 @@ resource "aws_waf_web_acl" "test" { type = "ALLOW" } } -`, rName)) +`, rName) } func testAccWebACLConfig_loggingUpdate(rName string) string { - return acctest.ConfigCompose( - testAccLoggingConfigurationRegionProviderConfig(), - fmt.Sprintf(` + return fmt.Sprintf(` resource "aws_waf_web_acl" "test" { metric_name = %[1]q name = %[1]q @@ -672,7 +667,7 @@ resource "aws_kinesis_firehose_delivery_stream" "test" { bucket_arn = aws_s3_bucket.test.arn } } -`, rName)) +`, rName) } func testAccWebACLConfig_tags1(rName, tag1Key, tag1Value string) string { From e9427557ebfaef904dd146d6ee860703e6d48a5f Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Sun, 12 Mar 2023 17:15:56 -0400 Subject: [PATCH 664/763] Route 53 Zone Signing Keys: Require 'us-east-1' for acceptance tests. --- .../route53/hosted_zone_dnssec_test.go | 25 ++-- .../service/route53/key_signing_key_test.go | 109 ++---------------- 2 files changed, 21 insertions(+), 113 deletions(-) diff --git a/internal/service/route53/hosted_zone_dnssec_test.go b/internal/service/route53/hosted_zone_dnssec_test.go index c7c2a7d4b7ec..c538571a5380 100644 --- a/internal/service/route53/hosted_zone_dnssec_test.go +++ b/internal/service/route53/hosted_zone_dnssec_test.go @@ -6,6 +6,7 @@ import ( "testing" "github.com/aws/aws-sdk-go/aws" + "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" @@ -25,7 +26,7 @@ func TestAccRoute53HostedZoneDNSSEC_basic(t *testing.T) { domainName := acctest.RandomDomainName() resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckKeySigningKey(ctx, t) }, + PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckRegion(t, endpoints.UsEast1RegionID) }, ErrorCheck: acctest.ErrorCheck(t, route53.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckHostedZoneDNSSECDestroy(ctx), @@ -55,7 +56,7 @@ func TestAccRoute53HostedZoneDNSSEC_disappears(t *testing.T) { domainName := acctest.RandomDomainName() resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckKeySigningKey(ctx, t) }, + PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckRegion(t, endpoints.UsEast1RegionID) }, ErrorCheck: acctest.ErrorCheck(t, route53.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckHostedZoneDNSSECDestroy(ctx), @@ -80,7 +81,7 @@ func TestAccRoute53HostedZoneDNSSEC_signingStatus(t *testing.T) { domainName := acctest.RandomDomainName() resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckKeySigningKey(ctx, t) }, + PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckRegion(t, endpoints.UsEast1RegionID) }, ErrorCheck: acctest.ErrorCheck(t, route53.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckHostedZoneDNSSECDestroy(ctx), @@ -117,7 +118,7 @@ func TestAccRoute53HostedZoneDNSSEC_signingStatus(t *testing.T) { func testAccCheckHostedZoneDNSSECDestroy(ctx context.Context) resource.TestCheckFunc { return func(s *terraform.State) error { - conn := testAccProviderRoute53KeySigningKey.Meta().(*conns.AWSClient).Route53Conn() + conn := acctest.Provider.Meta().(*conns.AWSClient).Route53Conn() for _, rs := range s.RootModule().Resources { if rs.Type != "aws_route53_hosted_zone_dnssec" { @@ -159,7 +160,7 @@ func testAccHostedZoneDNSSECExists(ctx context.Context, resourceName string) res return fmt.Errorf("resource %s has not set its id", resourceName) } - conn := testAccProviderRoute53KeySigningKey.Meta().(*conns.AWSClient).Route53Conn() + conn := acctest.Provider.Meta().(*conns.AWSClient).Route53Conn() hostedZoneDnssec, err := tfroute53.FindHostedZoneDNSSEC(ctx, conn, rs.Primary.ID) @@ -175,10 +176,8 @@ func testAccHostedZoneDNSSECExists(ctx context.Context, resourceName string) res } } -func testAccHostedZoneDNSSECConfig_Base(rName, domainName string) string { - return acctest.ConfigCompose( - testAccKeySigningKeyRegionProviderConfig(), - fmt.Sprintf(` +func testAccHostedZoneDNSSECConfig_base(rName, domainName string) string { + return fmt.Sprintf(` resource "aws_kms_key" "test" { customer_master_key_spec = "ECC_NIST_P256" deletion_window_in_days = 7 @@ -220,12 +219,11 @@ resource "aws_route53_key_signing_key" "test" { key_management_service_arn = aws_kms_key.test.arn name = %[1]q } -`, rName, domainName)) +`, rName, domainName) } func testAccHostedZoneDNSSECConfig_basic(rName, domainName string) string { - return acctest.ConfigCompose( - testAccHostedZoneDNSSECConfig_Base(rName, domainName), ` + return acctest.ConfigCompose(testAccHostedZoneDNSSECConfig_base(rName, domainName), ` resource "aws_route53_hosted_zone_dnssec" "test" { hosted_zone_id = aws_route53_key_signing_key.test.hosted_zone_id } @@ -233,8 +231,7 @@ resource "aws_route53_hosted_zone_dnssec" "test" { } func testAccHostedZoneDNSSECConfig_signingStatus(rName, domainName, signingStatus string) string { - return acctest.ConfigCompose( - testAccHostedZoneDNSSECConfig_Base(rName, domainName), + return acctest.ConfigCompose(testAccHostedZoneDNSSECConfig_base(rName, domainName), fmt.Sprintf(` resource "aws_route53_hosted_zone_dnssec" "test" { hosted_zone_id = aws_route53_key_signing_key.test.hosted_zone_id diff --git a/internal/service/route53/key_signing_key_test.go b/internal/service/route53/key_signing_key_test.go index de2d3935aa72..c77be1b27169 100644 --- a/internal/service/route53/key_signing_key_test.go +++ b/internal/service/route53/key_signing_key_test.go @@ -4,20 +4,16 @@ import ( "context" "fmt" "regexp" - "sync" "testing" "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" - "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" "github.com/hashicorp/terraform-plugin-sdk/v2/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" tfroute53 "github.com/hashicorp/terraform-provider-aws/internal/service/route53" ) @@ -33,7 +29,7 @@ func TestAccRoute53KeySigningKey_basic(t *testing.T) { domainName := acctest.RandomDomainName() resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckKeySigningKey(ctx, t) }, + PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckRegion(t, endpoints.UsEast1RegionID) }, ErrorCheck: acctest.ErrorCheck(t, route53.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckKeySigningKeyDestroy(ctx), @@ -75,7 +71,7 @@ func TestAccRoute53KeySigningKey_disappears(t *testing.T) { domainName := acctest.RandomDomainName() resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckKeySigningKey(ctx, t) }, + PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckRegion(t, endpoints.UsEast1RegionID) }, ErrorCheck: acctest.ErrorCheck(t, route53.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckKeySigningKeyDestroy(ctx), @@ -100,7 +96,7 @@ func TestAccRoute53KeySigningKey_status(t *testing.T) { domainName := acctest.RandomDomainName() resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheckKeySigningKey(ctx, t) }, + PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckRegion(t, endpoints.UsEast1RegionID) }, ErrorCheck: acctest.ErrorCheck(t, route53.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckKeySigningKeyDestroy(ctx), @@ -137,7 +133,7 @@ func TestAccRoute53KeySigningKey_status(t *testing.T) { func testAccCheckKeySigningKeyDestroy(ctx context.Context) resource.TestCheckFunc { return func(s *terraform.State) error { - conn := testAccProviderRoute53KeySigningKey.Meta().(*conns.AWSClient).Route53Conn() + conn := acctest.Provider.Meta().(*conns.AWSClient).Route53Conn() for _, rs := range s.RootModule().Resources { if rs.Type != "aws_route53_key_signing_key" { @@ -179,7 +175,7 @@ func testAccKeySigningKeyExists(ctx context.Context, resourceName string) resour return fmt.Errorf("resource %s has not set its id", resourceName) } - conn := testAccProviderRoute53KeySigningKey.Meta().(*conns.AWSClient).Route53Conn() + conn := acctest.Provider.Meta().(*conns.AWSClient).Route53Conn() keySigningKey, err := tfroute53.FindKeySigningKeyByResourceID(ctx, conn, rs.Primary.ID) @@ -195,10 +191,8 @@ func testAccKeySigningKeyExists(ctx context.Context, resourceName string) resour } } -func testAccKeySigningKeyConfig_Base(rName, domainName string) string { - return acctest.ConfigCompose( - testAccKeySigningKeyRegionProviderConfig(), - fmt.Sprintf(` +func testAccKeySigningKeyConfig_base(rName, domainName string) string { + return fmt.Sprintf(` resource "aws_kms_key" "test" { customer_master_key_spec = "ECC_NIST_P256" deletion_window_in_days = 7 @@ -234,13 +228,11 @@ resource "aws_kms_key" "test" { resource "aws_route53_zone" "test" { name = %[2]q } -`, rName, domainName)) +`, rName, domainName) } func testAccKeySigningKeyConfig_name(rName, domainName string) string { - return acctest.ConfigCompose( - testAccKeySigningKeyConfig_Base(rName, domainName), - fmt.Sprintf(` + return acctest.ConfigCompose(testAccKeySigningKeyConfig_base(rName, domainName), fmt.Sprintf(` resource "aws_route53_key_signing_key" "test" { hosted_zone_id = aws_route53_zone.test.id key_management_service_arn = aws_kms_key.test.arn @@ -250,9 +242,7 @@ resource "aws_route53_key_signing_key" "test" { } func testAccKeySigningKeyConfig_status(rName, domainName, status string) string { - return acctest.ConfigCompose( - testAccKeySigningKeyConfig_Base(rName, domainName), - fmt.Sprintf(` + return acctest.ConfigCompose(testAccKeySigningKeyConfig_base(rName, domainName), fmt.Sprintf(` resource "aws_route53_key_signing_key" "test" { hosted_zone_id = aws_route53_zone.test.id key_management_service_arn = aws_kms_key.test.arn @@ -261,82 +251,3 @@ resource "aws_route53_key_signing_key" "test" { } `, rName, status)) } - -// Route 53 Key Signing Key can only be enabled with KMS Keys in specific regions, - -// testAccRoute53KeySigningKeyRegion is the chosen Route 53 Key Signing Key testing region -// -// Cached to prevent issues should multiple regions become available. -var testAccRoute53KeySigningKeyRegion string - -// testAccProviderRoute53KeySigningKey is the Route 53 Key Signing Key provider instance -// -// This Provider can be used in testing code for API calls without requiring -// the use of saving and referencing specific ProviderFactories instances. -// -// testAccPreCheckKeySigningKey(t) must be called before using this provider instance. -var testAccProviderRoute53KeySigningKey *schema.Provider - -// testAccProviderRoute53KeySigningKeyConfigure ensures the provider is only configured once -var testAccProviderRoute53KeySigningKeyConfigure sync.Once - -// testAccPreCheckKeySigningKey verifies AWS credentials and that Route 53 Key Signing Key is supported -func testAccPreCheckKeySigningKey(ctx context.Context, t *testing.T) { - acctest.PreCheckPartitionHasService(t, route53.EndpointsID) - - region := testAccGetKeySigningKeyRegion() - - if region == "" { - t.Skip("Route 53 Key Signing Key not available in this AWS Partition") - } - - // Since we are outside the scope of the Terraform configuration we must - // call Configure() to properly initialize the provider configuration. - testAccProviderRoute53KeySigningKeyConfigure.Do(func() { - var err error - testAccProviderRoute53KeySigningKey, err = provider.New(ctx) - - if err != nil { - t.Fatal(err) - } - - testAccRecordConfig_config := map[string]interface{}{ - "region": region, - } - - diags := testAccProviderRoute53KeySigningKey.Configure(ctx, terraform.NewResourceConfigRaw(testAccRecordConfig_config)) - - if diags != nil && diags.HasError() { - for _, d := range diags { - if d.Severity == diag.Error { - t.Fatalf("error configuring Route 53 Key Signing Key provider: %s", d.Summary) - } - } - } - }) -} - -// testAccKeySigningKeyRegionProviderConfig is the Terraform provider configuration for Route 53 Key Signing Key region testing -// -// Testing Route 53 Key Signing Key assumes no other provider configurations -// are necessary and overwrites the "aws" provider configuration. -func testAccKeySigningKeyRegionProviderConfig() string { - return acctest.ConfigRegionalProvider(testAccGetKeySigningKeyRegion()) -} - -// testAccGetKeySigningKeyRegion returns the Route 53 Key Signing Key region for testing -func testAccGetKeySigningKeyRegion() string { - if testAccRoute53KeySigningKeyRegion != "" { - return testAccRoute53KeySigningKeyRegion - } - - // AWS Commercial: https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/dns-configuring-dnssec-cmk-requirements.html - // AWS GovCloud (US) - not available yet: https://docs.aws.amazon.com/govcloud-us/latest/UserGuide/govcloud-r53.html - // AWS China - not available yet: https://docs.amazonaws.cn/en_us/aws/latest/userguide/route53.html - switch acctest.Partition() { - case endpoints.AwsPartitionID: - testAccRoute53KeySigningKeyRegion = endpoints.UsEast1RegionID - } - - return testAccRoute53KeySigningKeyRegion -} From 3fa0bf241ef62cce0e9efcd19e67f18efe6049a4 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Sun, 12 Mar 2023 17:25:19 -0400 Subject: [PATCH 665/763] Cost and Usage Reports: Require 'us-east-1' for acceptance tests. --- internal/service/cur/acc_test.go | 107 ------------------ .../cur/report_definition_data_source_test.go | 40 ++----- .../service/cur/report_definition_test.go | 31 +++-- 3 files changed, 24 insertions(+), 154 deletions(-) delete mode 100644 internal/service/cur/acc_test.go diff --git a/internal/service/cur/acc_test.go b/internal/service/cur/acc_test.go deleted file mode 100644 index 60f3ad6c5831..000000000000 --- a/internal/service/cur/acc_test.go +++ /dev/null @@ -1,107 +0,0 @@ -package cur_test - -import ( - "context" - "sync" - "testing" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/endpoints" - "github.com/aws/aws-sdk-go/service/costandusagereportservice" - "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-plugin-sdk/v2/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" -) - -// testAccCurRegion is the chosen Cost and Usage Reporting testing region -// -// Cached to prevent issues should multiple regions become available. -var testAccCurRegion string - -// testAccProviderCur is the Cost and Usage Reporting provider instance -// -// This Provider can be used in testing code for API calls without requiring -// the use of saving and referencing specific ProviderFactories instances. -// -// testAccPreCheck(t) must be called before using this provider instance. -var testAccProviderCur *schema.Provider - -// testAccProviderCurConfigure ensures the provider is only configured once -var testAccProviderCurConfigure sync.Once - -// testAccPreCheck verifies AWS credentials and that Cost and Usage Reporting is supported -func testAccPreCheck(ctx context.Context, t *testing.T) { - acctest.PreCheckPartitionHasService(t, costandusagereportservice.ServiceName) - - // Since we are outside the scope of the Terraform configuration we must - // call Configure() to properly initialize the provider configuration. - testAccProviderCurConfigure.Do(func() { - var err error - testAccProviderCur, err = provider.New(ctx) - - if err != nil { - t.Fatal(err) - } - - config := map[string]interface{}{ - "region": testAccGetRegion(), - } - - diags := testAccProviderCur.Configure(ctx, terraform.NewResourceConfigRaw(config)) - - if diags != nil && diags.HasError() { - for _, d := range diags { - if d.Severity == diag.Error { - t.Fatalf("error configuring CUR provider: %s", d.Summary) - } - } - } - }) - - conn := testAccProviderCur.Meta().(*conns.AWSClient).CURConn() - - input := &costandusagereportservice.DescribeReportDefinitionsInput{ - MaxResults: aws.Int64(5), - } - - _, err := conn.DescribeReportDefinitionsWithContext(ctx, input) - - if acctest.PreCheckSkipError(err) || tfawserr.ErrMessageContains(err, "AccessDeniedException", "linked account is not allowed to modify report preference") { - t.Skipf("skipping acceptance testing: %s", err) - } - - if err != nil { - t.Fatalf("unexpected PreCheck error: %s", err) - } -} - -// testAccRegionProviderConfig is the Terraform provider configuration for Cost and Usage Reporting region testing -// -// Testing Cost and Usage Reporting assumes no other provider configurations -// are necessary and overwrites the "aws" provider configuration. -func testAccRegionProviderConfig() string { - return acctest.ConfigRegionalProvider(testAccGetRegion()) -} - -// testAccGetRegion returns the Cost and Usage Reporting region for testing -func testAccGetRegion() string { - if testAccCurRegion != "" { - return testAccCurRegion - } - - if rs, ok := endpoints.RegionsForService(endpoints.DefaultPartitions(), acctest.Partition(), costandusagereportservice.ServiceName); ok { - // return available region (random if multiple) - for regionID := range rs { - testAccCurRegion = regionID - return testAccCurRegion - } - } - - testAccCurRegion = acctest.Region() - - return testAccCurRegion -} diff --git a/internal/service/cur/report_definition_data_source_test.go b/internal/service/cur/report_definition_data_source_test.go index 68f09399f7a6..026148aa03e3 100644 --- a/internal/service/cur/report_definition_data_source_test.go +++ b/internal/service/cur/report_definition_data_source_test.go @@ -4,10 +4,10 @@ import ( "fmt" "testing" - "github.com/aws/aws-sdk-go/service/costandusagereportservice" + "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" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) @@ -20,15 +20,14 @@ func TestAccCURReportDefinitionDataSource_basic(t *testing.T) { bucketName := fmt.Sprintf("tf-test-bucket-%d", sdkacctest.RandInt()) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, - ErrorCheck: acctest.ErrorCheck(t, costandusagereportservice.EndpointsID), + PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckRegion(t, endpoints.UsEast1RegionID) }, + ErrorCheck: acctest.ErrorCheck(t, cur.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckReportDefinitionDestroy(ctx), Steps: []resource.TestStep{ { Config: testAccReportDefinitionDataSourceConfig_basic(reportName, bucketName), Check: resource.ComposeTestCheckFunc( - testAccReportDefinitionCheckExistsDataSource(datasourceName, resourceName), resource.TestCheckResourceAttrPair(datasourceName, "report_name", resourceName, "report_name"), resource.TestCheckResourceAttrPair(datasourceName, "time_unit", resourceName, "time_unit"), resource.TestCheckResourceAttrPair(datasourceName, "compression", resourceName, "compression"), @@ -52,15 +51,14 @@ func TestAccCURReportDefinitionDataSource_additional(t *testing.T) { bucketName := fmt.Sprintf("tf-test-bucket-%d", sdkacctest.RandInt()) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, - ErrorCheck: acctest.ErrorCheck(t, costandusagereportservice.EndpointsID), + PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckRegion(t, endpoints.UsEast1RegionID) }, + ErrorCheck: acctest.ErrorCheck(t, cur.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckReportDefinitionDestroy(ctx), Steps: []resource.TestStep{ { Config: testAccReportDefinitionDataSourceConfig_additional(reportName, bucketName), Check: resource.ComposeTestCheckFunc( - testAccReportDefinitionCheckExistsDataSource(datasourceName, resourceName), resource.TestCheckResourceAttrPair(datasourceName, "report_name", resourceName, "report_name"), resource.TestCheckResourceAttrPair(datasourceName, "time_unit", resourceName, "time_unit"), resource.TestCheckResourceAttrPair(datasourceName, "compression", resourceName, "compression"), @@ -77,24 +75,8 @@ func TestAccCURReportDefinitionDataSource_additional(t *testing.T) { }) } -func testAccReportDefinitionCheckExistsDataSource(datasourceName, resourceName string) resource.TestCheckFunc { - return func(s *terraform.State) error { - _, ok := s.RootModule().Resources[datasourceName] - if !ok { - return fmt.Errorf("root module has no data source called %s", datasourceName) - } - _, ok = s.RootModule().Resources[resourceName] - if !ok { - return fmt.Errorf("root module has no resource called %s", resourceName) - } - return nil - } -} - func testAccReportDefinitionDataSourceConfig_basic(reportName string, bucketName string) string { - return acctest.ConfigCompose( - testAccRegionProviderConfig(), - fmt.Sprintf(` + return fmt.Sprintf(` data "aws_billing_service_account" "test" {} data "aws_partition" "current" {} @@ -160,13 +142,11 @@ resource "aws_cur_report_definition" "test" { data "aws_cur_report_definition" "test" { report_name = aws_cur_report_definition.test.report_name } -`, reportName, bucketName)) +`, reportName, bucketName) } func testAccReportDefinitionDataSourceConfig_additional(reportName string, bucketName string) string { - return acctest.ConfigCompose( - testAccRegionProviderConfig(), - fmt.Sprintf(` + return fmt.Sprintf(` data "aws_billing_service_account" "test" {} data "aws_partition" "current" {} @@ -234,5 +214,5 @@ resource "aws_cur_report_definition" "test" { data "aws_cur_report_definition" "test" { report_name = aws_cur_report_definition.test.report_name } -`, reportName, bucketName)) +`, reportName, bucketName) } diff --git a/internal/service/cur/report_definition_test.go b/internal/service/cur/report_definition_test.go index 6ab21705b0af..92d0e7ece219 100644 --- a/internal/service/cur/report_definition_test.go +++ b/internal/service/cur/report_definition_test.go @@ -6,6 +6,7 @@ import ( "strings" "testing" + "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" @@ -23,7 +24,7 @@ func testAccReportDefinition_basic(t *testing.T) { bucketName := fmt.Sprintf("tf-test-bucket-%d", sdkacctest.RandInt()) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckRegion(t, endpoints.UsEast1RegionID) }, ErrorCheck: acctest.ErrorCheck(t, cur.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckReportDefinitionDestroy(ctx), @@ -83,7 +84,7 @@ func testAccReportDefinition_textOrCSV(t *testing.T) { reportVersioning := "CREATE_NEW_REPORT" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckRegion(t, endpoints.UsEast1RegionID) }, ErrorCheck: acctest.ErrorCheck(t, cur.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckReportDefinitionDestroy(ctx), @@ -128,7 +129,7 @@ func testAccReportDefinition_parquet(t *testing.T) { reportVersioning := "CREATE_NEW_REPORT" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckRegion(t, endpoints.UsEast1RegionID) }, ErrorCheck: acctest.ErrorCheck(t, cur.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckReportDefinitionDestroy(ctx), @@ -172,7 +173,7 @@ func testAccReportDefinition_athena(t *testing.T) { reportVersioning := "OVERWRITE_REPORT" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckRegion(t, endpoints.UsEast1RegionID) }, ErrorCheck: acctest.ErrorCheck(t, cur.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckReportDefinitionDestroy(ctx), @@ -217,7 +218,7 @@ func testAccReportDefinition_refresh(t *testing.T) { reportVersioning := "CREATE_NEW_REPORT" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckRegion(t, endpoints.UsEast1RegionID) }, ErrorCheck: acctest.ErrorCheck(t, cur.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckReportDefinitionDestroy(ctx), @@ -262,7 +263,7 @@ func testAccReportDefinition_overwrite(t *testing.T) { reportVersioning := "OVERWRITE_REPORT" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckRegion(t, endpoints.UsEast1RegionID) }, ErrorCheck: acctest.ErrorCheck(t, cur.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckReportDefinitionDestroy(ctx), @@ -300,7 +301,7 @@ func testAccReportDefinition_disappears(t *testing.T) { bucketName := fmt.Sprintf("tf-test-bucket-%d", sdkacctest.RandInt()) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckRegion(t, endpoints.UsEast1RegionID) }, ErrorCheck: acctest.ErrorCheck(t, cur.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckReportDefinitionDestroy(ctx), @@ -319,7 +320,7 @@ func testAccReportDefinition_disappears(t *testing.T) { func testAccCheckReportDefinitionDestroy(ctx context.Context) resource.TestCheckFunc { return func(s *terraform.State) error { - conn := testAccProviderCur.Meta().(*conns.AWSClient).CURConn() + conn := acctest.Provider.Meta().(*conns.AWSClient).CURConn() for _, rs := range s.RootModule().Resources { if rs.Type != "aws_cur_report_definition" { @@ -343,7 +344,7 @@ func testAccCheckReportDefinitionDestroy(ctx context.Context) resource.TestCheck func testAccCheckReportDefinitionExists(ctx context.Context, resourceName string) resource.TestCheckFunc { return func(s *terraform.State) error { - conn := testAccProviderCur.Meta().(*conns.AWSClient).CURConn() + conn := acctest.Provider.Meta().(*conns.AWSClient).CURConn() rs, ok := s.RootModule().Resources[resourceName] if !ok { @@ -364,9 +365,7 @@ func testAccCheckReportDefinitionExists(ctx context.Context, resourceName string } func testAccReportDefinitionConfig_basic(reportName, bucketName, prefix string) string { - return acctest.ConfigCompose( - testAccRegionProviderConfig(), - fmt.Sprintf(` + return fmt.Sprintf(` resource "aws_s3_bucket" "test" { bucket = %[2]q force_destroy = true @@ -426,7 +425,7 @@ resource "aws_cur_report_definition" "test" { s3_region = aws_s3_bucket.test.region additional_artifacts = ["REDSHIFT", "QUICKSIGHT"] } -`, reportName, bucketName, prefix)) +`, reportName, bucketName, prefix) } func testAccReportDefinitionConfig_additional(reportName string, bucketName string, bucketPrefix string, format string, compression string, additionalArtifacts []string, refreshClosedReports bool, reportVersioning string) string { @@ -438,9 +437,7 @@ func testAccReportDefinitionConfig_additional(reportName string, bucketName stri artifactsStr = "" } - return acctest.ConfigCompose( - testAccRegionProviderConfig(), - fmt.Sprintf(` + return fmt.Sprintf(` resource "aws_s3_bucket" "test" { bucket = "%[2]s" force_destroy = true @@ -502,7 +499,7 @@ resource "aws_cur_report_definition" "test" { refresh_closed_reports = %[7]t report_versioning = "%[8]s" } -`, reportName, bucketName, bucketPrefix, format, compression, artifactsStr, refreshClosedReports, reportVersioning)) +`, reportName, bucketName, bucketPrefix, format, compression, artifactsStr, refreshClosedReports, reportVersioning) } func TestCheckDefinitionPropertyCombination(t *testing.T) { From 56cce3c4354e919fd1e0aa54004174c469c485fe Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Sun, 12 Mar 2023 17:39:55 -0400 Subject: [PATCH 666/763] Pricing: Require 'us-east-1' or 'ap-south-1' for acceptance tests. --- internal/service/pricing/acc_test.go | 88 ------------------- .../pricing/product_data_source_test.go | 72 +++++++-------- 2 files changed, 31 insertions(+), 129 deletions(-) delete mode 100644 internal/service/pricing/acc_test.go diff --git a/internal/service/pricing/acc_test.go b/internal/service/pricing/acc_test.go deleted file mode 100644 index 679a9865e124..000000000000 --- a/internal/service/pricing/acc_test.go +++ /dev/null @@ -1,88 +0,0 @@ -package pricing_test - -import ( - "context" - "sync" - "testing" - - "github.com/aws/aws-sdk-go/aws/endpoints" - "github.com/aws/aws-sdk-go/service/pricing" - "github.com/hashicorp/terraform-plugin-sdk/v2/diag" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/hashicorp/terraform-provider-aws/internal/acctest" - "github.com/hashicorp/terraform-provider-aws/internal/provider" -) - -// testAccPricingRegion is the chosen Pricing testing region -// -// Cached to prevent issues should multiple regions become available. -var testAccPricingRegion string - -// testAccProviderPricing is the Pricing provider instance -// -// This Provider can be used in testing code for API calls without requiring -// the use of saving and referencing specific ProviderFactories instances. -// -// testAccPreCheck(t) must be called before using this provider instance. -var testAccProviderPricing *schema.Provider - -// testAccProviderPricingConfigure ensures the provider is only configured once -var testAccProviderPricingConfigure sync.Once - -// testAccPreCheck verifies AWS credentials and that Pricing is supported -func testAccPreCheck(ctx context.Context, t *testing.T) { - acctest.PreCheckPartitionHasService(t, pricing.EndpointsID) - - // Since we are outside the scope of the Terraform configuration we must - // call Configure() to properly initialize the provider configuration. - testAccProviderPricingConfigure.Do(func() { - var err error - testAccProviderPricing, err = provider.New(ctx) - - if err != nil { - t.Fatal(err) - } - - config := map[string]interface{}{ - "region": testAccGetRegion(), - } - - diags := testAccProviderPricing.Configure(ctx, terraform.NewResourceConfigRaw(config)) - - if diags != nil && diags.HasError() { - for _, d := range diags { - if d.Severity == diag.Error { - t.Fatalf("error configuring Pricing provider: %s", d.Summary) - } - } - } - }) -} - -// testAccRegionProviderConfig is the Terraform provider configuration for Pricing region testing -// -// Testing Pricing assumes no other provider configurations -// are necessary and overwrites the "aws" provider configuration. -func testAccRegionProviderConfig() string { - return acctest.ConfigRegionalProvider(testAccGetRegion()) -} - -// testAccGetRegion returns the Pricing region for testing -func testAccGetRegion() string { - if testAccPricingRegion != "" { - return testAccPricingRegion - } - - if rs, ok := endpoints.RegionsForService(endpoints.DefaultPartitions(), acctest.Partition(), pricing.ServiceName); ok { - // return available region (random if multiple) - for regionID := range rs { - testAccPricingRegion = regionID - return testAccPricingRegion - } - } - - testAccPricingRegion = acctest.Region() - - return testAccPricingRegion -} diff --git a/internal/service/pricing/product_data_source_test.go b/internal/service/pricing/product_data_source_test.go index 4704892f8d39..91a21a6e6b86 100644 --- a/internal/service/pricing/product_data_source_test.go +++ b/internal/service/pricing/product_data_source_test.go @@ -2,27 +2,31 @@ package pricing_test import ( "encoding/json" + "errors" "fmt" "testing" + "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-sdk/v2/terraform" "github.com/hashicorp/terraform-provider-aws/internal/acctest" ) func TestAccPricingProductDataSource_ec2(t *testing.T) { - ctx := acctest.Context(t) + dataSourceName := "data.aws_pricing_product.test" + resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { + acctest.PreCheck(t) + acctest.PreCheckRegion(t, endpoints.UsEast1RegionID, endpoints.ApSouth1RegionID) + }, ErrorCheck: acctest.ErrorCheck(t, pricing.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ { - Config: testAccProductDataSourceConfig_ec2(), + Config: testAccProductDataSourceConfig_ec2, Check: resource.ComposeAggregateTestCheckFunc( - resource.TestCheckResourceAttrSet("data.aws_pricing_product.test", "result"), - testAccCheckValueIsJSON("data.aws_pricing_product.test"), + resource.TestCheckResourceAttrWith(dataSourceName, "result", testAccCheckValueIsJSON), ), }, }, @@ -30,27 +34,27 @@ func TestAccPricingProductDataSource_ec2(t *testing.T) { } func TestAccPricingProductDataSource_redshift(t *testing.T) { - ctx := acctest.Context(t) + dataSourceName := "data.aws_pricing_product.test" + resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(t); testAccPreCheck(ctx, t) }, + PreCheck: func() { + acctest.PreCheck(t) + acctest.PreCheckRegion(t, endpoints.UsEast1RegionID, endpoints.ApSouth1RegionID) + }, ErrorCheck: acctest.ErrorCheck(t, pricing.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ { - Config: testAccProductDataSourceConfig_redshift(), + Config: testAccProductDataSourceConfig_redshift, Check: resource.ComposeAggregateTestCheckFunc( - resource.TestCheckResourceAttrSet("data.aws_pricing_product.test", "result"), - testAccCheckValueIsJSON("data.aws_pricing_product.test"), + resource.TestCheckResourceAttrWith(dataSourceName, "result", testAccCheckValueIsJSON), ), }, }, }) } -func testAccProductDataSourceConfig_ec2() string { - return acctest.ConfigCompose( - testAccRegionProviderConfig(), - ` +const testAccProductDataSourceConfig_ec2 = ` data "aws_ec2_instance_type_offering" "available" { preferred_instance_types = ["c5.large", "c4.large"] } @@ -95,13 +99,9 @@ data "aws_pricing_product" "test" { value = "Used" } } -`) -} +` -func testAccProductDataSourceConfig_redshift() string { - return acctest.ConfigCompose( - testAccRegionProviderConfig(), - ` +const testAccProductDataSourceConfig_redshift = ` data "aws_redshift_orderable_cluster" "test" { preferred_node_types = ["dc2.8xlarge", "ds2.8xlarge"] } @@ -126,28 +126,18 @@ data "aws_pricing_product" "test" { value = "Compute Instance" } } -`) -} +` -func testAccCheckValueIsJSON(data string) resource.TestCheckFunc { - return func(s *terraform.State) error { - rs, ok := s.RootModule().Resources[data] +func testAccCheckValueIsJSON(v string) error { + var m map[string]*json.RawMessage - if !ok { - return fmt.Errorf("Can't find resource: %s", data) - } - - result := rs.Primary.Attributes["result"] - var objmap map[string]*json.RawMessage - - if err := json.Unmarshal([]byte(result), &objmap); err != nil { - return fmt.Errorf("%s result value (%s) is not JSON: %s", data, result, err) - } - - if len(objmap) == 0 { - return fmt.Errorf("%s result value (%s) unmarshalling resulted in an empty map", data, result) - } + if err := json.Unmarshal([]byte(v), &m); err != nil { + return fmt.Errorf("parsing JSON: %s", err) + } - return nil + if len(m) == 0 { + return errors.New(`empty JSON`) } + + return nil } From d39eaa38f832fb1d79e29b58ffc0c5286afcd171 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Sun, 12 Mar 2023 17:45:42 -0400 Subject: [PATCH 667/763] Log supported Regions in 'acctest.PreCheckRegion'. --- internal/acctest/acctest.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/internal/acctest/acctest.go b/internal/acctest/acctest.go index 162144d1ebbd..9b548154f556 100644 --- a/internal/acctest/acctest.go +++ b/internal/acctest/acctest.go @@ -796,7 +796,7 @@ func PreCheckMultipleRegion(t *testing.T, regions int) { } if regions >= 3 { - if thirdRegionPartition() == "aws-us-gov" || Partition() == "aws-us-gov" { + if thirdRegionPartition() == endpoints.AwsUsGovPartitionID || Partition() == endpoints.AwsUsGovPartitionID { t.Skipf("wanted %d regions, partition (%s) only has 2 regions", regions, Partition()) } @@ -820,7 +820,7 @@ func PreCheckMultipleRegion(t *testing.T, regions int) { } } -// PreCheckRegion checks that the test region is one of the specified regions. +// PreCheckRegion checks that the test region is one of the specified AWS Regions. func PreCheckRegion(t *testing.T, regions ...string) { curr := Region() var regionOK bool @@ -833,11 +833,11 @@ func PreCheckRegion(t *testing.T, regions ...string) { } if !regionOK { - t.Skipf("skipping tests; %s (%s) not supported", envvar.DefaultRegion, curr) + t.Skipf("skipping tests; %s (%s) not supported. Supported: [%s]", envvar.DefaultRegion, curr, strings.Join(regions, ", ")) } } -// PreCheckRegionNot checks that the test region is not one of the specified regions. +// PreCheckRegionNot checks that the test region is not one of the specified AWS Regions. func PreCheckRegionNot(t *testing.T, regions ...string) { curr := Region() @@ -848,7 +848,7 @@ func PreCheckRegionNot(t *testing.T, regions ...string) { } } -// PreCheckAlternateRegionIs checks that the alternate test region is the specified region. +// PreCheckAlternateRegionIs checks that the alternate test region is the specified AWS Region. func PreCheckAlternateRegionIs(t *testing.T, region string) { if curr := AlternateRegion(); curr != region { t.Skipf("skipping tests; %s (%s) does not equal %s", envvar.AlternateRegion, curr, region) From 8ed39c6d4b9d69b07ddab34296638efa4f30d817 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Sun, 12 Mar 2023 17:56:42 -0400 Subject: [PATCH 668/763] Remove 'Service-Specific Region Acceptance Testing' section from contributor documentation. --- docs/running-and-writing-acceptance-tests.md | 117 +------------------ 1 file changed, 5 insertions(+), 112 deletions(-) diff --git a/docs/running-and-writing-acceptance-tests.md b/docs/running-and-writing-acceptance-tests.md index de8e58bd9a69..f840d1ca372f 100644 --- a/docs/running-and-writing-acceptance-tests.md +++ b/docs/running-and-writing-acceptance-tests.md @@ -571,6 +571,11 @@ If you add a new test that has preconditions which are checked by an existing pr These are some of the standard provider PreChecks: +* `acctest.PreCheckRegion(t *testing.T, regions ...string)` checks that the test region is one of the specified AWS Regions. +* `acctest.PreCheckRegionNot(t *testing.T, regions ...string)` checks that the test region is not one of the specified AWS Regions. +* `acctest.PreCheckAlternateRegionIs(t *testing.T, region string)` checks that the alternate test region is the specified AWS Region. +* `acctest.PreCheckPartition(t *testing.T, partition string)` checks that the test partition is the specified partition. +* `acctest.PreCheckPartitionNot(t *testing.T, partitions ...string)` checks that the test partition is not one of the specified partitions. * `acctest.PreCheckPartitionHasService(t *testing.T, serviceID string)` checks whether the current partition lists the service as part of its offerings. Note: AWS may not add new or public preview services to the service list immediately. This function will return a false positive in that case. * `acctest.PreCheckOrganizationsAccount(ctx context.Context, t *testing.T)` checks whether the current account can perform AWS Organizations tests. * `acctest.PreCheckAlternateAccount(t *testing.T)` checks whether the environment is set up for tests across accounts. @@ -953,118 +958,6 @@ resource "aws_example" "test" { Searching for usage of `acctest.PreCheckMultipleRegion` in the codebase will yield real world examples of this setup in action. -#### Service-Specific Region Acceptance Testing - -Certain AWS service APIs are only available in specific AWS regions. For example as of this writing, the `pricing` service is available in `ap-south-1` and `us-east-1`, but no other regions or partitions. When encountering these types of services, the acceptance testing can be setup to automatically detect the correct region(s), while skipping the testing in unsupported partitions. - -To prepare the shared service functionality, create a file named `internal/service/{SERVICE}/acc_test.go`. A starting example with the Pricing service (`internal/service/pricing/acc_test.go`): - -```go -package aws - -import ( - "context" - "sync" - "testing" - - "github.com/aws/aws-sdk-go/aws/endpoints" - "github.com/aws/aws-sdk-go/service/pricing" - "github.com/hashicorp/terraform-plugin-sdk/v2/diag" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "github.com/hashicorp/terraform-provider-aws/internal/acctest" - "github.com/hashicorp/terraform-provider-aws/internal/provider" -) - -// testAccPricingRegion is the chosen Pricing testing region -// -// Cached to prevent issues should multiple regions become available. -var testAccPricingRegion string - -// testAccProviderPricing is the Pricing provider instance -// -// This Provider can be used in testing code for API calls without requiring -// the use of saving and referencing specific ProviderFactories instances. -// -// testAccPreCheckPricing(t) must be called before using this provider instance. -var testAccProviderPricing *schema.Provider - -// testAccProviderPricingConfigure ensures the provider is only configured once -var testAccProviderPricingConfigure sync.Once - -// testAccPreCheckPricing verifies AWS credentials and that Pricing is supported -func testAccPreCheckPricing(t *testing.T) { - acctest.PreCheckPartitionHasService(t, pricing.EndpointsID) - - // Since we are outside the scope of the Terraform configuration we must - // call Configure() to properly initialize the provider configuration. - testAccProviderPricingConfigure.Do(func() { - testAccProviderPricing = provider.Provider() - - config := map[string]interface{}{ - "region": testAccGetPricingRegion(), - } - - diags := testAccProviderPricing.Configure(context.Background(), terraform.NewResourceConfigRaw(config)) - - if diags != nil && diags.HasError() { - for _, d := range diags { - if d.Severity == diag.Error { - t.Fatalf("configuring Pricing provider: %s", d.Summary) - } - } - } - }) -} - -// testAccPricingRegionProviderConfig is the Terraform provider configuration for Pricing region testing -// -// Testing Pricing assumes no other provider configurations -// are necessary and overwrites the "aws" provider configuration. -func testAccPricingRegionProviderConfig() string { - return acctest.ConfigRegionalProvider(testAccGetPricingRegion()) -} - -// testAccGetPricingRegion returns the Pricing region for testing -func testAccGetPricingRegion() string { - if testAccPricingRegion != "" { - return testAccPricingRegion - } - - if rs, ok := endpoints.RegionsForService(endpoints.DefaultPartitions(), testAccGetPartition(), pricing.ServiceName); ok { - // return available region (random if multiple) - for regionID := range rs { - testAccPricingRegion = regionID - return testAccPricingRegion - } - } - - testAccPricingRegion = testAccGetRegion() - - return testAccPricingRegion -} -``` - -For the resource or data source acceptance tests, the key items to adjust are: - -* Ensure `TestCase` uses `ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories` instead of `ProviderFactories: acctest.ProviderFactories` or `Providers: acctest.Providers` -* Add the call for the new `PreCheck` function (keeping `acctest.PreCheck(t)`), e.g. `PreCheck: func() { acctest.PreCheck(t); testAccPreCheckPricing(t) },` -* If the testing is for a managed resource with a `CheckDestroy` function, ensure it uses the new provider instance, e.g. `testAccProviderPricing`, instead of `acctest.Provider`. -* If the testing is for a managed resource with a `Check...Exists` function, ensure it uses the new provider instance, e.g. `testAccProviderPricing`, instead of `acctest.Provider`. -* In each `TestStep` configuration, ensure the new provider configuration function is called, e.g. - -```go -func testAccDataSourcePricingProductConfigRedshift() string { - return acctest.ConfigCompose( - testAccPricingRegionProviderConfig(), - ` -# ... test configuration ... -`) -} -``` - -If the testing configurations require more than one region, reach out to the maintainers for further assistance. - #### Acceptance Test Concurrency Certain AWS service APIs allow a limited number of a certain component, while the acceptance testing runs at a default concurrency of twenty tests at a time. For example as of this writing, the SageMaker service only allows one SageMaker Domain per AWS Region. Running the tests with the default concurrency will fail with API errors relating to the component quota being exceeded. From a13570feb0c74d36678beb29648fd6007806e2e1 Mon Sep 17 00:00:00 2001 From: Benny Lu Date: Sun, 12 Mar 2023 15:02:36 -0700 Subject: [PATCH 669/763] r/aws_fms_policy - add description --- internal/service/fms/policy.go | 25 ++++++++++++++++++------- internal/service/fms/policy_test.go | 2 ++ 2 files changed, 20 insertions(+), 7 deletions(-) diff --git a/internal/service/fms/policy.go b/internal/service/fms/policy.go index 3744ec8437cc..212af0dc7d36 100644 --- a/internal/service/fms/policy.go +++ b/internal/service/fms/policy.go @@ -50,6 +50,10 @@ func ResourcePolicy() *schema.Resource { Optional: true, Default: false, }, + "description": { + Type: schema.TypeString, + Optional: true, + }, "exclude_resource_tags": { Type: schema.TypeBool, Required: true, @@ -295,21 +299,26 @@ func FindPolicyByID(ctx context.Context, conn *fms.FMS, id string) (*fms.GetPoli func resourcePolicyFlattenPolicy(d *schema.ResourceData, resp *fms.GetPolicyOutput) error { d.Set("arn", resp.PolicyArn) - d.Set("name", resp.Policy.PolicyName) + d.Set("delete_unused_fm_managed_resources", resp.Policy.DeleteUnusedFMManagedResources) + d.Set("description", resp.Policy.PolicyDescription) d.Set("exclude_resource_tags", resp.Policy.ExcludeResourceTags) + d.Set("name", resp.Policy.PolicyName) + d.Set("policy_update_token", resp.Policy.PolicyUpdateToken) + d.Set("remediation_enabled", resp.Policy.RemediationEnabled) + d.Set("resource_type", resp.Policy.ResourceType) + if err := d.Set("exclude_map", flattenPolicyMap(resp.Policy.ExcludeMap)); err != nil { return fmt.Errorf("setting exclude_map: %w", err) } + if err := d.Set("include_map", flattenPolicyMap(resp.Policy.IncludeMap)); err != nil { return fmt.Errorf("setting include_map: %w", err) } - d.Set("remediation_enabled", resp.Policy.RemediationEnabled) + if err := d.Set("resource_type_list", resp.Policy.ResourceTypeList); err != nil { return fmt.Errorf("setting resource_type_list: %w", err) } - d.Set("delete_unused_fm_managed_resources", resp.Policy.DeleteUnusedFMManagedResources) - d.Set("resource_type", resp.Policy.ResourceType) - d.Set("policy_update_token", resp.Policy.PolicyUpdateToken) + if err := d.Set("resource_tags", flattenResourceTags(resp.Policy.ResourceTags)); err != nil { return fmt.Errorf("setting resource_tags: %w", err) } @@ -318,6 +327,7 @@ func resourcePolicyFlattenPolicy(d *schema.ResourceData, resp *fms.GetPolicyOutp "type": *resp.Policy.SecurityServicePolicyData.Type, "managed_service_data": *resp.Policy.SecurityServicePolicyData.ManagedServiceData, }} + if err := d.Set("security_service_policy_data", securityServicePolicy); err != nil { return fmt.Errorf("setting security_service_policy_data: %w", err) } @@ -333,12 +343,13 @@ func resourcePolicyExpandPolicy(d *schema.ResourceData) *fms.Policy { } fmsPolicy := &fms.Policy{ + DeleteUnusedFMManagedResources: aws.Bool(d.Get("delete_unused_fm_managed_resources").(bool)), + ExcludeResourceTags: aws.Bool(d.Get("exclude_resource_tags").(bool)), + PolicyDescription: aws.String(d.Get("description").(string)), PolicyName: aws.String(d.Get("name").(string)), RemediationEnabled: aws.Bool(d.Get("remediation_enabled").(bool)), ResourceType: resourceType, ResourceTypeList: resourceTypeList, - ExcludeResourceTags: aws.Bool(d.Get("exclude_resource_tags").(bool)), - DeleteUnusedFMManagedResources: aws.Bool(d.Get("delete_unused_fm_managed_resources").(bool)), } if d.Id() != "" { diff --git a/internal/service/fms/policy_test.go b/internal/service/fms/policy_test.go index 0ac28906d471..07442cd91197 100644 --- a/internal/service/fms/policy_test.go +++ b/internal/service/fms/policy_test.go @@ -37,6 +37,7 @@ func testAccPolicy_basic(t *testing.T) { testAccCheckPolicyExists(ctx, resourceName), acctest.CheckResourceAttrRegionalARNIgnoreRegionAndAccount(resourceName, "arn", "fms", "policy/.+"), resource.TestCheckResourceAttr(resourceName, "delete_unused_fm_managed_resources", "false"), + resource.TestCheckResourceAttr(resourceName, "description", "test description"), resource.TestCheckResourceAttr(resourceName, "name", rName), resource.TestCheckResourceAttr(resourceName, "security_service_policy_data.#", "1"), resource.TestCheckResourceAttr(resourceName, "tags.%", "0"), @@ -284,6 +285,7 @@ func testAccPolicyConfig_basic(policyName, ruleGroupName string) string { resource "aws_fms_policy" "test" { exclude_resource_tags = false name = %[1]q + description = "test description" remediation_enabled = false resource_type_list = ["AWS::ElasticLoadBalancingV2::LoadBalancer"] From 2a9c13bbce9f2fbcf27302b07c54a9d9a06fc81e Mon Sep 17 00:00:00 2001 From: Benny Lu Date: Sun, 12 Mar 2023 15:27:04 -0700 Subject: [PATCH 670/763] docs --- website/docs/r/fms_policy.html.markdown | 1 + 1 file changed, 1 insertion(+) diff --git a/website/docs/r/fms_policy.html.markdown b/website/docs/r/fms_policy.html.markdown index 5421ed917b8a..697bb9782c9e 100644 --- a/website/docs/r/fms_policy.html.markdown +++ b/website/docs/r/fms_policy.html.markdown @@ -55,6 +55,7 @@ The following arguments are supported: * `name` - (Required, Forces new resource) The friendly name of the AWS Firewall Manager Policy. * `delete_all_policy_resources` - (Optional) If true, the request will also perform a clean-up process. Defaults to `true`. More information can be found here [AWS Firewall Manager delete policy](https://docs.aws.amazon.com/fms/2018-01-01/APIReference/API_DeletePolicy.html) * `delete_unused_fm_managed_resources` - (Optional) If true, Firewall Manager will automatically remove protections from resources that leave the policy scope. Defaults to `false`. More information can be found here [AWS Firewall Manager policy contents](https://docs.aws.amazon.com/fms/2018-01-01/APIReference/API_Policy.html) +* `description` - (Optional) The definition of the AWS Network Firewall firewall policy. * `exclude_map` - (Optional) A map of lists of accounts and OU's to exclude from the policy. * `exclude_resource_tags` - (Required, Forces new resource) A boolean value, if true the tags that are specified in the `resource_tags` are not protected by this policy. If set to false and resource_tags are populated, resources that contain tags will be protected by this policy. * `include_map` - (Optional) A map of lists of accounts and OU's to include in the policy. From 12406b720d513cddda2de925a8a05816cc5458a2 Mon Sep 17 00:00:00 2001 From: Benny Lu Date: Sun, 12 Mar 2023 15:32:17 -0700 Subject: [PATCH 671/763] changelog --- .changelog/29926.txt | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 .changelog/29926.txt diff --git a/.changelog/29926.txt b/.changelog/29926.txt new file mode 100644 index 000000000000..77b0096725c5 --- /dev/null +++ b/.changelog/29926.txt @@ -0,0 +1,3 @@ +```release-note:enhancement +resource/aws_fms_policy: Add `description` argument +``` From 096746e94a391db798a5ecace749a8a5ec054dae Mon Sep 17 00:00:00 2001 From: Benny Lu Date: Sun, 12 Mar 2023 15:35:03 -0700 Subject: [PATCH 672/763] lint --- internal/service/fms/policy_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/service/fms/policy_test.go b/internal/service/fms/policy_test.go index 07442cd91197..598e47c72670 100644 --- a/internal/service/fms/policy_test.go +++ b/internal/service/fms/policy_test.go @@ -285,7 +285,7 @@ func testAccPolicyConfig_basic(policyName, ruleGroupName string) string { resource "aws_fms_policy" "test" { exclude_resource_tags = false name = %[1]q - description = "test description" + description = "test description" remediation_enabled = false resource_type_list = ["AWS::ElasticLoadBalancingV2::LoadBalancer"] From 88003154e71e24f9410ddb54b61812811840b84e Mon Sep 17 00:00:00 2001 From: Benny Lu Date: Sun, 12 Mar 2023 15:45:52 -0700 Subject: [PATCH 673/763] aws_ssoadmin_account_assignment - update example --- website/docs/r/ssoadmin_account_assignment.html.markdown | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/website/docs/r/ssoadmin_account_assignment.html.markdown b/website/docs/r/ssoadmin_account_assignment.html.markdown index c00e3b070296..4afd4e53ab92 100644 --- a/website/docs/r/ssoadmin_account_assignment.html.markdown +++ b/website/docs/r/ssoadmin_account_assignment.html.markdown @@ -23,9 +23,11 @@ data "aws_ssoadmin_permission_set" "example" { data "aws_identitystore_group" "example" { identity_store_id = tolist(data.aws_ssoadmin_instances.example.identity_store_ids)[0] - filter { - attribute_path = "DisplayName" - attribute_value = "ExampleGroup" + alternate_identifier { + unique_attribute { + attribute_path = "DisplayName" + attribute_value = "ExampleGroup" + } } } From 13fdcb36df712e866d4025b54f5b198b0bc9e8c8 Mon Sep 17 00:00:00 2001 From: Benny Lu Date: Sun, 12 Mar 2023 16:04:03 -0700 Subject: [PATCH 674/763] aws_batch_job_definition - fix example --- website/docs/r/batch_job_definition.html.markdown | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/website/docs/r/batch_job_definition.html.markdown b/website/docs/r/batch_job_definition.html.markdown index 048a7e1b165e..a90fae5609c2 100644 --- a/website/docs/r/batch_job_definition.html.markdown +++ b/website/docs/r/batch_job_definition.html.markdown @@ -99,8 +99,9 @@ resource "aws_batch_job_definition" "test" { ] container_properties = jsonencode({ - command = ["echo", "test"] - image = "busybox" + command = ["echo", "test"] + image = "busybox" + jobRoleArn = "arn:aws:iam::123456789012:role/AWSBatchS3ReadOnly" fargatePlatformConfiguration = { platformVersion = "LATEST" From 9932b8e7a68dce07c9aa6b237385cebbe89f2ee4 Mon Sep 17 00:00:00 2001 From: Benny Lu Date: Sun, 12 Mar 2023 19:28:46 -0700 Subject: [PATCH 675/763] description --- website/docs/r/fms_policy.html.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/website/docs/r/fms_policy.html.markdown b/website/docs/r/fms_policy.html.markdown index 697bb9782c9e..34f910c8508a 100644 --- a/website/docs/r/fms_policy.html.markdown +++ b/website/docs/r/fms_policy.html.markdown @@ -55,7 +55,7 @@ The following arguments are supported: * `name` - (Required, Forces new resource) The friendly name of the AWS Firewall Manager Policy. * `delete_all_policy_resources` - (Optional) If true, the request will also perform a clean-up process. Defaults to `true`. More information can be found here [AWS Firewall Manager delete policy](https://docs.aws.amazon.com/fms/2018-01-01/APIReference/API_DeletePolicy.html) * `delete_unused_fm_managed_resources` - (Optional) If true, Firewall Manager will automatically remove protections from resources that leave the policy scope. Defaults to `false`. More information can be found here [AWS Firewall Manager policy contents](https://docs.aws.amazon.com/fms/2018-01-01/APIReference/API_Policy.html) -* `description` - (Optional) The definition of the AWS Network Firewall firewall policy. +* `description` - (Optional) The description of the AWS Network Firewall firewall policy. * `exclude_map` - (Optional) A map of lists of accounts and OU's to exclude from the policy. * `exclude_resource_tags` - (Required, Forces new resource) A boolean value, if true the tags that are specified in the `resource_tags` are not protected by this policy. If set to false and resource_tags are populated, resources that contain tags will be protected by this policy. * `include_map` - (Optional) A map of lists of accounts and OU's to include in the policy. From 8c76f6a60febbd1bef915cfac3b813111a5c405b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 13 Mar 2023 07:09:55 +0000 Subject: [PATCH 676/763] build(deps): bump github.com/aws/aws-sdk-go-v2/service/scheduler Bumps [github.com/aws/aws-sdk-go-v2/service/scheduler](https://github.com/aws/aws-sdk-go-v2) from 1.1.4 to 1.1.5. - [Release notes](https://github.com/aws/aws-sdk-go-v2/releases) - [Changelog](https://github.com/aws/aws-sdk-go-v2/blob/main/CHANGELOG.md) - [Commits](https://github.com/aws/aws-sdk-go-v2/compare/config/v1.1.4...config/v1.1.5) --- updated-dependencies: - dependency-name: github.com/aws/aws-sdk-go-v2/service/scheduler dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- go.mod | 8 ++++---- go.sum | 13 ++++++++----- 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/go.mod b/go.mod index 5705163eb1cf..f307e84555b7 100644 --- a/go.mod +++ b/go.mod @@ -5,7 +5,7 @@ go 1.19 require ( github.com/ProtonMail/go-crypto v0.0.0-20230201104953-d1d05f4e2bfb github.com/aws/aws-sdk-go v1.44.218 - github.com/aws/aws-sdk-go-v2 v1.17.5 + github.com/aws/aws-sdk-go-v2 v1.17.6 github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.12.23 github.com/aws/aws-sdk-go-v2/service/auditmanager v1.24.1 github.com/aws/aws-sdk-go-v2/service/cloudcontrol v1.11.5 @@ -29,7 +29,7 @@ require ( github.com/aws/aws-sdk-go-v2/service/rolesanywhere v1.1.5 github.com/aws/aws-sdk-go-v2/service/route53domains v1.14.4 github.com/aws/aws-sdk-go-v2/service/s3control v1.29.4 - github.com/aws/aws-sdk-go-v2/service/scheduler v1.1.4 + github.com/aws/aws-sdk-go-v2/service/scheduler v1.1.5 github.com/aws/aws-sdk-go-v2/service/sesv2 v1.17.0 github.com/aws/aws-sdk-go-v2/service/ssm v1.35.5 github.com/aws/aws-sdk-go-v2/service/ssmcontacts v1.14.4 @@ -80,8 +80,8 @@ require ( github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310 // indirect github.com/aws/aws-sdk-go-v2/config v1.18.12 // indirect github.com/aws/aws-sdk-go-v2/credentials v1.13.12 // indirect - github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.29 // indirect - github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.23 // indirect + github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.30 // indirect + github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.24 // indirect github.com/aws/aws-sdk-go-v2/internal/ini v1.3.29 // indirect github.com/aws/aws-sdk-go-v2/service/iam v1.19.4 // indirect github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.9.23 // indirect diff --git a/go.sum b/go.sum index 54246b612cc0..170cbcb475e4 100644 --- a/go.sum +++ b/go.sum @@ -26,8 +26,9 @@ github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5/go.mod h1:wHh0iHkY github.com/aws/aws-sdk-go v1.44.218 h1:p707+xOCazWhkSpZOeyhtTcg7Z+asxxvueGgYPSitn4= github.com/aws/aws-sdk-go v1.44.218/go.mod h1:aVsgQcEevwlmQ7qHE9I3h+dtQgpqhFB+i8Phjh7fkwI= github.com/aws/aws-sdk-go-v2 v1.17.4/go.mod h1:uzbQtefpm44goOPmdKyAlXSNcwlRgF3ePWVW6EtJvvw= -github.com/aws/aws-sdk-go-v2 v1.17.5 h1:TzCUW1Nq4H8Xscph5M/skINUitxM5UBAyvm2s7XBzL4= github.com/aws/aws-sdk-go-v2 v1.17.5/go.mod h1:uzbQtefpm44goOPmdKyAlXSNcwlRgF3ePWVW6EtJvvw= +github.com/aws/aws-sdk-go-v2 v1.17.6 h1:Y773UK7OBqhzi5VDXMi1zVGsoj+CVHs2eaC2bDsLwi0= +github.com/aws/aws-sdk-go-v2 v1.17.6/go.mod h1:uzbQtefpm44goOPmdKyAlXSNcwlRgF3ePWVW6EtJvvw= github.com/aws/aws-sdk-go-v2/config v1.18.12 h1:fKs/I4wccmfrNRO9rdrbMO1NgLxct6H9rNMiPdBxHWw= github.com/aws/aws-sdk-go-v2/config v1.18.12/go.mod h1:J36fOhj1LQBr+O4hJCiT8FwVvieeoSGOtPuvhKlsNu8= github.com/aws/aws-sdk-go-v2/credentials v1.13.12 h1:Cb+HhuEnV19zHRaYYVglwvdHGMJWbdsyP4oHhw04xws= @@ -36,11 +37,13 @@ github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.12.22/go.mod h1:YGSIJyQ6D6FjKMQ github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.12.23 h1:Kbiv9PGnQfG/imNI4L/heyUXvzKmcWSBeDvkrQz5pFc= github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.12.23/go.mod h1:mOtmAg65GT1HIL/HT/PynwPbS+UG0BgCZ6vhkPqnxWo= github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.28/go.mod h1:3lwChorpIM/BhImY/hy+Z6jekmN92cXGPI1QJasVPYY= -github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.29 h1:9/aKwwus0TQxppPXFmf010DFrE+ssSbzroLVYINA+xE= github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.29/go.mod h1:Dip3sIGv485+xerzVv24emnjX5Sg88utCL8fwGmCeWg= +github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.30 h1:y+8n9AGDjikyXoMBTRaHHHSaFEB8267ykmvyPodJfys= +github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.30/go.mod h1:LUBAO3zNXQjoONBKn/kR1y0Q4cj/D02Ts0uHYjcCQLM= github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.22/go.mod h1:EqK7gVrIGAHyZItrD1D8B0ilgwMD1GiWAmbU4u/JHNk= -github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.23 h1:b/Vn141DBuLVgXbhRWIrl9g+ww7G+ScV5SzniWR13jQ= github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.23/go.mod h1:mr6c4cHC+S/MMkrjtSlG4QA36kOznDep+0fga5L/fGQ= +github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.24 h1:r+Kv+SEJquhAZXaJ7G4u44cIwXV3f8K+N482NNAzJZA= +github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.24/go.mod h1:gAuCezX/gob6BSMbItsSlMb6WZGV7K2+fWOvk8xBSto= github.com/aws/aws-sdk-go-v2/internal/ini v1.3.29 h1:J4xhFd6zHhdF9jPP0FQJ6WknzBboGMBNjKOv4iTuw4A= github.com/aws/aws-sdk-go-v2/internal/ini v1.3.29/go.mod h1:TwuqRBGzxjQJIwH16/fOZodwXt2Zxa9/cwJC5ke4j7s= github.com/aws/aws-sdk-go-v2/service/auditmanager v1.24.1 h1:lU4z86semH3yi8zMkYq/DXccjRMCjkSN/eZRmNAGOU0= @@ -94,8 +97,8 @@ github.com/aws/aws-sdk-go-v2/service/route53domains v1.14.4 h1:/1qBMwOZb/2ua5jFM github.com/aws/aws-sdk-go-v2/service/route53domains v1.14.4/go.mod h1:MSwXvIWYZIBgC1otPRfafXbiOIdihO36INeOhqCciao= github.com/aws/aws-sdk-go-v2/service/s3control v1.29.4 h1:2FnFwA3DaXibWS3gMk9/hfJL3oNU+jIWsgytn5X2aFQ= github.com/aws/aws-sdk-go-v2/service/s3control v1.29.4/go.mod h1:7N/XbfABmShA4NEeFRhn9itmFk/E3DZ9im/+1++XnCY= -github.com/aws/aws-sdk-go-v2/service/scheduler v1.1.4 h1:LfCy6abbOMk2O6OdxFiMvySEMMYXyA4wLTZZzoyDU14= -github.com/aws/aws-sdk-go-v2/service/scheduler v1.1.4/go.mod h1:l7ebY4UfyEXzsM+yh74U1yTsZ4c8OZZd8de4aY0G19U= +github.com/aws/aws-sdk-go-v2/service/scheduler v1.1.5 h1:c4H0lPUXeo9XlMQ9fSskG8yYscq8/HNINnN3NlpQ2wI= +github.com/aws/aws-sdk-go-v2/service/scheduler v1.1.5/go.mod h1:GNtZoju1It1f7xOjYzIu2dUEdd7sP75+boLldkGu4A4= github.com/aws/aws-sdk-go-v2/service/sesv2 v1.17.0 h1:0HyUGJ3DCaXmOPFkCYhvi8aDA4WOsZ42mq4GnTGSlmA= github.com/aws/aws-sdk-go-v2/service/sesv2 v1.17.0/go.mod h1:uIM2GAheOB6xz7UuG5By72Zw2B/20fViFsbDY1JVTVY= github.com/aws/aws-sdk-go-v2/service/ssm v1.35.5 h1:x7FjoHx8A559fAHi0WMnrVxxk9iXwyj1UK5S7TrqFAM= From e7a0790ce748c69e55c7674104d970a029669736 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 13 Mar 2023 06:58:36 +0000 Subject: [PATCH 677/763] build(deps): bump github.com/aws/aws-sdk-go-v2/service/ssmcontacts Bumps [github.com/aws/aws-sdk-go-v2/service/ssmcontacts](https://github.com/aws/aws-sdk-go-v2) from 1.14.4 to 1.14.5. - [Release notes](https://github.com/aws/aws-sdk-go-v2/releases) - [Changelog](https://github.com/aws/aws-sdk-go-v2/blob/main/CHANGELOG.md) - [Commits](https://github.com/aws/aws-sdk-go-v2/compare/service/mq/v1.14.4...service/mq/v1.14.5) --- updated-dependencies: - dependency-name: github.com/aws/aws-sdk-go-v2/service/ssmcontacts dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- go.mod | 8 ++++---- go.sum | 13 ++++++++----- 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/go.mod b/go.mod index 5705163eb1cf..47ecc5de46d4 100644 --- a/go.mod +++ b/go.mod @@ -5,7 +5,7 @@ go 1.19 require ( github.com/ProtonMail/go-crypto v0.0.0-20230201104953-d1d05f4e2bfb github.com/aws/aws-sdk-go v1.44.218 - github.com/aws/aws-sdk-go-v2 v1.17.5 + github.com/aws/aws-sdk-go-v2 v1.17.6 github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.12.23 github.com/aws/aws-sdk-go-v2/service/auditmanager v1.24.1 github.com/aws/aws-sdk-go-v2/service/cloudcontrol v1.11.5 @@ -32,7 +32,7 @@ require ( github.com/aws/aws-sdk-go-v2/service/scheduler v1.1.4 github.com/aws/aws-sdk-go-v2/service/sesv2 v1.17.0 github.com/aws/aws-sdk-go-v2/service/ssm v1.35.5 - github.com/aws/aws-sdk-go-v2/service/ssmcontacts v1.14.4 + github.com/aws/aws-sdk-go-v2/service/ssmcontacts v1.14.5 github.com/aws/aws-sdk-go-v2/service/ssmincidents v1.20.4 github.com/aws/aws-sdk-go-v2/service/transcribe v1.26.0 github.com/aws/smithy-go v1.13.5 @@ -80,8 +80,8 @@ require ( github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310 // indirect github.com/aws/aws-sdk-go-v2/config v1.18.12 // indirect github.com/aws/aws-sdk-go-v2/credentials v1.13.12 // indirect - github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.29 // indirect - github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.23 // indirect + github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.30 // indirect + github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.24 // indirect github.com/aws/aws-sdk-go-v2/internal/ini v1.3.29 // indirect github.com/aws/aws-sdk-go-v2/service/iam v1.19.4 // indirect github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.9.23 // indirect diff --git a/go.sum b/go.sum index 54246b612cc0..4ac7686ba6d2 100644 --- a/go.sum +++ b/go.sum @@ -26,8 +26,9 @@ github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5/go.mod h1:wHh0iHkY github.com/aws/aws-sdk-go v1.44.218 h1:p707+xOCazWhkSpZOeyhtTcg7Z+asxxvueGgYPSitn4= github.com/aws/aws-sdk-go v1.44.218/go.mod h1:aVsgQcEevwlmQ7qHE9I3h+dtQgpqhFB+i8Phjh7fkwI= github.com/aws/aws-sdk-go-v2 v1.17.4/go.mod h1:uzbQtefpm44goOPmdKyAlXSNcwlRgF3ePWVW6EtJvvw= -github.com/aws/aws-sdk-go-v2 v1.17.5 h1:TzCUW1Nq4H8Xscph5M/skINUitxM5UBAyvm2s7XBzL4= github.com/aws/aws-sdk-go-v2 v1.17.5/go.mod h1:uzbQtefpm44goOPmdKyAlXSNcwlRgF3ePWVW6EtJvvw= +github.com/aws/aws-sdk-go-v2 v1.17.6 h1:Y773UK7OBqhzi5VDXMi1zVGsoj+CVHs2eaC2bDsLwi0= +github.com/aws/aws-sdk-go-v2 v1.17.6/go.mod h1:uzbQtefpm44goOPmdKyAlXSNcwlRgF3ePWVW6EtJvvw= github.com/aws/aws-sdk-go-v2/config v1.18.12 h1:fKs/I4wccmfrNRO9rdrbMO1NgLxct6H9rNMiPdBxHWw= github.com/aws/aws-sdk-go-v2/config v1.18.12/go.mod h1:J36fOhj1LQBr+O4hJCiT8FwVvieeoSGOtPuvhKlsNu8= github.com/aws/aws-sdk-go-v2/credentials v1.13.12 h1:Cb+HhuEnV19zHRaYYVglwvdHGMJWbdsyP4oHhw04xws= @@ -36,11 +37,13 @@ github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.12.22/go.mod h1:YGSIJyQ6D6FjKMQ github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.12.23 h1:Kbiv9PGnQfG/imNI4L/heyUXvzKmcWSBeDvkrQz5pFc= github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.12.23/go.mod h1:mOtmAg65GT1HIL/HT/PynwPbS+UG0BgCZ6vhkPqnxWo= github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.28/go.mod h1:3lwChorpIM/BhImY/hy+Z6jekmN92cXGPI1QJasVPYY= -github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.29 h1:9/aKwwus0TQxppPXFmf010DFrE+ssSbzroLVYINA+xE= github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.29/go.mod h1:Dip3sIGv485+xerzVv24emnjX5Sg88utCL8fwGmCeWg= +github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.30 h1:y+8n9AGDjikyXoMBTRaHHHSaFEB8267ykmvyPodJfys= +github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.30/go.mod h1:LUBAO3zNXQjoONBKn/kR1y0Q4cj/D02Ts0uHYjcCQLM= github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.22/go.mod h1:EqK7gVrIGAHyZItrD1D8B0ilgwMD1GiWAmbU4u/JHNk= -github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.23 h1:b/Vn141DBuLVgXbhRWIrl9g+ww7G+ScV5SzniWR13jQ= github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.23/go.mod h1:mr6c4cHC+S/MMkrjtSlG4QA36kOznDep+0fga5L/fGQ= +github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.24 h1:r+Kv+SEJquhAZXaJ7G4u44cIwXV3f8K+N482NNAzJZA= +github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.24/go.mod h1:gAuCezX/gob6BSMbItsSlMb6WZGV7K2+fWOvk8xBSto= github.com/aws/aws-sdk-go-v2/internal/ini v1.3.29 h1:J4xhFd6zHhdF9jPP0FQJ6WknzBboGMBNjKOv4iTuw4A= github.com/aws/aws-sdk-go-v2/internal/ini v1.3.29/go.mod h1:TwuqRBGzxjQJIwH16/fOZodwXt2Zxa9/cwJC5ke4j7s= github.com/aws/aws-sdk-go-v2/service/auditmanager v1.24.1 h1:lU4z86semH3yi8zMkYq/DXccjRMCjkSN/eZRmNAGOU0= @@ -100,8 +103,8 @@ github.com/aws/aws-sdk-go-v2/service/sesv2 v1.17.0 h1:0HyUGJ3DCaXmOPFkCYhvi8aDA4 github.com/aws/aws-sdk-go-v2/service/sesv2 v1.17.0/go.mod h1:uIM2GAheOB6xz7UuG5By72Zw2B/20fViFsbDY1JVTVY= github.com/aws/aws-sdk-go-v2/service/ssm v1.35.5 h1:x7FjoHx8A559fAHi0WMnrVxxk9iXwyj1UK5S7TrqFAM= github.com/aws/aws-sdk-go-v2/service/ssm v1.35.5/go.mod h1:DlzAqaXaUSJVQGuZrGPb4TWTkDG6vUs5OiIoX0AxjkU= -github.com/aws/aws-sdk-go-v2/service/ssmcontacts v1.14.4 h1:IzV/IHEKeM0taWRbFuHU8onhj7R088VzYau7Ka2jDsw= -github.com/aws/aws-sdk-go-v2/service/ssmcontacts v1.14.4/go.mod h1:t9IGXyK+eDt/FSGD2mLQgNS5nK1J+37r0d7jI4d8hqs= +github.com/aws/aws-sdk-go-v2/service/ssmcontacts v1.14.5 h1:cMy9iY65vX8QOd2BYJo85IFjPqFvpIiM7Jow5pbLefw= +github.com/aws/aws-sdk-go-v2/service/ssmcontacts v1.14.5/go.mod h1:bP0RQ1FZXmrFeOoiq6Uv4UYgkLLcJuDlPkzoob0WlbI= github.com/aws/aws-sdk-go-v2/service/ssmincidents v1.20.4 h1:gglh7K4VN15y6ENH2wM16TO6E0MgiLtKh2CCSHkCQuM= github.com/aws/aws-sdk-go-v2/service/ssmincidents v1.20.4/go.mod h1:hYnjkk6Qz1eI1aXZVWXdmcyb3HGK1sPAFM8efXREt5Q= github.com/aws/aws-sdk-go-v2/service/sso v1.12.1/go.mod h1:IgV8l3sj22nQDd5qcAGY0WenwCzCphqdbFOpfktZPrI= From 32caeca061da8df320a35a54a790a5968ccc1cd0 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 13 Mar 2023 07:00:18 +0000 Subject: [PATCH 678/763] build(deps): bump github.com/aws/aws-sdk-go-v2/service/inspector2 Bumps [github.com/aws/aws-sdk-go-v2/service/inspector2](https://github.com/aws/aws-sdk-go-v2) from 1.11.5 to 1.11.6. - [Release notes](https://github.com/aws/aws-sdk-go-v2/releases) - [Changelog](https://github.com/aws/aws-sdk-go-v2/blob/main/CHANGELOG.md) - [Commits](https://github.com/aws/aws-sdk-go-v2/compare/service/dax/v1.11.5...service/dax/v1.11.6) --- updated-dependencies: - dependency-name: github.com/aws/aws-sdk-go-v2/service/inspector2 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 47ecc5de46d4..dae5a17eabb2 100644 --- a/go.mod +++ b/go.mod @@ -16,7 +16,7 @@ require ( github.com/aws/aws-sdk-go-v2/service/fis v1.14.4 github.com/aws/aws-sdk-go-v2/service/healthlake v1.15.4 github.com/aws/aws-sdk-go-v2/service/identitystore v1.16.4 - github.com/aws/aws-sdk-go-v2/service/inspector2 v1.11.5 + github.com/aws/aws-sdk-go-v2/service/inspector2 v1.11.6 github.com/aws/aws-sdk-go-v2/service/ivschat v1.3.4 github.com/aws/aws-sdk-go-v2/service/kendra v1.38.5 github.com/aws/aws-sdk-go-v2/service/lambda v1.30.0 diff --git a/go.sum b/go.sum index 4ac7686ba6d2..54b98f334396 100644 --- a/go.sum +++ b/go.sum @@ -66,8 +66,8 @@ github.com/aws/aws-sdk-go-v2/service/iam v1.19.4 h1:hrBxgoUih7uy9sJTXrX0N/3TVgbm github.com/aws/aws-sdk-go-v2/service/iam v1.19.4/go.mod h1:F5Xt96+AfAiyMpRXHy9CKafE/KULVwj7MwgZ0a4row4= github.com/aws/aws-sdk-go-v2/service/identitystore v1.16.4 h1:WmE4yfzKZBgSLdLOG8/pWekHSskhXNX+7HXeWire/II= github.com/aws/aws-sdk-go-v2/service/identitystore v1.16.4/go.mod h1:b/31AIODyxR/m34zRvUXs/mjF7pLAwS6IHIfl0kdRYc= -github.com/aws/aws-sdk-go-v2/service/inspector2 v1.11.5 h1:QAQmyUAqBtq72FBJD5efZbiPej3+tpesSSknvYJDr1M= -github.com/aws/aws-sdk-go-v2/service/inspector2 v1.11.5/go.mod h1:XsERJJVZCcUOrsHAeDy73b++Yvx8K7gdi+gEMYUeNr0= +github.com/aws/aws-sdk-go-v2/service/inspector2 v1.11.6 h1:LtoRGfh9b+aLxVSgVSjXAmPePYGvbzVTfcXdopKokuI= +github.com/aws/aws-sdk-go-v2/service/inspector2 v1.11.6/go.mod h1:w5tN/JjIMU0RycBR1oQ46dhIq8eWpCR1Ggp0y6zPuZE= github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.9.22/go.mod h1:xt0Au8yPIwYXf/GYPy/vl4K3CgwhfQMYbrH7DlUUIws= github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.9.23 h1:QoOybhwRfciWUBbZ0gp9S7XaDnCuSTeK/fySB99V1ls= github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.9.23/go.mod h1:9uPh+Hrz2Vn6oMnQYiUi/zbh3ovbnQk19YKINkQny44= From 530d2bac63bf4d85d54faa3f85223fdfc3c832e4 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 13 Mar 2023 07:01:50 +0000 Subject: [PATCH 679/763] build(deps): bump github.com/aws/aws-sdk-go-v2/service/pipes Bumps [github.com/aws/aws-sdk-go-v2/service/pipes](https://github.com/aws/aws-sdk-go-v2) from 1.2.0 to 1.2.1. - [Release notes](https://github.com/aws/aws-sdk-go-v2/releases) - [Changelog](https://github.com/aws/aws-sdk-go-v2/blob/main/CHANGELOG.md) - [Commits](https://github.com/aws/aws-sdk-go-v2/compare/v1.2.0...v1.2.1) --- updated-dependencies: - dependency-name: github.com/aws/aws-sdk-go-v2/service/pipes dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index dae5a17eabb2..86dfa5fd2588 100644 --- a/go.mod +++ b/go.mod @@ -23,7 +23,7 @@ require ( github.com/aws/aws-sdk-go-v2/service/medialive v1.30.0 github.com/aws/aws-sdk-go-v2/service/oam v1.1.5 github.com/aws/aws-sdk-go-v2/service/opensearchserverless v1.1.5 - github.com/aws/aws-sdk-go-v2/service/pipes v1.2.0 + github.com/aws/aws-sdk-go-v2/service/pipes v1.2.1 github.com/aws/aws-sdk-go-v2/service/rds v1.40.5 github.com/aws/aws-sdk-go-v2/service/resourceexplorer2 v1.2.5 github.com/aws/aws-sdk-go-v2/service/rolesanywhere v1.1.5 diff --git a/go.sum b/go.sum index 54b98f334396..95eb2639721e 100644 --- a/go.sum +++ b/go.sum @@ -85,8 +85,8 @@ github.com/aws/aws-sdk-go-v2/service/oam v1.1.5 h1:b4IaVHpAfwj2cOmTUgoIFTjLjTuC1 github.com/aws/aws-sdk-go-v2/service/oam v1.1.5/go.mod h1:wjIJYruJrl1fA6qqfQSOjUUUjASLrjbVsD7y6NYcoOc= github.com/aws/aws-sdk-go-v2/service/opensearchserverless v1.1.5 h1:3EqOT8+GTVfZny8ltIZk0VUflBjC7Ks55jw2M2edneM= github.com/aws/aws-sdk-go-v2/service/opensearchserverless v1.1.5/go.mod h1:zyCz2VSeUsBE9LMtZc+rVaTSPqJM64cjvLL50FJbblM= -github.com/aws/aws-sdk-go-v2/service/pipes v1.2.0 h1:IMmWO56Q3ICN4AR4D/8t2cAc2L1VdETvWwaVjJnJQ7o= -github.com/aws/aws-sdk-go-v2/service/pipes v1.2.0/go.mod h1:+c65uht0a5kyjx9emTS00DdDiVYBoXLKDF7LQ0/2g5U= +github.com/aws/aws-sdk-go-v2/service/pipes v1.2.1 h1:wA503x0d2eGCyghtrLXrRGPLjR5sHIQbFkelM9PsIYs= +github.com/aws/aws-sdk-go-v2/service/pipes v1.2.1/go.mod h1:PJ3LnWVqKqpHdDdIW7X+VO8FjWyOvMuHBkygW28C5tk= github.com/aws/aws-sdk-go-v2/service/rds v1.40.5 h1:m4v9hSOgnLmSDbdVdNT0H8GTY6tik7uB7SVV/SFbhLY= github.com/aws/aws-sdk-go-v2/service/rds v1.40.5/go.mod h1:994zebv5Cj1WoGzo3zrrscm1zBLFvGwoA3ve1eVYNVQ= github.com/aws/aws-sdk-go-v2/service/resourceexplorer2 v1.2.5 h1:+F3ULspZOOeUy3LWcIrTguJdO1/A1llhML7alifHldQ= From 99871e829866b8791c88652b5a9cb9e0750c2442 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 13 Mar 2023 07:03:28 +0000 Subject: [PATCH 680/763] build(deps): bump github.com/aws/aws-sdk-go-v2/service/oam Bumps [github.com/aws/aws-sdk-go-v2/service/oam](https://github.com/aws/aws-sdk-go-v2) from 1.1.5 to 1.1.6. - [Release notes](https://github.com/aws/aws-sdk-go-v2/releases) - [Changelog](https://github.com/aws/aws-sdk-go-v2/blob/main/CHANGELOG.md) - [Commits](https://github.com/aws/aws-sdk-go-v2/compare/config/v1.1.5...config/v1.1.6) --- updated-dependencies: - dependency-name: github.com/aws/aws-sdk-go-v2/service/oam dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 86dfa5fd2588..b312113e8c02 100644 --- a/go.mod +++ b/go.mod @@ -21,7 +21,7 @@ require ( github.com/aws/aws-sdk-go-v2/service/kendra v1.38.5 github.com/aws/aws-sdk-go-v2/service/lambda v1.30.0 github.com/aws/aws-sdk-go-v2/service/medialive v1.30.0 - github.com/aws/aws-sdk-go-v2/service/oam v1.1.5 + github.com/aws/aws-sdk-go-v2/service/oam v1.1.6 github.com/aws/aws-sdk-go-v2/service/opensearchserverless v1.1.5 github.com/aws/aws-sdk-go-v2/service/pipes v1.2.1 github.com/aws/aws-sdk-go-v2/service/rds v1.40.5 diff --git a/go.sum b/go.sum index 95eb2639721e..d7702a5bdb22 100644 --- a/go.sum +++ b/go.sum @@ -81,8 +81,8 @@ github.com/aws/aws-sdk-go-v2/service/lambda v1.30.0 h1:i2AFUTfisQPZP0iZlUEJiGfOB github.com/aws/aws-sdk-go-v2/service/lambda v1.30.0/go.mod h1:iPDYs5hrSZ+/8Ifoq9ZpoiuHZXDEJx9Udurdoq20958= github.com/aws/aws-sdk-go-v2/service/medialive v1.30.0 h1:NkQZuHbEyoDDoyu0g4hpUrOV9fitbrZZkIHdXnEaSAA= github.com/aws/aws-sdk-go-v2/service/medialive v1.30.0/go.mod h1:MDHSj74ylVyTusJYPIoFhNXqwaD8W8cIf8yTEI7+ccc= -github.com/aws/aws-sdk-go-v2/service/oam v1.1.5 h1:b4IaVHpAfwj2cOmTUgoIFTjLjTuC1yh3Ml3K7cjZFaU= -github.com/aws/aws-sdk-go-v2/service/oam v1.1.5/go.mod h1:wjIJYruJrl1fA6qqfQSOjUUUjASLrjbVsD7y6NYcoOc= +github.com/aws/aws-sdk-go-v2/service/oam v1.1.6 h1:A5vCeU8BdCJRaEI/UvrY3amM3Lo3WZd7VzCDjIyE2Y8= +github.com/aws/aws-sdk-go-v2/service/oam v1.1.6/go.mod h1:1/LZsdsqFoSCouz/3n1hP7fL8E6S05fvLUbzd187brQ= github.com/aws/aws-sdk-go-v2/service/opensearchserverless v1.1.5 h1:3EqOT8+GTVfZny8ltIZk0VUflBjC7Ks55jw2M2edneM= github.com/aws/aws-sdk-go-v2/service/opensearchserverless v1.1.5/go.mod h1:zyCz2VSeUsBE9LMtZc+rVaTSPqJM64cjvLL50FJbblM= github.com/aws/aws-sdk-go-v2/service/pipes v1.2.1 h1:wA503x0d2eGCyghtrLXrRGPLjR5sHIQbFkelM9PsIYs= From 54d984ae8bbb961252d73e643d82b13fab96ebda Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 13 Mar 2023 07:04:39 +0000 Subject: [PATCH 681/763] build(deps): bump github.com/aws/aws-sdk-go-v2/service/fis Bumps [github.com/aws/aws-sdk-go-v2/service/fis](https://github.com/aws/aws-sdk-go-v2) from 1.14.4 to 1.14.5. - [Release notes](https://github.com/aws/aws-sdk-go-v2/releases) - [Changelog](https://github.com/aws/aws-sdk-go-v2/blob/main/CHANGELOG.md) - [Commits](https://github.com/aws/aws-sdk-go-v2/compare/service/mq/v1.14.4...service/mq/v1.14.5) --- updated-dependencies: - dependency-name: github.com/aws/aws-sdk-go-v2/service/fis dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index b312113e8c02..d245e7fcc1d9 100644 --- a/go.mod +++ b/go.mod @@ -13,7 +13,7 @@ require ( github.com/aws/aws-sdk-go-v2/service/comprehend v1.22.0 github.com/aws/aws-sdk-go-v2/service/computeoptimizer v1.21.3 github.com/aws/aws-sdk-go-v2/service/ec2 v1.89.0 - github.com/aws/aws-sdk-go-v2/service/fis v1.14.4 + github.com/aws/aws-sdk-go-v2/service/fis v1.14.5 github.com/aws/aws-sdk-go-v2/service/healthlake v1.15.4 github.com/aws/aws-sdk-go-v2/service/identitystore v1.16.4 github.com/aws/aws-sdk-go-v2/service/inspector2 v1.11.6 diff --git a/go.sum b/go.sum index d7702a5bdb22..682752623dcf 100644 --- a/go.sum +++ b/go.sum @@ -58,8 +58,8 @@ github.com/aws/aws-sdk-go-v2/service/computeoptimizer v1.21.3 h1:JkWxBPjWWDKjVWj github.com/aws/aws-sdk-go-v2/service/computeoptimizer v1.21.3/go.mod h1:U4bKXeB586zd73RIAkJX+ZmUtwI00xLJhDKJ7+hTCO0= github.com/aws/aws-sdk-go-v2/service/ec2 v1.89.0 h1:f/mZ9YbM+c429V/3ghExrw9bpM4kRzmjyNui7bnRkaE= github.com/aws/aws-sdk-go-v2/service/ec2 v1.89.0/go.mod h1:2HxUY7Pkfmt1uIhPrFp0/O6+0aGoLaGIN5tXp/rYDL8= -github.com/aws/aws-sdk-go-v2/service/fis v1.14.4 h1:YHeT7fN7oQY7wUzOwZv4gfzULrrojjbFq9vipBUvFgE= -github.com/aws/aws-sdk-go-v2/service/fis v1.14.4/go.mod h1:IQGhkhTVkQE+/bVqKbLpipbH9H935C05Z0/z6k7eVPQ= +github.com/aws/aws-sdk-go-v2/service/fis v1.14.5 h1:y9wcj0xCmf3i+1igp+PK9pALMQK7z72W1gHtcMQkVC0= +github.com/aws/aws-sdk-go-v2/service/fis v1.14.5/go.mod h1:DQ++Ekb5IvuYfc+lQN8qFDpIZPjE0bqS4vpUYcdvyu4= github.com/aws/aws-sdk-go-v2/service/healthlake v1.15.4 h1:VFI+riYGn52qqqU8hbCgOhYkVz7ZDjKJ1HN4vsaqkdE= github.com/aws/aws-sdk-go-v2/service/healthlake v1.15.4/go.mod h1:Q0AOLQ3/vSpDs3YoBE9CbAu4PN899DWHFuU6cqy6Utw= github.com/aws/aws-sdk-go-v2/service/iam v1.19.4 h1:hrBxgoUih7uy9sJTXrX0N/3TVgbmevlxEYsP9l+Lje4= From c5aa6dbc76f57b85cce8f2e041f51fbe383700d0 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 13 Mar 2023 07:06:07 +0000 Subject: [PATCH 682/763] build(deps): bump github.com/aws/aws-sdk-go-v2/service/s3control Bumps [github.com/aws/aws-sdk-go-v2/service/s3control](https://github.com/aws/aws-sdk-go-v2) from 1.29.4 to 1.29.5. - [Release notes](https://github.com/aws/aws-sdk-go-v2/releases) - [Changelog](https://github.com/aws/aws-sdk-go-v2/blob/main/CHANGELOG.md) - [Commits](https://github.com/aws/aws-sdk-go-v2/compare/service/s3/v1.29.4...service/s3/v1.29.5) --- updated-dependencies: - dependency-name: github.com/aws/aws-sdk-go-v2/service/s3control dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- go.mod | 4 ++-- go.sum | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/go.mod b/go.mod index d245e7fcc1d9..5d75cf2b394a 100644 --- a/go.mod +++ b/go.mod @@ -28,7 +28,7 @@ require ( github.com/aws/aws-sdk-go-v2/service/resourceexplorer2 v1.2.5 github.com/aws/aws-sdk-go-v2/service/rolesanywhere v1.1.5 github.com/aws/aws-sdk-go-v2/service/route53domains v1.14.4 - github.com/aws/aws-sdk-go-v2/service/s3control v1.29.4 + github.com/aws/aws-sdk-go-v2/service/s3control v1.29.5 github.com/aws/aws-sdk-go-v2/service/scheduler v1.1.4 github.com/aws/aws-sdk-go-v2/service/sesv2 v1.17.0 github.com/aws/aws-sdk-go-v2/service/ssm v1.35.5 @@ -85,7 +85,7 @@ require ( github.com/aws/aws-sdk-go-v2/internal/ini v1.3.29 // indirect github.com/aws/aws-sdk-go-v2/service/iam v1.19.4 // indirect github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.9.23 // indirect - github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.13.23 // indirect + github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.13.24 // indirect github.com/aws/aws-sdk-go-v2/service/sso v1.12.4 // indirect github.com/aws/aws-sdk-go-v2/service/ssooidc v1.14.4 // indirect github.com/aws/aws-sdk-go-v2/service/sts v1.18.5 // indirect diff --git a/go.sum b/go.sum index 682752623dcf..216ea6ef5ca8 100644 --- a/go.sum +++ b/go.sum @@ -71,8 +71,8 @@ github.com/aws/aws-sdk-go-v2/service/inspector2 v1.11.6/go.mod h1:w5tN/JjIMU0Ryc github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.9.22/go.mod h1:xt0Au8yPIwYXf/GYPy/vl4K3CgwhfQMYbrH7DlUUIws= github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.9.23 h1:QoOybhwRfciWUBbZ0gp9S7XaDnCuSTeK/fySB99V1ls= github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.9.23/go.mod h1:9uPh+Hrz2Vn6oMnQYiUi/zbh3ovbnQk19YKINkQny44= -github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.13.23 h1:qc+RW0WWZ2KApMnsu/EVCPqLTyIH55uc7YQq7mq4XqE= -github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.13.23/go.mod h1:FJhZWVWBCcgAF8jbep7pxQ1QUsjzTwa9tvEXGw2TDRo= +github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.13.24 h1:i4RH8DLv/BHY0fCrXYQDr+DGnWzaxB3Ee/esxUaSavk= +github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.13.24/go.mod h1:N8X45/o2cngvjCYi2ZnvI0P4mU4ZRJfEYC3maCSsPyw= github.com/aws/aws-sdk-go-v2/service/ivschat v1.3.4 h1:nGVv8RFgC4P7BsnL/NPGhT8W0kdhBSf3TXR88GzjwLQ= github.com/aws/aws-sdk-go-v2/service/ivschat v1.3.4/go.mod h1:Ic/51aMt0SrY+rLEBYCMW6iuORW0wQJ/rhV0PGg07mQ= github.com/aws/aws-sdk-go-v2/service/kendra v1.38.5 h1:vYyn1h1+/eRL8UxfzRgxhH8tm+Jd6ujsyXmUFztfnks= @@ -95,8 +95,8 @@ github.com/aws/aws-sdk-go-v2/service/rolesanywhere v1.1.5 h1:ywT18Rmkr/cWcJSJNyL github.com/aws/aws-sdk-go-v2/service/rolesanywhere v1.1.5/go.mod h1:YER6EnZk8ud7mEHI4SeHtpE6VjIaOuD1a/ayUegKaB0= github.com/aws/aws-sdk-go-v2/service/route53domains v1.14.4 h1:/1qBMwOZb/2ua5jFMc8xmLUxHz7VNt70Zx2fKLoZ40M= github.com/aws/aws-sdk-go-v2/service/route53domains v1.14.4/go.mod h1:MSwXvIWYZIBgC1otPRfafXbiOIdihO36INeOhqCciao= -github.com/aws/aws-sdk-go-v2/service/s3control v1.29.4 h1:2FnFwA3DaXibWS3gMk9/hfJL3oNU+jIWsgytn5X2aFQ= -github.com/aws/aws-sdk-go-v2/service/s3control v1.29.4/go.mod h1:7N/XbfABmShA4NEeFRhn9itmFk/E3DZ9im/+1++XnCY= +github.com/aws/aws-sdk-go-v2/service/s3control v1.29.5 h1:64MXeSwJp35lJ9kvP01EEYxI0uW5P+cOXBECFhLq9Og= +github.com/aws/aws-sdk-go-v2/service/s3control v1.29.5/go.mod h1:u9sP19O4PvfQMvFeScgmemf+YxSRkySPQNQgxQgDKNQ= github.com/aws/aws-sdk-go-v2/service/scheduler v1.1.4 h1:LfCy6abbOMk2O6OdxFiMvySEMMYXyA4wLTZZzoyDU14= github.com/aws/aws-sdk-go-v2/service/scheduler v1.1.4/go.mod h1:l7ebY4UfyEXzsM+yh74U1yTsZ4c8OZZd8de4aY0G19U= github.com/aws/aws-sdk-go-v2/service/sesv2 v1.17.0 h1:0HyUGJ3DCaXmOPFkCYhvi8aDA4WOsZ42mq4GnTGSlmA= From e47ce79ab999f220642e006044ad77928b962dc4 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 13 Mar 2023 07:06:41 +0000 Subject: [PATCH 683/763] build(deps): bump github.com/aws/aws-sdk-go in /.ci/providerlint Bumps [github.com/aws/aws-sdk-go](https://github.com/aws/aws-sdk-go) from 1.44.218 to 1.44.219. - [Release notes](https://github.com/aws/aws-sdk-go/releases) - [Commits](https://github.com/aws/aws-sdk-go/compare/v1.44.218...v1.44.219) --- updated-dependencies: - dependency-name: github.com/aws/aws-sdk-go dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- .ci/providerlint/go.mod | 2 +- .ci/providerlint/go.sum | 4 ++-- .../aws/aws-sdk-go/aws/endpoints/defaults.go | 15 ++++++++++++++- .ci/providerlint/vendor/modules.txt | 2 +- 4 files changed, 18 insertions(+), 5 deletions(-) diff --git a/.ci/providerlint/go.mod b/.ci/providerlint/go.mod index e2e103d5bad7..40c077786dac 100644 --- a/.ci/providerlint/go.mod +++ b/.ci/providerlint/go.mod @@ -3,7 +3,7 @@ module github.com/hashicorp/terraform-provider-aws/ci/providerlint go 1.19 require ( - github.com/aws/aws-sdk-go v1.44.218 + github.com/aws/aws-sdk-go v1.44.219 github.com/bflad/tfproviderlint v0.28.1 github.com/hashicorp/terraform-plugin-sdk/v2 v2.25.0 golang.org/x/tools v0.1.12 diff --git a/.ci/providerlint/go.sum b/.ci/providerlint/go.sum index c1838df19626..7c04575cd598 100644 --- a/.ci/providerlint/go.sum +++ b/.ci/providerlint/go.sum @@ -65,8 +65,8 @@ github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5/go.mod h1:wHh0iHkY github.com/aws/aws-sdk-go v1.15.78/go.mod h1:E3/ieXAlvM0XWO57iftYVDLLvQ824smPP3ATZkfNZeM= github.com/aws/aws-sdk-go v1.25.3/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo= github.com/aws/aws-sdk-go v1.37.0/go.mod h1:hcU610XS61/+aQV88ixoOzUoG7v3b31pl2zKMmprdro= -github.com/aws/aws-sdk-go v1.44.218 h1:p707+xOCazWhkSpZOeyhtTcg7Z+asxxvueGgYPSitn4= -github.com/aws/aws-sdk-go v1.44.218/go.mod h1:aVsgQcEevwlmQ7qHE9I3h+dtQgpqhFB+i8Phjh7fkwI= +github.com/aws/aws-sdk-go v1.44.219 h1:YOFxTUQZvdRzgwb6XqLFRwNHxoUdKBuunITC7IFhvbc= +github.com/aws/aws-sdk-go v1.44.219/go.mod h1:aVsgQcEevwlmQ7qHE9I3h+dtQgpqhFB+i8Phjh7fkwI= github.com/bflad/gopaniccheck v0.1.0 h1:tJftp+bv42ouERmUMWLoUn/5bi/iQZjHPznM00cP/bU= github.com/bflad/gopaniccheck v0.1.0/go.mod h1:ZCj2vSr7EqVeDaqVsWN4n2MwdROx1YL+LFo47TSWtsA= github.com/bflad/tfproviderlint v0.28.1 h1:7f54/ynV6/lK5/1EyG7tHtc4sMdjJSEFGjZNRJKwBs8= diff --git a/.ci/providerlint/vendor/github.com/aws/aws-sdk-go/aws/endpoints/defaults.go b/.ci/providerlint/vendor/github.com/aws/aws-sdk-go/aws/endpoints/defaults.go index 1b68cbb78648..f90062d1d705 100644 --- a/.ci/providerlint/vendor/github.com/aws/aws-sdk-go/aws/endpoints/defaults.go +++ b/.ci/providerlint/vendor/github.com/aws/aws-sdk-go/aws/endpoints/defaults.go @@ -20850,6 +20850,9 @@ var awsPartition = partition{ endpointKey{ Region: "ap-northeast-2", }: endpoint{}, + endpointKey{ + Region: "ap-south-1", + }: endpoint{}, endpointKey{ Region: "ap-southeast-1", }: endpoint{}, @@ -34606,12 +34609,22 @@ var awsusgovPartition = partition{ "participant.connect": service{ Endpoints: serviceEndpoints{ endpointKey{ - Region: "us-gov-west-1", + Region: "fips-us-gov-west-1", }: endpoint{ Hostname: "participant.connect.us-gov-west-1.amazonaws.com", CredentialScope: credentialScope{ Region: "us-gov-west-1", }, + Deprecated: boxedTrue, + }, + endpointKey{ + Region: "us-gov-west-1", + }: endpoint{}, + endpointKey{ + Region: "us-gov-west-1", + Variant: fipsVariant, + }: endpoint{ + Hostname: "participant.connect.us-gov-west-1.amazonaws.com", }, }, }, diff --git a/.ci/providerlint/vendor/modules.txt b/.ci/providerlint/vendor/modules.txt index fe097891a1ae..6f4a61748563 100644 --- a/.ci/providerlint/vendor/modules.txt +++ b/.ci/providerlint/vendor/modules.txt @@ -4,7 +4,7 @@ github.com/agext/levenshtein # github.com/apparentlymart/go-textseg/v13 v13.0.0 ## explicit; go 1.16 github.com/apparentlymart/go-textseg/v13/textseg -# github.com/aws/aws-sdk-go v1.44.218 +# github.com/aws/aws-sdk-go v1.44.219 ## explicit; go 1.11 github.com/aws/aws-sdk-go/aws/awserr github.com/aws/aws-sdk-go/aws/endpoints From 95a9fd84c016ac40ebbc1d9c4c35c47963d7e01a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 13 Mar 2023 07:07:57 +0000 Subject: [PATCH 684/763] build(deps): bump github.com/aws/aws-sdk-go-v2/service/healthlake Bumps [github.com/aws/aws-sdk-go-v2/service/healthlake](https://github.com/aws/aws-sdk-go-v2) from 1.15.4 to 1.15.5. - [Release notes](https://github.com/aws/aws-sdk-go-v2/releases) - [Changelog](https://github.com/aws/aws-sdk-go-v2/blob/main/CHANGELOG.md) - [Commits](https://github.com/aws/aws-sdk-go-v2/compare/config/v1.15.4...config/v1.15.5) --- updated-dependencies: - dependency-name: github.com/aws/aws-sdk-go-v2/service/healthlake dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 5d75cf2b394a..d832ec4faa7b 100644 --- a/go.mod +++ b/go.mod @@ -14,7 +14,7 @@ require ( github.com/aws/aws-sdk-go-v2/service/computeoptimizer v1.21.3 github.com/aws/aws-sdk-go-v2/service/ec2 v1.89.0 github.com/aws/aws-sdk-go-v2/service/fis v1.14.5 - github.com/aws/aws-sdk-go-v2/service/healthlake v1.15.4 + github.com/aws/aws-sdk-go-v2/service/healthlake v1.15.5 github.com/aws/aws-sdk-go-v2/service/identitystore v1.16.4 github.com/aws/aws-sdk-go-v2/service/inspector2 v1.11.6 github.com/aws/aws-sdk-go-v2/service/ivschat v1.3.4 diff --git a/go.sum b/go.sum index 216ea6ef5ca8..d1ac60681ac7 100644 --- a/go.sum +++ b/go.sum @@ -60,8 +60,8 @@ github.com/aws/aws-sdk-go-v2/service/ec2 v1.89.0 h1:f/mZ9YbM+c429V/3ghExrw9bpM4k github.com/aws/aws-sdk-go-v2/service/ec2 v1.89.0/go.mod h1:2HxUY7Pkfmt1uIhPrFp0/O6+0aGoLaGIN5tXp/rYDL8= github.com/aws/aws-sdk-go-v2/service/fis v1.14.5 h1:y9wcj0xCmf3i+1igp+PK9pALMQK7z72W1gHtcMQkVC0= github.com/aws/aws-sdk-go-v2/service/fis v1.14.5/go.mod h1:DQ++Ekb5IvuYfc+lQN8qFDpIZPjE0bqS4vpUYcdvyu4= -github.com/aws/aws-sdk-go-v2/service/healthlake v1.15.4 h1:VFI+riYGn52qqqU8hbCgOhYkVz7ZDjKJ1HN4vsaqkdE= -github.com/aws/aws-sdk-go-v2/service/healthlake v1.15.4/go.mod h1:Q0AOLQ3/vSpDs3YoBE9CbAu4PN899DWHFuU6cqy6Utw= +github.com/aws/aws-sdk-go-v2/service/healthlake v1.15.5 h1:9O+XnH1SGXV9J9yr2d2p9EweysA6bHI8ucmgQ2HjOUE= +github.com/aws/aws-sdk-go-v2/service/healthlake v1.15.5/go.mod h1:hZLFihMKaVykypz8xRMpOTJtng9RV64rNnRxkt93U00= github.com/aws/aws-sdk-go-v2/service/iam v1.19.4 h1:hrBxgoUih7uy9sJTXrX0N/3TVgbmevlxEYsP9l+Lje4= github.com/aws/aws-sdk-go-v2/service/iam v1.19.4/go.mod h1:F5Xt96+AfAiyMpRXHy9CKafE/KULVwj7MwgZ0a4row4= github.com/aws/aws-sdk-go-v2/service/identitystore v1.16.4 h1:WmE4yfzKZBgSLdLOG8/pWekHSskhXNX+7HXeWire/II= From 631a5fbbf425499ce0f00f3857659b3a7deed4c4 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 13 Mar 2023 07:09:01 +0000 Subject: [PATCH 685/763] build(deps): bump github.com/aws/aws-sdk-go-v2/service/transcribe Bumps [github.com/aws/aws-sdk-go-v2/service/transcribe](https://github.com/aws/aws-sdk-go-v2) from 1.26.0 to 1.26.1. - [Release notes](https://github.com/aws/aws-sdk-go-v2/releases) - [Changelog](https://github.com/aws/aws-sdk-go-v2/blob/main/CHANGELOG.md) - [Commits](https://github.com/aws/aws-sdk-go-v2/compare/service/s3/v1.26.0...service/s3/v1.26.1) --- updated-dependencies: - dependency-name: github.com/aws/aws-sdk-go-v2/service/transcribe dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index d832ec4faa7b..39bd58d9c04d 100644 --- a/go.mod +++ b/go.mod @@ -34,7 +34,7 @@ require ( github.com/aws/aws-sdk-go-v2/service/ssm v1.35.5 github.com/aws/aws-sdk-go-v2/service/ssmcontacts v1.14.5 github.com/aws/aws-sdk-go-v2/service/ssmincidents v1.20.4 - github.com/aws/aws-sdk-go-v2/service/transcribe v1.26.0 + github.com/aws/aws-sdk-go-v2/service/transcribe v1.26.1 github.com/aws/smithy-go v1.13.5 github.com/beevik/etree v1.1.0 github.com/google/go-cmp v0.5.9 diff --git a/go.sum b/go.sum index d1ac60681ac7..3732d02da0bf 100644 --- a/go.sum +++ b/go.sum @@ -116,8 +116,8 @@ github.com/aws/aws-sdk-go-v2/service/ssooidc v1.14.4/go.mod h1:zVwRrfdSmbRZWkUkW github.com/aws/aws-sdk-go-v2/service/sts v1.18.3/go.mod h1:b+psTJn33Q4qGoDaM7ZiOVVG8uVjGI6HaZ8WBHdgDgU= github.com/aws/aws-sdk-go-v2/service/sts v1.18.5 h1:L1600eLr0YvTT7gNh3Ni24yGI7NSHkq9Gp62vijPRCs= github.com/aws/aws-sdk-go-v2/service/sts v1.18.5/go.mod h1:1mKZHLLpDMHTNSYPJ7qrcnCQdHCWsNQaT0xRvq2u80s= -github.com/aws/aws-sdk-go-v2/service/transcribe v1.26.0 h1:3cwoie+qJvBJWOa9r/1AONz9XgrcLSWnL37rHNRMS6s= -github.com/aws/aws-sdk-go-v2/service/transcribe v1.26.0/go.mod h1:Sfekn5aPGiTP+22/2DOuE6WoVBY19xfW6esh0HjdgzQ= +github.com/aws/aws-sdk-go-v2/service/transcribe v1.26.1 h1:gLvQJbkj0GKQ17FP2eyIJ6bTpE5IEIcPpVSOuwaaRck= +github.com/aws/aws-sdk-go-v2/service/transcribe v1.26.1/go.mod h1:dS0jryOiMP8aMos6KC4y+B7cWoz10YlH7Cq8ivdBq7s= github.com/aws/smithy-go v1.13.5 h1:hgz0X/DX0dGqTYpGALqXJoRKRj5oQ7150i5FdTePzO8= github.com/aws/smithy-go v1.13.5/go.mod h1:Tg+OJXh4MB2R/uN61Ko2f6hTZwB/ZYGOtib8J3gBHzA= github.com/beevik/etree v1.1.0 h1:T0xke/WvNtMoCqgzPhkX2r4rjY3GDZFi+FjpRZY2Jbs= From 5d87d29da8ce04fbc6c619b24358579f4d33b572 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 13 Mar 2023 07:09:55 +0000 Subject: [PATCH 686/763] build(deps): bump github.com/aws/aws-sdk-go-v2/service/scheduler Bumps [github.com/aws/aws-sdk-go-v2/service/scheduler](https://github.com/aws/aws-sdk-go-v2) from 1.1.4 to 1.1.5. - [Release notes](https://github.com/aws/aws-sdk-go-v2/releases) - [Changelog](https://github.com/aws/aws-sdk-go-v2/blob/main/CHANGELOG.md) - [Commits](https://github.com/aws/aws-sdk-go-v2/compare/config/v1.1.4...config/v1.1.5) --- updated-dependencies: - dependency-name: github.com/aws/aws-sdk-go-v2/service/scheduler dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 39bd58d9c04d..3206bfc56802 100644 --- a/go.mod +++ b/go.mod @@ -29,7 +29,7 @@ require ( github.com/aws/aws-sdk-go-v2/service/rolesanywhere v1.1.5 github.com/aws/aws-sdk-go-v2/service/route53domains v1.14.4 github.com/aws/aws-sdk-go-v2/service/s3control v1.29.5 - github.com/aws/aws-sdk-go-v2/service/scheduler v1.1.4 + github.com/aws/aws-sdk-go-v2/service/scheduler v1.1.5 github.com/aws/aws-sdk-go-v2/service/sesv2 v1.17.0 github.com/aws/aws-sdk-go-v2/service/ssm v1.35.5 github.com/aws/aws-sdk-go-v2/service/ssmcontacts v1.14.5 diff --git a/go.sum b/go.sum index 3732d02da0bf..41fcee0efb4f 100644 --- a/go.sum +++ b/go.sum @@ -97,8 +97,8 @@ github.com/aws/aws-sdk-go-v2/service/route53domains v1.14.4 h1:/1qBMwOZb/2ua5jFM github.com/aws/aws-sdk-go-v2/service/route53domains v1.14.4/go.mod h1:MSwXvIWYZIBgC1otPRfafXbiOIdihO36INeOhqCciao= github.com/aws/aws-sdk-go-v2/service/s3control v1.29.5 h1:64MXeSwJp35lJ9kvP01EEYxI0uW5P+cOXBECFhLq9Og= github.com/aws/aws-sdk-go-v2/service/s3control v1.29.5/go.mod h1:u9sP19O4PvfQMvFeScgmemf+YxSRkySPQNQgxQgDKNQ= -github.com/aws/aws-sdk-go-v2/service/scheduler v1.1.4 h1:LfCy6abbOMk2O6OdxFiMvySEMMYXyA4wLTZZzoyDU14= -github.com/aws/aws-sdk-go-v2/service/scheduler v1.1.4/go.mod h1:l7ebY4UfyEXzsM+yh74U1yTsZ4c8OZZd8de4aY0G19U= +github.com/aws/aws-sdk-go-v2/service/scheduler v1.1.5 h1:c4H0lPUXeo9XlMQ9fSskG8yYscq8/HNINnN3NlpQ2wI= +github.com/aws/aws-sdk-go-v2/service/scheduler v1.1.5/go.mod h1:GNtZoju1It1f7xOjYzIu2dUEdd7sP75+boLldkGu4A4= github.com/aws/aws-sdk-go-v2/service/sesv2 v1.17.0 h1:0HyUGJ3DCaXmOPFkCYhvi8aDA4WOsZ42mq4GnTGSlmA= github.com/aws/aws-sdk-go-v2/service/sesv2 v1.17.0/go.mod h1:uIM2GAheOB6xz7UuG5By72Zw2B/20fViFsbDY1JVTVY= github.com/aws/aws-sdk-go-v2/service/ssm v1.35.5 h1:x7FjoHx8A559fAHi0WMnrVxxk9iXwyj1UK5S7TrqFAM= From d5d77ff0bc70cf4f09598d0d67ea9af14530f81a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 13 Mar 2023 07:10:44 +0000 Subject: [PATCH 687/763] build(deps): bump github.com/aws/aws-sdk-go-v2/service/cloudwatchlogs Bumps [github.com/aws/aws-sdk-go-v2/service/cloudwatchlogs](https://github.com/aws/aws-sdk-go-v2) from 1.20.5 to 1.20.6. - [Release notes](https://github.com/aws/aws-sdk-go-v2/releases) - [Changelog](https://github.com/aws/aws-sdk-go-v2/blob/main/CHANGELOG.md) - [Commits](https://github.com/aws/aws-sdk-go-v2/compare/service/eks/v1.20.5...service/eks/v1.20.6) --- updated-dependencies: - dependency-name: github.com/aws/aws-sdk-go-v2/service/cloudwatchlogs dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 3206bfc56802..541d787063b5 100644 --- a/go.mod +++ b/go.mod @@ -9,7 +9,7 @@ require ( github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.12.23 github.com/aws/aws-sdk-go-v2/service/auditmanager v1.24.1 github.com/aws/aws-sdk-go-v2/service/cloudcontrol v1.11.5 - github.com/aws/aws-sdk-go-v2/service/cloudwatchlogs v1.20.5 + github.com/aws/aws-sdk-go-v2/service/cloudwatchlogs v1.20.6 github.com/aws/aws-sdk-go-v2/service/comprehend v1.22.0 github.com/aws/aws-sdk-go-v2/service/computeoptimizer v1.21.3 github.com/aws/aws-sdk-go-v2/service/ec2 v1.89.0 diff --git a/go.sum b/go.sum index 41fcee0efb4f..5f3b43ad4bae 100644 --- a/go.sum +++ b/go.sum @@ -50,8 +50,8 @@ github.com/aws/aws-sdk-go-v2/service/auditmanager v1.24.1 h1:lU4z86semH3yi8zMkYq github.com/aws/aws-sdk-go-v2/service/auditmanager v1.24.1/go.mod h1:ZAErSW/Pfr0z7DbU00jjt9/n9Pzf5v46Tm1X9NGUwBE= github.com/aws/aws-sdk-go-v2/service/cloudcontrol v1.11.5 h1:+gZHaILpl4yTDHwAxWnNNyumYLRZJ86+o+MVI3KSoyk= github.com/aws/aws-sdk-go-v2/service/cloudcontrol v1.11.5/go.mod h1:SlSHujpy5ECaG+b4zZPBomo6LSenfp4jOS/5ysPhsFE= -github.com/aws/aws-sdk-go-v2/service/cloudwatchlogs v1.20.5 h1:hUMG/9p2Y23CAvAtVhoI2D+CB7eKkU60K76Dlp1zEII= -github.com/aws/aws-sdk-go-v2/service/cloudwatchlogs v1.20.5/go.mod h1:cylAO6dxr/pnL0iXXw7aqHHm/rcbQEf8g5VrYZqZKaE= +github.com/aws/aws-sdk-go-v2/service/cloudwatchlogs v1.20.6 h1:hT9mrvaUpx/T9gi6JkAI5uAmX+eTCI0ignb5YXNG/GU= +github.com/aws/aws-sdk-go-v2/service/cloudwatchlogs v1.20.6/go.mod h1:kOHVSyc1cOsgOzB1MJViE4KteDEjosGukDWGrd9oOW0= github.com/aws/aws-sdk-go-v2/service/comprehend v1.22.0 h1:HfIi9A8XYph6xwnoevrO9LSSH4Fj0ld42/YbnzUWfy4= github.com/aws/aws-sdk-go-v2/service/comprehend v1.22.0/go.mod h1:wR/O51vYY5XCt2FzuaSgvHV36BozkKxKWW4NoDIXrlc= github.com/aws/aws-sdk-go-v2/service/computeoptimizer v1.21.3 h1:JkWxBPjWWDKjVWjBoiIw9zbMA72Ynde66y5fInm9Q/g= From e93966025a7ff6e439759241566362acc3dc20f1 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 13 Mar 2023 07:11:40 +0000 Subject: [PATCH 688/763] build(deps): bump github.com/aws/aws-sdk-go-v2/service/auditmanager Bumps [github.com/aws/aws-sdk-go-v2/service/auditmanager](https://github.com/aws/aws-sdk-go-v2) from 1.24.1 to 1.24.2. - [Release notes](https://github.com/aws/aws-sdk-go-v2/releases) - [Changelog](https://github.com/aws/aws-sdk-go-v2/blob/main/CHANGELOG.md) - [Commits](https://github.com/aws/aws-sdk-go-v2/compare/service/s3/v1.24.1...service/fsx/v1.24.2) --- updated-dependencies: - dependency-name: github.com/aws/aws-sdk-go-v2/service/auditmanager dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 541d787063b5..be1690539f37 100644 --- a/go.mod +++ b/go.mod @@ -7,7 +7,7 @@ require ( github.com/aws/aws-sdk-go v1.44.218 github.com/aws/aws-sdk-go-v2 v1.17.6 github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.12.23 - github.com/aws/aws-sdk-go-v2/service/auditmanager v1.24.1 + github.com/aws/aws-sdk-go-v2/service/auditmanager v1.24.2 github.com/aws/aws-sdk-go-v2/service/cloudcontrol v1.11.5 github.com/aws/aws-sdk-go-v2/service/cloudwatchlogs v1.20.6 github.com/aws/aws-sdk-go-v2/service/comprehend v1.22.0 diff --git a/go.sum b/go.sum index 5f3b43ad4bae..e7e3fb348f40 100644 --- a/go.sum +++ b/go.sum @@ -46,8 +46,8 @@ github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.24 h1:r+Kv+SEJquhAZXaJ7G github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.24/go.mod h1:gAuCezX/gob6BSMbItsSlMb6WZGV7K2+fWOvk8xBSto= github.com/aws/aws-sdk-go-v2/internal/ini v1.3.29 h1:J4xhFd6zHhdF9jPP0FQJ6WknzBboGMBNjKOv4iTuw4A= github.com/aws/aws-sdk-go-v2/internal/ini v1.3.29/go.mod h1:TwuqRBGzxjQJIwH16/fOZodwXt2Zxa9/cwJC5ke4j7s= -github.com/aws/aws-sdk-go-v2/service/auditmanager v1.24.1 h1:lU4z86semH3yi8zMkYq/DXccjRMCjkSN/eZRmNAGOU0= -github.com/aws/aws-sdk-go-v2/service/auditmanager v1.24.1/go.mod h1:ZAErSW/Pfr0z7DbU00jjt9/n9Pzf5v46Tm1X9NGUwBE= +github.com/aws/aws-sdk-go-v2/service/auditmanager v1.24.2 h1:pbelBMdI4/oPEjkw862jMnvKh2JiZgUvjUqCNWHj+M4= +github.com/aws/aws-sdk-go-v2/service/auditmanager v1.24.2/go.mod h1:n8Qc8IoCTsytDk7JLqNRHsLgCoQjhHIphnPs4uV+esU= github.com/aws/aws-sdk-go-v2/service/cloudcontrol v1.11.5 h1:+gZHaILpl4yTDHwAxWnNNyumYLRZJ86+o+MVI3KSoyk= github.com/aws/aws-sdk-go-v2/service/cloudcontrol v1.11.5/go.mod h1:SlSHujpy5ECaG+b4zZPBomo6LSenfp4jOS/5ysPhsFE= github.com/aws/aws-sdk-go-v2/service/cloudwatchlogs v1.20.6 h1:hT9mrvaUpx/T9gi6JkAI5uAmX+eTCI0ignb5YXNG/GU= From 6d8e494e2080267f70bc0843cf13fd598f2ef7f4 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 13 Mar 2023 07:12:33 +0000 Subject: [PATCH 689/763] build(deps): bump github.com/aws/aws-sdk-go-v2/service/ivschat Bumps [github.com/aws/aws-sdk-go-v2/service/ivschat](https://github.com/aws/aws-sdk-go-v2) from 1.3.4 to 1.4.0. - [Release notes](https://github.com/aws/aws-sdk-go-v2/releases) - [Changelog](https://github.com/aws/aws-sdk-go-v2/blob/main/CHANGELOG.md) - [Commits](https://github.com/aws/aws-sdk-go-v2/compare/v1.3.4...v1.4.0) --- updated-dependencies: - dependency-name: github.com/aws/aws-sdk-go-v2/service/ivschat dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index be1690539f37..21f10615660a 100644 --- a/go.mod +++ b/go.mod @@ -17,7 +17,7 @@ require ( github.com/aws/aws-sdk-go-v2/service/healthlake v1.15.5 github.com/aws/aws-sdk-go-v2/service/identitystore v1.16.4 github.com/aws/aws-sdk-go-v2/service/inspector2 v1.11.6 - github.com/aws/aws-sdk-go-v2/service/ivschat v1.3.4 + github.com/aws/aws-sdk-go-v2/service/ivschat v1.4.0 github.com/aws/aws-sdk-go-v2/service/kendra v1.38.5 github.com/aws/aws-sdk-go-v2/service/lambda v1.30.0 github.com/aws/aws-sdk-go-v2/service/medialive v1.30.0 diff --git a/go.sum b/go.sum index e7e3fb348f40..a2688993518e 100644 --- a/go.sum +++ b/go.sum @@ -73,8 +73,8 @@ github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.9.23 h1:QoOybhwRf github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.9.23/go.mod h1:9uPh+Hrz2Vn6oMnQYiUi/zbh3ovbnQk19YKINkQny44= github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.13.24 h1:i4RH8DLv/BHY0fCrXYQDr+DGnWzaxB3Ee/esxUaSavk= github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.13.24/go.mod h1:N8X45/o2cngvjCYi2ZnvI0P4mU4ZRJfEYC3maCSsPyw= -github.com/aws/aws-sdk-go-v2/service/ivschat v1.3.4 h1:nGVv8RFgC4P7BsnL/NPGhT8W0kdhBSf3TXR88GzjwLQ= -github.com/aws/aws-sdk-go-v2/service/ivschat v1.3.4/go.mod h1:Ic/51aMt0SrY+rLEBYCMW6iuORW0wQJ/rhV0PGg07mQ= +github.com/aws/aws-sdk-go-v2/service/ivschat v1.4.0 h1:KmTUwjxQ/WzS64jhqwXpjngif7sAIscGUSkaw3Q7gV4= +github.com/aws/aws-sdk-go-v2/service/ivschat v1.4.0/go.mod h1:Xwv56usY/pQjpXTB5kZitJlGaQT+jMpxZ3d/RksI1Tg= github.com/aws/aws-sdk-go-v2/service/kendra v1.38.5 h1:vYyn1h1+/eRL8UxfzRgxhH8tm+Jd6ujsyXmUFztfnks= github.com/aws/aws-sdk-go-v2/service/kendra v1.38.5/go.mod h1:PMq9hXXhaNxmBMIolmknhJ9gXi4PYDsZwsFBaJs7Zak= github.com/aws/aws-sdk-go-v2/service/lambda v1.30.0 h1:i2AFUTfisQPZP0iZlUEJiGfOBxEN7Yy+d3zBfDYRmnQ= From df25096b5cb9a8c2ab4c6c9de999ad02e0a82b86 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 13 Mar 2023 07:13:28 +0000 Subject: [PATCH 690/763] build(deps): bump github.com/aws/aws-sdk-go-v2/service/sesv2 Bumps [github.com/aws/aws-sdk-go-v2/service/sesv2](https://github.com/aws/aws-sdk-go-v2) from 1.17.0 to 1.17.1. - [Release notes](https://github.com/aws/aws-sdk-go-v2/releases) - [Changelog](https://github.com/aws/aws-sdk-go-v2/blob/main/CHANGELOG.md) - [Commits](https://github.com/aws/aws-sdk-go-v2/compare/v1.17.0...v1.17.1) --- updated-dependencies: - dependency-name: github.com/aws/aws-sdk-go-v2/service/sesv2 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 21f10615660a..2f7b05adfd5e 100644 --- a/go.mod +++ b/go.mod @@ -30,7 +30,7 @@ require ( github.com/aws/aws-sdk-go-v2/service/route53domains v1.14.4 github.com/aws/aws-sdk-go-v2/service/s3control v1.29.5 github.com/aws/aws-sdk-go-v2/service/scheduler v1.1.5 - github.com/aws/aws-sdk-go-v2/service/sesv2 v1.17.0 + github.com/aws/aws-sdk-go-v2/service/sesv2 v1.17.1 github.com/aws/aws-sdk-go-v2/service/ssm v1.35.5 github.com/aws/aws-sdk-go-v2/service/ssmcontacts v1.14.5 github.com/aws/aws-sdk-go-v2/service/ssmincidents v1.20.4 diff --git a/go.sum b/go.sum index a2688993518e..b546279cbf4a 100644 --- a/go.sum +++ b/go.sum @@ -99,8 +99,8 @@ github.com/aws/aws-sdk-go-v2/service/s3control v1.29.5 h1:64MXeSwJp35lJ9kvP01EEY github.com/aws/aws-sdk-go-v2/service/s3control v1.29.5/go.mod h1:u9sP19O4PvfQMvFeScgmemf+YxSRkySPQNQgxQgDKNQ= github.com/aws/aws-sdk-go-v2/service/scheduler v1.1.5 h1:c4H0lPUXeo9XlMQ9fSskG8yYscq8/HNINnN3NlpQ2wI= github.com/aws/aws-sdk-go-v2/service/scheduler v1.1.5/go.mod h1:GNtZoju1It1f7xOjYzIu2dUEdd7sP75+boLldkGu4A4= -github.com/aws/aws-sdk-go-v2/service/sesv2 v1.17.0 h1:0HyUGJ3DCaXmOPFkCYhvi8aDA4WOsZ42mq4GnTGSlmA= -github.com/aws/aws-sdk-go-v2/service/sesv2 v1.17.0/go.mod h1:uIM2GAheOB6xz7UuG5By72Zw2B/20fViFsbDY1JVTVY= +github.com/aws/aws-sdk-go-v2/service/sesv2 v1.17.1 h1:dDF8EdHxS/1MN5qxyQhBChxybPHwOIRMFEevfU7PNls= +github.com/aws/aws-sdk-go-v2/service/sesv2 v1.17.1/go.mod h1:b/r6MD2q+mNSSbmWy2QLHpnEnXA/M/XFunNwPYl7iFM= github.com/aws/aws-sdk-go-v2/service/ssm v1.35.5 h1:x7FjoHx8A559fAHi0WMnrVxxk9iXwyj1UK5S7TrqFAM= github.com/aws/aws-sdk-go-v2/service/ssm v1.35.5/go.mod h1:DlzAqaXaUSJVQGuZrGPb4TWTkDG6vUs5OiIoX0AxjkU= github.com/aws/aws-sdk-go-v2/service/ssmcontacts v1.14.5 h1:cMy9iY65vX8QOd2BYJo85IFjPqFvpIiM7Jow5pbLefw= From eadc7c16b5a0dc370d9c0de2f244c347ec4385de Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 13 Mar 2023 07:14:20 +0000 Subject: [PATCH 691/763] build(deps): bump github.com/aws/aws-sdk-go-v2/service/route53domains Bumps [github.com/aws/aws-sdk-go-v2/service/route53domains](https://github.com/aws/aws-sdk-go-v2) from 1.14.4 to 1.14.5. - [Release notes](https://github.com/aws/aws-sdk-go-v2/releases) - [Changelog](https://github.com/aws/aws-sdk-go-v2/blob/main/CHANGELOG.md) - [Commits](https://github.com/aws/aws-sdk-go-v2/compare/service/mq/v1.14.4...service/mq/v1.14.5) --- updated-dependencies: - dependency-name: github.com/aws/aws-sdk-go-v2/service/route53domains dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 2f7b05adfd5e..22dffd4a6874 100644 --- a/go.mod +++ b/go.mod @@ -27,7 +27,7 @@ require ( github.com/aws/aws-sdk-go-v2/service/rds v1.40.5 github.com/aws/aws-sdk-go-v2/service/resourceexplorer2 v1.2.5 github.com/aws/aws-sdk-go-v2/service/rolesanywhere v1.1.5 - github.com/aws/aws-sdk-go-v2/service/route53domains v1.14.4 + github.com/aws/aws-sdk-go-v2/service/route53domains v1.14.5 github.com/aws/aws-sdk-go-v2/service/s3control v1.29.5 github.com/aws/aws-sdk-go-v2/service/scheduler v1.1.5 github.com/aws/aws-sdk-go-v2/service/sesv2 v1.17.1 diff --git a/go.sum b/go.sum index b546279cbf4a..7810f4577faf 100644 --- a/go.sum +++ b/go.sum @@ -93,8 +93,8 @@ github.com/aws/aws-sdk-go-v2/service/resourceexplorer2 v1.2.5 h1:+F3ULspZOOeUy3L github.com/aws/aws-sdk-go-v2/service/resourceexplorer2 v1.2.5/go.mod h1:9qmFEhCHjKM1+oO2XlzI5adhgfbTdyaDK5joeHLr2WM= github.com/aws/aws-sdk-go-v2/service/rolesanywhere v1.1.5 h1:ywT18Rmkr/cWcJSJNyLOF3lJIHGozt1NH7B+QyTceZw= github.com/aws/aws-sdk-go-v2/service/rolesanywhere v1.1.5/go.mod h1:YER6EnZk8ud7mEHI4SeHtpE6VjIaOuD1a/ayUegKaB0= -github.com/aws/aws-sdk-go-v2/service/route53domains v1.14.4 h1:/1qBMwOZb/2ua5jFMc8xmLUxHz7VNt70Zx2fKLoZ40M= -github.com/aws/aws-sdk-go-v2/service/route53domains v1.14.4/go.mod h1:MSwXvIWYZIBgC1otPRfafXbiOIdihO36INeOhqCciao= +github.com/aws/aws-sdk-go-v2/service/route53domains v1.14.5 h1:W3jd8OfMmkr0lhMC3MNhMf7WxpXMoFs7rQwHryjzDQg= +github.com/aws/aws-sdk-go-v2/service/route53domains v1.14.5/go.mod h1:fsgQ9e1bs7ZUgf64eTfsQFpP9iJJ13o33KJWIXnPI8s= github.com/aws/aws-sdk-go-v2/service/s3control v1.29.5 h1:64MXeSwJp35lJ9kvP01EEYxI0uW5P+cOXBECFhLq9Og= github.com/aws/aws-sdk-go-v2/service/s3control v1.29.5/go.mod h1:u9sP19O4PvfQMvFeScgmemf+YxSRkySPQNQgxQgDKNQ= github.com/aws/aws-sdk-go-v2/service/scheduler v1.1.5 h1:c4H0lPUXeo9XlMQ9fSskG8yYscq8/HNINnN3NlpQ2wI= From 20f275f7e89013a576941db7e910265989e9fce0 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 13 Mar 2023 07:15:23 +0000 Subject: [PATCH 692/763] build(deps): bump github.com/aws/aws-sdk-go-v2/service/rolesanywhere Bumps [github.com/aws/aws-sdk-go-v2/service/rolesanywhere](https://github.com/aws/aws-sdk-go-v2) from 1.1.5 to 1.1.6. - [Release notes](https://github.com/aws/aws-sdk-go-v2/releases) - [Changelog](https://github.com/aws/aws-sdk-go-v2/blob/main/CHANGELOG.md) - [Commits](https://github.com/aws/aws-sdk-go-v2/compare/config/v1.1.5...config/v1.1.6) --- updated-dependencies: - dependency-name: github.com/aws/aws-sdk-go-v2/service/rolesanywhere dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 22dffd4a6874..baefb1ba8421 100644 --- a/go.mod +++ b/go.mod @@ -26,7 +26,7 @@ require ( github.com/aws/aws-sdk-go-v2/service/pipes v1.2.1 github.com/aws/aws-sdk-go-v2/service/rds v1.40.5 github.com/aws/aws-sdk-go-v2/service/resourceexplorer2 v1.2.5 - github.com/aws/aws-sdk-go-v2/service/rolesanywhere v1.1.5 + github.com/aws/aws-sdk-go-v2/service/rolesanywhere v1.1.6 github.com/aws/aws-sdk-go-v2/service/route53domains v1.14.5 github.com/aws/aws-sdk-go-v2/service/s3control v1.29.5 github.com/aws/aws-sdk-go-v2/service/scheduler v1.1.5 diff --git a/go.sum b/go.sum index 7810f4577faf..0de09b1ad238 100644 --- a/go.sum +++ b/go.sum @@ -91,8 +91,8 @@ github.com/aws/aws-sdk-go-v2/service/rds v1.40.5 h1:m4v9hSOgnLmSDbdVdNT0H8GTY6ti github.com/aws/aws-sdk-go-v2/service/rds v1.40.5/go.mod h1:994zebv5Cj1WoGzo3zrrscm1zBLFvGwoA3ve1eVYNVQ= github.com/aws/aws-sdk-go-v2/service/resourceexplorer2 v1.2.5 h1:+F3ULspZOOeUy3LWcIrTguJdO1/A1llhML7alifHldQ= github.com/aws/aws-sdk-go-v2/service/resourceexplorer2 v1.2.5/go.mod h1:9qmFEhCHjKM1+oO2XlzI5adhgfbTdyaDK5joeHLr2WM= -github.com/aws/aws-sdk-go-v2/service/rolesanywhere v1.1.5 h1:ywT18Rmkr/cWcJSJNyLOF3lJIHGozt1NH7B+QyTceZw= -github.com/aws/aws-sdk-go-v2/service/rolesanywhere v1.1.5/go.mod h1:YER6EnZk8ud7mEHI4SeHtpE6VjIaOuD1a/ayUegKaB0= +github.com/aws/aws-sdk-go-v2/service/rolesanywhere v1.1.6 h1:Fzl9/XspAWWsgERARa8iOnKTo1dgt/KEJhVope0RvkY= +github.com/aws/aws-sdk-go-v2/service/rolesanywhere v1.1.6/go.mod h1:PO0JAnohvB5VPwedVzpiY8ZGdgamnweWsx/+yi1jZxc= github.com/aws/aws-sdk-go-v2/service/route53domains v1.14.5 h1:W3jd8OfMmkr0lhMC3MNhMf7WxpXMoFs7rQwHryjzDQg= github.com/aws/aws-sdk-go-v2/service/route53domains v1.14.5/go.mod h1:fsgQ9e1bs7ZUgf64eTfsQFpP9iJJ13o33KJWIXnPI8s= github.com/aws/aws-sdk-go-v2/service/s3control v1.29.5 h1:64MXeSwJp35lJ9kvP01EEYxI0uW5P+cOXBECFhLq9Og= From 32601261ff180b5956166d779b32164d0080862b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 13 Mar 2023 07:16:18 +0000 Subject: [PATCH 693/763] build(deps): bump github.com/aws/aws-sdk-go-v2/service/identitystore Bumps [github.com/aws/aws-sdk-go-v2/service/identitystore](https://github.com/aws/aws-sdk-go-v2) from 1.16.4 to 1.16.5. - [Release notes](https://github.com/aws/aws-sdk-go-v2/releases) - [Changelog](https://github.com/aws/aws-sdk-go-v2/blob/main/CHANGELOG.md) - [Commits](https://github.com/aws/aws-sdk-go-v2/compare/v1.16.4...v1.16.5) --- updated-dependencies: - dependency-name: github.com/aws/aws-sdk-go-v2/service/identitystore dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index baefb1ba8421..a3f4234f2267 100644 --- a/go.mod +++ b/go.mod @@ -15,7 +15,7 @@ require ( github.com/aws/aws-sdk-go-v2/service/ec2 v1.89.0 github.com/aws/aws-sdk-go-v2/service/fis v1.14.5 github.com/aws/aws-sdk-go-v2/service/healthlake v1.15.5 - github.com/aws/aws-sdk-go-v2/service/identitystore v1.16.4 + github.com/aws/aws-sdk-go-v2/service/identitystore v1.16.5 github.com/aws/aws-sdk-go-v2/service/inspector2 v1.11.6 github.com/aws/aws-sdk-go-v2/service/ivschat v1.4.0 github.com/aws/aws-sdk-go-v2/service/kendra v1.38.5 diff --git a/go.sum b/go.sum index 0de09b1ad238..7375a124a666 100644 --- a/go.sum +++ b/go.sum @@ -64,8 +64,8 @@ github.com/aws/aws-sdk-go-v2/service/healthlake v1.15.5 h1:9O+XnH1SGXV9J9yr2d2p9 github.com/aws/aws-sdk-go-v2/service/healthlake v1.15.5/go.mod h1:hZLFihMKaVykypz8xRMpOTJtng9RV64rNnRxkt93U00= github.com/aws/aws-sdk-go-v2/service/iam v1.19.4 h1:hrBxgoUih7uy9sJTXrX0N/3TVgbmevlxEYsP9l+Lje4= github.com/aws/aws-sdk-go-v2/service/iam v1.19.4/go.mod h1:F5Xt96+AfAiyMpRXHy9CKafE/KULVwj7MwgZ0a4row4= -github.com/aws/aws-sdk-go-v2/service/identitystore v1.16.4 h1:WmE4yfzKZBgSLdLOG8/pWekHSskhXNX+7HXeWire/II= -github.com/aws/aws-sdk-go-v2/service/identitystore v1.16.4/go.mod h1:b/31AIODyxR/m34zRvUXs/mjF7pLAwS6IHIfl0kdRYc= +github.com/aws/aws-sdk-go-v2/service/identitystore v1.16.5 h1:Mbz3LjbbVE6fFwYEYf2cJFcmFmIOZhSOyuTGYY0CzgQ= +github.com/aws/aws-sdk-go-v2/service/identitystore v1.16.5/go.mod h1:ZMSJuu9//YKamgC3vArYkljfp2wjbtwdqYAwclNfhXY= github.com/aws/aws-sdk-go-v2/service/inspector2 v1.11.6 h1:LtoRGfh9b+aLxVSgVSjXAmPePYGvbzVTfcXdopKokuI= github.com/aws/aws-sdk-go-v2/service/inspector2 v1.11.6/go.mod h1:w5tN/JjIMU0RycBR1oQ46dhIq8eWpCR1Ggp0y6zPuZE= github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.9.22/go.mod h1:xt0Au8yPIwYXf/GYPy/vl4K3CgwhfQMYbrH7DlUUIws= From 40416e357b8636fdc800bd274d418cd30341b3bd Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 13 Mar 2023 07:17:09 +0000 Subject: [PATCH 694/763] build(deps): bump github.com/aws/aws-sdk-go-v2/service/ssmincidents Bumps [github.com/aws/aws-sdk-go-v2/service/ssmincidents](https://github.com/aws/aws-sdk-go-v2) from 1.20.4 to 1.20.5. - [Release notes](https://github.com/aws/aws-sdk-go-v2/releases) - [Changelog](https://github.com/aws/aws-sdk-go-v2/blob/main/CHANGELOG.md) - [Commits](https://github.com/aws/aws-sdk-go-v2/compare/service/eks/v1.20.4...service/eks/v1.20.5) --- updated-dependencies: - dependency-name: github.com/aws/aws-sdk-go-v2/service/ssmincidents dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- go.mod | 4 ++-- go.sum | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/go.mod b/go.mod index a3f4234f2267..acb11baafc4f 100644 --- a/go.mod +++ b/go.mod @@ -33,8 +33,8 @@ require ( github.com/aws/aws-sdk-go-v2/service/sesv2 v1.17.1 github.com/aws/aws-sdk-go-v2/service/ssm v1.35.5 github.com/aws/aws-sdk-go-v2/service/ssmcontacts v1.14.5 - github.com/aws/aws-sdk-go-v2/service/ssmincidents v1.20.4 - github.com/aws/aws-sdk-go-v2/service/transcribe v1.26.1 + github.com/aws/aws-sdk-go-v2/service/ssmincidents v1.20.5 + github.com/aws/aws-sdk-go-v2/service/transcribe v1.26.0 github.com/aws/smithy-go v1.13.5 github.com/beevik/etree v1.1.0 github.com/google/go-cmp v0.5.9 diff --git a/go.sum b/go.sum index 7375a124a666..6a7a18ea3a2c 100644 --- a/go.sum +++ b/go.sum @@ -105,8 +105,8 @@ github.com/aws/aws-sdk-go-v2/service/ssm v1.35.5 h1:x7FjoHx8A559fAHi0WMnrVxxk9iX github.com/aws/aws-sdk-go-v2/service/ssm v1.35.5/go.mod h1:DlzAqaXaUSJVQGuZrGPb4TWTkDG6vUs5OiIoX0AxjkU= github.com/aws/aws-sdk-go-v2/service/ssmcontacts v1.14.5 h1:cMy9iY65vX8QOd2BYJo85IFjPqFvpIiM7Jow5pbLefw= github.com/aws/aws-sdk-go-v2/service/ssmcontacts v1.14.5/go.mod h1:bP0RQ1FZXmrFeOoiq6Uv4UYgkLLcJuDlPkzoob0WlbI= -github.com/aws/aws-sdk-go-v2/service/ssmincidents v1.20.4 h1:gglh7K4VN15y6ENH2wM16TO6E0MgiLtKh2CCSHkCQuM= -github.com/aws/aws-sdk-go-v2/service/ssmincidents v1.20.4/go.mod h1:hYnjkk6Qz1eI1aXZVWXdmcyb3HGK1sPAFM8efXREt5Q= +github.com/aws/aws-sdk-go-v2/service/ssmincidents v1.20.5 h1:IlsNCrIQVjqtGMogOLkC7zK7HbJFUG7gyRxCLJ+Cu4Q= +github.com/aws/aws-sdk-go-v2/service/ssmincidents v1.20.5/go.mod h1:F6SzQwUsHF2o4FMW3L7/+bgQKrMvUEUhJgpEZ9xQ1Ns= github.com/aws/aws-sdk-go-v2/service/sso v1.12.1/go.mod h1:IgV8l3sj22nQDd5qcAGY0WenwCzCphqdbFOpfktZPrI= github.com/aws/aws-sdk-go-v2/service/sso v1.12.4 h1:qJdM48OOLl1FBSzI7ZrA1ZfLwOyCYqkXV5lko1hYDBw= github.com/aws/aws-sdk-go-v2/service/sso v1.12.4/go.mod h1:jtLIhd+V+lft6ktxpItycqHqiVXrPIRjWIsFIlzMriw= @@ -116,8 +116,8 @@ github.com/aws/aws-sdk-go-v2/service/ssooidc v1.14.4/go.mod h1:zVwRrfdSmbRZWkUkW github.com/aws/aws-sdk-go-v2/service/sts v1.18.3/go.mod h1:b+psTJn33Q4qGoDaM7ZiOVVG8uVjGI6HaZ8WBHdgDgU= github.com/aws/aws-sdk-go-v2/service/sts v1.18.5 h1:L1600eLr0YvTT7gNh3Ni24yGI7NSHkq9Gp62vijPRCs= github.com/aws/aws-sdk-go-v2/service/sts v1.18.5/go.mod h1:1mKZHLLpDMHTNSYPJ7qrcnCQdHCWsNQaT0xRvq2u80s= -github.com/aws/aws-sdk-go-v2/service/transcribe v1.26.1 h1:gLvQJbkj0GKQ17FP2eyIJ6bTpE5IEIcPpVSOuwaaRck= -github.com/aws/aws-sdk-go-v2/service/transcribe v1.26.1/go.mod h1:dS0jryOiMP8aMos6KC4y+B7cWoz10YlH7Cq8ivdBq7s= +github.com/aws/aws-sdk-go-v2/service/transcribe v1.26.0 h1:3cwoie+qJvBJWOa9r/1AONz9XgrcLSWnL37rHNRMS6s= +github.com/aws/aws-sdk-go-v2/service/transcribe v1.26.0/go.mod h1:Sfekn5aPGiTP+22/2DOuE6WoVBY19xfW6esh0HjdgzQ= github.com/aws/smithy-go v1.13.5 h1:hgz0X/DX0dGqTYpGALqXJoRKRj5oQ7150i5FdTePzO8= github.com/aws/smithy-go v1.13.5/go.mod h1:Tg+OJXh4MB2R/uN61Ko2f6hTZwB/ZYGOtib8J3gBHzA= github.com/beevik/etree v1.1.0 h1:T0xke/WvNtMoCqgzPhkX2r4rjY3GDZFi+FjpRZY2Jbs= From f5dc42026c262856ec2ec7938dcc020109341587 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 13 Mar 2023 07:25:35 +0000 Subject: [PATCH 695/763] build(deps): bump github.com/aws/aws-sdk-go from 1.44.218 to 1.44.219 Bumps [github.com/aws/aws-sdk-go](https://github.com/aws/aws-sdk-go) from 1.44.218 to 1.44.219. - [Release notes](https://github.com/aws/aws-sdk-go/releases) - [Commits](https://github.com/aws/aws-sdk-go/compare/v1.44.218...v1.44.219) --- updated-dependencies: - dependency-name: github.com/aws/aws-sdk-go dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index acb11baafc4f..7c943b715906 100644 --- a/go.mod +++ b/go.mod @@ -4,7 +4,7 @@ go 1.19 require ( github.com/ProtonMail/go-crypto v0.0.0-20230201104953-d1d05f4e2bfb - github.com/aws/aws-sdk-go v1.44.218 + github.com/aws/aws-sdk-go v1.44.219 github.com/aws/aws-sdk-go-v2 v1.17.6 github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.12.23 github.com/aws/aws-sdk-go-v2/service/auditmanager v1.24.2 diff --git a/go.sum b/go.sum index 6a7a18ea3a2c..b1ce9766cff2 100644 --- a/go.sum +++ b/go.sum @@ -23,8 +23,8 @@ github.com/apparentlymart/go-textseg/v13 v13.0.0/go.mod h1:ZK2fH7c4NqDTLtiYLvIkE github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310 h1:BUAU3CGlLvorLI26FmByPp2eC2qla6E1Tw+scpcg/to= github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5/go.mod h1:wHh0iHkYZB8zMSxRWpUBQtwG5a7fFgvEO+odwuTv2gs= -github.com/aws/aws-sdk-go v1.44.218 h1:p707+xOCazWhkSpZOeyhtTcg7Z+asxxvueGgYPSitn4= -github.com/aws/aws-sdk-go v1.44.218/go.mod h1:aVsgQcEevwlmQ7qHE9I3h+dtQgpqhFB+i8Phjh7fkwI= +github.com/aws/aws-sdk-go v1.44.219 h1:YOFxTUQZvdRzgwb6XqLFRwNHxoUdKBuunITC7IFhvbc= +github.com/aws/aws-sdk-go v1.44.219/go.mod h1:aVsgQcEevwlmQ7qHE9I3h+dtQgpqhFB+i8Phjh7fkwI= github.com/aws/aws-sdk-go-v2 v1.17.4/go.mod h1:uzbQtefpm44goOPmdKyAlXSNcwlRgF3ePWVW6EtJvvw= github.com/aws/aws-sdk-go-v2 v1.17.5/go.mod h1:uzbQtefpm44goOPmdKyAlXSNcwlRgF3ePWVW6EtJvvw= github.com/aws/aws-sdk-go-v2 v1.17.6 h1:Y773UK7OBqhzi5VDXMi1zVGsoj+CVHs2eaC2bDsLwi0= From 0907ec37efea4e282a89a08e28a326913bbcbfe9 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 13 Mar 2023 07:18:09 +0000 Subject: [PATCH 696/763] build(deps): bump github.com/aws/aws-sdk-go-v2/service/medialive Bumps [github.com/aws/aws-sdk-go-v2/service/medialive](https://github.com/aws/aws-sdk-go-v2) from 1.30.0 to 1.30.1. - [Release notes](https://github.com/aws/aws-sdk-go-v2/releases) - [Changelog](https://github.com/aws/aws-sdk-go-v2/blob/main/CHANGELOG.md) - [Commits](https://github.com/aws/aws-sdk-go-v2/compare/service/s3/v1.30.0...service/s3/v1.30.1) --- updated-dependencies: - dependency-name: github.com/aws/aws-sdk-go-v2/service/medialive dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] From ed744cfef4c3ad8be4a8d54d2738160dbfa7ad67 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 13 Mar 2023 07:19:15 +0000 Subject: [PATCH 697/763] build(deps): bump github.com/aws/aws-sdk-go-v2/service/kendra Bumps [github.com/aws/aws-sdk-go-v2/service/kendra](https://github.com/aws/aws-sdk-go-v2) from 1.38.5 to 1.38.6. - [Release notes](https://github.com/aws/aws-sdk-go-v2/releases) - [Changelog](https://github.com/aws/aws-sdk-go-v2/blob/main/CHANGELOG.md) - [Commits](https://github.com/aws/aws-sdk-go-v2/compare/service/kendra/v1.38.5...service/kendra/v1.38.6) --- updated-dependencies: - dependency-name: github.com/aws/aws-sdk-go-v2/service/kendra dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] From 8efd692d3c5dcdb544c1b3894fd4cc5f01526c9d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 13 Mar 2023 07:20:06 +0000 Subject: [PATCH 698/763] build(deps): bump github.com/aws/aws-sdk-go-v2/service/comprehend Bumps [github.com/aws/aws-sdk-go-v2/service/comprehend](https://github.com/aws/aws-sdk-go-v2) from 1.22.0 to 1.22.1. - [Release notes](https://github.com/aws/aws-sdk-go-v2/releases) - [Changelog](https://github.com/aws/aws-sdk-go-v2/blob/main/CHANGELOG.md) - [Commits](https://github.com/aws/aws-sdk-go-v2/compare/service/s3/v1.22.0...service/eks/v1.22.1) --- updated-dependencies: - dependency-name: github.com/aws/aws-sdk-go-v2/service/comprehend dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] From a0ef181f664898b63d87b5dff25e5218752c8dc8 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 13 Mar 2023 07:21:08 +0000 Subject: [PATCH 699/763] build(deps): bump github.com/aws/aws-sdk-go-v2/service/ssm Bumps [github.com/aws/aws-sdk-go-v2/service/ssm](https://github.com/aws/aws-sdk-go-v2) from 1.35.5 to 1.35.6. - [Release notes](https://github.com/aws/aws-sdk-go-v2/releases) - [Changelog](https://github.com/aws/aws-sdk-go-v2/blob/main/CHANGELOG.md) - [Commits](https://github.com/aws/aws-sdk-go-v2/compare/service/ssm/v1.35.5...service/ssm/v1.35.6) --- updated-dependencies: - dependency-name: github.com/aws/aws-sdk-go-v2/service/ssm dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] From 117031f5e21ee1c118c3ffb1786d75a94a95a1d9 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 13 Mar 2023 07:22:07 +0000 Subject: [PATCH 700/763] build(deps): bump github.com/aws/aws-sdk-go-v2/feature/ec2/imds Bumps [github.com/aws/aws-sdk-go-v2/feature/ec2/imds](https://github.com/aws/aws-sdk-go-v2) from 1.12.23 to 1.12.24. - [Release notes](https://github.com/aws/aws-sdk-go-v2/releases) - [Changelog](https://github.com/aws/aws-sdk-go-v2/blob/main/CHANGELOG.md) - [Commits](https://github.com/aws/aws-sdk-go-v2/compare/credentials/v1.12.23...credentials/v1.12.24) --- updated-dependencies: - dependency-name: github.com/aws/aws-sdk-go-v2/feature/ec2/imds dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- go.sum | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/go.sum b/go.sum index b1ce9766cff2..30bdb9833a09 100644 --- a/go.sum +++ b/go.sum @@ -34,8 +34,8 @@ github.com/aws/aws-sdk-go-v2/config v1.18.12/go.mod h1:J36fOhj1LQBr+O4hJCiT8FwVv github.com/aws/aws-sdk-go-v2/credentials v1.13.12 h1:Cb+HhuEnV19zHRaYYVglwvdHGMJWbdsyP4oHhw04xws= github.com/aws/aws-sdk-go-v2/credentials v1.13.12/go.mod h1:37HG2MBroXK3jXfxVGtbM2J48ra2+Ltu+tmwr/jO0KA= github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.12.22/go.mod h1:YGSIJyQ6D6FjKMQh16hVFSIUD54L4F7zTGePqYMYYJU= -github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.12.23 h1:Kbiv9PGnQfG/imNI4L/heyUXvzKmcWSBeDvkrQz5pFc= -github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.12.23/go.mod h1:mOtmAg65GT1HIL/HT/PynwPbS+UG0BgCZ6vhkPqnxWo= +github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.12.24 h1:5qyqXASrX2zy5cTnoHHa4N2c3Lc94GH7gjnBP3GwKdU= +github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.12.24/go.mod h1:neYVaeKr5eT7BzwULuG2YbLhzWZ22lpjKdCybR7AXrQ= github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.28/go.mod h1:3lwChorpIM/BhImY/hy+Z6jekmN92cXGPI1QJasVPYY= github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.29/go.mod h1:Dip3sIGv485+xerzVv24emnjX5Sg88utCL8fwGmCeWg= github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.30 h1:y+8n9AGDjikyXoMBTRaHHHSaFEB8267ykmvyPodJfys= From f9264d50e7e212a5597389f4dd4e9802d4e769c7 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 13 Mar 2023 07:23:14 +0000 Subject: [PATCH 701/763] build(deps): bump github.com/aws/aws-sdk-go-v2/service/rds Bumps [github.com/aws/aws-sdk-go-v2/service/rds](https://github.com/aws/aws-sdk-go-v2) from 1.40.5 to 1.40.6. - [Release notes](https://github.com/aws/aws-sdk-go-v2/releases) - [Changelog](https://github.com/aws/aws-sdk-go-v2/blob/main/CHANGELOG.md) - [Commits](https://github.com/aws/aws-sdk-go-v2/compare/service/rds/v1.40.5...service/rds/v1.40.6) --- updated-dependencies: - dependency-name: github.com/aws/aws-sdk-go-v2/service/rds dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- go.sum | 1 - 1 file changed, 1 deletion(-) diff --git a/go.sum b/go.sum index 30bdb9833a09..7c3c83d21bf6 100644 --- a/go.sum +++ b/go.sum @@ -69,7 +69,6 @@ github.com/aws/aws-sdk-go-v2/service/identitystore v1.16.5/go.mod h1:ZMSJuu9//YK github.com/aws/aws-sdk-go-v2/service/inspector2 v1.11.6 h1:LtoRGfh9b+aLxVSgVSjXAmPePYGvbzVTfcXdopKokuI= github.com/aws/aws-sdk-go-v2/service/inspector2 v1.11.6/go.mod h1:w5tN/JjIMU0RycBR1oQ46dhIq8eWpCR1Ggp0y6zPuZE= github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.9.22/go.mod h1:xt0Au8yPIwYXf/GYPy/vl4K3CgwhfQMYbrH7DlUUIws= -github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.9.23 h1:QoOybhwRfciWUBbZ0gp9S7XaDnCuSTeK/fySB99V1ls= github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.9.23/go.mod h1:9uPh+Hrz2Vn6oMnQYiUi/zbh3ovbnQk19YKINkQny44= github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.13.24 h1:i4RH8DLv/BHY0fCrXYQDr+DGnWzaxB3Ee/esxUaSavk= github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.13.24/go.mod h1:N8X45/o2cngvjCYi2ZnvI0P4mU4ZRJfEYC3maCSsPyw= From 188220575cc675853d765939ad5191d327fd2064 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 13 Mar 2023 07:24:18 +0000 Subject: [PATCH 702/763] build(deps): bump github.com/aws/aws-sdk-go-v2/service/opensearchserverless Bumps [github.com/aws/aws-sdk-go-v2/service/opensearchserverless](https://github.com/aws/aws-sdk-go-v2) from 1.1.5 to 1.1.6. - [Release notes](https://github.com/aws/aws-sdk-go-v2/releases) - [Changelog](https://github.com/aws/aws-sdk-go-v2/blob/main/CHANGELOG.md) - [Commits](https://github.com/aws/aws-sdk-go-v2/compare/config/v1.1.5...config/v1.1.6) --- updated-dependencies: - dependency-name: github.com/aws/aws-sdk-go-v2/service/opensearchserverless dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] From ac6277931c12ed3335a5698d4ab3958c1be2c002 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 13 Mar 2023 07:25:18 +0000 Subject: [PATCH 703/763] build(deps): bump github.com/aws/aws-sdk-go-v2/service/resourceexplorer2 Bumps [github.com/aws/aws-sdk-go-v2/service/resourceexplorer2](https://github.com/aws/aws-sdk-go-v2) from 1.2.5 to 1.2.6. - [Release notes](https://github.com/aws/aws-sdk-go-v2/releases) - [Changelog](https://github.com/aws/aws-sdk-go-v2/blob/main/CHANGELOG.md) - [Commits](https://github.com/aws/aws-sdk-go-v2/compare/internal/ini/v1.2.5...feature/rds/auth/v1.2.6) --- updated-dependencies: - dependency-name: github.com/aws/aws-sdk-go-v2/service/resourceexplorer2 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] From 9b369b9248e2ad3de08771969428eef4b1386f36 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 13 Mar 2023 07:26:21 +0000 Subject: [PATCH 704/763] build(deps): bump github.com/aws/aws-sdk-go-v2/service/cloudcontrol Bumps [github.com/aws/aws-sdk-go-v2/service/cloudcontrol](https://github.com/aws/aws-sdk-go-v2) from 1.11.5 to 1.11.6. - [Release notes](https://github.com/aws/aws-sdk-go-v2/releases) - [Changelog](https://github.com/aws/aws-sdk-go-v2/blob/main/CHANGELOG.md) - [Commits](https://github.com/aws/aws-sdk-go-v2/compare/service/dax/v1.11.5...service/dax/v1.11.6) --- updated-dependencies: - dependency-name: github.com/aws/aws-sdk-go-v2/service/cloudcontrol dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] From 279bef7595fd3be04b5a113172e737c792d0bd1d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 13 Mar 2023 07:28:11 +0000 Subject: [PATCH 705/763] build(deps): bump github.com/aws/aws-sdk-go-v2/service/ec2 Bumps [github.com/aws/aws-sdk-go-v2/service/ec2](https://github.com/aws/aws-sdk-go-v2) from 1.89.0 to 1.89.1. - [Release notes](https://github.com/aws/aws-sdk-go-v2/releases) - [Changelog](https://github.com/aws/aws-sdk-go-v2/blob/main/CHANGELOG.md) - [Commits](https://github.com/aws/aws-sdk-go-v2/compare/service/ec2/v1.89.0...service/ec2/v1.89.1) --- updated-dependencies: - dependency-name: github.com/aws/aws-sdk-go-v2/service/ec2 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] From 60274a0fd13cd797a2fd515e27317e81cf61b0df Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 13 Mar 2023 07:27:17 +0000 Subject: [PATCH 706/763] build(deps): bump github.com/aws/aws-sdk-go-v2/service/lambda Bumps [github.com/aws/aws-sdk-go-v2/service/lambda](https://github.com/aws/aws-sdk-go-v2) from 1.30.0 to 1.30.1. - [Release notes](https://github.com/aws/aws-sdk-go-v2/releases) - [Changelog](https://github.com/aws/aws-sdk-go-v2/blob/main/CHANGELOG.md) - [Commits](https://github.com/aws/aws-sdk-go-v2/compare/service/s3/v1.30.0...service/s3/v1.30.1) --- updated-dependencies: - dependency-name: github.com/aws/aws-sdk-go-v2/service/lambda dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 7c943b715906..8aeb2f144ab9 100644 --- a/go.mod +++ b/go.mod @@ -19,7 +19,7 @@ require ( github.com/aws/aws-sdk-go-v2/service/inspector2 v1.11.6 github.com/aws/aws-sdk-go-v2/service/ivschat v1.4.0 github.com/aws/aws-sdk-go-v2/service/kendra v1.38.5 - github.com/aws/aws-sdk-go-v2/service/lambda v1.30.0 + github.com/aws/aws-sdk-go-v2/service/lambda v1.30.1 github.com/aws/aws-sdk-go-v2/service/medialive v1.30.0 github.com/aws/aws-sdk-go-v2/service/oam v1.1.6 github.com/aws/aws-sdk-go-v2/service/opensearchserverless v1.1.5 diff --git a/go.sum b/go.sum index 7c3c83d21bf6..4cf21f632453 100644 --- a/go.sum +++ b/go.sum @@ -76,8 +76,8 @@ github.com/aws/aws-sdk-go-v2/service/ivschat v1.4.0 h1:KmTUwjxQ/WzS64jhqwXpjngif github.com/aws/aws-sdk-go-v2/service/ivschat v1.4.0/go.mod h1:Xwv56usY/pQjpXTB5kZitJlGaQT+jMpxZ3d/RksI1Tg= github.com/aws/aws-sdk-go-v2/service/kendra v1.38.5 h1:vYyn1h1+/eRL8UxfzRgxhH8tm+Jd6ujsyXmUFztfnks= github.com/aws/aws-sdk-go-v2/service/kendra v1.38.5/go.mod h1:PMq9hXXhaNxmBMIolmknhJ9gXi4PYDsZwsFBaJs7Zak= -github.com/aws/aws-sdk-go-v2/service/lambda v1.30.0 h1:i2AFUTfisQPZP0iZlUEJiGfOBxEN7Yy+d3zBfDYRmnQ= -github.com/aws/aws-sdk-go-v2/service/lambda v1.30.0/go.mod h1:iPDYs5hrSZ+/8Ifoq9ZpoiuHZXDEJx9Udurdoq20958= +github.com/aws/aws-sdk-go-v2/service/lambda v1.30.1 h1:cn7Aus/F0sUyARPhxRUcu7WJJ08xIurq3zmpaPHm15o= +github.com/aws/aws-sdk-go-v2/service/lambda v1.30.1/go.mod h1:mc/9GTdsVssN9PsId2/0hpWC5EAXXYym9qNhSXdSEsY= github.com/aws/aws-sdk-go-v2/service/medialive v1.30.0 h1:NkQZuHbEyoDDoyu0g4hpUrOV9fitbrZZkIHdXnEaSAA= github.com/aws/aws-sdk-go-v2/service/medialive v1.30.0/go.mod h1:MDHSj74ylVyTusJYPIoFhNXqwaD8W8cIf8yTEI7+ccc= github.com/aws/aws-sdk-go-v2/service/oam v1.1.6 h1:A5vCeU8BdCJRaEI/UvrY3amM3Lo3WZd7VzCDjIyE2Y8= From 8268d4b20f8bf005b053c51a1f0686c7922a4a03 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 13 Mar 2023 07:29:01 +0000 Subject: [PATCH 707/763] build(deps): bump github.com/aws/aws-sdk-go-v2/service/computeoptimizer Bumps [github.com/aws/aws-sdk-go-v2/service/computeoptimizer](https://github.com/aws/aws-sdk-go-v2) from 1.21.3 to 1.21.4. - [Release notes](https://github.com/aws/aws-sdk-go-v2/releases) - [Changelog](https://github.com/aws/aws-sdk-go-v2/blob/main/CHANGELOG.md) - [Commits](https://github.com/aws/aws-sdk-go-v2/compare/service/eks/v1.21.3...service/eks/v1.21.4) --- updated-dependencies: - dependency-name: github.com/aws/aws-sdk-go-v2/service/computeoptimizer dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 8aeb2f144ab9..d428225845d9 100644 --- a/go.mod +++ b/go.mod @@ -11,7 +11,7 @@ require ( github.com/aws/aws-sdk-go-v2/service/cloudcontrol v1.11.5 github.com/aws/aws-sdk-go-v2/service/cloudwatchlogs v1.20.6 github.com/aws/aws-sdk-go-v2/service/comprehend v1.22.0 - github.com/aws/aws-sdk-go-v2/service/computeoptimizer v1.21.3 + github.com/aws/aws-sdk-go-v2/service/computeoptimizer v1.21.4 github.com/aws/aws-sdk-go-v2/service/ec2 v1.89.0 github.com/aws/aws-sdk-go-v2/service/fis v1.14.5 github.com/aws/aws-sdk-go-v2/service/healthlake v1.15.5 diff --git a/go.sum b/go.sum index 4cf21f632453..e86ccfc73cb4 100644 --- a/go.sum +++ b/go.sum @@ -54,8 +54,8 @@ github.com/aws/aws-sdk-go-v2/service/cloudwatchlogs v1.20.6 h1:hT9mrvaUpx/T9gi6J github.com/aws/aws-sdk-go-v2/service/cloudwatchlogs v1.20.6/go.mod h1:kOHVSyc1cOsgOzB1MJViE4KteDEjosGukDWGrd9oOW0= github.com/aws/aws-sdk-go-v2/service/comprehend v1.22.0 h1:HfIi9A8XYph6xwnoevrO9LSSH4Fj0ld42/YbnzUWfy4= github.com/aws/aws-sdk-go-v2/service/comprehend v1.22.0/go.mod h1:wR/O51vYY5XCt2FzuaSgvHV36BozkKxKWW4NoDIXrlc= -github.com/aws/aws-sdk-go-v2/service/computeoptimizer v1.21.3 h1:JkWxBPjWWDKjVWjBoiIw9zbMA72Ynde66y5fInm9Q/g= -github.com/aws/aws-sdk-go-v2/service/computeoptimizer v1.21.3/go.mod h1:U4bKXeB586zd73RIAkJX+ZmUtwI00xLJhDKJ7+hTCO0= +github.com/aws/aws-sdk-go-v2/service/computeoptimizer v1.21.4 h1:4lnei6CLYjPH0m0Io93E0uENrIxdTQHaSKgiOtwBaOM= +github.com/aws/aws-sdk-go-v2/service/computeoptimizer v1.21.4/go.mod h1:dWtl9dlDyZsQQoyPxO6xwnXY0c1n2H6mege+iMEnSEk= github.com/aws/aws-sdk-go-v2/service/ec2 v1.89.0 h1:f/mZ9YbM+c429V/3ghExrw9bpM4kRzmjyNui7bnRkaE= github.com/aws/aws-sdk-go-v2/service/ec2 v1.89.0/go.mod h1:2HxUY7Pkfmt1uIhPrFp0/O6+0aGoLaGIN5tXp/rYDL8= github.com/aws/aws-sdk-go-v2/service/fis v1.14.5 h1:y9wcj0xCmf3i+1igp+PK9pALMQK7z72W1gHtcMQkVC0= From 29ca850b79aa39383a795ae0e077afe6823a25a9 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Mon, 13 Mar 2023 08:17:45 -0400 Subject: [PATCH 708/763] Upgrade to latest AWS SDK for Go v2 service modules. --- go.mod | 22 +++++++++++----------- go.sum | 38 ++++++++++++++++++++------------------ 2 files changed, 31 insertions(+), 29 deletions(-) diff --git a/go.mod b/go.mod index d428225845d9..7a75f1e97cbe 100644 --- a/go.mod +++ b/go.mod @@ -6,32 +6,32 @@ require ( github.com/ProtonMail/go-crypto v0.0.0-20230201104953-d1d05f4e2bfb github.com/aws/aws-sdk-go v1.44.219 github.com/aws/aws-sdk-go-v2 v1.17.6 - github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.12.23 + github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.12.24 github.com/aws/aws-sdk-go-v2/service/auditmanager v1.24.2 - github.com/aws/aws-sdk-go-v2/service/cloudcontrol v1.11.5 + github.com/aws/aws-sdk-go-v2/service/cloudcontrol v1.11.6 github.com/aws/aws-sdk-go-v2/service/cloudwatchlogs v1.20.6 - github.com/aws/aws-sdk-go-v2/service/comprehend v1.22.0 + github.com/aws/aws-sdk-go-v2/service/comprehend v1.22.1 github.com/aws/aws-sdk-go-v2/service/computeoptimizer v1.21.4 - github.com/aws/aws-sdk-go-v2/service/ec2 v1.89.0 + github.com/aws/aws-sdk-go-v2/service/ec2 v1.89.1 github.com/aws/aws-sdk-go-v2/service/fis v1.14.5 github.com/aws/aws-sdk-go-v2/service/healthlake v1.15.5 github.com/aws/aws-sdk-go-v2/service/identitystore v1.16.5 github.com/aws/aws-sdk-go-v2/service/inspector2 v1.11.6 github.com/aws/aws-sdk-go-v2/service/ivschat v1.4.0 - github.com/aws/aws-sdk-go-v2/service/kendra v1.38.5 + github.com/aws/aws-sdk-go-v2/service/kendra v1.38.6 github.com/aws/aws-sdk-go-v2/service/lambda v1.30.1 - github.com/aws/aws-sdk-go-v2/service/medialive v1.30.0 + github.com/aws/aws-sdk-go-v2/service/medialive v1.30.1 github.com/aws/aws-sdk-go-v2/service/oam v1.1.6 - github.com/aws/aws-sdk-go-v2/service/opensearchserverless v1.1.5 + github.com/aws/aws-sdk-go-v2/service/opensearchserverless v1.1.6 github.com/aws/aws-sdk-go-v2/service/pipes v1.2.1 - github.com/aws/aws-sdk-go-v2/service/rds v1.40.5 - github.com/aws/aws-sdk-go-v2/service/resourceexplorer2 v1.2.5 + github.com/aws/aws-sdk-go-v2/service/rds v1.40.6 + github.com/aws/aws-sdk-go-v2/service/resourceexplorer2 v1.2.6 github.com/aws/aws-sdk-go-v2/service/rolesanywhere v1.1.6 github.com/aws/aws-sdk-go-v2/service/route53domains v1.14.5 github.com/aws/aws-sdk-go-v2/service/s3control v1.29.5 github.com/aws/aws-sdk-go-v2/service/scheduler v1.1.5 github.com/aws/aws-sdk-go-v2/service/sesv2 v1.17.1 - github.com/aws/aws-sdk-go-v2/service/ssm v1.35.5 + github.com/aws/aws-sdk-go-v2/service/ssm v1.35.6 github.com/aws/aws-sdk-go-v2/service/ssmcontacts v1.14.5 github.com/aws/aws-sdk-go-v2/service/ssmincidents v1.20.5 github.com/aws/aws-sdk-go-v2/service/transcribe v1.26.0 @@ -84,7 +84,7 @@ require ( github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.24 // indirect github.com/aws/aws-sdk-go-v2/internal/ini v1.3.29 // indirect github.com/aws/aws-sdk-go-v2/service/iam v1.19.4 // indirect - github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.9.23 // indirect + github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.9.24 // indirect github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.13.24 // indirect github.com/aws/aws-sdk-go-v2/service/sso v1.12.4 // indirect github.com/aws/aws-sdk-go-v2/service/ssooidc v1.14.4 // indirect diff --git a/go.sum b/go.sum index e86ccfc73cb4..e4f2be9b51b4 100644 --- a/go.sum +++ b/go.sum @@ -48,16 +48,16 @@ github.com/aws/aws-sdk-go-v2/internal/ini v1.3.29 h1:J4xhFd6zHhdF9jPP0FQJ6WknzBb github.com/aws/aws-sdk-go-v2/internal/ini v1.3.29/go.mod h1:TwuqRBGzxjQJIwH16/fOZodwXt2Zxa9/cwJC5ke4j7s= github.com/aws/aws-sdk-go-v2/service/auditmanager v1.24.2 h1:pbelBMdI4/oPEjkw862jMnvKh2JiZgUvjUqCNWHj+M4= github.com/aws/aws-sdk-go-v2/service/auditmanager v1.24.2/go.mod h1:n8Qc8IoCTsytDk7JLqNRHsLgCoQjhHIphnPs4uV+esU= -github.com/aws/aws-sdk-go-v2/service/cloudcontrol v1.11.5 h1:+gZHaILpl4yTDHwAxWnNNyumYLRZJ86+o+MVI3KSoyk= -github.com/aws/aws-sdk-go-v2/service/cloudcontrol v1.11.5/go.mod h1:SlSHujpy5ECaG+b4zZPBomo6LSenfp4jOS/5ysPhsFE= +github.com/aws/aws-sdk-go-v2/service/cloudcontrol v1.11.6 h1:sje7c3VVzdGEnOIEK4ZbxJxF10is6zyFd/pOczByMlQ= +github.com/aws/aws-sdk-go-v2/service/cloudcontrol v1.11.6/go.mod h1:amppzN0qHx+8CoGKHqLKWPW+r9zVw6fqpcpu0olZZJ8= github.com/aws/aws-sdk-go-v2/service/cloudwatchlogs v1.20.6 h1:hT9mrvaUpx/T9gi6JkAI5uAmX+eTCI0ignb5YXNG/GU= github.com/aws/aws-sdk-go-v2/service/cloudwatchlogs v1.20.6/go.mod h1:kOHVSyc1cOsgOzB1MJViE4KteDEjosGukDWGrd9oOW0= -github.com/aws/aws-sdk-go-v2/service/comprehend v1.22.0 h1:HfIi9A8XYph6xwnoevrO9LSSH4Fj0ld42/YbnzUWfy4= -github.com/aws/aws-sdk-go-v2/service/comprehend v1.22.0/go.mod h1:wR/O51vYY5XCt2FzuaSgvHV36BozkKxKWW4NoDIXrlc= +github.com/aws/aws-sdk-go-v2/service/comprehend v1.22.1 h1:PM3LPgmbOKelThQ6k/4sAbylzQjyAecfdFG8AZzm6w8= +github.com/aws/aws-sdk-go-v2/service/comprehend v1.22.1/go.mod h1:jfcyde8HLCJFHGITnVbi02XyYtrLqoQI071d9KtUzgU= github.com/aws/aws-sdk-go-v2/service/computeoptimizer v1.21.4 h1:4lnei6CLYjPH0m0Io93E0uENrIxdTQHaSKgiOtwBaOM= github.com/aws/aws-sdk-go-v2/service/computeoptimizer v1.21.4/go.mod h1:dWtl9dlDyZsQQoyPxO6xwnXY0c1n2H6mege+iMEnSEk= -github.com/aws/aws-sdk-go-v2/service/ec2 v1.89.0 h1:f/mZ9YbM+c429V/3ghExrw9bpM4kRzmjyNui7bnRkaE= -github.com/aws/aws-sdk-go-v2/service/ec2 v1.89.0/go.mod h1:2HxUY7Pkfmt1uIhPrFp0/O6+0aGoLaGIN5tXp/rYDL8= +github.com/aws/aws-sdk-go-v2/service/ec2 v1.89.1 h1:2CO0T8ReHjH5TFjk9RHmAafJt4vk/wMlQtn3c9bNL5Y= +github.com/aws/aws-sdk-go-v2/service/ec2 v1.89.1/go.mod h1:zDr1uSSLVYc6KqXvrmqYkeqnfbmOOrbVloz4Eqsc83k= github.com/aws/aws-sdk-go-v2/service/fis v1.14.5 h1:y9wcj0xCmf3i+1igp+PK9pALMQK7z72W1gHtcMQkVC0= github.com/aws/aws-sdk-go-v2/service/fis v1.14.5/go.mod h1:DQ++Ekb5IvuYfc+lQN8qFDpIZPjE0bqS4vpUYcdvyu4= github.com/aws/aws-sdk-go-v2/service/healthlake v1.15.5 h1:9O+XnH1SGXV9J9yr2d2p9EweysA6bHI8ucmgQ2HjOUE= @@ -70,26 +70,28 @@ github.com/aws/aws-sdk-go-v2/service/inspector2 v1.11.6 h1:LtoRGfh9b+aLxVSgVSjXA github.com/aws/aws-sdk-go-v2/service/inspector2 v1.11.6/go.mod h1:w5tN/JjIMU0RycBR1oQ46dhIq8eWpCR1Ggp0y6zPuZE= github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.9.22/go.mod h1:xt0Au8yPIwYXf/GYPy/vl4K3CgwhfQMYbrH7DlUUIws= github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.9.23/go.mod h1:9uPh+Hrz2Vn6oMnQYiUi/zbh3ovbnQk19YKINkQny44= +github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.9.24 h1:c5qGfdbCHav6viBwiyDns3OXqhqAbGjfIB4uVu2ayhk= +github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.9.24/go.mod h1:HMA4FZG6fyib+NDo5bpIxX1EhYjrAOveZJY2YR0xrNE= github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.13.24 h1:i4RH8DLv/BHY0fCrXYQDr+DGnWzaxB3Ee/esxUaSavk= github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.13.24/go.mod h1:N8X45/o2cngvjCYi2ZnvI0P4mU4ZRJfEYC3maCSsPyw= github.com/aws/aws-sdk-go-v2/service/ivschat v1.4.0 h1:KmTUwjxQ/WzS64jhqwXpjngif7sAIscGUSkaw3Q7gV4= github.com/aws/aws-sdk-go-v2/service/ivschat v1.4.0/go.mod h1:Xwv56usY/pQjpXTB5kZitJlGaQT+jMpxZ3d/RksI1Tg= -github.com/aws/aws-sdk-go-v2/service/kendra v1.38.5 h1:vYyn1h1+/eRL8UxfzRgxhH8tm+Jd6ujsyXmUFztfnks= -github.com/aws/aws-sdk-go-v2/service/kendra v1.38.5/go.mod h1:PMq9hXXhaNxmBMIolmknhJ9gXi4PYDsZwsFBaJs7Zak= +github.com/aws/aws-sdk-go-v2/service/kendra v1.38.6 h1:qjID86gt8RzN0fBZ3bo9lGnIZG/wZKl8OwKeydFuI7Q= +github.com/aws/aws-sdk-go-v2/service/kendra v1.38.6/go.mod h1:cnN7Q+P0o2NrzF2dnOkWhAqtULXJ/x8HZh6mmZdefGo= github.com/aws/aws-sdk-go-v2/service/lambda v1.30.1 h1:cn7Aus/F0sUyARPhxRUcu7WJJ08xIurq3zmpaPHm15o= github.com/aws/aws-sdk-go-v2/service/lambda v1.30.1/go.mod h1:mc/9GTdsVssN9PsId2/0hpWC5EAXXYym9qNhSXdSEsY= -github.com/aws/aws-sdk-go-v2/service/medialive v1.30.0 h1:NkQZuHbEyoDDoyu0g4hpUrOV9fitbrZZkIHdXnEaSAA= -github.com/aws/aws-sdk-go-v2/service/medialive v1.30.0/go.mod h1:MDHSj74ylVyTusJYPIoFhNXqwaD8W8cIf8yTEI7+ccc= +github.com/aws/aws-sdk-go-v2/service/medialive v1.30.1 h1:jYjHMN2TF4d3opiQmZcwg7aG0MIKCss8xAxxQhoPZ0M= +github.com/aws/aws-sdk-go-v2/service/medialive v1.30.1/go.mod h1:51pIhgB4o0HoHLcUkyZnvMD+iJ8ErZLXsstNTzBI3hI= github.com/aws/aws-sdk-go-v2/service/oam v1.1.6 h1:A5vCeU8BdCJRaEI/UvrY3amM3Lo3WZd7VzCDjIyE2Y8= github.com/aws/aws-sdk-go-v2/service/oam v1.1.6/go.mod h1:1/LZsdsqFoSCouz/3n1hP7fL8E6S05fvLUbzd187brQ= -github.com/aws/aws-sdk-go-v2/service/opensearchserverless v1.1.5 h1:3EqOT8+GTVfZny8ltIZk0VUflBjC7Ks55jw2M2edneM= -github.com/aws/aws-sdk-go-v2/service/opensearchserverless v1.1.5/go.mod h1:zyCz2VSeUsBE9LMtZc+rVaTSPqJM64cjvLL50FJbblM= +github.com/aws/aws-sdk-go-v2/service/opensearchserverless v1.1.6 h1:OMX4K9NK0HzXL83qun7y12vz9w81RT8o0E8/n1vtZQ4= +github.com/aws/aws-sdk-go-v2/service/opensearchserverless v1.1.6/go.mod h1:1tQGJCnMMArYedK9x4mmyvIyo44AiynG51y0SVB/cp0= github.com/aws/aws-sdk-go-v2/service/pipes v1.2.1 h1:wA503x0d2eGCyghtrLXrRGPLjR5sHIQbFkelM9PsIYs= github.com/aws/aws-sdk-go-v2/service/pipes v1.2.1/go.mod h1:PJ3LnWVqKqpHdDdIW7X+VO8FjWyOvMuHBkygW28C5tk= -github.com/aws/aws-sdk-go-v2/service/rds v1.40.5 h1:m4v9hSOgnLmSDbdVdNT0H8GTY6tik7uB7SVV/SFbhLY= -github.com/aws/aws-sdk-go-v2/service/rds v1.40.5/go.mod h1:994zebv5Cj1WoGzo3zrrscm1zBLFvGwoA3ve1eVYNVQ= -github.com/aws/aws-sdk-go-v2/service/resourceexplorer2 v1.2.5 h1:+F3ULspZOOeUy3LWcIrTguJdO1/A1llhML7alifHldQ= -github.com/aws/aws-sdk-go-v2/service/resourceexplorer2 v1.2.5/go.mod h1:9qmFEhCHjKM1+oO2XlzI5adhgfbTdyaDK5joeHLr2WM= +github.com/aws/aws-sdk-go-v2/service/rds v1.40.6 h1:6+TwyX5iCbAZE5KwzCKDKowUnFSYLbrtIcgcOXzwwzg= +github.com/aws/aws-sdk-go-v2/service/rds v1.40.6/go.mod h1:AJLw3mrKo1Yj6HWcFUgqNVQGR3KgCmMsKXyI2AxBVKI= +github.com/aws/aws-sdk-go-v2/service/resourceexplorer2 v1.2.6 h1:iqcsRMduYwhipbxkJiTqyEgcAsig208RIxd9eW47lqM= +github.com/aws/aws-sdk-go-v2/service/resourceexplorer2 v1.2.6/go.mod h1:Sri4U+1knElVG/n8z0oJtGBY0KWykxR/I/CW1LNaVKA= github.com/aws/aws-sdk-go-v2/service/rolesanywhere v1.1.6 h1:Fzl9/XspAWWsgERARa8iOnKTo1dgt/KEJhVope0RvkY= github.com/aws/aws-sdk-go-v2/service/rolesanywhere v1.1.6/go.mod h1:PO0JAnohvB5VPwedVzpiY8ZGdgamnweWsx/+yi1jZxc= github.com/aws/aws-sdk-go-v2/service/route53domains v1.14.5 h1:W3jd8OfMmkr0lhMC3MNhMf7WxpXMoFs7rQwHryjzDQg= @@ -100,8 +102,8 @@ github.com/aws/aws-sdk-go-v2/service/scheduler v1.1.5 h1:c4H0lPUXeo9XlMQ9fSskG8y github.com/aws/aws-sdk-go-v2/service/scheduler v1.1.5/go.mod h1:GNtZoju1It1f7xOjYzIu2dUEdd7sP75+boLldkGu4A4= github.com/aws/aws-sdk-go-v2/service/sesv2 v1.17.1 h1:dDF8EdHxS/1MN5qxyQhBChxybPHwOIRMFEevfU7PNls= github.com/aws/aws-sdk-go-v2/service/sesv2 v1.17.1/go.mod h1:b/r6MD2q+mNSSbmWy2QLHpnEnXA/M/XFunNwPYl7iFM= -github.com/aws/aws-sdk-go-v2/service/ssm v1.35.5 h1:x7FjoHx8A559fAHi0WMnrVxxk9iXwyj1UK5S7TrqFAM= -github.com/aws/aws-sdk-go-v2/service/ssm v1.35.5/go.mod h1:DlzAqaXaUSJVQGuZrGPb4TWTkDG6vUs5OiIoX0AxjkU= +github.com/aws/aws-sdk-go-v2/service/ssm v1.35.6 h1:7aR7m/6O8/BlYgMqpDwwLmsF0KCus5S+18zP3Y0Wj98= +github.com/aws/aws-sdk-go-v2/service/ssm v1.35.6/go.mod h1:Tkroqwa5sqjboPu++LC/W7mk9BnNUhHr/OJr3XVpX4U= github.com/aws/aws-sdk-go-v2/service/ssmcontacts v1.14.5 h1:cMy9iY65vX8QOd2BYJo85IFjPqFvpIiM7Jow5pbLefw= github.com/aws/aws-sdk-go-v2/service/ssmcontacts v1.14.5/go.mod h1:bP0RQ1FZXmrFeOoiq6Uv4UYgkLLcJuDlPkzoob0WlbI= github.com/aws/aws-sdk-go-v2/service/ssmincidents v1.20.5 h1:IlsNCrIQVjqtGMogOLkC7zK7HbJFUG7gyRxCLJ+Cu4Q= From 3d8770bf7bd6ad3d660dec2db859acd089e48614 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Mon, 13 Mar 2023 08:19:58 -0400 Subject: [PATCH 709/763] tools/tfsdk2fw: Run 'go mod tidy'. --- tools/tfsdk2fw/go.mod | 75 +++++++++++---------- tools/tfsdk2fw/go.sum | 148 ++++++++++++++++++++++-------------------- 2 files changed, 118 insertions(+), 105 deletions(-) diff --git a/tools/tfsdk2fw/go.mod b/tools/tfsdk2fw/go.mod index 4d6c476d4a02..81e5769b8744 100644 --- a/tools/tfsdk2fw/go.mod +++ b/tools/tfsdk2fw/go.mod @@ -16,45 +16,48 @@ require ( github.com/agext/levenshtein v1.2.3 // indirect github.com/apparentlymart/go-textseg/v13 v13.0.0 // indirect github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310 // indirect - github.com/aws/aws-sdk-go v1.44.206 // indirect - github.com/aws/aws-sdk-go-v2 v1.17.5 // indirect + github.com/aws/aws-sdk-go v1.44.219 // indirect + github.com/aws/aws-sdk-go-v2 v1.17.6 // indirect github.com/aws/aws-sdk-go-v2/config v1.18.12 // indirect github.com/aws/aws-sdk-go-v2/credentials v1.13.12 // indirect - github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.12.23 // indirect - github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.29 // indirect - github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.23 // indirect + github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.12.24 // indirect + github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.30 // indirect + github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.24 // indirect github.com/aws/aws-sdk-go-v2/internal/ini v1.3.29 // indirect - github.com/aws/aws-sdk-go-v2/service/auditmanager v1.24.1 // indirect - github.com/aws/aws-sdk-go-v2/service/cloudcontrol v1.11.5 // indirect - github.com/aws/aws-sdk-go-v2/service/cloudwatchlogs v1.20.5 // indirect - github.com/aws/aws-sdk-go-v2/service/comprehend v1.21.4 // indirect - github.com/aws/aws-sdk-go-v2/service/computeoptimizer v1.21.3 // indirect - github.com/aws/aws-sdk-go-v2/service/ec2 v1.86.1 // indirect - github.com/aws/aws-sdk-go-v2/service/fis v1.14.4 // indirect + github.com/aws/aws-sdk-go-v2/service/auditmanager v1.24.2 // indirect + github.com/aws/aws-sdk-go-v2/service/cloudcontrol v1.11.6 // indirect + github.com/aws/aws-sdk-go-v2/service/cloudwatchlogs v1.20.6 // indirect + github.com/aws/aws-sdk-go-v2/service/comprehend v1.22.1 // indirect + github.com/aws/aws-sdk-go-v2/service/computeoptimizer v1.21.4 // indirect + github.com/aws/aws-sdk-go-v2/service/ec2 v1.89.1 // indirect + github.com/aws/aws-sdk-go-v2/service/fis v1.14.5 // indirect + github.com/aws/aws-sdk-go-v2/service/healthlake v1.15.5 // indirect github.com/aws/aws-sdk-go-v2/service/iam v1.19.4 // indirect - github.com/aws/aws-sdk-go-v2/service/identitystore v1.16.4 // indirect - github.com/aws/aws-sdk-go-v2/service/inspector2 v1.11.5 // indirect - github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.9.23 // indirect - github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.13.23 // indirect - github.com/aws/aws-sdk-go-v2/service/ivschat v1.3.4 // indirect - github.com/aws/aws-sdk-go-v2/service/kendra v1.38.5 // indirect - github.com/aws/aws-sdk-go-v2/service/medialive v1.29.4 // indirect - github.com/aws/aws-sdk-go-v2/service/oam v1.1.5 // indirect - github.com/aws/aws-sdk-go-v2/service/opensearchserverless v1.1.5 // indirect - github.com/aws/aws-sdk-go-v2/service/pipes v1.1.4 // indirect - github.com/aws/aws-sdk-go-v2/service/rds v1.40.5 // indirect - github.com/aws/aws-sdk-go-v2/service/resourceexplorer2 v1.2.5 // indirect - github.com/aws/aws-sdk-go-v2/service/rolesanywhere v1.1.4 // indirect - github.com/aws/aws-sdk-go-v2/service/route53domains v1.14.4 // indirect - github.com/aws/aws-sdk-go-v2/service/s3control v1.29.4 // indirect - github.com/aws/aws-sdk-go-v2/service/scheduler v1.1.4 // indirect - github.com/aws/aws-sdk-go-v2/service/sesv2 v1.16.4 // indirect - github.com/aws/aws-sdk-go-v2/service/ssm v1.35.5 // indirect - github.com/aws/aws-sdk-go-v2/service/ssmincidents v1.20.4 // indirect + github.com/aws/aws-sdk-go-v2/service/identitystore v1.16.5 // indirect + github.com/aws/aws-sdk-go-v2/service/inspector2 v1.11.6 // indirect + github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.9.24 // indirect + github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.13.24 // indirect + github.com/aws/aws-sdk-go-v2/service/ivschat v1.4.0 // indirect + github.com/aws/aws-sdk-go-v2/service/kendra v1.38.6 // indirect + github.com/aws/aws-sdk-go-v2/service/lambda v1.30.1 // indirect + github.com/aws/aws-sdk-go-v2/service/medialive v1.30.1 // indirect + github.com/aws/aws-sdk-go-v2/service/oam v1.1.6 // indirect + github.com/aws/aws-sdk-go-v2/service/opensearchserverless v1.1.6 // indirect + github.com/aws/aws-sdk-go-v2/service/pipes v1.2.1 // indirect + github.com/aws/aws-sdk-go-v2/service/rds v1.40.6 // indirect + github.com/aws/aws-sdk-go-v2/service/resourceexplorer2 v1.2.6 // indirect + github.com/aws/aws-sdk-go-v2/service/rolesanywhere v1.1.6 // indirect + github.com/aws/aws-sdk-go-v2/service/route53domains v1.14.5 // indirect + github.com/aws/aws-sdk-go-v2/service/s3control v1.29.5 // indirect + github.com/aws/aws-sdk-go-v2/service/scheduler v1.1.5 // indirect + github.com/aws/aws-sdk-go-v2/service/sesv2 v1.17.1 // indirect + github.com/aws/aws-sdk-go-v2/service/ssm v1.35.6 // indirect + github.com/aws/aws-sdk-go-v2/service/ssmcontacts v1.14.5 // indirect + github.com/aws/aws-sdk-go-v2/service/ssmincidents v1.20.5 // indirect github.com/aws/aws-sdk-go-v2/service/sso v1.12.4 // indirect github.com/aws/aws-sdk-go-v2/service/ssooidc v1.14.4 // indirect github.com/aws/aws-sdk-go-v2/service/sts v1.18.5 // indirect - github.com/aws/aws-sdk-go-v2/service/transcribe v1.25.4 // indirect + github.com/aws/aws-sdk-go-v2/service/transcribe v1.26.0 // indirect github.com/aws/smithy-go v1.13.5 // indirect github.com/beevik/etree v1.1.0 // indirect github.com/bgentry/speakeasy v0.1.0 // indirect @@ -116,11 +119,11 @@ require ( github.com/zclconf/go-cty v1.12.1 // indirect go.opentelemetry.io/otel v1.13.0 // indirect go.opentelemetry.io/otel/trace v1.13.0 // indirect - golang.org/x/crypto v0.6.0 // indirect + golang.org/x/crypto v0.7.0 // indirect golang.org/x/mod v0.8.0 // indirect - golang.org/x/net v0.7.0 // indirect - golang.org/x/sys v0.5.0 // indirect - golang.org/x/text v0.7.0 // indirect + golang.org/x/net v0.8.0 // indirect + golang.org/x/sys v0.6.0 // indirect + golang.org/x/text v0.8.0 // indirect google.golang.org/appengine v1.6.7 // indirect google.golang.org/genproto v0.0.0-20230202175211-008b39050e57 // indirect google.golang.org/grpc v1.53.0 // indirect diff --git a/tools/tfsdk2fw/go.sum b/tools/tfsdk2fw/go.sum index e39041a9c5c7..ebcb90577f95 100644 --- a/tools/tfsdk2fw/go.sum +++ b/tools/tfsdk2fw/go.sum @@ -23,81 +23,91 @@ github.com/apparentlymart/go-textseg/v13 v13.0.0/go.mod h1:ZK2fH7c4NqDTLtiYLvIkE github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310 h1:BUAU3CGlLvorLI26FmByPp2eC2qla6E1Tw+scpcg/to= github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5/go.mod h1:wHh0iHkYZB8zMSxRWpUBQtwG5a7fFgvEO+odwuTv2gs= -github.com/aws/aws-sdk-go v1.44.206 h1:xC7O40wdnKH4A95KdYt+smXl9hig1vu9b3mFxAxUoak= -github.com/aws/aws-sdk-go v1.44.206/go.mod h1:aVsgQcEevwlmQ7qHE9I3h+dtQgpqhFB+i8Phjh7fkwI= +github.com/aws/aws-sdk-go v1.44.219 h1:YOFxTUQZvdRzgwb6XqLFRwNHxoUdKBuunITC7IFhvbc= +github.com/aws/aws-sdk-go v1.44.219/go.mod h1:aVsgQcEevwlmQ7qHE9I3h+dtQgpqhFB+i8Phjh7fkwI= github.com/aws/aws-sdk-go-v2 v1.17.4/go.mod h1:uzbQtefpm44goOPmdKyAlXSNcwlRgF3ePWVW6EtJvvw= -github.com/aws/aws-sdk-go-v2 v1.17.5 h1:TzCUW1Nq4H8Xscph5M/skINUitxM5UBAyvm2s7XBzL4= github.com/aws/aws-sdk-go-v2 v1.17.5/go.mod h1:uzbQtefpm44goOPmdKyAlXSNcwlRgF3ePWVW6EtJvvw= +github.com/aws/aws-sdk-go-v2 v1.17.6 h1:Y773UK7OBqhzi5VDXMi1zVGsoj+CVHs2eaC2bDsLwi0= +github.com/aws/aws-sdk-go-v2 v1.17.6/go.mod h1:uzbQtefpm44goOPmdKyAlXSNcwlRgF3ePWVW6EtJvvw= github.com/aws/aws-sdk-go-v2/config v1.18.12 h1:fKs/I4wccmfrNRO9rdrbMO1NgLxct6H9rNMiPdBxHWw= github.com/aws/aws-sdk-go-v2/config v1.18.12/go.mod h1:J36fOhj1LQBr+O4hJCiT8FwVvieeoSGOtPuvhKlsNu8= github.com/aws/aws-sdk-go-v2/credentials v1.13.12 h1:Cb+HhuEnV19zHRaYYVglwvdHGMJWbdsyP4oHhw04xws= github.com/aws/aws-sdk-go-v2/credentials v1.13.12/go.mod h1:37HG2MBroXK3jXfxVGtbM2J48ra2+Ltu+tmwr/jO0KA= github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.12.22/go.mod h1:YGSIJyQ6D6FjKMQh16hVFSIUD54L4F7zTGePqYMYYJU= -github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.12.23 h1:Kbiv9PGnQfG/imNI4L/heyUXvzKmcWSBeDvkrQz5pFc= -github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.12.23/go.mod h1:mOtmAg65GT1HIL/HT/PynwPbS+UG0BgCZ6vhkPqnxWo= +github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.12.24 h1:5qyqXASrX2zy5cTnoHHa4N2c3Lc94GH7gjnBP3GwKdU= +github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.12.24/go.mod h1:neYVaeKr5eT7BzwULuG2YbLhzWZ22lpjKdCybR7AXrQ= github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.28/go.mod h1:3lwChorpIM/BhImY/hy+Z6jekmN92cXGPI1QJasVPYY= -github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.29 h1:9/aKwwus0TQxppPXFmf010DFrE+ssSbzroLVYINA+xE= github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.29/go.mod h1:Dip3sIGv485+xerzVv24emnjX5Sg88utCL8fwGmCeWg= +github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.30 h1:y+8n9AGDjikyXoMBTRaHHHSaFEB8267ykmvyPodJfys= +github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.30/go.mod h1:LUBAO3zNXQjoONBKn/kR1y0Q4cj/D02Ts0uHYjcCQLM= github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.22/go.mod h1:EqK7gVrIGAHyZItrD1D8B0ilgwMD1GiWAmbU4u/JHNk= -github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.23 h1:b/Vn141DBuLVgXbhRWIrl9g+ww7G+ScV5SzniWR13jQ= github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.23/go.mod h1:mr6c4cHC+S/MMkrjtSlG4QA36kOznDep+0fga5L/fGQ= +github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.24 h1:r+Kv+SEJquhAZXaJ7G4u44cIwXV3f8K+N482NNAzJZA= +github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.24/go.mod h1:gAuCezX/gob6BSMbItsSlMb6WZGV7K2+fWOvk8xBSto= github.com/aws/aws-sdk-go-v2/internal/ini v1.3.29 h1:J4xhFd6zHhdF9jPP0FQJ6WknzBboGMBNjKOv4iTuw4A= github.com/aws/aws-sdk-go-v2/internal/ini v1.3.29/go.mod h1:TwuqRBGzxjQJIwH16/fOZodwXt2Zxa9/cwJC5ke4j7s= -github.com/aws/aws-sdk-go-v2/service/auditmanager v1.24.1 h1:lU4z86semH3yi8zMkYq/DXccjRMCjkSN/eZRmNAGOU0= -github.com/aws/aws-sdk-go-v2/service/auditmanager v1.24.1/go.mod h1:ZAErSW/Pfr0z7DbU00jjt9/n9Pzf5v46Tm1X9NGUwBE= -github.com/aws/aws-sdk-go-v2/service/cloudcontrol v1.11.5 h1:+gZHaILpl4yTDHwAxWnNNyumYLRZJ86+o+MVI3KSoyk= -github.com/aws/aws-sdk-go-v2/service/cloudcontrol v1.11.5/go.mod h1:SlSHujpy5ECaG+b4zZPBomo6LSenfp4jOS/5ysPhsFE= -github.com/aws/aws-sdk-go-v2/service/cloudwatchlogs v1.20.5 h1:hUMG/9p2Y23CAvAtVhoI2D+CB7eKkU60K76Dlp1zEII= -github.com/aws/aws-sdk-go-v2/service/cloudwatchlogs v1.20.5/go.mod h1:cylAO6dxr/pnL0iXXw7aqHHm/rcbQEf8g5VrYZqZKaE= -github.com/aws/aws-sdk-go-v2/service/comprehend v1.21.4 h1:KEVo6vgrvxdGsnTYnXkoZT/RuouZcFh564vnfn6wCuk= -github.com/aws/aws-sdk-go-v2/service/comprehend v1.21.4/go.mod h1:wR/O51vYY5XCt2FzuaSgvHV36BozkKxKWW4NoDIXrlc= -github.com/aws/aws-sdk-go-v2/service/computeoptimizer v1.21.3 h1:JkWxBPjWWDKjVWjBoiIw9zbMA72Ynde66y5fInm9Q/g= -github.com/aws/aws-sdk-go-v2/service/computeoptimizer v1.21.3/go.mod h1:U4bKXeB586zd73RIAkJX+ZmUtwI00xLJhDKJ7+hTCO0= -github.com/aws/aws-sdk-go-v2/service/ec2 v1.86.1 h1:LCRt6GgCjXGvWvJC6e6f84wDjlZN6H0u+aoAaq2RP9k= -github.com/aws/aws-sdk-go-v2/service/ec2 v1.86.1/go.mod h1:2HxUY7Pkfmt1uIhPrFp0/O6+0aGoLaGIN5tXp/rYDL8= -github.com/aws/aws-sdk-go-v2/service/fis v1.14.4 h1:YHeT7fN7oQY7wUzOwZv4gfzULrrojjbFq9vipBUvFgE= -github.com/aws/aws-sdk-go-v2/service/fis v1.14.4/go.mod h1:IQGhkhTVkQE+/bVqKbLpipbH9H935C05Z0/z6k7eVPQ= +github.com/aws/aws-sdk-go-v2/service/auditmanager v1.24.2 h1:pbelBMdI4/oPEjkw862jMnvKh2JiZgUvjUqCNWHj+M4= +github.com/aws/aws-sdk-go-v2/service/auditmanager v1.24.2/go.mod h1:n8Qc8IoCTsytDk7JLqNRHsLgCoQjhHIphnPs4uV+esU= +github.com/aws/aws-sdk-go-v2/service/cloudcontrol v1.11.6 h1:sje7c3VVzdGEnOIEK4ZbxJxF10is6zyFd/pOczByMlQ= +github.com/aws/aws-sdk-go-v2/service/cloudcontrol v1.11.6/go.mod h1:amppzN0qHx+8CoGKHqLKWPW+r9zVw6fqpcpu0olZZJ8= +github.com/aws/aws-sdk-go-v2/service/cloudwatchlogs v1.20.6 h1:hT9mrvaUpx/T9gi6JkAI5uAmX+eTCI0ignb5YXNG/GU= +github.com/aws/aws-sdk-go-v2/service/cloudwatchlogs v1.20.6/go.mod h1:kOHVSyc1cOsgOzB1MJViE4KteDEjosGukDWGrd9oOW0= +github.com/aws/aws-sdk-go-v2/service/comprehend v1.22.1 h1:PM3LPgmbOKelThQ6k/4sAbylzQjyAecfdFG8AZzm6w8= +github.com/aws/aws-sdk-go-v2/service/comprehend v1.22.1/go.mod h1:jfcyde8HLCJFHGITnVbi02XyYtrLqoQI071d9KtUzgU= +github.com/aws/aws-sdk-go-v2/service/computeoptimizer v1.21.4 h1:4lnei6CLYjPH0m0Io93E0uENrIxdTQHaSKgiOtwBaOM= +github.com/aws/aws-sdk-go-v2/service/computeoptimizer v1.21.4/go.mod h1:dWtl9dlDyZsQQoyPxO6xwnXY0c1n2H6mege+iMEnSEk= +github.com/aws/aws-sdk-go-v2/service/ec2 v1.89.1 h1:2CO0T8ReHjH5TFjk9RHmAafJt4vk/wMlQtn3c9bNL5Y= +github.com/aws/aws-sdk-go-v2/service/ec2 v1.89.1/go.mod h1:zDr1uSSLVYc6KqXvrmqYkeqnfbmOOrbVloz4Eqsc83k= +github.com/aws/aws-sdk-go-v2/service/fis v1.14.5 h1:y9wcj0xCmf3i+1igp+PK9pALMQK7z72W1gHtcMQkVC0= +github.com/aws/aws-sdk-go-v2/service/fis v1.14.5/go.mod h1:DQ++Ekb5IvuYfc+lQN8qFDpIZPjE0bqS4vpUYcdvyu4= +github.com/aws/aws-sdk-go-v2/service/healthlake v1.15.5 h1:9O+XnH1SGXV9J9yr2d2p9EweysA6bHI8ucmgQ2HjOUE= +github.com/aws/aws-sdk-go-v2/service/healthlake v1.15.5/go.mod h1:hZLFihMKaVykypz8xRMpOTJtng9RV64rNnRxkt93U00= github.com/aws/aws-sdk-go-v2/service/iam v1.19.4 h1:hrBxgoUih7uy9sJTXrX0N/3TVgbmevlxEYsP9l+Lje4= github.com/aws/aws-sdk-go-v2/service/iam v1.19.4/go.mod h1:F5Xt96+AfAiyMpRXHy9CKafE/KULVwj7MwgZ0a4row4= -github.com/aws/aws-sdk-go-v2/service/identitystore v1.16.4 h1:WmE4yfzKZBgSLdLOG8/pWekHSskhXNX+7HXeWire/II= -github.com/aws/aws-sdk-go-v2/service/identitystore v1.16.4/go.mod h1:b/31AIODyxR/m34zRvUXs/mjF7pLAwS6IHIfl0kdRYc= -github.com/aws/aws-sdk-go-v2/service/inspector2 v1.11.5 h1:QAQmyUAqBtq72FBJD5efZbiPej3+tpesSSknvYJDr1M= -github.com/aws/aws-sdk-go-v2/service/inspector2 v1.11.5/go.mod h1:XsERJJVZCcUOrsHAeDy73b++Yvx8K7gdi+gEMYUeNr0= +github.com/aws/aws-sdk-go-v2/service/identitystore v1.16.5 h1:Mbz3LjbbVE6fFwYEYf2cJFcmFmIOZhSOyuTGYY0CzgQ= +github.com/aws/aws-sdk-go-v2/service/identitystore v1.16.5/go.mod h1:ZMSJuu9//YKamgC3vArYkljfp2wjbtwdqYAwclNfhXY= +github.com/aws/aws-sdk-go-v2/service/inspector2 v1.11.6 h1:LtoRGfh9b+aLxVSgVSjXAmPePYGvbzVTfcXdopKokuI= +github.com/aws/aws-sdk-go-v2/service/inspector2 v1.11.6/go.mod h1:w5tN/JjIMU0RycBR1oQ46dhIq8eWpCR1Ggp0y6zPuZE= github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.9.22/go.mod h1:xt0Au8yPIwYXf/GYPy/vl4K3CgwhfQMYbrH7DlUUIws= -github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.9.23 h1:QoOybhwRfciWUBbZ0gp9S7XaDnCuSTeK/fySB99V1ls= github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.9.23/go.mod h1:9uPh+Hrz2Vn6oMnQYiUi/zbh3ovbnQk19YKINkQny44= -github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.13.23 h1:qc+RW0WWZ2KApMnsu/EVCPqLTyIH55uc7YQq7mq4XqE= -github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.13.23/go.mod h1:FJhZWVWBCcgAF8jbep7pxQ1QUsjzTwa9tvEXGw2TDRo= -github.com/aws/aws-sdk-go-v2/service/ivschat v1.3.4 h1:nGVv8RFgC4P7BsnL/NPGhT8W0kdhBSf3TXR88GzjwLQ= -github.com/aws/aws-sdk-go-v2/service/ivschat v1.3.4/go.mod h1:Ic/51aMt0SrY+rLEBYCMW6iuORW0wQJ/rhV0PGg07mQ= -github.com/aws/aws-sdk-go-v2/service/kendra v1.38.5 h1:vYyn1h1+/eRL8UxfzRgxhH8tm+Jd6ujsyXmUFztfnks= -github.com/aws/aws-sdk-go-v2/service/kendra v1.38.5/go.mod h1:PMq9hXXhaNxmBMIolmknhJ9gXi4PYDsZwsFBaJs7Zak= -github.com/aws/aws-sdk-go-v2/service/medialive v1.29.4 h1:1K+jiIQQdFGgYUmITnQRTRFQSCv0fUIH/X//Kgq0m/8= -github.com/aws/aws-sdk-go-v2/service/medialive v1.29.4/go.mod h1:MDHSj74ylVyTusJYPIoFhNXqwaD8W8cIf8yTEI7+ccc= -github.com/aws/aws-sdk-go-v2/service/oam v1.1.5 h1:b4IaVHpAfwj2cOmTUgoIFTjLjTuC1yh3Ml3K7cjZFaU= -github.com/aws/aws-sdk-go-v2/service/oam v1.1.5/go.mod h1:wjIJYruJrl1fA6qqfQSOjUUUjASLrjbVsD7y6NYcoOc= -github.com/aws/aws-sdk-go-v2/service/opensearchserverless v1.1.5 h1:3EqOT8+GTVfZny8ltIZk0VUflBjC7Ks55jw2M2edneM= -github.com/aws/aws-sdk-go-v2/service/opensearchserverless v1.1.5/go.mod h1:zyCz2VSeUsBE9LMtZc+rVaTSPqJM64cjvLL50FJbblM= -github.com/aws/aws-sdk-go-v2/service/pipes v1.1.4 h1:KAGParM+d33STJa8vDxIfLHEAerLFluqx1RFDUMb5RE= -github.com/aws/aws-sdk-go-v2/service/pipes v1.1.4/go.mod h1:+c65uht0a5kyjx9emTS00DdDiVYBoXLKDF7LQ0/2g5U= -github.com/aws/aws-sdk-go-v2/service/rds v1.40.5 h1:m4v9hSOgnLmSDbdVdNT0H8GTY6tik7uB7SVV/SFbhLY= -github.com/aws/aws-sdk-go-v2/service/rds v1.40.5/go.mod h1:994zebv5Cj1WoGzo3zrrscm1zBLFvGwoA3ve1eVYNVQ= -github.com/aws/aws-sdk-go-v2/service/resourceexplorer2 v1.2.5 h1:+F3ULspZOOeUy3LWcIrTguJdO1/A1llhML7alifHldQ= -github.com/aws/aws-sdk-go-v2/service/resourceexplorer2 v1.2.5/go.mod h1:9qmFEhCHjKM1+oO2XlzI5adhgfbTdyaDK5joeHLr2WM= -github.com/aws/aws-sdk-go-v2/service/rolesanywhere v1.1.4 h1:jifVZl6fqn5jSSph1XPv4eucXt3xcFq3xJLQOWUwFDQ= -github.com/aws/aws-sdk-go-v2/service/rolesanywhere v1.1.4/go.mod h1:YER6EnZk8ud7mEHI4SeHtpE6VjIaOuD1a/ayUegKaB0= -github.com/aws/aws-sdk-go-v2/service/route53domains v1.14.4 h1:/1qBMwOZb/2ua5jFMc8xmLUxHz7VNt70Zx2fKLoZ40M= -github.com/aws/aws-sdk-go-v2/service/route53domains v1.14.4/go.mod h1:MSwXvIWYZIBgC1otPRfafXbiOIdihO36INeOhqCciao= -github.com/aws/aws-sdk-go-v2/service/s3control v1.29.4 h1:2FnFwA3DaXibWS3gMk9/hfJL3oNU+jIWsgytn5X2aFQ= -github.com/aws/aws-sdk-go-v2/service/s3control v1.29.4/go.mod h1:7N/XbfABmShA4NEeFRhn9itmFk/E3DZ9im/+1++XnCY= -github.com/aws/aws-sdk-go-v2/service/scheduler v1.1.4 h1:LfCy6abbOMk2O6OdxFiMvySEMMYXyA4wLTZZzoyDU14= -github.com/aws/aws-sdk-go-v2/service/scheduler v1.1.4/go.mod h1:l7ebY4UfyEXzsM+yh74U1yTsZ4c8OZZd8de4aY0G19U= -github.com/aws/aws-sdk-go-v2/service/sesv2 v1.16.4 h1:2bikS7i3POwibqKLlkyZBYKsdTWtFMT20QTHasMEMB4= -github.com/aws/aws-sdk-go-v2/service/sesv2 v1.16.4/go.mod h1:uIM2GAheOB6xz7UuG5By72Zw2B/20fViFsbDY1JVTVY= -github.com/aws/aws-sdk-go-v2/service/ssm v1.35.5 h1:x7FjoHx8A559fAHi0WMnrVxxk9iXwyj1UK5S7TrqFAM= -github.com/aws/aws-sdk-go-v2/service/ssm v1.35.5/go.mod h1:DlzAqaXaUSJVQGuZrGPb4TWTkDG6vUs5OiIoX0AxjkU= -github.com/aws/aws-sdk-go-v2/service/ssmincidents v1.20.4 h1:gglh7K4VN15y6ENH2wM16TO6E0MgiLtKh2CCSHkCQuM= -github.com/aws/aws-sdk-go-v2/service/ssmincidents v1.20.4/go.mod h1:hYnjkk6Qz1eI1aXZVWXdmcyb3HGK1sPAFM8efXREt5Q= +github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.9.24 h1:c5qGfdbCHav6viBwiyDns3OXqhqAbGjfIB4uVu2ayhk= +github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.9.24/go.mod h1:HMA4FZG6fyib+NDo5bpIxX1EhYjrAOveZJY2YR0xrNE= +github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.13.24 h1:i4RH8DLv/BHY0fCrXYQDr+DGnWzaxB3Ee/esxUaSavk= +github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.13.24/go.mod h1:N8X45/o2cngvjCYi2ZnvI0P4mU4ZRJfEYC3maCSsPyw= +github.com/aws/aws-sdk-go-v2/service/ivschat v1.4.0 h1:KmTUwjxQ/WzS64jhqwXpjngif7sAIscGUSkaw3Q7gV4= +github.com/aws/aws-sdk-go-v2/service/ivschat v1.4.0/go.mod h1:Xwv56usY/pQjpXTB5kZitJlGaQT+jMpxZ3d/RksI1Tg= +github.com/aws/aws-sdk-go-v2/service/kendra v1.38.6 h1:qjID86gt8RzN0fBZ3bo9lGnIZG/wZKl8OwKeydFuI7Q= +github.com/aws/aws-sdk-go-v2/service/kendra v1.38.6/go.mod h1:cnN7Q+P0o2NrzF2dnOkWhAqtULXJ/x8HZh6mmZdefGo= +github.com/aws/aws-sdk-go-v2/service/lambda v1.30.1 h1:cn7Aus/F0sUyARPhxRUcu7WJJ08xIurq3zmpaPHm15o= +github.com/aws/aws-sdk-go-v2/service/lambda v1.30.1/go.mod h1:mc/9GTdsVssN9PsId2/0hpWC5EAXXYym9qNhSXdSEsY= +github.com/aws/aws-sdk-go-v2/service/medialive v1.30.1 h1:jYjHMN2TF4d3opiQmZcwg7aG0MIKCss8xAxxQhoPZ0M= +github.com/aws/aws-sdk-go-v2/service/medialive v1.30.1/go.mod h1:51pIhgB4o0HoHLcUkyZnvMD+iJ8ErZLXsstNTzBI3hI= +github.com/aws/aws-sdk-go-v2/service/oam v1.1.6 h1:A5vCeU8BdCJRaEI/UvrY3amM3Lo3WZd7VzCDjIyE2Y8= +github.com/aws/aws-sdk-go-v2/service/oam v1.1.6/go.mod h1:1/LZsdsqFoSCouz/3n1hP7fL8E6S05fvLUbzd187brQ= +github.com/aws/aws-sdk-go-v2/service/opensearchserverless v1.1.6 h1:OMX4K9NK0HzXL83qun7y12vz9w81RT8o0E8/n1vtZQ4= +github.com/aws/aws-sdk-go-v2/service/opensearchserverless v1.1.6/go.mod h1:1tQGJCnMMArYedK9x4mmyvIyo44AiynG51y0SVB/cp0= +github.com/aws/aws-sdk-go-v2/service/pipes v1.2.1 h1:wA503x0d2eGCyghtrLXrRGPLjR5sHIQbFkelM9PsIYs= +github.com/aws/aws-sdk-go-v2/service/pipes v1.2.1/go.mod h1:PJ3LnWVqKqpHdDdIW7X+VO8FjWyOvMuHBkygW28C5tk= +github.com/aws/aws-sdk-go-v2/service/rds v1.40.6 h1:6+TwyX5iCbAZE5KwzCKDKowUnFSYLbrtIcgcOXzwwzg= +github.com/aws/aws-sdk-go-v2/service/rds v1.40.6/go.mod h1:AJLw3mrKo1Yj6HWcFUgqNVQGR3KgCmMsKXyI2AxBVKI= +github.com/aws/aws-sdk-go-v2/service/resourceexplorer2 v1.2.6 h1:iqcsRMduYwhipbxkJiTqyEgcAsig208RIxd9eW47lqM= +github.com/aws/aws-sdk-go-v2/service/resourceexplorer2 v1.2.6/go.mod h1:Sri4U+1knElVG/n8z0oJtGBY0KWykxR/I/CW1LNaVKA= +github.com/aws/aws-sdk-go-v2/service/rolesanywhere v1.1.6 h1:Fzl9/XspAWWsgERARa8iOnKTo1dgt/KEJhVope0RvkY= +github.com/aws/aws-sdk-go-v2/service/rolesanywhere v1.1.6/go.mod h1:PO0JAnohvB5VPwedVzpiY8ZGdgamnweWsx/+yi1jZxc= +github.com/aws/aws-sdk-go-v2/service/route53domains v1.14.5 h1:W3jd8OfMmkr0lhMC3MNhMf7WxpXMoFs7rQwHryjzDQg= +github.com/aws/aws-sdk-go-v2/service/route53domains v1.14.5/go.mod h1:fsgQ9e1bs7ZUgf64eTfsQFpP9iJJ13o33KJWIXnPI8s= +github.com/aws/aws-sdk-go-v2/service/s3control v1.29.5 h1:64MXeSwJp35lJ9kvP01EEYxI0uW5P+cOXBECFhLq9Og= +github.com/aws/aws-sdk-go-v2/service/s3control v1.29.5/go.mod h1:u9sP19O4PvfQMvFeScgmemf+YxSRkySPQNQgxQgDKNQ= +github.com/aws/aws-sdk-go-v2/service/scheduler v1.1.5 h1:c4H0lPUXeo9XlMQ9fSskG8yYscq8/HNINnN3NlpQ2wI= +github.com/aws/aws-sdk-go-v2/service/scheduler v1.1.5/go.mod h1:GNtZoju1It1f7xOjYzIu2dUEdd7sP75+boLldkGu4A4= +github.com/aws/aws-sdk-go-v2/service/sesv2 v1.17.1 h1:dDF8EdHxS/1MN5qxyQhBChxybPHwOIRMFEevfU7PNls= +github.com/aws/aws-sdk-go-v2/service/sesv2 v1.17.1/go.mod h1:b/r6MD2q+mNSSbmWy2QLHpnEnXA/M/XFunNwPYl7iFM= +github.com/aws/aws-sdk-go-v2/service/ssm v1.35.6 h1:7aR7m/6O8/BlYgMqpDwwLmsF0KCus5S+18zP3Y0Wj98= +github.com/aws/aws-sdk-go-v2/service/ssm v1.35.6/go.mod h1:Tkroqwa5sqjboPu++LC/W7mk9BnNUhHr/OJr3XVpX4U= +github.com/aws/aws-sdk-go-v2/service/ssmcontacts v1.14.5 h1:cMy9iY65vX8QOd2BYJo85IFjPqFvpIiM7Jow5pbLefw= +github.com/aws/aws-sdk-go-v2/service/ssmcontacts v1.14.5/go.mod h1:bP0RQ1FZXmrFeOoiq6Uv4UYgkLLcJuDlPkzoob0WlbI= +github.com/aws/aws-sdk-go-v2/service/ssmincidents v1.20.5 h1:IlsNCrIQVjqtGMogOLkC7zK7HbJFUG7gyRxCLJ+Cu4Q= +github.com/aws/aws-sdk-go-v2/service/ssmincidents v1.20.5/go.mod h1:F6SzQwUsHF2o4FMW3L7/+bgQKrMvUEUhJgpEZ9xQ1Ns= github.com/aws/aws-sdk-go-v2/service/sso v1.12.1/go.mod h1:IgV8l3sj22nQDd5qcAGY0WenwCzCphqdbFOpfktZPrI= github.com/aws/aws-sdk-go-v2/service/sso v1.12.4 h1:qJdM48OOLl1FBSzI7ZrA1ZfLwOyCYqkXV5lko1hYDBw= github.com/aws/aws-sdk-go-v2/service/sso v1.12.4/go.mod h1:jtLIhd+V+lft6ktxpItycqHqiVXrPIRjWIsFIlzMriw= @@ -107,8 +117,8 @@ github.com/aws/aws-sdk-go-v2/service/ssooidc v1.14.4/go.mod h1:zVwRrfdSmbRZWkUkW github.com/aws/aws-sdk-go-v2/service/sts v1.18.3/go.mod h1:b+psTJn33Q4qGoDaM7ZiOVVG8uVjGI6HaZ8WBHdgDgU= github.com/aws/aws-sdk-go-v2/service/sts v1.18.5 h1:L1600eLr0YvTT7gNh3Ni24yGI7NSHkq9Gp62vijPRCs= github.com/aws/aws-sdk-go-v2/service/sts v1.18.5/go.mod h1:1mKZHLLpDMHTNSYPJ7qrcnCQdHCWsNQaT0xRvq2u80s= -github.com/aws/aws-sdk-go-v2/service/transcribe v1.25.4 h1:OwII6iBkiA3sw3XfuSJ7X8cZ7enxL3f4ckLeTmCPdj8= -github.com/aws/aws-sdk-go-v2/service/transcribe v1.25.4/go.mod h1:Sfekn5aPGiTP+22/2DOuE6WoVBY19xfW6esh0HjdgzQ= +github.com/aws/aws-sdk-go-v2/service/transcribe v1.26.0 h1:3cwoie+qJvBJWOa9r/1AONz9XgrcLSWnL37rHNRMS6s= +github.com/aws/aws-sdk-go-v2/service/transcribe v1.26.0/go.mod h1:Sfekn5aPGiTP+22/2DOuE6WoVBY19xfW6esh0HjdgzQ= github.com/aws/smithy-go v1.13.5 h1:hgz0X/DX0dGqTYpGALqXJoRKRj5oQ7150i5FdTePzO8= github.com/aws/smithy-go v1.13.5/go.mod h1:Tg+OJXh4MB2R/uN61Ko2f6hTZwB/ZYGOtib8J3gBHzA= github.com/beevik/etree v1.1.0 h1:T0xke/WvNtMoCqgzPhkX2r4rjY3GDZFi+FjpRZY2Jbs= @@ -345,8 +355,8 @@ golang.org/x/crypto v0.0.0-20210322153248-0c34fe9e7dc2/go.mod h1:T9bdIzuCu7OtxOm golang.org/x/crypto v0.0.0-20210421170649-83a5a9bb288b/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.5.0/go.mod h1:NK/OQwhpMQP3MwtdjgLlYHnH9ebylxKWv3e0fK+mkQU= -golang.org/x/crypto v0.6.0 h1:qfktjS5LUO+fFKeJXZ+ikTRijMmljikvG68fpMMruSc= -golang.org/x/crypto v0.6.0/go.mod h1:OFC/31mSvZgRz0V1QTNCzfAI1aIRzbiufJtkMIlEp58= +golang.org/x/crypto v0.7.0 h1:AvwMYaRytfdeVt3u6mLaxYtErKYjxA2OXjJ1HHq6t3A= +golang.org/x/crypto v0.7.0/go.mod h1:pYwdfH91IfpZVANVyUOhSIPZaFoJGxTFbZhFTx+dXZU= golang.org/x/exp v0.0.0-20230206171751-46f607a40771 h1:xP7rWLUr1e1n2xkK5YB4LI0hPEy3LJC6Wk+D4pGlOJg= golang.org/x/exp v0.0.0-20230206171751-46f607a40771/go.mod h1:CxIveKay+FTh1D0yPZemJVgC/95VzuuOLq5Qi4xnoYc= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= @@ -367,8 +377,8 @@ golang.org/x/net v0.0.0-20210326060303-6b1517762897/go.mod h1:uSPa2vr4CLtc/ILN5o golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= golang.org/x/net v0.1.0/go.mod h1:Cx3nUiGt4eDBEyega/BKRp+/AlGL8hYe7U9odMt2Cco= golang.org/x/net v0.5.0/go.mod h1:DivGGAXEgPSlEBzxGzZI+ZLohi+xUj054jfeKui00ws= -golang.org/x/net v0.7.0 h1:rJrUqqhjsgNp7KqAIc25s9pZnjU7TUcSY7HcVZjdn1g= -golang.org/x/net v0.7.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= +golang.org/x/net v0.8.0 h1:Zrh2ngAOFYneWTAIAPethzeaQLuHwhuBkuV6ZiRnUaQ= +golang.org/x/net v0.8.0/go.mod h1:QVkue5JL9kW//ek3r6jTKnTFis1tRmNAW2P1shuFdJc= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -396,13 +406,13 @@ golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.4.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.5.0 h1:MUK/U/4lj1t1oPg0HfuXDN/Z1wv31ZJ/YcPiGccS4DU= -golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.6.0 h1:MVltZSvRTcU2ljQOhs94SXPftV6DCNnZViHeQps87pQ= +golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.1.0/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.4.0/go.mod h1:9P2UbLfCdcvo3p/nzKvsmas4TnlujnuoV9hGgYzW1lQ= -golang.org/x/term v0.5.0 h1:n2a8QNdAb0sZNpU9R1ALUXBbY+w51fCQDN+7EdxNBsY= +golang.org/x/term v0.6.0 h1:clScbb1cHjoCkyRbWwBEUZ5H/tIFu5TAXIqaZD0Gcjw= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= @@ -410,8 +420,8 @@ golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.6.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= -golang.org/x/text v0.7.0 h1:4BRB4x83lYWy72KwLD/qYDuTu7q9PjSagHvijDw7cLo= -golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= +golang.org/x/text v0.8.0 h1:57P1ETyNKtuIjB4SRd15iJxuhj8Gc416Y78H3qgMh68= +golang.org/x/text v0.8.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= From 28bfdf72122389c0bab3b4dd03dcc1575074d771 Mon Sep 17 00:00:00 2001 From: changelogbot Date: Mon, 13 Mar 2023 12:53:30 +0000 Subject: [PATCH 710/763] Update CHANGELOG.md for #29967 --- CHANGELOG.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 90bf38aedc85..39a9a83cce73 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,9 +1,17 @@ ## 4.59.0 (Unreleased) +FEATURES: + +* **New Data Source:** `aws_servicecatalog_provisioning_artifacts` ([#25535](https://github.com/hashicorp/terraform-provider-aws/issues/25535)) +* **New Resource:** `aws_oam_sink` ([#29670](https://github.com/hashicorp/terraform-provider-aws/issues/29670)) +* **New Resource:** `codegurureviewer_repository_association` ([#29656](https://github.com/hashicorp/terraform-provider-aws/issues/29656)) + ENHANCEMENTS: * data-source/aws_ce_cost_category: Add `default_value` attribute ([#29291](https://github.com/hashicorp/terraform-provider-aws/issues/29291)) * resource/aws_appflow_flow: Add attribute `preserve_source_data_typing` to `s3_output_format_config` in `s3` ([#27616](https://github.com/hashicorp/terraform-provider-aws/issues/27616)) +* resource/aws_cognito_user_pool_domain: Add `cloudfront_distribution` and `cloudfront_distribution_zone_id` attributes ([#27790](https://github.com/hashicorp/terraform-provider-aws/issues/27790)) +* resource/aws_ecs_task_definition: Add `arn_without_revision` attribute ([#27351](https://github.com/hashicorp/terraform-provider-aws/issues/27351)) * resource/aws_glue_crawler: Add `create_native_delta_table` attribute to the `delta_target` configuration block ([#29566](https://github.com/hashicorp/terraform-provider-aws/issues/29566)) * resource/aws_qldb_ledger: Add configurable timeouts ([#29635](https://github.com/hashicorp/terraform-provider-aws/issues/29635)) * resource/aws_s3_bucket: Add error handling for `XNotImplemented` errors when reading `acceleration_status`, `request_payer`, `lifecycle_rule`, `logging`, or `replication_configuration` into terraform state. ([#29632](https://github.com/hashicorp/terraform-provider-aws/issues/29632)) From a17d286ef452e35c32da18e5e849a43dc050adb1 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 13 Mar 2023 12:53:38 +0000 Subject: [PATCH 711/763] build(deps): bump github.com/aws/aws-sdk-go-v2/service/transcribe Bumps [github.com/aws/aws-sdk-go-v2/service/transcribe](https://github.com/aws/aws-sdk-go-v2) from 1.26.0 to 1.26.1. - [Release notes](https://github.com/aws/aws-sdk-go-v2/releases) - [Changelog](https://github.com/aws/aws-sdk-go-v2/blob/main/CHANGELOG.md) - [Commits](https://github.com/aws/aws-sdk-go-v2/compare/service/s3/v1.26.0...service/s3/v1.26.1) --- updated-dependencies: - dependency-name: github.com/aws/aws-sdk-go-v2/service/transcribe dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 7a75f1e97cbe..38d0c2017520 100644 --- a/go.mod +++ b/go.mod @@ -34,7 +34,7 @@ require ( github.com/aws/aws-sdk-go-v2/service/ssm v1.35.6 github.com/aws/aws-sdk-go-v2/service/ssmcontacts v1.14.5 github.com/aws/aws-sdk-go-v2/service/ssmincidents v1.20.5 - github.com/aws/aws-sdk-go-v2/service/transcribe v1.26.0 + github.com/aws/aws-sdk-go-v2/service/transcribe v1.26.1 github.com/aws/smithy-go v1.13.5 github.com/beevik/etree v1.1.0 github.com/google/go-cmp v0.5.9 diff --git a/go.sum b/go.sum index e4f2be9b51b4..c9f615dddf93 100644 --- a/go.sum +++ b/go.sum @@ -117,8 +117,8 @@ github.com/aws/aws-sdk-go-v2/service/ssooidc v1.14.4/go.mod h1:zVwRrfdSmbRZWkUkW github.com/aws/aws-sdk-go-v2/service/sts v1.18.3/go.mod h1:b+psTJn33Q4qGoDaM7ZiOVVG8uVjGI6HaZ8WBHdgDgU= github.com/aws/aws-sdk-go-v2/service/sts v1.18.5 h1:L1600eLr0YvTT7gNh3Ni24yGI7NSHkq9Gp62vijPRCs= github.com/aws/aws-sdk-go-v2/service/sts v1.18.5/go.mod h1:1mKZHLLpDMHTNSYPJ7qrcnCQdHCWsNQaT0xRvq2u80s= -github.com/aws/aws-sdk-go-v2/service/transcribe v1.26.0 h1:3cwoie+qJvBJWOa9r/1AONz9XgrcLSWnL37rHNRMS6s= -github.com/aws/aws-sdk-go-v2/service/transcribe v1.26.0/go.mod h1:Sfekn5aPGiTP+22/2DOuE6WoVBY19xfW6esh0HjdgzQ= +github.com/aws/aws-sdk-go-v2/service/transcribe v1.26.1 h1:gLvQJbkj0GKQ17FP2eyIJ6bTpE5IEIcPpVSOuwaaRck= +github.com/aws/aws-sdk-go-v2/service/transcribe v1.26.1/go.mod h1:dS0jryOiMP8aMos6KC4y+B7cWoz10YlH7Cq8ivdBq7s= github.com/aws/smithy-go v1.13.5 h1:hgz0X/DX0dGqTYpGALqXJoRKRj5oQ7150i5FdTePzO8= github.com/aws/smithy-go v1.13.5/go.mod h1:Tg+OJXh4MB2R/uN61Ko2f6hTZwB/ZYGOtib8J3gBHzA= github.com/beevik/etree v1.1.0 h1:T0xke/WvNtMoCqgzPhkX2r4rjY3GDZFi+FjpRZY2Jbs= From 6274a0387a581b88efd72b449175f5f30419e6ab Mon Sep 17 00:00:00 2001 From: teruya <27873650+teru01@users.noreply.github.com> Date: Mon, 13 Mar 2023 22:00:37 +0900 Subject: [PATCH 712/763] add docs --- .changelog/29920.txt | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 .changelog/29920.txt diff --git a/.changelog/29920.txt b/.changelog/29920.txt new file mode 100644 index 000000000000..1b4e609b6a5b --- /dev/null +++ b/.changelog/29920.txt @@ -0,0 +1,3 @@ +```release-note:enhancement +resource/aws_lb_target_group: Add `load_balancing_cross_zone_enabled` argument +``` From 8515babf5f15993e045b5ee13eff6313cd96089f Mon Sep 17 00:00:00 2001 From: Simon Davis Date: Wed, 1 Mar 2023 08:38:38 -0800 Subject: [PATCH 713/763] replace version pin with SHA --- .github/workflows/acctest-terraform-lint.yml | 4 ++-- .github/workflows/changelog.yml | 2 +- .github/workflows/dependencies.yml | 2 +- .github/workflows/documentation.yml | 2 +- .github/workflows/examples.yml | 4 ++-- .github/workflows/golangci-lint.yml | 4 ++-- .github/workflows/goreleaser-ci.yml | 4 ++-- .github/workflows/providerlint.yml | 4 ++-- .github/workflows/skaff.yml | 2 +- .github/workflows/snapshot.yml | 2 +- .github/workflows/terraform_provider.yml | 14 +++++++------- .github/workflows/website.yml | 6 +++--- .github/workflows/workflow-lint.yml | 2 +- 13 files changed, 26 insertions(+), 26 deletions(-) diff --git a/.github/workflows/acctest-terraform-lint.yml b/.github/workflows/acctest-terraform-lint.yml index 92406038a6ea..7367ccbe16b0 100644 --- a/.github/workflows/acctest-terraform-lint.yml +++ b/.github/workflows/acctest-terraform-lint.yml @@ -18,7 +18,7 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - - uses: actions/setup-go@v3 + - uses: actions/setup-go@6edd4406fa81c3da01a34fa6f6343087c207a568 with: go-version-file: go.mod - uses: actions/cache@v3 @@ -46,7 +46,7 @@ jobs: steps: - uses: actions/checkout@v3 - - uses: actions/setup-go@v3 + - uses: actions/setup-go@6edd4406fa81c3da01a34fa6f6343087c207a568 with: go-version-file: go.mod - uses: actions/cache@v3 diff --git a/.github/workflows/changelog.yml b/.github/workflows/changelog.yml index 6f3b6b0626cd..4a8d534ca6f4 100644 --- a/.github/workflows/changelog.yml +++ b/.github/workflows/changelog.yml @@ -59,7 +59,7 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - - uses: actions/setup-go@v3 + - uses: actions/setup-go@6edd4406fa81c3da01a34fa6f6343087c207a568 with: go-version-file: go.mod - uses: actions/cache@v3 diff --git a/.github/workflows/dependencies.yml b/.github/workflows/dependencies.yml index edfedc5c50a7..d33ab1ce802c 100644 --- a/.github/workflows/dependencies.yml +++ b/.github/workflows/dependencies.yml @@ -64,7 +64,7 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - - uses: actions/setup-go@v3 + - uses: actions/setup-go@6edd4406fa81c3da01a34fa6f6343087c207a568 with: go-version-file: go.mod - name: go mod diff --git a/.github/workflows/documentation.yml b/.github/workflows/documentation.yml index ad30caee1994..4ae6ac14f80d 100644 --- a/.github/workflows/documentation.yml +++ b/.github/workflows/documentation.yml @@ -38,7 +38,7 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - - uses: actions/setup-go@v3 + - uses: actions/setup-go@6edd4406fa81c3da01a34fa6f6343087c207a568 with: go-version-file: go.mod - uses: actions/cache@v3 diff --git a/.github/workflows/examples.yml b/.github/workflows/examples.yml index 6517fef72177..4578e8654a37 100644 --- a/.github/workflows/examples.yml +++ b/.github/workflows/examples.yml @@ -25,7 +25,7 @@ jobs: with: path: ~/go/pkg/mod key: ${{ runner.os }}-go-pkg-mod-${{ hashFiles('go.sum') }} - - uses: actions/setup-go@v3 + - uses: actions/setup-go@6edd4406fa81c3da01a34fa6f6343087c207a568 with: go-version-file: go.mod @@ -74,7 +74,7 @@ jobs: with: path: ~/go/pkg/mod key: ${{ runner.os }}-go-pkg-mod-${{ hashFiles('go.sum') }} - - uses: actions/setup-go@v3 + - uses: actions/setup-go@6edd4406fa81c3da01a34fa6f6343087c207a568 with: go-version-file: go.mod - name: go build diff --git a/.github/workflows/golangci-lint.yml b/.github/workflows/golangci-lint.yml index a26a3991e9e9..ff33bf63ccb4 100644 --- a/.github/workflows/golangci-lint.yml +++ b/.github/workflows/golangci-lint.yml @@ -21,7 +21,7 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - - uses: actions/setup-go@v3 + - uses: actions/setup-go@6edd4406fa81c3da01a34fa6f6343087c207a568 with: go-version-file: go.mod - name: golangci-lint @@ -35,7 +35,7 @@ jobs: runs-on: [custom, linux, large] steps: - uses: actions/checkout@v3 - - uses: actions/setup-go@v3 + - uses: actions/setup-go@6edd4406fa81c3da01a34fa6f6343087c207a568 with: go-version-file: go.mod - name: golangci-lint diff --git a/.github/workflows/goreleaser-ci.yml b/.github/workflows/goreleaser-ci.yml index 63f88008cbed..de1232e2e316 100644 --- a/.github/workflows/goreleaser-ci.yml +++ b/.github/workflows/goreleaser-ci.yml @@ -38,7 +38,7 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - - uses: actions/setup-go@v3 + - uses: actions/setup-go@6edd4406fa81c3da01a34fa6f6343087c207a568 with: go-version-file: go.mod - uses: actions/cache@v3 @@ -58,7 +58,7 @@ jobs: runs-on: [custom, linux, small] steps: - uses: actions/checkout@v3 - - uses: actions/setup-go@v3 + - uses: actions/setup-go@6edd4406fa81c3da01a34fa6f6343087c207a568 with: go-version-file: go.mod - uses: actions/cache@v3 diff --git a/.github/workflows/providerlint.yml b/.github/workflows/providerlint.yml index 903f5eca71eb..2c214bf144aa 100644 --- a/.github/workflows/providerlint.yml +++ b/.github/workflows/providerlint.yml @@ -20,7 +20,7 @@ jobs: runs-on: [custom, linux, small] steps: - uses: actions/checkout@v3 - - uses: actions/setup-go@v3 + - uses: actions/setup-go@6edd4406fa81c3da01a34fa6f6343087c207a568 with: go-version-file: go.mod - name: go env @@ -45,7 +45,7 @@ jobs: runs-on: [custom, linux, medium] steps: - uses: actions/checkout@v3 - - uses: actions/setup-go@v3 + - uses: actions/setup-go@6edd4406fa81c3da01a34fa6f6343087c207a568 with: go-version-file: go.mod - name: go env diff --git a/.github/workflows/skaff.yml b/.github/workflows/skaff.yml index 3393536279b2..4ec4dd721789 100644 --- a/.github/workflows/skaff.yml +++ b/.github/workflows/skaff.yml @@ -18,7 +18,7 @@ jobs: - uses: actions/checkout@v3 with: fetch-depth: 0 - - uses: actions/setup-go@v3 + - uses: actions/setup-go@6edd4406fa81c3da01a34fa6f6343087c207a568 with: go-version-file: skaff/go.mod # See also: https://github.com/actions/setup-go/issues/54 diff --git a/.github/workflows/snapshot.yml b/.github/workflows/snapshot.yml index b4bdd51d9103..a8a62d31a1cc 100644 --- a/.github/workflows/snapshot.yml +++ b/.github/workflows/snapshot.yml @@ -10,7 +10,7 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - - uses: actions/setup-go@v3 + - uses: actions/setup-go@6edd4406fa81c3da01a34fa6f6343087c207a568 with: go-version-file: go.mod - uses: actions/cache@v3 diff --git a/.github/workflows/terraform_provider.yml b/.github/workflows/terraform_provider.yml index 5f6415d87d77..3a239f86f62f 100644 --- a/.github/workflows/terraform_provider.yml +++ b/.github/workflows/terraform_provider.yml @@ -33,7 +33,7 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - - uses: actions/setup-go@v3 + - uses: actions/setup-go@6edd4406fa81c3da01a34fa6f6343087c207a568 with: go-version-file: go.mod - uses: actions/cache@v3 @@ -60,7 +60,7 @@ jobs: path: terraform-plugin-dir key: ${{ runner.os }}-terraform-plugin-dir-${{ hashFiles('go.sum') }}-${{ hashFiles('internal/**') }} - if: steps.cache-terraform-plugin-dir.outputs.cache-hit != 'true' || steps.cache-terraform-plugin-dir.outcome == 'failure' - uses: actions/setup-go@v3 + uses: actions/setup-go@6edd4406fa81c3da01a34fa6f6343087c207a568 with: go-version-file: go.mod # See also: https://github.com/actions/setup-go/issues/54 @@ -88,7 +88,7 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - - uses: actions/setup-go@v3 + - uses: actions/setup-go@6edd4406fa81c3da01a34fa6f6343087c207a568 with: go-version-file: go.mod # See also: https://github.com/actions/setup-go/issues/54 @@ -122,7 +122,7 @@ jobs: - uses: actions/checkout@v3 with: fetch-depth: 0 - - uses: actions/setup-go@v3 + - uses: actions/setup-go@6edd4406fa81c3da01a34fa6f6343087c207a568 with: go-version-file: go.mod # See also: https://github.com/actions/setup-go/issues/54 @@ -149,7 +149,7 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - - uses: actions/setup-go@v3 + - uses: actions/setup-go@6edd4406fa81c3da01a34fa6f6343087c207a568 with: go-version-file: go.mod # See also: https://github.com/actions/setup-go/issues/54 @@ -179,7 +179,7 @@ jobs: - uses: actions/checkout@v3 with: fetch-depth: 0 - - uses: actions/setup-go@v3 + - uses: actions/setup-go@6edd4406fa81c3da01a34fa6f6343087c207a568 with: go-version-file: go.mod # See also: https://github.com/actions/setup-go/issues/54 @@ -242,7 +242,7 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - - uses: actions/setup-go@v3 + - uses: actions/setup-go@6edd4406fa81c3da01a34fa6f6343087c207a568 with: go-version-file: go.mod - uses: actions/cache@v3 diff --git a/.github/workflows/website.yml b/.github/workflows/website.yml index 64bf77488d01..2c46fa961745 100644 --- a/.github/workflows/website.yml +++ b/.github/workflows/website.yml @@ -76,7 +76,7 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - - uses: actions/setup-go@v3 + - uses: actions/setup-go@6edd4406fa81c3da01a34fa6f6343087c207a568 with: go-version-file: .ci/tools/go.mod - uses: actions/cache@v3 @@ -92,7 +92,7 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - - uses: actions/setup-go@v3 + - uses: actions/setup-go@6edd4406fa81c3da01a34fa6f6343087c207a568 with: go-version-file: .ci/tools/go.mod - uses: actions/cache@v3 @@ -110,7 +110,7 @@ jobs: - uses: actions/checkout@v3 with: fetch-depth: 0 - - uses: actions/setup-go@v3 + - uses: actions/setup-go@6edd4406fa81c3da01a34fa6f6343087c207a568 with: go-version-file: .ci/tools/go.mod - uses: actions/cache@v3 diff --git a/.github/workflows/workflow-lint.yml b/.github/workflows/workflow-lint.yml index b86537330fb9..0b2eb11935f6 100644 --- a/.github/workflows/workflow-lint.yml +++ b/.github/workflows/workflow-lint.yml @@ -13,7 +13,7 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - - uses: actions/setup-go@v3 + - uses: actions/setup-go@6edd4406fa81c3da01a34fa6f6343087c207a568 with: go-version-file: .ci/tools/go.mod - name: Install actionlint From 8c548e366d82ed015d0a325f3f4dccb4610e996b Mon Sep 17 00:00:00 2001 From: Simon Davis Date: Wed, 1 Mar 2023 09:20:27 -0800 Subject: [PATCH 714/763] pin cache action to SHA --- .github/workflows/acctest-terraform-lint.yml | 6 ++-- .github/workflows/changelog.yml | 2 +- .github/workflows/documentation.yml | 2 +- .github/workflows/examples.yml | 6 ++-- .github/workflows/goreleaser-ci.yml | 4 +-- .github/workflows/providerlint.yml | 8 ++--- .github/workflows/skaff.yml | 4 +-- .github/workflows/snapshot.yml | 2 +- .github/workflows/terraform_provider.yml | 32 ++++++++++---------- .github/workflows/website.yml | 8 ++--- 10 files changed, 37 insertions(+), 37 deletions(-) diff --git a/.github/workflows/acctest-terraform-lint.yml b/.github/workflows/acctest-terraform-lint.yml index 92406038a6ea..92013dee5618 100644 --- a/.github/workflows/acctest-terraform-lint.yml +++ b/.github/workflows/acctest-terraform-lint.yml @@ -21,7 +21,7 @@ jobs: - uses: actions/setup-go@v3 with: go-version-file: go.mod - - uses: actions/cache@v3 + - uses: actions/cache@69d9d449aced6a2ede0bc19182fadc3a0a42d2b0 continue-on-error: true timeout-minutes: 2 with: @@ -49,13 +49,13 @@ jobs: - uses: actions/setup-go@v3 with: go-version-file: go.mod - - uses: actions/cache@v3 + - uses: actions/cache@69d9d449aced6a2ede0bc19182fadc3a0a42d2b0 continue-on-error: true timeout-minutes: 2 with: path: ~/go/pkg/mod key: ${{ runner.os }}-go-pkg-mod-${{ hashFiles('go.sum') }} - - uses: actions/cache@v3 + - uses: actions/cache@69d9d449aced6a2ede0bc19182fadc3a0a42d2b0 name: Cache plugin dir continue-on-error: true timeout-minutes: 2 diff --git a/.github/workflows/changelog.yml b/.github/workflows/changelog.yml index 6f3b6b0626cd..d65664f21c56 100644 --- a/.github/workflows/changelog.yml +++ b/.github/workflows/changelog.yml @@ -62,7 +62,7 @@ jobs: - uses: actions/setup-go@v3 with: go-version-file: go.mod - - uses: actions/cache@v3 + - uses: actions/cache@69d9d449aced6a2ede0bc19182fadc3a0a42d2b0 continue-on-error: true timeout-minutes: 2 with: diff --git a/.github/workflows/documentation.yml b/.github/workflows/documentation.yml index ad30caee1994..4bb4f1b67f60 100644 --- a/.github/workflows/documentation.yml +++ b/.github/workflows/documentation.yml @@ -41,7 +41,7 @@ jobs: - uses: actions/setup-go@v3 with: go-version-file: go.mod - - uses: actions/cache@v3 + - uses: actions/cache@69d9d449aced6a2ede0bc19182fadc3a0a42d2b0 continue-on-error: true timeout-minutes: 2 with: diff --git a/.github/workflows/examples.yml b/.github/workflows/examples.yml index 6517fef72177..ee848465ace3 100644 --- a/.github/workflows/examples.yml +++ b/.github/workflows/examples.yml @@ -21,7 +21,7 @@ jobs: - uses: actions/checkout@v3 with: fetch-depth: 0 - - uses: actions/cache@v3 + - uses: actions/cache@69d9d449aced6a2ede0bc19182fadc3a0a42d2b0 with: path: ~/go/pkg/mod key: ${{ runner.os }}-go-pkg-mod-${{ hashFiles('go.sum') }} @@ -32,7 +32,7 @@ jobs: - name: install tflint run: cd .ci/tools && go install github.com/terraform-linters/tflint - - uses: actions/cache@v3 + - uses: actions/cache@69d9d449aced6a2ede0bc19182fadc3a0a42d2b0 name: Cache plugin dir with: path: ~/.tflint.d/plugins @@ -70,7 +70,7 @@ jobs: - uses: actions/checkout@v3 with: fetch-depth: 0 - - uses: actions/cache@v3 + - uses: actions/cache@69d9d449aced6a2ede0bc19182fadc3a0a42d2b0 with: path: ~/go/pkg/mod key: ${{ runner.os }}-go-pkg-mod-${{ hashFiles('go.sum') }} diff --git a/.github/workflows/goreleaser-ci.yml b/.github/workflows/goreleaser-ci.yml index 63f88008cbed..e44326d80506 100644 --- a/.github/workflows/goreleaser-ci.yml +++ b/.github/workflows/goreleaser-ci.yml @@ -41,7 +41,7 @@ jobs: - uses: actions/setup-go@v3 with: go-version-file: go.mod - - uses: actions/cache@v3 + - uses: actions/cache@69d9d449aced6a2ede0bc19182fadc3a0a42d2b0 continue-on-error: true timeout-minutes: 2 with: @@ -61,7 +61,7 @@ jobs: - uses: actions/setup-go@v3 with: go-version-file: go.mod - - uses: actions/cache@v3 + - uses: actions/cache@69d9d449aced6a2ede0bc19182fadc3a0a42d2b0 continue-on-error: true timeout-minutes: 2 with: diff --git a/.github/workflows/providerlint.yml b/.github/workflows/providerlint.yml index 903f5eca71eb..4bfd091024b1 100644 --- a/.github/workflows/providerlint.yml +++ b/.github/workflows/providerlint.yml @@ -25,13 +25,13 @@ jobs: go-version-file: go.mod - name: go env run: echo "GOCACHE=$(go env GOCACHE)" >> $GITHUB_ENV - - uses: actions/cache@v3 + - uses: actions/cache@69d9d449aced6a2ede0bc19182fadc3a0a42d2b0 continue-on-error: true timeout-minutes: 2 with: path: ${{ env.GOCACHE }} key: ${{ runner.os }}-GOCACHE-${{ hashFiles('go.sum') }}-${{ hashFiles('internal/**') }} - - uses: actions/cache@v3 + - uses: actions/cache@69d9d449aced6a2ede0bc19182fadc3a0a42d2b0 continue-on-error: true timeout-minutes: 2 with: @@ -50,13 +50,13 @@ jobs: go-version-file: go.mod - name: go env run: echo "GOCACHE=$(go env GOCACHE)" >> $GITHUB_ENV - - uses: actions/cache@v3 + - uses: actions/cache@69d9d449aced6a2ede0bc19182fadc3a0a42d2b0 continue-on-error: true timeout-minutes: 2 with: path: ${{ env.GOCACHE }} key: ${{ runner.os }}-GOCACHE-${{ hashFiles('go.sum') }}-${{ hashFiles('internal/**') }} - - uses: actions/cache@v3 + - uses: actions/cache@69d9d449aced6a2ede0bc19182fadc3a0a42d2b0 continue-on-error: true timeout-minutes: 2 with: diff --git a/.github/workflows/skaff.yml b/.github/workflows/skaff.yml index 3393536279b2..2f58e04c4366 100644 --- a/.github/workflows/skaff.yml +++ b/.github/workflows/skaff.yml @@ -25,13 +25,13 @@ jobs: - name: go env run: | echo "GOCACHE=$(go env GOCACHE)" >> $GITHUB_ENV - - uses: actions/cache@v3 + - uses: actions/cache@69d9d449aced6a2ede0bc19182fadc3a0a42d2b0 continue-on-error: true timeout-minutes: 2 with: path: ${{ env.GOCACHE }} key: ${{ runner.os }}-GOCACHE-${{ hashFiles('go.sum') }}-${{ hashFiles('internal/**') }} - - uses: actions/cache@v3 + - uses: actions/cache@69d9d449aced6a2ede0bc19182fadc3a0a42d2b0 continue-on-error: true timeout-minutes: 2 with: diff --git a/.github/workflows/snapshot.yml b/.github/workflows/snapshot.yml index b4bdd51d9103..9ac9a7600e29 100644 --- a/.github/workflows/snapshot.yml +++ b/.github/workflows/snapshot.yml @@ -13,7 +13,7 @@ jobs: - uses: actions/setup-go@v3 with: go-version-file: go.mod - - uses: actions/cache@v3 + - uses: actions/cache@69d9d449aced6a2ede0bc19182fadc3a0a42d2b0 continue-on-error: true timeout-minutes: 2 with: diff --git a/.github/workflows/terraform_provider.yml b/.github/workflows/terraform_provider.yml index 5f6415d87d77..75074d6bfaac 100644 --- a/.github/workflows/terraform_provider.yml +++ b/.github/workflows/terraform_provider.yml @@ -36,7 +36,7 @@ jobs: - uses: actions/setup-go@v3 with: go-version-file: go.mod - - uses: actions/cache@v3 + - uses: actions/cache@69d9d449aced6a2ede0bc19182fadc3a0a42d2b0 continue-on-error: true id: cache-go-pkg-mod timeout-minutes: 2 @@ -52,7 +52,7 @@ jobs: runs-on: [custom, linux, medium] steps: - uses: actions/checkout@v3 - - uses: actions/cache@v3 + - uses: actions/cache@69d9d449aced6a2ede0bc19182fadc3a0a42d2b0 continue-on-error: true id: cache-terraform-plugin-dir timeout-minutes: 2 @@ -69,12 +69,12 @@ jobs: run: | echo "GOCACHE=$(go env GOCACHE)" >> $GITHUB_ENV - if: steps.cache-terraform-plugin-dir.outputs.cache-hit != 'true' || steps.cache-terraform-plugin-dir.outcome == 'failure' - uses: actions/cache@v3 + uses: actions/cache@69d9d449aced6a2ede0bc19182fadc3a0a42d2b0 with: path: ${{ env.GOCACHE }} key: ${{ runner.os }}-GOCACHE-${{ hashFiles('go.sum') }}-${{ hashFiles('internal/**') }} - if: steps.cache-terraform-plugin-dir.outputs.cache-hit != 'true' || steps.cache-terraform-plugin-dir.outcome == 'failure' - uses: actions/cache@v3 + uses: actions/cache@69d9d449aced6a2ede0bc19182fadc3a0a42d2b0 with: path: ~/go/pkg/mod key: ${{ runner.os }}-go-pkg-mod-${{ hashFiles('go.sum') }} @@ -95,13 +95,13 @@ jobs: - name: go env run: | echo "GOCACHE=$(go env GOCACHE)" >> $GITHUB_ENV - - uses: actions/cache@v3 + - uses: actions/cache@69d9d449aced6a2ede0bc19182fadc3a0a42d2b0 continue-on-error: true timeout-minutes: 2 with: path: ${{ env.GOCACHE }} key: ${{ runner.os }}-GOCACHE-${{ hashFiles('go.sum') }}-${{ hashFiles('internal/**') }} - - uses: actions/cache@v3 + - uses: actions/cache@69d9d449aced6a2ede0bc19182fadc3a0a42d2b0 continue-on-error: true timeout-minutes: 2 with: @@ -129,13 +129,13 @@ jobs: - name: go env run: | echo "GOCACHE=$(go env GOCACHE)" >> $GITHUB_ENV - - uses: actions/cache@v3 + - uses: actions/cache@69d9d449aced6a2ede0bc19182fadc3a0a42d2b0 continue-on-error: true timeout-minutes: 2 with: path: ${{ env.GOCACHE }} key: ${{ runner.os }}-GOCACHE-${{ hashFiles('go.sum') }}-${{ hashFiles('internal/**') }} - - uses: actions/cache@v3 + - uses: actions/cache@69d9d449aced6a2ede0bc19182fadc3a0a42d2b0 continue-on-error: true timeout-minutes: 2 with: @@ -156,13 +156,13 @@ jobs: - name: go env run: | echo "GOCACHE=$(go env GOCACHE)" >> $GITHUB_ENV - - uses: actions/cache@v3 + - uses: actions/cache@69d9d449aced6a2ede0bc19182fadc3a0a42d2b0 continue-on-error: true timeout-minutes: 2 with: path: ${{ env.GOCACHE }} key: ${{ runner.os }}-GOCACHE-${{ hashFiles('go.sum') }}-${{ hashFiles('internal/**') }} - - uses: actions/cache@v3 + - uses: actions/cache@69d9d449aced6a2ede0bc19182fadc3a0a42d2b0 continue-on-error: true timeout-minutes: 2 with: @@ -186,13 +186,13 @@ jobs: - name: go env run: | echo "GOCACHE=$(go env GOCACHE)" >> $GITHUB_ENV - - uses: actions/cache@v3 + - uses: actions/cache@69d9d449aced6a2ede0bc19182fadc3a0a42d2b0 continue-on-error: true timeout-minutes: 2 with: path: ${{ env.GOCACHE }} key: ${{ runner.os }}-GOCACHE-${{ hashFiles('go.sum') }}-${{ hashFiles('internal/**') }} - - uses: actions/cache@v3 + - uses: actions/cache@69d9d449aced6a2ede0bc19182fadc3a0a42d2b0 continue-on-error: true timeout-minutes: 2 with: @@ -207,7 +207,7 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - - uses: actions/cache@v3 + - uses: actions/cache@69d9d449aced6a2ede0bc19182fadc3a0a42d2b0 continue-on-error: true id: cache-terraform-providers-schema timeout-minutes: 2 @@ -215,7 +215,7 @@ jobs: path: terraform-providers-schema key: ${{ runner.os }}-terraform-providers-schema-${{ hashFiles('go.sum') }}-${{ hashFiles('internal/**') }} - if: steps.cache-terraform-providers-schema.outputs.cache-hit != 'true' || steps.cache-terraform-providers-schema.outcome == 'failure' - uses: actions/cache@v3 + uses: actions/cache@69d9d449aced6a2ede0bc19182fadc3a0a42d2b0 timeout-minutes: 2 with: path: terraform-plugin-dir @@ -245,14 +245,14 @@ jobs: - uses: actions/setup-go@v3 with: go-version-file: go.mod - - uses: actions/cache@v3 + - uses: actions/cache@69d9d449aced6a2ede0bc19182fadc3a0a42d2b0 continue-on-error: true timeout-minutes: 2 with: path: ~/go/pkg/mod key: ${{ runner.os }}-go-pkg-mod-${{ hashFiles('go.sum') }} - run: cd .ci/tools && go install github.com/bflad/tfproviderdocs - - uses: actions/cache@v3 + - uses: actions/cache@69d9d449aced6a2ede0bc19182fadc3a0a42d2b0 timeout-minutes: 2 with: path: terraform-providers-schema diff --git a/.github/workflows/website.yml b/.github/workflows/website.yml index 64bf77488d01..82f4a67ad9b9 100644 --- a/.github/workflows/website.yml +++ b/.github/workflows/website.yml @@ -79,7 +79,7 @@ jobs: - uses: actions/setup-go@v3 with: go-version-file: .ci/tools/go.mod - - uses: actions/cache@v3 + - uses: actions/cache@69d9d449aced6a2ede0bc19182fadc3a0a42d2b0 continue-on-error: true timeout-minutes: 2 with: @@ -95,7 +95,7 @@ jobs: - uses: actions/setup-go@v3 with: go-version-file: .ci/tools/go.mod - - uses: actions/cache@v3 + - uses: actions/cache@69d9d449aced6a2ede0bc19182fadc3a0a42d2b0 continue-on-error: true timeout-minutes: 2 with: @@ -113,7 +113,7 @@ jobs: - uses: actions/setup-go@v3 with: go-version-file: .ci/tools/go.mod - - uses: actions/cache@v3 + - uses: actions/cache@69d9d449aced6a2ede0bc19182fadc3a0a42d2b0 continue-on-error: true timeout-minutes: 2 with: @@ -123,7 +123,7 @@ jobs: - run: cd .ci/tools && go install github.com/katbyte/terrafmt - run: cd .ci/tools && go install github.com/terraform-linters/tflint - - uses: actions/cache@v3 + - uses: actions/cache@69d9d449aced6a2ede0bc19182fadc3a0a42d2b0 name: Cache plugin dir with: path: ~/.tflint.d/plugins From b5bc078792134cf2c6e2a2b32dff71d1e3ed0abb Mon Sep 17 00:00:00 2001 From: Martin Samuels Date: Mon, 13 Mar 2023 14:12:00 +0000 Subject: [PATCH 715/763] docs: fix linting errors Signed-off-by: Martin Samuels --- website/docs/r/budgets_budget.html.markdown | 32 +++++++++++---------- 1 file changed, 17 insertions(+), 15 deletions(-) diff --git a/website/docs/r/budgets_budget.html.markdown b/website/docs/r/budgets_budget.html.markdown index 82e87d8ab5e6..ce1647a3c8fc 100644 --- a/website/docs/r/budgets_budget.html.markdown +++ b/website/docs/r/budgets_budget.html.markdown @@ -138,7 +138,7 @@ resource "aws_budgets_budget" "ri_utilization" { } ``` -Create a Cost Filter using Resource Tags +Create a Cost Filter using Resource Tags ```terraform resource "aws_budgets_budget" "cost" { @@ -149,6 +149,7 @@ resource "aws_budgets_budget" "cost" { "TagKey$TagValue", ] } +} ``` Create a cost_filter using resource tags, obtaining the tag value from a terraform variable @@ -162,6 +163,7 @@ resource "aws_budgets_budget" "cost" { "TagKey${"$"}${var.TagValue}" ] } +} ``` ## Argument Reference @@ -229,20 +231,20 @@ Refer to [AWS CostTypes documentation](https://docs.aws.amazon.com/aws-cost-mana Based on your choice of budget type, you can choose one or more of the available budget filters. - * `PurchaseType` - * `UsageTypeGroup` - * `Service` - * `Operation` - * `UsageType` - * `BillingEntity` - * `CostCategory` - * `LinkedAccount` - * `TagKeyValue` - * `LegalEntityName` - * `InvoicingEntity` - * `AZ` - * `Region` - * `InstanceType` +* `PurchaseType` +* `UsageTypeGroup` +* `Service` +* `Operation` +* `UsageType` +* `BillingEntity` +* `CostCategory` +* `LinkedAccount` +* `TagKeyValue` +* `LegalEntityName` +* `InvoicingEntity` +* `AZ` +* `Region` +* `InstanceType` Refer to [AWS CostFilter documentation](https://docs.aws.amazon.com/cost-management/latest/userguide/budgets-create-filters.html) for further detail. From 8439840f91ded27eca47dce9c7a9f7aee9c56690 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Mon, 13 Mar 2023 10:44:07 -0400 Subject: [PATCH 716/763] Fix golangci-lint 'contextcheck'. --- internal/service/oam/sink_test.go | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/internal/service/oam/sink_test.go b/internal/service/oam/sink_test.go index c98a2d471520..5ffdb21a4350 100644 --- a/internal/service/oam/sink_test.go +++ b/internal/service/oam/sink_test.go @@ -34,7 +34,7 @@ func TestAccObservabilityAccessManagerSink_basic(t *testing.T) { PreCheck: func() { acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(t, names.ObservabilityAccessManagerEndpointID) - testAccPreCheck(t) + testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, names.ObservabilityAccessManagerEndpointID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, @@ -73,7 +73,7 @@ func TestAccObservabilityAccessManagerSink_disappears(t *testing.T) { PreCheck: func() { acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(t, names.ObservabilityAccessManagerEndpointID) - testAccPreCheck(t) + testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, names.ObservabilityAccessManagerEndpointID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, @@ -105,7 +105,7 @@ func TestAccObservabilityAccessManagerSink_tags(t *testing.T) { PreCheck: func() { acctest.PreCheck(ctx, t) acctest.PreCheckPartitionHasService(t, names.ObservabilityAccessManagerEndpointID) - testAccPreCheck(t) + testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, names.ObservabilityAccessManagerEndpointID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, @@ -200,9 +200,8 @@ func testAccCheckSinkExists(ctx context.Context, name string, sink *oam.GetSinkO } } -func testAccPreCheck(t *testing.T) { +func testAccPreCheck(ctx context.Context, t *testing.T) { conn := acctest.Provider.Meta().(*conns.AWSClient).ObservabilityAccessManagerClient() - ctx := context.Background() input := &oam.ListSinksInput{} _, err := conn.ListSinks(ctx, input) From 4a6c782017abf366aba3867710b938a94ee7c8cd Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Mon, 13 Mar 2023 10:48:53 -0400 Subject: [PATCH 717/763] r/aws_batch_compute_environment: Test multiple 'compute_resources.ec2_configuration's. --- .changelog/27207.txt | 3 +++ internal/service/batch/compute_environment_test.go | 10 +++++++++- 2 files changed, 12 insertions(+), 1 deletion(-) create mode 100644 .changelog/27207.txt diff --git a/.changelog/27207.txt b/.changelog/27207.txt new file mode 100644 index 000000000000..62cea2322052 --- /dev/null +++ b/.changelog/27207.txt @@ -0,0 +1,3 @@ +```release-note:enhancement +resource/aws_batch_compute_environment: Allow a maximum of 2 `compute_resources.ec2_configuration`s +``` \ No newline at end of file diff --git a/internal/service/batch/compute_environment_test.go b/internal/service/batch/compute_environment_test.go index 07259340d862..c4e708529798 100644 --- a/internal/service/batch/compute_environment_test.go +++ b/internal/service/batch/compute_environment_test.go @@ -1036,9 +1036,11 @@ func TestAccBatchComputeEnvironment_ec2Configuration(t *testing.T) { resource.TestCheckResourceAttrPair(resourceName, "compute_resources.0.instance_role", instanceProfileResourceName, "arn"), resource.TestCheckResourceAttr(resourceName, "compute_resources.0.instance_type.#", "1"), resource.TestCheckTypeSetElemAttr(resourceName, "compute_resources.0.instance_type.*", "optimal"), - resource.TestCheckResourceAttr(resourceName, "compute_resources.0.ec2_configuration.#", "1"), + resource.TestCheckResourceAttr(resourceName, "compute_resources.0.ec2_configuration.#", "2"), resource.TestCheckResourceAttrSet(resourceName, "compute_resources.0.ec2_configuration.0.image_id_override"), resource.TestCheckResourceAttr(resourceName, "compute_resources.0.ec2_configuration.0.image_type", "ECS_AL2"), + resource.TestCheckResourceAttrSet(resourceName, "compute_resources.0.ec2_configuration.1.image_id_override"), + resource.TestCheckResourceAttr(resourceName, "compute_resources.0.ec2_configuration.1.image_type", "ECS_AL2_NVIDIA"), resource.TestCheckResourceAttr(resourceName, "compute_resources.0.max_vcpus", "16"), resource.TestCheckResourceAttr(resourceName, "compute_resources.0.min_vcpus", "0"), resource.TestCheckResourceAttr(resourceName, "compute_resources.0.security_group_ids.#", "1"), @@ -2461,11 +2463,17 @@ resource "aws_batch_compute_environment" "test" { compute_resources { instance_role = aws_iam_instance_profile.ecs_instance.arn instance_type = ["optimal"] + ec2_configuration { image_id_override = data.aws_ami.amzn-ami-minimal-hvm-ebs.id image_type = "ECS_AL2" } + ec2_configuration { + image_id_override = data.aws_ami.amzn-ami-minimal-hvm-ebs.id + image_type = "ECS_AL2_NVIDIA" + } + max_vcpus = 16 min_vcpus = 0 From e9ece54e04eaa919a0c7ea1d95c1e43a86114b2b Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Mon, 13 Mar 2023 10:51:20 -0400 Subject: [PATCH 718/763] r/aws_wafregional_rule_group: Fix spurions 'Error: deleting WAF Regional Rule Group ...'. --- internal/service/wafregional/rule_group.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/internal/service/wafregional/rule_group.go b/internal/service/wafregional/rule_group.go index 8fcfdb35c242..22674ae0d711 100644 --- a/internal/service/wafregional/rule_group.go +++ b/internal/service/wafregional/rule_group.go @@ -221,7 +221,11 @@ func resourceRuleGroupDelete(ctx context.Context, d *schema.ResourceData, meta i oldRules := d.Get("activated_rule").(*schema.Set).List() err := DeleteRuleGroup(ctx, d.Id(), oldRules, conn, region) - return sdkdiag.AppendErrorf(diags, "deleting WAF Regional Rule Group (%s): %s", d.Id(), err) + if err != nil { + return sdkdiag.AppendErrorf(diags, "deleting WAF Regional Rule Group (%s): %s", d.Id(), err) + } + + return diags } func DeleteRuleGroup(ctx context.Context, id string, oldRules []interface{}, conn *wafregional.WAFRegional, region string) error { From 10b1d395457ebc2074325995e7b64a75d33a90c6 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Mon, 13 Mar 2023 11:03:08 -0400 Subject: [PATCH 719/763] r/aws_fms_policy: Tidy up. --- internal/service/fms/policy.go | 76 ++++++++++++----------------- internal/service/fms/policy_test.go | 22 ++++----- 2 files changed, 41 insertions(+), 57 deletions(-) diff --git a/internal/service/fms/policy.go b/internal/service/fms/policy.go index 212af0dc7d36..54a4dfff1e12 100644 --- a/internal/service/fms/policy.go +++ b/internal/service/fms/policy.go @@ -2,7 +2,6 @@ package fms import ( "context" - "fmt" "log" "regexp" @@ -200,14 +199,40 @@ func resourcePolicyRead(ctx context.Context, d *schema.ResourceData, meta interf return sdkdiag.AppendErrorf(diags, "reading FMS Policy (%s): %s", d.Id(), err) } - if err := resourcePolicyFlattenPolicy(d, output); err != nil { - return sdkdiag.AppendErrorf(diags, "reading FMS Policy (%s): %s", d.Id(), err) + arn := aws.StringValue(output.PolicyArn) + d.Set("arn", arn) + policy := output.Policy + d.Set("delete_unused_fm_managed_resources", policy.DeleteUnusedFMManagedResources) + d.Set("description", policy.PolicyDescription) + if err := d.Set("exclude_map", flattenPolicyMap(policy.ExcludeMap)); err != nil { + sdkdiag.AppendErrorf(diags, "setting exclude_map: %s", err) + } + d.Set("exclude_resource_tags", policy.ExcludeResourceTags) + if err := d.Set("include_map", flattenPolicyMap(policy.IncludeMap)); err != nil { + sdkdiag.AppendErrorf(diags, "setting include_map: %s", err) + } + d.Set("name", policy.PolicyName) + d.Set("policy_update_token", policy.PolicyUpdateToken) + d.Set("remediation_enabled", policy.RemediationEnabled) + if err := d.Set("resource_tags", flattenResourceTags(policy.ResourceTags)); err != nil { + sdkdiag.AppendErrorf(diags, "setting resource_tags: %s", err) + } + d.Set("resource_type", policy.ResourceType) + if err := d.Set("resource_type_list", policy.ResourceTypeList); err != nil { + sdkdiag.AppendErrorf(diags, "setting resource_type_list: %s", err) + } + securityServicePolicy := []map[string]string{{ + "type": aws.StringValue(policy.SecurityServicePolicyData.Type), + "managed_service_data": aws.StringValue(policy.SecurityServicePolicyData.ManagedServiceData), + }} + if err := d.Set("security_service_policy_data", securityServicePolicy); err != nil { + sdkdiag.AppendErrorf(diags, "setting security_service_policy_data: %s", err) } - tags, err := ListTags(ctx, conn, d.Get("arn").(string)) + tags, err := ListTags(ctx, conn, arn) if err != nil { - return sdkdiag.AppendErrorf(diags, "reading FMS Policy (%s): listing tags: %s", d.Id(), err) + return sdkdiag.AppendErrorf(diags, "listing tags for FMS Policy (%s): %s", d.Id(), err) } tags = tags.IgnoreAWS().IgnoreConfig(ignoreTagsConfig) @@ -289,52 +314,13 @@ func FindPolicyByID(ctx context.Context, conn *fms.FMS, id string) (*fms.GetPoli return nil, err } - if output == nil { + if output == nil || output.Policy == nil || output.Policy.SecurityServicePolicyData == nil { return nil, tfresource.NewEmptyResultError(input) } return output, nil } -func resourcePolicyFlattenPolicy(d *schema.ResourceData, resp *fms.GetPolicyOutput) error { - d.Set("arn", resp.PolicyArn) - - d.Set("delete_unused_fm_managed_resources", resp.Policy.DeleteUnusedFMManagedResources) - d.Set("description", resp.Policy.PolicyDescription) - d.Set("exclude_resource_tags", resp.Policy.ExcludeResourceTags) - d.Set("name", resp.Policy.PolicyName) - d.Set("policy_update_token", resp.Policy.PolicyUpdateToken) - d.Set("remediation_enabled", resp.Policy.RemediationEnabled) - d.Set("resource_type", resp.Policy.ResourceType) - - if err := d.Set("exclude_map", flattenPolicyMap(resp.Policy.ExcludeMap)); err != nil { - return fmt.Errorf("setting exclude_map: %w", err) - } - - if err := d.Set("include_map", flattenPolicyMap(resp.Policy.IncludeMap)); err != nil { - return fmt.Errorf("setting include_map: %w", err) - } - - if err := d.Set("resource_type_list", resp.Policy.ResourceTypeList); err != nil { - return fmt.Errorf("setting resource_type_list: %w", err) - } - - if err := d.Set("resource_tags", flattenResourceTags(resp.Policy.ResourceTags)); err != nil { - return fmt.Errorf("setting resource_tags: %w", err) - } - - securityServicePolicy := []map[string]string{{ - "type": *resp.Policy.SecurityServicePolicyData.Type, - "managed_service_data": *resp.Policy.SecurityServicePolicyData.ManagedServiceData, - }} - - if err := d.Set("security_service_policy_data", securityServicePolicy); err != nil { - return fmt.Errorf("setting security_service_policy_data: %w", err) - } - - return nil -} - func resourcePolicyExpandPolicy(d *schema.ResourceData) *fms.Policy { resourceType := aws.String("ResourceTypeList") resourceTypeList := flex.ExpandStringSet(d.Get("resource_type_list").(*schema.Set)) diff --git a/internal/service/fms/policy_test.go b/internal/service/fms/policy_test.go index 598e47c72670..a09515a0344c 100644 --- a/internal/service/fms/policy_test.go +++ b/internal/service/fms/policy_test.go @@ -270,18 +270,16 @@ func testAccCheckPolicyExists(ctx context.Context, n string) resource.TestCheckF } } -func testAccPolicyConfigOrgMgmtAccountBase() string { - return acctest.ConfigCompose(testAccAdminRegionProviderConfig(), ` +const testAccPolicyConfigOrgMgmtAccount_base = ` data "aws_caller_identity" "current" {} resource "aws_fms_admin_account" "test" { account_id = data.aws_caller_identity.current.account_id } -`) -} +` func testAccPolicyConfig_basic(policyName, ruleGroupName string) string { - return acctest.ConfigCompose(testAccPolicyConfigOrgMgmtAccountBase(), fmt.Sprintf(` + return acctest.ConfigCompose(testAccPolicyConfigOrgMgmtAccount_base, fmt.Sprintf(` resource "aws_fms_policy" "test" { exclude_resource_tags = false name = %[1]q @@ -309,7 +307,7 @@ resource "aws_wafregional_rule_group" "test" { } func testAccPolicyConfig_cloudFrontDistribution(rName string) string { - return acctest.ConfigCompose(testAccPolicyConfigOrgMgmtAccountBase(), fmt.Sprintf(` + return acctest.ConfigCompose(testAccPolicyConfigOrgMgmtAccount_base, fmt.Sprintf(` resource "aws_fms_policy" "test" { exclude_resource_tags = false name = %[1]q @@ -385,7 +383,7 @@ resource "aws_kinesis_firehose_delivery_stream" "test" { } func testAccPolicyConfig_updated(policyName, ruleGroupName string) string { - return acctest.ConfigCompose(testAccPolicyConfigOrgMgmtAccountBase(), fmt.Sprintf(` + return acctest.ConfigCompose(testAccPolicyConfigOrgMgmtAccount_base, fmt.Sprintf(` resource "aws_fms_policy" "test" { exclude_resource_tags = false name = %[1]q @@ -416,7 +414,7 @@ resource "aws_wafregional_rule_group" "test" { } func testAccPolicyConfig_include(rName string) string { - return acctest.ConfigCompose(testAccPolicyConfigOrgMgmtAccountBase(), fmt.Sprintf(` + return acctest.ConfigCompose(testAccPolicyConfigOrgMgmtAccount_base, fmt.Sprintf(` resource "aws_fms_policy" "test" { exclude_resource_tags = false name = %[1]q @@ -443,7 +441,7 @@ resource "aws_wafregional_rule_group" "test" { } func testAccPolicyConfig_resourceTags1(rName, tagKey1, tagValue1 string) string { - return acctest.ConfigCompose(testAccPolicyConfigOrgMgmtAccountBase(), fmt.Sprintf(` + return acctest.ConfigCompose(testAccPolicyConfigOrgMgmtAccount_base, fmt.Sprintf(` resource "aws_fms_policy" "test" { exclude_resource_tags = false name = %[1]q @@ -470,7 +468,7 @@ resource "aws_wafregional_rule_group" "test" { } func testAccPolicyConfig_resourceTags2(rName, tagKey1, tagValue1, tagKey2, tagValue2 string) string { - return acctest.ConfigCompose(testAccPolicyConfigOrgMgmtAccountBase(), fmt.Sprintf(` + return acctest.ConfigCompose(testAccPolicyConfigOrgMgmtAccount_base, fmt.Sprintf(` resource "aws_fms_policy" "test" { exclude_resource_tags = false name = %[1]q @@ -498,7 +496,7 @@ resource "aws_wafregional_rule_group" "test" { } func testAccPolicyConfig_tags1(rName, tagKey1, tagValue1 string) string { - return acctest.ConfigCompose(testAccPolicyConfigOrgMgmtAccountBase(), fmt.Sprintf(` + return acctest.ConfigCompose(testAccPolicyConfigOrgMgmtAccount_base, fmt.Sprintf(` resource "aws_fms_policy" "test" { exclude_resource_tags = false name = %[1]q @@ -525,7 +523,7 @@ resource "aws_wafregional_rule_group" "test" { } func testAccPolicyConfig_tags2(rName, tagKey1, tagValue1, tagKey2, tagValue2 string) string { - return acctest.ConfigCompose(testAccPolicyConfigOrgMgmtAccountBase(), fmt.Sprintf(` + return acctest.ConfigCompose(testAccPolicyConfigOrgMgmtAccount_base, fmt.Sprintf(` resource "aws_fms_policy" "test" { exclude_resource_tags = false name = %[1]q From e943cdfbf38a28557202218adbd2581ea47bff00 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Mon, 13 Mar 2023 11:05:54 -0400 Subject: [PATCH 720/763] Update .changelog/26746.txt Co-authored-by: Tim Bannister --- .changelog/26746.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.changelog/26746.txt b/.changelog/26746.txt index d9e0cc1dc79e..a33c1e38f351 100644 --- a/.changelog/26746.txt +++ b/.changelog/26746.txt @@ -1,3 +1,3 @@ ```release-note:bug -data/aws_opensearch_domain: Adds missing anonymous_auth_enabled parameter to aws_opensearch_domain data resource +data/aws_opensearch_domain: Add missing `anonymous_auth_enabled` parameter to `aws_opensearch_domain` data resource ``` \ No newline at end of file From 778b0d44356d762f6e5c7b580adf69fe5506b932 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Mon, 13 Mar 2023 11:09:24 -0400 Subject: [PATCH 721/763] Tweak CHANGELOG entry. --- .changelog/26746.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.changelog/26746.txt b/.changelog/26746.txt index a33c1e38f351..e9617b389579 100644 --- a/.changelog/26746.txt +++ b/.changelog/26746.txt @@ -1,3 +1,3 @@ ```release-note:bug -data/aws_opensearch_domain: Add missing `anonymous_auth_enabled` parameter to `aws_opensearch_domain` data resource +data-source/aws_opensearch_domain: Add missing `advanced_security_options.anonymous_auth_enabled` attribute ``` \ No newline at end of file From 31c51136424102d08073d695668c70c800fe878e Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Mon, 13 Mar 2023 11:14:53 -0400 Subject: [PATCH 722/763] d/aws_opensearch_domain: Tidy up 'TestAccOpenSearchDomainDataSource_Data_advanced'. --- .../opensearch/domain_data_source_test.go | 43 ++++++------------- 1 file changed, 12 insertions(+), 31 deletions(-) diff --git a/internal/service/opensearch/domain_data_source_test.go b/internal/service/opensearch/domain_data_source_test.go index 8ce46d83267d..1bbc6a0d9193 100644 --- a/internal/service/opensearch/domain_data_source_test.go +++ b/internal/service/opensearch/domain_data_source_test.go @@ -72,7 +72,9 @@ func TestAccOpenSearchDomainDataSource_Data_advanced(t *testing.T) { { Config: testAccDomainDataSourceConfig_advanced(rName, autoTuneStartAtTime), Check: resource.ComposeAggregateTestCheckFunc( - resource.TestCheckResourceAttrPair(datasourceName, "engine_version", resourceName, "engine_version"), + resource.TestCheckResourceAttrPair(datasourceName, "advanced_security_options.#", resourceName, "advanced_security_options.#"), + resource.TestCheckResourceAttrPair(datasourceName, "advanced_security_options.0.enabled", resourceName, "advanced_security_options.0.enabled"), + resource.TestCheckResourceAttrPair(datasourceName, "advanced_security_options.0.internal_user_database_enabled", resourceName, "advanced_security_options.0.internal_user_database_enabled"), resource.TestCheckResourceAttrPair(datasourceName, "auto_tune_options.#", resourceName, "auto_tune_options.#"), resource.TestCheckResourceAttrPair(datasourceName, "auto_tune_options.0.desired_state", resourceName, "auto_tune_options.0.desired_state"), resource.TestCheckResourceAttrPair(datasourceName, "auto_tune_options.0.maintenance_schedule", resourceName, "auto_tune_options.0.maintenance_schedule"), @@ -86,12 +88,11 @@ func TestAccOpenSearchDomainDataSource_Data_advanced(t *testing.T) { resource.TestCheckResourceAttrPair(datasourceName, "ebs_options.0.ebs_enabled", resourceName, "ebs_options.0.ebs_enabled"), resource.TestCheckResourceAttrPair(datasourceName, "ebs_options.0.volume_type", resourceName, "ebs_options.0.volume_type"), resource.TestCheckResourceAttrPair(datasourceName, "ebs_options.0.volume_size", resourceName, "ebs_options.0.volume_size"), + resource.TestCheckResourceAttrPair(datasourceName, "engine_version", resourceName, "engine_version"), + resource.TestCheckResourceAttrPair(datasourceName, "log_publishing_options.#", resourceName, "log_publishing_options.#"), resource.TestCheckResourceAttrPair(datasourceName, "snapshot_options.#", resourceName, "snapshot_options.#"), resource.TestCheckResourceAttrPair(datasourceName, "snapshot_options.0.automated_snapshot_start_hour", resourceName, "snapshot_options.0.automated_snapshot_start_hour"), - resource.TestCheckResourceAttrPair(datasourceName, "log_publishing_options.#", resourceName, "log_publishing_options.#"), resource.TestCheckResourceAttrPair(datasourceName, "vpc_options.#", resourceName, "vpc_options.#"), - resource.TestCheckResourceAttrPair(datasourceName, "advanced_security_options.0.enabled", resourceName, "advanced_security_options.0.enabled"), - resource.TestCheckResourceAttrPair(datasourceName, "advanced_security_options.0.internal_user_database_enabled", resourceName, "advanced_security_options.0.internal_user_database_enabled"), ), }, }, @@ -183,9 +184,7 @@ data "aws_opensearch_domain" "test" { } func testAccDomainDataSourceConfig_advanced(rName, autoTuneStartAtTime string) string { - return acctest.ConfigCompose( - acctest.ConfigAvailableAZsNoOptIn(), - fmt.Sprintf(` + return acctest.ConfigCompose(acctest.ConfigVPCWithSubnets(rName, 2), fmt.Sprintf(` data "aws_partition" "current" {} data "aws_region" "current" {} @@ -220,25 +219,13 @@ resource "aws_cloudwatch_log_resource_policy" "test" { CONFIG } -resource "aws_vpc" "test" { - cidr_block = "10.0.0.0/16" -} - -resource "aws_subnet" "test" { - availability_zone = data.aws_availability_zones.available.names[0] - cidr_block = "10.0.0.0/24" - vpc_id = aws_vpc.test.id -} - -resource "aws_subnet" "test2" { - availability_zone = data.aws_availability_zones.available.names[1] - cidr_block = "10.0.1.0/24" - vpc_id = aws_vpc.test.id -} - resource "aws_security_group" "test" { name = %[1]q vpc_id = aws_vpc.test.id + + tags = { + Name = %[1]q + } } resource "aws_security_group_rule" "test" { @@ -286,7 +273,6 @@ POLICY } rollback_on_disable = "NO_ROLLBACK" - } cluster_config { @@ -317,13 +303,8 @@ POLICY } vpc_options { - security_group_ids = [ - aws_security_group.test.id - ] - subnet_ids = [ - aws_subnet.test.id, - aws_subnet.test2.id - ] + security_group_ids = [aws_security_group.test.id] + subnet_ids = aws_subnet.test[*].id } advanced_security_options { From 33a725cdb6ce3a9d6887010ac87b505e31177afa Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Mon, 13 Mar 2023 13:20:36 -0400 Subject: [PATCH 723/763] r/aws_instance: Allow update of 'private_dns_name_options'. --- internal/service/ec2/ec2_instance.go | 31 ++++++++++++-- internal/service/ec2/ec2_instance_test.go | 51 ++++++++++++++++++----- 2 files changed, 68 insertions(+), 14 deletions(-) diff --git a/internal/service/ec2/ec2_instance.go b/internal/service/ec2/ec2_instance.go index bec1967df8c0..77cb1b9336c7 100644 --- a/internal/service/ec2/ec2_instance.go +++ b/internal/service/ec2/ec2_instance.go @@ -531,19 +531,16 @@ func ResourceInstance() *schema.Resource { Type: schema.TypeBool, Optional: true, Computed: true, - ForceNew: false, }, "enable_resource_name_dns_a_record": { Type: schema.TypeBool, Optional: true, Computed: true, - ForceNew: false, }, "hostname_type": { Type: schema.TypeString, Optional: true, Computed: true, - ForceNew: true, ValidateFunc: validation.StringInSlice(ec2.HostnameType_Values(), false), }, }, @@ -1812,6 +1809,34 @@ func resourceInstanceUpdate(ctx context.Context, d *schema.ResourceData, meta in } } + if d.HasChange("private_dns_name_options") && !d.IsNewResource() { + if v, ok := d.GetOk("private_dns_name_options"); ok && len(v.([]interface{})) > 0 && v.([]interface{})[0] != nil { + tfMap := v.([]interface{})[0].(map[string]interface{}) + + input := &ec2.ModifyPrivateDnsNameOptionsInput{ + InstanceId: aws.String(d.Id()), + } + + if d.HasChange("private_dns_name_options.0.enable_resource_name_dns_aaaa_record") { + input.EnableResourceNameDnsAAAARecord = aws.Bool(tfMap["enable_resource_name_dns_aaaa_record"].(bool)) + } + + if d.HasChange("private_dns_name_options.0.enable_resource_name_dns_a_record") { + input.EnableResourceNameDnsARecord = aws.Bool(tfMap["enable_resource_name_dns_a_record"].(bool)) + } + + if d.HasChange("private_dns_name_options.0.hostname_type") { + input.PrivateDnsHostnameType = aws.String(tfMap["hostname_type"].(string)) + } + + _, err := conn.ModifyPrivateDnsNameOptionsWithContext(ctx, input) + + if err != nil { + return sdkdiag.AppendErrorf(diags, "updating EC2 Instance (%s): modifying private DNS name options: %s", d.Id(), err) + } + } + } + // TODO(mitchellh): wait for the attributes we modified to // persist the change... diff --git a/internal/service/ec2/ec2_instance_test.go b/internal/service/ec2/ec2_instance_test.go index c72389054179..d1772ed19335 100644 --- a/internal/service/ec2/ec2_instance_test.go +++ b/internal/service/ec2/ec2_instance_test.go @@ -1870,7 +1870,7 @@ func TestAccEC2Instance_PrivateDNSNameOptions_computed(t *testing.T) { func TestAccEC2Instance_PrivateDNSNameOptions_configured(t *testing.T) { ctx := acctest.Context(t) - var v ec2.Instance + var v1, v2, v3 ec2.Instance resourceName := "aws_instance.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) @@ -1881,9 +1881,9 @@ func TestAccEC2Instance_PrivateDNSNameOptions_configured(t *testing.T) { CheckDestroy: testAccCheckInstanceDestroy(ctx), Steps: []resource.TestStep{ { - Config: testAccInstanceConfig_PrivateDNSNameOptions_configured(rName), + Config: testAccInstanceConfig_PrivateDNSNameOptions_configured(rName, false, true, "ip-name"), Check: resource.ComposeTestCheckFunc( - testAccCheckInstanceExists(ctx, resourceName, &v), + testAccCheckInstanceExists(ctx, resourceName, &v1), resource.TestCheckResourceAttr(resourceName, "private_dns_name_options.#", "1"), resource.TestCheckResourceAttr(resourceName, "private_dns_name_options.0.enable_resource_name_dns_aaaa_record", "false"), resource.TestCheckResourceAttr(resourceName, "private_dns_name_options.0.enable_resource_name_dns_a_record", "true"), @@ -1896,6 +1896,35 @@ func TestAccEC2Instance_PrivateDNSNameOptions_configured(t *testing.T) { ImportStateVerify: true, ImportStateVerifyIgnore: []string{"user_data_replace_on_change"}, }, + { + Config: testAccInstanceConfig_PrivateDNSNameOptions_configured(rName, true, true, "ip-name"), + Check: resource.ComposeTestCheckFunc( + testAccCheckInstanceExists(ctx, resourceName, &v2), + testAccCheckInstanceNotRecreated(&v1, &v2), + resource.TestCheckResourceAttr(resourceName, "private_dns_name_options.#", "1"), + resource.TestCheckResourceAttr(resourceName, "private_dns_name_options.0.enable_resource_name_dns_aaaa_record", "true"), + resource.TestCheckResourceAttr(resourceName, "private_dns_name_options.0.enable_resource_name_dns_a_record", "true"), + resource.TestCheckResourceAttr(resourceName, "private_dns_name_options.0.hostname_type", "ip-name"), + ), + }, + // "InvalidParameterValue: Cannot modify hostname-type for running instances". + { + Config: testAccInstanceConfig_PrivateDNSNameOptions_configured(rName, true, true, "ip-name"), + Check: resource.ComposeTestCheckFunc( + testAccCheckStopInstance(ctx, &v2), + ), + }, + { + Config: testAccInstanceConfig_PrivateDNSNameOptions_configured(rName, true, true, "resource-name"), + Check: resource.ComposeTestCheckFunc( + testAccCheckInstanceExists(ctx, resourceName, &v3), + testAccCheckInstanceNotRecreated(&v2, &v3), + resource.TestCheckResourceAttr(resourceName, "private_dns_name_options.#", "1"), + resource.TestCheckResourceAttr(resourceName, "private_dns_name_options.0.enable_resource_name_dns_aaaa_record", "true"), + resource.TestCheckResourceAttr(resourceName, "private_dns_name_options.0.enable_resource_name_dns_a_record", "true"), + resource.TestCheckResourceAttr(resourceName, "private_dns_name_options.0.hostname_type", "resource-name"), + ), + }, }, }) } @@ -6750,7 +6779,7 @@ resource "aws_instance" "test" { `, rName)) } -func testAccInstancePrivateDNSNameOptionsBaseConfig(rName string) string { +func testAccInstancePrivateDNSNameOptionsConfig_base(rName string) string { return acctest.ConfigCompose( acctest.ConfigAvailableAZsNoOptInDefaultExclude(), fmt.Sprintf(` @@ -6784,7 +6813,7 @@ resource "aws_subnet" "test" { func testAccInstanceConfig_PrivateDNSNameOptions_computed(rName string) string { return acctest.ConfigCompose( acctest.ConfigLatestAmazonLinuxHVMEBSAMI(), - testAccInstancePrivateDNSNameOptionsBaseConfig(rName), + testAccInstancePrivateDNSNameOptionsConfig_base(rName), fmt.Sprintf(` resource "aws_instance" "test" { ami = data.aws_ami.amzn-ami-minimal-hvm-ebs.id @@ -6798,10 +6827,10 @@ resource "aws_instance" "test" { `, rName)) } -func testAccInstanceConfig_PrivateDNSNameOptions_configured(rName string) string { +func testAccInstanceConfig_PrivateDNSNameOptions_configured(rName string, enableAAAA, enableA bool, hostNameType string) string { return acctest.ConfigCompose( acctest.ConfigLatestAmazonLinuxHVMEBSAMI(), - testAccInstancePrivateDNSNameOptionsBaseConfig(rName), + testAccInstancePrivateDNSNameOptionsConfig_base(rName), fmt.Sprintf(` resource "aws_instance" "test" { ami = data.aws_ami.amzn-ami-minimal-hvm-ebs.id @@ -6809,16 +6838,16 @@ resource "aws_instance" "test" { subnet_id = aws_subnet.test.id private_dns_name_options { - enable_resource_name_dns_aaaa_record = false - enable_resource_name_dns_a_record = true - hostname_type = "ip-name" + enable_resource_name_dns_aaaa_record = %[2]t + enable_resource_name_dns_a_record = %[3]t + hostname_type = %[4]q } tags = { Name = %[1]q } } -`, rName)) +`, rName, enableAAAA, enableA, hostNameType)) } func testAccInstanceConfig_networkSecurityGroups(rName string) string { From 49c336e16f34a43c99b76443ec70c193c7258e2b Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Mon, 13 Mar 2023 13:22:32 -0400 Subject: [PATCH 724/763] Add CHANGELOG entry. --- .changelog/26305.txt | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 .changelog/26305.txt diff --git a/.changelog/26305.txt b/.changelog/26305.txt new file mode 100644 index 000000000000..59cb7fdd428a --- /dev/null +++ b/.changelog/26305.txt @@ -0,0 +1,3 @@ +```release-note:enhancement +resource/aws_instance: Add ability to update `private_dns_name_options` in place +``` \ No newline at end of file From f5d85074e5e69efc36d523bd6cc57790421910ce Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Mon, 13 Mar 2023 14:49:45 -0400 Subject: [PATCH 725/763] r/aws_dynamodb_global_table: Add 'FindGlobalTableByName'. Acceptance test output: % make testacc TESTARGS='-run=TestAccDynamoDBGlobalTable_' PKG=dynamodb ACCTEST_PARALLELISM=3 ==> Checking that code complies with gofmt requirements... TF_ACC=1 go test ./internal/service/dynamodb/... -v -count 1 -parallel 3 -run=TestAccDynamoDBGlobalTable_ -timeout 180m === RUN TestAccDynamoDBGlobalTable_basic === PAUSE TestAccDynamoDBGlobalTable_basic === RUN TestAccDynamoDBGlobalTable_multipleRegions === PAUSE TestAccDynamoDBGlobalTable_multipleRegions === CONT TestAccDynamoDBGlobalTable_basic === CONT TestAccDynamoDBGlobalTable_multipleRegions --- PASS: TestAccDynamoDBGlobalTable_basic (53.55s) --- PASS: TestAccDynamoDBGlobalTable_multipleRegions (97.68s) PASS ok github.com/hashicorp/terraform-provider-aws/internal/service/dynamodb 103.903s --- internal/service/dynamodb/global_table.go | 250 ++++++++++-------- .../service/dynamodb/global_table_test.go | 124 +++++---- 2 files changed, 196 insertions(+), 178 deletions(-) diff --git a/internal/service/dynamodb/global_table.go b/internal/service/dynamodb/global_table.go index 9fc8d4983bf3..f3db0f4eb3ad 100644 --- a/internal/service/dynamodb/global_table.go +++ b/internal/service/dynamodb/global_table.go @@ -13,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/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) @@ -23,6 +24,7 @@ func ResourceGlobalTable() *schema.Resource { ReadWithoutTimeout: resourceGlobalTableRead, UpdateWithoutTimeout: resourceGlobalTableUpdate, DeleteWithoutTimeout: resourceGlobalTableDelete, + Importer: &schema.ResourceImporter{ StateContext: schema.ImportStatePassthroughContext, }, @@ -34,13 +36,16 @@ func ResourceGlobalTable() *schema.Resource { }, Schema: map[string]*schema.Schema{ + names.AttrARN: { + Type: schema.TypeString, + Computed: true, + }, names.AttrName: { Type: schema.TypeString, Required: true, ForceNew: true, ValidateFunc: validGlobalTableName, }, - "replica": { Type: schema.TypeSet, Required: true, @@ -53,11 +58,6 @@ func ResourceGlobalTable() *schema.Resource { }, }, }, - - names.AttrARN: { - Type: schema.TypeString, - Computed: true, - }, }, } } @@ -66,37 +66,22 @@ func resourceGlobalTableCreate(ctx context.Context, d *schema.ResourceData, meta var diags diag.Diagnostics conn := meta.(*conns.AWSClient).DynamoDBConn() - globalTableName := d.Get(names.AttrName).(string) - + name := d.Get(names.AttrName).(string) input := &dynamodb.CreateGlobalTableInput{ - GlobalTableName: aws.String(globalTableName), + GlobalTableName: aws.String(name), ReplicationGroup: expandReplicas(d.Get("replica").(*schema.Set).List()), } _, err := conn.CreateGlobalTableWithContext(ctx, input) + if err != nil { - return sdkdiag.AppendErrorf(diags, "creating DynamoDB Global Table (%s): %s", globalTableName, err) + return sdkdiag.AppendErrorf(diags, "creating DynamoDB Global Table (%s): %s", name, err) } - d.SetId(globalTableName) + d.SetId(name) - log.Println("[INFO] Waiting for DynamoDB Global Table to be created") - stateConf := &resource.StateChangeConf{ - Pending: []string{ - dynamodb.GlobalTableStatusCreating, - dynamodb.GlobalTableStatusDeleting, - dynamodb.GlobalTableStatusUpdating, - }, - Target: []string{ - dynamodb.GlobalTableStatusActive, - }, - Refresh: resourceGlobalTableStateRefreshFunc(ctx, d, meta), - Timeout: d.Timeout(schema.TimeoutCreate), - MinTimeout: 10 * time.Second, - } - _, err = stateConf.WaitForStateContext(ctx) - if err != nil { - return sdkdiag.AppendErrorf(diags, "creating DynamoDB Global Table (%s): waiting for completion: %s", globalTableName, err) + if _, err := waitGlobalTableCreated(ctx, conn, d.Id(), d.Timeout(schema.TimeoutCreate)); err != nil { + return sdkdiag.AppendErrorf(diags, "waiting for DynamoDB Global Table (%s) create: %s", d.Id(), err) } return append(diags, resourceGlobalTableRead(ctx, d, meta)...) @@ -104,20 +89,26 @@ func resourceGlobalTableCreate(ctx context.Context, d *schema.ResourceData, meta func resourceGlobalTableRead(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { var diags diag.Diagnostics - globalTableDescription, err := resourceGlobalTableRetrieve(ctx, d, meta) + conn := meta.(*conns.AWSClient).DynamoDBConn() - if err != nil { - return sdkdiag.AppendErrorf(diags, "reading DynamoDB Global Table (%s): %s", d.Id(), err) - } - if globalTableDescription == nil { - log.Printf("[WARN] DynamoDB Global Table %q not found, removing from state", d.Id()) + globalTableDescription, err := FindGlobalTableByName(ctx, conn, d.Id()) + + if !d.IsNewResource() && tfresource.NotFound(err) { + log.Printf("[WARN] DynamoDB Global Table %s not found, removing from state", d.Id()) d.SetId("") return diags } - if err := flattenGlobalTable(d, globalTableDescription); err != nil { + if err != nil { return sdkdiag.AppendErrorf(diags, "reading DynamoDB Global Table (%s): %s", d.Id(), err) } + + d.Set(names.AttrARN, globalTableDescription.GlobalTableArn) + d.Set(names.AttrName, globalTableDescription.GlobalTableName) + if err := d.Set("replica", flattenReplicas(globalTableDescription.ReplicationGroup)); err != nil { + return sdkdiag.AppendErrorf(diags, "setting replica: %s", err) + } + return diags } @@ -125,54 +116,39 @@ func resourceGlobalTableUpdate(ctx context.Context, d *schema.ResourceData, meta var diags diag.Diagnostics conn := meta.(*conns.AWSClient).DynamoDBConn() - if d.HasChange("replica") { - o, n := d.GetChange("replica") - if o == nil { - o = new(schema.Set) - } - if n == nil { - n = new(schema.Set) - } + o, n := d.GetChange("replica") + if o == nil { + o = new(schema.Set) + } + if n == nil { + n = new(schema.Set) + } - os := o.(*schema.Set) - ns := n.(*schema.Set) - replicaUpdateCreateReplicas := expandReplicaUpdateCreateReplicas(ns.Difference(os).List()) - replicaUpdateDeleteReplicas := expandReplicaUpdateDeleteReplicas(os.Difference(ns).List()) + os := o.(*schema.Set) + ns := n.(*schema.Set) + replicaUpdateCreateReplicas := expandReplicaUpdateCreateReplicas(ns.Difference(os).List()) + replicaUpdateDeleteReplicas := expandReplicaUpdateDeleteReplicas(os.Difference(ns).List()) - replicaUpdates := make([]*dynamodb.ReplicaUpdate, 0, (len(replicaUpdateCreateReplicas) + len(replicaUpdateDeleteReplicas))) - replicaUpdates = append(replicaUpdates, replicaUpdateCreateReplicas...) - replicaUpdates = append(replicaUpdates, replicaUpdateDeleteReplicas...) + replicaUpdates := make([]*dynamodb.ReplicaUpdate, 0, (len(replicaUpdateCreateReplicas) + len(replicaUpdateDeleteReplicas))) + replicaUpdates = append(replicaUpdates, replicaUpdateCreateReplicas...) + replicaUpdates = append(replicaUpdates, replicaUpdateDeleteReplicas...) - input := &dynamodb.UpdateGlobalTableInput{ - GlobalTableName: aws.String(d.Id()), - ReplicaUpdates: replicaUpdates, - } - log.Printf("[DEBUG] Updating DynamoDB Global Table: %#v", input) - if _, err := conn.UpdateGlobalTableWithContext(ctx, input); err != nil { - return sdkdiag.AppendErrorf(diags, "updating DynamoDB Global Table (%s): %s", d.Id(), err) - } + input := &dynamodb.UpdateGlobalTableInput{ + GlobalTableName: aws.String(d.Id()), + ReplicaUpdates: replicaUpdates, + } - log.Println("[INFO] Waiting for DynamoDB Global Table to be updated") - stateConf := &resource.StateChangeConf{ - Pending: []string{ - dynamodb.GlobalTableStatusCreating, - dynamodb.GlobalTableStatusDeleting, - dynamodb.GlobalTableStatusUpdating, - }, - Target: []string{ - dynamodb.GlobalTableStatusActive, - }, - Refresh: resourceGlobalTableStateRefreshFunc(ctx, d, meta), - Timeout: d.Timeout(schema.TimeoutUpdate), - MinTimeout: 10 * time.Second, - } - _, err := stateConf.WaitForStateContext(ctx) - if err != nil { - return sdkdiag.AppendErrorf(diags, "updating DynamoDB Global Table (%s): waiting for completion: %s", d.Id(), err) - } + _, err := conn.UpdateGlobalTableWithContext(ctx, input) + + if err != nil { + return sdkdiag.AppendErrorf(diags, "updating DynamoDB Global Table (%s): %s", d.Id(), err) } - return diags + if _, err := waitGlobalTableUpdated(ctx, conn, d.Id(), d.Timeout(schema.TimeoutUpdate)); err != nil { + return sdkdiag.AppendErrorf(diags, "waiting for DynamoDB Global Table (%s) update: %s", d.Id(), err) + } + + return append(diags, resourceGlobalTableRead(ctx, d, meta)...) } // Deleting a DynamoDB Global Table is represented by removing all replicas. @@ -180,74 +156,120 @@ func resourceGlobalTableDelete(ctx context.Context, d *schema.ResourceData, meta var diags diag.Diagnostics conn := meta.(*conns.AWSClient).DynamoDBConn() - input := &dynamodb.UpdateGlobalTableInput{ + log.Printf("[DEBUG] Deleting DynamoDB Global Table: %s", d.Id()) + _, err := conn.UpdateGlobalTableWithContext(ctx, &dynamodb.UpdateGlobalTableInput{ GlobalTableName: aws.String(d.Id()), ReplicaUpdates: expandReplicaUpdateDeleteReplicas(d.Get("replica").(*schema.Set).List()), + }) + + if tfawserr.ErrCodeEquals(err, dynamodb.ErrCodeGlobalTableNotFoundException, dynamodb.ErrCodeReplicaNotFoundException) { + return diags } - log.Printf("[DEBUG] Deleting DynamoDB Global Table: %#v", input) - if _, err := conn.UpdateGlobalTableWithContext(ctx, input); err != nil { + + if err != nil { return sdkdiag.AppendErrorf(diags, "deleting DynamoDB Global Table (%s): %s", d.Id(), err) } - log.Println("[INFO] Waiting for DynamoDB Global Table to be destroyed") - stateConf := &resource.StateChangeConf{ - Pending: []string{ - dynamodb.GlobalTableStatusActive, - dynamodb.GlobalTableStatusCreating, - dynamodb.GlobalTableStatusDeleting, - dynamodb.GlobalTableStatusUpdating, - }, - Target: []string{}, - Refresh: resourceGlobalTableStateRefreshFunc(ctx, d, meta), - Timeout: d.Timeout(schema.TimeoutDelete), - MinTimeout: 10 * time.Second, + if _, err := waitGlobalTableDeleted(ctx, conn, d.Id(), d.Timeout(schema.TimeoutDelete)); err != nil { + return sdkdiag.AppendErrorf(diags, "waiting for DynamoDB Global Table (%s) delete: %s", d.Id(), err) } - _, err := stateConf.WaitForStateContext(ctx) - return sdkdiag.AppendErrorf(diags, "deleting DynamoDB Global Table (%s): waiting for completion: %s", d.Id(), err) -} -func resourceGlobalTableRetrieve(ctx context.Context, d *schema.ResourceData, meta interface{}) (*dynamodb.GlobalTableDescription, error) { - conn := meta.(*conns.AWSClient).DynamoDBConn() + return diags +} +func FindGlobalTableByName(ctx context.Context, conn *dynamodb.DynamoDB, name string) (*dynamodb.GlobalTableDescription, error) { input := &dynamodb.DescribeGlobalTableInput{ - GlobalTableName: aws.String(d.Id()), + GlobalTableName: aws.String(name), } - log.Printf("[DEBUG] Retrieving DynamoDB Global Table: %#v", input) - output, err := conn.DescribeGlobalTableWithContext(ctx, input) - if err != nil { - if tfawserr.ErrCodeEquals(err, dynamodb.ErrCodeGlobalTableNotFoundException) { - return nil, nil + + if tfawserr.ErrCodeEquals(err, dynamodb.ErrCodeGlobalTableNotFoundException) { + return nil, &resource.NotFoundError{ + LastError: err, + LastRequest: input, } + } + + if err != nil { return nil, err } + if output == nil || output.GlobalTableDescription == nil { + return nil, tfresource.NewEmptyResultError(input) + } + return output.GlobalTableDescription, nil } -func resourceGlobalTableStateRefreshFunc(ctx context.Context, - d *schema.ResourceData, meta interface{}) resource.StateRefreshFunc { +func statusGlobalTable(ctx context.Context, conn *dynamodb.DynamoDB, name string) resource.StateRefreshFunc { return func() (interface{}, string, error) { - gtd, err := resourceGlobalTableRetrieve(ctx, d, meta) + output, err := FindGlobalTableByName(ctx, conn, name) + + if tfresource.NotFound(err) { + return nil, "", nil + } if err != nil { return nil, "", err } - if gtd == nil { - return nil, "", nil - } + return output, aws.StringValue(output.GlobalTableStatus), nil + } +} - return gtd, *gtd.GlobalTableStatus, nil +func waitGlobalTableCreated(ctx context.Context, conn *dynamodb.DynamoDB, name string, timeout time.Duration) (*dynamodb.GlobalTableDescription, error) { + stateConf := &resource.StateChangeConf{ + Pending: []string{dynamodb.GlobalTableStatusCreating}, + Target: []string{dynamodb.GlobalTableStatusActive}, + Refresh: statusGlobalTable(ctx, conn, name), + Timeout: timeout, + MinTimeout: 10 * time.Second, } + + outputRaw, err := stateConf.WaitForStateContext(ctx) + + if output, ok := outputRaw.(*dynamodb.GlobalTableDescription); ok { + return output, err + } + + return nil, err } -func flattenGlobalTable(d *schema.ResourceData, globalTableDescription *dynamodb.GlobalTableDescription) error { - d.Set(names.AttrARN, globalTableDescription.GlobalTableArn) - d.Set(names.AttrName, globalTableDescription.GlobalTableName) +func waitGlobalTableDeleted(ctx context.Context, conn *dynamodb.DynamoDB, name string, timeout time.Duration) (*dynamodb.GlobalTableDescription, error) { + stateConf := &resource.StateChangeConf{ + Pending: []string{dynamodb.GlobalTableStatusActive, dynamodb.GlobalTableStatusDeleting}, + Target: []string{}, + Refresh: statusGlobalTable(ctx, conn, name), + Timeout: timeout, + MinTimeout: 10 * time.Second, + } + + outputRaw, err := stateConf.WaitForStateContext(ctx) + + if output, ok := outputRaw.(*dynamodb.GlobalTableDescription); ok { + return output, err + } + + return nil, err +} + +func waitGlobalTableUpdated(ctx context.Context, conn *dynamodb.DynamoDB, name string, timeout time.Duration) (*dynamodb.GlobalTableDescription, error) { + stateConf := &resource.StateChangeConf{ + Pending: []string{dynamodb.GlobalTableStatusUpdating}, + Target: []string{dynamodb.GlobalTableStatusActive}, + Refresh: statusGlobalTable(ctx, conn, name), + Timeout: timeout, + MinTimeout: 10 * time.Second, + } + + outputRaw, err := stateConf.WaitForStateContext(ctx) + + if output, ok := outputRaw.(*dynamodb.GlobalTableDescription); ok { + return output, err + } - return d.Set("replica", flattenReplicas(globalTableDescription.ReplicationGroup)) + return nil, err } func expandReplicaUpdateCreateReplicas(configuredReplicas []interface{}) []*dynamodb.ReplicaUpdate { diff --git a/internal/service/dynamodb/global_table_test.go b/internal/service/dynamodb/global_table_test.go index 9a2de4218063..b08b88d09100 100644 --- a/internal/service/dynamodb/global_table_test.go +++ b/internal/service/dynamodb/global_table_test.go @@ -4,31 +4,29 @@ import ( "context" "fmt" "regexp" - "sort" "testing" - "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/endpoints" "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" "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" + "github.com/hashicorp/terraform-provider-aws/internal/tfresource" "github.com/hashicorp/terraform-provider-aws/names" ) func TestAccDynamoDBGlobalTable_basic(t *testing.T) { ctx := acctest.Context(t) resourceName := "aws_dynamodb_global_table.test" - tableName := fmt.Sprintf("tf-acc-test-%s", sdkacctest.RandString(5)) + rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { acctest.PreCheck(ctx, t) testAccPreCheckGlobalTable(ctx, t) - testAccGlobalTablePreCheck(t) }, ErrorCheck: acctest.ErrorCheck(t, dynamodb.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, @@ -47,12 +45,12 @@ func TestAccDynamoDBGlobalTable_basic(t *testing.T) { ExpectError: regexp.MustCompile("name must only include alphanumeric, underscore, period, or hyphen characters"), }, { - Config: testAccGlobalTableConfig_basic(tableName), + Config: testAccGlobalTableConfig_basic(rName), Check: resource.ComposeTestCheckFunc( - testAccCheckGlobalTableExists(resourceName), - resource.TestCheckResourceAttr(resourceName, names.AttrName, tableName), - resource.TestCheckResourceAttr(resourceName, "replica.#", "1"), + testAccCheckGlobalTableExists(ctx, resourceName), acctest.MatchResourceAttrGlobalARN(resourceName, names.AttrARN, "dynamodb", regexp.MustCompile("global-table/[a-z0-9-]+$")), + resource.TestCheckResourceAttr(resourceName, names.AttrName, rName), + resource.TestCheckResourceAttr(resourceName, "replica.#", "1"), ), }, { @@ -67,45 +65,44 @@ func TestAccDynamoDBGlobalTable_basic(t *testing.T) { func TestAccDynamoDBGlobalTable_multipleRegions(t *testing.T) { ctx := acctest.Context(t) resourceName := "aws_dynamodb_global_table.test" - tableName := fmt.Sprintf("tf-acc-test-%s", sdkacctest.RandString(5)) + rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { acctest.PreCheck(ctx, t) testAccPreCheckGlobalTable(ctx, t) acctest.PreCheckMultipleRegion(t, 2) - testAccGlobalTablePreCheck(t) }, ErrorCheck: acctest.ErrorCheck(t, dynamodb.EndpointsID), ProtoV5ProviderFactories: acctest.ProtoV5FactoriesAlternate(ctx, t), CheckDestroy: testAccCheckGlobalTableDestroy(ctx), Steps: []resource.TestStep{ { - Config: testAccGlobalTableConfig_multipleRegions1(tableName), + Config: testAccGlobalTableConfig_multipleRegions1(rName), Check: resource.ComposeTestCheckFunc( - testAccCheckGlobalTableExists(resourceName), - resource.TestCheckResourceAttr(resourceName, names.AttrName, tableName), - resource.TestCheckResourceAttr(resourceName, "replica.#", "1"), + testAccCheckGlobalTableExists(ctx, resourceName), acctest.MatchResourceAttrGlobalARN(resourceName, names.AttrARN, "dynamodb", regexp.MustCompile("global-table/[a-z0-9-]+$")), + resource.TestCheckResourceAttr(resourceName, names.AttrName, rName), + resource.TestCheckResourceAttr(resourceName, "replica.#", "1"), ), }, { - Config: testAccGlobalTableConfig_multipleRegions1(tableName), + Config: testAccGlobalTableConfig_multipleRegions1(rName), ResourceName: resourceName, ImportState: true, ImportStateVerify: true, }, { - Config: testAccGlobalTableConfig_multipleRegions2(tableName), + Config: testAccGlobalTableConfig_multipleRegions2(rName), Check: resource.ComposeTestCheckFunc( - testAccCheckGlobalTableExists(resourceName), + testAccCheckGlobalTableExists(ctx, resourceName), resource.TestCheckResourceAttr(resourceName, "replica.#", "2"), ), }, { - Config: testAccGlobalTableConfig_multipleRegions1(tableName), + Config: testAccGlobalTableConfig_multipleRegions1(rName), Check: resource.ComposeTestCheckFunc( - testAccCheckGlobalTableExists(resourceName), + testAccCheckGlobalTableExists(ctx, resourceName), resource.TestCheckResourceAttr(resourceName, "replica.#", "1"), ), }, @@ -122,56 +119,45 @@ func testAccCheckGlobalTableDestroy(ctx context.Context) resource.TestCheckFunc continue } - input := &dynamodb.DescribeGlobalTableInput{ - GlobalTableName: aws.String(rs.Primary.ID), + _, err := tfdynamodb.FindGlobalTableByName(ctx, conn, rs.Primary.ID) + + if tfresource.NotFound(err) { + continue } - _, err := conn.DescribeGlobalTableWithContext(ctx, input) if err != nil { - if tfawserr.ErrCodeEquals(err, dynamodb.ErrCodeGlobalTableNotFoundException) { - return nil - } return err } - return fmt.Errorf("Expected DynamoDB Global Table to be destroyed, %s found", rs.Primary.ID) + return fmt.Errorf("DynamoDB Global Table %s still exists", rs.Primary.ID) } return nil } } -func testAccCheckGlobalTableExists(name string) resource.TestCheckFunc { +func testAccCheckGlobalTableExists(ctx context.Context, n string) resource.TestCheckFunc { return func(s *terraform.State) error { - _, 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) } - return nil - } -} - -func testAccPreCheckGlobalTable(ctx context.Context, t *testing.T) { - conn := acctest.Provider.Meta().(*conns.AWSClient).DynamoDBConn() + if rs.Primary.ID == "" { + return fmt.Errorf("No DynamoDB Global Table ID is set") + } - input := &dynamodb.ListGlobalTablesInput{} + conn := acctest.Provider.Meta().(*conns.AWSClient).DynamoDBConn() - _, err := conn.ListGlobalTablesWithContext(ctx, input) + _, err := tfdynamodb.FindGlobalTableByName(ctx, conn, rs.Primary.ID) - if acctest.PreCheckSkipError(err) { - t.Skipf("skipping acceptance testing: %s", err) - } - - if err != nil { - t.Fatalf("unexpected PreCheck error: %s", err) + return err } } -// testAccGlobalTablePreCheck checks if aws_dynamodb_global_table (version 2017.11.29) can be used and skips test if not. -// Region availability for Version 2017.11.29: https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/GlobalTables.html -func testAccGlobalTablePreCheck(t *testing.T) { - supportRegionsSort := []string{ +func testAccPreCheckGlobalTable(ctx context.Context, t *testing.T) { + // Region availability for Version 2017.11.29: https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/GlobalTables.html + supportedRegions := []string{ endpoints.ApNortheast1RegionID, endpoints.ApNortheast2RegionID, endpoints.ApSoutheast1RegionID, @@ -184,20 +170,30 @@ func testAccGlobalTablePreCheck(t *testing.T) { endpoints.UsWest1RegionID, endpoints.UsWest2RegionID, } + acctest.PreCheckRegion(t, supportedRegions...) + + conn := acctest.Provider.Meta().(*conns.AWSClient).DynamoDBConn() - if acctest.Region() != supportRegionsSort[sort.SearchStrings(supportRegionsSort, acctest.Region())] { - t.Skipf("skipping test; aws_dynamodb_global_table (DynamoDB v2017.11.29) not supported in region %s", acctest.Region()) + input := &dynamodb.ListGlobalTablesInput{} + + _, err := conn.ListGlobalTablesWithContext(ctx, input) + + if acctest.PreCheckSkipError(err) { + t.Skipf("skipping acceptance testing: %s", err) + } + + if err != nil { + t.Fatalf("unexpected PreCheck error: %s", err) } } -func testAccGlobalTableConfig_basic(tableName string) string { +func testAccGlobalTableConfig_basic(rName string) string { return fmt.Sprintf(` -data "aws_region" "current" { -} +data "aws_region" "current" {} resource "aws_dynamodb_table" "test" { hash_key = "myAttribute" - name = "%s" + name = %[1]q stream_enabled = true stream_view_type = "NEW_AND_OLD_IMAGES" read_capacity = 1 @@ -212,17 +208,17 @@ resource "aws_dynamodb_table" "test" { resource "aws_dynamodb_global_table" "test" { depends_on = [aws_dynamodb_table.test] - name = "%s" + name = %[1]q replica { region_name = data.aws_region.current.name } } -`, tableName, tableName) +`, rName) } -func testAccGlobalTableConfig_MultipleRegions_tables(tableName string) string { - return acctest.ConfigAlternateRegionProvider() + fmt.Sprintf(` +func testAccGlobalTableConfig_baseMultipleRegions(tableName string) string { + return acctest.ConfigCompose(acctest.ConfigAlternateRegionProvider(), fmt.Sprintf(` data "aws_region" "alternate" { provider = "awsalternate" } @@ -258,11 +254,11 @@ resource "aws_dynamodb_table" "alternate" { type = "S" } } -`, tableName) +`, tableName)) } func testAccGlobalTableConfig_multipleRegions1(tableName string) string { - return testAccGlobalTableConfig_MultipleRegions_tables(tableName) + ` + return acctest.ConfigCompose(testAccGlobalTableConfig_baseMultipleRegions(tableName), ` resource "aws_dynamodb_global_table" "test" { name = aws_dynamodb_table.test.name @@ -270,11 +266,11 @@ resource "aws_dynamodb_global_table" "test" { region_name = data.aws_region.current.name } } -` +`) } func testAccGlobalTableConfig_multipleRegions2(tableName string) string { - return testAccGlobalTableConfig_MultipleRegions_tables(tableName) + ` + return acctest.ConfigCompose(testAccGlobalTableConfig_baseMultipleRegions(tableName), ` resource "aws_dynamodb_global_table" "test" { depends_on = [aws_dynamodb_table.alternate] @@ -288,7 +284,7 @@ resource "aws_dynamodb_global_table" "test" { region_name = data.aws_region.current.name } } -` +`) } func testAccGlobalTableConfig_invalidName(tableName string) string { @@ -296,7 +292,7 @@ func testAccGlobalTableConfig_invalidName(tableName string) string { data "aws_region" "current" {} resource "aws_dynamodb_global_table" "test" { - name = "%s" + name = %[1]q replica { region_name = data.aws_region.current.name From 17e386a7b88f71c5e5d10711ccca6acc7159bc29 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Mon, 13 Mar 2023 14:58:45 -0400 Subject: [PATCH 726/763] Tweak CHANGELOG entry. --- .changelog/29924.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.changelog/29924.txt b/.changelog/29924.txt index f01db3760dcb..8107995a10ea 100644 --- a/.changelog/29924.txt +++ b/.changelog/29924.txt @@ -1,3 +1,3 @@ ```release-note:enhancement -resource/aws_dynamodb_table: Add `deletion_protection_enabled` argument to enable deletion protection for table. +resource/aws_dynamodb_table: Add `deletion_protection_enabled` argument ``` From f2a6da9fca6b6782996b1c846590c3108ef95dd4 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Mon, 13 Mar 2023 14:59:14 -0400 Subject: [PATCH 727/763] r/aws_dynamodb_table: No explicit default value for 'deletion_protection_enabled'. --- internal/service/dynamodb/table.go | 1 - 1 file changed, 1 deletion(-) diff --git a/internal/service/dynamodb/table.go b/internal/service/dynamodb/table.go index cc9a76d0cd9c..1c67e8ead5ff 100644 --- a/internal/service/dynamodb/table.go +++ b/internal/service/dynamodb/table.go @@ -149,7 +149,6 @@ func ResourceTable() *schema.Resource { "deletion_protection_enabled": { Type: schema.TypeBool, Optional: true, - Default: false, }, "global_secondary_index": { Type: schema.TypeSet, From eb433532590122800f9f14a63cd62858ba6363af Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Mon, 13 Mar 2023 15:07:17 -0400 Subject: [PATCH 728/763] d/aws_dynamodb_table: Add 'deletion_protection_enabled' attribute. --- .changelog/29924.txt | 4 + .../service/dynamodb/table_data_source.go | 115 +++++++++--------- .../dynamodb/table_data_source_test.go | 2 +- 3 files changed, 65 insertions(+), 56 deletions(-) diff --git a/.changelog/29924.txt b/.changelog/29924.txt index 8107995a10ea..f62cdab38a82 100644 --- a/.changelog/29924.txt +++ b/.changelog/29924.txt @@ -1,3 +1,7 @@ ```release-note:enhancement resource/aws_dynamodb_table: Add `deletion_protection_enabled` argument ``` + +```release-note:enhancement +data-source/aws_dynamodb_table: Add `deletion_protection_enabled` attribute +``` \ No newline at end of file diff --git a/internal/service/dynamodb/table_data_source.go b/internal/service/dynamodb/table_data_source.go index d41f0aec074f..555f90fe334e 100644 --- a/internal/service/dynamodb/table_data_source.go +++ b/internal/service/dynamodb/table_data_source.go @@ -23,10 +23,6 @@ func DataSourceTable() *schema.Resource { return &schema.Resource{ ReadWithoutTimeout: dataSourceTableRead, Schema: map[string]*schema.Schema{ - names.AttrName: { - Type: schema.TypeString, - Required: true, - }, names.AttrARN: { Type: schema.TypeString, Computed: true, @@ -53,24 +49,33 @@ func DataSourceTable() *schema.Resource { return create.StringHashcode(buf.String()) }, }, + "billing_mode": { + Type: schema.TypeString, + Computed: true, + }, + "deletion_protection_enabled": { + Type: schema.TypeBool, + Computed: true, + }, "global_secondary_index": { Type: schema.TypeSet, Computed: true, Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - names.AttrName: { + "hash_key": { Type: schema.TypeString, Computed: true, }, - "write_capacity": { - Type: schema.TypeInt, + names.AttrName: { + Type: schema.TypeString, Computed: true, }, - "read_capacity": { - Type: schema.TypeInt, + "non_key_attributes": { + Type: schema.TypeList, Computed: true, + Elem: &schema.Schema{Type: schema.TypeString}, }, - "hash_key": { + "projection_type": { Type: schema.TypeString, Computed: true, }, @@ -78,14 +83,13 @@ func DataSourceTable() *schema.Resource { Type: schema.TypeString, Computed: true, }, - "projection_type": { - Type: schema.TypeString, + "read_capacity": { + Type: schema.TypeInt, Computed: true, }, - "non_key_attributes": { - Type: schema.TypeList, + "write_capacity": { + Type: schema.TypeInt, Computed: true, - Elem: &schema.Schema{Type: schema.TypeString}, }, }, }, @@ -103,18 +107,18 @@ func DataSourceTable() *schema.Resource { Type: schema.TypeString, Computed: true, }, - "range_key": { - Type: schema.TypeString, + "non_key_attributes": { + Type: schema.TypeList, Computed: true, + Elem: &schema.Schema{Type: schema.TypeString}, }, "projection_type": { Type: schema.TypeString, Computed: true, }, - "non_key_attributes": { - Type: schema.TypeList, + "range_key": { + Type: schema.TypeString, Computed: true, - Elem: &schema.Schema{Type: schema.TypeString}, }, }, }, @@ -125,40 +129,15 @@ func DataSourceTable() *schema.Resource { return create.StringHashcode(buf.String()) }, }, - "range_key": { - Type: schema.TypeString, - Computed: true, - }, - "read_capacity": { - Type: schema.TypeInt, - Computed: true, - }, - "stream_arn": { - Type: schema.TypeString, - Computed: true, - }, - "stream_enabled": { - Type: schema.TypeBool, - Computed: true, - }, - "stream_label": { - Type: schema.TypeString, - Computed: true, - }, - "stream_view_type": { + names.AttrName: { Type: schema.TypeString, - Computed: true, + Required: true, }, - names.AttrTags: tftags.TagsSchemaComputed(), - "ttl": { - Type: schema.TypeSet, + "point_in_time_recovery": { + Type: schema.TypeList, Computed: true, Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "attribute_name": { - Type: schema.TypeString, - Computed: true, - }, names.AttrEnabled: { Type: schema.TypeBool, Computed: true, @@ -166,7 +145,11 @@ func DataSourceTable() *schema.Resource { }, }, }, - "write_capacity": { + "range_key": { + Type: schema.TypeString, + Computed: true, + }, + "read_capacity": { Type: schema.TypeInt, Computed: true, }, @@ -204,15 +187,36 @@ func DataSourceTable() *schema.Resource { }, }, }, - "billing_mode": { + "stream_arn": { Type: schema.TypeString, Computed: true, }, - "point_in_time_recovery": { - Type: schema.TypeList, + "stream_enabled": { + Type: schema.TypeBool, + Computed: true, + }, + "stream_label": { + Type: schema.TypeString, + Computed: true, + }, + "stream_view_type": { + Type: schema.TypeString, + Computed: true, + }, + "table_class": { + Type: schema.TypeString, + Computed: true, + }, + names.AttrTags: tftags.TagsSchemaComputed(), + "ttl": { + Type: schema.TypeSet, Computed: true, Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ + "attribute_name": { + Type: schema.TypeString, + Computed: true, + }, names.AttrEnabled: { Type: schema.TypeBool, Computed: true, @@ -220,8 +224,8 @@ func DataSourceTable() *schema.Resource { }, }, }, - "table_class": { - Type: schema.TypeString, + "write_capacity": { + Type: schema.TypeInt, Computed: true, }, }, @@ -253,6 +257,7 @@ func dataSourceTableRead(ctx context.Context, d *schema.ResourceData, meta inter d.Set(names.AttrARN, table.TableArn) d.Set(names.AttrName, table.TableName) + d.Set("deletion_protection_enabled", table.DeletionProtectionEnabled) if table.BillingModeSummary != nil { d.Set("billing_mode", table.BillingModeSummary.BillingMode) diff --git a/internal/service/dynamodb/table_data_source_test.go b/internal/service/dynamodb/table_data_source_test.go index a73a6e6d281c..57079a575f48 100644 --- a/internal/service/dynamodb/table_data_source_test.go +++ b/internal/service/dynamodb/table_data_source_test.go @@ -50,7 +50,7 @@ func TestAccDynamoDBTableDataSource_basic(t *testing.T) { func testAccTableDataSourceConfig_basic(tableName string) string { return fmt.Sprintf(` resource "aws_dynamodb_table" "test" { - name = "%s" + name = %[1]q read_capacity = 20 write_capacity = 20 hash_key = "UserId" From e67718bd9117d48a8c94cba6fad8c5f69ec9187a Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Mon, 13 Mar 2023 15:09:54 -0400 Subject: [PATCH 729/763] Update 29656.txt --- .changelog/29656.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.changelog/29656.txt b/.changelog/29656.txt index 0612ee96a863..9047288f88d4 100644 --- a/.changelog/29656.txt +++ b/.changelog/29656.txt @@ -1,3 +1,3 @@ ```release-note:new-resource -codegurureviewer_repository_association -``` \ No newline at end of file +aws_codegurureviewer_repository_association +``` From 385882b7398ff616a6a6caa58b0c22ae74ccc526 Mon Sep 17 00:00:00 2001 From: changelogbot Date: Mon, 13 Mar 2023 19:23:24 +0000 Subject: [PATCH 730/763] Update CHANGELOG.md for #29971 --- CHANGELOG.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 39a9a83cce73..a1bcb3a419b9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,21 +3,25 @@ FEATURES: * **New Data Source:** `aws_servicecatalog_provisioning_artifacts` ([#25535](https://github.com/hashicorp/terraform-provider-aws/issues/25535)) +* **New Resource:** `aws_codegurureviewer_repository_association` ([#29656](https://github.com/hashicorp/terraform-provider-aws/issues/29656)) * **New Resource:** `aws_oam_sink` ([#29670](https://github.com/hashicorp/terraform-provider-aws/issues/29670)) -* **New Resource:** `codegurureviewer_repository_association` ([#29656](https://github.com/hashicorp/terraform-provider-aws/issues/29656)) ENHANCEMENTS: * data-source/aws_ce_cost_category: Add `default_value` attribute ([#29291](https://github.com/hashicorp/terraform-provider-aws/issues/29291)) * resource/aws_appflow_flow: Add attribute `preserve_source_data_typing` to `s3_output_format_config` in `s3` ([#27616](https://github.com/hashicorp/terraform-provider-aws/issues/27616)) +* resource/aws_batch_compute_environment: Allow a maximum of 2 `compute_resources.ec2_configuration`s ([#27207](https://github.com/hashicorp/terraform-provider-aws/issues/27207)) * resource/aws_cognito_user_pool_domain: Add `cloudfront_distribution` and `cloudfront_distribution_zone_id` attributes ([#27790](https://github.com/hashicorp/terraform-provider-aws/issues/27790)) * resource/aws_ecs_task_definition: Add `arn_without_revision` attribute ([#27351](https://github.com/hashicorp/terraform-provider-aws/issues/27351)) +* resource/aws_fms_policy: Add `description` argument ([#29926](https://github.com/hashicorp/terraform-provider-aws/issues/29926)) * resource/aws_glue_crawler: Add `create_native_delta_table` attribute to the `delta_target` configuration block ([#29566](https://github.com/hashicorp/terraform-provider-aws/issues/29566)) +* resource/aws_instance: Add ability to update `private_dns_name_options` in place ([#26305](https://github.com/hashicorp/terraform-provider-aws/issues/26305)) * resource/aws_qldb_ledger: Add configurable timeouts ([#29635](https://github.com/hashicorp/terraform-provider-aws/issues/29635)) * resource/aws_s3_bucket: Add error handling for `XNotImplemented` errors when reading `acceleration_status`, `request_payer`, `lifecycle_rule`, `logging`, or `replication_configuration` into terraform state. ([#29632](https://github.com/hashicorp/terraform-provider-aws/issues/29632)) BUG FIXES: +* data-source/aws_opensearch_domain: Add missing `advanced_security_options.anonymous_auth_enabled` attribute ([#26746](https://github.com/hashicorp/terraform-provider-aws/issues/26746)) * resource/aws_apigatewayv2_integration: Retry errors like `ConflictException: Unable to complete operation due to concurrent modification. Please try again later.` ([#29735](https://github.com/hashicorp/terraform-provider-aws/issues/29735)) * resource/aws_elasticsearch_domain: Remove upper bound validation for `ebs_options.throughput` as the 1,000 MB/s limit can be raised ([#27598](https://github.com/hashicorp/terraform-provider-aws/issues/27598)) * resource/aws_lambda_function: Fix empty environment variable update ([#29839](https://github.com/hashicorp/terraform-provider-aws/issues/29839)) From 166bde7efc73a1cba68f5b658a7f7c93de19321b Mon Sep 17 00:00:00 2001 From: Scott Reu Date: Mon, 13 Mar 2023 12:55:45 -0700 Subject: [PATCH 731/763] Correct tftags.New calls to use new API requirement (ctx) --- internal/service/ec2/public_ipv4_pool_data_source.go | 2 +- internal/service/ec2/public_ipv4_pools_data_source.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/service/ec2/public_ipv4_pool_data_source.go b/internal/service/ec2/public_ipv4_pool_data_source.go index e3553eb1f87b..d3d2660d075d 100644 --- a/internal/service/ec2/public_ipv4_pool_data_source.go +++ b/internal/service/ec2/public_ipv4_pool_data_source.go @@ -45,7 +45,7 @@ func dataSourcePublicIpv4PoolRead(ctx context.Context, d *schema.ResourceData, m } input.Filters = append(input.Filters, BuildTagFilterList( - Tags(tftags.New(d.Get("tags").(map[string]interface{}))), + Tags(tftags.New(ctx, d.Get("tags").(map[string]interface{}))), )...) input.Filters = append(input.Filters, BuildFiltersDataSource( diff --git a/internal/service/ec2/public_ipv4_pools_data_source.go b/internal/service/ec2/public_ipv4_pools_data_source.go index 16c5fd8bf154..3fef8f724352 100644 --- a/internal/service/ec2/public_ipv4_pools_data_source.go +++ b/internal/service/ec2/public_ipv4_pools_data_source.go @@ -49,7 +49,7 @@ func dataSourcePublicIpv4PoolsRead(ctx context.Context, d *schema.ResourceData, } input.Filters = append(input.Filters, BuildTagFilterList( - Tags(tftags.New(d.Get("tags").(map[string]interface{}))), + Tags(tftags.New(ctx, d.Get("tags").(map[string]interface{}))), )...) input.Filters = append(input.Filters, BuildFiltersDataSource( From 1893040d5b8f353fd92bce2724dd31eb247857bd Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Mon, 13 Mar 2023 16:13:46 -0400 Subject: [PATCH 732/763] Revert "Add support for auto-enabling lambda scanning on aws_inspector2_organization_configuration" This reverts commit 750866fec30b5b214193d28e5680b6fb11be3b36. --- CHANGELOG.md | 1 - .../inspector2/organization_configuration.go | 27 +++++-------------- .../organization_configuration_test.go | 27 +++++++++---------- 3 files changed, 19 insertions(+), 36 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7706243fa0da..12dd1c3ea341 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,7 +10,6 @@ ENHANCEMENTS: * resource/aws_grafana_workspace: Add `configuration` argument ([#28569](https://github.com/hashicorp/terraform-provider-aws/issues/28569)) * resource/aws_imagbuilder_component: Add `skip_destroy` argument ([#28905](https://github.com/hashicorp/terraform-provider-aws/issues/28905)) * resource/aws_lambda_event_source_mapping: Add `scaling_config` argument ([#28876](https://github.com/hashicorp/terraform-provider-aws/issues/28876)) -* resource/aws_inspector2_organization_configuration: Add `lambda` attribute in `auto_enable` ([#28823](https://github.com/hashicorp/terraform-provider-aws/issues/28823)) BUG FIXES: diff --git a/internal/service/inspector2/organization_configuration.go b/internal/service/inspector2/organization_configuration.go index e013998cd151..12d20f9b93c0 100644 --- a/internal/service/inspector2/organization_configuration.go +++ b/internal/service/inspector2/organization_configuration.go @@ -47,10 +47,6 @@ func ResourceOrganizationConfiguration() *schema.Resource { Type: schema.TypeBool, Required: true, }, - "lambda": { - Type: schema.TypeBool, - Required: true, - }, }, }, }, @@ -121,7 +117,7 @@ func resourceOrganizationConfigurationUpdate(ctx context.Context, d *schema.Reso return create.DiagError(names.Inspector2, create.ErrActionUpdating, ResNameOrganizationConfiguration, d.Id(), err) } - if err := waitOrganizationConfigurationUpdated(ctx, conn, d.Get("auto_enable.0.ec2").(bool), d.Get("auto_enable.0.ecr").(bool), d.Get("auto_enable.0.lambda").(bool), d.Timeout(schema.TimeoutUpdate)); err != nil { + if err := waitOrganizationConfigurationUpdated(ctx, conn, d.Get("auto_enable.0.ec2").(bool), d.Get("auto_enable.0.ecr").(bool), d.Timeout(schema.TimeoutUpdate)); err != nil { return create.DiagError(names.Inspector2, create.ErrActionWaitingForUpdate, ResNameOrganizationConfiguration, d.Id(), err) } @@ -136,9 +132,8 @@ func resourceOrganizationConfigurationDelete(ctx context.Context, d *schema.Reso in := &inspector2.UpdateOrganizationConfigurationInput{ AutoEnable: &types.AutoEnable{ - Ec2: aws.Bool(false), - Ecr: aws.Bool(false), - Lambda: aws.Bool(false), + Ec2: aws.Bool(false), + Ecr: aws.Bool(false), }, } @@ -148,15 +143,15 @@ func resourceOrganizationConfigurationDelete(ctx context.Context, d *schema.Reso return create.DiagError(names.Inspector2, create.ErrActionUpdating, ResNameOrganizationConfiguration, d.Id(), err) } - if err := waitOrganizationConfigurationUpdated(ctx, conn, false, false, false, d.Timeout(schema.TimeoutUpdate)); err != nil { + if err := waitOrganizationConfigurationUpdated(ctx, conn, false, false, d.Timeout(schema.TimeoutUpdate)); err != nil { return create.DiagError(names.Inspector2, create.ErrActionWaitingForUpdate, ResNameOrganizationConfiguration, d.Id(), err) } return nil } -func waitOrganizationConfigurationUpdated(ctx context.Context, conn *inspector2.Client, ec2, ecr, lambda bool, timeout time.Duration) error { - needle := fmt.Sprintf("%t:%t:%t", ec2, ecr, lambda) +func waitOrganizationConfigurationUpdated(ctx context.Context, conn *inspector2.Client, ec2, ecr bool, timeout time.Duration) error { + needle := fmt.Sprintf("%t:%t", ec2, ecr) all := []string{ fmt.Sprintf("%t:%t", false, false), @@ -198,7 +193,7 @@ func statusOrganizationConfiguration(ctx context.Context, conn *inspector2.Clien return nil, "", err } - return out, fmt.Sprintf("%t:%t:%t", aws.ToBool(out.AutoEnable.Ec2), aws.ToBool(out.AutoEnable.Ecr), aws.ToBool(out.AutoEnable.Lambda)), nil + return out, fmt.Sprintf("%t:%t", aws.ToBool(out.AutoEnable.Ec2), aws.ToBool(out.AutoEnable.Ecr)), nil } } @@ -217,10 +212,6 @@ func flattenAutoEnable(apiObject *types.AutoEnable) map[string]interface{} { m["ecr"] = aws.ToBool(v) } - if v := apiObject.Lambda; v != nil { - m["lambda"] = aws.ToBool(v) - } - return m } @@ -239,9 +230,5 @@ func expandAutoEnable(tfMap map[string]interface{}) *types.AutoEnable { a.Ecr = aws.Bool(v) } - if v, ok := tfMap["lambda"].(bool); ok { - a.Lambda = aws.Bool(v) - } - return a } diff --git a/internal/service/inspector2/organization_configuration_test.go b/internal/service/inspector2/organization_configuration_test.go index 8050bf1d0d22..2034a5f7011e 100644 --- a/internal/service/inspector2/organization_configuration_test.go +++ b/internal/service/inspector2/organization_configuration_test.go @@ -23,9 +23,9 @@ func TestAccInspector2OrganizationConfiguration_serial(t *testing.T) { t.Parallel() testCases := map[string]func(t *testing.T){ - "basic": testAccOrganizationConfiguration_basic, - "disappears": testAccOrganizationConfiguration_disappears, - "ec2ECRLambda": testAccOrganizationConfiguration_ec2ECRLambda, + "basic": testAccOrganizationConfiguration_basic, + "disappears": testAccOrganizationConfiguration_disappears, + "ec2ECR": testAccOrganizationConfiguration_ec2ECR, } acctest.RunSerialTests1Level(t, testCases, 0) @@ -46,12 +46,11 @@ func testAccOrganizationConfiguration_basic(t *testing.T) { CheckDestroy: testAccCheckOrganizationConfigurationDestroy, Steps: []resource.TestStep{ { - Config: testAccOrganizationConfigurationConfig_basic(true, false, true), + Config: testAccOrganizationConfigurationConfig_basic(true, false), Check: resource.ComposeTestCheckFunc( testAccCheckOrganizationConfigurationExists(resourceName), resource.TestCheckResourceAttr(resourceName, "auto_enable.0.ec2", "true"), resource.TestCheckResourceAttr(resourceName, "auto_enable.0.ecr", "false"), - resource.TestCheckResourceAttr(resourceName, "auto_enable.0.lambda", "true"), ), }, }, @@ -73,7 +72,7 @@ func testAccOrganizationConfiguration_disappears(t *testing.T) { CheckDestroy: testAccCheckOrganizationConfigurationDestroy, Steps: []resource.TestStep{ { - Config: testAccOrganizationConfigurationConfig_basic(true, false, true), + Config: testAccOrganizationConfigurationConfig_basic(true, false), Check: resource.ComposeTestCheckFunc( testAccCheckOrganizationConfigurationExists(resourceName), acctest.CheckResourceDisappears(acctest.Provider, tfinspector2.ResourceOrganizationConfiguration(), resourceName), @@ -84,7 +83,7 @@ func testAccOrganizationConfiguration_disappears(t *testing.T) { }) } -func testAccOrganizationConfiguration_ec2ECRLambda(t *testing.T) { +func testAccOrganizationConfiguration_ec2ECR(t *testing.T) { resourceName := "aws_inspector2_organization_configuration.test" resource.Test(t, resource.TestCase{ @@ -99,12 +98,11 @@ func testAccOrganizationConfiguration_ec2ECRLambda(t *testing.T) { CheckDestroy: testAccCheckOrganizationConfigurationDestroy, Steps: []resource.TestStep{ { - Config: testAccOrganizationConfigurationConfig_basic(true, true, true), + Config: testAccOrganizationConfigurationConfig_basic(true, true), Check: resource.ComposeTestCheckFunc( testAccCheckOrganizationConfigurationExists(resourceName), resource.TestCheckResourceAttr(resourceName, "auto_enable.0.ec2", "true"), resource.TestCheckResourceAttr(resourceName, "auto_enable.0.ecr", "true"), - resource.TestCheckResourceAttr(resourceName, "auto_enable.0.lambda", "true"), ), }, }, @@ -144,7 +142,7 @@ func testAccCheckOrganizationConfigurationDestroy(s *terraform.State) error { return create.Error(names.Inspector2, create.ErrActionCheckingDestroyed, tfinspector2.ResNameOrganizationConfiguration, rs.Primary.ID, err) } - if out != nil && out.AutoEnable != nil && !aws.ToBool(out.AutoEnable.Ec2) && !aws.ToBool(out.AutoEnable.Ecr) && !aws.ToBool(out.AutoEnable.Lambda) { + if out != nil && out.AutoEnable != nil && !aws.ToBool(out.AutoEnable.Ec2) && !aws.ToBool(out.AutoEnable.Ecr) { if enabledDelAdAcct { if err := testDisableDelegatedAdminAccount(ctx, conn, acctest.AccountID()); err != nil { return err @@ -219,7 +217,7 @@ func testAccCheckOrganizationConfigurationExists(name string) resource.TestCheck } } -func testAccOrganizationConfigurationConfig_basic(ec2, ecr, lambda bool) string { +func testAccOrganizationConfigurationConfig_basic(ec2, ecr bool) string { return fmt.Sprintf(` data "aws_caller_identity" "current" {} @@ -229,12 +227,11 @@ resource "aws_inspector2_delegated_admin_account" "test" { resource "aws_inspector2_organization_configuration" "test" { auto_enable { - ec2 = %[1]t - ecr = %[2]t - lambda = %[3]t + ec2 = %[1]t + ecr = %[2]t } depends_on = [aws_inspector2_delegated_admin_account.test] } -`, ec2, ecr, lambda) +`, ec2, ecr) } From 2fb84614663c8f0bd3d5979a1f1bd0b109d5350e Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Mon, 13 Mar 2023 16:21:59 -0400 Subject: [PATCH 733/763] Add CHANGELOG entry. --- .changelog/28961.txt | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 .changelog/28961.txt diff --git a/.changelog/28961.txt b/.changelog/28961.txt new file mode 100644 index 000000000000..6a074f5551a4 --- /dev/null +++ b/.changelog/28961.txt @@ -0,0 +1,3 @@ +```release-note:enhancement +resource/aws_inspector2_organization_configuration: Add `lambda` attribute to `auto_enable` configuration block +``` \ No newline at end of file From dfb9062c7d6182bf3dfbb1c0dcb2f3fcef47500e Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Mon, 13 Mar 2023 16:32:56 -0400 Subject: [PATCH 734/763] Add CHANGELOG entry. --- .changelog/28245.txt | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 .changelog/28245.txt diff --git a/.changelog/28245.txt b/.changelog/28245.txt new file mode 100644 index 000000000000..3679718020e5 --- /dev/null +++ b/.changelog/28245.txt @@ -0,0 +1,7 @@ +```release-note:new-data-source +aws_vpc_public_ipv4_pools +``` + +```release-note:new-data-source +aws_vpc_public_ipv4_pool +``` \ No newline at end of file From 932ff30ec233f9a3451dd277d89b334a9e476312 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Mon, 13 Mar 2023 16:35:59 -0400 Subject: [PATCH 735/763] d/aws_dynamodb_table: Set default 'table_class' to match #29816. --- internal/service/dynamodb/table_data_source.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/service/dynamodb/table_data_source.go b/internal/service/dynamodb/table_data_source.go index 555f90fe334e..7e00e8fd88ff 100644 --- a/internal/service/dynamodb/table_data_source.go +++ b/internal/service/dynamodb/table_data_source.go @@ -314,7 +314,7 @@ func dataSourceTableRead(ctx context.Context, d *schema.ResourceData, meta inter if table.TableClassSummary != nil { d.Set("table_class", table.TableClassSummary.TableClass) } else { - d.Set("table_class", nil) + d.Set("table_class", dynamodb.TableClassStandard) } pitrOut, err := conn.DescribeContinuousBackupsWithContext(ctx, &dynamodb.DescribeContinuousBackupsInput{ From 43ae24d66711117f7b0858330c24d24462308df8 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Mon, 13 Mar 2023 16:44:34 -0400 Subject: [PATCH 736/763] 'FindPublicIpv4Pool(s)' -> 'FindPublicIPv4Pool(s)'. --- internal/service/ec2/find.go | 4 ++-- internal/service/ec2/public_ipv4_pool_data_source.go | 3 ++- internal/service/ec2/public_ipv4_pools_data_source.go | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/internal/service/ec2/find.go b/internal/service/ec2/find.go index b47925874621..fde5f4b5065b 100644 --- a/internal/service/ec2/find.go +++ b/internal/service/ec2/find.go @@ -1257,7 +1257,7 @@ func FindInstanceTypeOfferings(ctx context.Context, conn *ec2.EC2, input *ec2.De return output, nil } -func FindPublicIpv4Pool(ctx context.Context, conn *ec2.EC2, input *ec2.DescribePublicIpv4PoolsInput) ([]*ec2.PublicIpv4Pool, error) { +func FindPublicIPv4Pool(ctx context.Context, conn *ec2.EC2, input *ec2.DescribePublicIpv4PoolsInput) ([]*ec2.PublicIpv4Pool, error) { var output *ec2.DescribePublicIpv4PoolsOutput var result []*ec2.PublicIpv4Pool @@ -1271,7 +1271,7 @@ func FindPublicIpv4Pool(ctx context.Context, conn *ec2.EC2, input *ec2.DescribeP return result, nil } -func FindPublicIpv4Pools(ctx context.Context, conn *ec2.EC2, input *ec2.DescribePublicIpv4PoolsInput) ([]*ec2.PublicIpv4Pool, error) { +func FindPublicIPv4Pools(ctx context.Context, conn *ec2.EC2, input *ec2.DescribePublicIpv4PoolsInput) ([]*ec2.PublicIpv4Pool, error) { var output []*ec2.PublicIpv4Pool err := conn.DescribePublicIpv4PoolsPages(input, func(page *ec2.DescribePublicIpv4PoolsOutput, lastPage bool) bool { diff --git a/internal/service/ec2/public_ipv4_pool_data_source.go b/internal/service/ec2/public_ipv4_pool_data_source.go index d3d2660d075d..5e4e768c1116 100644 --- a/internal/service/ec2/public_ipv4_pool_data_source.go +++ b/internal/service/ec2/public_ipv4_pool_data_source.go @@ -16,6 +16,7 @@ import ( func DataSourcePublicIpv4Pool() *schema.Resource { return &schema.Resource{ ReadWithoutTimeout: dataSourcePublicIpv4PoolRead, + Schema: map[string]*schema.Schema{ "filter": DataSourceFiltersSchema(), "pool_id": { @@ -56,7 +57,7 @@ func dataSourcePublicIpv4PoolRead(ctx context.Context, d *schema.ResourceData, m input.Filters = nil } - output, err := FindPublicIpv4Pool(ctx, conn, input) + output, err := FindPublicIPv4Pool(ctx, conn, input) if err != nil { create.DiagError(names.EC2, create.ErrActionSetting, DSNamePublicIpv4Pool, d.Id(), err) } diff --git a/internal/service/ec2/public_ipv4_pools_data_source.go b/internal/service/ec2/public_ipv4_pools_data_source.go index 3fef8f724352..fd111cb5c03f 100644 --- a/internal/service/ec2/public_ipv4_pools_data_source.go +++ b/internal/service/ec2/public_ipv4_pools_data_source.go @@ -62,7 +62,7 @@ func dataSourcePublicIpv4PoolsRead(ctx context.Context, d *schema.ResourceData, publicIpv4Pools := []map[string]interface{}{} - output, err := FindPublicIpv4Pools(ctx, conn, input) + output, err := FindPublicIPv4Pools(ctx, conn, input) if err != nil { create.DiagError(names.EC2, create.ErrActionSetting, DSNamePublicIpv4Pools, d.Id(), err) } From 1a93dcf1c721d1d419be57c8797e62acf999ad27 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Mon, 13 Mar 2023 16:48:12 -0400 Subject: [PATCH 737/763] Add and use 'errCodeInvalidPublicIpv4PoolIDNotFound'. --- internal/service/ec2/errors.go | 1 + internal/service/ec2/find.go | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/internal/service/ec2/errors.go b/internal/service/ec2/errors.go index e22f30beb178..6bc6924688f8 100644 --- a/internal/service/ec2/errors.go +++ b/internal/service/ec2/errors.go @@ -68,6 +68,7 @@ const ( errCodeInvalidPoolIDNotFound = "InvalidPoolID.NotFound" errCodeInvalidPrefixListIDNotFound = "InvalidPrefixListID.NotFound" errCodeInvalidPrefixListIdNotFound = "InvalidPrefixListId.NotFound" + errCodeInvalidPublicIpv4PoolIDNotFound = "InvalidPublicIpv4PoolID.NotFound" errCodeInvalidRouteNotFound = "InvalidRoute.NotFound" errCodeInvalidRouteTableIDNotFound = "InvalidRouteTableID.NotFound" errCodeInvalidRouteTableIdNotFound = "InvalidRouteTableId.NotFound" diff --git a/internal/service/ec2/find.go b/internal/service/ec2/find.go index fde5f4b5065b..c4134d98cedc 100644 --- a/internal/service/ec2/find.go +++ b/internal/service/ec2/find.go @@ -1290,7 +1290,7 @@ func FindPublicIPv4Pools(ctx context.Context, conn *ec2.EC2, input *ec2.Describe return !lastPage }) - if tfawserr.ErrCodeEquals(err, errCodeInvalidPoolIDNotFound) { + if tfawserr.ErrCodeEquals(err, errCodeInvalidPublicIpv4PoolIDNotFound) { return nil, &resource.NotFoundError{ LastError: err, LastRequest: input, From 265fc088f5890eaecdd6142dbede49cdf2e8c66e Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Mon, 13 Mar 2023 16:51:28 -0400 Subject: [PATCH 738/763] Use 'FindPublicIPv4Pools' in 'FindPublicIPv4Pool'. --- internal/service/ec2/find.go | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/internal/service/ec2/find.go b/internal/service/ec2/find.go index c4134d98cedc..b3aabbd0c3ea 100644 --- a/internal/service/ec2/find.go +++ b/internal/service/ec2/find.go @@ -1257,18 +1257,22 @@ func FindInstanceTypeOfferings(ctx context.Context, conn *ec2.EC2, input *ec2.De return output, nil } -func FindPublicIPv4Pool(ctx context.Context, conn *ec2.EC2, input *ec2.DescribePublicIpv4PoolsInput) ([]*ec2.PublicIpv4Pool, error) { - var output *ec2.DescribePublicIpv4PoolsOutput - var result []*ec2.PublicIpv4Pool +func FindPublicIPv4Pool(ctx context.Context, conn *ec2.EC2, input *ec2.DescribePublicIpv4PoolsInput) (*ec2.PublicIpv4Pool, error) { + output, err := FindPublicIPv4Pools(ctx, conn, input) - output, err := conn.DescribePublicIpv4Pools(input) if err != nil { return nil, err } - result = output.PublicIpv4Pools + if len(output) == 0 || output[0] == nil { + return nil, tfresource.NewEmptyResultError(input) + } + + if count := len(output); count > 1 { + return nil, tfresource.NewTooManyResultsError(count, input) + } - return result, nil + return output[0], nil } func FindPublicIPv4Pools(ctx context.Context, conn *ec2.EC2, input *ec2.DescribePublicIpv4PoolsInput) ([]*ec2.PublicIpv4Pool, error) { From 632044751a01464fd7d72b0708928ee15ceeab80 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Mon, 13 Mar 2023 17:05:08 -0400 Subject: [PATCH 739/763] d/aws_vpc_public_ipv4_pools: Simplify attributes. --- .../ec2/public_ipv4_pools_data_source.go | 43 +++++++------------ internal/service/ec2/service_package_gen.go | 4 ++ .../docs/d/public_ipv4_pools.html.markdown | 34 ++++++--------- 3 files changed, 32 insertions(+), 49 deletions(-) diff --git a/internal/service/ec2/public_ipv4_pools_data_source.go b/internal/service/ec2/public_ipv4_pools_data_source.go index fd111cb5c03f..ee4d0d09e58f 100644 --- a/internal/service/ec2/public_ipv4_pools_data_source.go +++ b/internal/service/ec2/public_ipv4_pools_data_source.go @@ -8,45 +8,32 @@ import ( "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/names" ) -func DataSourcePublicIpv4Pools() *schema.Resource { +// @SDKDataSource("aws_vpc_public_ipv4_pools") +func DataSourcePublicIPv4Pools() *schema.Resource { return &schema.Resource{ ReadWithoutTimeout: dataSourcePublicIpv4PoolsRead, + Schema: map[string]*schema.Schema{ "filter": DataSourceFiltersSchema(), "pool_ids": { - Type: schema.TypeList, - Optional: true, - Elem: &schema.Schema{Type: schema.TypeString}, - }, - "pools": { Type: schema.TypeList, Computed: true, - Elem: &schema.Schema{ - Type: schema.TypeMap, - Elem: &schema.Schema{Type: schema.TypeString}, - }, + Elem: &schema.Schema{Type: schema.TypeString}, }, "tags": tftags.TagsSchemaComputed(), }, } } -const ( - DSNamePublicIpv4Pools = "Public IPv4 Pools Data Source" -) - func dataSourcePublicIpv4PoolsRead(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - conn := meta.(*conns.AWSClient).EC2Conn - input := &ec2.DescribePublicIpv4PoolsInput{} + var diags diag.Diagnostics + conn := meta.(*conns.AWSClient).EC2Conn() - if v, ok := d.GetOk("pool_ids"); ok { - input.PoolIds = aws.StringSlice([]string{v.(string)}) - } + input := &ec2.DescribePublicIpv4PoolsInput{} input.Filters = append(input.Filters, BuildTagFilterList( Tags(tftags.New(ctx, d.Get("tags").(map[string]interface{}))), @@ -60,20 +47,20 @@ func dataSourcePublicIpv4PoolsRead(ctx context.Context, d *schema.ResourceData, input.Filters = nil } - publicIpv4Pools := []map[string]interface{}{} - output, err := FindPublicIPv4Pools(ctx, conn, input) + if err != nil { - create.DiagError(names.EC2, create.ErrActionSetting, DSNamePublicIpv4Pools, d.Id(), err) + return sdkdiag.AppendErrorf(diags, "reading EC2 Public IPv4 Pools: %s", err) } + var poolIDs []string + for _, v := range output { - pool := flattenPublicIpv4Pool(v) - publicIpv4Pools = append(publicIpv4Pools, pool) + poolIDs = append(poolIDs, aws.StringValue(v.PoolId)) } d.SetId(meta.(*conns.AWSClient).Region) - d.Set("pools", publicIpv4Pools) + d.Set("pool_ids", poolIDs) - return nil + return diags } diff --git a/internal/service/ec2/service_package_gen.go b/internal/service/ec2/service_package_gen.go index ec2c9d412633..a12adf3a7446 100644 --- a/internal/service/ec2/service_package_gen.go +++ b/internal/service/ec2/service_package_gen.go @@ -335,6 +335,10 @@ func (p *servicePackage) SDKDataSources(ctx context.Context) []*types.ServicePac Factory: DataSourceVPCPeeringConnections, TypeName: "aws_vpc_peering_connections", }, + { + Factory: DataSourcePublicIPv4Pools, + TypeName: "aws_vpc_public_ipv4_pools", + }, { Factory: DataSourceVPCs, TypeName: "aws_vpcs", diff --git a/website/docs/d/public_ipv4_pools.html.markdown b/website/docs/d/public_ipv4_pools.html.markdown index 790fa9314ec8..149d986f4bd7 100644 --- a/website/docs/d/public_ipv4_pools.html.markdown +++ b/website/docs/d/public_ipv4_pools.html.markdown @@ -3,21 +3,20 @@ subcategory: "VPC (Virtual Private Cloud)" layout: "aws" page_title: "AWS: aws_vpc_public_ipv4_pools" description: |- - Terraform data source for managing AWS VPC (Virtual Private Cloud) Public IPv4 Pools. + Terraform data source for getting information about AWS VPC (Virtual Private Cloud) Public IPv4 Pools. --- # Data Source: aws_ec2_public_ipv4_pools -Terraform data source for managing AWS VPC (Virtual Private Cloud) Public IPv4 Pools +Terraform data source for getting information about AWS VPC (Virtual Private Cloud) Public IPv4 Pools. ## Example Usage ### Basic Usage ```terraform -data "aws_vpc_public_ipv4_pools" "example" { - pool_ids = ["ipv4pool-ec2-000df99cff0c1ec10", "ipv4pool-ec2-000fe121a300ffc94"] -} +# Returns all public IPv4 pools. +data "aws_vpc_public_ipv4_pools" "example" {} ``` ### Usage with Filter @@ -34,22 +33,15 @@ data "aws_vpc_public_ipv4_pools" "example" { The following arguments are optional: -* `pool_ids` - (Optional) List of AWS resource IDs of public IPv4 pools (as strings) for which this data source will fetch detailed information. If not specified, then this data source will return info about all pools in the configured region. -* `filter` - (Optional) One or more filters for results. Supported filters include `tag` and `tag-key`. -* `tags` - (Optional) One or more tags, which are used to filter results. +* `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 pools. + +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](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DescribePublicIpv4Pools.html). +* `values` - (Required) Set of values that are accepted for the given field. Pool IDs will be selected if any one of the given values match. ## Attributes Reference -In addition to all arguments above, the following attributes are exported: - -* `pools` - List of Public IPv4 Pool records. Each of these contains: - - `description` - Description of the pool, if any. - - `network_border_group` - Name of the location from which the address pool is advertised. - - `pool_address_ranges` - List of Address Ranges in the Pool; each address range record contains: - - `address_count` - Number of addresses in the range. - - `available_address_count` - Number of available addresses in the range. - - `first_address` - First address in the range. - - `last_address` - Last address in the range. - - `tags` - Any tags for the address pool. - - `total_address_count` - Total number of addresses in the pool. - - `total_available_address_count` - Total number of available addresses in the pool. +* `pool_ids` - List of all the pool IDs found. From ff2700842b390605fb67e0acf5269adaae296a56 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Mon, 13 Mar 2023 17:12:50 -0400 Subject: [PATCH 740/763] Add 'FindPublicIPv4PoolByID'. --- internal/service/ec2/find.go | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/internal/service/ec2/find.go b/internal/service/ec2/find.go index b3aabbd0c3ea..1be25c959e75 100644 --- a/internal/service/ec2/find.go +++ b/internal/service/ec2/find.go @@ -1308,6 +1308,27 @@ func FindPublicIPv4Pools(ctx context.Context, conn *ec2.EC2, input *ec2.Describe return output, nil } +func FindPublicIPv4PoolByID(ctx context.Context, conn *ec2.EC2, id string) (*ec2.PublicIpv4Pool, error) { + input := &ec2.DescribePublicIpv4PoolsInput{ + PoolIds: aws.StringSlice([]string{id}), + } + + output, err := FindPublicIPv4Pool(ctx, conn, input) + + if err != nil { + return nil, err + } + + // Eventual consistency check. + if aws.StringValue(output.PoolId) != id { + return nil, &resource.NotFoundError{ + LastRequest: input, + } + } + + return output, nil +} + func FindLocalGatewayRouteTables(ctx context.Context, conn *ec2.EC2, input *ec2.DescribeLocalGatewayRouteTablesInput) ([]*ec2.LocalGatewayRouteTable, error) { var output []*ec2.LocalGatewayRouteTable From 9f563434cf70ffb1932f15df3a33d2c14a1ad19d Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Mon, 13 Mar 2023 17:27:01 -0400 Subject: [PATCH 741/763] d/aws_vpc_public_ipv4_pool: Simplify attributes. --- .../ec2/public_ipv4_pool_data_source.go | 155 ++++++++++-------- internal/service/ec2/service_package_gen.go | 4 + website/docs/d/public_ipv4_pool.html.markdown | 46 ++---- 3 files changed, 107 insertions(+), 98 deletions(-) diff --git a/internal/service/ec2/public_ipv4_pool_data_source.go b/internal/service/ec2/public_ipv4_pool_data_source.go index 5e4e768c1116..f8e2afb6bcba 100644 --- a/internal/service/ec2/public_ipv4_pool_data_source.go +++ b/internal/service/ec2/public_ipv4_pool_data_source.go @@ -8,111 +8,132 @@ import ( "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/names" ) -func DataSourcePublicIpv4Pool() *schema.Resource { +// @SDKDataSource("aws_vpc_public_ipv4_pool") +func DataSourcePublicIPv4Pool() *schema.Resource { return &schema.Resource{ ReadWithoutTimeout: dataSourcePublicIpv4PoolRead, Schema: map[string]*schema.Schema{ - "filter": DataSourceFiltersSchema(), + "description": { + Type: schema.TypeString, + Computed: true, + }, + "network_border_group": { + Type: schema.TypeString, + Computed: true, + }, + "pool_address_ranges": { + Type: schema.TypeList, + Computed: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "address_count": { + Type: schema.TypeInt, + Computed: true, + }, + "available_address_count": { + Type: schema.TypeInt, + Computed: true, + }, + "first_address": { + Type: schema.TypeString, + Computed: true, + }, + "last_address": { + Type: schema.TypeString, + Computed: true, + }, + }, + }, + }, "pool_id": { Type: schema.TypeString, Required: true, }, - "pool": { - Type: schema.TypeMap, + "tags": tftags.TagsSchemaComputed(), + "total_address_count": { + Type: schema.TypeInt, + Computed: true, + }, + "total_available_address_count": { + Type: schema.TypeInt, Computed: true, - Elem: &schema.Schema{Type: schema.TypeString}, }, - "tags": tftags.TagsSchemaComputed(), }, } } -const ( - DSNamePublicIpv4Pool = "Public IPv4 Pool Data Source" -) - func dataSourcePublicIpv4PoolRead(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { - conn := meta.(*conns.AWSClient).EC2Conn - input := &ec2.DescribePublicIpv4PoolsInput{} - - if v, ok := d.GetOk("pool_id"); ok { - input.PoolIds = aws.StringSlice([]string{v.(string)}) - } + var diags diag.Diagnostics + conn := meta.(*conns.AWSClient).EC2Conn() + ignoreTagsConfig := meta.(*conns.AWSClient).IgnoreTagsConfig - input.Filters = append(input.Filters, BuildTagFilterList( - Tags(tftags.New(ctx, d.Get("tags").(map[string]interface{}))), - )...) + poolID := d.Get("pool_id").(string) + pool, err := FindPublicIPv4PoolByID(ctx, conn, poolID) - input.Filters = append(input.Filters, BuildFiltersDataSource( - d.Get("filter").(*schema.Set), - )...) - - if len(input.Filters) == 0 { - input.Filters = nil - } - - output, err := FindPublicIPv4Pool(ctx, conn, input) if err != nil { - create.DiagError(names.EC2, create.ErrActionSetting, DSNamePublicIpv4Pool, d.Id(), err) + return sdkdiag.AppendErrorf(diags, "reading EC2 Public IPv4 Pool (%s): %s", poolID, err) } - pool := flattenPublicIpv4Pool(output[0]) - - d.SetId(meta.(*conns.AWSClient).Region) - d.Set("pool", pool) + d.SetId(poolID) + d.Set("description", pool.Description) + d.Set("network_border_group", pool.NetworkBorderGroup) + if err := d.Set("pool_address_ranges", flattenPublicIpv4PoolRanges(pool.PoolAddressRanges)); err != nil { + return sdkdiag.AppendErrorf(diags, "setting pool_address_ranges: %s", err) + } + if err := d.Set("tags", KeyValueTags(ctx, pool.Tags).IgnoreAWS().IgnoreConfig(ignoreTagsConfig).Map()); err != nil { + return sdkdiag.AppendErrorf(diags, "setting tags: %s", err) + } + d.Set("total_address_count", pool.TotalAddressCount) + d.Set("total_available_address_count", pool.TotalAvailableAddressCount) return nil } -func flattenPublicIpv4Pool(pool *ec2.PublicIpv4Pool) map[string]interface{} { - if pool == nil { - return map[string]interface{}{} +func flattenPublicIpv4PoolRange(apiObject *ec2.PublicIpv4PoolRange) map[string]interface{} { + if apiObject == nil { + return nil } - m := map[string]interface{}{ - "description": aws.StringValue(pool.Description), - "network_border_group": aws.StringValue(pool.NetworkBorderGroup), - "pool_address_ranges": flattenPublicIpv4PoolRanges(pool.PoolAddressRanges), - "pool_id": aws.StringValue(pool.PoolId), - "tags": flattenTags(pool.Tags), - "total_address_count": aws.Int64Value(pool.TotalAddressCount), - "total_available_address_count": aws.Int64Value(pool.TotalAvailableAddressCount), - } + tfMap := map[string]interface{}{} - return m -} + if v := apiObject.AddressCount; v != nil { + tfMap["address_count"] = aws.Int64Value(v) + } -func flattenPublicIpv4PoolRanges(pool_ranges []*ec2.PublicIpv4PoolRange) []interface{} { - result := []interface{}{} + if v := apiObject.AvailableAddressCount; v != nil { + tfMap["available_address_count"] = aws.Int64Value(v) + } - if pool_ranges == nil { - return result + if v := apiObject.FirstAddress; v != nil { + tfMap["first_address"] = aws.StringValue(v) } - for _, v := range pool_ranges { - range_map := map[string]interface{}{ - "address_count": aws.Int64Value(v.AddressCount), - "available_address_count": aws.Int64Value(v.AvailableAddressCount), - "first_address": aws.StringValue(v.FirstAddress), - "last_address": aws.StringValue(v.LastAddress), - } - result = append(result, range_map) + if v := apiObject.LastAddress; v != nil { + tfMap["last_address"] = aws.StringValue(v) } - return result + return tfMap } -func flattenTags(tags []*ec2.Tag) map[string]string { - result := make(map[string]string) - for _, t := range tags { - result[aws.StringValue(t.Key)] = aws.StringValue(t.Value) +func flattenPublicIpv4PoolRanges(apiObjects []*ec2.PublicIpv4PoolRange) []interface{} { + if len(apiObjects) == 0 { + return nil + } + + var tfList []interface{} + + for _, apiObject := range apiObjects { + if apiObject == nil { + continue + } + + tfList = append(tfList, flattenPublicIpv4PoolRange(apiObject)) } - return result + return tfList } diff --git a/internal/service/ec2/service_package_gen.go b/internal/service/ec2/service_package_gen.go index a12adf3a7446..0e41645e9b4a 100644 --- a/internal/service/ec2/service_package_gen.go +++ b/internal/service/ec2/service_package_gen.go @@ -335,6 +335,10 @@ func (p *servicePackage) SDKDataSources(ctx context.Context) []*types.ServicePac Factory: DataSourceVPCPeeringConnections, TypeName: "aws_vpc_peering_connections", }, + { + Factory: DataSourcePublicIPv4Pool, + TypeName: "aws_vpc_public_ipv4_pool", + }, { Factory: DataSourcePublicIPv4Pools, TypeName: "aws_vpc_public_ipv4_pools", diff --git a/website/docs/d/public_ipv4_pool.html.markdown b/website/docs/d/public_ipv4_pool.html.markdown index dcf853369e62..8674dca7cef9 100644 --- a/website/docs/d/public_ipv4_pool.html.markdown +++ b/website/docs/d/public_ipv4_pool.html.markdown @@ -1,14 +1,14 @@ --- subcategory: "VPC (Virtual Private Cloud)" layout: "aws" -page_title: "AWS: aws_vpc_public_ipv4_pools" +page_title: "AWS: aws_vpc_public_ipv4_pool" description: |- - Terraform data source for managing AWS VPC (Virtual Private Cloud) Public IPv4 Pools. + Provides details about a specific AWS VPC (Virtual Private Cloud) Public IPv4 Pool. --- -# Data Source: aws_ec2_public_ipv4_pools +# Data Source: aws_ec2_public_ipv4_pool -Terraform data source for managing an AWS VPC (Virtual Private Cloud) Public IPv4 Pool +Provides details about a specific AWS VPC (Virtual Private Cloud) Public IPv4 Pool. ## Example Usage @@ -16,17 +16,7 @@ Terraform data source for managing an AWS VPC (Virtual Private Cloud) Public IPv ```terraform data "aws_vpc_public_ipv4_pool" "example" { - pool_ids = "ipv4pool-ec2-000df99cff0c1ec10" -} -``` - -### Usage with Filter -```terraform -data "aws_vpc_public_ipv4_pool" "example" { - filter { - name = "tag-key" - values = ["ExampleTagKey"] - } + pool_id = "ipv4pool-ec2-000df99cff0c1ec10" } ``` @@ -36,23 +26,17 @@ The following arguments are required: * `pool_id` - (Required) AWS resource IDs of a public IPv4 pool (as a string) for which this data source will fetch detailed information. -The following arguments are optional: - -* `filter` - (Optional) One or more filters for results. Supported filters include `tag` and `tag-key`. -* `tags` - (Optional) One or more tags, which are used to filter results. - ## Attributes Reference In addition to all arguments above, the following attributes are exported: -* `pool` - Record containing information about a Public IPv4 Pool. Contents: - - `description` - Description of the pool, if any. - - `network_border_group` - Name of the location from which the address pool is advertised. - - `pool_address_ranges` - List of Address Ranges in the Pool; each address range record contains: - - `address_count` - Number of addresses in the range. - - `available_address_count` - Number of available addresses in the range. - - `first_address` - First address in the range. - - `last_address` - Last address in the range. - - `tags` - Any tags for the address pool. - - `total_address_count` - Total number of addresses in the pool. - - `total_available_address_count` - Total number of available addresses in the pool. +* `description` - Description of the pool, if any. +* `network_border_group` - Name of the location from which the address pool is advertised. +* pool_address_ranges` - List of Address Ranges in the Pool; each address range record contains: + * `address_count` - Number of addresses in the range. + * `available_address_count` - Number of available addresses in the range. + * `first_address` - First address in the range. + * `last_address` - Last address in the range. +* `tags` - Any tags for the address pool. +* `total_address_count` - Total number of addresses in the pool. +* `total_available_address_count` - Total number of available addresses in the pool. From e6eae97a1dc48ae4c59662e958a08acfc9d233ff Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 14 Mar 2023 06:57:30 +0000 Subject: [PATCH 742/763] build(deps): bump actions/cache from 3.2.6 to 3.3.1 Bumps [actions/cache](https://github.com/actions/cache) from 3.2.6 to 3.3.1. - [Release notes](https://github.com/actions/cache/releases) - [Changelog](https://github.com/actions/cache/blob/main/RELEASES.md) - [Commits](https://github.com/actions/cache/compare/69d9d449aced6a2ede0bc19182fadc3a0a42d2b0...88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8) --- updated-dependencies: - dependency-name: actions/cache dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- .github/workflows/acctest-terraform-lint.yml | 6 ++-- .github/workflows/changelog.yml | 2 +- .github/workflows/documentation.yml | 2 +- .github/workflows/examples.yml | 6 ++-- .github/workflows/goreleaser-ci.yml | 4 +-- .github/workflows/providerlint.yml | 8 ++--- .github/workflows/skaff.yml | 4 +-- .github/workflows/snapshot.yml | 2 +- .github/workflows/terraform_provider.yml | 32 ++++++++++---------- .github/workflows/website.yml | 8 ++--- 10 files changed, 37 insertions(+), 37 deletions(-) diff --git a/.github/workflows/acctest-terraform-lint.yml b/.github/workflows/acctest-terraform-lint.yml index 0c0908637d96..86f2ccfe3580 100644 --- a/.github/workflows/acctest-terraform-lint.yml +++ b/.github/workflows/acctest-terraform-lint.yml @@ -21,7 +21,7 @@ jobs: - uses: actions/setup-go@6edd4406fa81c3da01a34fa6f6343087c207a568 with: go-version-file: go.mod - - uses: actions/cache@69d9d449aced6a2ede0bc19182fadc3a0a42d2b0 + - uses: actions/cache@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 continue-on-error: true timeout-minutes: 2 with: @@ -49,13 +49,13 @@ jobs: - uses: actions/setup-go@6edd4406fa81c3da01a34fa6f6343087c207a568 with: go-version-file: go.mod - - uses: actions/cache@69d9d449aced6a2ede0bc19182fadc3a0a42d2b0 + - uses: actions/cache@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 continue-on-error: true timeout-minutes: 2 with: path: ~/go/pkg/mod key: ${{ runner.os }}-go-pkg-mod-${{ hashFiles('go.sum') }} - - uses: actions/cache@69d9d449aced6a2ede0bc19182fadc3a0a42d2b0 + - uses: actions/cache@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 name: Cache plugin dir continue-on-error: true timeout-minutes: 2 diff --git a/.github/workflows/changelog.yml b/.github/workflows/changelog.yml index 73df12a2a645..03c3c9ec00f8 100644 --- a/.github/workflows/changelog.yml +++ b/.github/workflows/changelog.yml @@ -62,7 +62,7 @@ jobs: - uses: actions/setup-go@6edd4406fa81c3da01a34fa6f6343087c207a568 with: go-version-file: go.mod - - uses: actions/cache@69d9d449aced6a2ede0bc19182fadc3a0a42d2b0 + - uses: actions/cache@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 continue-on-error: true timeout-minutes: 2 with: diff --git a/.github/workflows/documentation.yml b/.github/workflows/documentation.yml index 256f0c2f37de..fdad86debf47 100644 --- a/.github/workflows/documentation.yml +++ b/.github/workflows/documentation.yml @@ -41,7 +41,7 @@ jobs: - uses: actions/setup-go@6edd4406fa81c3da01a34fa6f6343087c207a568 with: go-version-file: go.mod - - uses: actions/cache@69d9d449aced6a2ede0bc19182fadc3a0a42d2b0 + - uses: actions/cache@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 continue-on-error: true timeout-minutes: 2 with: diff --git a/.github/workflows/examples.yml b/.github/workflows/examples.yml index f223b5de05db..6e7e901d8fd8 100644 --- a/.github/workflows/examples.yml +++ b/.github/workflows/examples.yml @@ -21,7 +21,7 @@ jobs: - uses: actions/checkout@v3 with: fetch-depth: 0 - - uses: actions/cache@69d9d449aced6a2ede0bc19182fadc3a0a42d2b0 + - uses: actions/cache@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 with: path: ~/go/pkg/mod key: ${{ runner.os }}-go-pkg-mod-${{ hashFiles('go.sum') }} @@ -32,7 +32,7 @@ jobs: - name: install tflint run: cd .ci/tools && go install github.com/terraform-linters/tflint - - uses: actions/cache@69d9d449aced6a2ede0bc19182fadc3a0a42d2b0 + - uses: actions/cache@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 name: Cache plugin dir with: path: ~/.tflint.d/plugins @@ -70,7 +70,7 @@ jobs: - uses: actions/checkout@v3 with: fetch-depth: 0 - - uses: actions/cache@69d9d449aced6a2ede0bc19182fadc3a0a42d2b0 + - uses: actions/cache@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 with: path: ~/go/pkg/mod key: ${{ runner.os }}-go-pkg-mod-${{ hashFiles('go.sum') }} diff --git a/.github/workflows/goreleaser-ci.yml b/.github/workflows/goreleaser-ci.yml index c0f61b562905..547f847f72cd 100644 --- a/.github/workflows/goreleaser-ci.yml +++ b/.github/workflows/goreleaser-ci.yml @@ -41,7 +41,7 @@ jobs: - uses: actions/setup-go@6edd4406fa81c3da01a34fa6f6343087c207a568 with: go-version-file: go.mod - - uses: actions/cache@69d9d449aced6a2ede0bc19182fadc3a0a42d2b0 + - uses: actions/cache@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 continue-on-error: true timeout-minutes: 2 with: @@ -61,7 +61,7 @@ jobs: - uses: actions/setup-go@6edd4406fa81c3da01a34fa6f6343087c207a568 with: go-version-file: go.mod - - uses: actions/cache@69d9d449aced6a2ede0bc19182fadc3a0a42d2b0 + - uses: actions/cache@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 continue-on-error: true timeout-minutes: 2 with: diff --git a/.github/workflows/providerlint.yml b/.github/workflows/providerlint.yml index d1f977dd702a..ba4cd66d72a2 100644 --- a/.github/workflows/providerlint.yml +++ b/.github/workflows/providerlint.yml @@ -25,13 +25,13 @@ jobs: go-version-file: go.mod - name: go env run: echo "GOCACHE=$(go env GOCACHE)" >> $GITHUB_ENV - - uses: actions/cache@69d9d449aced6a2ede0bc19182fadc3a0a42d2b0 + - uses: actions/cache@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 continue-on-error: true timeout-minutes: 2 with: path: ${{ env.GOCACHE }} key: ${{ runner.os }}-GOCACHE-${{ hashFiles('go.sum') }}-${{ hashFiles('internal/**') }} - - uses: actions/cache@69d9d449aced6a2ede0bc19182fadc3a0a42d2b0 + - uses: actions/cache@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 continue-on-error: true timeout-minutes: 2 with: @@ -50,13 +50,13 @@ jobs: go-version-file: go.mod - name: go env run: echo "GOCACHE=$(go env GOCACHE)" >> $GITHUB_ENV - - uses: actions/cache@69d9d449aced6a2ede0bc19182fadc3a0a42d2b0 + - uses: actions/cache@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 continue-on-error: true timeout-minutes: 2 with: path: ${{ env.GOCACHE }} key: ${{ runner.os }}-GOCACHE-${{ hashFiles('go.sum') }}-${{ hashFiles('internal/**') }} - - uses: actions/cache@69d9d449aced6a2ede0bc19182fadc3a0a42d2b0 + - uses: actions/cache@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 continue-on-error: true timeout-minutes: 2 with: diff --git a/.github/workflows/skaff.yml b/.github/workflows/skaff.yml index fbb93946879d..19a5bd84a859 100644 --- a/.github/workflows/skaff.yml +++ b/.github/workflows/skaff.yml @@ -25,13 +25,13 @@ jobs: - name: go env run: | echo "GOCACHE=$(go env GOCACHE)" >> $GITHUB_ENV - - uses: actions/cache@69d9d449aced6a2ede0bc19182fadc3a0a42d2b0 + - uses: actions/cache@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 continue-on-error: true timeout-minutes: 2 with: path: ${{ env.GOCACHE }} key: ${{ runner.os }}-GOCACHE-${{ hashFiles('go.sum') }}-${{ hashFiles('internal/**') }} - - uses: actions/cache@69d9d449aced6a2ede0bc19182fadc3a0a42d2b0 + - uses: actions/cache@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 continue-on-error: true timeout-minutes: 2 with: diff --git a/.github/workflows/snapshot.yml b/.github/workflows/snapshot.yml index 8391056ecccc..ee8ce58abef2 100644 --- a/.github/workflows/snapshot.yml +++ b/.github/workflows/snapshot.yml @@ -13,7 +13,7 @@ jobs: - uses: actions/setup-go@6edd4406fa81c3da01a34fa6f6343087c207a568 with: go-version-file: go.mod - - uses: actions/cache@69d9d449aced6a2ede0bc19182fadc3a0a42d2b0 + - uses: actions/cache@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 continue-on-error: true timeout-minutes: 2 with: diff --git a/.github/workflows/terraform_provider.yml b/.github/workflows/terraform_provider.yml index 2c47c9b3f848..69ec35b62b2a 100644 --- a/.github/workflows/terraform_provider.yml +++ b/.github/workflows/terraform_provider.yml @@ -36,7 +36,7 @@ jobs: - uses: actions/setup-go@6edd4406fa81c3da01a34fa6f6343087c207a568 with: go-version-file: go.mod - - uses: actions/cache@69d9d449aced6a2ede0bc19182fadc3a0a42d2b0 + - uses: actions/cache@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 continue-on-error: true id: cache-go-pkg-mod timeout-minutes: 2 @@ -52,7 +52,7 @@ jobs: runs-on: [custom, linux, medium] steps: - uses: actions/checkout@v3 - - uses: actions/cache@69d9d449aced6a2ede0bc19182fadc3a0a42d2b0 + - uses: actions/cache@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 continue-on-error: true id: cache-terraform-plugin-dir timeout-minutes: 2 @@ -69,12 +69,12 @@ jobs: run: | echo "GOCACHE=$(go env GOCACHE)" >> $GITHUB_ENV - if: steps.cache-terraform-plugin-dir.outputs.cache-hit != 'true' || steps.cache-terraform-plugin-dir.outcome == 'failure' - uses: actions/cache@69d9d449aced6a2ede0bc19182fadc3a0a42d2b0 + uses: actions/cache@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 with: path: ${{ env.GOCACHE }} key: ${{ runner.os }}-GOCACHE-${{ hashFiles('go.sum') }}-${{ hashFiles('internal/**') }} - if: steps.cache-terraform-plugin-dir.outputs.cache-hit != 'true' || steps.cache-terraform-plugin-dir.outcome == 'failure' - uses: actions/cache@69d9d449aced6a2ede0bc19182fadc3a0a42d2b0 + uses: actions/cache@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 with: path: ~/go/pkg/mod key: ${{ runner.os }}-go-pkg-mod-${{ hashFiles('go.sum') }} @@ -95,13 +95,13 @@ jobs: - name: go env run: | echo "GOCACHE=$(go env GOCACHE)" >> $GITHUB_ENV - - uses: actions/cache@69d9d449aced6a2ede0bc19182fadc3a0a42d2b0 + - uses: actions/cache@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 continue-on-error: true timeout-minutes: 2 with: path: ${{ env.GOCACHE }} key: ${{ runner.os }}-GOCACHE-${{ hashFiles('go.sum') }}-${{ hashFiles('internal/**') }} - - uses: actions/cache@69d9d449aced6a2ede0bc19182fadc3a0a42d2b0 + - uses: actions/cache@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 continue-on-error: true timeout-minutes: 2 with: @@ -129,13 +129,13 @@ jobs: - name: go env run: | echo "GOCACHE=$(go env GOCACHE)" >> $GITHUB_ENV - - uses: actions/cache@69d9d449aced6a2ede0bc19182fadc3a0a42d2b0 + - uses: actions/cache@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 continue-on-error: true timeout-minutes: 2 with: path: ${{ env.GOCACHE }} key: ${{ runner.os }}-GOCACHE-${{ hashFiles('go.sum') }}-${{ hashFiles('internal/**') }} - - uses: actions/cache@69d9d449aced6a2ede0bc19182fadc3a0a42d2b0 + - uses: actions/cache@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 continue-on-error: true timeout-minutes: 2 with: @@ -156,13 +156,13 @@ jobs: - name: go env run: | echo "GOCACHE=$(go env GOCACHE)" >> $GITHUB_ENV - - uses: actions/cache@69d9d449aced6a2ede0bc19182fadc3a0a42d2b0 + - uses: actions/cache@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 continue-on-error: true timeout-minutes: 2 with: path: ${{ env.GOCACHE }} key: ${{ runner.os }}-GOCACHE-${{ hashFiles('go.sum') }}-${{ hashFiles('internal/**') }} - - uses: actions/cache@69d9d449aced6a2ede0bc19182fadc3a0a42d2b0 + - uses: actions/cache@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 continue-on-error: true timeout-minutes: 2 with: @@ -186,13 +186,13 @@ jobs: - name: go env run: | echo "GOCACHE=$(go env GOCACHE)" >> $GITHUB_ENV - - uses: actions/cache@69d9d449aced6a2ede0bc19182fadc3a0a42d2b0 + - uses: actions/cache@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 continue-on-error: true timeout-minutes: 2 with: path: ${{ env.GOCACHE }} key: ${{ runner.os }}-GOCACHE-${{ hashFiles('go.sum') }}-${{ hashFiles('internal/**') }} - - uses: actions/cache@69d9d449aced6a2ede0bc19182fadc3a0a42d2b0 + - uses: actions/cache@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 continue-on-error: true timeout-minutes: 2 with: @@ -207,7 +207,7 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - - uses: actions/cache@69d9d449aced6a2ede0bc19182fadc3a0a42d2b0 + - uses: actions/cache@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 continue-on-error: true id: cache-terraform-providers-schema timeout-minutes: 2 @@ -215,7 +215,7 @@ jobs: path: terraform-providers-schema key: ${{ runner.os }}-terraform-providers-schema-${{ hashFiles('go.sum') }}-${{ hashFiles('internal/**') }} - if: steps.cache-terraform-providers-schema.outputs.cache-hit != 'true' || steps.cache-terraform-providers-schema.outcome == 'failure' - uses: actions/cache@69d9d449aced6a2ede0bc19182fadc3a0a42d2b0 + uses: actions/cache@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 timeout-minutes: 2 with: path: terraform-plugin-dir @@ -245,14 +245,14 @@ jobs: - uses: actions/setup-go@6edd4406fa81c3da01a34fa6f6343087c207a568 with: go-version-file: go.mod - - uses: actions/cache@69d9d449aced6a2ede0bc19182fadc3a0a42d2b0 + - uses: actions/cache@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 continue-on-error: true timeout-minutes: 2 with: path: ~/go/pkg/mod key: ${{ runner.os }}-go-pkg-mod-${{ hashFiles('go.sum') }} - run: cd .ci/tools && go install github.com/bflad/tfproviderdocs - - uses: actions/cache@69d9d449aced6a2ede0bc19182fadc3a0a42d2b0 + - uses: actions/cache@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 timeout-minutes: 2 with: path: terraform-providers-schema diff --git a/.github/workflows/website.yml b/.github/workflows/website.yml index 94bc0f2862a2..2e47a4195ab8 100644 --- a/.github/workflows/website.yml +++ b/.github/workflows/website.yml @@ -79,7 +79,7 @@ jobs: - uses: actions/setup-go@6edd4406fa81c3da01a34fa6f6343087c207a568 with: go-version-file: .ci/tools/go.mod - - uses: actions/cache@69d9d449aced6a2ede0bc19182fadc3a0a42d2b0 + - uses: actions/cache@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 continue-on-error: true timeout-minutes: 2 with: @@ -95,7 +95,7 @@ jobs: - uses: actions/setup-go@6edd4406fa81c3da01a34fa6f6343087c207a568 with: go-version-file: .ci/tools/go.mod - - uses: actions/cache@69d9d449aced6a2ede0bc19182fadc3a0a42d2b0 + - uses: actions/cache@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 continue-on-error: true timeout-minutes: 2 with: @@ -113,7 +113,7 @@ jobs: - uses: actions/setup-go@6edd4406fa81c3da01a34fa6f6343087c207a568 with: go-version-file: .ci/tools/go.mod - - uses: actions/cache@69d9d449aced6a2ede0bc19182fadc3a0a42d2b0 + - uses: actions/cache@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 continue-on-error: true timeout-minutes: 2 with: @@ -123,7 +123,7 @@ jobs: - run: cd .ci/tools && go install github.com/katbyte/terrafmt - run: cd .ci/tools && go install github.com/terraform-linters/tflint - - uses: actions/cache@69d9d449aced6a2ede0bc19182fadc3a0a42d2b0 + - uses: actions/cache@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 name: Cache plugin dir with: path: ~/.tflint.d/plugins From d84955311ebe1c24f05db99f65a5c649456f621c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 14 Mar 2023 06:58:59 +0000 Subject: [PATCH 743/763] build(deps): bump github.com/aws/aws-sdk-go-v2/service/s3control Bumps [github.com/aws/aws-sdk-go-v2/service/s3control](https://github.com/aws/aws-sdk-go-v2) from 1.29.5 to 1.30.0. - [Release notes](https://github.com/aws/aws-sdk-go-v2/releases) - [Changelog](https://github.com/aws/aws-sdk-go-v2/blob/main/CHANGELOG.md) - [Commits](https://github.com/aws/aws-sdk-go-v2/compare/service/s3/v1.29.5...service/s3/v1.30.0) --- updated-dependencies: - dependency-name: github.com/aws/aws-sdk-go-v2/service/s3control dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 38d0c2017520..55305b329f2f 100644 --- a/go.mod +++ b/go.mod @@ -28,7 +28,7 @@ require ( github.com/aws/aws-sdk-go-v2/service/resourceexplorer2 v1.2.6 github.com/aws/aws-sdk-go-v2/service/rolesanywhere v1.1.6 github.com/aws/aws-sdk-go-v2/service/route53domains v1.14.5 - github.com/aws/aws-sdk-go-v2/service/s3control v1.29.5 + github.com/aws/aws-sdk-go-v2/service/s3control v1.30.0 github.com/aws/aws-sdk-go-v2/service/scheduler v1.1.5 github.com/aws/aws-sdk-go-v2/service/sesv2 v1.17.1 github.com/aws/aws-sdk-go-v2/service/ssm v1.35.6 diff --git a/go.sum b/go.sum index c9f615dddf93..ffc3feeefeb3 100644 --- a/go.sum +++ b/go.sum @@ -96,8 +96,8 @@ github.com/aws/aws-sdk-go-v2/service/rolesanywhere v1.1.6 h1:Fzl9/XspAWWsgERARa8 github.com/aws/aws-sdk-go-v2/service/rolesanywhere v1.1.6/go.mod h1:PO0JAnohvB5VPwedVzpiY8ZGdgamnweWsx/+yi1jZxc= github.com/aws/aws-sdk-go-v2/service/route53domains v1.14.5 h1:W3jd8OfMmkr0lhMC3MNhMf7WxpXMoFs7rQwHryjzDQg= github.com/aws/aws-sdk-go-v2/service/route53domains v1.14.5/go.mod h1:fsgQ9e1bs7ZUgf64eTfsQFpP9iJJ13o33KJWIXnPI8s= -github.com/aws/aws-sdk-go-v2/service/s3control v1.29.5 h1:64MXeSwJp35lJ9kvP01EEYxI0uW5P+cOXBECFhLq9Og= -github.com/aws/aws-sdk-go-v2/service/s3control v1.29.5/go.mod h1:u9sP19O4PvfQMvFeScgmemf+YxSRkySPQNQgxQgDKNQ= +github.com/aws/aws-sdk-go-v2/service/s3control v1.30.0 h1:ysnqyS1zgHilP4jDlIEFouvq3EEWh5lWreEXUfRdqcM= +github.com/aws/aws-sdk-go-v2/service/s3control v1.30.0/go.mod h1:u9sP19O4PvfQMvFeScgmemf+YxSRkySPQNQgxQgDKNQ= github.com/aws/aws-sdk-go-v2/service/scheduler v1.1.5 h1:c4H0lPUXeo9XlMQ9fSskG8yYscq8/HNINnN3NlpQ2wI= github.com/aws/aws-sdk-go-v2/service/scheduler v1.1.5/go.mod h1:GNtZoju1It1f7xOjYzIu2dUEdd7sP75+boLldkGu4A4= github.com/aws/aws-sdk-go-v2/service/sesv2 v1.17.1 h1:dDF8EdHxS/1MN5qxyQhBChxybPHwOIRMFEevfU7PNls= From 10036f0d155c14e66aba0208aed5011be4ea89b9 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 14 Mar 2023 07:03:41 +0000 Subject: [PATCH 744/763] build(deps): bump github.com/aws/aws-sdk-go in /.ci/providerlint Bumps [github.com/aws/aws-sdk-go](https://github.com/aws/aws-sdk-go) from 1.44.219 to 1.44.220. - [Release notes](https://github.com/aws/aws-sdk-go/releases) - [Changelog](https://github.com/aws/aws-sdk-go/blob/main/CHANGELOG_PENDING.md) - [Commits](https://github.com/aws/aws-sdk-go/compare/v1.44.219...v1.44.220) --- updated-dependencies: - dependency-name: github.com/aws/aws-sdk-go dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- .ci/providerlint/go.mod | 2 +- .ci/providerlint/go.sum | 4 ++-- .../github.com/aws/aws-sdk-go/aws/endpoints/defaults.go | 3 +++ .ci/providerlint/vendor/modules.txt | 2 +- 4 files changed, 7 insertions(+), 4 deletions(-) diff --git a/.ci/providerlint/go.mod b/.ci/providerlint/go.mod index 40c077786dac..610f864ebe46 100644 --- a/.ci/providerlint/go.mod +++ b/.ci/providerlint/go.mod @@ -3,7 +3,7 @@ module github.com/hashicorp/terraform-provider-aws/ci/providerlint go 1.19 require ( - github.com/aws/aws-sdk-go v1.44.219 + github.com/aws/aws-sdk-go v1.44.220 github.com/bflad/tfproviderlint v0.28.1 github.com/hashicorp/terraform-plugin-sdk/v2 v2.25.0 golang.org/x/tools v0.1.12 diff --git a/.ci/providerlint/go.sum b/.ci/providerlint/go.sum index 7c04575cd598..1f4860f74b34 100644 --- a/.ci/providerlint/go.sum +++ b/.ci/providerlint/go.sum @@ -65,8 +65,8 @@ github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5/go.mod h1:wHh0iHkY github.com/aws/aws-sdk-go v1.15.78/go.mod h1:E3/ieXAlvM0XWO57iftYVDLLvQ824smPP3ATZkfNZeM= github.com/aws/aws-sdk-go v1.25.3/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo= github.com/aws/aws-sdk-go v1.37.0/go.mod h1:hcU610XS61/+aQV88ixoOzUoG7v3b31pl2zKMmprdro= -github.com/aws/aws-sdk-go v1.44.219 h1:YOFxTUQZvdRzgwb6XqLFRwNHxoUdKBuunITC7IFhvbc= -github.com/aws/aws-sdk-go v1.44.219/go.mod h1:aVsgQcEevwlmQ7qHE9I3h+dtQgpqhFB+i8Phjh7fkwI= +github.com/aws/aws-sdk-go v1.44.220 h1:yAj99qAt0Htjle9Up3DglgHfOP77lmFPrElA4jKnrBo= +github.com/aws/aws-sdk-go v1.44.220/go.mod h1:aVsgQcEevwlmQ7qHE9I3h+dtQgpqhFB+i8Phjh7fkwI= github.com/bflad/gopaniccheck v0.1.0 h1:tJftp+bv42ouERmUMWLoUn/5bi/iQZjHPznM00cP/bU= github.com/bflad/gopaniccheck v0.1.0/go.mod h1:ZCj2vSr7EqVeDaqVsWN4n2MwdROx1YL+LFo47TSWtsA= github.com/bflad/tfproviderlint v0.28.1 h1:7f54/ynV6/lK5/1EyG7tHtc4sMdjJSEFGjZNRJKwBs8= diff --git a/.ci/providerlint/vendor/github.com/aws/aws-sdk-go/aws/endpoints/defaults.go b/.ci/providerlint/vendor/github.com/aws/aws-sdk-go/aws/endpoints/defaults.go index f90062d1d705..1bfcbd976426 100644 --- a/.ci/providerlint/vendor/github.com/aws/aws-sdk-go/aws/endpoints/defaults.go +++ b/.ci/providerlint/vendor/github.com/aws/aws-sdk-go/aws/endpoints/defaults.go @@ -21664,6 +21664,9 @@ var awsPartition = partition{ endpointKey{ Region: "eu-central-1", }: endpoint{}, + endpointKey{ + Region: "eu-central-2", + }: endpoint{}, endpointKey{ Region: "eu-north-1", }: endpoint{}, diff --git a/.ci/providerlint/vendor/modules.txt b/.ci/providerlint/vendor/modules.txt index 6f4a61748563..3ccc3a61f091 100644 --- a/.ci/providerlint/vendor/modules.txt +++ b/.ci/providerlint/vendor/modules.txt @@ -4,7 +4,7 @@ github.com/agext/levenshtein # github.com/apparentlymart/go-textseg/v13 v13.0.0 ## explicit; go 1.16 github.com/apparentlymart/go-textseg/v13/textseg -# github.com/aws/aws-sdk-go v1.44.219 +# github.com/aws/aws-sdk-go v1.44.220 ## explicit; go 1.11 github.com/aws/aws-sdk-go/aws/awserr github.com/aws/aws-sdk-go/aws/endpoints From 7f71ce743e1cecaed595d0245bd65a5c4302b7ad Mon Sep 17 00:00:00 2001 From: changelogbot Date: Tue, 14 Mar 2023 11:11:06 +0000 Subject: [PATCH 745/763] Update CHANGELOG.md for #29981 --- CHANGELOG.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index a1bcb3a419b9..b0a5c10da13a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,12 +9,15 @@ FEATURES: ENHANCEMENTS: * data-source/aws_ce_cost_category: Add `default_value` attribute ([#29291](https://github.com/hashicorp/terraform-provider-aws/issues/29291)) +* data-source/aws_dynamodb_table: Add `deletion_protection_enabled` attribute ([#29924](https://github.com/hashicorp/terraform-provider-aws/issues/29924)) * resource/aws_appflow_flow: Add attribute `preserve_source_data_typing` to `s3_output_format_config` in `s3` ([#27616](https://github.com/hashicorp/terraform-provider-aws/issues/27616)) * resource/aws_batch_compute_environment: Allow a maximum of 2 `compute_resources.ec2_configuration`s ([#27207](https://github.com/hashicorp/terraform-provider-aws/issues/27207)) * resource/aws_cognito_user_pool_domain: Add `cloudfront_distribution` and `cloudfront_distribution_zone_id` attributes ([#27790](https://github.com/hashicorp/terraform-provider-aws/issues/27790)) +* resource/aws_dynamodb_table: Add `deletion_protection_enabled` argument ([#29924](https://github.com/hashicorp/terraform-provider-aws/issues/29924)) * resource/aws_ecs_task_definition: Add `arn_without_revision` attribute ([#27351](https://github.com/hashicorp/terraform-provider-aws/issues/27351)) * resource/aws_fms_policy: Add `description` argument ([#29926](https://github.com/hashicorp/terraform-provider-aws/issues/29926)) * resource/aws_glue_crawler: Add `create_native_delta_table` attribute to the `delta_target` configuration block ([#29566](https://github.com/hashicorp/terraform-provider-aws/issues/29566)) +* resource/aws_inspector2_organization_configuration: Add `lambda` attribute to `auto_enable` configuration block ([#28961](https://github.com/hashicorp/terraform-provider-aws/issues/28961)) * resource/aws_instance: Add ability to update `private_dns_name_options` in place ([#26305](https://github.com/hashicorp/terraform-provider-aws/issues/26305)) * resource/aws_qldb_ledger: Add configurable timeouts ([#29635](https://github.com/hashicorp/terraform-provider-aws/issues/29635)) * resource/aws_s3_bucket: Add error handling for `XNotImplemented` errors when reading `acceleration_status`, `request_payer`, `lifecycle_rule`, `logging`, or `replication_configuration` into terraform state. ([#29632](https://github.com/hashicorp/terraform-provider-aws/issues/29632)) From a5681aa55b2973ae63521de1fbec6ca2ea93faf5 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Tue, 14 Mar 2023 08:13:15 -0400 Subject: [PATCH 746/763] d/aws_vpc_public_ipv4_pools: Add acceptance tests. Acceptance test output: % make testacc TESTARGS='-run=TestAccEC2PublicIPv4PoolsDataSource_' PKG=ec2 ACCTEST_PARALLELISM=3 ==> Checking that code complies with gofmt requirements... TF_ACC=1 go test ./internal/service/ec2/... -v -count 1 -parallel 3 -run=TestAccEC2PublicIPv4PoolsDataSource_ -timeout 180m === RUN TestAccEC2PublicIPv4PoolsDataSource_basic === PAUSE TestAccEC2PublicIPv4PoolsDataSource_basic === RUN TestAccEC2PublicIPv4PoolsDataSource_tags === PAUSE TestAccEC2PublicIPv4PoolsDataSource_tags === CONT TestAccEC2PublicIPv4PoolsDataSource_basic === CONT TestAccEC2PublicIPv4PoolsDataSource_tags --- PASS: TestAccEC2PublicIPv4PoolsDataSource_basic (13.84s) --- PASS: TestAccEC2PublicIPv4PoolsDataSource_tags (13.85s) PASS ok github.com/hashicorp/terraform-provider-aws/internal/service/ec2 19.297s --- .../ec2/public_ipv4_pools_data_source_test.go | 64 +++++++++++++++++++ 1 file changed, 64 insertions(+) create mode 100644 internal/service/ec2/public_ipv4_pools_data_source_test.go diff --git a/internal/service/ec2/public_ipv4_pools_data_source_test.go b/internal/service/ec2/public_ipv4_pools_data_source_test.go new file mode 100644 index 000000000000..8f2f8de124e5 --- /dev/null +++ b/internal/service/ec2/public_ipv4_pools_data_source_test.go @@ -0,0 +1,64 @@ +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 TestAccEC2PublicIPv4PoolsDataSource_basic(t *testing.T) { + ctx := acctest.Context(t) + dataSourceName := "data.aws_vpc_public_ipv4_pools.test" + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { acctest.PreCheck(ctx, t) }, + ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + Steps: []resource.TestStep{ + { + Config: testPublicIPv4PoolsDataSourceConfig_basic, + Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttrSet(dataSourceName, "pool_ids.#"), + ), + }, + }, + }) +} + +func TestAccEC2PublicIPv4PoolsDataSource_tags(t *testing.T) { + ctx := acctest.Context(t) + dataSourceName := "data.aws_vpc_public_ipv4_pools.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, + Steps: []resource.TestStep{ + { + Config: testPublicIPv4PoolsDataSourceConfig_tags(rName), + Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttr(dataSourceName, "pool_ids.#", "0"), + ), + }, + }, + }) +} + +const testPublicIPv4PoolsDataSourceConfig_basic = ` +data "aws_vpc_public_ipv4_pools" "test" {} +` + +func testPublicIPv4PoolsDataSourceConfig_tags(rName string) string { + return fmt.Sprintf(` +data "aws_vpc_public_ipv4_pools" "test" { + tags = { + Name = %[1]q + } +} +`, rName) +} From fb016467e6f98f041b6e246ca895b66b7176f713 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 14 Mar 2023 12:20:53 +0000 Subject: [PATCH 747/763] build(deps): bump github.com/aws/aws-sdk-go from 1.44.219 to 1.44.220 Bumps [github.com/aws/aws-sdk-go](https://github.com/aws/aws-sdk-go) from 1.44.219 to 1.44.220. - [Release notes](https://github.com/aws/aws-sdk-go/releases) - [Changelog](https://github.com/aws/aws-sdk-go/blob/main/CHANGELOG_PENDING.md) - [Commits](https://github.com/aws/aws-sdk-go/compare/v1.44.219...v1.44.220) --- updated-dependencies: - dependency-name: github.com/aws/aws-sdk-go dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 55305b329f2f..0fc2d1193365 100644 --- a/go.mod +++ b/go.mod @@ -4,7 +4,7 @@ go 1.19 require ( github.com/ProtonMail/go-crypto v0.0.0-20230201104953-d1d05f4e2bfb - github.com/aws/aws-sdk-go v1.44.219 + github.com/aws/aws-sdk-go v1.44.220 github.com/aws/aws-sdk-go-v2 v1.17.6 github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.12.24 github.com/aws/aws-sdk-go-v2/service/auditmanager v1.24.2 diff --git a/go.sum b/go.sum index ffc3feeefeb3..e7af6c1e2425 100644 --- a/go.sum +++ b/go.sum @@ -23,8 +23,8 @@ github.com/apparentlymart/go-textseg/v13 v13.0.0/go.mod h1:ZK2fH7c4NqDTLtiYLvIkE github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310 h1:BUAU3CGlLvorLI26FmByPp2eC2qla6E1Tw+scpcg/to= github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5/go.mod h1:wHh0iHkYZB8zMSxRWpUBQtwG5a7fFgvEO+odwuTv2gs= -github.com/aws/aws-sdk-go v1.44.219 h1:YOFxTUQZvdRzgwb6XqLFRwNHxoUdKBuunITC7IFhvbc= -github.com/aws/aws-sdk-go v1.44.219/go.mod h1:aVsgQcEevwlmQ7qHE9I3h+dtQgpqhFB+i8Phjh7fkwI= +github.com/aws/aws-sdk-go v1.44.220 h1:yAj99qAt0Htjle9Up3DglgHfOP77lmFPrElA4jKnrBo= +github.com/aws/aws-sdk-go v1.44.220/go.mod h1:aVsgQcEevwlmQ7qHE9I3h+dtQgpqhFB+i8Phjh7fkwI= github.com/aws/aws-sdk-go-v2 v1.17.4/go.mod h1:uzbQtefpm44goOPmdKyAlXSNcwlRgF3ePWVW6EtJvvw= github.com/aws/aws-sdk-go-v2 v1.17.5/go.mod h1:uzbQtefpm44goOPmdKyAlXSNcwlRgF3ePWVW6EtJvvw= github.com/aws/aws-sdk-go-v2 v1.17.6 h1:Y773UK7OBqhzi5VDXMi1zVGsoj+CVHs2eaC2bDsLwi0= From 8fcaf500b01cc9043fb83f490b127181d06b3885 Mon Sep 17 00:00:00 2001 From: Simon Davis Date: Wed, 1 Mar 2023 08:30:18 -0800 Subject: [PATCH 748/763] replace version pin with SHA --- .github/workflows/acctest-terraform-lint.yml | 4 ++-- .github/workflows/changelog.yml | 2 +- .github/workflows/codeql-analysis.yml | 2 +- .github/workflows/dependencies.yml | 2 +- .github/workflows/documentation.yml | 6 +++--- .github/workflows/examples.yml | 4 ++-- .github/workflows/gen-teamcity.yml | 2 +- .github/workflows/generate_changelog.yml | 2 +- .github/workflows/golangci-lint.yml | 4 ++-- .github/workflows/goreleaser-ci.yml | 6 +++--- .github/workflows/milestone.yml | 2 +- .github/workflows/mkdocs.yml | 2 +- .github/workflows/providerlint.yml | 4 ++-- .github/workflows/pull_requests.yml | 4 ++-- .github/workflows/release.yml | 6 +++--- .github/workflows/semgrep-ci.yml | 14 +++++++------- .github/workflows/skaff.yml | 2 +- .github/workflows/snapshot.yml | 2 +- .github/workflows/terraform_provider.yml | 18 +++++++++--------- .github/workflows/website.yml | 14 +++++++------- .github/workflows/workflow-lint.yml | 2 +- .github/workflows/yamllint.yml | 2 +- 22 files changed, 53 insertions(+), 53 deletions(-) diff --git a/.github/workflows/acctest-terraform-lint.yml b/.github/workflows/acctest-terraform-lint.yml index 86f2ccfe3580..6e64dd6331f6 100644 --- a/.github/workflows/acctest-terraform-lint.yml +++ b/.github/workflows/acctest-terraform-lint.yml @@ -17,7 +17,7 @@ jobs: terrafmt: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c - uses: actions/setup-go@6edd4406fa81c3da01a34fa6f6343087c207a568 with: go-version-file: go.mod @@ -45,7 +45,7 @@ jobs: TEST_FILES_PARTITION: '\./internal/service/${{ matrix.path }}.*/.*_test\.go' steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c - uses: actions/setup-go@6edd4406fa81c3da01a34fa6f6343087c207a568 with: go-version-file: go.mod diff --git a/.github/workflows/changelog.yml b/.github/workflows/changelog.yml index 03c3c9ec00f8..22e35528331f 100644 --- a/.github/workflows/changelog.yml +++ b/.github/workflows/changelog.yml @@ -58,7 +58,7 @@ jobs: misspell: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c - uses: actions/setup-go@6edd4406fa81c3da01a34fa6f6343087c207a568 with: go-version-file: go.mod diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index e8c8a96f4aa6..dec70f163dac 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -31,7 +31,7 @@ jobs: steps: - name: Checkout repository - uses: actions/checkout@v3 + uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # Initializes the CodeQL tools for scanning. - name: Initialize CodeQL diff --git a/.github/workflows/dependencies.yml b/.github/workflows/dependencies.yml index d33ab1ce802c..0ad311ab766c 100644 --- a/.github/workflows/dependencies.yml +++ b/.github/workflows/dependencies.yml @@ -63,7 +63,7 @@ jobs: name: go mod runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c - uses: actions/setup-go@6edd4406fa81c3da01a34fa6f6343087c207a568 with: go-version-file: go.mod diff --git a/.github/workflows/documentation.yml b/.github/workflows/documentation.yml index fdad86debf47..f276468eda42 100644 --- a/.github/workflows/documentation.yml +++ b/.github/workflows/documentation.yml @@ -17,7 +17,7 @@ jobs: env: UV_THREADPOOL_SIZE: 128 steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c - uses: YakDriver/md-check-links@v2.0.5 with: use-quiet-mode: 'yes' @@ -30,14 +30,14 @@ jobs: markdown-lint: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c - uses: avto-dev/markdown-lint@v1 with: args: 'docs' misspell: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c - uses: actions/setup-go@6edd4406fa81c3da01a34fa6f6343087c207a568 with: go-version-file: go.mod diff --git a/.github/workflows/examples.yml b/.github/workflows/examples.yml index 6e7e901d8fd8..7f4aa1cf7854 100644 --- a/.github/workflows/examples.yml +++ b/.github/workflows/examples.yml @@ -18,7 +18,7 @@ jobs: tflint: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c with: fetch-depth: 0 - uses: actions/cache@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 @@ -67,7 +67,7 @@ jobs: env: TF_IN_AUTOMATION: "1" steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c with: fetch-depth: 0 - uses: actions/cache@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 diff --git a/.github/workflows/gen-teamcity.yml b/.github/workflows/gen-teamcity.yml index 3552f18c6f71..d417b78f6ffd 100644 --- a/.github/workflows/gen-teamcity.yml +++ b/.github/workflows/gen-teamcity.yml @@ -9,7 +9,7 @@ jobs: name: Validate TeamCity Configuration runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c - uses: actions/setup-java@v3 with: distribution: adopt diff --git a/.github/workflows/generate_changelog.yml b/.github/workflows/generate_changelog.yml index 9adc87b964a7..3a9f6bef0654 100644 --- a/.github/workflows/generate_changelog.yml +++ b/.github/workflows/generate_changelog.yml @@ -8,7 +8,7 @@ jobs: if: github.event.pull_request.merged || github.event_name == 'workflow_dispatch' runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c with: fetch-depth: 0 - run: cd .ci/tools && go install github.com/hashicorp/go-changelog/cmd/changelog-build diff --git a/.github/workflows/golangci-lint.yml b/.github/workflows/golangci-lint.yml index ff33bf63ccb4..9f42519cad54 100644 --- a/.github/workflows/golangci-lint.yml +++ b/.github/workflows/golangci-lint.yml @@ -20,7 +20,7 @@ jobs: name: 1 of 2 runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c - uses: actions/setup-go@6edd4406fa81c3da01a34fa6f6343087c207a568 with: go-version-file: go.mod @@ -34,7 +34,7 @@ jobs: needs: [golangci-linta] runs-on: [custom, linux, large] steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c - uses: actions/setup-go@6edd4406fa81c3da01a34fa6f6343087c207a568 with: go-version-file: go.mod diff --git a/.github/workflows/goreleaser-ci.yml b/.github/workflows/goreleaser-ci.yml index 547f847f72cd..bc18833e0426 100644 --- a/.github/workflows/goreleaser-ci.yml +++ b/.github/workflows/goreleaser-ci.yml @@ -23,7 +23,7 @@ jobs: outputs: goreleaser: ${{ steps.filter.outputs.goreleaser }} steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c - uses: dorny/paths-filter@v2 id: filter with: @@ -37,7 +37,7 @@ jobs: if: ${{ needs.changes.outputs.goreleaser == 'true' }} runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c - uses: actions/setup-go@6edd4406fa81c3da01a34fa6f6343087c207a568 with: go-version-file: go.mod @@ -57,7 +57,7 @@ jobs: # Ref: https://github.com/hashicorp/terraform-provider-aws/issues/8988 runs-on: [custom, linux, small] steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c - uses: actions/setup-go@6edd4406fa81c3da01a34fa6f6343087c207a568 with: go-version-file: go.mod diff --git a/.github/workflows/milestone.yml b/.github/workflows/milestone.yml index 8a7445fc3e3c..c3e5b08c5060 100644 --- a/.github/workflows/milestone.yml +++ b/.github/workflows/milestone.yml @@ -7,7 +7,7 @@ jobs: if: github.event.pull_request.merged runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c with: ref: ${{ github.event.pull_request.base.ref }} - id: get-current-milestone diff --git a/.github/workflows/mkdocs.yml b/.github/workflows/mkdocs.yml index df61e284321b..0b3c27421f61 100644 --- a/.github/workflows/mkdocs.yml +++ b/.github/workflows/mkdocs.yml @@ -11,7 +11,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout main - uses: actions/checkout@v3 + uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c - name: Deploy docs uses: mhausenblas/mkdocs-deploy-gh-pages@master diff --git a/.github/workflows/providerlint.yml b/.github/workflows/providerlint.yml index ba4cd66d72a2..24c6a8881bf3 100644 --- a/.github/workflows/providerlint.yml +++ b/.github/workflows/providerlint.yml @@ -19,7 +19,7 @@ jobs: name: 1 of 2 runs-on: [custom, linux, small] steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c - uses: actions/setup-go@6edd4406fa81c3da01a34fa6f6343087c207a568 with: go-version-file: go.mod @@ -44,7 +44,7 @@ jobs: needs: [providerlinta] runs-on: [custom, linux, medium] steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c - uses: actions/setup-go@6edd4406fa81c3da01a34fa6f6343087c207a568 with: go-version-file: go.mod diff --git a/.github/workflows/pull_requests.yml b/.github/workflows/pull_requests.yml index e1fffb74f523..8fbcac9d4266 100644 --- a/.github/workflows/pull_requests.yml +++ b/.github/workflows/pull_requests.yml @@ -10,7 +10,7 @@ jobs: Labeler: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c - name: Apply Labels uses: actions/labeler@v4 with: @@ -19,7 +19,7 @@ jobs: NeedsTriageLabeler: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c - name: Apply needs-triage Label uses: actions/labeler@v4 if: github.event.action == 'opened' && env.IN_MAINTAINER_LIST == 'false' diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 03dd0a6918a0..1b41d1dba0a8 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -12,7 +12,7 @@ jobs: release-notes: runs-on: macos-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c with: fetch-depth: 0 - name: Generate Release Notes @@ -48,7 +48,7 @@ jobs: outputs: tag: ${{ steps.highest-version-tag.outputs.tag }} steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c with: # Allow tag to be fetched when ref is a commit fetch-depth: 0 @@ -66,7 +66,7 @@ jobs: if: github.ref_name == needs.highest-version-tag.outputs.tag runs-on: macos-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c with: fetch-depth: 0 ref: main diff --git a/.github/workflows/semgrep-ci.yml b/.github/workflows/semgrep-ci.yml index f83d1d93b7c7..9cb458d194b1 100644 --- a/.github/workflows/semgrep-ci.yml +++ b/.github/workflows/semgrep-ci.yml @@ -23,7 +23,7 @@ jobs: container: image: returntocorp/semgrep steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c - run: | semgrep $COMMON_PARAMS \ --config .ci/.semgrep.yml \ @@ -42,7 +42,7 @@ jobs: image: returntocorp/semgrep if: (github.action != 'dependabot[bot]') steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c - run: semgrep $COMMON_PARAMS --config .ci/.semgrep-caps-aws-ec2.yml naming_tests: @@ -52,7 +52,7 @@ jobs: image: returntocorp/semgrep if: (github.action != 'dependabot[bot]') steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c - run: semgrep $COMMON_PARAMS --config .ci/.semgrep-configs.yml naming_semgrep0: @@ -62,7 +62,7 @@ jobs: image: returntocorp/semgrep if: (github.action != 'dependabot[bot]') steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c - run: semgrep $COMMON_PARAMS --config .ci/.semgrep-service-name0.yml naming_semgrep1: @@ -72,7 +72,7 @@ jobs: image: returntocorp/semgrep if: (github.action != 'dependabot[bot]') steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c - run: semgrep $COMMON_PARAMS --config .ci/.semgrep-service-name1.yml naming_semgrep2: @@ -82,7 +82,7 @@ jobs: image: returntocorp/semgrep if: (github.action != 'dependabot[bot]') steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c - run: semgrep $COMMON_PARAMS --config .ci/.semgrep-service-name2.yml naming_semgrep3: @@ -92,5 +92,5 @@ jobs: image: returntocorp/semgrep if: (github.action != 'dependabot[bot]') steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c - run: semgrep $COMMON_PARAMS --config .ci/.semgrep-service-name3.yml diff --git a/.github/workflows/skaff.yml b/.github/workflows/skaff.yml index 19a5bd84a859..5ce5614af7f6 100644 --- a/.github/workflows/skaff.yml +++ b/.github/workflows/skaff.yml @@ -15,7 +15,7 @@ jobs: name: Compile skaff runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c with: fetch-depth: 0 - uses: actions/setup-go@6edd4406fa81c3da01a34fa6f6343087c207a568 diff --git a/.github/workflows/snapshot.yml b/.github/workflows/snapshot.yml index ee8ce58abef2..aabd2c33c066 100644 --- a/.github/workflows/snapshot.yml +++ b/.github/workflows/snapshot.yml @@ -9,7 +9,7 @@ jobs: goreleaser: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c - uses: actions/setup-go@6edd4406fa81c3da01a34fa6f6343087c207a568 with: go-version-file: go.mod diff --git a/.github/workflows/terraform_provider.yml b/.github/workflows/terraform_provider.yml index 69ec35b62b2a..2c3dfdd64a58 100644 --- a/.github/workflows/terraform_provider.yml +++ b/.github/workflows/terraform_provider.yml @@ -32,7 +32,7 @@ jobs: name: go mod download runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c - uses: actions/setup-go@6edd4406fa81c3da01a34fa6f6343087c207a568 with: go-version-file: go.mod @@ -51,7 +51,7 @@ jobs: needs: [go_mod_download] runs-on: [custom, linux, medium] steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c - uses: actions/cache@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 continue-on-error: true id: cache-terraform-plugin-dir @@ -87,7 +87,7 @@ jobs: needs: [go_build] runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c - uses: actions/setup-go@6edd4406fa81c3da01a34fa6f6343087c207a568 with: go-version-file: go.mod @@ -119,7 +119,7 @@ jobs: needs: [go_build] runs-on: [custom, linux, large] steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c with: fetch-depth: 0 - uses: actions/setup-go@6edd4406fa81c3da01a34fa6f6343087c207a568 @@ -148,7 +148,7 @@ jobs: needs: [go_build] runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c - uses: actions/setup-go@6edd4406fa81c3da01a34fa6f6343087c207a568 with: go-version-file: go.mod @@ -176,7 +176,7 @@ jobs: needs: [go_build] runs-on: [custom, linux, medium] steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c with: fetch-depth: 0 - uses: actions/setup-go@6edd4406fa81c3da01a34fa6f6343087c207a568 @@ -206,7 +206,7 @@ jobs: needs: [go_build] runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c - uses: actions/cache@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 continue-on-error: true id: cache-terraform-providers-schema @@ -241,7 +241,7 @@ jobs: needs: [terraform_providers_schema] runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c - uses: actions/setup-go@6edd4406fa81c3da01a34fa6f6343087c207a568 with: go-version-file: go.mod @@ -271,7 +271,7 @@ jobs: markdown-lint: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c - uses: avto-dev/markdown-lint@v1 with: args: '.' diff --git a/.github/workflows/website.yml b/.github/workflows/website.yml index 2e47a4195ab8..6e2c06466740 100644 --- a/.github/workflows/website.yml +++ b/.github/workflows/website.yml @@ -20,7 +20,7 @@ jobs: markdown-link-check-a-h-markdown: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c - uses: YakDriver/md-check-links@v2.0.5 name: markdown-link-check website/docs/**/[a-h].markdown with: @@ -36,7 +36,7 @@ jobs: markdown-link-check-i-z-markdown: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c - uses: YakDriver/md-check-links@v2.0.5 name: markdown-link-check website/docs/**/[i-z].markdown with: @@ -52,7 +52,7 @@ jobs: markdown-link-check-md: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c - uses: YakDriver/md-check-links@v2.0.5 name: markdown-link-check website/docs/**/*.md with: @@ -67,7 +67,7 @@ jobs: markdown-lint: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c - uses: avto-dev/markdown-lint@v1 with: args: "website/docs" @@ -75,7 +75,7 @@ jobs: misspell: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c - uses: actions/setup-go@6edd4406fa81c3da01a34fa6f6343087c207a568 with: go-version-file: .ci/tools/go.mod @@ -91,7 +91,7 @@ jobs: terrafmt: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c - uses: actions/setup-go@6edd4406fa81c3da01a34fa6f6343087c207a568 with: go-version-file: .ci/tools/go.mod @@ -107,7 +107,7 @@ jobs: tflint: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c with: fetch-depth: 0 - uses: actions/setup-go@6edd4406fa81c3da01a34fa6f6343087c207a568 diff --git a/.github/workflows/workflow-lint.yml b/.github/workflows/workflow-lint.yml index 0b2eb11935f6..8caf25860521 100644 --- a/.github/workflows/workflow-lint.yml +++ b/.github/workflows/workflow-lint.yml @@ -12,7 +12,7 @@ jobs: actionlint: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c - uses: actions/setup-go@6edd4406fa81c3da01a34fa6f6343087c207a568 with: go-version-file: .ci/tools/go.mod diff --git a/.github/workflows/yamllint.yml b/.github/workflows/yamllint.yml index 6517158178e1..c431eae10746 100644 --- a/.github/workflows/yamllint.yml +++ b/.github/workflows/yamllint.yml @@ -12,7 +12,7 @@ jobs: yamllint: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c - name: Run yamllint uses: ibiqlik/action-yamllint@v3 with: From 70094b3fe9ab3aab64eb8f16ed3ee5e23e30af9c Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Tue, 14 Mar 2023 08:31:11 -0400 Subject: [PATCH 749/763] d/aws_vpc_public_ipv4_pool: Add acceptance tests. Acceptance test output: % make testacc TESTARGS='-run=TestAccEC2PublicIPv4PoolDataSource_' PKG=ec2 ACCTEST_PARALLELISM=3 ==> Checking that code complies with gofmt requirements... TF_ACC=1 go test ./internal/service/ec2/... -v -count 1 -parallel 3 -run=TestAccEC2PublicIPv4PoolDataSource_ -timeout 180m === RUN TestAccEC2PublicIPv4PoolDataSource_basic === PAUSE TestAccEC2PublicIPv4PoolDataSource_basic === CONT TestAccEC2PublicIPv4PoolDataSource_basic public_ipv4_pool_data_source_test.go:49: skipping since no EC2 Public IPv4 Pools found --- SKIP: TestAccEC2PublicIPv4PoolDataSource_basic (0.88s) PASS ok github.com/hashicorp/terraform-provider-aws/internal/service/ec2 7.321s --- .../ec2/public_ipv4_pool_data_source_test.go | 59 +++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100644 internal/service/ec2/public_ipv4_pool_data_source_test.go diff --git a/internal/service/ec2/public_ipv4_pool_data_source_test.go b/internal/service/ec2/public_ipv4_pool_data_source_test.go new file mode 100644 index 000000000000..18815263d352 --- /dev/null +++ b/internal/service/ec2/public_ipv4_pool_data_source_test.go @@ -0,0 +1,59 @@ +package ec2_test + +import ( + "context" + "testing" + + "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" + "github.com/hashicorp/terraform-provider-aws/internal/conns" + tfec2 "github.com/hashicorp/terraform-provider-aws/internal/service/ec2" +) + +func TestAccEC2PublicIPv4PoolDataSource_basic(t *testing.T) { + ctx := acctest.Context(t) + dataSourceName := "data.aws_vpc_public_ipv4_pool.test" + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckPublicIPv4Pools(ctx, t) }, + ErrorCheck: acctest.ErrorCheck(t, ec2.EndpointsID), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + Steps: []resource.TestStep{ + { + Config: testPublicIPv4PoolDataSourceConfig_basic, + Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttrSet(dataSourceName, "total_address_count"), + resource.TestCheckResourceAttrSet(dataSourceName, "total_available_address_count"), + ), + }, + }, + }) +} + +func testAccPreCheckPublicIPv4Pools(ctx context.Context, t *testing.T) { + conn := acctest.Provider.Meta().(*conns.AWSClient).EC2Conn() + + output, err := tfec2.FindPublicIPv4Pools(ctx, conn, &ec2.DescribePublicIpv4PoolsInput{}) + + if acctest.PreCheckSkipError(err) { + t.Skipf("skipping acceptance testing: %s", err) + } + + if err != nil { + t.Fatalf("unexpected PreCheck error: %s", err) + } + + // Ensure there is at least one pool. + if len(output) == 0 { + t.Skip("skipping since no EC2 Public IPv4 Pools found") + } +} + +const testPublicIPv4PoolDataSourceConfig_basic = ` +data "aws_vpc_public_ipv4_pools" "test" {} + +data "aws_vpc_public_ipv4_pool" "test" { + pool_id = data.aws_vpc_public_ipv4_pools.test.pool_ids[0] +} +` From f7d36e91e7892fb58440461eef617e565b8e67ec Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Tue, 14 Mar 2023 08:40:01 -0400 Subject: [PATCH 750/763] 'aws_vpc_public_ipv4_pools' -> 'aws_ec2_public_ipv4_pools'. --- .changelog/28245.txt | 2 +- ...ource.go => ec2_public_ipv4_pools_data_source.go} | 2 +- ....go => ec2_public_ipv4_pools_data_source_test.go} | 8 ++++---- .../service/ec2/public_ipv4_pool_data_source_test.go | 4 ++-- internal/service/ec2/service_package_gen.go | 8 ++++---- ....markdown => ec2_public_ipv4_pools.html.markdown} | 12 ++++++------ 6 files changed, 18 insertions(+), 18 deletions(-) rename internal/service/ec2/{public_ipv4_pools_data_source.go => ec2_public_ipv4_pools_data_source.go} (97%) rename internal/service/ec2/{public_ipv4_pools_data_source_test.go => ec2_public_ipv4_pools_data_source_test.go} (89%) rename website/docs/d/{public_ipv4_pools.html.markdown => ec2_public_ipv4_pools.html.markdown} (72%) diff --git a/.changelog/28245.txt b/.changelog/28245.txt index 3679718020e5..f8c3c0121488 100644 --- a/.changelog/28245.txt +++ b/.changelog/28245.txt @@ -1,5 +1,5 @@ ```release-note:new-data-source -aws_vpc_public_ipv4_pools +aws_ec2_public_ipv4_pools ``` ```release-note:new-data-source diff --git a/internal/service/ec2/public_ipv4_pools_data_source.go b/internal/service/ec2/ec2_public_ipv4_pools_data_source.go similarity index 97% rename from internal/service/ec2/public_ipv4_pools_data_source.go rename to internal/service/ec2/ec2_public_ipv4_pools_data_source.go index ee4d0d09e58f..f5cf7cb8f65f 100644 --- a/internal/service/ec2/public_ipv4_pools_data_source.go +++ b/internal/service/ec2/ec2_public_ipv4_pools_data_source.go @@ -12,7 +12,7 @@ import ( tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" ) -// @SDKDataSource("aws_vpc_public_ipv4_pools") +// @SDKDataSource("aws_ec2_public_ipv4_pools") func DataSourcePublicIPv4Pools() *schema.Resource { return &schema.Resource{ ReadWithoutTimeout: dataSourcePublicIpv4PoolsRead, diff --git a/internal/service/ec2/public_ipv4_pools_data_source_test.go b/internal/service/ec2/ec2_public_ipv4_pools_data_source_test.go similarity index 89% rename from internal/service/ec2/public_ipv4_pools_data_source_test.go rename to internal/service/ec2/ec2_public_ipv4_pools_data_source_test.go index 8f2f8de124e5..8ae2ee7c74e6 100644 --- a/internal/service/ec2/public_ipv4_pools_data_source_test.go +++ b/internal/service/ec2/ec2_public_ipv4_pools_data_source_test.go @@ -12,7 +12,7 @@ import ( func TestAccEC2PublicIPv4PoolsDataSource_basic(t *testing.T) { ctx := acctest.Context(t) - dataSourceName := "data.aws_vpc_public_ipv4_pools.test" + dataSourceName := "data.aws_ec2_public_ipv4_pools.test" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { acctest.PreCheck(ctx, t) }, @@ -31,7 +31,7 @@ func TestAccEC2PublicIPv4PoolsDataSource_basic(t *testing.T) { func TestAccEC2PublicIPv4PoolsDataSource_tags(t *testing.T) { ctx := acctest.Context(t) - dataSourceName := "data.aws_vpc_public_ipv4_pools.test" + dataSourceName := "data.aws_ec2_public_ipv4_pools.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ @@ -50,12 +50,12 @@ func TestAccEC2PublicIPv4PoolsDataSource_tags(t *testing.T) { } const testPublicIPv4PoolsDataSourceConfig_basic = ` -data "aws_vpc_public_ipv4_pools" "test" {} +data "aws_ec2_public_ipv4_pools" "test" {} ` func testPublicIPv4PoolsDataSourceConfig_tags(rName string) string { return fmt.Sprintf(` -data "aws_vpc_public_ipv4_pools" "test" { +data "aws_ec2_public_ipv4_pools" "test" { tags = { Name = %[1]q } diff --git a/internal/service/ec2/public_ipv4_pool_data_source_test.go b/internal/service/ec2/public_ipv4_pool_data_source_test.go index 18815263d352..aa89e8f0d94b 100644 --- a/internal/service/ec2/public_ipv4_pool_data_source_test.go +++ b/internal/service/ec2/public_ipv4_pool_data_source_test.go @@ -51,9 +51,9 @@ func testAccPreCheckPublicIPv4Pools(ctx context.Context, t *testing.T) { } const testPublicIPv4PoolDataSourceConfig_basic = ` -data "aws_vpc_public_ipv4_pools" "test" {} +data "aws_ec2_public_ipv4_pools" "test" {} data "aws_vpc_public_ipv4_pool" "test" { - pool_id = data.aws_vpc_public_ipv4_pools.test.pool_ids[0] + pool_id = data.aws_ec2_public_ipv4_pools.test.pool_ids[0] } ` diff --git a/internal/service/ec2/service_package_gen.go b/internal/service/ec2/service_package_gen.go index 0e41645e9b4a..9f1a95193528 100644 --- a/internal/service/ec2/service_package_gen.go +++ b/internal/service/ec2/service_package_gen.go @@ -155,6 +155,10 @@ func (p *servicePackage) SDKDataSources(ctx context.Context) []*types.ServicePac Factory: DataSourceNetworkInsightsPath, TypeName: "aws_ec2_network_insights_path", }, + { + Factory: DataSourcePublicIPv4Pools, + TypeName: "aws_ec2_public_ipv4_pools", + }, { Factory: DataSourceSerialConsoleAccess, TypeName: "aws_ec2_serial_console_access", @@ -339,10 +343,6 @@ func (p *servicePackage) SDKDataSources(ctx context.Context) []*types.ServicePac Factory: DataSourcePublicIPv4Pool, TypeName: "aws_vpc_public_ipv4_pool", }, - { - Factory: DataSourcePublicIPv4Pools, - TypeName: "aws_vpc_public_ipv4_pools", - }, { Factory: DataSourceVPCs, TypeName: "aws_vpcs", diff --git a/website/docs/d/public_ipv4_pools.html.markdown b/website/docs/d/ec2_public_ipv4_pools.html.markdown similarity index 72% rename from website/docs/d/public_ipv4_pools.html.markdown rename to website/docs/d/ec2_public_ipv4_pools.html.markdown index 149d986f4bd7..1ba41450122b 100644 --- a/website/docs/d/public_ipv4_pools.html.markdown +++ b/website/docs/d/ec2_public_ipv4_pools.html.markdown @@ -1,14 +1,14 @@ --- -subcategory: "VPC (Virtual Private Cloud)" +subcategory: "EC2 (Elastic Compute Cloud)" layout: "aws" -page_title: "AWS: aws_vpc_public_ipv4_pools" +page_title: "AWS: aws_ec2_public_ipv4_pools" description: |- - Terraform data source for getting information about AWS VPC (Virtual Private Cloud) Public IPv4 Pools. + Terraform data source for getting information about AWS EC2 Public IPv4 Pools. --- # Data Source: aws_ec2_public_ipv4_pools -Terraform data source for getting information about AWS VPC (Virtual Private Cloud) Public IPv4 Pools. +Terraform data source for getting information about AWS EC2 Public IPv4 Pools. ## Example Usage @@ -16,12 +16,12 @@ Terraform data source for getting information about AWS VPC (Virtual Private Clo ```terraform # Returns all public IPv4 pools. -data "aws_vpc_public_ipv4_pools" "example" {} +data "aws_ec2_public_ipv4_pools" "example" {} ``` ### Usage with Filter ```terraform -data "aws_vpc_public_ipv4_pools" "example" { +data "aws_ec2_public_ipv4_pools" "example" { filter { name = "tag-key" values = ["ExampleTagKey"] From 55775308cae5297e7c847ec96c0f6d088962c0f9 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Tue, 14 Mar 2023 08:43:59 -0400 Subject: [PATCH 751/763] 'aws_vpc_public_ipv4_pool' -> 'aws_ec2_public_ipv4_pool'. --- .changelog/28245.txt | 2 +- ...a_source.go => ec2_public_ipv4_pool_data_source.go} | 2 +- ...est.go => ec2_public_ipv4_pool_data_source_test.go} | 4 ++-- internal/service/ec2/service_package_gen.go | 8 ++++---- ...tml.markdown => ec2_public_ipv4_pool.html.markdown} | 10 +++++----- 5 files changed, 13 insertions(+), 13 deletions(-) rename internal/service/ec2/{public_ipv4_pool_data_source.go => ec2_public_ipv4_pool_data_source.go} (98%) rename internal/service/ec2/{public_ipv4_pool_data_source_test.go => ec2_public_ipv4_pool_data_source_test.go} (94%) rename website/docs/d/{public_ipv4_pool.html.markdown => ec2_public_ipv4_pool.html.markdown} (79%) diff --git a/.changelog/28245.txt b/.changelog/28245.txt index f8c3c0121488..58dc5465387c 100644 --- a/.changelog/28245.txt +++ b/.changelog/28245.txt @@ -3,5 +3,5 @@ aws_ec2_public_ipv4_pools ``` ```release-note:new-data-source -aws_vpc_public_ipv4_pool +aws_ec2_public_ipv4_pool ``` \ No newline at end of file diff --git a/internal/service/ec2/public_ipv4_pool_data_source.go b/internal/service/ec2/ec2_public_ipv4_pool_data_source.go similarity index 98% rename from internal/service/ec2/public_ipv4_pool_data_source.go rename to internal/service/ec2/ec2_public_ipv4_pool_data_source.go index f8e2afb6bcba..b3a46bd2eaed 100644 --- a/internal/service/ec2/public_ipv4_pool_data_source.go +++ b/internal/service/ec2/ec2_public_ipv4_pool_data_source.go @@ -12,7 +12,7 @@ import ( tftags "github.com/hashicorp/terraform-provider-aws/internal/tags" ) -// @SDKDataSource("aws_vpc_public_ipv4_pool") +// @SDKDataSource("aws_ec2_public_ipv4_pool") func DataSourcePublicIPv4Pool() *schema.Resource { return &schema.Resource{ ReadWithoutTimeout: dataSourcePublicIpv4PoolRead, diff --git a/internal/service/ec2/public_ipv4_pool_data_source_test.go b/internal/service/ec2/ec2_public_ipv4_pool_data_source_test.go similarity index 94% rename from internal/service/ec2/public_ipv4_pool_data_source_test.go rename to internal/service/ec2/ec2_public_ipv4_pool_data_source_test.go index aa89e8f0d94b..95039a4c65a9 100644 --- a/internal/service/ec2/public_ipv4_pool_data_source_test.go +++ b/internal/service/ec2/ec2_public_ipv4_pool_data_source_test.go @@ -13,7 +13,7 @@ import ( func TestAccEC2PublicIPv4PoolDataSource_basic(t *testing.T) { ctx := acctest.Context(t) - dataSourceName := "data.aws_vpc_public_ipv4_pool.test" + dataSourceName := "data.aws_ec2_public_ipv4_pool.test" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheckPublicIPv4Pools(ctx, t) }, @@ -53,7 +53,7 @@ func testAccPreCheckPublicIPv4Pools(ctx context.Context, t *testing.T) { const testPublicIPv4PoolDataSourceConfig_basic = ` data "aws_ec2_public_ipv4_pools" "test" {} -data "aws_vpc_public_ipv4_pool" "test" { +data "aws_ec2_public_ipv4_pool" "test" { pool_id = data.aws_ec2_public_ipv4_pools.test.pool_ids[0] } ` diff --git a/internal/service/ec2/service_package_gen.go b/internal/service/ec2/service_package_gen.go index 9f1a95193528..835f6a571d61 100644 --- a/internal/service/ec2/service_package_gen.go +++ b/internal/service/ec2/service_package_gen.go @@ -155,6 +155,10 @@ func (p *servicePackage) SDKDataSources(ctx context.Context) []*types.ServicePac Factory: DataSourceNetworkInsightsPath, TypeName: "aws_ec2_network_insights_path", }, + { + Factory: DataSourcePublicIPv4Pool, + TypeName: "aws_ec2_public_ipv4_pool", + }, { Factory: DataSourcePublicIPv4Pools, TypeName: "aws_ec2_public_ipv4_pools", @@ -339,10 +343,6 @@ func (p *servicePackage) SDKDataSources(ctx context.Context) []*types.ServicePac Factory: DataSourceVPCPeeringConnections, TypeName: "aws_vpc_peering_connections", }, - { - Factory: DataSourcePublicIPv4Pool, - TypeName: "aws_vpc_public_ipv4_pool", - }, { Factory: DataSourceVPCs, TypeName: "aws_vpcs", diff --git a/website/docs/d/public_ipv4_pool.html.markdown b/website/docs/d/ec2_public_ipv4_pool.html.markdown similarity index 79% rename from website/docs/d/public_ipv4_pool.html.markdown rename to website/docs/d/ec2_public_ipv4_pool.html.markdown index 8674dca7cef9..09805cf1b5c5 100644 --- a/website/docs/d/public_ipv4_pool.html.markdown +++ b/website/docs/d/ec2_public_ipv4_pool.html.markdown @@ -1,21 +1,21 @@ --- -subcategory: "VPC (Virtual Private Cloud)" +subcategory: "EC2 (Elastic Compute Cloud)" layout: "aws" -page_title: "AWS: aws_vpc_public_ipv4_pool" +page_title: "AWS: aws_ec2_public_ipv4_pool" description: |- - Provides details about a specific AWS VPC (Virtual Private Cloud) Public IPv4 Pool. + Provides details about a specific AWS EC2 Public IPv4 Pool. --- # Data Source: aws_ec2_public_ipv4_pool -Provides details about a specific AWS VPC (Virtual Private Cloud) Public IPv4 Pool. +Provides details about a specific AWS EC2 Public IPv4 Pool. ## Example Usage ### Basic Usage ```terraform -data "aws_vpc_public_ipv4_pool" "example" { +data "aws_ec2_public_ipv4_pool" "example" { pool_id = "ipv4pool-ec2-000df99cff0c1ec10" } ``` From a27be32bebc9d1e6aace31ce1ba53a378bc0fcda Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Tue, 14 Mar 2023 08:51:48 -0400 Subject: [PATCH 752/763] Fix semgrep 'ci.semgrep.migrate.aws-api-context'. --- internal/service/ec2/find.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/service/ec2/find.go b/internal/service/ec2/find.go index 1be25c959e75..2373b2a325b4 100644 --- a/internal/service/ec2/find.go +++ b/internal/service/ec2/find.go @@ -1278,7 +1278,7 @@ func FindPublicIPv4Pool(ctx context.Context, conn *ec2.EC2, input *ec2.DescribeP func FindPublicIPv4Pools(ctx context.Context, conn *ec2.EC2, input *ec2.DescribePublicIpv4PoolsInput) ([]*ec2.PublicIpv4Pool, error) { var output []*ec2.PublicIpv4Pool - err := conn.DescribePublicIpv4PoolsPages(input, func(page *ec2.DescribePublicIpv4PoolsOutput, lastPage bool) bool { + err := conn.DescribePublicIpv4PoolsPagesWithContext(ctx, input, func(page *ec2.DescribePublicIpv4PoolsOutput, lastPage bool) bool { if page == nil { return !lastPage } From a907712b0a6035e6790af2da4b6734cf0b6e7393 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Tue, 14 Mar 2023 08:53:56 -0400 Subject: [PATCH 753/763] Fix semgrep 'ci.caps5-in-func-name'. --- .../service/ec2/ec2_public_ipv4_pool_data_source.go | 12 ++++++------ .../service/ec2/ec2_public_ipv4_pools_data_source.go | 4 ++-- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/internal/service/ec2/ec2_public_ipv4_pool_data_source.go b/internal/service/ec2/ec2_public_ipv4_pool_data_source.go index b3a46bd2eaed..4099b783dd87 100644 --- a/internal/service/ec2/ec2_public_ipv4_pool_data_source.go +++ b/internal/service/ec2/ec2_public_ipv4_pool_data_source.go @@ -15,7 +15,7 @@ import ( // @SDKDataSource("aws_ec2_public_ipv4_pool") func DataSourcePublicIPv4Pool() *schema.Resource { return &schema.Resource{ - ReadWithoutTimeout: dataSourcePublicIpv4PoolRead, + ReadWithoutTimeout: dataSourcePublicIPv4PoolRead, Schema: map[string]*schema.Schema{ "description": { @@ -67,7 +67,7 @@ func DataSourcePublicIPv4Pool() *schema.Resource { } } -func dataSourcePublicIpv4PoolRead(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { +func dataSourcePublicIPv4PoolRead(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { var diags diag.Diagnostics conn := meta.(*conns.AWSClient).EC2Conn() ignoreTagsConfig := meta.(*conns.AWSClient).IgnoreTagsConfig @@ -82,7 +82,7 @@ func dataSourcePublicIpv4PoolRead(ctx context.Context, d *schema.ResourceData, m d.SetId(poolID) d.Set("description", pool.Description) d.Set("network_border_group", pool.NetworkBorderGroup) - if err := d.Set("pool_address_ranges", flattenPublicIpv4PoolRanges(pool.PoolAddressRanges)); err != nil { + if err := d.Set("pool_address_ranges", flattenPublicIPv4PoolRanges(pool.PoolAddressRanges)); err != nil { return sdkdiag.AppendErrorf(diags, "setting pool_address_ranges: %s", err) } if err := d.Set("tags", KeyValueTags(ctx, pool.Tags).IgnoreAWS().IgnoreConfig(ignoreTagsConfig).Map()); err != nil { @@ -94,7 +94,7 @@ func dataSourcePublicIpv4PoolRead(ctx context.Context, d *schema.ResourceData, m return nil } -func flattenPublicIpv4PoolRange(apiObject *ec2.PublicIpv4PoolRange) map[string]interface{} { +func flattenPublicIPv4PoolRange(apiObject *ec2.PublicIpv4PoolRange) map[string]interface{} { if apiObject == nil { return nil } @@ -120,7 +120,7 @@ func flattenPublicIpv4PoolRange(apiObject *ec2.PublicIpv4PoolRange) map[string]i return tfMap } -func flattenPublicIpv4PoolRanges(apiObjects []*ec2.PublicIpv4PoolRange) []interface{} { +func flattenPublicIPv4PoolRanges(apiObjects []*ec2.PublicIpv4PoolRange) []interface{} { if len(apiObjects) == 0 { return nil } @@ -132,7 +132,7 @@ func flattenPublicIpv4PoolRanges(apiObjects []*ec2.PublicIpv4PoolRange) []interf continue } - tfList = append(tfList, flattenPublicIpv4PoolRange(apiObject)) + tfList = append(tfList, flattenPublicIPv4PoolRange(apiObject)) } return tfList diff --git a/internal/service/ec2/ec2_public_ipv4_pools_data_source.go b/internal/service/ec2/ec2_public_ipv4_pools_data_source.go index f5cf7cb8f65f..712f6adb2d36 100644 --- a/internal/service/ec2/ec2_public_ipv4_pools_data_source.go +++ b/internal/service/ec2/ec2_public_ipv4_pools_data_source.go @@ -15,7 +15,7 @@ import ( // @SDKDataSource("aws_ec2_public_ipv4_pools") func DataSourcePublicIPv4Pools() *schema.Resource { return &schema.Resource{ - ReadWithoutTimeout: dataSourcePublicIpv4PoolsRead, + ReadWithoutTimeout: dataSourcePublicIPv4PoolsRead, Schema: map[string]*schema.Schema{ "filter": DataSourceFiltersSchema(), @@ -29,7 +29,7 @@ func DataSourcePublicIPv4Pools() *schema.Resource { } } -func dataSourcePublicIpv4PoolsRead(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { +func dataSourcePublicIPv4PoolsRead(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics { var diags diag.Diagnostics conn := meta.(*conns.AWSClient).EC2Conn() From 5f8e886ebc0ccbb5cfcdd042ee5f3cb646223cd4 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Tue, 14 Mar 2023 08:55:21 -0400 Subject: [PATCH 754/763] Fix markdown-lint 'MD007/ul-indent Unordered list indentation [Expected: 4; Actual: 2]'. --- website/docs/d/ec2_public_ipv4_pool.html.markdown | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/website/docs/d/ec2_public_ipv4_pool.html.markdown b/website/docs/d/ec2_public_ipv4_pool.html.markdown index 09805cf1b5c5..f62cf07d828e 100644 --- a/website/docs/d/ec2_public_ipv4_pool.html.markdown +++ b/website/docs/d/ec2_public_ipv4_pool.html.markdown @@ -33,10 +33,10 @@ In addition to all arguments above, the following attributes are exported: * `description` - Description of the pool, if any. * `network_border_group` - Name of the location from which the address pool is advertised. * pool_address_ranges` - List of Address Ranges in the Pool; each address range record contains: - * `address_count` - Number of addresses in the range. - * `available_address_count` - Number of available addresses in the range. - * `first_address` - First address in the range. - * `last_address` - Last address in the range. + * `address_count` - Number of addresses in the range. + * `available_address_count` - Number of available addresses in the range. + * `first_address` - First address in the range. + * `last_address` - Last address in the range. * `tags` - Any tags for the address pool. * `total_address_count` - Total number of addresses in the pool. * `total_available_address_count` - Total number of available addresses in the pool. From ece0ecf56213468cdb6fcefac2cc42b93b86f569 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Tue, 14 Mar 2023 08:56:20 -0400 Subject: [PATCH 755/763] Fix markdown-lint 'MD031/blanks-around-fences Fenced code blocks should be surrounded by blank lines'. --- website/docs/d/ec2_public_ipv4_pools.html.markdown | 1 + 1 file changed, 1 insertion(+) diff --git a/website/docs/d/ec2_public_ipv4_pools.html.markdown b/website/docs/d/ec2_public_ipv4_pools.html.markdown index 1ba41450122b..409453dffce3 100644 --- a/website/docs/d/ec2_public_ipv4_pools.html.markdown +++ b/website/docs/d/ec2_public_ipv4_pools.html.markdown @@ -20,6 +20,7 @@ data "aws_ec2_public_ipv4_pools" "example" {} ``` ### Usage with Filter + ```terraform data "aws_ec2_public_ipv4_pools" "example" { filter { From 041d304137e71b520d3bf83ecd59cdd7ec169f2c Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Tue, 14 Mar 2023 09:15:42 -0400 Subject: [PATCH 756/763] Add CHANGELOG entry. --- .changelog/29867.txt | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 .changelog/29867.txt diff --git a/.changelog/29867.txt b/.changelog/29867.txt new file mode 100644 index 000000000000..a2a8f1c28f2c --- /dev/null +++ b/.changelog/29867.txt @@ -0,0 +1,7 @@ +```release-note:enhancement +resource/aws_opensearch_domain: Add `dashboard_endpoint` attribute +``` + +```release-note:enhancement +data-source/aws_opensearch_domain: Add `dashboard_endpoint` attribute +``` \ No newline at end of file From 2635c246e0d37ac1bf882ab6a33b8893cf7b3a2d Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Tue, 14 Mar 2023 09:23:44 -0400 Subject: [PATCH 757/763] Fix semgrep 'ci.caps5-in-const-name' and 'ci.caps5-in-var-name'. --- internal/service/ec2/errors.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/service/ec2/errors.go b/internal/service/ec2/errors.go index 6bc6924688f8..ef94bfc8167a 100644 --- a/internal/service/ec2/errors.go +++ b/internal/service/ec2/errors.go @@ -68,7 +68,7 @@ const ( errCodeInvalidPoolIDNotFound = "InvalidPoolID.NotFound" errCodeInvalidPrefixListIDNotFound = "InvalidPrefixListID.NotFound" errCodeInvalidPrefixListIdNotFound = "InvalidPrefixListId.NotFound" - errCodeInvalidPublicIpv4PoolIDNotFound = "InvalidPublicIpv4PoolID.NotFound" + errCodeInvalidPublicIpv4PoolIDNotFound = "InvalidPublicIpv4PoolID.NotFound" // nosemgrep:ci.caps5-in-const-name,ci.caps5-in-var-name errCodeInvalidRouteNotFound = "InvalidRoute.NotFound" errCodeInvalidRouteTableIDNotFound = "InvalidRouteTableID.NotFound" errCodeInvalidRouteTableIdNotFound = "InvalidRouteTableId.NotFound" From 99ec9b1e94dfb24589d4b7b07b400538afdc62fb Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Tue, 14 Mar 2023 09:29:39 -0400 Subject: [PATCH 758/763] OpenSearch Domain: Restore 'kibana_endpoint' attribute until it can be deprecated in a major version. --- internal/service/opensearch/domain.go | 12 +++++++++++- internal/service/opensearch/domain_data_source.go | 13 ++++++++++--- internal/service/opensearch/domain_test.go | 5 +++-- website/docs/d/opensearch_domain.html.markdown | 3 ++- website/docs/r/opensearch_domain.html.markdown | 1 + 5 files changed, 27 insertions(+), 7 deletions(-) diff --git a/internal/service/opensearch/domain.go b/internal/service/opensearch/domain.go index eae5c3076875..490707e6acc2 100644 --- a/internal/service/opensearch/domain.go +++ b/internal/service/opensearch/domain.go @@ -335,6 +335,10 @@ func ResourceDomain() *schema.Resource { }, }, }, + "dashboard_endpoint": { + Type: schema.TypeString, + Computed: true, + }, "domain_endpoint_options": { Type: schema.TypeList, Optional: true, @@ -449,7 +453,7 @@ func ResourceDomain() *schema.Resource { Optional: true, Default: "OpenSearch_1.1", }, - "dashboard_endpoint": { + "kibana_endpoint": { Type: schema.TypeString, Computed: true, }, @@ -849,6 +853,7 @@ func resourceDomainRead(ctx context.Context, d *schema.ResourceData, meta interf endpoints := flex.PointersMapToStringList(ds.Endpoints) d.Set("endpoint", endpoints["vpc"]) d.Set("dashboard_endpoint", getDashboardEndpoint(d)) + d.Set("kibana_endpoint", getKibanaEndpoint(d)) if ds.Endpoint != nil { return sdkdiag.AppendErrorf(diags, "%q: OpenSearch domain in VPC expected to have null Endpoint value", d.Id()) } @@ -856,6 +861,7 @@ func resourceDomainRead(ctx context.Context, d *schema.ResourceData, meta interf if ds.Endpoint != nil { d.Set("endpoint", ds.Endpoint) d.Set("dashboard_endpoint", getDashboardEndpoint(d)) + d.Set("kibana_endpoint", getKibanaEndpoint(d)) } if ds.Endpoints != nil { return sdkdiag.AppendErrorf(diags, "%q: OpenSearch domain not in VPC expected to have null Endpoints value", d.Id()) @@ -1101,6 +1107,10 @@ func getDashboardEndpoint(d *schema.ResourceData) string { return d.Get("endpoint").(string) + "/_dashboards" } +func getKibanaEndpoint(d *schema.ResourceData) string { + return d.Get("endpoint").(string) + "/_plugin/kibana/" +} + func isDedicatedMasterDisabled(k, old, new string, d *schema.ResourceData) bool { v, ok := d.GetOk("cluster_config") if ok { diff --git a/internal/service/opensearch/domain_data_source.go b/internal/service/opensearch/domain_data_source.go index 56e277d19e74..030119a7874e 100644 --- a/internal/service/opensearch/domain_data_source.go +++ b/internal/service/opensearch/domain_data_source.go @@ -101,15 +101,15 @@ func DataSourceDomain() *schema.Resource { Type: schema.TypeString, Computed: true, }, - "domain_id": { + "dashboard_endpoint": { Type: schema.TypeString, Computed: true, }, - "endpoint": { + "domain_id": { Type: schema.TypeString, Computed: true, }, - "dashboard_endpoint": { + "endpoint": { Type: schema.TypeString, Computed: true, }, @@ -157,6 +157,10 @@ func DataSourceDomain() *schema.Resource { }, }, }, + "kibana_endpoint": { + Type: schema.TypeString, + Computed: true, + }, "node_to_node_encryption": { Type: schema.TypeList, Computed: true, @@ -387,6 +391,7 @@ func dataSourceDomainRead(ctx context.Context, d *schema.ResourceData, meta inte d.Set("domain_id", ds.DomainId) d.Set("endpoint", ds.Endpoint) d.Set("dashboard_endpoint", getDashboardEndpoint(d)) + d.Set("kibana_endpoint", getKibanaEndpoint(d)) if err := d.Set("advanced_security_options", flattenAdvancedSecurityOptions(ds.AdvancedSecurityOptions)); err != nil { return sdkdiag.AppendErrorf(diags, "setting advanced_security_options: %s", err) @@ -428,6 +433,7 @@ func dataSourceDomainRead(ctx context.Context, d *schema.ResourceData, meta inte return sdkdiag.AppendErrorf(diags, "setting endpoint: %s", err) } d.Set("dashboard_endpoint", getDashboardEndpoint(d)) + d.Set("kibana_endpoint", getKibanaEndpoint(d)) if ds.Endpoint != nil { return sdkdiag.AppendErrorf(diags, "%q: OpenSearch domain in VPC expected to have null Endpoint value", d.Id()) } @@ -435,6 +441,7 @@ func dataSourceDomainRead(ctx context.Context, d *schema.ResourceData, meta inte if ds.Endpoint != nil { d.Set("endpoint", ds.Endpoint) d.Set("dashboard_endpoint", getDashboardEndpoint(d)) + d.Set("kibana_endpoint", getKibanaEndpoint(d)) } if ds.Endpoints != nil { return sdkdiag.AppendErrorf(diags, "%q: OpenSearch domain not in VPC expected to have null Endpoints value", d.Id()) diff --git a/internal/service/opensearch/domain_test.go b/internal/service/opensearch/domain_test.go index 4f668fc3f1ed..d32062ce04ef 100644 --- a/internal/service/opensearch/domain_test.go +++ b/internal/service/opensearch/domain_test.go @@ -149,10 +149,11 @@ func TestAccOpenSearchDomain_basic(t *testing.T) { Config: testAccDomainConfig_basic(rName), Check: resource.ComposeTestCheckFunc( testAccCheckDomainExists(ctx, resourceName, &domain), - resource.TestCheckResourceAttr(resourceName, "engine_version", "OpenSearch_1.1"), resource.TestMatchResourceAttr(resourceName, "dashboard_endpoint", regexp.MustCompile(`.*(opensearch|es)\..*/_dashboards`)), - resource.TestCheckResourceAttr(resourceName, "vpc_options.#", "0"), + resource.TestCheckResourceAttr(resourceName, "engine_version", "OpenSearch_1.1"), + resource.TestMatchResourceAttr(resourceName, "kibana_endpoint", regexp.MustCompile(`.*(opensearch|es)\..*/_plugin/kibana/`)), resource.TestCheckResourceAttr(resourceName, "tags.%", "0"), + resource.TestCheckResourceAttr(resourceName, "vpc_options.#", "0"), ), }, { diff --git a/website/docs/d/opensearch_domain.html.markdown b/website/docs/d/opensearch_domain.html.markdown index 6d61b5f906cb..66c7b0b7ceef 100644 --- a/website/docs/d/opensearch_domain.html.markdown +++ b/website/docs/d/opensearch_domain.html.markdown @@ -76,7 +76,8 @@ The following attributes are exported: * `enabled` - Whether encryption at rest is enabled in the domain. * `kms_key_id` - KMS key id used to encrypt data at rest. * `endpoint` – Domain-specific endpoint used to submit index, search, and data upload requests. -* `dashboard_endpoint` - Domain-specific endpoint used to access the Dashboard application. +* `dashboard_endpoint` - Domain-specific endpoint used to access the [Dashboard application](https://docs.aws.amazon.com/opensearch-service/latest/developerguide/dashboards.html). +* `kibana_endpoint` - Domain-specific endpoint used to access the Kibana application. OpenSearch Dashboards do not use Kibana, so this attribute will be **DEPRECATED** in a future version. * `log_publishing_options` - Domain log publishing related options. * `log_type` - Type of OpenSearch log being published. * `cloudwatch_log_group_arn` - CloudWatch Log Group where the logs are published. diff --git a/website/docs/r/opensearch_domain.html.markdown b/website/docs/r/opensearch_domain.html.markdown index 61f4f0bac271..bb0b459e06e5 100644 --- a/website/docs/r/opensearch_domain.html.markdown +++ b/website/docs/r/opensearch_domain.html.markdown @@ -453,6 +453,7 @@ In addition to all arguments above, the following attributes are exported: * `domain_name` - Name of the OpenSearch domain. * `endpoint` - Domain-specific endpoint used to submit index, search, and data upload requests. * `dashboard_endpoint` - Domain-specific endpoint for Dashboard without https scheme. +* `kibana_endpoint` - Domain-specific endpoint for kibana without https scheme. OpenSearch Dashboards do not use Kibana, so this attribute will be **DEPRECATED** in a future version. * `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). * `vpc_options.0.availability_zones` - If the domain was created inside a VPC, the names of the availability zones the configured `subnet_ids` were created inside. * `vpc_options.0.vpc_id` - If the domain was created inside a VPC, the ID of the VPC. From 9d7a4532c955232c918ab96d52d29f9546ba32fd Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Tue, 14 Mar 2023 09:41:35 -0400 Subject: [PATCH 759/763] Add prefix for EC2 Public IPv4 Pools. --- .github/labeler-issue-triage.yml | 2 +- .github/labeler-pr-triage.yml | 1 + names/names_data.csv | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/labeler-issue-triage.yml b/.github/labeler-issue-triage.yml index 30c412c73bb6..5d9d2cfaa5e4 100644 --- a/.github/labeler-issue-triage.yml +++ b/.github/labeler-issue-triage.yml @@ -206,7 +206,7 @@ service/dynamodbstreams: service/ebs: - '((\*|-)\s*`?|(data|resource)\s+"?)aws_ebs_' service/ec2: - - '((\*|-)\s*`?|(data|resource)\s+"?)aws_(ami|availability_zone|ec2_(availability|capacity|fleet|host|instance|serial|spot|tag)|eip|instance|key_pair|launch_template|placement_group|spot)' + - '((\*|-)\s*`?|(data|resource)\s+"?)aws_(ami|availability_zone|ec2_(availability|capacity|fleet|host|instance|public_ipv4_pool|serial|spot|tag)|eip|instance|key_pair|launch_template|placement_group|spot)' service/ec2ebs: - '((\*|-)\s*`?|(data|resource)\s+"?)aws_(ebs_|volume_attach|snapshot_create)' service/ec2instanceconnect: diff --git a/.github/labeler-pr-triage.yml b/.github/labeler-pr-triage.yml index 3f64aaf3729a..9d842fb7884c 100644 --- a/.github/labeler-pr-triage.yml +++ b/.github/labeler-pr-triage.yml @@ -346,6 +346,7 @@ service/ec2: - 'website/**/ec2_fleet*' - 'website/**/ec2_host*' - 'website/**/ec2_instance_*' + - 'website/**/ec2_public_ipv4_pool*' - 'website/**/ec2_serial_*' - 'website/**/ec2_spot_*' - 'website/**/ec2_tag*' diff --git a/names/names_data.csv b/names/names_data.csv index 8da7cbcbb075..ef2b193f3d9b 100644 --- a/names/names_data.csv +++ b/names/names_data.csv @@ -117,7 +117,7 @@ dax,dax,dax,dax,,dax,,,DAX,DAX,,1,,,aws_dax_,,dax_,DynamoDB Accelerator (DAX),Am dynamodbstreams,dynamodbstreams,dynamodbstreams,dynamodbstreams,,dynamodbstreams,,,DynamoDBStreams,DynamoDBStreams,,1,,,aws_dynamodbstreams_,,dynamodbstreams_,DynamoDB Streams,Amazon,,,,, ,,,,,ec2ebs,ec2,,EC2EBS,,,,,aws_(ebs_|volume_attach|snapshot_create),aws_ec2ebs_,ebs_,ebs_;volume_attachment;snapshot_,EBS (EC2),Amazon,x,x,,,Part of EC2 ebs,ebs,ebs,ebs,,ebs,,,EBS,EBS,,1,,,aws_ebs_,,changewhenimplemented,EBS (Elastic Block Store),Amazon,,,,, -ec2,ec2,ec2,ec2,,ec2,ec2,,EC2,EC2,,1,2,aws_(ami|availability_zone|ec2_(availability|capacity|fleet|host|instance|serial|spot|tag)|eip|instance|key_pair|launch_template|placement_group|spot),aws_ec2_,ec2_,ami;availability_zone;ec2_availability_;ec2_capacity_;ec2_fleet;ec2_host;ec2_instance_;ec2_serial_;ec2_spot_;ec2_tag;eip;instance;key_pair;launch_template;placement_group;spot_,EC2 (Elastic Compute Cloud),Amazon,,,,, +ec2,ec2,ec2,ec2,,ec2,ec2,,EC2,EC2,,1,2,aws_(ami|availability_zone|ec2_(availability|capacity|fleet|host|instance|public_ipv4_pool|serial|spot|tag)|eip|instance|key_pair|launch_template|placement_group|spot),aws_ec2_,ec2_,ami;availability_zone;ec2_availability_;ec2_capacity_;ec2_fleet;ec2_host;ec2_instance_;ec2_public_ipv4_pool;ec2_serial_;ec2_spot_;ec2_tag;eip;instance;key_pair;launch_template;placement_group;spot_,EC2 (Elastic Compute Cloud),Amazon,,,,, imagebuilder,imagebuilder,imagebuilder,imagebuilder,,imagebuilder,,,ImageBuilder,Imagebuilder,,1,,,aws_imagebuilder_,,imagebuilder_,EC2 Image Builder,Amazon,,,,, ec2-instance-connect,ec2instanceconnect,ec2instanceconnect,ec2instanceconnect,,ec2instanceconnect,,,EC2InstanceConnect,EC2InstanceConnect,,1,,,aws_ec2instanceconnect_,,ec2instanceconnect_,EC2 Instance Connect,AWS,,,,, ecr,ecr,ecr,ecr,,ecr,,,ECR,ECR,,1,,,aws_ecr_,,ecr_,ECR (Elastic Container Registry),Amazon,,,,, From 22087cf838af6c175eb232807954be7ceb0c87d2 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Tue, 14 Mar 2023 09:54:06 -0400 Subject: [PATCH 760/763] r/aws_alb_target_group: Alphabetize attributes. --- internal/service/elbv2/target_group.go | 40 +++++++++++++------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/internal/service/elbv2/target_group.go b/internal/service/elbv2/target_group.go index 68f20cf2388d..8e4983ed66c0 100644 --- a/internal/service/elbv2/target_group.go +++ b/internal/service/elbv2/target_group.go @@ -33,12 +33,6 @@ const ( // @SDKResource("aws_lb_target_group") func ResourceTargetGroup() *schema.Resource { return &schema.Resource{ - // NLBs have restrictions on them at this time - CustomizeDiff: customdiff.Sequence( - resourceTargetGroupCustomizeDiff, - verify.SetTagsDiff, - ), - CreateWithoutTimeout: resourceTargetGroupCreate, ReadWithoutTimeout: resourceTargetGroupRead, UpdateWithoutTimeout: resourceTargetGroupUpdate, @@ -48,6 +42,12 @@ func ResourceTargetGroup() *schema.Resource { StateContext: schema.ImportStatePassthroughContext, }, + // NLBs have restrictions on them at this time + CustomizeDiff: customdiff.Sequence( + resourceTargetGroupCustomizeDiff, + verify.SetTagsDiff, + ), + Schema: map[string]*schema.Schema{ "arn": { Type: schema.TypeString, @@ -57,6 +57,11 @@ func ResourceTargetGroup() *schema.Resource { Type: schema.TypeString, Computed: true, }, + "connection_termination": { + Type: schema.TypeBool, + Optional: true, + Default: false, + }, "deregistration_delay": { Type: nullable.TypeNullableInt, Optional: true, @@ -133,6 +138,13 @@ func ResourceTargetGroup() *schema.Resource { }, }, }, + "ip_address_type": { + Type: schema.TypeString, + Optional: true, + Computed: true, + ForceNew: true, + ValidateFunc: validation.StringInSlice(elbv2.TargetGroupIpAddressTypeEnum_Values(), false), + }, "lambda_multi_value_headers_enabled": { Type: schema.TypeBool, Optional: true, @@ -220,11 +232,6 @@ func ResourceTargetGroup() *schema.Resource { Optional: true, Default: false, }, - "connection_termination": { - Type: schema.TypeBool, - Optional: true, - Default: false, - }, "slow_start": { Type: schema.TypeInt, Optional: true, @@ -274,13 +281,8 @@ func ResourceTargetGroup() *schema.Resource { }, }, }, - "ip_address_type": { - Type: schema.TypeString, - Optional: true, - Computed: true, - ForceNew: true, - ValidateFunc: validation.StringInSlice(elbv2.TargetGroupIpAddressTypeEnum_Values(), false), - }, + "tags": tftags.TagsSchema(), + "tags_all": tftags.TagsSchemaComputed(), "target_failover": { Type: schema.TypeList, Optional: true, @@ -313,8 +315,6 @@ func ResourceTargetGroup() *schema.Resource { ForceNew: true, ValidateFunc: validation.StringInSlice(elbv2.TargetTypeEnum_Values(), false), }, - "tags": tftags.TagsSchema(), - "tags_all": tftags.TagsSchemaComputed(), "vpc_id": { Type: schema.TypeString, Optional: true, From 97807539a42f005fe6253ea0bb51248f6bcd5dd5 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Tue, 14 Mar 2023 09:59:21 -0400 Subject: [PATCH 761/763] r/aws_alb_target_group: Document 'load_balancing_cross_zone_enabled'. --- website/docs/r/lb_target_group.html.markdown | 1 + 1 file changed, 1 insertion(+) diff --git a/website/docs/r/lb_target_group.html.markdown b/website/docs/r/lb_target_group.html.markdown index ce2e26fae901..e94e1886f276 100644 --- a/website/docs/r/lb_target_group.html.markdown +++ b/website/docs/r/lb_target_group.html.markdown @@ -75,6 +75,7 @@ The following arguments are supported: * `health_check` - (Optional, Maximum of 1) Health Check configuration block. Detailed below. * `lambda_multi_value_headers_enabled` - (Optional) Whether the request and response headers exchanged between the load balancer and the Lambda function include arrays of values or strings. Only applies when `target_type` is `lambda`. Default is `false`. * `load_balancing_algorithm_type` - (Optional) Determines how the load balancer selects targets when routing requests. Only applicable for Application Load Balancer Target Groups. The value is `round_robin` or `least_outstanding_requests`. The default is `round_robin`. +* `load_balancing_cross_zone_enabled` - (Optional) Indicates whether cross zone load balancing is enabled. The value is `"true"`, `"false"` or `"use_load_balancer_configuration"`. The default is `"use_load_balancer_configuration"`. * `name_prefix` - (Optional, Forces new resource) Creates a unique name beginning with the specified prefix. Conflicts with `name`. Cannot be longer than 6 characters. * `name` - (Optional, Forces new resource) Name of the target group. If omitted, Terraform will assign a random, unique name. This name must be unique per region per account, can have a maximum of 32 characters, must contain only alphanumeric characters or hyphens, and must not begin or end with a hyphen. * `port` - (May be required, Forces new resource) Port on which targets receive traffic, unless overridden when registering a specific target. Required when `target_type` is `instance`, `ip` or `alb`. Does not apply when `target_type` is `lambda`. From d7289174bed4c231715f1892651bb13ee86ad718 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Tue, 14 Mar 2023 11:18:29 -0400 Subject: [PATCH 762/763] d/aws_alb_target_group: Alphabetize attributes. --- internal/service/elbv2/target_group_data_source.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/service/elbv2/target_group_data_source.go b/internal/service/elbv2/target_group_data_source.go index c5c07a321d04..a011be85096d 100644 --- a/internal/service/elbv2/target_group_data_source.go +++ b/internal/service/elbv2/target_group_data_source.go @@ -154,11 +154,11 @@ func DataSourceTargetGroup() *schema.Resource { }, }, }, + "tags": tftags.TagsSchemaComputed(), "target_type": { Type: schema.TypeString, Computed: true, }, - "tags": tftags.TagsSchemaComputed(), "vpc_id": { Type: schema.TypeString, Computed: true, From 26940ab92f574c8231b255a22aea598cd8e54d47 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Tue, 14 Mar 2023 11:25:38 -0400 Subject: [PATCH 763/763] r/aws_alb_target_group: Tidy up acceptance tests. --- internal/service/elbv2/target_group_test.go | 162 ++++++++++---------- 1 file changed, 81 insertions(+), 81 deletions(-) diff --git a/internal/service/elbv2/target_group_test.go b/internal/service/elbv2/target_group_test.go index 03bdf7889fb0..16ce952fd045 100644 --- a/internal/service/elbv2/target_group_test.go +++ b/internal/service/elbv2/target_group_test.go @@ -1364,7 +1364,7 @@ func TestAccELBV2TargetGroup_tags(t *testing.T) { func TestAccELBV2TargetGroup_Stickiness_updateAppEnabled(t *testing.T) { ctx := acctest.Context(t) var conf elbv2.TargetGroup - targetGroupName := fmt.Sprintf("test-target-group-%s", sdkacctest.RandString(10)) + rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resourceName := "aws_lb_target_group.test" resource.ParallelTest(t, resource.TestCase{ @@ -1374,11 +1374,11 @@ func TestAccELBV2TargetGroup_Stickiness_updateAppEnabled(t *testing.T) { CheckDestroy: testAccCheckTargetGroupDestroy(ctx), Steps: []resource.TestStep{ { - Config: testAccTargetGroupConfig_appStickiness(targetGroupName, false, false), + Config: testAccTargetGroupConfig_appStickiness(rName, false, false), Check: resource.ComposeAggregateTestCheckFunc( testAccCheckTargetGroupExists(ctx, resourceName, &conf), resource.TestCheckResourceAttrSet(resourceName, "arn"), - resource.TestCheckResourceAttr(resourceName, "name", targetGroupName), + resource.TestCheckResourceAttr(resourceName, "name", rName), resource.TestCheckResourceAttr(resourceName, "port", "443"), resource.TestCheckResourceAttr(resourceName, "protocol", "HTTPS"), resource.TestCheckResourceAttrSet(resourceName, "vpc_id"), @@ -1395,11 +1395,11 @@ func TestAccELBV2TargetGroup_Stickiness_updateAppEnabled(t *testing.T) { ), }, { - Config: testAccTargetGroupConfig_appStickiness(targetGroupName, true, true), + Config: testAccTargetGroupConfig_appStickiness(rName, true, true), Check: resource.ComposeAggregateTestCheckFunc( testAccCheckTargetGroupExists(ctx, resourceName, &conf), resource.TestCheckResourceAttrSet(resourceName, "arn"), - resource.TestCheckResourceAttr(resourceName, "name", targetGroupName), + resource.TestCheckResourceAttr(resourceName, "name", rName), resource.TestCheckResourceAttr(resourceName, "port", "443"), resource.TestCheckResourceAttr(resourceName, "protocol", "HTTPS"), resource.TestCheckResourceAttrSet(resourceName, "vpc_id"), @@ -1421,11 +1421,11 @@ func TestAccELBV2TargetGroup_Stickiness_updateAppEnabled(t *testing.T) { ), }, { - Config: testAccTargetGroupConfig_appStickiness(targetGroupName, true, false), + Config: testAccTargetGroupConfig_appStickiness(rName, true, false), Check: resource.ComposeAggregateTestCheckFunc( testAccCheckTargetGroupExists(ctx, resourceName, &conf), resource.TestCheckResourceAttrSet(resourceName, "arn"), - resource.TestCheckResourceAttr(resourceName, "name", targetGroupName), + resource.TestCheckResourceAttr(resourceName, "name", rName), resource.TestCheckResourceAttr(resourceName, "port", "443"), resource.TestCheckResourceAttr(resourceName, "protocol", "HTTPS"), resource.TestCheckResourceAttrSet(resourceName, "vpc_id"), @@ -2279,6 +2279,77 @@ func TestAccELBV2TargetGroup_Name_noDuplicates(t *testing.T) { }) } +func testAccCheckTargetGroupDestroy(ctx context.Context) resource.TestCheckFunc { + return func(s *terraform.State) error { + conn := acctest.Provider.Meta().(*conns.AWSClient).ELBV2Conn() + + for _, rs := range s.RootModule().Resources { + if rs.Type != "aws_lb_target_group" && rs.Type != "aws_alb_target_group" { + continue + } + + _, err := tfelbv2.FindTargetGroupByARN(ctx, conn, rs.Primary.ID) + + if tfresource.NotFound(err) { + continue + } + + if err != nil { + return err + } + + return fmt.Errorf("ELBv2 Target Group %s still exists", rs.Primary.ID) + } + + return nil + } +} + +func testAccCheckTargetGroupExists(ctx context.Context, n string, v *elbv2.TargetGroup) 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 errors.New("No ELBv2 Target Group ID is set") + } + + conn := acctest.Provider.Meta().(*conns.AWSClient).ELBV2Conn() + + output, err := tfelbv2.FindTargetGroupByARN(ctx, conn, rs.Primary.ID) + + if err != nil { + return err + } + + *v = *output + + return nil + } +} + +func testAccCheckTargetGroupNotRecreated(i, j *elbv2.TargetGroup) resource.TestCheckFunc { + return func(s *terraform.State) error { + if aws.StringValue(i.TargetGroupArn) != aws.StringValue(j.TargetGroupArn) { + return errors.New("ELBv2 Target Group was recreated") + } + + return nil + } +} + +func testAccCheckTargetGroupRecreated(i, j *elbv2.TargetGroup) resource.TestCheckFunc { + return func(s *terraform.State) error { + if aws.StringValue(i.TargetGroupArn) == aws.StringValue(j.TargetGroupArn) { + return errors.New("ELBv2 Target Group was not recreated") + } + + return nil + } +} + func testAccTargetGroupConfig_albDefaults(rName string) string { return fmt.Sprintf(` resource "aws_lb_target_group" "test" { @@ -2685,7 +2756,7 @@ resource "aws_lb_target_group" "test" { `, rName) } -func testAccTargetGroupConfig_appStickiness(targetGroupName string, addAppStickinessBlock bool, enabled bool) string { +func testAccTargetGroupConfig_appStickiness(rName string, addAppStickinessBlock bool, enabled bool) string { var appSstickinessBlock string if addAppStickinessBlock { @@ -2726,10 +2797,10 @@ resource "aws_vpc" "test" { cidr_block = "10.0.0.0/16" tags = { - Name = "terraform-testacc-lb-target-group-stickiness" + Name = %[1]q } } -`, targetGroupName, appSstickinessBlock) +`, rName, appSstickinessBlock) } func testAccTargetGroupConfig_basic(rName string, deregDelay int) string { @@ -3344,77 +3415,6 @@ resource "aws_lb_target_group" "test" { `, rName) } -func testAccCheckTargetGroupDestroy(ctx context.Context) resource.TestCheckFunc { - return func(s *terraform.State) error { - conn := acctest.Provider.Meta().(*conns.AWSClient).ELBV2Conn() - - for _, rs := range s.RootModule().Resources { - if rs.Type != "aws_lb_target_group" && rs.Type != "aws_alb_target_group" { - continue - } - - _, err := tfelbv2.FindTargetGroupByARN(ctx, conn, rs.Primary.ID) - - if tfresource.NotFound(err) { - continue - } - - if err != nil { - return err - } - - return fmt.Errorf("ELBv2 Target Group %s still exists", rs.Primary.ID) - } - - return nil - } -} - -func testAccCheckTargetGroupExists(ctx context.Context, n string, v *elbv2.TargetGroup) 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 errors.New("No ELBv2 Target Group ID is set") - } - - conn := acctest.Provider.Meta().(*conns.AWSClient).ELBV2Conn() - - output, err := tfelbv2.FindTargetGroupByARN(ctx, conn, rs.Primary.ID) - - if err != nil { - return err - } - - *v = *output - - return nil - } -} - -func testAccCheckTargetGroupNotRecreated(i, j *elbv2.TargetGroup) resource.TestCheckFunc { - return func(s *terraform.State) error { - if aws.StringValue(i.TargetGroupArn) != aws.StringValue(j.TargetGroupArn) { - return errors.New("ELBv2 Target Group was recreated") - } - - return nil - } -} - -func testAccCheckTargetGroupRecreated(i, j *elbv2.TargetGroup) resource.TestCheckFunc { - return func(s *terraform.State) error { - if aws.StringValue(i.TargetGroupArn) == aws.StringValue(j.TargetGroupArn) { - return errors.New("ELBv2 Target Group was not recreated") - } - - return nil - } -} - func testAccTargetGroupConfig_nlbDefaults(rName, healthCheckBlock string) string { return fmt.Sprintf(` resource "aws_lb_target_group" "test" {